| Line 8... |
Line 8... |
| 8 |
import com.spice.profitmandi.common.util.*;
|
8 |
import com.spice.profitmandi.common.util.*;
|
| 9 |
import com.spice.profitmandi.dao.entity.dtr.CreditAccount;
|
9 |
import com.spice.profitmandi.dao.entity.dtr.CreditAccount;
|
| 10 |
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
|
10 |
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
|
| 11 |
import com.spice.profitmandi.dao.entity.transaction.*;
|
11 |
import com.spice.profitmandi.dao.entity.transaction.*;
|
| 12 |
import com.spice.profitmandi.dao.enumuration.transaction.AddWalletRequestStatus;
|
12 |
import com.spice.profitmandi.dao.enumuration.transaction.AddWalletRequestStatus;
|
| 13 |
import com.spice.profitmandi.dao.enumuration.transaction.LoanReferenceType;
|
- |
|
| 14 |
import com.spice.profitmandi.dao.enumuration.transaction.LoanSummaryType;
|
- |
|
| 15 |
import com.spice.profitmandi.dao.enumuration.transaction.TransactionType;
|
13 |
import com.spice.profitmandi.dao.enumuration.transaction.TransactionType;
|
| 16 |
import com.spice.profitmandi.dao.model.SDCreditResponseOut;
|
- |
|
| 17 |
import com.spice.profitmandi.dao.repository.catalog.AddWalletRequestRepository;
|
14 |
import com.spice.profitmandi.dao.repository.catalog.AddWalletRequestRepository;
|
| 18 |
import com.spice.profitmandi.dao.repository.catalog.ManualPaymentRequestRepository;
|
15 |
import com.spice.profitmandi.dao.repository.catalog.ManualPaymentRequestRepository;
|
| 19 |
import com.spice.profitmandi.dao.repository.catalog.UnsettledPaymentsRepository;
|
16 |
import com.spice.profitmandi.dao.repository.catalog.UnsettledPaymentsRepository;
|
| 20 |
import com.spice.profitmandi.dao.repository.dtr.CreditAccountRepository;
|
17 |
import com.spice.profitmandi.dao.repository.dtr.CreditAccountRepository;
|
| 21 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
18 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
| Line 61... |
Line 58... |
| 61 |
import java.math.BigDecimal;
|
58 |
import java.math.BigDecimal;
|
| 62 |
import java.text.MessageFormat;
|
59 |
import java.text.MessageFormat;
|
| 63 |
import java.time.LocalDate;
|
60 |
import java.time.LocalDate;
|
| 64 |
import java.time.LocalDateTime;
|
61 |
import java.time.LocalDateTime;
|
| 65 |
import java.time.ZoneId;
|
62 |
import java.time.ZoneId;
|
| 66 |
import java.time.temporal.ChronoUnit;
|
- |
|
| 67 |
import java.util.*;
|
63 |
import java.util.*;
|
| 68 |
import java.util.stream.Collectors;
|
64 |
import java.util.stream.Collectors;
|
| 69 |
|
65 |
|
| 70 |
@Controller
|
66 |
@Controller
|
| 71 |
@Transactional(rollbackOn = Throwable.class)
|
67 |
@Transactional(rollbackOn = Throwable.class)
|
| Line 88... |
Line 84... |
| 88 |
private static final int RECHARGE = 16;
|
84 |
private static final int RECHARGE = 16;
|
| 89 |
private static final int REFUND = 17;
|
85 |
private static final int REFUND = 17;
|
| 90 |
private static final int SCHEME_IN = 18;
|
86 |
private static final int SCHEME_IN = 18;
|
| 91 |
private static final int SCHEME_OUT = 19;
|
87 |
private static final int SCHEME_OUT = 19;
|
| 92 |
private static final Map<WalletReferenceType, Integer> walletReferenceMap = new HashMap<>();
|
88 |
private static final Map<WalletReferenceType, Integer> walletReferenceMap = new HashMap<>();
|
| - |
|
89 |
private static final int GRAND_TOTAL = 20;
|
| - |
|
90 |
private static final int CLOSING_BALANCE = 22;
|
| - |
|
91 |
private static final int PENDING_GRN = 23;
|
| - |
|
92 |
private static final int ACTIVATED_IMEIS = 24;
|
| - |
|
93 |
private static final Logger LOGGER = LogManager.getLogger(WalletController.class);
|
| 93 |
|
94 |
|
| 94 |
static {
|
95 |
static {
|
| 95 |
walletReferenceMap.put(WalletReferenceType.ACTIVATION_SCHEME, ACTIVATION_SCHEME);
|
96 |
walletReferenceMap.put(WalletReferenceType.ACTIVATION_SCHEME, ACTIVATION_SCHEME);
|
| 96 |
walletReferenceMap.put(WalletReferenceType.ADVANCE_AMOUNT, ADVANCE_AMOUNT);
|
97 |
walletReferenceMap.put(WalletReferenceType.ADVANCE_AMOUNT, ADVANCE_AMOUNT);
|
| 97 |
walletReferenceMap.put(WalletReferenceType.AUTOMATED_ADVANCE, AUTOMATED_ADVANCE);
|
98 |
walletReferenceMap.put(WalletReferenceType.AUTOMATED_ADVANCE, AUTOMATED_ADVANCE);
|
| Line 106... |
Line 107... |
| 106 |
walletReferenceMap.put(WalletReferenceType.SCHEME_IN, SCHEME_IN);
|
107 |
walletReferenceMap.put(WalletReferenceType.SCHEME_IN, SCHEME_IN);
|
| 107 |
walletReferenceMap.put(WalletReferenceType.SCHEME_OUT, SCHEME_OUT);
|
108 |
walletReferenceMap.put(WalletReferenceType.SCHEME_OUT, SCHEME_OUT);
|
| 108 |
|
109 |
|
| 109 |
}
|
110 |
}
|
| 110 |
|
111 |
|
| - |
|
112 |
@Autowired
|
| 111 |
private static final int GRAND_TOTAL = 20;
|
113 |
JavaMailSender mailSender;
|
| 112 |
|
114 |
@Autowired
|
| 113 |
private static final int CLOSING_BALANCE = 22;
|
115 |
AddWalletRequestRepository addWalletRequestRepository;
|
| 114 |
private static final int PENDING_GRN = 23;
|
116 |
@Autowired
|
| 115 |
private static final int ACTIVATED_IMEIS = 24;
|
117 |
TransactionService transactionService;
|
| 116 |
|
- |
|
| 117 |
@Autowired
|
118 |
@Autowired
|
| 118 |
private CookiesProcessor cookiesProcessor;
|
119 |
private CookiesProcessor cookiesProcessor;
|
| 119 |
|
- |
|
| 120 |
@Autowired
|
120 |
@Autowired
|
| 121 |
private WalletService walletService;
|
121 |
private WalletService walletService;
|
| 122 |
|
- |
|
| 123 |
@Autowired
|
122 |
@Autowired
|
| 124 |
private UserWalletRepository userWalletRepository;
|
123 |
private UserWalletRepository userWalletRepository;
|
| 125 |
|
- |
|
| 126 |
@Autowired
|
124 |
@Autowired
|
| 127 |
private UserWalletHistoryRepository userWalletHistoryRepository;
|
125 |
private UserWalletHistoryRepository userWalletHistoryRepository;
|
| 128 |
|
- |
|
| 129 |
@Autowired
|
126 |
@Autowired
|
| 130 |
private MVCResponseSender mvcResponseSender;
|
127 |
private MVCResponseSender mvcResponseSender;
|
| 131 |
|
- |
|
| 132 |
@Autowired
|
128 |
@Autowired
|
| 133 |
private UserAccountRepository userAccountRepository;
|
129 |
private UserAccountRepository userAccountRepository;
|
| 134 |
|
- |
|
| 135 |
@Autowired
|
130 |
@Autowired
|
| 136 |
private OrderRepository orderRepository;
|
131 |
private OrderRepository orderRepository;
|
| 137 |
|
- |
|
| 138 |
@Autowired
|
- |
|
| 139 |
JavaMailSender mailSender;
|
- |
|
| 140 |
|
- |
|
| 141 |
@Autowired
|
132 |
@Autowired
|
| 142 |
private UnsettledPaymentsRepository unsettledPaymentsRepository;
|
133 |
private UnsettledPaymentsRepository unsettledPaymentsRepository;
|
| 143 |
|
- |
|
| 144 |
@Autowired
|
134 |
@Autowired
|
| 145 |
private RetailerService retailerService;
|
135 |
private RetailerService retailerService;
|
| 146 |
|
- |
|
| 147 |
@Autowired
|
136 |
@Autowired
|
| 148 |
private RoleManager roleManager;
|
137 |
private RoleManager roleManager;
|
| 149 |
|
- |
|
| 150 |
@Autowired
|
138 |
@Autowired
|
| 151 |
private FofoStoreRepository fofoStoreRepository;
|
139 |
private FofoStoreRepository fofoStoreRepository;
|
| 152 |
|
- |
|
| 153 |
@Autowired
|
140 |
@Autowired
|
| 154 |
private ManualPaymentRequestRepository manualPaymentRequestRepository;
|
141 |
private ManualPaymentRequestRepository manualPaymentRequestRepository;
|
| 155 |
|
142 |
|
| 156 |
@Autowired
|
143 |
@Autowired
|
| 157 |
AddWalletRequestRepository addWalletRequestRepository;
|
144 |
AddWalletRequestRepository addWalletRequestRepository;
|
| Line 165... |
Line 152... |
| 165 |
LoanRepository loanRepository;
|
152 |
LoanRepository loanRepository;
|
| 166 |
@Autowired
|
153 |
@Autowired
|
| 167 |
private LoanStatementRepository loanStatementRepository;
|
154 |
private LoanStatementRepository loanStatementRepository;
|
| 168 |
@Autowired
|
155 |
@Autowired
|
| 169 |
SDCreditRequirementRepository sdCreditRequirementRepository;
|
156 |
SDCreditRequirementRepository sdCreditRequirementRepository;
|
| 170 |
private static final Logger LOGGER = LogManager.getLogger(WalletController.class);
|
- |
|
| 171 |
|
157 |
|
| 172 |
@PostMapping(value = "/wallet/upload")
|
158 |
@PostMapping(value = "/wallet/upload")
|
| 173 |
public String uploadWalletBulk(HttpServletRequest request, @RequestPart("file") MultipartFile file, Model model)
|
159 |
public String uploadWalletBulk(HttpServletRequest request, @RequestPart("file") MultipartFile file, Model model)
|
| 174 |
throws Exception {
|
160 |
throws Exception {
|
| 175 |
List<WalletHistoryModel> walletHistoryModelList = ExcelUtils.parseWalletBulkCredit(file.getInputStream());
|
161 |
List<WalletHistoryModel> walletHistoryModelList = ExcelUtils.parseWalletBulkCredit(file.getInputStream());
|
| Line 673... |
Line 659... |
| 673 |
model.addAttribute("startDate", startDate);
|
659 |
model.addAttribute("startDate", startDate);
|
| 674 |
model.addAttribute("endDate", endDate);
|
660 |
model.addAttribute("endDate", endDate);
|
| 675 |
return "walletStatement";
|
661 |
return "walletStatement";
|
| 676 |
}
|
662 |
}
|
| 677 |
|
663 |
|
| 678 |
@Autowired
|
- |
|
| 679 |
TransactionService transactionService;
|
- |
|
| 680 |
|
- |
|
| 681 |
@RequestMapping(value = "/account/reco", method = RequestMethod.GET)
|
664 |
@RequestMapping(value = "/account/reco", method = RequestMethod.GET)
|
| 682 |
public ResponseEntity<?> accountReco(HttpServletRequest request, @RequestParam LocalDate closingDate, Model model)
|
665 |
public ResponseEntity<?> accountReco(HttpServletRequest request, @RequestParam LocalDate closingDate, Model model)
|
| 683 |
throws Exception {
|
666 |
throws Exception {
|
| 684 |
boolean isAdmin = roleManager.isAdmin(cookiesProcessor.getCookiesObject(request).getRoleIds());
|
667 |
boolean isAdmin = roleManager.isAdmin(cookiesProcessor.getCookiesObject(request).getRoleIds());
|
| 685 |
if (!isAdmin) {
|
668 |
if (!isAdmin) {
|
| Line 948... |
Line 931... |
| 948 |
|
931 |
|
| 949 |
model.addAttribute("userWallet", userWallet);
|
932 |
model.addAttribute("userWallet", userWallet);
|
| 950 |
model.addAttribute("customretailer", customretailer);
|
933 |
model.addAttribute("customretailer", customretailer);
|
| 951 |
|
934 |
|
| 952 |
model.addAttribute("wallethistory", userWalletHistory);
|
935 |
model.addAttribute("wallethistory", userWalletHistory);
|
| 953 |
|
- |
|
| 954 |
model.addAttribute("response1", mvcResponseSender.createResponseString(true));
|
936 |
model.addAttribute("response1", mvcResponseSender.createResponseString(true));
|
| 955 |
return "wallet-history";
|
937 |
return "wallet-history";
|
| 956 |
|
938 |
|
| 957 |
}
|
939 |
}
|
| 958 |
|
940 |
|
| 959 |
@RequestMapping(value = "/getWalletHistoryByPartner", method = RequestMethod.GET)
|
941 |
@RequestMapping(value = "/getWalletHistoryByPartner", method = RequestMethod.GET)
|
| 960 |
public String getWalletHistoryByPartner(HttpServletRequest request, int fofoId,
|
942 |
public String getWalletHistoryByPartner(HttpServletRequest request, int fofoId,
|
| 961 |
@RequestParam(name = "referenceType", required = false) WalletReferenceType referenceType,
|
943 |
@RequestParam(name = "referenceType", required = false) WalletReferenceType referenceType,
|
| 962 |
@RequestParam(name = "offset", required = false, defaultValue = "0") int offset,
|
944 |
@RequestParam(name = "offset", required = false, defaultValue = "0") int offset,
|
| 963 |
@RequestParam(name = "limit", required = false, defaultValue = "30") int limit,
|
945 |
@RequestParam(name = "limit", required = false, defaultValue = "30") int limit, Model model)
|
| 964 |
Model model)
|
- |
|
| 965 |
throws Exception {
|
946 |
throws Exception {
|
| 966 |
|
947 |
|
| 967 |
UserWallet userWallet = userWalletRepository.selectByRetailerId(fofoId);
|
948 |
UserWallet userWallet = userWalletRepository.selectByRetailerId(fofoId);
|
| 968 |
List<UserWalletHistory> userWalletHistory = userWalletHistoryRepository.selectPaginatedByWalletIdReferenceType(
|
949 |
List<UserWalletHistory> userWalletHistory = userWalletHistoryRepository.selectPaginatedByWalletIdReferenceType(
|
| 969 |
userWallet.getId(), referenceType, SortOrder.DESCENDING, offset, limit);
|
950 |
userWallet.getId(), referenceType, SortOrder.DESCENDING, offset, limit);
|