Browse Source

공급사 납품서 현황, 입고처리대상 현황

dwkim 2 years ago
parent
commit
5dff728a9b

+ 2 - 0
src/main/java/com/oqpo/api/entity/inoutmng/DeliDtlMgntEntity.java

@@ -34,6 +34,8 @@ public class DeliDtlMgntEntity implements Serializable {
34 34
     private String sysRegId;
35 35
     private String sysChgDttm;
36 36
     private String sysChgId;
37
+    private Integer whsQty;
38
+    private Integer whsAmt;
37 39
 
38 40
 
39 41
 }

+ 1 - 0
src/main/java/com/oqpo/api/entity/inoutmng/DeliInfoMgntEntity.java

@@ -48,6 +48,7 @@ public class DeliInfoMgntEntity implements Serializable {
48 48
     private String whsAddr;
49 49
     private String whsMgrTelNo;
50 50
 
51
+
51 52
     private String dlvBsnsRegno;
52 53
     private String dlvNm;
53 54
     private String dlvOwnerNm;

+ 6 - 0
src/main/java/com/oqpo/api/mapper/inoutmng/ShmtOdrMapper.java

@@ -42,4 +42,10 @@ public interface ShmtOdrMapper {
42 42
     List<DeliInfoMgntEntity> selectDeliGridList(@Param("sBrandId") String sBrandId, @Param("dtGubun") String dtGubun, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sDlvStCd") String sDlvStCd, @Param("sSpplyId") String sSpplyId, @Param("sWhsId") String sWhsId, @Param("sItemNm") String sItemNm, GridRequest gridRequest )throws Exception;
43 43
     int selectDeliGridCnt(@Param("sBrandId") String sBrandId, @Param("dtGubun") String dtGubun, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sDlvStCd") String sDlvStCd, @Param("sSpplyId") String sSpplyId, @Param("sWhsId") String sWhsId, @Param("sItemNm") String sItemNm )throws Exception;
44 44
 
45
+    List<DeliInfoMgntEntity> selectSpplyDeliGridList(@Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sSpplyId") String sSpplyId, @Param("sWhsId") String sWhsId, @Param("sItemNm") String sItemNm, GridRequest gridRequest )throws Exception;
46
+    int selectSpplyDeliGridCnt(@Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sSpplyId") String sSpplyId, @Param("sWhsId") String sWhsId, @Param("sItemNm") String sItemNm )throws Exception;
47
+
48
+    List<DeliInfoMgntEntity> selectWarehouseTargetGridList(@Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sWhsId") String sWhsId,  @Param("sSpplyId") String sSpplyId, @Param("sDlvSttmtUnqNo") String  sDlvSttmtUnqNo,  @Param("sItemNm") String sItemNm, GridRequest gridRequest )throws Exception;
49
+    int selectWarehouseTargetGridCnt(@Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sWhsId") String sWhsId,  @Param("sSpplyId") String sSpplyId, @Param("sDlvSttmtUnqNo") String  sDlvSttmtUnqNo,  @Param("sItemNm") String sItemNm )throws Exception;
50
+
45 51
 }

+ 93 - 1
src/main/java/com/oqpo/api/service/inoutmng/ShmtOdrService.java

@@ -727,6 +727,7 @@ public class ShmtOdrService extends CommonService {
727 727
                         .dlvRegDt(m.getDlvRegDt() == null ? "" : m.getDlvRegDt())
728 728
                         .dlvReqDt(m.getDlvReqDt() == null ? "" : m.getDlvReqDt())
729 729
                         .dlvSchDt(m.getDlvSchDt() == null ? "" : m.getDlvSchDt())
730
+                        .dlvCmpltDt(m.getDlvCmpltDt() == null ? "" : m.getDlvCmpltDt())
730 731
                         .itemId(m.getDeliDtlMgntInfo() == null ? "" : m.getDeliDtlMgntInfo().getItemId() == null ? "" : m.getDeliDtlMgntInfo().getItemId())
731 732
                         .itemNm(m.getDeliDtlMgntInfo() == null ? "" : m.getDeliDtlMgntInfo().getItemNm() == null ? "" : m.getDeliDtlMgntInfo().getItemNm())
732 733
                         .podrQty(m.getDeliDtlMgntInfo() == null ? 0 : m.getDeliDtlMgntInfo().getPodrQty() == null ? 0 : m.getDeliDtlMgntInfo().getPodrQty())
@@ -734,7 +735,98 @@ public class ShmtOdrService extends CommonService {
734 735
                         .unit(m.getDeliDtlMgntInfo() == null ? "" : m.getDeliDtlMgntInfo().getUnit() == null ? "" : m.getDeliDtlMgntInfo().getUnit())
735 736
                         .unitAmt(m.getDeliDtlMgntInfo() == null ? 0 : m.getDeliDtlMgntInfo().getUnitAmt() == null ? 0 : m.getDeliDtlMgntInfo().getUnitAmt())
736 737
                         .dlvMgrNm(m.getDlvMgrNm() == null ? "" : m.getDlvMgrNm())
737
-                        .dlvMgrMblNo(m.getDlvMgrMblNo() == null ? "" : m.getDlvMgrMblNo())
738
+                        .dlvMgrTelNo(m.getDlvMgrTelNo() == null ? "" : m.getDlvMgrTelNo())
739
+                        .build())
740
+                .collect(Collectors.toList());
741
+        return GridResponse.toDTO(gridPage, gridTotal, gridRecords, gridRows);
742
+    }
743
+
744
+
745
+    /*
746
+      공급사  - 납품서 현황 그리드 리스트 조회
747
+     */
748
+    public GridResponse selectSpplyDeliGridList(String sBrandId, String fromDt, String toDt, String sSpplyId, String sWhsId, String sItemNm, GridRequest gridRequest) throws Exception {
749
+        int gridPage = gridRequest.getGridPage();
750
+        int gridSize = gridRequest.getGridSize();
751
+
752
+        fromDt = fromDt == null ? null : fromDt.replace(".", "");
753
+        toDt = toDt == null ? null : toDt.replace(".", "");
754
+
755
+        int gridRecords = shmtOdrMapper.selectSpplyDeliGridCnt(sBrandId,  fromDt, toDt, sSpplyId, sWhsId, sItemNm);
756
+        int gridTotal = fnCalculateGridTotal(gridSize, gridRecords);
757
+        List<DeliInfoMgntEntity> entities = shmtOdrMapper.selectSpplyDeliGridList(sBrandId, fromDt, toDt, sSpplyId, sWhsId, sItemNm, gridRequest);
758
+        List<Object> gridRows = entities.stream()
759
+                .map(m -> DeliDtlSearchListResponse.builder()
760
+                        .viewCd("R")
761
+                        .brandId(m.getBrandId() == null ? "" : m.getBrandId())
762
+                        .brandNm(m.getBrandNm() == null ? "" : m.getBrandNm())
763
+                        .dlvSttmtUnqNo(m.getDlvSttmtUnqNo() == null ? "" : m.getDlvSttmtUnqNo())
764
+                        .spplyId(m.getSpplyId() == null ? "" : m.getSpplyId())
765
+                        .spplyNm(m.getSpplyNm() == null ? "" : m.getSpplyNm())
766
+                        .dlvStCd(m.getDlvStCd() == null ? "" : m.getDlvStCd())
767
+                        .dlvStNm(m.getDlvStNm() == null ? "" : m.getDlvStNm())
768
+                        .whsId(m.getWhsId() == null ? "" :m.getWhsId())
769
+                        .location(m.getLocation() == null ? "" : m.getLocation())
770
+                        .whsNm(m.getWhsNm() == null ? "" : m.getWhsNm() + " - " + m.getLocationNm())
771
+                        .podrRegDt(m.getPodrRegDt() == null ? "" : m.getPodrRegDt())
772
+                        .dlvRegDt(m.getDlvRegDt() == null ? "" : m.getDlvRegDt())
773
+                        .dlvReqDt(m.getDlvReqDt() == null ? "" : m.getDlvReqDt())
774
+                        .dlvSchDt(m.getDlvSchDt() == null ? "" : m.getDlvSchDt())
775
+                        .dlvCmpltDt(m.getDlvCmpltDt() == null ? "" : m.getDlvCmpltDt())
776
+                        .itemId(m.getDeliDtlMgntInfo() == null ? "" : m.getDeliDtlMgntInfo().getItemId() == null ? "" : m.getDeliDtlMgntInfo().getItemId())
777
+                        .itemNm(m.getDeliDtlMgntInfo() == null ? "" : m.getDeliDtlMgntInfo().getItemNm() == null ? "" : m.getDeliDtlMgntInfo().getItemNm())
778
+                        .podrQty(m.getDeliDtlMgntInfo() == null ? 0 : m.getDeliDtlMgntInfo().getPodrQty() == null ? 0 : m.getDeliDtlMgntInfo().getPodrQty())
779
+                        .dlvQty(m.getDeliDtlMgntInfo() == null ? 0 : m.getDeliDtlMgntInfo().getDlvQty() == null ? 0 : m.getDeliDtlMgntInfo().getDlvQty())
780
+                        .unit(m.getDeliDtlMgntInfo() == null ? "" : m.getDeliDtlMgntInfo().getUnit() == null ? "" : m.getDeliDtlMgntInfo().getUnit())
781
+                        .unitAmt(m.getDeliDtlMgntInfo() == null ? 0 : m.getDeliDtlMgntInfo().getUnitAmt() == null ? 0 : m.getDeliDtlMgntInfo().getUnitAmt())
782
+                        .dlvMgrNm(m.getDlvMgrNm() == null ? "" : m.getDlvMgrNm())
783
+                        .dlvMgrTelNo(m.getDlvMgrTelNo() == null ? "" : m.getDlvMgrTelNo())
784
+                        .build())
785
+                .collect(Collectors.toList());
786
+        return GridResponse.toDTO(gridPage, gridTotal, gridRecords, gridRows);
787
+    }
788
+
789
+    /*
790
+      입고처리 그리드 리스트 조회
791
+     */
792
+    public GridResponse selectWarehouseTargetList(String sBrandId, String fromDt, String toDt, String sWhsId, String sSpplyId, String sDlvSttmtUnqNo, String sItemNm, GridRequest gridRequest) throws Exception {
793
+        int gridPage = gridRequest.getGridPage();
794
+        int gridSize = gridRequest.getGridSize();
795
+
796
+        fromDt = fromDt == null ? null : fromDt.replace(".", "");
797
+        toDt = toDt == null ? null : toDt.replace(".", "");
798
+
799
+        int gridRecords = shmtOdrMapper.selectWarehouseTargetGridCnt(sBrandId,  fromDt, toDt, sWhsId, sSpplyId, sDlvSttmtUnqNo, sItemNm);
800
+        int gridTotal = fnCalculateGridTotal(gridSize, gridRecords);
801
+        List<DeliInfoMgntEntity> entities = shmtOdrMapper.selectWarehouseTargetGridList(sBrandId,  fromDt, toDt, sWhsId, sSpplyId, sDlvSttmtUnqNo, sItemNm, gridRequest);
802
+        List<Object> gridRows = entities.stream()
803
+                .map(m -> WarehouseTargetResponse.builder()
804
+                        .viewCd("R")
805
+                        .brandId(m.getBrandId() == null ? "" : m.getBrandId())
806
+                        .brandNm(m.getBrandNm() == null ? "" : m.getBrandNm())
807
+                        .dlvSttmtUnqNo(m.getDlvSttmtUnqNo() == null ? "" : m.getDlvSttmtUnqNo())
808
+                        .dlvSttmtDtlNo(m.getDeliDtlMgntInfo() == null ? "" : m.getDeliDtlMgntInfo().getDlvSttmtDtlNo() == null ? "" : m.getDeliDtlMgntInfo().getDlvSttmtDtlNo())
809
+                        .itemId(m.getDeliDtlMgntInfo() == null ? "" : m.getDeliDtlMgntInfo().getItemId() == null ? "" : m.getDeliDtlMgntInfo().getItemId())
810
+                        .itemNm(m.getDeliDtlMgntInfo() == null ? "" : m.getDeliDtlMgntInfo().getItemNm() == null ? "" : m.getDeliDtlMgntInfo().getItemNm())
811
+                        .podrQty(m.getDeliDtlMgntInfo() == null ? 0 : m.getDeliDtlMgntInfo().getPodrQty() == null ? 0 : m.getDeliDtlMgntInfo().getPodrQty())
812
+                        .dlvQty(m.getDeliDtlMgntInfo() == null ? 0 : m.getDeliDtlMgntInfo().getDlvQty() == null ? 0 : m.getDeliDtlMgntInfo().getDlvQty())
813
+                        .whsQty(m.getDeliDtlMgntInfo() == null ? 0 : m.getDeliDtlMgntInfo().getWhsQty() == null ? 0 : m.getDeliDtlMgntInfo().getWhsQty())
814
+                        .whsAmt(m.getDeliDtlMgntInfo() == null ? 0 : m.getDeliDtlMgntInfo().getWhsAmt() == null ? 0 : m.getDeliDtlMgntInfo().getWhsAmt())
815
+                        .unit(m.getDeliDtlMgntInfo() == null ? "" : m.getDeliDtlMgntInfo().getUnit() == null ? "" : m.getDeliDtlMgntInfo().getUnit())
816
+                        .unitAmt(m.getDeliDtlMgntInfo() == null ? 0 : m.getDeliDtlMgntInfo().getUnitAmt() == null ? 0 : m.getDeliDtlMgntInfo().getUnitAmt())
817
+                        .whsId(m.getWhsId() == null ? "" :m.getWhsId())
818
+                        .location(m.getLocation() == null ? "" : m.getLocation())
819
+                        .whsNm(m.getWhsNm() == null ? "" : m.getWhsNm() + " - " + m.getLocationNm())
820
+                        .dlvReqDt(m.getDlvReqDt() == null ? "" : m.getDlvReqDt())
821
+                        .dlvSchDt(m.getDlvSchDt() == null ? "" : m.getDlvSchDt())
822
+                        .dlvMgrNm(m.getDlvMgrNm() == null ? "" : m.getDlvMgrNm())
823
+                        .dlvMgrTelNo(m.getDlvMgrTelNo() == null ? "" : m.getDlvMgrTelNo())
824
+                        .pchPodrUnqNo(m.getDeliDtlMgntInfo() == null ? "" : m.getDeliDtlMgntInfo().getPchPodrUnqNo() == null ? "" : m.getDeliDtlMgntInfo().getPchPodrUnqNo())
825
+                        .pchPodrDtlNo(m.getDeliDtlMgntInfo() == null ? "" : m.getDeliDtlMgntInfo().getPchPodrDtlNo() == null ? "" : m.getDeliDtlMgntInfo().getPchPodrDtlNo())
826
+                        .pchReqUnqNo(m.getDeliDtlMgntInfo() == null ? "" : m.getDeliDtlMgntInfo().getPchReqUnqNo() == null ? "" : m.getDeliDtlMgntInfo().getPchReqUnqNo())
827
+                        .pchReqDltNo(m.getDeliDtlMgntInfo() == null ? "" : m.getDeliDtlMgntInfo().getPchReqDtlNo() == null ? "" : m.getDeliDtlMgntInfo().getPchReqDtlNo())
828
+                        .spplyId(m.getSpplyId() == null ? "" : m.getSpplyId())
829
+                        .spplyNm(m.getSpplyNm() == null ? "" : m.getSpplyNm())
738 830
                         .build())
739 831
                 .collect(Collectors.toList());
740 832
         return GridResponse.toDTO(gridPage, gridTotal, gridRecords, gridRows);

+ 34 - 0
src/main/java/com/oqpo/api/web/controller/inoutmng/ShmtOdrController.java

@@ -174,4 +174,38 @@ public class ShmtOdrController {
174 174
     public ResponseEntity<GridResponse> selectDeliGridList(@RequestBody @Valid DeliDtlGridRequest deliDtlGridRequest) throws Exception {
175 175
         return ResponseEntity.ok(shmtOdrService.selectDeliGridList(deliDtlGridRequest.getSBrandId(), deliDtlGridRequest.getDtlGubun(), deliDtlGridRequest.getFromDt(), deliDtlGridRequest.getToDt(), deliDtlGridRequest.getSDlvStCd(),  deliDtlGridRequest.getSSpplyId(), deliDtlGridRequest.getSWhsId(), deliDtlGridRequest.getSItemNm(),  deliDtlGridRequest.toDTO(deliDtlGridRequest)));
176 176
     }
177
+
178
+    /**
179
+     * 설명 : 공급사 납품서 현황 그리드 리스트
180
+     *
181
+     * @param SpplyDeliDtlGridRequest
182
+     * @return
183
+     * @throws Exception
184
+     */
185
+
186
+    @ApiImplicitParams({
187
+            @ApiImplicitParam(name = "X-AUTH-TOKEN", value = "CONN-KEY", required = true, dataType = "String", paramType = "header")
188
+    })
189
+    @ApiOperation(value = " 공급사 - 납품서 현황 그리드 리스트")
190
+    @PostMapping("/spply-deli-grid-list")
191
+    public ResponseEntity<GridResponse> selectSpplyDeliGridList(@RequestBody @Valid SpplyDeliDtlGridRequest spplyDeliDtlGridRequest) throws Exception {
192
+        return ResponseEntity.ok(shmtOdrService.selectSpplyDeliGridList(spplyDeliDtlGridRequest.getSBrandId(), spplyDeliDtlGridRequest.getFromDt(), spplyDeliDtlGridRequest.getToDt(),  spplyDeliDtlGridRequest.getSSpplyId(), spplyDeliDtlGridRequest.getSWhsId(), spplyDeliDtlGridRequest.getSItemNm(),  spplyDeliDtlGridRequest.toDTO(spplyDeliDtlGridRequest)));
193
+    }
194
+
195
+    /**
196
+     * 설명 : 입고처리 대상 리스트
197
+     *
198
+     * @param SpplyDeliDtlGridRequest
199
+     * @return
200
+     * @throws Exception
201
+     */
202
+
203
+    @ApiImplicitParams({
204
+            @ApiImplicitParam(name = "X-AUTH-TOKEN", value = "CONN-KEY", required = true, dataType = "String", paramType = "header")
205
+    })
206
+    @ApiOperation(value = " 입고처리 대상 그리드 리스트")
207
+    @PostMapping("/warehouse-target-grid-list")
208
+    public ResponseEntity<GridResponse> selectSpplyDeliGridList(@RequestBody @Valid WarehouseTragetGridRequest warehouseTragetGridRequest) throws Exception {
209
+        return ResponseEntity.ok(shmtOdrService.selectWarehouseTargetList(warehouseTragetGridRequest.getSBrandId(), warehouseTragetGridRequest.getFromDt(), warehouseTragetGridRequest.getToDt(), warehouseTragetGridRequest.getSWhsId(), warehouseTragetGridRequest.getSSpplyId(), warehouseTragetGridRequest.getSDlvSttmtUnqNo(), warehouseTragetGridRequest.getSItemNm(),  warehouseTragetGridRequest.toDTO(warehouseTragetGridRequest)));
210
+    }
177 211
 }

+ 43 - 0
src/main/java/com/oqpo/api/web/dto/request/inoutmng/SpplyDeliDtlGridRequest.java

@@ -0,0 +1,43 @@
1
+package com.oqpo.api.web.dto.request.inoutmng;
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
+import javax.validation.constraints.NotBlank;
9
+
10
+
11
+@Getter
12
+@Setter
13
+public class SpplyDeliDtlGridRequest extends GridRequest {
14
+
15
+    @NotBlank
16
+    @ApiModelProperty(value = "브랜드아이디")
17
+    private String sBrandId;
18
+
19
+    @NotBlank
20
+    @ApiModelProperty(value = "공급업체코드")
21
+    private String sSpplyId;
22
+
23
+    @NotBlank
24
+    @ApiModelProperty(value = "시작일자")
25
+    private String fromDt;
26
+
27
+    @NotBlank
28
+    @ApiModelProperty(value = "종료일자")
29
+    private String toDt;
30
+
31
+
32
+    @ApiModelProperty(value = "납품창고아이디")
33
+    private String sWhsId;
34
+
35
+    @ApiModelProperty(value = "품목명")
36
+    private String sItemNm;
37
+
38
+
39
+
40
+    protected SpplyDeliDtlGridRequest(Integer gridSize, Integer gridPage, String sidx, String sord, Boolean pagingYn, Integer gridFirst) {
41
+        super(gridSize, gridPage, sidx, sord, pagingYn, gridFirst);
42
+    }
43
+}

+ 46 - 0
src/main/java/com/oqpo/api/web/dto/request/inoutmng/WarehouseTragetGridRequest.java

@@ -0,0 +1,46 @@
1
+package com.oqpo.api.web.dto.request.inoutmng;
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
+import javax.validation.constraints.NotBlank;
9
+
10
+
11
+@Getter
12
+@Setter
13
+public class WarehouseTragetGridRequest extends GridRequest {
14
+
15
+    @NotBlank
16
+    @ApiModelProperty(value = "브랜드아이디")
17
+    private String sBrandId;
18
+
19
+    @NotBlank
20
+    @ApiModelProperty(value = "납품창고아이디")
21
+    private String sWhsId;
22
+
23
+    @NotBlank
24
+    @ApiModelProperty(value = "시작일자")
25
+    private String fromDt;
26
+
27
+    @NotBlank
28
+    @ApiModelProperty(value = "종료일자")
29
+    private String toDt;
30
+
31
+    @ApiModelProperty(value = "공급업체코드")
32
+    private String sSpplyId;
33
+
34
+    @ApiModelProperty(value = "납품서번호")
35
+    private String sDlvSttmtUnqNo;
36
+
37
+    @ApiModelProperty(value = "품목명")
38
+    private String sItemNm;
39
+
40
+
41
+
42
+
43
+    protected WarehouseTragetGridRequest(Integer gridSize, Integer gridPage, String sidx, String sord, Boolean pagingYn, Integer gridFirst) {
44
+        super(gridSize, gridPage, sidx, sord, pagingYn, gridFirst);
45
+    }
46
+}

+ 4 - 3
src/main/java/com/oqpo/api/web/dto/response/inoutmng/DeliDtlSearchListResponse.java

@@ -24,17 +24,18 @@ public class DeliDtlSearchListResponse {
24 24
     @ApiModelProperty(value = "납품창고아이디") private String whsId;
25 25
     @ApiModelProperty(value = "납품LOCATION") private String location;
26 26
     @ApiModelProperty(value = "납품창고명") private String whsNm;
27
-    @ApiModelProperty(value = "발주생성일") private String podrRegDt;
27
+    @ApiModelProperty(value = "발주생성일/수주일자") private String podrRegDt;
28 28
     @ApiModelProperty(value = "납품생성일") private String dlvRegDt;
29 29
     @ApiModelProperty(value = "납품요청일") private String dlvReqDt;
30 30
     @ApiModelProperty(value = "납품예정일") private String dlvSchDt;
31
+    @ApiModelProperty(value = "납품완료일") private String dlvCmpltDt;
31 32
     @ApiModelProperty(value = "품목아이디") private String itemId;
32 33
     @ApiModelProperty(value = "품목명") private String itemNm;
33 34
     @ApiModelProperty(value = "발주금액") private Integer podrQty;
34
-    @ApiModelProperty(value = "납품수량") private Integer dlvQty;
35
+    @ApiModelProperty(value = "납품/수주 수량") private Integer dlvQty;
35 36
     @ApiModelProperty(value = "단위") private String unit;
36 37
     @ApiModelProperty(value = "납품금액") private Integer unitAmt;
37 38
     @ApiModelProperty(value = "납품담당자명") private String dlvMgrNm;
38
-    @ApiModelProperty(value = "납품담당자연락처") private String dlvMgrMblNo;
39
+    @ApiModelProperty(value = "납품담당자연락처") private String dlvMgrTelNo;
39 40
 
40 41
 }

+ 43 - 0
src/main/java/com/oqpo/api/web/dto/response/inoutmng/WarehouseTargetResponse.java

@@ -0,0 +1,43 @@
1
+package com.oqpo.api.web.dto.response.inoutmng;
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 WarehouseTargetResponse {
13
+
14
+    @ApiModelProperty(value = "CRUD")
15
+    private String viewCd;
16
+
17
+    @ApiModelProperty(value = "브랜드아이디") private String brandId;
18
+    @ApiModelProperty(value = "브랜드명") private String brandNm;
19
+    @ApiModelProperty(value = "납품서번호") private String dlvSttmtUnqNo;
20
+    @ApiModelProperty(value = "납품서번호") private String dlvSttmtDtlNo;
21
+    @ApiModelProperty(value = "품목아이디") private String itemId;
22
+    @ApiModelProperty(value = "품목명") private String itemNm;
23
+    @ApiModelProperty(value = "발주금액") private Integer podrQty;
24
+    @ApiModelProperty(value = "납품/수주 수량") private Integer dlvQty;
25
+    @ApiModelProperty(value = "입고 수량") private Integer whsQty;
26
+    @ApiModelProperty(value = "입고금액") private Integer whsAmt;
27
+    @ApiModelProperty(value = "단가") private Integer unitAmt;
28
+    @ApiModelProperty(value = "납품창고아이디") private String whsId;
29
+    @ApiModelProperty(value = "납품LOCATION") private String location;
30
+    @ApiModelProperty(value = "납품창고명") private String whsNm;
31
+    @ApiModelProperty(value = "납품요청일") private String dlvReqDt;
32
+    @ApiModelProperty(value = "납품예정일") private String dlvSchDt;
33
+    @ApiModelProperty(value = "납품담당자명") private String dlvMgrNm;
34
+    @ApiModelProperty(value = "납품담당자연락처") private String dlvMgrTelNo;
35
+    @ApiModelProperty(value = "구매발주번호") private String pchPodrUnqNo;
36
+    @ApiModelProperty(value = "구매발주항번") private String pchPodrDtlNo;
37
+    @ApiModelProperty(value = "구매요청번호") private String pchReqUnqNo;
38
+    @ApiModelProperty(value = "구매요청항번") private String pchReqDltNo;
39
+    @ApiModelProperty(value = "단위") private String unit;
40
+    @ApiModelProperty(value = "공급사아이디") private String spplyId;
41
+    @ApiModelProperty(value = "공급사명") private String spplyNm;
42
+
43
+}

+ 147 - 2
src/main/resources/mybatis/sqlmaps/inoutmng/ShmtOdr.xml

@@ -362,6 +362,7 @@
362 362
             , fn_whs_location_nm(info.brand_id, info.whs_id, info.location) as location_nm
363 363
             , date_format(info.podr_reg_dt, '%Y.%m.%d') as podr_reg_dt, date_format(info.dlv_req_dt, '%y.%m.%d') as dlv_req_dt
364 364
             , date_format(info.dlv_reg_dt, '%Y.%m.%d') as dlv_req_dt, date_format(info.dlv_sch_dt, '%y.%m.%d') as dlv_sch_dt
365
+            , date_format(info.dlv_cmplt_dt, '%y.%m.%d') as dlv_cmplt_dt
365 366
             , ptcl.item_id as 'deliDtlMgntInfo.item_id', ptcl.item_nm as 'deliDtlMgntInfo.item_nm'
366 367
             , ptcl.podr_qty as 'deliDtlMgntInfo.podr_qty', ptcl.dlv_qty as 'deliDtlMgntInfo.dlv_qty'
367 368
             , ptcl.unit as 'deliDtlMgntInfo.unit', ptcl.unit_amt as 'deliDtlMgntInfo.unit_amt'
@@ -378,7 +379,10 @@
378 379
             and info.dlv_req_dt between #{fromDt} and #{toDt}   -- 2인경우 납품요청일로 조회
379 380
         </if>
380 381
         <if test="dtGubun eq '3'.toString()">
381
-            and info.dlv_reg_dt between #{fromDt} and #{toDt}    -- 3인경우 납품생성일로 조회
382
+            and info.dlv_sch_dt between #{fromDt} and #{toDt}    -- 3인경우 납품예정일로 조회
383
+        </if>
384
+        <if test="dtGubun eq '4'.toString()">
385
+            and info.dlv_cmplt_dt between #{fromDt} and #{toDt}    -- 3인경우 납품완료일 조회
382 386
         </if>
383 387
         <if test="sDlvStCd != null and sDlvStCd != ''">
384 388
             and info.dlv_st_cd = #{sDlvStCd}  -- 납품상태
@@ -426,7 +430,10 @@
426 430
             and info.dlv_req_dt between #{fromDt} and #{toDt}   -- 2인경우 납품요청일로 조회
427 431
         </if>
428 432
         <if test="dtGubun eq '3'.toString()">
429
-            and info.dlv_reg_dt between #{fromDt} and #{toDt}    -- 3인경우 납품생성일로 조회
433
+            and info.dlv_sch_dt between #{fromDt} and #{toDt}    -- 3인경우 납품예정일로 조회
434
+        </if>
435
+        <if test="dtGubun eq '4'.toString()">
436
+            and info.dlv_cmplt_dt between #{fromDt} and #{toDt}    -- 3인경우 납품완료일 조회
430 437
         </if>
431 438
         <if test="sDlvStCd != null and sDlvStCd != ''">
432 439
             and info.dlv_st_cd = #{sDlvStCd}  -- 납품상태
@@ -442,4 +449,142 @@
442 449
         </if>
443 450
     </select>
444 451
 
452
+    <select id="selectSpplyDeliGridList" resultType="com.oqpo.api.entity.inoutmng.DeliInfoMgntEntity">
453
+        select info.brand_id, fn_brand_nm(info.brand_id) as brand_nm, info.dlv_sttmt_unq_no
454
+        , info.spply_id, info.spply_nm, info.dlv_st_cd, fn_code_nm(upper('dlv_st_cd'), info.dlv_st_cd) as dlv_st_nm
455
+        , info.whs_id, info.location, fn_whs_nm(info.brand_id, info.whs_id) as whs_nm
456
+        , fn_whs_location_nm(info.brand_id, info.whs_id, info.location) as location_nm
457
+        , date_format(info.podr_reg_dt, '%Y.%m.%d') as podr_reg_dt, date_format(info.dlv_req_dt, '%y.%m.%d') as dlv_req_dt
458
+        , date_format(info.dlv_reg_dt, '%Y.%m.%d') as dlv_req_dt, date_format(info.dlv_sch_dt, '%y.%m.%d') as dlv_sch_dt
459
+        , date_format(info.dlv_cmplt_dt, '%y.%m.%d') as dlv_cmplt_dt
460
+        , ptcl.item_id as 'deliDtlMgntInfo.item_id', ptcl.item_nm as 'deliDtlMgntInfo.item_nm'
461
+        , ptcl.podr_qty as 'deliDtlMgntInfo.podr_qty', ptcl.dlv_qty as 'deliDtlMgntInfo.dlv_qty'
462
+        , ptcl.unit as 'deliDtlMgntInfo.unit', ptcl.unit_amt as 'deliDtlMgntInfo.unit_amt'
463
+        , info.dlv_mgr_nm , info.dlv_mgr_mbl_no
464
+        from deli_info_mgnt info
465
+        , deli_dtl_ptcl ptcl
466
+        where 1 = 1
467
+        and info.dlv_sttmt_unq_no = ptcl.dlv_sttmt_unq_no
468
+        and info.brand_id = #{sBrandId}
469
+        and info.spply_id = #{sSpplyId}
470
+        and info.dlv_sch_dt between #{fromDt} and #{toDt}  -- 납품 예정일
471
+        <if test="sWhsId != null and sWhsId != ''">
472
+            and info.whs_id = #{sWhsId}
473
+        </if>
474
+        <if test="sItemNm != null and sItemNm != ''">
475
+            and (ptcl.item_id like concat('%', #{sItemNm}, '%') or ptcl.item_nm like concat('%', #{sItemNm}, '%'))
476
+        </if>
477
+        <choose>
478
+            <when test="gridRequest.sidx != null and gridRequest.sidx != ''">
479
+                <if test="gridRequest.sidx == 'VIEW_NUM'.toString()">
480
+                    <if test="gridRequest.sord == 'asc'.toString()">
481
+                        order by pch_req_unq_no asc
482
+                    </if>
483
+                    <if test="gridRequest.sord == 'desc'.toString()">
484
+                        order by pch_req_unq_no desc
485
+                    </if>
486
+                </if>
487
+            </when>
488
+            <otherwise>
489
+                order by pch_req_unq_no desc
490
+            </otherwise>
491
+        </choose>
492
+        <if test="gridRequest.pagingYn == true">
493
+            limit #{gridRequest.gridFirst}, #{gridRequest.gridSize}
494
+        </if>
495
+    </select>
496
+
497
+    <select id="selectSpplyDeliGridCnt" resultType="int">
498
+        select count(*)
499
+        from deli_info_mgnt info
500
+        , deli_dtl_ptcl ptcl
501
+        where 1 = 1
502
+        and info.dlv_sttmt_unq_no = ptcl.dlv_sttmt_unq_no
503
+        and info.brand_id = #{sBrandId}
504
+        and info.spply_id = #{sSpplyId}
505
+        and info.dlv_sch_dt between #{fromDt} and #{toDt}  -- 납품 예정일
506
+        <if test="sWhsId != null and sWhsId != ''">
507
+            and info.whs_id = #{sWhsId}
508
+        </if>
509
+        <if test="sItemNm != null and sItemNm != ''">
510
+            and (ptcl.item_id like concat('%', #{sItemNm}, '%') or ptcl.item_nm like concat('%', #{sItemNm}, '%'))
511
+        </if>
512
+    </select>
513
+
514
+    <select id="selectWarehouseTargetGridList" resultType="com.oqpo.api.entity.inoutmng.DeliInfoMgntEntity">
515
+        select info.brand_id, fn_brand_nm(info.brand_id) as brand_nm
516
+                , info.dlv_sttmt_unq_no, ptcl.dlv_sttmt_dtl_no as 'deliDtlMgntInfo.dlv_sttmt_dtl_no'
517
+                , ptcl.item_id as 'deliDtlMgntInfo.item_id' , ptcl.item_nm as 'deliDtlMgntInfo.item_nm'
518
+                , ptcl.podr_qty as 'deliDtlMgntInfo.podr_qty', ptcl.dlv_qty as 'deliDtlMgntInfo.dlv_qty'
519
+                , ptcl.dlv_qty as 'deliDtlMgntInfo.whs_qty' , ptcl.dlv_qty * ptcl.unit_amt as 'deliDtlMgntInfo.whs_amt'
520
+                , ptcl.unit_amt as 'deliDtlMgntInfo.unit_amt'
521
+                , info.whs_id, info.location, fn_whs_nm(info.brand_id, info.whs_id) as whs_nm
522
+                , fn_whs_location_nm(info.brand_id, info.whs_id, info.location) as location_nm
523
+                , date_format(info.dlv_sch_dt, '%Y.%m.%d %H:%i:%s') as dlv_sch_dt
524
+                , date_format(info.dlv_req_dt, '%Y.%m.%d %H:%i:%s') as dlv_req_dt
525
+                , info.dlv_mgr_nm, info.dlv_mgr_mbl_no, fn_get_telno(info.dlv_mgr_tel_no) AS dlv_mgr_tel_no
526
+                , ptcl.pch_podr_unq_no as 'deliDtlMgntInfo.pch_podr_unq_no', ptcl.pch_podr_dtl_no as 'deliDtlMgntInfo.pch_podr_dtl_no'
527
+                , ptcl.pch_req_unq_no as 'deliDtlMgntInfo.pch_req_unq_no', ptcl.pch_req_dtl_no as 'deliDtlMgntInfo.pch_req_dlt_no'
528
+                , ptcl.unit as 'deliDtlMgntInfo.unit', info.dlv_cmplt_dt as 'deliDtlMgntInfo.dlv_cmplt_dt'
529
+                , info.spply_id as 'deliDtlMgntInfo.spply_id', info.spply_nm as 'deliDtlMgntInfo.spply_nm'
530
+        from deli_info_mgnt info
531
+        , deli_dtl_ptcl ptcl
532
+        where 1 = 1
533
+        and info.dlv_sttmt_unq_no = ptcl.dlv_sttmt_unq_no
534
+        and info.brand_id = #{sBrandId}
535
+        and info.dlv_sch_dt between #{fromDt} and #{endDt}
536
+        and info.dlv_st_cd = 'DLV0'
537
+        and info.whs_id = #{sWhsId}
538
+        <if test="sSpplyId != null and sSpplyId != ''">
539
+        and info.spply_id = #{sSpplyId}
540
+        </if>
541
+        <if test="sDlvSttmtUnqNo != null and sDlvSttmtUnqNo != ''">
542
+        and info.dlv_sttmt_unq_no like concat('%',#{sDlvSttmtUnqNo},'%')
543
+        </if>
544
+        <if test="sItemNm != null and sItemNm != ''">
545
+        and (ptcl.item_id like concat('%', #{sItemNm}, '%') or ptcl.item_nm like concat('%', #{sItemNm}, '%'))
546
+        </if>
547
+        <choose>
548
+            <when test="gridRequest.sidx != null and gridRequest.sidx != ''">
549
+                <if test="gridRequest.sidx == 'VIEW_NUM'.toString()">
550
+                    <if test="gridRequest.sord == 'asc'.toString()">
551
+                        order by pch_req_unq_no asc
552
+                    </if>
553
+                    <if test="gridRequest.sord == 'desc'.toString()">
554
+                        order by pch_req_unq_no desc
555
+                    </if>
556
+                </if>
557
+            </when>
558
+            <otherwise>
559
+                order by pch_req_unq_no desc
560
+            </otherwise>
561
+        </choose>
562
+        <if test="gridRequest.pagingYn == true">
563
+            limit #{gridRequest.gridFirst}, #{gridRequest.gridSize}
564
+        </if>
565
+    </select>
566
+
567
+    <select id="selectWarehouseTargetGridCnt" resultType="int">
568
+        select count(*)
569
+        from deli_info_mgnt info
570
+            , deli_dtl_ptcl ptcl
571
+        where 1 = 1
572
+        and info.dlv_sttmt_unq_no = ptcl.dlv_sttmt_unq_no
573
+        and info.brand_id = #{sBrandId}
574
+        and info.dlv_sch_dt between #{fromDt} and #{endDt}
575
+        and info.dlv_st_cd = 'DLV0'
576
+        and info.whs_id = #{whsId}
577
+        <if test="sSpplyId != null and sSpplyId != ''">
578
+            and info.spply_id = #{sSpplyId}
579
+        </if>
580
+        <if test="sDlvSttmtUnqNo != null and sDlvSttmtUnqNo != ''">
581
+            and info.dlv_sttmt_unq_no like concat('%',#{sDlvSttmtUnqNo},'%')
582
+        </if>
583
+        <if test="sItemNm != null and sItemNm != ''">
584
+            and (ptcl.item_id like concat('%', #{sItemNm}, '%') or ptcl.item_nm like concat('%', #{sItemNm}, '%'))
585
+        </if>
586
+    </select>
587
+
588
+
589
+
445 590
 </mapper>

+ 4 - 4
src/main/resources/mybatis/sqlmaps/oper/Ntice.xml

@@ -23,11 +23,11 @@
23 23
         </if>
24 24
         <if test="authTpCd == '50' ">
25 25
             and ((A.affl_shop_id is null or A.affl_shop_id == '')
26
-            or  (A.affl_shop_id = #{afflShopId} and  A.brand_id = #{brandId} and A.target_cd = 'T' ))
26
+            or  (A.affl_shop_id = #{afflShopId} and  A.brand_id = #{brandId} and A.target_cd in ('A', 'T')))
27 27
         </if>
28 28
         <if test="authTpCd == '60' ">
29 29
             and ((A.affl_shop_id is null or A.affl_shop_id == '')
30
-            or  (A.affl_shop_id = #{afflShopId} and  A.brand_id = #{brandId} and A.target_cd = 'S' ))
30
+            or  (A.affl_shop_id = #{afflShopId} and  A.brand_id = #{brandId} and A.target_cd in ('A', 'T')))
31 31
         </if>
32 32
         <if test="sAfflShopId != null and sAfflShopId != ''">
33 33
             and    A.affl_shop_id = #{sAfflShopId}
@@ -77,11 +77,11 @@
77 77
         </if>
78 78
         <if test="authTpCd == '50' ">
79 79
             and ((A.affl_shop_id is null or A.affl_shop_id == '')
80
-            or  (A.affl_shop_id = #{afflShopId} and  A.brand_id = #{brandId} and A.target_cd = 'T' ))
80
+            or  (A.affl_shop_id = #{afflShopId} and  A.brand_id = #{brandId} and A.target_cd in ('A', 'T')))
81 81
         </if>
82 82
         <if test="authTpCd == '60' ">
83 83
             and ((A.affl_shop_id is null or A.affl_shop_id == '')
84
-            or  (A.affl_shop_id = #{afflShopId} and  A.brand_id = #{brandId} and A.target_cd = 'S' ))
84
+            or  (A.affl_shop_id = #{afflShopId} and  A.brand_id = #{brandId} and A.target_cd in ('A', 'S')))
85 85
         </if>
86 86
         <if test="sAfflShopId != null and sAfflShopId != ''">
87 87
             and    A.affl_shop_id = #{sAfflShopId}