Explorar o código

수거지시 및 관려부분 수정조치

dwkim %!s(int64=2) %!d(string=hai) anos
pai
achega
89f2927bf8

+ 42 - 0
src/main/java/com/oqpo/api/entity/inoutmng/PickDtlPtclEntity.java

@@ -0,0 +1,42 @@
1
+package com.oqpo.api.entity.inoutmng;
2
+
3
+import lombok.Getter;
4
+import lombok.Setter;
5
+import lombok.ToString;
6
+
7
+import java.io.Serializable;
8
+
9
+@Getter
10
+@Setter
11
+@ToString
12
+public class PickDtlPtclEntity implements Serializable {
13
+    private static final long serialVersionUID = -3590936033715917450L;
14
+
15
+    private String colPickUnqNo;
16
+    private String colPickDtlNo;
17
+    private String rtnPodrUnqNo;
18
+    private String rtnPodrDtlNo;
19
+    private String rtnReqUnqNo;
20
+    private String rtnReqDtlNo;
21
+    private String colCmdUnqNo;
22
+    private String colCmdDtlNo;
23
+    private String pickDtlStCd;
24
+    private String pickDtlStNm;
25
+    private String itemId;
26
+    private String itemNm;
27
+    private String unit;
28
+    private Long unitAmt;
29
+    private String priceUnit;
30
+    private Integer rodrQty;
31
+    private Integer colQty;
32
+    private Long rtnAmt;
33
+    private Long colAmt;
34
+    private String delayYn;
35
+    private String delayRsn;
36
+    private String sysRegDttm;
37
+    private String sysRegId;
38
+    private String sysChgDttm;
39
+    private String sysChgId;
40
+
41
+
42
+}

+ 45 - 0
src/main/java/com/oqpo/api/entity/inoutmng/PickInfoMgntEntity.java

@@ -0,0 +1,45 @@
1
+package com.oqpo.api.entity.inoutmng;
2
+
3
+import lombok.Getter;
4
+import lombok.Setter;
5
+import lombok.ToString;
6
+
7
+import java.io.Serializable;
8
+
9
+@Getter
10
+@Setter
11
+@ToString
12
+public class PickInfoMgntEntity implements Serializable {
13
+    private static final long serialVersionUID = -3590936033715917450L;
14
+
15
+    private String colPickUnqNo;
16
+    private String spplyId;
17
+    private String spplyNm;
18
+    private String storeId;
19
+    private String colRegDt;
20
+    private Long colTotAmt;
21
+    private String pickMgrNm;
22
+    private String pickMgrTelNo;
23
+    private String pickMgrEmal;
24
+    private String pickMgrMblNo;
25
+    private String pndrTelNo;
26
+    private String pickStCd;
27
+    private String pickStNm;
28
+    private String rodrRegDt;
29
+    private String colReqDt;
30
+    private String colSchDt;
31
+    private String colCmpltDt;
32
+    private String whsId;
33
+    private String whsNm;
34
+    private String location;
35
+    private String locationNm;
36
+    private String whsDvsn;
37
+    private String whsDvsnNm;
38
+    private String brandId;
39
+    private String colDesc;
40
+    private String sysRegDttm;
41
+    private String sysRegId;
42
+    private String sysChgDttm;
43
+    private String sysChgId;
44
+
45
+}

+ 2 - 0
src/main/java/com/oqpo/api/entity/rtnmng/RtnOdrDtlPtclEntity.java

@@ -43,6 +43,8 @@ public class RtnOdrDtlPtclEntity implements Serializable {
43 43
     private String storeUnitUnqNo;
44 44
     private String unitGubun;
45 45
     private Integer rtnReqQty;
46
+    private Integer colQty;
47
+    private Integer rtnStatusCnt;
46 48
 
47 49
 
48 50
 

+ 1 - 0
src/main/java/com/oqpo/api/enums/SystemMessageCode.java

@@ -60,6 +60,7 @@ public enum SystemMessageCode {
60 60
     ERR_NOTSPPLY (40031, "공급사 정보가 없습니다.", HttpStatus.BAD_REQUEST),
61 61
     ERR_INGPOCNT (40032, "발주 진행중인건이 있어서 반품 반려 처리를 할 수 없습니다.", HttpStatus.BAD_REQUEST),
62 62
     ERR_INGCOLCNT (40033, "발주 진행중인건이 있어서 반품 취소처리를 할 수 없습니다.", HttpStatus.BAD_REQUEST),
63
+    ERR_POPICKQTY (40034, "반품 발주 수량보다 수거 수량이 많습니다.", HttpStatus.BAD_REQUEST),
63 64
     ;
64 65
 
65 66
 

+ 13 - 4
src/main/java/com/oqpo/api/mapper/inoutmng/ColOdrMapper.java

@@ -1,12 +1,11 @@
1 1
 package com.oqpo.api.mapper.inoutmng;
2 2
 
3 3
 
4
-import com.oqpo.api.entity.inoutmng.DeliDtlMgntEntity;
5
-import com.oqpo.api.entity.inoutmng.DeliInfoMgntEntity;
6
-import com.oqpo.api.entity.inoutmng.ShmtOdrBaseEntity;
7
-import com.oqpo.api.entity.inoutmng.ShmtOdrDtlEntity;
4
+import com.oqpo.api.entity.inoutmng.*;
8 5
 import com.oqpo.api.entity.pomng.PchOdrBaseInfoEntity;
9 6
 import com.oqpo.api.entity.pomng.PchOdrDtlPtclEntity;
7
+import com.oqpo.api.entity.rtnmng.RtnOdrBaseInfoEntity;
8
+import com.oqpo.api.entity.rtnmng.RtnOdrDtlPtclEntity;
10 9
 import com.oqpo.api.entity.stockmng.WhsProcInfoPtclEntity;
11 10
 import com.oqpo.api.web.dto.request.GridRequest;
12 11
 import org.apache.ibatis.annotations.Mapper;
@@ -18,6 +17,16 @@ import java.util.List;
18 17
 public interface ColOdrMapper {
19 18
     int selectColRtnIngCnt(@Param("brandId") String brandId, @Param("rtnPodrUnqNo") String rtnPodrUnqNo)throws Exception;
20 19
 
20
+    List<RtnOdrBaseInfoEntity> selectColTargetRtnGridList(@Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sWhsId") String sWhsId, @Param("sRtnWhsId") String sRtnWhsId, @Param("sItemNm") String sItemNm, GridRequest gridRequest)throws Exception;
21
+    int selectColTargetRtnGridCnt(@Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sWhsId") String sWhsId, @Param("sRtnWhsId") String sRtnWhsId, @Param("sItemNm") String sItemNm )throws Exception;
22
+
23
+    List<RtnOdrBaseInfoEntity> selectPickJobDataList(@Param("brandId") String brandId, List<RtnOdrDtlPtclEntity> gridInsertData)throws Exception;
24
+
25
+    int insertColOdrBase(@Param("userId") String userId, ColOdrBaseEntity entity)throws Exception;
26
+    int insertColOdrDtl(@Param("userId") String userId, List<ColOdrDtlPtclEntity> gridInsertData)throws Exception;
27
+    int insertPickMgntBase(@Param("userId") String userId, PickInfoMgntEntity entity)throws Exception;
28
+    int insertPickDtlPtcl(@Param("userId") String userId, List<PickDtlPtclEntity> gridInsertData)throws Exception;
29
+
21 30
     /*
22 31
     List<PchOdrBaseInfoEntity> selectShmtTargetOdrGridList(@Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sShmtWhsId") String sShmtWhsId, @Param("sWhsId") String sWhsId, @Param("sItemNm") String sItemNm, GridRequest gridRequest)throws Exception;
23 32
     int selectShmtTargetOdrGridCnt(@Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sShmtWhsId") String sShmtWhsId, @Param("sWhsId") String sWhsId, @Param("sItemNm") String sItemNm)throws Exception;

+ 9 - 6
src/main/java/com/oqpo/api/mapper/rtnmng/RtnOdrMapper.java

@@ -28,14 +28,17 @@ public interface RtnOdrMapper {
28 28
 
29 29
     RtnOdrDtlPtclEntity selectRtnItemDtlSaveInfo(@Param("brandId") String brandId, @Param("itemId") String itemId, @Param("brandUnitUnqNo") String brandUnitUnqNo)throws Exception;
30 30
 
31
-    List<RtnOdrBaseInfoEntity>  selectRtnOdrGridList(@Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sRtnOdrStCd") String sRtnOdrStCd, @Param("sRtnWhsId") String sRtnWhsId, @Param("sColDvsn") String sColDvsn, @Param("sWhsId") String sWhsId, @Param("sSpplyId") String sSpplyId, @Param("sItemNm") String sItemNm, GridRequest gridRequest);
32
-    int selectRtnOdrGridCnt(@Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sRtnOdrStCd") String sRtnOdrStCd, @Param("sRtnWhsId") String sRtnWhsId, @Param("sColDvsn") String sColDvsn, @Param("sWhsId") String sWhsId, @Param("sSpplyId") String sSpplyId, @Param("sItemNm") String sItemNm);
31
+    List<RtnOdrBaseInfoEntity>  selectRtnOdrGridList(@Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sRtnOdrStCd") String sRtnOdrStCd, @Param("sRtnWhsId") String sRtnWhsId, @Param("sColDvsn") String sColDvsn, @Param("sWhsId") String sWhsId, @Param("sSpplyId") String sSpplyId, @Param("sItemNm") String sItemNm, GridRequest gridRequest) throws Exception;;
32
+    int selectRtnOdrGridCnt(@Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sRtnOdrStCd") String sRtnOdrStCd, @Param("sRtnWhsId") String sRtnWhsId, @Param("sColDvsn") String sColDvsn, @Param("sWhsId") String sWhsId, @Param("sSpplyId") String sSpplyId, @Param("sItemNm") String sItemNm) throws Exception;;
33 33
 
34
-    RtnOdrBaseInfoEntity selectRtnOdrInfo(@Param("rtnPodrUnqNo") String rtnPodrUnqNo);
35
-    List<RtnOdrDtlPtclEntity> selectROdrDtlList(@Param("rtnPodrUnqNo") String rtnPodrUnqNo);
34
+    RtnOdrBaseInfoEntity selectRtnOdrInfo(@Param("rtnPodrUnqNo") String rtnPodrUnqNo) throws Exception;;
35
+    List<RtnOdrDtlPtclEntity> selectROdrDtlList(@Param("rtnPodrUnqNo") String rtnPodrUnqNo) throws Exception;;
36 36
 
37
-    int updateChgRodrStCd(@Param("userId") String userId, @Param("rtnPodrUnqNo") String rtnPodrUnqNo, @Param("rtnOdrStCd") String rtnOdrStCd);
38
-    int updateChangeRodrDtlStCd(@Param("userId") String userId, @Param("rtnPodrUnqNo") String rtnPodrUnqNo, @Param("rodrDtlStCd") String rodrDtlStCd);
37
+    int updateChgRodrStCd(@Param("userId") String userId, @Param("rtnPodrUnqNo") String rtnPodrUnqNo, @Param("rtnOdrStCd") String rtnOdrStCd) throws Exception;;
38
+    int updateChangeRodrDtlStCd(@Param("userId") String userId, @Param("rtnPodrUnqNo") String rtnPodrUnqNo, @Param("rodrDtlStCd") String rodrDtlStCd) throws Exception;;
39
+    int updateChangeMultiRodrDtlStCd(@Param("userId") String userId, List<RtnOdrDtlPtclEntity> gridUpdateData) throws Exception;;
40
+
41
+    List<RtnOdrDtlPtclEntity> selectRtnOdrDtlStatusList(String rtnPodrUnqNo) throws Exception;;
39 42
 
40 43
     /*
41 44
 

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1009 - 0
src/main/java/com/oqpo/api/service/inoutmng/ColOdrService.java


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

@@ -692,7 +692,6 @@ public class ShmtOdrService extends CommonService {
692 692
                 if (i == 0 ) {
693 693
                     dlvSttmtUnqNo = fnGetDealNo(15, ""); // 납품서번호
694 694
                     deliBaseEntity.setDlvSttmtUnqNo(dlvSttmtUnqNo);
695
-                    deliBaseEntity.setDlvSttmtUnqNo(dlvSttmtUnqNo);
696 695
                     deliBaseEntity.setSpplyId(entity.getSpplyId());
697 696
                     deliBaseEntity.setSpplyNm(entity.getSpplyNm());
698 697
                     deliBaseEntity.setStoreId(entity.getStoreId());

+ 2 - 2
src/main/java/com/oqpo/api/service/pomng/PchOrdService.java

@@ -519,10 +519,10 @@ public class PchOrdService extends CommonService {
519 519
         }
520 520
     }
521 521
 
522
-    public String  selectOdrDtlStatusList(String  pchReqUnqNo) throws Exception {
522
+    public String  selectOdrDtlStatusList(String  pchPodrUnqNo) throws Exception {
523 523
         //PCH_ODR_ST_CD
524 524
         String pchOdrStCd = "";
525
-        List<PchOdrDtlPtclEntity> dtlEntity = pchOrdMapper.selectOdrDtlStatusList( pchReqUnqNo);
525
+        List<PchOdrDtlPtclEntity> dtlEntity = pchOrdMapper.selectOdrDtlStatusList( pchPodrUnqNo);
526 526
 
527 527
         int pod0 = 0 ;
528 528
         int pod1 = 0 ;

+ 42 - 2
src/main/java/com/oqpo/api/service/rtnmng/RtnOdrService.java

@@ -305,8 +305,10 @@ public class RtnOdrService extends CommonService {
305 305
                     rtnSaveDtlEntity.setRtnDvsn(rtnDtlEntity.getRtnDvsn());
306 306
                     rtnSaveDtlEntity.setRtnRsn(rtnDtlEntity.getRtnRsn());
307 307
                     rtnSaveDtlEntity.setRtnRsnDvsn(rtnDtlEntity.getRtnRsnDvsn());
308
-                    rtnSaveDtlEntity.setRtnReqQty(rtnDtlEntity.getRtnReqQty());
308
+                    rtnSaveDtlEntity.setRtnOdrQty(rtnDtlEntity.getRtnQty());
309 309
                     rtnSaveDtlEntity.setRtnOdrAmt(Long.valueOf(rtnDtlEntity.getRtnQty()) * rtnSaveDtlEntity.getUnitAmt());
310
+
311
+
310 312
                     rtnSaveDtlEntity.setRodrDtlStCd("ROD0");
311 313
 
312 314
                     rtnTotAmt = rtnTotAmt +  rtnSaveDtlEntity.getRtnOdrAmt();
@@ -449,7 +451,7 @@ public class RtnOdrService extends CommonService {
449 451
 
450 452
             //반품요청 취소처리
451 453
             rtnOdrMapper.updateChgRodrStCd(userId, cancelRtnOrdDtlRequest.getRtnPodrUnqNo(),"RO99");
452
-            rtnOdrMapper.updateChangeRodrDtlStCd(userId, cancelRtnOrdDtlRequest.getRtnPodrUnqNo(),"ROD2");
454
+            rtnOdrMapper.updateChangeRodrDtlStCd(userId, cancelRtnOrdDtlRequest.getRtnPodrUnqNo(),"ROD4");
453 455
 
454 456
             RtnOdrBaseInfoEntity rtnOdrInfo = rtnOdrMapper.selectRtnOdrInfo(cancelRtnOrdDtlRequest.getRtnPodrUnqNo());
455 457
 
@@ -492,6 +494,44 @@ public class RtnOdrService extends CommonService {
492 494
         }
493 495
     }
494 496
 
497
+
498
+    public String  selectRtnOdrDtlStatusList(String  rtnPodrUnqNo) throws Exception {
499
+        //PCH_ODR_ST_CD
500
+        String rtnOdrStCd = "";
501
+        List<RtnOdrDtlPtclEntity> dtlEntity = rtnOdrMapper.selectRtnOdrDtlStatusList( rtnPodrUnqNo);
502
+
503
+        int rod0 = 0 ;
504
+        int rod1 = 0 ;
505
+        int rod2 = 0 ;
506
+        int rod3 = 0 ;
507
+        int rod4 = 0 ;
508
+
509
+        for (int i = 0 ; i < dtlEntity.size() ; i++ ) {
510
+            RtnOdrDtlPtclEntity entity = dtlEntity.get(i);
511
+            if ( "ROD0".equals(entity.getRodrDtlStCd())) {  // 임시저장
512
+                rod0 = rod0 + entity.getRtnStatusCnt() ;
513
+            } else if ( "ROD1".equals(entity.getRodrDtlStCd())) {  // 요청
514
+                rod1 = rod1 + entity.getRtnStatusCnt() ;
515
+            } else if ( "ROD3".equals(entity.getRodrDtlStCd())) {  //접수
516
+                rod3 = rod3 + entity.getRtnStatusCnt() ;
517
+            } else if ( "ROD4".equals(entity.getRodrDtlStCd())) {  //취소
518
+                rod4 = rod4 + entity.getRtnStatusCnt() ;
519
+            }
520
+        }
521
+
522
+        if (rod0 > 0 ) {
523
+            rtnOdrStCd = "RO00";  //임시저장
524
+        } else if ( rod0 == 0 && rod1 > 0 ) {
525
+            rtnOdrStCd = "RO20";  // 접수
526
+        } else if ( rod0 == 0 && rod1 == 0 && rod3 > 0 ) {
527
+            rtnOdrStCd = "RO30";  // 취소
528
+        } else {
529
+            rtnOdrStCd = "RO99";  // 취소
530
+        }
531
+
532
+        return rtnOdrStCd;
533
+    }
534
+
495 535
     /*
496 536
      공급사 수주현황 리스트
497 537
 

+ 248 - 0
src/main/java/com/oqpo/api/web/controller/inoutmng/ColOdrController.java

@@ -0,0 +1,248 @@
1
+package com.oqpo.api.web.controller.inoutmng;
2
+
3
+import com.oqpo.api.enums.SystemMessageCode;
4
+import com.oqpo.api.service.inoutmng.ColOdrService;
5
+import com.oqpo.api.service.inoutmng.ShmtOdrService;
6
+import com.oqpo.api.web.dto.request.inoutmng.*;
7
+import com.oqpo.api.web.dto.response.GridResponse;
8
+import com.oqpo.api.web.dto.response.SaveResponse;
9
+import com.oqpo.api.web.dto.response.inoutmng.InvInfoResponse;
10
+import com.oqpo.api.web.dto.response.inoutmng.SpplyInvInitResponse;
11
+import io.swagger.annotations.Api;
12
+import io.swagger.annotations.ApiImplicitParam;
13
+import io.swagger.annotations.ApiImplicitParams;
14
+import io.swagger.annotations.ApiOperation;
15
+import lombok.extern.slf4j.Slf4j;
16
+import org.springframework.beans.factory.annotation.Autowired;
17
+import org.springframework.http.ResponseEntity;
18
+import org.springframework.web.bind.annotation.*;
19
+import springfox.documentation.annotations.ApiIgnore;
20
+
21
+import javax.validation.Valid;
22
+
23
+@Slf4j
24
+@RestController
25
+@RequestMapping("/api/rtnmng/inoutmng")
26
+@Api(tags = {"수거지시 / 공급사 수거서 생성 관리 (ColOdrController) -- 진행중"})
27
+public class ColOdrController {
28
+    @Autowired
29
+    private ColOdrService colOdrService;
30
+
31
+
32
+    /**
33
+     * 설명 : 수거지시 대상리스트트 그리 리스트
34
+     *
35
+     * @param colOdrTargetRtnGridRequest
36
+     * @return
37
+     * @throws Exception
38
+     */
39
+
40
+    @ApiImplicitParams({
41
+            @ApiImplicitParam(name = "X-AUTH-TOKEN", value = "CONN-KEY", required = true, dataType = "String", paramType = "header")
42
+    })
43
+    @ApiOperation(value = " 수거지시 대상리스트트 그리 리스트")
44
+    @PostMapping("/col-target-grid-list")
45
+    public ResponseEntity<GridResponse> selectColTargetOdrGridList(@RequestBody @Valid ColOdrTargetRtnGridRequest colOdrTargetRtnGridRequest) throws Exception {
46
+        return ResponseEntity.ok(colOdrService.selectShmtTargetOdrGridList(colOdrTargetRtnGridRequest.getSBrandId(), colOdrTargetRtnGridRequest.getFromDt(), colOdrTargetRtnGridRequest.getToDt(), colOdrTargetRtnGridRequest.getSWhsId(), colOdrTargetRtnGridRequest.getSRtnWhsId(), colOdrTargetRtnGridRequest.getSItemNm(),  colOdrTargetRtnGridRequest.toDTO(colOdrTargetRtnGridRequest)));
47
+    }
48
+
49
+    /**
50
+     * 설명 : 출하지시 정보 저장
51
+     *
52
+     * @param userId
53
+     * @param instShmtOdrRequest
54
+     * @return SaveResponse
55
+     * @throws Exception
56
+     */
57
+
58
+    @ApiImplicitParams({
59
+            @ApiImplicitParam(name = "X-AUTH-TOKEN", value = "CONN-KEY", required = true, dataType = "String", paramType = "header")
60
+    })
61
+    @ApiOperation(value = "수거지시 정보 저장")
62
+    @PostMapping("/save-inst-col")
63
+    public ResponseEntity<SaveResponse> instShmtOdr(@ApiIgnore String userId, @RequestBody @Valid InstColOdrRequest instColOdrRequest) throws Exception {
64
+        colOdrService.instColOdr(userId,  instColOdrRequest);
65
+        return ResponseEntity.ok(SaveResponse.toDTO(SystemMessageCode.SAVE_OK));
66
+    }
67
+
68
+    /**
69
+     * 설명 : 출하현황 그리 리스트
70
+     *
71
+     * @param ShmtOutSearchGridRequest
72
+     * @return
73
+     * @throws Exception
74
+
75
+
76
+    @ApiImplicitParams({
77
+            @ApiImplicitParam(name = "X-AUTH-TOKEN", value = "CONN-KEY", required = true, dataType = "String", paramType = "header")
78
+    })
79
+    @ApiOperation(value = " 출하현황 그리 리스트")
80
+    @PostMapping("/outsearch-grid-list")
81
+    public ResponseEntity<GridResponse> selectShmtOutSearchGridList(@RequestBody @Valid ShmtOutSearchGridRequest shmtOutSearchGridRequest) throws Exception {
82
+        return ResponseEntity.ok(shmtOdrService.selectShmtSearchGridList(shmtOutSearchGridRequest.getSBrandId(), shmtOutSearchGridRequest.getFromDt(), shmtOutSearchGridRequest.getToDt(), shmtOutSearchGridRequest.getSShmtWhsId(), shmtOutSearchGridRequest.getSShmtReqStCd(),  shmtOutSearchGridRequest.getSWhsId(), shmtOutSearchGridRequest.getSItemNm(),  shmtOutSearchGridRequest.toDTO(shmtOutSearchGridRequest)));
83
+    }
84
+     */
85
+
86
+    /**
87
+     * 설명 : 납품서정보 정보
88
+     *
89
+     * @param brandId, dlvSttmtUnqNo
90
+     * @return
91
+     * @throws Exception
92
+
93
+    @ApiImplicitParams({
94
+            @ApiImplicitParam(name = "X-AUTH-TOKEN", value = "CONN-KEY", required = true, dataType = "String", paramType = "header")
95
+    })
96
+    @ApiOperation(value = "납품서출력 정보")
97
+    @PostMapping("/info-inv")
98
+    public ResponseEntity<InvInfoResponse> infoInv(@RequestBody @Valid DeliPrtInfoRequest deliPrtInfoRequest) throws Exception {
99
+        return ResponseEntity.ok(shmtOdrService.selectInvInfo(deliPrtInfoRequest.getBrandId(), deliPrtInfoRequest.getDlvSttmtUnqNo()));
100
+    }
101
+     */
102
+    /**
103
+     * 설명 : 공급사 납품 대상리스트트 그리 리스트
104
+     *
105
+     * @param SpplyTargerOdrSearchListResponse
106
+     * @return
107
+     * @throws Exception
108
+
109
+
110
+    @ApiImplicitParams({
111
+            @ApiImplicitParam(name = "X-AUTH-TOKEN", value = "CONN-KEY", required = true, dataType = "String", paramType = "header")
112
+    })
113
+    @ApiOperation(value = " 공급사 납품 대상리스트 그리 리스트")
114
+    @PostMapping("/spply-target-grid-list")
115
+    public ResponseEntity<GridResponse> selectSpplyTargetOdrGridList(@RequestBody @Valid SpplyOdrTargetGridRequest spplyOdrTargetGridRequest) throws Exception {
116
+        return ResponseEntity.ok(shmtOdrService.selectSpplyTargetOdrGridList(spplyOdrTargetGridRequest.getSBrandId(), spplyOdrTargetGridRequest.getFromDt(), spplyOdrTargetGridRequest.getToDt(), spplyOdrTargetGridRequest.getSSpplyId(), spplyOdrTargetGridRequest.getSWhsId(), spplyOdrTargetGridRequest.getSItemNm(),  spplyOdrTargetGridRequest.toDTO(spplyOdrTargetGridRequest)));
117
+    }
118
+     */
119
+
120
+    /**
121
+     * 설명 : 공급사 발주데이타 납품서 생성 초기데이타
122
+     *
123
+     * @param brandId, dlvSttmtUnqNo
124
+     * @return
125
+     * @throws Exception
126
+
127
+    @ApiImplicitParams({
128
+            @ApiImplicitParam(name = "X-AUTH-TOKEN", value = "CONN-KEY", required = true, dataType = "String", paramType = "header"),
129
+            @ApiImplicitParam(name = "brandId", value = "브랜드번호", required = true, dataType = "String", paramType = "query"),
130
+            @ApiImplicitParam(name = "spplyId", value = "공급사아이디", required = true, dataType = "String", paramType = "query"),
131
+            @ApiImplicitParam(name = "pchPodrUnqNo", value = "구매발주번호", required = true, dataType = "String", paramType = "query")
132
+    })
133
+    @ApiOperation(value = "공급사 발주데이타 납품서 생성 초기데이타")
134
+    @GetMapping("/init-spply-inv")
135
+    public ResponseEntity<SpplyInvInitResponse> initSpplyInv(@RequestParam(value = "brandId") String brandId, @RequestParam(value = "spplyId") String spplyId, @RequestParam(value = "pchPodrUnqNo") String pchPodrUnqNo) throws Exception {
136
+        return ResponseEntity.ok(shmtOdrService.selectSpplyShmtOdrInfo(brandId,spplyId, pchPodrUnqNo));
137
+    }
138
+     */
139
+    /**
140
+     * 설명 : 공급사 납품서 생성 저장
141
+     *
142
+     * @param userId
143
+     * @param instShmtOdrRequest
144
+     * @return SaveResponse
145
+     * @throws Exception
146
+
147
+
148
+    @ApiImplicitParams({
149
+            @ApiImplicitParam(name = "X-AUTH-TOKEN", value = "CONN-KEY", required = true, dataType = "String", paramType = "header")
150
+    })
151
+    @ApiOperation(value = "공급사 납품서 생성 저장 저장")
152
+    @PostMapping("/save-spply-inv")
153
+    public ResponseEntity<SaveResponse> saveSpplyInv(@ApiIgnore String userId, @RequestBody @Valid SaveSpplyDlvRequest saveSpplyDlvRequest) throws Exception {
154
+        shmtOdrService.saveSpplyInv(userId,  saveSpplyDlvRequest);
155
+        return ResponseEntity.ok(SaveResponse.toDTO(SystemMessageCode.SAVE_OK));
156
+    }
157
+     */
158
+
159
+    /**
160
+     * 설명 : 납품서 현황 그리드 리스트
161
+     *
162
+     * @param DeliDtlGridRequest
163
+     * @return
164
+     * @throws Exception
165
+
166
+
167
+    @ApiImplicitParams({
168
+            @ApiImplicitParam(name = "X-AUTH-TOKEN", value = "CONN-KEY", required = true, dataType = "String", paramType = "header")
169
+    })
170
+    @ApiOperation(value = " 납품서 현황 그리드 리스트")
171
+    @PostMapping("/deli-grid-list")
172
+    public ResponseEntity<GridResponse> selectDeliGridList(@RequestBody @Valid DeliDtlGridRequest deliDtlGridRequest) throws Exception {
173
+        return ResponseEntity.ok(shmtOdrService.selectDeliGridList(deliDtlGridRequest.getSBrandId(), deliDtlGridRequest.getDtlGubun(), deliDtlGridRequest.getFromDt(), deliDtlGridRequest.getToDt(), deliDtlGridRequest.getSDlvStCd(),  deliDtlGridRequest.getSSpplyId(), deliDtlGridRequest.getSWhsId(), deliDtlGridRequest.getSItemNm(),  deliDtlGridRequest.toDTO(deliDtlGridRequest)));
174
+    }
175
+     */
176
+    /**
177
+     * 설명 : 공급사 납품서 현황 그리드 리스트
178
+     *
179
+     * @param SpplyDeliDtlGridRequest
180
+     * @return
181
+     * @throws Exception
182
+
183
+
184
+    @ApiImplicitParams({
185
+            @ApiImplicitParam(name = "X-AUTH-TOKEN", value = "CONN-KEY", required = true, dataType = "String", paramType = "header")
186
+    })
187
+    @ApiOperation(value = " 공급사 - 납품서 현황 그리드 리스트")
188
+    @PostMapping("/spply-deli-grid-list")
189
+    public ResponseEntity<GridResponse> selectSpplyDeliGridList(@RequestBody @Valid SpplyDeliDtlGridRequest spplyDeliDtlGridRequest) throws Exception {
190
+        return ResponseEntity.ok(shmtOdrService.selectSpplyDeliGridList(spplyDeliDtlGridRequest.getSBrandId(), spplyDeliDtlGridRequest.getFromDt(), spplyDeliDtlGridRequest.getToDt(),  spplyDeliDtlGridRequest.getSSpplyId(), spplyDeliDtlGridRequest.getSWhsId(), spplyDeliDtlGridRequest.getSItemNm(),  spplyDeliDtlGridRequest.toDTO(spplyDeliDtlGridRequest)));
191
+    }
192
+     */
193
+    /**
194
+     * 설명 : 입고처리 대상 리스트
195
+     *
196
+     * @param SpplyDeliDtlGridRequest
197
+     * @return
198
+     * @throws Exception
199
+
200
+
201
+    @ApiImplicitParams({
202
+            @ApiImplicitParam(name = "X-AUTH-TOKEN", value = "CONN-KEY", required = true, dataType = "String", paramType = "header")
203
+    })
204
+    @ApiOperation(value = " 입고처리 대상 그리드 리스트")
205
+    @PostMapping("/warehouse-target-grid-list")
206
+    public ResponseEntity<GridResponse> selectSpplyDeliGridList(@RequestBody @Valid WarehouseTragetGridRequest warehouseTragetGridRequest) throws Exception {
207
+        return ResponseEntity.ok(shmtOdrService.selectWarehouseTargetList(warehouseTragetGridRequest.getSBrandId(), warehouseTragetGridRequest.getFromDt(), warehouseTragetGridRequest.getToDt(), warehouseTragetGridRequest.getSWhsId(), warehouseTragetGridRequest.getSSpplyId(), warehouseTragetGridRequest.getSDlvSttmtUnqNo(), warehouseTragetGridRequest.getSItemNm(),  warehouseTragetGridRequest.toDTO(warehouseTragetGridRequest)));
208
+    }
209
+     */
210
+
211
+    /**
212
+     * 설명 : 입고처리
213
+     *
214
+     * @param userId
215
+     * @param instShmtOdrRequest
216
+     * @return SaveResponse
217
+     * @throws Exception
218
+
219
+
220
+    @ApiImplicitParams({
221
+            @ApiImplicitParam(name = "X-AUTH-TOKEN", value = "CONN-KEY", required = true, dataType = "String", paramType = "header")
222
+    })
223
+    @ApiOperation(value = "입고처리 저장")
224
+    @PostMapping("/save-warehouse")
225
+    public ResponseEntity<SaveResponse> instShmtOdr(@ApiIgnore String userId, @RequestBody @Valid SaveWarehouseProcRequest saveWarehouseProcRequest) throws Exception {
226
+        shmtOdrService.saveWarehouseProc(userId,  saveWarehouseProcRequest);
227
+        return ResponseEntity.ok(SaveResponse.toDTO(SystemMessageCode.SAVE_OK));
228
+    }
229
+     */
230
+
231
+    /**
232
+     * 설명 : 입고 현황 그리드 리스트
233
+     *
234
+     * @param DeliDtlGridRequest
235
+     * @return
236
+     * @throws Exception
237
+
238
+
239
+    @ApiImplicitParams({
240
+            @ApiImplicitParam(name = "X-AUTH-TOKEN", value = "CONN-KEY", required = true, dataType = "String", paramType = "header")
241
+    })
242
+    @ApiOperation(value = " 입고 현황 그리드 리스트")
243
+    @PostMapping("/warehouse-grid-list")
244
+    public ResponseEntity<GridResponse> selectWarehouseGridList(@RequestBody @Valid WarehouseGridRequest warehouseGridRequest) throws Exception {
245
+        return ResponseEntity.ok(shmtOdrService.selectWarehouseGridList(warehouseGridRequest.getSBrandId(), warehouseGridRequest.getSStoreId(), warehouseGridRequest.getFromDt(), warehouseGridRequest.getToDt(), warehouseGridRequest.getSPchPodrUnqNo(),  warehouseGridRequest.getSSpplyId(), warehouseGridRequest.getSWhsId(), warehouseGridRequest.getSItemNm(),  warehouseGridRequest.toDTO(warehouseGridRequest)));
246
+    }
247
+     */
248
+}

+ 41 - 0
src/main/java/com/oqpo/api/web/dto/request/inoutmng/ColOdrTargetRtnGridRequest.java

@@ -0,0 +1,41 @@
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 ColOdrTargetRtnGridRequest extends GridRequest {
14
+
15
+    @NotBlank
16
+    @ApiModelProperty(value = "시작일자")
17
+    private String fromDt;
18
+
19
+    @NotBlank
20
+    @ApiModelProperty(value = "종료일자")
21
+    private String toDt;
22
+
23
+    @NotBlank
24
+    @ApiModelProperty(value = "브랜드아이디")
25
+    private String sBrandId;
26
+
27
+    @ApiModelProperty(value = "수거창고아이디")
28
+    private String sRtnWhsId;
29
+
30
+    @ApiModelProperty(value = "입고창고아이디")
31
+    private String sWhsId;
32
+
33
+    @ApiModelProperty(value = "품목명")
34
+    private String sItemNm;
35
+
36
+
37
+
38
+    protected ColOdrTargetRtnGridRequest(Integer gridSize, Integer gridPage, String sidx, String sord, Boolean pagingYn, Integer gridFirst) {
39
+        super(gridSize, gridPage, sidx, sord, pagingYn, gridFirst);
40
+    }
41
+}

+ 67 - 0
src/main/java/com/oqpo/api/web/dto/request/inoutmng/InstColOdrRequest.java

@@ -0,0 +1,67 @@
1
+package com.oqpo.api.web.dto.request.inoutmng;
2
+
3
+import com.oqpo.api.entity.pomng.PchOdrDtlPtclEntity;
4
+import com.oqpo.api.entity.rtnmng.RtnOdrDtlPtclEntity;
5
+import io.swagger.annotations.ApiModelProperty;
6
+import lombok.*;
7
+
8
+import javax.validation.constraints.NotBlank;
9
+import java.util.ArrayList;
10
+import java.util.List;
11
+
12
+@Getter
13
+@Setter
14
+public class InstColOdrRequest {
15
+    @NotBlank
16
+    @ApiModelProperty(value = "CRUD")
17
+    private String viewCd;
18
+
19
+    @NotBlank
20
+    @ApiModelProperty(value = "브랜드아이디") private String brandId;
21
+
22
+    @NotBlank
23
+    @ApiModelProperty(value = "수거예정일") private String colSchDt;
24
+
25
+    @NotBlank
26
+    @ApiModelProperty(value = "수거담당자명") private String pickMgrNm;
27
+
28
+    @NotBlank
29
+    @ApiModelProperty(value = "수거담당자연락처") private String pickMgrTelNo;
30
+
31
+
32
+    @ApiModelProperty(value = "수거지시대상 리스트")
33
+    private List<InstColItemDataList> gridInsertData;
34
+
35
+
36
+    public List<RtnOdrDtlPtclEntity> toCodeEntities(List<InstColItemDataList> gridData) {
37
+        List<RtnOdrDtlPtclEntity> entities = new ArrayList<>();
38
+        if (gridData == null || gridData.size() == 0)
39
+            return entities;
40
+
41
+        gridData.forEach(x -> {
42
+            RtnOdrDtlPtclEntity entity = new RtnOdrDtlPtclEntity();
43
+            entity.setRtnPodrUnqNo(x.getRtnPodrUnqNo());
44
+            entity.setRtnPodrDtlNo(x.getRtnPodrDtlNo());
45
+            entity.setColQty(x.getColQty());
46
+            entities.add(entity);
47
+        });
48
+        return entities;
49
+    }
50
+
51
+    @Getter
52
+    @Builder
53
+    @AllArgsConstructor(access = AccessLevel.PROTECTED)
54
+    static class InstColItemDataList {
55
+
56
+        @NotBlank
57
+        @ApiModelProperty(value = "반품발주고유번호") private String rtnPodrUnqNo;
58
+
59
+        @NotBlank
60
+        @ApiModelProperty(value = "반품발주항번") private String rtnPodrDtlNo;
61
+
62
+        @NotBlank
63
+        @ApiModelProperty(value = "수거수량") private Integer colQty ;
64
+
65
+
66
+    }
67
+}

+ 38 - 0
src/main/java/com/oqpo/api/web/dto/response/inoutmng/ColTragetOdrSearchListResponse.java

@@ -0,0 +1,38 @@
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 ColTragetOdrSearchListResponse {
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 rtnPodrUnqNo;
20
+    @ApiModelProperty(value = "반품발주항번") private String rtnPodrDtlNo;
21
+    @ApiModelProperty(value = "반품요청번호") private String rtnReqUnqNo;
22
+    @ApiModelProperty(value = "반품요청항번") private String rtnReqDtlNo;
23
+    @ApiModelProperty(value = "품목아이디") private String itemId;
24
+    @ApiModelProperty(value = "품목명") private String itemNm;
25
+    @ApiModelProperty(value = "수거창고아이디") private String rtnWhsId;
26
+    @ApiModelProperty(value = "수거LOCATION") private String rtnLocation;
27
+    @ApiModelProperty(value = "수거창고명") private String rntWhsNm;
28
+    @ApiModelProperty(value = "입고창고아이디") private String whsId;
29
+    @ApiModelProperty(value = "입고LOCATION") private String location;
30
+    @ApiModelProperty(value = "입고창고명") private String whsNm;
31
+    @ApiModelProperty(value = "단가") private Long unitAmt;
32
+    @ApiModelProperty(value = "반품발주수량") private Integer rtnReqQty;
33
+    @ApiModelProperty(value = "수거수량") private Integer rtnQty;
34
+    @ApiModelProperty(value = "발주금액") private Long rtnAmt;
35
+    @ApiModelProperty(value = "수거요청일") private String colReqDt;
36
+    @ApiModelProperty(value = "매장아이디") private String storeId;
37
+
38
+}

+ 162 - 0
src/main/resources/mybatis/sqlmaps/inoutmng/ColOdr.xml

@@ -12,4 +12,166 @@
12 12
         and   ptcl.rtn_podr_unq_no = #{rtnPodrUnqNo}
13 13
     </select>
14 14
 
15
+    <select id="selectColTargetRtnGridList" resultType="com.oqpo.api.entity.rtnmng.RtnOdrBaseInfoEntity">
16
+        select base.brand_id, fn_brand_nm(base.brand_id) as brand_nm
17
+            , base.rtn_podr_unq_no, ptcl.rtn_podr_dtl_no as 'rtnOdrDtlInfo.rtn_podr_dtl_no'
18
+            , ptcl.rtn_req_unq_no as 'rtnOdrDtlInfo.rtn_req_unq_no', ptcl.rtn_req_dtl_no as 'rtnOdrDtlInfo.rtn_req_dtl_no'
19
+            , ptcl.item_id as 'rtnOdrDtlInfo.item_id', ptcl.item_nm as 'rtnOdrDtlInfo.item_nm'
20
+            , base.rtn_whs_id, fn_whs_nm(base.brand_id, base.rtn_whs_id) as rtn_whs_nm, ptcl.unit_amt as 'rtnOdrDtlInfo.unit_amt'
21
+            , ptcl.rtn_qty as 'rtnOdrDtlInfo.rtn_qty',  ptcl.rtn_odr_qty as 'rtnOdrDtlInfo.rtn_odr_qty'
22
+            , date_format(base.col_req_dt,'%Y.%m.%d') as  col_req_dt, ptcl.rtn_amt as 'rtnOdrDtlInfo.rtn_amt'
23
+            , base.whs_id,  fn_whs_nm(base.brand_id, base.whs_id) as whs_nm
24
+            , base.location, fn_whs_location_nm(base.brand_id, base.whs_id, base.location) as location_nm
25
+            , base.store_id
26
+        from rtn_odr_base_info base
27
+             , rtn_odr_dtl_ptcl ptcl
28
+        where 1=1
29
+        and    base.rtn_podr_unq_no = ptcl.rtn_podr_unq_no
30
+        and    base.brand_id = #{sBrandId}
31
+        and    base.col_req_dt between #{fromDt} and #{toDt}
32
+        and    base.rtn_odr_st_cd = 'RO20'
33
+        and    ptcl.rodr_dtl_st_cd = 'ROD0'
34
+        and    base.col_dvsn = 'C001'
35
+        <if test="sWhsId != null and sWhsId != ''">
36
+        and    base.whs_id = #{sWhsId}
37
+        </if>
38
+        <if test="sRtnWhsId != null and sRtnWhsId != ''">
39
+        and    base.rtn_whs_id = #{sRtnWhsId}
40
+        </if>
41
+        <if test="sItemNm != null and sItemNm != ''">
42
+        and   (ptcl.item_id like concat('%', '', '%') or ptcl.item_nm like concat('%', '', '%'))
43
+        </if>
44
+        <choose>
45
+            <when test="gridRequest.sidx != null and gridRequest.sidx != ''">
46
+                <if test="gridRequest.sidx == 'VIEW_NUM'.toString()">
47
+                    <if test="gridRequest.sord == 'asc'.toString()">
48
+                        order by base.rtn_podr_unq_no as , ptcl.rtn_podr_dtl_no asc
49
+                    </if>
50
+                    <if test="gridRequest.sord == 'desc'.toString()">
51
+                        order by base.rtn_podr_unq_no desc , ptcl.rtn_podr_dtl_no asc
52
+                    </if>
53
+                </if>
54
+            </when>
55
+            <otherwise>
56
+                order by base.rtn_podr_unq_no as , ptcl.rtn_podr_dtl_no asc
57
+            </otherwise>
58
+        </choose>
59
+        <if test="gridRequest.pagingYn == true">
60
+            limit #{gridRequest.gridFirst}, #{gridRequest.gridSize}
61
+        </if>
62
+    </select>
63
+
64
+    <select id="selectColTargetRtnGridCnt" resultType="int">
65
+        select count(*) as cnt
66
+        from rtn_odr_base_info base
67
+            , rtn_odr_dtl_ptcl ptcl
68
+        where 1=1
69
+        and    base.rtn_podr_unq_no = ptcl.rtn_podr_unq_no
70
+        and    base.brand_id = #{sBrandId}
71
+        and    base.col_req_dt between #{fromDt} and #{toDt}
72
+        and    base.rtn_odr_st_cd = 'RO20'
73
+        and    ptcl.rodr_dtl_st_cd = 'ROD0'
74
+        and    base.col_dvsn = 'C001'
75
+        <if test="sWhsId != null and sWhsId != ''">
76
+            and    base.whs_id = #{sWhsId}
77
+        </if>
78
+        <if test="sRtnWhsId != null and sRtnWhsId != ''">
79
+            and    base.rtn_whs_id = #{sRtnWhsId}
80
+        </if>
81
+        <if test="sItemNm != null and sItemNm != ''">
82
+            and   (ptcl.item_id like concat('%', '', '%') or ptcl.item_nm like concat('%', '', '%'))
83
+        </if>
84
+
85
+    </select>
86
+
87
+    <select id="selectPickJobDataList" resultType="com.oqpo.api.entity.rtnmng.RtnOdrBaseInfoEntity">
88
+        select  base.brand_id,base.rtn_podr_unq_no, ptcl.rtn_podr_dtl_no as 'rtnOdrDtlInfo.rtn_podr_dtl_no'
89
+            ,ptcl.item_id as 'rtnOdrDtlInfo.item_id' , ptcl.item_nm as 'rtnOdrDtlInfo.item_nm', base.whs_id
90
+            ,base.location, ptcl.unit_amt as 'rtnOdrDtlInfo.unit_amt', ptcl.rtn_odr_qty as 'rtnOdrDtlInfo.rtn_odr_qty'
91
+            ,ptcl.rtn_odr_amt as 'rtnOdrDtlInfo.rtn_odr_amt', date_format(base.col_req_dt,'%Y.%m.%d') as col_req_dt
92
+            , base.rtn_whs_id, base.rtn_location, ptcl.rtn_req_unq_no as 'rtnOdrDtlInfo.rtn_req_unq_no' , ptcl.rtn_req_dtl_no as 'rtnOdrDtlInfo.rtn_req_dtl_no'
93
+            , base.store_id , base.rtn_mgr_nm , base.rtn_mgr_tel_no, base.rtn_mgr_id
94
+            , nvl(fn_get_telno((select mgr_tel_no from whs_mgnt_base_info where brand_id = base.brand_id and whs_id = base.rtn_whs_id)),'  ') as pick_tel_no
95
+            , date_format(base.rtn_odr_reg_dt,'%Y%m%d') as rtn_odr_req_dt
96
+            , base.spply_id, fn_spply_nm(base.spply_id) as spply_nm
97
+            , ptcl.rtn_rsn_dvsn as  'rtnOdrDtlInfo.rtn_rsn_dvsn', ptcl.rtn_rsn as 'rtnOdrDtlInfo.rtn_rsn'
98
+        from   rtn_odr_base_info base
99
+        join rtn_odr_dtl_ptcl ptcl on base.rtn_podr_unq_no = ptcl.rtn_podr_unq_no and ptcl.rodr_dtl_st_cd = 'ROD0'
100
+        join item_base_info itm on ptcl.item_id = itm.item_id
101
+        and    base.brand_id = #{brandId}
102
+        and    concat(base.rtn_podr_unq_no,ptcl.rtn_podr_dtl_no) in
103
+        <foreach collection="gridInsertData" item="item" separator="," open="(" close=")">
104
+            concat(#{item.rtnPodrUnqNo},#{item.rtnPodrDtlNo})
105
+        </foreach>
106
+        order by  base.brand_id, base.whs_id, base.location, base.rtn_whs_id,base.rtn_location
107
+    </select>
108
+
109
+    <insert id="insertColOdrBase">
110
+        insert into col_odr_base_info  /* ColOdr.insertColOdrBase*/
111
+            (col_cmd_unq_no, col_reg_dt, brand_id, whs_id, location
112
+            , store_id, item_qty, col_total_amt, col_req_dt, col_dvsn
113
+            , col_cmd_st_cd, col_req_mgr_nm, col_req_mgr_id, col_dt, col_cnfm_nm
114
+            , col_cnfm_id, col_mgr_nm, col_mgr_tel_no, col_mgr_emal, col_mgr_mbl_no
115
+            , rtn_whs_id, rtn_location, spply_id, spply_nm
116
+            , sys_reg_dttm, sys_reg_id, sys_chg_dttm, sys_chg_id)
117
+        values
118
+
119
+            (#{entity.colCmdUnqNo}, date_format(now(),'%Y%m%d'), #{entity.brandId}, #{entity.whsId}, #{entity.location}
120
+            , #{entity.storeId}, #{entity.itemQty}, #{entity.colTotalAmt}, #{entity.colReqDt}, #{entity.colReqDt}, #{entity.colDvsn}
121
+            , #{entity.colCmdStCd}, #{entity.colReqMgrNm}, #{entity.colReqMgrId}, #{entity.colDt}, #{entity.colCnfmNm}
122
+            , #{entity.colCnfmId}, #{entity.colMgrNm}, #{entity.colMgrTelNo}, #{entity.colMgrEmal}, #{entity.colMgrMblNo}
123
+            , #{entity.rtnWhsId}, #{entity.rtnLocation}, #{entity.spplyId}, #{entity.spplyNm}
124
+            , now(), #{userId}, now(), #{userId})
125
+
126
+    </insert>
127
+
128
+    <insert id="insertColOdrDtl">
129
+        insert into col_odr_dtl_ptcl /* ColOdr.insertColOdrDtl*/
130
+        (col_cmd_unq_no, col_cmd_dtl_no, item_id, item_nm, unit_amt
131
+        , col_qty, col_amt, rtn_qty, rtn_amt, rtn_rsn_dvsn
132
+        , rtn_rsn, rtn_podr_unq_no, rtn_podr_dtl_no, rtn_req_dtl_no, rtn_req_unq_no, col_cmd_dtl_st_cd
133
+        , sys_reg_dttm, sys_reg_id, sys_chg_dttm, sys_chg_id)
134
+        values
135
+        <foreach collection="gridInsertData" item="item" separator=",">
136
+        (#{item.colCmdUnqNo}, #{item.colCmdDtlNo}, #{item.itemId}, #{item.itemNm}, #{item.unitAmt}
137
+        , #{item.colQty}, #{item.colAmt}, #{item.rtnQty}, #{item.rtnAmt}, #{item.rtnRsnDvsn}
138
+        , #{item.rtnRsn}, #{item.rtnPodrUnqNo}, #{item.rtnPodrDtlNo}, #{item.rtnReqDtlNo}, #{item.rtnReqUnqNo}, 'CDLD1'
139
+        , now(), #{userId}, now(), #{userId})
140
+        </foreach>
141
+    </insert>
142
+
143
+    <insert id="insertPickMgntBase">
144
+        insert into pick_info_mgnt  /* ColOdr.insertPickMgntBase */
145
+        (col_pick_unq_no, spply_id, spply_nm, store_id, col_reg_dt
146
+        , col_tot_amt, pick_mgr_nm, pick_mgr_tel_no, pick_mgr_emal, pick_mgr_mbl_no
147
+        , pndr_tel_no, pick_st_cd, rodr_reg_dt, col_req_dt, col_sch_dt
148
+        , col_cmplt_dt, whs_id, location, whs_dvsn, brand_id, col_desc
149
+        , sys_reg_dttm, sys_reg_id, sys_chg_dttm, sys_chg_id)
150
+        values
151
+        (#{entity.colPickUnqNo}, #{entity.spplyId}, #{entity.spplyNm}, #{entity.storeId}, #{entity.colRegDt}
152
+        , #{entity.colTotAmt}, #{entity.pickMgrNm}, #{entity.pickMgrTelNo}, #{entity.pickMgrEmal}, #{entity.pickMgrMblNo}
153
+        , #{entity.pndrTelNo}, #{entity.pickStCd}, #{entity.rodrRegDt}, #{entity.colReqDt}, #{entity.colSchDt}
154
+        , #{entity.colCmpltDt}, #{entity.whsId}, #{entity.location}, #{entity.whsDvsn}, #{entity.brandId}, #{entity.colDesc}
155
+        , now(), #{userId}, now(), #{userId})
156
+    </insert>
157
+
158
+    <insert id="insertPickDtlPtcl">
159
+        insert into pick_dtl_ptcl  /* ColOdr.insertPickDtlPtcl */
160
+        (col_pick_unq_no, col_pick_dtl_no, rtn_podr_unq_no, rtn_podr_dtl_no, rtn_req_unq_no
161
+        , rtn_req_dtl_no, col_cmd_unq_no, col_cmd_dtl_no, pick_dtl_st_cd, item_id
162
+        , item_nm, unit, unit_amt, price_unit, rodr_qty
163
+        , col_qty, col_amt, delay_yn, delay_rsn
164
+        , sys_reg_dttm, sys_reg_id, sys_chg_dttm, sys_chg_id)
165
+        values
166
+        <foreach collection="gridInsertData" item="item" separator=",">
167
+        (#{item.colPickUnqNo}, #{item.colPickDtlNo}, #{item.rtnPodrUnqNo}, #{item.rtnPodrDtlNo}, #{item.rtnReqUnqNo}
168
+        , #{item.rtnReqDtlNo}, #{item.colCmdUnqNo}, #{item.colCmdDtlNo}, 'PICKD0', #{item.itemId}
169
+        , #{item.itemNm}, #{item.unit}, #{item.unitAmt}, #{item.priceUnit}, #{item.rodrQty}
170
+        , #{item.colQty}, #{item.colAmt}, #{item.delayYn}, #{item.delayRsn}
171
+        , now(), #{item.sysRegId}, now(), #{item.sysChgId})
172
+        </foreach>
173
+    </insert>
174
+
175
+
176
+
15 177
 </mapper>

+ 20 - 1
src/main/resources/mybatis/sqlmaps/rtnmng/RtnOrd.xml

@@ -78,7 +78,7 @@
78 78
                (#{item.rtnPodrUnqNo}, #{item.rtnPodrDtlNo}, #{item.rtnReqUnqNo}, #{item.rtnReqDtlNo}, #{item.itemId}
79 79
             , #{item.itemNm}, #{item.unit}, #{item.unitAmt}, #{item.colReqDt}, #{item.rtnDvsn}, #{item.rtnReqQty}
80 80
             , #{item.rtnQty}, #{item.rtnAmt}, #{item.rtnRsnDvsn}, #{item.rtnRsn}, #{item.rtnOdrQty}
81
-            , #{item.rtnOdrAmt}, #{item.rodrDtlStCd}, NOW(), #{userId}, NOW(), #{userId})
81
+            , #{item.rtnOdrAmt}, 'ROD1', NOW(), #{userId}, NOW(), #{userId})
82 82
             </foreach>
83 83
         </insert>
84 84
 
@@ -266,6 +266,25 @@
266 266
             WHERE rtn_podr_unq_no = #{rtnPodrUnqNo}
267 267
     </update>
268 268
 
269
+    <update id="updateChangeMultiRodrDtlStCd">
270
+        <foreach collection="gridUpdateData" item="item" separator=";">
271
+            UPDATE /* RtnOrd.updateChangeRodrDtlStCd */
272
+            rtn_odr_dtl_ptcl SET
273
+            rodr_dtl_st_cd = #{item.rodrDtlStCd},
274
+            sys_chg_dttm = NOW(),
275
+            sys_chg_id = #{userId}
276
+            WHERE rtn_podr_unq_no = #{item.rtnPodrUnqNo}
277
+            and   rtn_podr_dtl_no = #{item.rtnPodrDtlNo}
278
+        </foreach>
279
+    </update>
280
+
281
+    <select id="selectRtnOdrDtlStatusList" resultType="com.oqpo.api.entity.rtnmng.RtnOdrDtlPtclEntity">
282
+        select rodr_dtl_st_cd, count(*) as rtn_status_cnt
283
+        from rtn_odr_dtl_ptcl
284
+        where rtn_podr_unq_no = #{rtnPodrUnqNo}
285
+        group by rodr_dtl_st_cd
286
+    </select>
287
+
269 288
 
270 289
 
271 290
     <!--