Ver código fonte

Merge branch 'master' of http://106.246.249.162:13000/orderqueen/oqpo-api

dwkim 2 anos atrás
pai
commit
590f5d2a25

+ 5 - 5
src/main/java/com/oqpo/api/service/loanmng/UnpaidMngService.java

@@ -48,13 +48,13 @@ public class UnpaidMngService extends CommonService {
48 48
                         .storeNm(m.getStoreNm())
49 49
                         .sttlStCd(m.getSttlStCd())
50 50
                         .sttlStNm(m.getSttlStNm())
51
-                        .sttlReqAmt(m.getSttlReqAmt())
52
-                        .sttlDt(m.getSttlDt())
53
-                        .sttlAmt(m.getSttlAmt())
54
-                        .acctBal(m.getAcctBal())
51
+                        .sttlReqAmt(m.getSttlReqAmt())      /* 정산요청금액 */
52
+                        .sttlDt(m.getSttlDt())              /* 정산확정일자 */
53
+                        .sttlAmt(m.getSttlAmt())            /* 정산확정금액 */
54
+                        .unpaidAmt(m.getUnpaidAmt())        /* 미납금액 */
55 55
                         .loanDvsn(m.getLoanDvsn())
56 56
                         .loanDvsnNm(m.getLoanDvsnNm())
57
-                        .useAmtTotal(m.getUseAmtTotal())
57
+                        .useAmtTotal(m.getUseAmtTotal())    /* 사용가능한도 */
58 58
                         .build())
59 59
                 .collect(Collectors.toList());
60 60
         return GridResponse.toDTO(gridPage, gridTotal, gridRecords, gridRows);

+ 8 - 4
src/main/java/com/oqpo/api/web/dto/response/loanmng/UnpaidMngInfoResponse.java

@@ -39,6 +39,8 @@ public class UnpaidMngInfoResponse {
39 39
     private String sttlDt;
40 40
     @ApiModelProperty(value = "정산금액")
41 41
     private Long sttlAmt;
42
+    @ApiModelProperty(value = "미납금액(후불사용)")
43
+    private Long unpaidAmt;
42 44
     @ApiModelProperty(value = "정산등록담당자명")
43 45
     private String sttlRegMgrNm;
44 46
     @ApiModelProperty(value = "정산등록담당자아이디")
@@ -67,15 +69,16 @@ public class UnpaidMngInfoResponse {
67 69
         return UnpaidMngInfoResponse.builder()
68 70
                 .sttlMgntUnqNo(entity.getSttlMgntUnqNo())
69 71
                 .sttlReqDt(entity.getSttlReqDt())
72
+                .sttlDt(entity.getSttlDt())
70 73
                 .brandId(entity.getBrandId())
71 74
                 .brandNm(entity.getBrandNm())
72 75
                 .storeId(entity.getStoreId())
73 76
                 .storeNm(entity.getStoreNm())
74 77
                 .sttlStCd(entity.getSttlStCd())
75 78
                 .sttlStNm(entity.getSttlStNm())
76
-                .sttlReqAmt(entity.getSttlReqAmt())
77
-                .sttlDt(entity.getSttlDt())
78
-                .sttlAmt(entity.getSttlAmt())
79
+                .sttlReqAmt(entity.getSttlReqAmt())         /* 정산요청금액 */
80
+                .sttlAmt(entity.getSttlAmt())               /* 정산확정금액 */
81
+                .unpaidAmt(entity.getUnpaidAmt())           /* 미납금액 */
79 82
                 .sttlRegMgrNm(entity.getSttlRegMgrNm())
80 83
                 .sttlRegMgrId(entity.getSttlRegMgrId())
81 84
                 .sysRegDttm(entity.getSysRegDttm())
@@ -83,7 +86,8 @@ public class UnpaidMngInfoResponse {
83 86
                 .sysRegNm(entity.getSysRegNm())
84 87
                 .sysChgDttm(entity.getSysChgDttm())
85 88
                 .sysChgId(entity.getSysChgId())
86
-                .useAmtTotal(entity.getUseAmtTotal())
89
+                .acctBal(entity.getAcctBal())               /* 계좌잔액 */
90
+                .useAmtTotal(entity.getUseAmtTotal())       /* 사용가능한도금액 */
87 91
                 .rcptYn(entity.getRcptYn())
88 92
                 .build();
89 93
     }

+ 5 - 3
src/main/java/com/oqpo/api/web/dto/response/loanmng/UnpaidMngListResponse.java

@@ -32,11 +32,13 @@ public class UnpaidMngListResponse {
32 32
     private String sttlReqDt;
33 33
     @ApiModelProperty(value = "정산요청금액")
34 34
     private Long sttlReqAmt;
35
-    @ApiModelProperty(value = "정산일자")
35
+    @ApiModelProperty(value = "정산확정일자")
36 36
     private String sttlDt;
37
-    @ApiModelProperty(value = "정산금액")
37
+    @ApiModelProperty(value = "정산확정금액")
38 38
     private Long sttlAmt;
39
-    @ApiModelProperty(value = "계좌잔액")
39
+    @ApiModelProperty(value = "미납금액")
40
+    private Long unpaidAmt;
41
+    @ApiModelProperty(value = "매장 계좌잔액")
40 42
     private Long acctBal;
41 43
     @ApiModelProperty(value = "여신구분")
42 44
     private String loanDvsn;

+ 19 - 13
src/main/resources/mybatis/sqlmaps/loanmng/UnpaidMng.xml

@@ -15,8 +15,11 @@
15 15
             loan.credt_limit_amt,       /* 신용한도금액(후불) */
16 16
             loan.tmp_rcv_acct_total,    /* 가수금액합계(선결제) */
17 17
             DATE_FORMAT(stl.sttl_req_dt, '%Y.%m.%d') AS sttl_req_dt,        /* 정산요청일자 */
18
+            DATE_FORMAT(stl.sttl_dt, '%Y.%m.%d') AS sttl_dt,                /* 정산확정일자 */
18 19
             stl.sttl_req_amt,           /* 정산요청금액 */
19
-            DATE_FORMAT(stl.sttl_dt, '%Y.%m.%d') AS sttl_dt,                /* 정산확인일자 */
20
+            stl.sttl_amt,               /* 정산확정금액 */
21
+            stl.rcpt_amt,               /* 수납금액 */
22
+            (IFNULL(stl.sttl_amt, stl.sttl_req_amt) - IFNULL(stl.rcpt_amt, 0)) AS unpaid_amt,       /* 미납금액 */
20 23
             <![CDATA[
21 24
             CASE WHEN store.sttl_req_cfrm_term > 0 AND store.sttl_rcp_amt_term > 0 THEN
22 25
                     CASE WHEN stl.sttl_req_dt IS NULL THEN '정산요청전'
@@ -37,17 +40,17 @@
37 40
             stl.sttl_mgnt_unq_no      /* 정산관리고유번호 */
38 41
         FROM store_base_info store
39 42
         INNER JOIN loan_mgnt_base_info loan
40
-        ON store.loan_mgnt_unq_no = loan.loan_mgnt_unq_no
41
-        AND store.loan_dvsn = loan.loan_dvsn
42
-        AND store.store_id = loan.store_id
43
-        AND loan.loan_dvsn = 'LD02'
44
-        AND loan.use_amt_total > 0
43
+            ON store.loan_mgnt_unq_no = loan.loan_mgnt_unq_no
44
+            AND store.loan_dvsn = loan.loan_dvsn
45
+            AND store.store_id = loan.store_id
46
+            AND loan.loan_dvsn = 'LD02'
47
+            AND loan.use_amt_total > 0
45 48
         INNER JOIN stl_mgnt_base_info stl
46
-        ON store.store_id = stl.store_id
47
-        AND store.brand_id = stl.brand_id
48
-        AND stl.sttl_req_dt BETWEEN #{fromDt} AND #{toDt}
49
-        AND stl.sttl_st_cd IN ('ST10', 'ST20')      /* 정산요청/정산확정 */
50
-        AND IFNULL(stl.rcpt_yn, 'N') = 'N'          /* 수납여부(후불사용) */
49
+            ON store.store_id = stl.store_id
50
+            AND store.brand_id = stl.brand_id
51
+            AND stl.sttl_req_dt BETWEEN #{fromDt} AND #{toDt}
52
+            AND stl.sttl_st_cd IN ('ST10', 'ST20')      /* 정산요청/정산확정 */
53
+            AND IFNULL(stl.rcpt_yn, 'N') = 'N'          /* 수납여부(후불사용) */
51 54
         WHERE 1 = 1
52 55
         AND store.brand_id = #{sBrandId}
53 56
         <if test="sStoreId != null and sStoreId != ''">
@@ -104,12 +107,15 @@
104 107
             loan.loan_mgnt_unq_no,          /* 여신관리고유번호 */
105 108
             loan.loan_dvsn, FN_CODE_NM('LOAN_DVSN', loan.loan_dvsn) AS loan_dvsn_nm,       /* 여신구분(정산타입) */
106 109
             loan.credt_limit_amt - loan.use_amt_total + loan.acct_bal + loan.tmp_rcv_acct_total AS use_amt_total,    /* 사용가능한도 */
107
-            loan.acct_bal,              /* 계좌잔액 */
110
+            loan.acct_bal,              /* 매장 계좌잔액 */
108 111
             loan.credt_limit_amt,       /* 신용한도금액(후불) */
109 112
             loan.tmp_rcv_acct_total,    /* 가수금액합계(선결제) */
110 113
             DATE_FORMAT(stl.sttl_req_dt, '%Y.%m.%d') AS sttl_req_dt,        /* 정산요청일자 */
114
+            DATE_FORMAT(stl.sttl_dt, '%Y.%m.%d') AS sttl_dt,                /* 정산확정일자 */
111 115
             stl.sttl_req_amt,           /* 정산요청금액 */
112
-            DATE_FORMAT(stl.sttl_dt, '%Y.%m.%d') AS sttl_dt,                /* 정산확인일자 */
116
+            stl.sttl_amt,               /* 정산확정금액 */
117
+            stl.rcpt_amt,               /* 수납금액 */
118
+            (IFNULL(stl.sttl_amt, stl.sttl_req_amt) - IFNULL(stl.rcpt_amt, 0)) AS unpaid_amt,       /* 미납금액 */
113 119
             <![CDATA[
114 120
             CASE WHEN store.sttl_req_cfrm_term > 0 AND store.sttl_rcp_amt_term > 0 THEN
115 121
                     CASE WHEN stl.sttl_req_dt IS NULL THEN '정산요청전'