Browse Source

미납금관리

marseyes 2 years ago
parent
commit
0f463362e2

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

@@ -1,34 +1,17 @@
1 1
 package com.oqpo.api.service.loanmng;
2 2
 
3 3
 
4
-import com.oqpo.api.entity.loanmng.LoanMgntBaseInfoEntity;
5
-import com.oqpo.api.entity.loanmng.LoanMgntDsptProcEntity;
6
-import com.oqpo.api.entity.loanmng.LoanMgntDtlHstEntity;
7
-import com.oqpo.api.entity.oper.UserMngEntity;
8 4
 import com.oqpo.api.entity.settmng.StlMgntBaseInfoEntity;
9 5
 import com.oqpo.api.entity.settmng.StlMgntDtlPtclEntity;
10
-import com.oqpo.api.enums.DpstPayDvsn;
11
-import com.oqpo.api.enums.DpstStCd;
12
-import com.oqpo.api.enums.MediaDvsn;
13
-import com.oqpo.api.exception.GlobalException;
14
-import com.oqpo.api.mapper.loanmng.DsptMngMapper;
15 6
 import com.oqpo.api.mapper.loanmng.UnpaidMngMapper;
16
-import com.oqpo.api.mapper.oper.UserMngMapper;
17 7
 import com.oqpo.api.service.CommonService;
18
-import com.oqpo.api.util.DateUtil;
19 8
 import com.oqpo.api.web.dto.request.GridRequest;
20
-import com.oqpo.api.web.dto.request.loanmng.ApproveDsptRequest;
21
-import com.oqpo.api.web.dto.request.loanmng.RejectDsptRequest;
22
-import com.oqpo.api.web.dto.request.loanmng.RemoveDsptRequest;
23
-import com.oqpo.api.web.dto.request.loanmng.ReqDsptRequest;
24 9
 import com.oqpo.api.web.dto.response.GridResponse;
25
-import com.oqpo.api.web.dto.response.loanmng.DsptMngInfoResponse;
26
-import com.oqpo.api.web.dto.response.loanmng.DsptMngListResponse;
27 10
 import com.oqpo.api.web.dto.response.loanmng.UnpaidMngInfoResponse;
11
+import com.oqpo.api.web.dto.response.loanmng.UnpaidMngListResponse;
28 12
 import lombok.extern.slf4j.Slf4j;
29 13
 import org.springframework.beans.factory.annotation.Autowired;
30 14
 import org.springframework.stereotype.Service;
31
-import org.springframework.transaction.annotation.Transactional;
32 15
 
33 16
 import java.util.List;
34 17
 import java.util.stream.Collectors;
@@ -40,13 +23,10 @@ public class UnpaidMngService extends CommonService {
40 23
     @Autowired
41 24
     private UnpaidMngMapper unpaidMngMapper;
42 25
 
43
-    @Autowired
44
-    private UserMngMapper userMngMapper;
45
-
46 26
     /*
47 27
       미납금관리 그리드 리스트 조회
48 28
      */
49
-    public GridResponse selectDsptMngGridList(String sBrandId, String sStoreId, String fromDt, String toDt, GridRequest gridRequest) throws Exception {
29
+    public GridResponse selectUnpaidMngGridList(String sBrandId, String sStoreId, String fromDt, String toDt, GridRequest gridRequest) throws Exception {
50 30
         int gridPage = gridRequest.getGridPage();
51 31
         int gridSize = gridRequest.getGridSize();
52 32
 
@@ -54,13 +34,19 @@ public class UnpaidMngService extends CommonService {
54 34
         int gridTotal = fnCalculateGridTotal(gridSize, gridRecords);
55 35
         List<StlMgntBaseInfoEntity> entities = unpaidMngMapper.selectUnpaidMngGridList(sBrandId, sStoreId, fromDt, toDt, gridRequest);
56 36
         List<Object> gridRows = entities.stream()
57
-                .map(m -> DsptMngListResponse.builder()
37
+                .map(m -> UnpaidMngListResponse.builder()
58 38
                         .viewCd("R")
59
-
60
-                        .storeId(m.getStoreId())
61
-                        .storeNm(m.getStoreNm())
39
+                        .sttlMgntUnqNo(m.getSttlMgntUnqNo())
40
+                        .sttlReqDt(m.getSttlReqDt())
62 41
                         .brandId(m.getBrandId())
63 42
                         .brandNm(m.getBrandNm())
43
+                        .storeId(m.getStoreId())
44
+                        .storeNm(m.getStoreNm())
45
+                        .sttlStCd(m.getSttlStCd())
46
+                        .sttlStNm(m.getSttlStNm())
47
+                        .sttlReqAmt(m.getSttlReqAmt())
48
+                        .sttlDt(m.getSttlDt())
49
+                        .sttlAmt(m.getSttlAmt())
64 50
                         .build())
65 51
                 .collect(Collectors.toList());
66 52
         return GridResponse.toDTO(gridPage, gridTotal, gridRecords, gridRows);

+ 61 - 0
src/main/java/com/oqpo/api/web/controller/loanmng/UnpaidMngController.java

@@ -0,0 +1,61 @@
1
+package com.oqpo.api.web.controller.loanmng;
2
+
3
+import com.oqpo.api.service.loanmng.UnpaidMngService;
4
+import com.oqpo.api.web.dto.request.loanmng.*;
5
+import com.oqpo.api.web.dto.response.GridResponse;
6
+import com.oqpo.api.web.dto.response.loanmng.UnpaidMngInfoResponse;
7
+import io.swagger.annotations.Api;
8
+import io.swagger.annotations.ApiImplicitParam;
9
+import io.swagger.annotations.ApiImplicitParams;
10
+import io.swagger.annotations.ApiOperation;
11
+import lombok.extern.slf4j.Slf4j;
12
+import org.springframework.beans.factory.annotation.Autowired;
13
+import org.springframework.http.ResponseEntity;
14
+import org.springframework.web.bind.annotation.*;
15
+
16
+import javax.validation.Valid;
17
+
18
+@Slf4j
19
+@RestController
20
+@RequestMapping("/api/unpaid/mng")
21
+@Api(tags = {"미납금관리 (UnpaidMngController) -- 완료"})
22
+public class UnpaidMngController {
23
+
24
+    @Autowired
25
+    private UnpaidMngService unpaidMngService;
26
+
27
+    /**
28
+     * 설명 : 미납금관리 그리드 리스트
29
+     *
30
+     * @param unpaidMngGridRequest
31
+     * @return
32
+     * @throws Exception
33
+     */
34
+    @ApiImplicitParams({
35
+            @ApiImplicitParam(name = "X-AUTH-TOKEN", value = "CONN-KEY", required = true, dataType = "String", paramType = "header")
36
+    })
37
+    @ApiOperation(value = "미납금관리 그리드 리스트")
38
+    @PostMapping("/detail-grid-list")
39
+    public ResponseEntity<GridResponse> detailGridList(@RequestBody @Valid UnpaidMngGridRequest unpaidMngGridRequest) throws Exception {
40
+        return ResponseEntity.ok(unpaidMngService.selectUnpaidMngGridList(unpaidMngGridRequest.getSBrandId(), unpaidMngGridRequest.getSStoreId(),
41
+                unpaidMngGridRequest.getFromDt(), unpaidMngGridRequest.getToDt(), unpaidMngGridRequest.toDTO(unpaidMngGridRequest)));
42
+    }
43
+
44
+    /**
45
+     * 설명 : 미납금 정보
46
+     *
47
+     * @param sttlMgntUnqNo
48
+     * @return
49
+     * @throws Exception
50
+     */
51
+    @ApiImplicitParams({
52
+            @ApiImplicitParam(name = "X-AUTH-TOKEN", value = "CONN-KEY", required = true, dataType = "String", paramType = "header"),
53
+            @ApiImplicitParam(name = "sttlMgntUnqNo", value = "정산관리고유번호", required = true, dataType = "String", paramType = "query")
54
+    })
55
+    @ApiOperation(value = "미납금 정보")
56
+    @GetMapping("/info-unpaid")
57
+    public ResponseEntity<UnpaidMngInfoResponse> infoUnpaid(@RequestParam(value = "sttlMgntUnqNo") String sttlMgntUnqNo) throws Exception {
58
+        return ResponseEntity.ok(unpaidMngService.selectUnpaidMngInfo(sttlMgntUnqNo));
59
+    }
60
+
61
+}

+ 25 - 0
src/main/java/com/oqpo/api/web/dto/request/loanmng/UnpaidMngGridRequest.java

@@ -0,0 +1,25 @@
1
+package com.oqpo.api.web.dto.request.loanmng;
2
+
3
+import com.oqpo.api.web.dto.request.GridRequest;
4
+import io.swagger.annotations.ApiModelProperty;
5
+import lombok.Getter;
6
+import lombok.Setter;
7
+
8
+
9
+@Getter
10
+@Setter
11
+public class UnpaidMngGridRequest extends GridRequest {
12
+
13
+    @ApiModelProperty(value = "브랜드아이디")
14
+    private String sBrandId;
15
+    @ApiModelProperty(value = "매장아이디")
16
+    private String sStoreId;
17
+    @ApiModelProperty(value = "조회시작일자")
18
+    private String fromDt;
19
+    @ApiModelProperty(value = "조회종료일자")
20
+    private String toDt;
21
+
22
+    protected UnpaidMngGridRequest(Integer gridSize, Integer gridPage, String sidx, String sord, Boolean pagingYn, Integer gridFirst) {
23
+        super(gridSize, gridPage, sidx, sord, pagingYn, gridFirst);
24
+    }
25
+}

+ 46 - 3
src/main/java/com/oqpo/api/web/dto/response/loanmng/UnpaidMngInfoResponse.java

@@ -63,19 +63,62 @@ public class UnpaidMngInfoResponse {
63 63
     public static UnpaidMngInfoResponse toDTO(StlMgntBaseInfoEntity entity, List<StlMgntDtlPtclEntity> dtlPtclEntities) {
64 64
         if (entity == null) return null;
65 65
         return UnpaidMngInfoResponse.builder()
66
+                .sttlMgntUnqNo(entity.getSttlMgntUnqNo())
67
+                .sttlReqDt(entity.getSttlReqDt())
66 68
                 .brandId(entity.getBrandId())
67 69
                 .brandNm(entity.getBrandNm())
68
-
69 70
                 .storeId(entity.getStoreId())
70 71
                 .storeNm(entity.getStoreNm())
72
+                .sttlStCd(entity.getSttlStCd())
73
+                .sttlStNm(entity.getSttlStNm())
74
+                .sttlReqAmt(entity.getSttlReqAmt())
75
+                .sttlDt(entity.getSttlDt())
76
+                .sttlAmt(entity.getSttlAmt())
77
+                .sttlRegMgrNm(entity.getSttlRegMgrNm())
78
+                .sttlRegMgrId(entity.getSttlRegMgrId())
71 79
                 .sysRegDttm(entity.getSysRegDttm())
72 80
                 .sysRegId(entity.getSysRegId())
73 81
                 .sysChgDttm(entity.getSysChgDttm())
74 82
                 .sysChgId(entity.getSysChgId())
75 83
                 .stlDtlPtclList(dtlPtclEntities.stream()
76 84
                         .map(m -> StlDtlPtclInfo.builder()
77
-
78
-
85
+                                .sttlMgntUnqNo(m.getSttlMgntUnqNo())
86
+                                .sttlMgntDtlNo(m.getSttlMgntDtlNo())
87
+                                .brandId(m.getBrandId())
88
+                                .brandNm(m.getBrandNm())
89
+                                .whsMgntUnqNo(m.getWhsMgntUnqNo())
90
+                                .rtnMgntUnqNo(m.getRtnMgntUnqNo())
91
+                                .storeId(m.getStoreId())
92
+                                .storeNm(m.getStoreNm())
93
+                                .itemId(m.getItemId())
94
+                                .itemNm(m.getItemNm())
95
+                                .unit(m.getUnit())
96
+                                .unitAmt(m.getUnitAmt())
97
+                                .podrQty(m.getPodrQty())
98
+                                .dlvQty(m.getDlvQty())
99
+                                .whsQty(m.getWhsQty())
100
+                                .colQty(m.getColQty())
101
+                                .whsColQty(m.getWhsColQty())        /* 입고/수거수량 */
102
+                                .dlvCmpltDt(m.getDlvCmpltDt())
103
+                                .colDt(m.getColDt())
104
+                                .whsColDt(m.getWhsColDt())          /* 입고/수거일자 */
105
+                                .whsAmt(m.getWhsAmt())
106
+                                .colAmt(m.getColAmt())
107
+                                .whsColAmt(m.getWhsColAmt())        /* 입고/수거금액 */
108
+                                .sttlDvsn(m.getSttlDvsn())
109
+                                .sttlDvsnNm(m.getSttlDvsnNm())
110
+                                .pchPodrUnqNo(m.getPchPodrUnqNo())
111
+                                .pchPodrDtlNo(m.getPchPodrDtlNo())
112
+                                .pchReqUnqNo(m.getPchReqUnqNo())
113
+                                .pchReqDtlNo(m.getPchReqDtlNo())
114
+                                .rtnPodrUnqNo(m.getRtnPodrUnqNo())
115
+                                .rtnPodrDtlNo(m.getRtnPodrDtlNo())
116
+                                .rtnReqUnqNo(m.getRtnReqUnqNo())
117
+                                .rtnReqDtlNo(m.getRtnReqDtlNo())
118
+                                .sysRegDttm(m.getSysRegDttm())
119
+                                .sysRegId(m.getSysRegId())
120
+                                .sysChgDttm(m.getSysChgDttm())
121
+                                .sysChgId(m.getSysChgId())
79 122
                                 .build())
80 123
                         .collect(Collectors.toList()))
81 124
                 .build();

+ 42 - 0
src/main/java/com/oqpo/api/web/dto/response/loanmng/UnpaidMngListResponse.java

@@ -0,0 +1,42 @@
1
+package com.oqpo.api.web.dto.response.loanmng;
2
+
3
+import com.fasterxml.jackson.annotation.JsonInclude;
4
+import io.swagger.annotations.ApiModelProperty;
5
+import lombok.*;
6
+
7
+@Getter
8
+@Setter
9
+@Builder
10
+@AllArgsConstructor(access = AccessLevel.PROTECTED)
11
+@JsonInclude(JsonInclude.Include.ALWAYS)
12
+public class UnpaidMngListResponse {
13
+
14
+    @ApiModelProperty(value = "CRUD")
15
+    private String viewCd;
16
+
17
+    @ApiModelProperty(value = "정산관리고유번호")
18
+    private String sttlMgntUnqNo;
19
+    @ApiModelProperty(value = "브랜드아이디")
20
+    private String brandId;
21
+    @ApiModelProperty(value = "브랜드명")
22
+    private String brandNm;
23
+    @ApiModelProperty(value = "매장아이디")
24
+    private String storeId;
25
+    @ApiModelProperty(value = "매장명")
26
+    private String storeNm;
27
+    @ApiModelProperty(value = "정산상태코드")
28
+    private String sttlStCd;
29
+    @ApiModelProperty(value = "정산상태명")
30
+    private String sttlStNm;
31
+    @ApiModelProperty(value = "정산요청일자")
32
+    private String sttlReqDt;
33
+    @ApiModelProperty(value = "정산요청금액")
34
+    private long sttlReqAmt;
35
+    @ApiModelProperty(value = "정산일자")
36
+    private String sttlDt;
37
+    @ApiModelProperty(value = "정산금액")
38
+    private long sttlAmt;
39
+    @ApiModelProperty(value = "계좌잔액")
40
+    private long acctBal;
41
+
42
+}