|
@@ -495,6 +495,21 @@ public class EasypayPaymentService extends CommonService {
|
495
|
495
|
infoEntity.setAcctBal(trscAfBal);
|
496
|
496
|
dsptMngMapper.updateLoanMgntBaseInfo4AcctBal(userId, infoEntity);
|
497
|
497
|
|
|
498
|
+ // 4. 여신관리입금처리
|
|
499
|
+ LoanMgntDsptProcEntity entity = new LoanMgntDsptProcEntity();
|
|
500
|
+ entity.setDsptMgntNo(fnGetDealNo(21, "")); // 입금관리번호
|
|
501
|
+ entity.setReqDt(DateUtil.getCurrentDate());
|
|
502
|
+ entity.setReqTm(DateUtil.getCurrentTime());
|
|
503
|
+ entity.setDpstAmt(Long.parseLong(r_amount)); // 입금금액
|
|
504
|
+ entity.setDpstDt(entity.getReqDt()); // 입금일자
|
|
505
|
+ entity.setDpstStCd(DpstStCd.DPST_APPROVE.getCd());
|
|
506
|
+ entity.setDpstReqId(userId);
|
|
507
|
+ entity.setStoreId(payInfo.getStoreId());
|
|
508
|
+ entity.setBrandId(payInfo.getBrandId());
|
|
509
|
+ entity.setPoOrdNo(payInfo.getPoOrdNo());
|
|
510
|
+ entity.setPgId("KICC");
|
|
511
|
+ dsptMngMapper.insertLoanMgntDsptProcInfo(userId, entity);
|
|
512
|
+
|
498
|
513
|
// 2. 여신관리상세이력
|
499
|
514
|
// 2.1 입금 처리
|
500
|
515
|
LoanMgntDtlHstEntity hstEntity = new LoanMgntDtlHstEntity();
|
|
@@ -515,12 +530,22 @@ public class EasypayPaymentService extends CommonService {
|
515
|
530
|
} else if (PayTpCd.PR_APPR_PAYMENT.getCd().equals(easypayPaymentRequest.getPayTpCd())) {
|
516
|
531
|
hstEntity.setPayType(PayType.PRE_PAYMENT.getCd());
|
517
|
532
|
}
|
518
|
|
-
|
519
|
|
-
|
520
|
533
|
hstEntity.setTrscAmt(Long.parseLong(r_amount)); // 거래금액
|
521
|
534
|
hstEntity.setTrscBfBal(trscBfBal);
|
522
|
535
|
hstEntity.setTrscAfBal(trscAfBal);
|
|
536
|
+ hstEntity.setDsptMgntNo(entity.getDsptMgntNo()); // 입금관리번호
|
523
|
537
|
dsptMngMapper.insertLoanMgntDtlHst(userId, hstEntity);
|
|
538
|
+ }
|
|
539
|
+
|
|
540
|
+ private void procAfterPayment(String userId, String r_amount, String r_pay_type, PgKiccPayPtclEntity payInfo, EasypayPaymentRequest easypayPaymentRequest) throws Exception {
|
|
541
|
+ // 2. 여신관리기본정보
|
|
542
|
+ LoanMgntBaseInfoEntity infoEntity = dsptMngMapper.selectLoanMgntBaseInfo(payInfo.getBrandId(), payInfo.getStoreId());
|
|
543
|
+
|
|
544
|
+ long trscBfBal = infoEntity.getAcctBal();
|
|
545
|
+ long trscAfBal = infoEntity.getAcctBal() + Long.parseLong(r_amount);
|
|
546
|
+ // 사용금액합계 감소
|
|
547
|
+ infoEntity.setUseAmtTotal(infoEntity.getUseAmtTotal() - Long.parseLong(r_amount));
|
|
548
|
+ unpaidMngMapper.updateLoanMgntBaseInfo4UnpaidPay(userId, infoEntity);
|
524
|
549
|
|
525
|
550
|
// 4. 여신관리입금처리
|
526
|
551
|
LoanMgntDsptProcEntity entity = new LoanMgntDsptProcEntity();
|
|
@@ -529,24 +554,17 @@ public class EasypayPaymentService extends CommonService {
|
529
|
554
|
entity.setReqTm(DateUtil.getCurrentTime());
|
530
|
555
|
entity.setDpstAmt(Long.parseLong(r_amount)); // 입금금액
|
531
|
556
|
entity.setDpstDt(entity.getReqDt()); // 입금일자
|
|
557
|
+ // entity.setDpstNm(reqDsptRequest.getDpstNm());
|
|
558
|
+ // entity.setRcvAcctNo(reqDsptRequest.getRcvAcctNo());
|
|
559
|
+ // entity.setDpstBnkCd(reqDsptRequest.getDpstBnkCd());
|
532
|
560
|
entity.setDpstStCd(DpstStCd.DPST_APPROVE.getCd());
|
533
|
561
|
entity.setDpstReqId(userId);
|
|
562
|
+ // entity.setDpstReqNm(user.getUserNm());
|
534
|
563
|
entity.setStoreId(payInfo.getStoreId());
|
535
|
564
|
entity.setBrandId(payInfo.getBrandId());
|
536
|
565
|
entity.setPoOrdNo(payInfo.getPoOrdNo());
|
537
|
566
|
entity.setPgId("KICC");
|
538
|
567
|
dsptMngMapper.insertLoanMgntDsptProcInfo(userId, entity);
|
539
|
|
- }
|
540
|
|
-
|
541
|
|
- private void procAfterPayment(String userId, String r_amount, String r_pay_type, PgKiccPayPtclEntity payInfo, EasypayPaymentRequest easypayPaymentRequest) throws Exception {
|
542
|
|
- // 2. 여신관리기본정보
|
543
|
|
- LoanMgntBaseInfoEntity infoEntity = dsptMngMapper.selectLoanMgntBaseInfo(payInfo.getBrandId(), payInfo.getStoreId());
|
544
|
|
-
|
545
|
|
- long trscBfBal = infoEntity.getAcctBal();
|
546
|
|
- long trscAfBal = infoEntity.getAcctBal() + Long.parseLong(r_amount);
|
547
|
|
- // 사용금액합계 감소
|
548
|
|
- infoEntity.setUseAmtTotal(infoEntity.getUseAmtTotal() - Long.parseLong(r_amount));
|
549
|
|
- unpaidMngMapper.updateLoanMgntBaseInfo4UnpaidPay(userId, infoEntity);
|
550
|
568
|
|
551
|
569
|
// 3. 여신관리상세이력
|
552
|
570
|
// 3.1 입금 처리
|
|
@@ -565,6 +583,7 @@ public class EasypayPaymentService extends CommonService {
|
565
|
583
|
hstEntity1.setTrscAmt(Long.parseLong(r_amount)); // 거래금액
|
566
|
584
|
hstEntity1.setTrscBfBal(trscBfBal);
|
567
|
585
|
hstEntity1.setTrscAfBal(trscAfBal);
|
|
586
|
+ hstEntity1.setDsptMgntNo(entity.getDsptMgntNo()); // 입금관리번호
|
568
|
587
|
dsptMngMapper.insertLoanMgntDtlHst(userId, hstEntity1);
|
569
|
588
|
|
570
|
589
|
// 3.2 지급 처리
|
|
@@ -580,25 +599,6 @@ public class EasypayPaymentService extends CommonService {
|
580
|
599
|
hstEntity2.setTrscAfBal(trscBfBal);
|
581
|
600
|
dsptMngMapper.insertLoanMgntDtlHst(userId, hstEntity2);
|
582
|
601
|
|
583
|
|
- // 4. 여신관리입금처리
|
584
|
|
- LoanMgntDsptProcEntity entity = new LoanMgntDsptProcEntity();
|
585
|
|
- entity.setDsptMgntNo(fnGetDealNo(21, "")); // 입금관리번호
|
586
|
|
- entity.setReqDt(DateUtil.getCurrentDate());
|
587
|
|
- entity.setReqTm(DateUtil.getCurrentTime());
|
588
|
|
- entity.setDpstAmt(Long.parseLong(r_amount)); // 입금금액
|
589
|
|
- entity.setDpstDt(entity.getReqDt()); // 입금일자
|
590
|
|
- // entity.setDpstNm(reqDsptRequest.getDpstNm());
|
591
|
|
- // entity.setRcvAcctNo(reqDsptRequest.getRcvAcctNo());
|
592
|
|
- // entity.setDpstBnkCd(reqDsptRequest.getDpstBnkCd());
|
593
|
|
- entity.setDpstStCd(DpstStCd.DPST_APPROVE.getCd());
|
594
|
|
- entity.setDpstReqId(userId);
|
595
|
|
- // entity.setDpstReqNm(user.getUserNm());
|
596
|
|
- entity.setStoreId(payInfo.getStoreId());
|
597
|
|
- entity.setBrandId(payInfo.getBrandId());
|
598
|
|
- entity.setPoOrdNo(payInfo.getPoOrdNo());
|
599
|
|
- entity.setPgId("KICC");
|
600
|
|
- dsptMngMapper.insertLoanMgntDsptProcInfo(userId, entity);
|
601
|
|
-
|
602
|
602
|
// 5. 정산관리기본정보 업데이트
|
603
|
603
|
// easypayPaymentRequest.setR_amount(Long.parseLong(r_amount));
|
604
|
604
|
List<EasypayPaymentReqData> reqDataList = easypayPaymentRequest.getReqDataList();
|