|
@@ -2,14 +2,19 @@ package com.oqpo.api.service.sttlmng;
|
2
|
2
|
|
3
|
3
|
|
4
|
4
|
import com.oqpo.api.entity.settmng.StlMgntBaseInfoEntity;
|
|
5
|
+import com.oqpo.api.enums.SttlStCd;
|
|
6
|
+import com.oqpo.api.mapper.sttlmng.SttlReqMapper;
|
5
|
7
|
import com.oqpo.api.mapper.sttlmng.SttlStateMapper;
|
6
|
8
|
import com.oqpo.api.service.CommonService;
|
|
9
|
+import com.oqpo.api.util.DateUtil;
|
7
|
10
|
import com.oqpo.api.web.dto.request.GridRequest;
|
|
11
|
+import com.oqpo.api.web.dto.request.sttlmng.SttlConfirmRequest;
|
8
|
12
|
import com.oqpo.api.web.dto.response.GridResponse;
|
9
|
13
|
import com.oqpo.api.web.dto.response.sttlmng.SttlStateGridResponse;
|
10
|
14
|
import lombok.extern.slf4j.Slf4j;
|
11
|
15
|
import org.springframework.beans.factory.annotation.Autowired;
|
12
|
16
|
import org.springframework.stereotype.Service;
|
|
17
|
+import org.springframework.transaction.annotation.Transactional;
|
13
|
18
|
|
14
|
19
|
import java.util.List;
|
15
|
20
|
import java.util.stream.Collectors;
|
|
@@ -21,6 +26,9 @@ public class SttlStateService extends CommonService {
|
21
|
26
|
@Autowired
|
22
|
27
|
private SttlStateMapper sttlStateMapper;
|
23
|
28
|
|
|
29
|
+ @Autowired
|
|
30
|
+ private SttlReqMapper sttlReqMapper;
|
|
31
|
+
|
24
|
32
|
/*
|
25
|
33
|
정산요청 그리드 리스트 조회
|
26
|
34
|
*/
|
|
@@ -59,4 +67,19 @@ public class SttlStateService extends CommonService {
|
59
|
67
|
return GridResponse.toDTO(gridPage, gridTotal, gridRecords, gridRows);
|
60
|
68
|
}
|
61
|
69
|
|
|
70
|
+ /* 정산완료 */
|
|
71
|
+ @Transactional
|
|
72
|
+ public void endSttl(String userId, SttlConfirmRequest sttlConfirmRequest) throws Exception {
|
|
73
|
+ // 정산기본정보 조회
|
|
74
|
+ StlMgntBaseInfoEntity entity = sttlReqMapper.selectStlMgntBaseInfo(sttlConfirmRequest.getSttlMgntUnqNo());
|
|
75
|
+
|
|
76
|
+ // 정산관리기본정보 - 정산상태코드 변경
|
|
77
|
+ StlMgntBaseInfoEntity infoEntity = new StlMgntBaseInfoEntity();
|
|
78
|
+ infoEntity.setSttlMgntUnqNo(sttlConfirmRequest.getSttlMgntUnqNo());
|
|
79
|
+ infoEntity.setSttlStCd(SttlStCd.STTL_CONFIRM.getCd());
|
|
80
|
+ infoEntity.setSttlDt(DateUtil.getCurrentDate());
|
|
81
|
+ infoEntity.setSttlAmt(entity.getSttlReqAmt()); // 정산요청금액을 정산금액으로 지정한다.
|
|
82
|
+ sttlReqMapper.updateStlMgntBaseInfo4SttlConfirm(userId, infoEntity);
|
|
83
|
+ }
|
|
84
|
+
|
62
|
85
|
}
|