Subversion Repositories SmartDukaan

Rev

Rev 30265 | Rev 30276 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 30265 Rev 30266
Line 294... Line 294...
294
 
294
 
295
					CreditAccount creditAccount = creditAccountRepository
295
					CreditAccount creditAccount = creditAccountRepository
296
							.selectByFofoIdAndGateway(Integer.parseInt(pa.getUserId()), Gateway.FUNDFINA);
296
							.selectByFofoIdAndGateway(Integer.parseInt(pa.getUserId()), Gateway.FUNDFINA);
297
 
297
 
298
					DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
298
					DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
299
					if (pa.getProductId() != null) {
-
 
300
 
299
 
301
						if (creditAccount == null) {
300
					if (creditAccount == null) {
302
							creditAccount = new CreditAccount();
301
						creditAccount = new CreditAccount();
303
							creditAccount.setLoanReferenceId(pa.getProductId());
302
						creditAccount.setLoanReferenceId(pa.getProductId());
304
 
303
 
305
						} else {
304
					} else {
306
 
305
 
307
							if (!pa.getProductId().equals(creditAccount.getLoanReferenceId())) {
306
						if (!pa.getProductId().equals(creditAccount.getLoanReferenceId())) {
308
								creditAccount.setLoanReferenceId(pa.getProductId());
307
							creditAccount.setLoanReferenceId(pa.getProductId());
309
 
308
 
310
							}
-
 
311
						}
309
						}
-
 
310
					}
312
 
311
 
313
						creditAccount.setExpiredOn(LocalDateTime.parse(pa.getExpiryDate(), formatter));
312
					creditAccount.setExpiredOn(LocalDateTime.parse(pa.getExpiryDate(), formatter));
314
						creditAccount.setProcessingFee(pa.getProcessingFee());
313
					creditAccount.setProcessingFee(pa.getProcessingFee());
315
						creditAccount.setSanctionedAmount(Float.parseFloat(pa.getApprovedAmount()));
314
					creditAccount.setSanctionedAmount(Float.parseFloat(pa.getApprovedAmount()));
316
						creditAccount.setGateway(Gateway.FUNDFINA);
315
					creditAccount.setGateway(Gateway.FUNDFINA);
317
 
316
 
318
						String in[] = pa.getAnnualInterestRate().split("%");
317
					String in[] = pa.getAnnualInterestRate().split("%");
319
						creditAccount.setInterestRate(Float.parseFloat(in[0]));
318
					creditAccount.setInterestRate(Float.parseFloat(in[0]));
320
						creditAccount.setFofoId(Integer.parseInt(pa.getUserId()));
319
					creditAccount.setFofoId(Integer.parseInt(pa.getUserId()));
321
						creditAccount.setUpdatedOn(LocalDateTime.now());
320
					creditAccount.setUpdatedOn(LocalDateTime.now());
322
 
-
 
323
						creditAccount.setCreditStatus(CreditStatus.SANCTIONED);
-
 
324
 
321
 
325
						creditAccountRepository.persist(creditAccount);
322
					creditAccount.setCreditStatus(CreditStatus.SANCTIONED);
326
 
323
 
327
					}
324
					creditAccountRepository.persist(creditAccount);
328
 
325
 
329
					if (fpa == null) {
326
					if (fpa == null) {
330
						fpa = new FundFinaPreApproval();
327
						fpa = new FundFinaPreApproval();
331
						fpa.setFofoId(Integer.parseInt(pa.getUserId()));
328
						fpa.setFofoId(Integer.parseInt(pa.getUserId()));
332
						fpa.setProductId(pa.getProductId());
329
						fpa.setProductId(pa.getProductId());