Sfoglia il codice sorgente

정산완료/입금승인 등 수정

marseyes 2 anni fa
parent
commit
465e9d36ba

+ 4 - 4
src/main/java/com/oqpo/api/service/loanmng/DsptMngService.java

@@ -191,10 +191,10 @@ public class DsptMngService extends CommonService {
191 191
             // 정산관리고유번호 존재시 처리
192 192
             if (!StringUtil.isEmpty(procEntity.getSttlMgntUnqNo())) {
193 193
                 // 1. 정산관리기본정보 수납처리
194
-                StlMgntBaseInfoEntity stlEntity = new StlMgntBaseInfoEntity();
195
-                stlEntity.setSttlMgntUnqNo(procEntity.getSttlMgntUnqNo());
196
-                stlEntity.setRcptYn("Y");
197
-                stlEntity.setRcptAmt(procEntity.getDpstAmt());
194
+                StlMgntBaseInfoEntity stlEntity = sttlReqMapper.selectStlMgntBaseInfo(procEntity.getSttlMgntUnqNo());
195
+                long rcptAmt = stlEntity.getRcptAmt() + procEntity.getDpstAmt(); // 수납금액
196
+                stlEntity.setRcptYn(rcptAmt >= stlEntity.getSttlReqAmt() ? "Y" : "N");
197
+                stlEntity.setRcptAmt(rcptAmt);
198 198
                 sttlReqMapper.updateStlMgntBaseInfo4Rcpt(userId, stlEntity);
199 199
 
200 200
                 // 2. 여신관리기본정보 처리

+ 7 - 13
src/main/java/com/oqpo/api/service/sttlmng/SttlStateService.java

@@ -9,7 +9,6 @@ import com.oqpo.api.enums.MediaDvsn;
9 9
 import com.oqpo.api.enums.PayType;
10 10
 import com.oqpo.api.enums.SttlStCd;
11 11
 import com.oqpo.api.mapper.loanmng.DsptMngMapper;
12
-import com.oqpo.api.mapper.loanmng.UnpaidMngMapper;
13 12
 import com.oqpo.api.mapper.sttlmng.SttlReqMapper;
14 13
 import com.oqpo.api.mapper.sttlmng.SttlStateMapper;
15 14
 import com.oqpo.api.service.CommonService;
@@ -39,9 +38,6 @@ public class SttlStateService extends CommonService {
39 38
     @Autowired
40 39
     private DsptMngMapper dsptMngMapper;
41 40
 
42
-    @Autowired
43
-    private UnpaidMngMapper unpaidMngMapper;
44
-
45 41
     /*
46 42
       정산요청 그리드 리스트 조회
47 43
      */
@@ -89,12 +85,10 @@ public class SttlStateService extends CommonService {
89 85
         StlMgntBaseInfoEntity entity = sttlReqMapper.selectStlMgntBaseInfo(sttlConfirmRequest.getSttlMgntUnqNo());
90 86
 
91 87
         // 정산관리기본정보 - 정산상태코드 변경
92
-        StlMgntBaseInfoEntity stlEntity = new StlMgntBaseInfoEntity();
93
-        stlEntity.setSttlMgntUnqNo(sttlConfirmRequest.getSttlMgntUnqNo());
94
-        stlEntity.setSttlStCd(SttlStCd.STTL_CONFIRM.getCd());
95
-        stlEntity.setSttlDt(DateUtil.getCurrentDate());
96
-        stlEntity.setSttlAmt(entity.getSttlReqAmt()); // 정산요청금액을 정산금액으로 지정한다.
97
-        sttlReqMapper.updateStlMgntBaseInfo4SttlConfirm(userId, stlEntity);
88
+        entity.setSttlStCd(SttlStCd.STTL_CONFIRM.getCd());
89
+        entity.setSttlDt(DateUtil.getCurrentDate());
90
+        entity.setSttlAmt(entity.getSttlReqAmt()); // 정산요청금액을 정산금액으로 지정한다.
91
+        sttlReqMapper.updateStlMgntBaseInfo4SttlConfirm(userId, entity);
98 92
 
99 93
         if ("N".equals(entity.getRcptYn())) { // 수납여부가 N인 경우
100 94
             // 매장의 계좌잔액이 있은 경우 정산지급 처리를 한다.
@@ -134,9 +128,9 @@ public class SttlStateService extends CommonService {
134 128
                 dsptMngMapper.insertLoanMgntDtlHst(userId, hstEntity);
135 129
 
136 130
                 // 3. 정산관리기본정보 수납처리
137
-                stlEntity.setRcptYn(rcptYn); // 수납여부
138
-                stlEntity.setRcptAmt(rcptAmt); // 수납금액
139
-                sttlReqMapper.updateStlMgntBaseInfo4Rcpt(userId, stlEntity);
131
+                entity.setRcptYn(rcptYn); // 수납여부
132
+                entity.setRcptAmt(entity.getRcptAmt() + rcptAmt); // 수납금액
133
+                sttlReqMapper.updateStlMgntBaseInfo4Rcpt(userId, entity);
140 134
             }
141 135
         }
142 136
     }

+ 3 - 3
src/main/resources/mybatis/sqlmaps/sttlmng/SttlReq.xml

@@ -172,9 +172,9 @@
172 172
             A.sttl_st_cd, FN_CODE_NM('STTL_ST_CD', A.sttl_st_cd) AS sttl_st_nm,
173 173
             DATE_FORMAT(A.sttl_req_dt, '%Y.%m.%d') AS sttl_req_dt,      /* 정산요청일자 */
174 174
             DATE_FORMAT(A.sttl_dt, '%Y.%m.%d') AS sttl_dt,              /* 정산확정일자 */
175
-            A.sttl_req_amt,             /* 정산요청금액 */
176
-            A.sttl_amt,                 /* 정산확정금액 */
177
-            A.rcpt_amt,                 /* 수납금액 */
175
+            A.sttl_req_amt,                         /* 정산요청금액 */
176
+            A.sttl_amt,                             /* 정산확정금액 */
177
+            IFNULL(A.rcpt_amt, 0) AS rcpt_amt,      /* 수납금액 */
178 178
             case when B.LOAN_DVSN = 'LD02' then A.sttl_amt - IFNULL(A.rcpt_amt, 0) ELSE 0 END AS unpaid_amt, /* 미납금액 */ 
179 179
             A.sttl_reg_mgr_nm, A.sttl_reg_mgr_id,
180 180
             A.sttl_rjct_rsn,