| Line 4... |
Line 4... |
| 4 |
import java.time.DayOfWeek;
|
4 |
import java.time.DayOfWeek;
|
| 5 |
import java.time.LocalDate;
|
5 |
import java.time.LocalDate;
|
| 6 |
import java.time.LocalDateTime;
|
6 |
import java.time.LocalDateTime;
|
| 7 |
import java.time.Month;
|
7 |
import java.time.Month;
|
| 8 |
import java.time.YearMonth;
|
8 |
import java.time.YearMonth;
|
| - |
|
9 |
import java.time.format.DateTimeFormatter;
|
| 9 |
import java.util.ArrayList;
|
10 |
import java.util.ArrayList;
|
| 10 |
import java.util.List;
|
11 |
import java.util.List;
|
| 11 |
import java.util.Map;
|
12 |
import java.util.Map;
|
| 12 |
import java.util.Map.Entry;
|
13 |
import java.util.Map.Entry;
|
| 13 |
import java.util.stream.Collectors;
|
14 |
import java.util.stream.Collectors;
|
| Line 37... |
Line 38... |
| 37 |
import com.spice.profitmandi.common.services.fundfina.TransactionRequest;
|
38 |
import com.spice.profitmandi.common.services.fundfina.TransactionRequest;
|
| 38 |
import com.spice.profitmandi.common.services.fundfina.TransactionResponse;
|
39 |
import com.spice.profitmandi.common.services.fundfina.TransactionResponse;
|
| 39 |
import com.spice.profitmandi.common.services.fundfina.TransactionSummary;
|
40 |
import com.spice.profitmandi.common.services.fundfina.TransactionSummary;
|
| 40 |
import com.spice.profitmandi.common.services.fundfina.TransactionalData;
|
41 |
import com.spice.profitmandi.common.services.fundfina.TransactionalData;
|
| 41 |
import com.spice.profitmandi.dao.entity.dtr.CreditAccount;
|
42 |
import com.spice.profitmandi.dao.entity.dtr.CreditAccount;
|
| - |
|
43 |
import com.spice.profitmandi.dao.entity.dtr.CreditStatus;
|
| 42 |
import com.spice.profitmandi.dao.entity.dtr.Document;
|
44 |
import com.spice.profitmandi.dao.entity.dtr.Document;
|
| 43 |
import com.spice.profitmandi.dao.entity.dtr.FundFinaPreApproval;
|
45 |
import com.spice.profitmandi.dao.entity.dtr.FundFinaPreApproval;
|
| 44 |
import com.spice.profitmandi.dao.entity.fofo.FofoKyc;
|
46 |
import com.spice.profitmandi.dao.entity.fofo.FofoKyc;
|
| 45 |
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
|
47 |
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
|
| 46 |
import com.spice.profitmandi.dao.entity.fofo.PartnerOnBoardingPanel;
|
48 |
import com.spice.profitmandi.dao.entity.fofo.PartnerOnBoardingPanel;
|
| Line 146... |
Line 148... |
| 146 |
int fofoId = customRetailerEntry.getKey();
|
148 |
int fofoId = customRetailerEntry.getKey();
|
| 147 |
|
149 |
|
| 148 |
User user = userRepository.selectById(fofoId);
|
150 |
User user = userRepository.selectById(fofoId);
|
| 149 |
TransactionalData td = new TransactionalData();
|
151 |
TransactionalData td = new TransactionalData();
|
| 150 |
td.setJoinedOn(user.getCreateTimestamp().toLocalDate().toString());
|
152 |
td.setJoinedOn(user.getCreateTimestamp().toLocalDate().toString());
|
| - |
|
153 |
td.setRegistrationDate(user.getCreateTimestamp().toLocalDate().toString());
|
| 151 |
td.setUserId(Integer.toString(user.getId()));
|
154 |
td.setUserId(Integer.toString(user.getId()));
|
| 152 |
td.setMerchantType("Retailer");
|
155 |
td.setMerchantType("Retailer");
|
| 153 |
td.setEmailId(user.getEmailId());
|
156 |
td.setEmailId(user.getEmailId());
|
| 154 |
td.setMobileNo(user.getMobileNumber());
|
157 |
td.setMobileNo(user.getMobileNumber());
|
| 155 |
td.setShopType("Mobile Shop");
|
158 |
td.setShopType("Mobile Shop");
|
| Line 286... |
Line 289... |
| 286 |
for (PreApprovals pa : preApprovals) {
|
289 |
for (PreApprovals pa : preApprovals) {
|
| 287 |
|
290 |
|
| 288 |
if (pa.getProductId() != null) {
|
291 |
if (pa.getProductId() != null) {
|
| 289 |
FundFinaPreApproval fpa = fundFinaPreApprovalRepository
|
292 |
FundFinaPreApproval fpa = fundFinaPreApprovalRepository
|
| 290 |
.selectByUserIdAndProductId(Integer.parseInt(pa.getUserId()), pa.getProductId());
|
293 |
.selectByUserIdAndProductId(Integer.parseInt(pa.getUserId()), pa.getProductId());
|
| - |
|
294 |
|
| - |
|
295 |
CreditAccount creditAccount = creditAccountRepository
|
| - |
|
296 |
.selectByFofoIdAndGateway(Integer.parseInt(pa.getUserId()), Gateway.FUNDFINA);
|
| - |
|
297 |
|
| - |
|
298 |
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
| - |
|
299 |
if (pa.getProductId() != null) {
|
| - |
|
300 |
|
| - |
|
301 |
if (creditAccount == null) {
|
| - |
|
302 |
creditAccount = new CreditAccount();
|
| - |
|
303 |
creditAccount.setLoanReferenceId(pa.getProductId());
|
| - |
|
304 |
|
| - |
|
305 |
} else {
|
| - |
|
306 |
|
| - |
|
307 |
if (!pa.getProductId().equals(creditAccount.getLoanReferenceId())) {
|
| - |
|
308 |
creditAccount.setLoanReferenceId(pa.getProductId());
|
| - |
|
309 |
|
| - |
|
310 |
}
|
| - |
|
311 |
}
|
| - |
|
312 |
|
| - |
|
313 |
creditAccount.setExpiredOn(LocalDateTime.parse(pa.getExpiryDate(), formatter));
|
| - |
|
314 |
creditAccount.setProcessingFee(pa.getProcessingFee());
|
| - |
|
315 |
creditAccount.setSanctionedAmount(Float.parseFloat(pa.getApprovedAmount()));
|
| - |
|
316 |
creditAccount.setGateway(Gateway.FUNDFINA);
|
| - |
|
317 |
|
| - |
|
318 |
String in[] = pa.getAnnualInterestRate().split("%");
|
| - |
|
319 |
creditAccount.setInterestRate(Float.parseFloat(in[0]));
|
| - |
|
320 |
creditAccount.setFofoId(Integer.parseInt(pa.getUserId()));
|
| - |
|
321 |
creditAccount.setUpdatedOn(LocalDateTime.now());
|
| - |
|
322 |
|
| - |
|
323 |
creditAccount.setCreditStatus(CreditStatus.SANCTIONED);
|
| - |
|
324 |
|
| - |
|
325 |
creditAccountRepository.persist(creditAccount);
|
| - |
|
326 |
|
| - |
|
327 |
}
|
| - |
|
328 |
|
| 291 |
if (fpa == null) {
|
329 |
if (fpa == null) {
|
| 292 |
fpa = new FundFinaPreApproval();
|
330 |
fpa = new FundFinaPreApproval();
|
| 293 |
fpa.setFofoId(Integer.parseInt(pa.getUserId()));
|
331 |
fpa.setFofoId(Integer.parseInt(pa.getUserId()));
|
| 294 |
fpa.setProductId(fpa.getProductId());
|
332 |
fpa.setProductId(pa.getProductId());
|
| 295 |
fpa.setTenureInDays(fpa.getTenureInDays());
|
333 |
fpa.setTenureInDays(pa.getTenureInDays());
|
| 296 |
fpa.setProcessingFee(fpa.getProcessingFee());
|
334 |
fpa.setProcessingFee(pa.getProcessingFee());
|
| 297 |
fpa.setAnnualInterestRate(fpa.getAnnualInterestRate());
|
335 |
fpa.setAnnualInterestRate(pa.getAnnualInterestRate());
|
| 298 |
fpa.setApprovedAmount(fpa.getApprovedAmount());
|
336 |
fpa.setApprovedAmount(pa.getApprovedAmount());
|
| 299 |
fpa.setEmiAmount(fpa.getEmiAmount());
|
337 |
fpa.setEmiAmount(pa.getEmiAmount());
|
| 300 |
fpa.setExpiryDate(fpa.getExpiryDate());
|
338 |
fpa.setExpiryDate(LocalDateTime.parse(pa.getExpiryDate(), formatter));
|
| 301 |
fpa.setCreateTimestamp(LocalDateTime.now());
|
339 |
fpa.setCreateTimestamp(LocalDateTime.now());
|
| 302 |
fpa.setUpdateTimestamp(LocalDateTime.now());
|
340 |
fpa.setUpdateTimestamp(LocalDateTime.now());
|
| 303 |
fundFinaPreApprovalRepository.persist(fpa);
|
341 |
fundFinaPreApprovalRepository.persist(fpa);
|
| 304 |
|
342 |
|
| 305 |
}
|
343 |
}
|