Bläddra i källkod

반품관련작업 진행

dwkim 2 år sedan
förälder
incheckning
f60e453ae7
19 ändrade filer med 374 tillägg och 79 borttagningar
  1. 2 1
      src/main/java/com/oqpo/api/entity/inoutmng/PickDtlPtclEntity.java
  2. 5 0
      src/main/java/com/oqpo/api/entity/inoutmng/PickInfoMgntEntity.java
  3. 5 0
      src/main/java/com/oqpo/api/entity/rtnmng/RtnProcInfoPtclEntity.java
  4. 1 0
      src/main/java/com/oqpo/api/enums/SystemMessageCode.java
  5. 5 0
      src/main/java/com/oqpo/api/mapper/inoutmng/ColOdrMapper.java
  6. 29 31
      src/main/java/com/oqpo/api/service/inoutmng/ColOdrService.java
  7. 26 27
      src/main/java/com/oqpo/api/service/rtnmng/RtnOdrService.java
  8. 3 1
      src/main/java/com/oqpo/api/service/rtnmng/RtnReqService.java
  9. 6 6
      src/main/java/com/oqpo/api/web/controller/inoutmng/ColOdrController.java
  10. 2 2
      src/main/java/com/oqpo/api/web/controller/rtnmng/RtnOrdController.java
  11. 1 1
      src/main/java/com/oqpo/api/web/controller/rtnmng/RtnReqController.java
  12. 48 0
      src/main/java/com/oqpo/api/web/dto/request/inoutmng/RtnStockTragetGridRequest.java
  13. 65 0
      src/main/java/com/oqpo/api/web/dto/request/inoutmng/SaveRtnStockProcRequest.java
  14. 5 5
      src/main/java/com/oqpo/api/web/dto/request/rtnmng/SaveRtnOrdRequest.java
  15. 40 0
      src/main/java/com/oqpo/api/web/dto/response/inoutmng/RtnStockTargetResponse.java
  16. 4 0
      src/main/java/com/oqpo/api/web/dto/response/rtnmng/rtnOrd/RtnOrdInitInfoResponse.java
  17. 121 0
      src/main/resources/mybatis/sqlmaps/inoutmng/ColOdr.xml
  18. 5 4
      src/main/resources/mybatis/sqlmaps/rtnmng/RtnOrd.xml
  19. 1 1
      src/main/resources/mybatis/sqlmaps/sttlmng/SttlReq.xml

+ 2 - 1
src/main/java/com/oqpo/api/entity/inoutmng/PickDtlPtclEntity.java

@@ -27,8 +27,9 @@ public class PickDtlPtclEntity implements Serializable {
27 27
     private String unit;
28 28
     private Long unitAmt;
29 29
     private String priceUnit;
30
-    private Integer rodrQty;
30
+    private Integer rodrQty;  // 컬럼 삭제 대상
31 31
     private Integer colQty;
32
+    private Integer colReqQty; // 수거요청수량
32 33
     private Long rtnAmt;
33 34
     private Long colAmt;
34 35
     private String delayYn;

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

@@ -33,6 +33,11 @@ public class PickInfoMgntEntity implements Serializable {
33 33
     private String whsNm;
34 34
     private String location;
35 35
     private String locationNm;
36
+    private String RtnWhsId;
37
+    private String RtnWhsNm;
38
+    private String RtnLocation;
39
+    private String RtnLocationNm;
40
+
36 41
     private String whsDvsn;
37 42
     private String whsDvsnNm;
38 43
     private String brandId;

+ 5 - 0
src/main/java/com/oqpo/api/entity/rtnmng/RtnProcInfoPtclEntity.java

@@ -5,6 +5,7 @@ import lombok.Getter;
5 5
 import lombok.Setter;
6 6
 import lombok.ToString;
7 7
 
8
+import javax.validation.constraints.NotBlank;
8 9
 import java.io.Serializable;
9 10
 
10 11
 @Getter
@@ -96,6 +97,10 @@ public class RtnProcInfoPtclEntity implements Serializable {
96 97
     private String sysChgDttm;
97 98
     @ApiModelProperty(value = "시스템변경아이디")
98 99
     private String sysChgId;
100
+    @ApiModelProperty(value = "수거서번호")
101
+    private String colPickUnqNo;
102
+    @ApiModelProperty(value = "수거서항번")
103
+    private String colPickDtlNo;
99 104
 
100 105
 
101 106
 }

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

@@ -26,6 +26,7 @@ public enum SystemMessageCode {
26 26
     RUN_OK (20062, "실행 요청하였습니다.", HttpStatus.OK),
27 27
     BATCH_OK (90000, "배치 성공", HttpStatus.OK),
28 28
     REJECT_OK (20022, "반려 되었습니다.", HttpStatus.OK),
29
+    RTN_REQ_OK (20023, "반품요청 되었습니다.", HttpStatus.OK),
29 30
     ERR_PW(40001, "현재의 비밀번호가 틀립니다. ", HttpStatus.BAD_REQUEST),
30 31
     ERR_FIND_ID(40002, "입력하신  정보로 등록된 아이디가 없습니다.", HttpStatus.BAD_REQUEST),
31 32
     ERR_FIND_PW(40003, "입력하신  정보로 등록된 아이디가 없습니다.", HttpStatus.BAD_REQUEST),

+ 5 - 0
src/main/java/com/oqpo/api/mapper/inoutmng/ColOdrMapper.java

@@ -6,6 +6,7 @@ import com.oqpo.api.entity.pomng.PchOdrBaseInfoEntity;
6 6
 import com.oqpo.api.entity.pomng.PchOdrDtlPtclEntity;
7 7
 import com.oqpo.api.entity.rtnmng.RtnOdrBaseInfoEntity;
8 8
 import com.oqpo.api.entity.rtnmng.RtnOdrDtlPtclEntity;
9
+import com.oqpo.api.entity.rtnmng.RtnProcInfoPtclEntity;
9 10
 import com.oqpo.api.entity.stockmng.WhsProcInfoPtclEntity;
10 11
 import com.oqpo.api.web.dto.request.GridRequest;
11 12
 import org.apache.ibatis.annotations.Mapper;
@@ -43,6 +44,10 @@ public interface ColOdrMapper {
43 44
     List<PickInfoMgntEntity> selectColSpplyPickGridList(@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;
44 45
     int selectColSpplyPickGridCnt(@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;
45 46
 
47
+    List<PickInfoMgntEntity> selectColRtnInstGridList(@Param("sBrandId") String sBrandId, @Param("sStoreId") String sStoreId,  @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sSpplyId") String sSpplyId, @Param("sRtnWhsId") String sRtnWhsId, @Param("sWhsId") String sWhsId,  @Param("sItemNm") String sItemNm, GridRequest gridRequest)throws Exception;
48
+    int selectColRtnInstGridCnt(@Param("sBrandId") String sBrandId, @Param("sStoreId") String sStoreId,  @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sSpplyId") String sSpplyId, @Param("sRtnWhsId") String sRtnWhsId, @Param("sWhsId") String sWhsId,  @Param("sItemNm") String sItemNm) throws Exception;
49
+
50
+    int insertRtnProcInfoPtcl(@Param("userId") String userId, List<RtnProcInfoPtclEntity> gridInsertData) throws Exception;
46 51
 
47 52
     /*
48 53
     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;

+ 29 - 31
src/main/java/com/oqpo/api/service/inoutmng/ColOdrService.java

@@ -8,6 +8,7 @@ import com.oqpo.api.entity.pomng.PchOdrBaseInfoEntity;
8 8
 import com.oqpo.api.entity.pomng.PchOdrDtlPtclEntity;
9 9
 import com.oqpo.api.entity.rtnmng.RtnOdrBaseInfoEntity;
10 10
 import com.oqpo.api.entity.rtnmng.RtnOdrDtlPtclEntity;
11
+import com.oqpo.api.entity.rtnmng.RtnProcInfoPtclEntity;
11 12
 import com.oqpo.api.entity.stinfo.BrandEntity;
12 13
 import com.oqpo.api.entity.stinfo.SpplyEntity;
13 14
 import com.oqpo.api.entity.stinfo.StoreBaseInfoEntity;
@@ -721,61 +722,58 @@ public class ColOdrService extends CommonService {
721 722
     }
722 723
 
723 724
     /*
724
-      입고처리 그리드 리스트 조회
725
-
726
-    public GridResponse selectWarehouseTargetList(String sBrandId, String fromDt, String toDt, String sWhsId, String sSpplyId, String sDlvSttmtUnqNo, String sItemNm, GridRequest gridRequest) throws Exception {
725
+      반품처리 그리드 리스트 조회
726
+ */
727
+    public GridResponse selectRtnStockTargetList(String sBrandId, String sStoreId,  String fromDt, String toDt, String sRtnWhsId, String sSpplyId, String sWhsId, String sItemNm, GridRequest gridRequest) throws Exception {
727 728
         int gridPage = gridRequest.getGridPage();
728 729
         int gridSize = gridRequest.getGridSize();
729 730
 
730 731
         fromDt = fromDt == null ? null : fromDt.replace(".", "");
731 732
         toDt = toDt == null ? null : toDt.replace(".", "");
732 733
 
733
-        int gridRecords = shmtOdrMapper.selectWarehouseTargetGridCnt(sBrandId,  fromDt, toDt, sWhsId, sSpplyId, sDlvSttmtUnqNo, sItemNm);
734
+        int gridRecords = colOdrMapper.selectColRtnInstGridCnt(sBrandId, sStoreId, fromDt, toDt, sSpplyId, sRtnWhsId,  sWhsId,  sItemNm);
734 735
         int gridTotal = fnCalculateGridTotal(gridSize, gridRecords);
735
-        List<DeliInfoMgntEntity> entities = shmtOdrMapper.selectWarehouseTargetGridList(sBrandId,  fromDt, toDt, sWhsId, sSpplyId, sDlvSttmtUnqNo, sItemNm, gridRequest);
736
+        List<PickInfoMgntEntity> entities = colOdrMapper.selectColRtnInstGridList(sBrandId, sStoreId, fromDt, toDt, sSpplyId, sRtnWhsId, sWhsId, sItemNm, gridRequest);
736 737
         List<Object> gridRows = entities.stream()
737
-                .map(m -> WarehouseTargetResponse.builder()
738
+                .map(m -> RtnStockTargetResponse.builder()
738 739
                         .viewCd("R")
739 740
                         .brandId(m.getBrandId() == null ? "" : m.getBrandId())
740 741
                         .brandNm(m.getBrandNm() == null ? "" : m.getBrandNm())
741
-                        .dlvSttmtUnqNo(m.getDlvSttmtUnqNo() == null ? "" : m.getDlvSttmtUnqNo())
742
-                        .dlvSttmtDtlNo(m.getDeliDtlMgntInfo() == null ? "" : m.getDeliDtlMgntInfo().getDlvSttmtDtlNo() == null ? "" : m.getDeliDtlMgntInfo().getDlvSttmtDtlNo())
743
-                        .itemId(m.getDeliDtlMgntInfo() == null ? "" : m.getDeliDtlMgntInfo().getItemId() == null ? "" : m.getDeliDtlMgntInfo().getItemId())
744
-                        .itemNm(m.getDeliDtlMgntInfo() == null ? "" : m.getDeliDtlMgntInfo().getItemNm() == null ? "" : m.getDeliDtlMgntInfo().getItemNm())
745
-                        .podrQty(m.getDeliDtlMgntInfo() == null ? 0 : m.getDeliDtlMgntInfo().getPodrQty() == null ? 0 : m.getDeliDtlMgntInfo().getPodrQty())
746
-                        .dlvQty(m.getDeliDtlMgntInfo() == null ? 0 : m.getDeliDtlMgntInfo().getDlvQty() == null ? 0 : m.getDeliDtlMgntInfo().getDlvQty())
747
-                        .whsQty(m.getDeliDtlMgntInfo() == null ? 0 : m.getDeliDtlMgntInfo().getWhsQty() == null ? 0 : m.getDeliDtlMgntInfo().getWhsQty())
748
-                        .whsAmt(m.getDeliDtlMgntInfo() == null ? 0 : m.getDeliDtlMgntInfo().getWhsAmt() == null ? 0 : m.getDeliDtlMgntInfo().getWhsAmt())
749
-                        .unit(m.getDeliDtlMgntInfo() == null ? "" : m.getDeliDtlMgntInfo().getUnit() == null ? "" : m.getDeliDtlMgntInfo().getUnit())
750
-                        .unitAmt(m.getDeliDtlMgntInfo() == null ? 0 : m.getDeliDtlMgntInfo().getUnitAmt() == null ? 0 : m.getDeliDtlMgntInfo().getUnitAmt())
751
-                        .whsId(m.getWhsId() == null ? "" :m.getWhsId())
742
+                        .colPickUnqNo(m.getColPickUnqNo() == null ? "" : m.getColPickUnqNo())
743
+                        .colPickDtlNo(m.getPickDtlInfo() == null ? "" : m.getPickDtlInfo().getColPickUnqNo() == null ? "" :m.getPickDtlInfo().getColPickUnqNo() )
744
+                        .rtnPodrUnqNo(m.getPickDtlInfo() == null ? "" : m.getPickDtlInfo().getRtnPodrUnqNo() == null ? "" :m.getPickDtlInfo().getRtnPodrUnqNo() )
745
+                        .rtnPodrDtlNo(m.getPickDtlInfo() == null ? "" : m.getPickDtlInfo().getRtnPodrDtlNo() == null ? "" :m.getPickDtlInfo().getRtnPodrDtlNo() )
746
+                        .itemId(m.getPickDtlInfo() == null ? "" : m.getPickDtlInfo().getItemId() == null ? "" :m.getPickDtlInfo().getItemId() )
747
+                        .itemNm(m.getPickDtlInfo() == null ? "" : m.getPickDtlInfo().getItemNm() == null ? "" :m.getPickDtlInfo().getItemNm() )
748
+                        .colQty(m.getPickDtlInfo() == null ? 0 : m.getPickDtlInfo().getColQty() == null ? 0 :m.getPickDtlInfo().getColQty() )
749
+                        .colReqQty(m.getPickDtlInfo() == null ? 0 : m.getPickDtlInfo().getColReqQty() == null ? 0 :m.getPickDtlInfo().getColReqQty() )
750
+                        .colAmt(m.getPickDtlInfo() == null ? 0 : m.getPickDtlInfo().getColAmt() == null ? 0 :m.getPickDtlInfo().getColAmt() )
751
+                        .whsId(m.getWhsId() == null ? "" : m.getWhsId())
752 752
                         .location(m.getLocation() == null ? "" : m.getLocation())
753
-                        .whsNm(m.getWhsNm() == null ? "" : m.getWhsNm() + " - " + m.getLocationNm())
754
-                        .dlvReqDt(m.getDlvReqDt() == null ? "" : m.getDlvReqDt())
755
-                        .dlvSchDt(m.getDlvSchDt() == null ? "" : m.getDlvSchDt())
756
-                        .dlvMgrNm(m.getDlvMgrNm() == null ? "" : m.getDlvMgrNm())
757
-                        .dlvMgrTelNo(m.getDlvMgrTelNo() == null ? "" : m.getDlvMgrTelNo())
758
-                        .pchPodrUnqNo(m.getDeliDtlMgntInfo() == null ? "" : m.getDeliDtlMgntInfo().getPchPodrUnqNo() == null ? "" : m.getDeliDtlMgntInfo().getPchPodrUnqNo())
759
-                        .pchPodrDtlNo(m.getDeliDtlMgntInfo() == null ? "" : m.getDeliDtlMgntInfo().getPchPodrDtlNo() == null ? "" : m.getDeliDtlMgntInfo().getPchPodrDtlNo())
760
-                        .pchReqUnqNo(m.getDeliDtlMgntInfo() == null ? "" : m.getDeliDtlMgntInfo().getPchReqUnqNo() == null ? "" : m.getDeliDtlMgntInfo().getPchReqUnqNo())
761
-                        .pchReqDltNo(m.getDeliDtlMgntInfo() == null ? "" : m.getDeliDtlMgntInfo().getPchReqDtlNo() == null ? "" : m.getDeliDtlMgntInfo().getPchReqDtlNo())
753
+                        .whsNm(m.getWhsNm() == null ? "" : m.getWhsNm())
754
+                        .rtnWhsId(m.getRtnWhsId() == null ? "" : m.getRtnWhsId())
755
+                        .rtnLocation(m.getRtnLocation() == null ? "" : m.getRtnLocation())
756
+                        .rtnWhsNm(m.getRtnWhsNm() == null ? "" : m.getRtnWhsNm())
757
+                        .colSchDt(m.getColSchDt() == null ? "" : m.getColSchDt())
758
+                        .pickMgrNm(m.getPickMgrNm() == null ? "" : m.getPickMgrNm())
759
+                        .pickMgrTelNo(m.getPickMgrTelNo() == null ? "" : m.getPickMgrTelNo())
762 760
                         .spplyId(m.getSpplyId() == null ? "" : m.getSpplyId())
763 761
                         .spplyNm(m.getSpplyNm() == null ? "" : m.getSpplyNm())
764 762
                         .build())
765 763
                 .collect(Collectors.toList());
766 764
         return GridResponse.toDTO(gridPage, gridTotal, gridRecords, gridRows);
767 765
     }
768
- */
766
+
769 767
     /* 입고처리 저장
770 768
     @Transactional
771
-    public void saveWarehouseProc(String userId, SaveWarehouseProcRequest saveWarehouseProcRequest) throws Exception {
769
+    public void saveRtnStockProc(String userId, SaveRtnStockProcRequest saveRtnStockProcRequest) throws Exception {
772 770
         try {
773 771
 
774
-            List<WhsProcInfoPtclEntity> gridInsertData = saveWarehouseProcRequest.toCodeEntities(saveWarehouseProcRequest.getGridInsertData());
775
-            List<DeliDtlMgntEntity> serarchList = new ArrayList<DeliDtlMgntEntity>();
772
+            List<RtnProcInfoPtclEntity> gridInsertData = saveRtnStockProcRequest.toCodeEntities(saveRtnStockProcRequest.getGridInsertData());
773
+            List<RtnProcInfoPtclEntity> serarchList = new ArrayList<RtnProcInfoPtclEntity>();
776 774
             if (gridInsertData.size() > 0) {
777 775
                 for (int i = 0 ; i < gridInsertData.size() ; i++) {
778
-                    WhsProcInfoPtclEntity whsProcData = gridInsertData.get(i);
776
+                    RtnProcInfoPtclEntity whsProcData = gridInsertData.get(i);
779 777
                     DeliDtlMgntEntity deliData = new DeliDtlMgntEntity();
780 778
                     deliData.setDlvSttmtDtlNo(whsProcData.getDlvSttmtUnqNo() + whsProcData.getDlvSttmtDtlNo());
781 779
                     serarchList.add(deliData);

+ 26 - 27
src/main/java/com/oqpo/api/service/rtnmng/RtnOdrService.java

@@ -3,7 +3,6 @@ package com.oqpo.api.service.rtnmng;
3 3
 
4 4
 
5 5
 import com.oqpo.api.entity.oper.UserMngEntity;
6
-import com.oqpo.api.entity.pomng.PchOdrDtlPtclEntity;
7 6
 import com.oqpo.api.entity.rtnmng.RtnOdrBaseInfoEntity;
8 7
 import com.oqpo.api.entity.rtnmng.RtnOdrDtlPtclEntity;
9 8
 import com.oqpo.api.entity.rtnmng.RtnReqBaseInfoEntity;
@@ -19,17 +18,12 @@ import com.oqpo.api.mapper.stinfo.StoreBaseInfoMapper;
19 18
 import com.oqpo.api.mapper.stockmng.StockMngMapper;
20 19
 import com.oqpo.api.service.CommonService;
21 20
 import com.oqpo.api.web.dto.request.GridRequest;
22
-import com.oqpo.api.web.dto.request.pomng.pchOrd.CancelPchOrdDtlRequest;
23 21
 import com.oqpo.api.web.dto.request.rtnmng.CancelRtnOrdDtlRequest;
24 22
 import com.oqpo.api.web.dto.request.rtnmng.RtnReqOrdInitRequest;
25
-import com.oqpo.api.web.dto.request.rtnmng.SaveRtnOrdRequest;
23
+import com.oqpo.api.web.dto.request.rtnmng.SaveRtnOdrRequest;
26 24
 import com.oqpo.api.web.dto.response.GridResponse;
27
-import com.oqpo.api.web.dto.response.pomng.pchOrd.PchOdrInfoResponse;
28
-import com.oqpo.api.web.dto.response.pomng.pchOrd.PchOdrSearchListResponse;
29 25
 import com.oqpo.api.web.dto.response.rtnmng.rtnOrd.*;
30
-import com.oqpo.api.web.dto.response.rtnmng.rtnReq.RtnReqInitInfoResponse;
31 26
 import lombok.extern.slf4j.Slf4j;
32
-import org.apache.ibatis.annotations.Param;
33 27
 import org.springframework.beans.factory.annotation.Autowired;
34 28
 import org.springframework.stereotype.Service;
35 29
 import org.springframework.transaction.annotation.Transactional;
@@ -215,7 +209,7 @@ public class RtnOdrService extends CommonService {
215 209
       발주 정보 저장
216 210
 */
217 211
     @Transactional
218
-    public void saveRtnOdrInfo(String userId, SaveRtnOrdRequest saveRtnOrdRequest) throws Exception {
212
+    public void saveRtnOdrInfo(String userId, SaveRtnOdrRequest saveRtnOdrRequest) throws Exception {
219 213
         try {
220 214
 
221 215
             // 로그인 정보 가져오기
@@ -226,30 +220,30 @@ public class RtnOdrService extends CommonService {
226 220
             RtnOdrBaseInfoEntity rtnOrdEntity = new RtnOdrBaseInfoEntity();
227 221
 
228 222
             rtnOrdEntity.setRtnPodrUnqNo(rtnPodrUnqNo);
229
-            rtnOrdEntity.setBrandId(saveRtnOrdRequest.getBrandId());
230
-            rtnOrdEntity.setRtnReqDvsn(saveRtnOrdRequest.getRtnReqDvsn());
223
+            rtnOrdEntity.setBrandId(saveRtnOdrRequest.getBrandId());
224
+            rtnOrdEntity.setRtnReqDvsn(saveRtnOdrRequest.getRtnReqDvsn());
231 225
             rtnOrdEntity.setRtnMgrNm(uEntity.getUserNm());
232 226
             rtnOrdEntity.setRtnMgrId(userId);
233 227
             rtnOrdEntity.setRtnMgrTelNo(uEntity.getTelNo());
234
-            rtnOrdEntity.setSpplyId(saveRtnOrdRequest.getSpplyId());
235
-            rtnOrdEntity.setWhsId(saveRtnOrdRequest.getWhsId());
236
-            rtnOrdEntity.setLocation(saveRtnOrdRequest.getLocation());
237
-            rtnOrdEntity.setColDvsn(saveRtnOrdRequest.getColDvsn());
238
-            rtnOrdEntity.setColReqDt(saveRtnOrdRequest.getColReqDt().replaceAll("\\.",""));
239
-            rtnOrdEntity.setStoreId(saveRtnOrdRequest.getStoreId());
240
-            rtnOrdEntity.setRtnWhsId(saveRtnOrdRequest.getRtnWhsId());
241
-            rtnOrdEntity.setRtnLocation(saveRtnOrdRequest.getRtnLocation());
228
+            rtnOrdEntity.setSpplyId(saveRtnOdrRequest.getSpplyId());
229
+            rtnOrdEntity.setWhsId(saveRtnOdrRequest.getWhsId());
230
+            rtnOrdEntity.setLocation(saveRtnOdrRequest.getLocation());
231
+            rtnOrdEntity.setColDvsn(saveRtnOdrRequest.getColDvsn());
232
+            rtnOrdEntity.setColReqDt(saveRtnOdrRequest.getColReqDt().replaceAll("\\.",""));
233
+            rtnOrdEntity.setStoreId(saveRtnOdrRequest.getStoreId());
234
+            rtnOrdEntity.setRtnWhsId(saveRtnOdrRequest.getRtnWhsId());
235
+            rtnOrdEntity.setRtnLocation(saveRtnOdrRequest.getRtnLocation());
242 236
 
243 237
             Integer dtlRow = 0 ;
244 238
             List<RtnOdrDtlPtclEntity> rtnOrdDtlList = new ArrayList<RtnOdrDtlPtclEntity>();
245
-            List<RtnOdrDtlPtclEntity> gridUpdateData = saveRtnOrdRequest.toCodeEntities(saveRtnOrdRequest.getGridInsertData());
239
+            List<RtnOdrDtlPtclEntity> gridUpdateData = saveRtnOdrRequest.toCodeEntities(saveRtnOdrRequest.getGridInsertData());
246 240
 
247 241
             // 헤더데이타 체크
248 242
             if (gridUpdateData.size() < 1) {
249 243
                 throw new GlobalException(SystemMessageCode.ERR_NOTITEM);
250 244
             }
251 245
 
252
-            List<RtnOdrBaseInfoEntity> headList = rtnOdrMapper.selectRecRtnInitInfo(saveRtnOrdRequest.getBrandId(),gridUpdateData);
246
+            List<RtnOdrBaseInfoEntity> headList = rtnOdrMapper.selectRecRtnInitInfo(saveRtnOdrRequest.getBrandId(),gridUpdateData);
253 247
             if (headList.size() > 1) {
254 248
                 // 서로다른 수거장소로 인한 처리 불가 오류 메세지 출력  본사출력이면 매장수거장소,,  공급사수거면 본사수거장소
255 249
                 throw new GlobalException(SystemMessageCode.ERR_NEQRTNWHSID);
@@ -267,8 +261,8 @@ public class RtnOdrService extends CommonService {
267 261
                     RtnOdrDtlPtclEntity rtnSaveDtlEntity = new RtnOdrDtlPtclEntity(); // 저장할 메인
268 262
                     //RtnReqBaseInfoEntity rtnReqEntity = new RtnReqBaseInfoEntity();  // 반품요청상태
269 263
                     RtnReqDtlPtclEntity rtnReqDtlEntity = new RtnReqDtlPtclEntity();  // 반품요청상세상태
270
-                    // 구매요청건에 대한 데이타 가져옴
271
-                    if ("R".equals(saveRtnOrdRequest.getJobCd())) {   // 반품요청건
264
+                    // 반품요청건에 대한 데이타 가져옴
265
+                    if ("R".equals(saveRtnOdrRequest.getJobCd())) {   // 반품요청건
272 266
                         // 구매요청번호와 항번으로 데이타 가져놈
273 267
 
274 268
                         rtnSaveDtlEntity = rtnOdrMapper.selectPoRtnDtlSaveInfo(rtnDtlEntity.getRtnReqUnqNo(), rtnDtlEntity.getRtnReqDtlNo());
@@ -280,9 +274,9 @@ public class RtnOdrService extends CommonService {
280 274
                         //rtnReqList.add(rtnReqEntity);
281 275
                         rtnReqDtlList.add(rtnReqDtlEntity);
282 276
 
283
-                    } else if ("P".equals(saveRtnOrdRequest.getJobCd())) {  // 신규발주건
277
+                    } else if ("P".equals(saveRtnOdrRequest.getJobCd())) {  // 신규발주건
284 278
                         // item id 로 데이타 가져옴  == 단가는 브랜드 단가로 처리함
285
-                        rtnSaveDtlEntity = rtnOdrMapper.selectRtnItemDtlSaveInfo(saveRtnOrdRequest.getBrandId(), rtnDtlEntity.getItemId(), rtnDtlEntity.getBrandUnitUnqNo());
279
+                        rtnSaveDtlEntity = rtnOdrMapper.selectRtnItemDtlSaveInfo(saveRtnOdrRequest.getBrandId(), rtnDtlEntity.getItemId(), rtnDtlEntity.getBrandUnitUnqNo());
286 280
                     }
287 281
 
288 282
                     if (!rtnOrdEntity.getSpplyId().equals(rtnSaveDtlEntity.getSpplyId())) {
@@ -295,7 +289,11 @@ public class RtnOdrService extends CommonService {
295 289
                     rtnSaveDtlEntity.setRtnPodrDtlNo(dtlNo);
296 290
                     rtnSaveDtlEntity.setRtnReqUnqNo(rtnDtlEntity.getRtnReqUnqNo());
297 291
                     rtnSaveDtlEntity.setRtnReqDtlNo(rtnDtlEntity.getRtnReqDtlNo());
298
-                    rtnSaveDtlEntity.setRtnQty(rtnDtlEntity.getRtnReqQty());
292
+                    rtnSaveDtlEntity.setRtnQty(rtnSaveDtlEntity.getRtnReqQty());
293
+                    //System.out.println("==========================================");
294
+                    //System.out.println(rtnDtlEntity.getRtnQty() + "===" + rtnSaveDtlEntity.getUnitAmt());
295
+                    //System.out.println("==========================================");
296
+
299 297
                     rtnSaveDtlEntity.setRtnAmt(Long.valueOf(rtnDtlEntity.getRtnQty()) * rtnSaveDtlEntity.getUnitAmt() );
300 298
                     rtnSaveDtlEntity.setBrandUnitUnqNo(rtnDtlEntity.getBrandUnitUnqNo());
301 299
                     rtnSaveDtlEntity.setStoreUnitUnqNo(rtnDtlEntity.getStoreUnitUnqNo());
@@ -303,6 +301,7 @@ public class RtnOdrService extends CommonService {
303 301
                     rtnSaveDtlEntity.setRtnRsn(rtnDtlEntity.getRtnRsn());
304 302
                     rtnSaveDtlEntity.setRtnRsnDvsn(rtnDtlEntity.getRtnRsnDvsn());
305 303
                     rtnSaveDtlEntity.setRtnOdrQty(rtnDtlEntity.getRtnQty());
304
+                    rtnSaveDtlEntity.setRtnReqQty(rtnDtlEntity.getRtnReqQty());
306 305
                     rtnSaveDtlEntity.setRtnOdrAmt(Long.valueOf(rtnDtlEntity.getRtnQty()) * rtnSaveDtlEntity.getUnitAmt());
307 306
 
308 307
 
@@ -318,7 +317,7 @@ public class RtnOdrService extends CommonService {
318 317
                 if ("C002".equals(rtnOrdEntity.getColDvsn())) {
319 318
                     // 공급사 수거일경우
320 319
                     // 공급사는 하나여야 함
321
-                    if("".equals(saveRtnOrdRequest.getSpplyId())) {
320
+                    if("".equals(saveRtnOdrRequest.getSpplyId())) {
322 321
                         throw new GlobalException(SystemMessageCode.ERR_NOTSPPLY);
323 322
                     }
324 323
 
@@ -349,7 +348,7 @@ public class RtnOdrService extends CommonService {
349 348
 
350 349
 
351 350
                 // 반품요청건에 대한 상태에 대한 처리상태 변경
352
-                if ("R".equals(saveRtnOrdRequest.getJobCd())) {   // 반품요청건
351
+                if ("R".equals(saveRtnOdrRequest.getJobCd())) {   // 반품요청건
353 352
                     rtnReqMapper.updateSelRtnReqDtlStCd(userId,rtnReqDtlList);
354 353
                     String rtnReqUnqNo = "";
355 354
                     List<RtnReqBaseInfoEntity> rtnReqList = new ArrayList<RtnReqBaseInfoEntity>();

+ 3 - 1
src/main/java/com/oqpo/api/service/rtnmng/RtnReqService.java

@@ -195,8 +195,10 @@ public class RtnReqService extends CommonService {
195 195
                 rtnReqMapper.updateRtnReqBaseInfo(userId, entity);
196 196
             }
197 197
             // 상세코드 업데이트
198
-            if ("RRD20".equals(saveRtnReqlRequest.getRtnReqStCd())) {
198
+            if ("RR20".equals(saveRtnReqlRequest.getRtnReqStCd())) {
199 199
                 rtnReqMapper.updateAllRtnReqDtlStCd(userId, entity.getRtnReqUnqNo() , "RRD20");
200
+            } else {
201
+                rtnReqMapper.updateAllRtnReqDtlStCd(userId, entity.getRtnReqUnqNo() , "RRD00");
200 202
             }
201 203
 
202 204
         } catch (GlobalException e) {

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

@@ -193,22 +193,22 @@ public class ColOdrController {
193 193
     }
194 194
 
195 195
     /**
196
-     * 설명 : 입고처리 대상 리스트
196
+     * 설명 : 반품처리 대상 리스트
197 197
      *
198 198
      * @param SpplyDeliDtlGridRequest
199 199
      * @return
200 200
      * @throws Exception
201 201
 
202
-
202
+     */
203 203
     @ApiImplicitParams({
204 204
             @ApiImplicitParam(name = "X-AUTH-TOKEN", value = "CONN-KEY", required = true, dataType = "String", paramType = "header")
205 205
     })
206
-    @ApiOperation(value = " 입고처리 대상 그리드 리스트")
206
+    @ApiOperation(value = " 반품처리 대상 그리드 리스트")
207 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)));
208
+    public ResponseEntity<GridResponse> selectRtnStockTargetList(@RequestBody @Valid RtnStockTragetGridRequest rtnStockTragetGridRequest) throws Exception {
209
+        return ResponseEntity.ok(colOdrService.selectRtnStockTargetList(rtnStockTragetGridRequest.getSBrandId(),rtnStockTragetGridRequest.getSStoreId(), rtnStockTragetGridRequest.getFromDt(), rtnStockTragetGridRequest.getToDt(), rtnStockTragetGridRequest.getSRtnWhsId(), rtnStockTragetGridRequest.getSSpplyId(), rtnStockTragetGridRequest.getSWhsId(), rtnStockTragetGridRequest.getSItemNm(),  rtnStockTragetGridRequest.toDTO(rtnStockTragetGridRequest)));
210 210
     }
211
-     */
211
+
212 212
 
213 213
     /**
214 214
      * 설명 : 입고처리

+ 2 - 2
src/main/java/com/oqpo/api/web/controller/rtnmng/RtnOrdController.java

@@ -104,8 +104,8 @@ public class RtnOrdController {
104 104
     })
105 105
     @ApiOperation(value = "반품발주 정보 저장")
106 106
     @PostMapping("/save-rtnPo")
107
-    public ResponseEntity<SaveResponse> saveRtnOdr(@ApiIgnore String userId, @RequestBody @Valid SaveRtnOrdRequest saveRtnOrdRequest) throws Exception {
108
-        rtnOdrService.saveRtnOdrInfo(userId,  saveRtnOrdRequest);
107
+    public ResponseEntity<SaveResponse> saveRtnOdr(@ApiIgnore String userId, @RequestBody @Valid SaveRtnOdrRequest saveRtnOdrRequest) throws Exception {
108
+        rtnOdrService.saveRtnOdrInfo(userId,  saveRtnOdrRequest);
109 109
         return ResponseEntity.ok(SaveResponse.toDTO(SystemMessageCode.SAVE_OK));
110 110
     }
111 111
 

+ 1 - 1
src/main/java/com/oqpo/api/web/controller/rtnmng/RtnReqController.java

@@ -73,7 +73,7 @@ public class RtnReqController {
73 73
         if ("RR00".equals(saveRtnReqlRequest.getRtnReqStCd())) {
74 74
             return ResponseEntity.ok(SaveResponse.toDTO(SystemMessageCode.SAVE_OK));
75 75
         } else {
76
-            return ResponseEntity.ok(SaveResponse.toDTO(SystemMessageCode.REQ_OK));
76
+            return ResponseEntity.ok(SaveResponse.toDTO(SystemMessageCode.RTN_REQ_OK));
77 77
         }
78 78
 
79 79
     }

+ 48 - 0
src/main/java/com/oqpo/api/web/dto/request/inoutmng/RtnStockTragetGridRequest.java

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

+ 65 - 0
src/main/java/com/oqpo/api/web/dto/request/inoutmng/SaveRtnStockProcRequest.java

@@ -0,0 +1,65 @@
1
+package com.oqpo.api.web.dto.request.inoutmng;
2
+
3
+import com.oqpo.api.entity.rtnmng.RtnProcInfoPtclEntity;
4
+import com.oqpo.api.entity.stockmng.WhsProcInfoPtclEntity;
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 SaveRtnStockProcRequest {
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 whsId;
24
+
25
+    @ApiModelProperty(value = "매장창고 입고처리시 필수") private String storeId;
26
+    //colCnfmDocFileNo
27
+    @ApiModelProperty(value = "반품처리대상 리스트")
28
+    private List<RtnStockProcDataList> gridInsertData;
29
+
30
+
31
+    public List<RtnProcInfoPtclEntity> toCodeEntities(List<RtnStockProcDataList> gridData) {
32
+        List<RtnProcInfoPtclEntity> entities = new ArrayList<>();
33
+        if (gridData == null || gridData.size() == 0)
34
+            return entities;
35
+
36
+        gridData.forEach(x -> {
37
+            RtnProcInfoPtclEntity entity = new RtnProcInfoPtclEntity();
38
+            entity.setColPickUnqNo(x.getColPickUnqNo());
39
+            entity.setColPickDtlNo(x.getColPickDtlNo());
40
+            entity.setItemId(x.getItemId());
41
+            entity.setColQty(x.getColQty());
42
+            entities.add(entity);
43
+        });
44
+        return entities;
45
+    }
46
+
47
+    @Getter
48
+    @Builder
49
+    @AllArgsConstructor(access = AccessLevel.PROTECTED)
50
+    static class RtnStockProcDataList {
51
+
52
+        @NotBlank
53
+        @ApiModelProperty(value = "수거서번호") private String colPickUnqNo;
54
+
55
+        @NotBlank
56
+        @ApiModelProperty(value = "수거서항번") private String colPickDtlNo;
57
+
58
+        @ApiModelProperty(value = "품목아이디") private String itemId;
59
+
60
+        @NotBlank
61
+        @ApiModelProperty(value = "수거수량") private Integer colQty;
62
+
63
+
64
+    }
65
+}

+ 5 - 5
src/main/java/com/oqpo/api/web/dto/request/rtnmng/SaveRtnOrdRequest.java

@@ -1,7 +1,7 @@
1 1
 package com.oqpo.api.web.dto.request.rtnmng;
2 2
 
3
-import com.oqpo.api.entity.pomng.PchOdrDtlPtclEntity;
4 3
 import com.oqpo.api.entity.rtnmng.RtnOdrDtlPtclEntity;
4
+import com.oqpo.api.entity.rtnmng.RtnReqDtlPtclEntity;
5 5
 import io.swagger.annotations.ApiModelProperty;
6 6
 import lombok.*;
7 7
 
@@ -11,7 +11,7 @@ import java.util.List;
11 11
 
12 12
 @Getter
13 13
 @Setter
14
-public class SaveRtnOrdRequest {
14
+public class SaveRtnOdrRequest {
15 15
     @NotBlank
16 16
     @ApiModelProperty(value = "CRUD")
17 17
     private String viewCd;
@@ -43,10 +43,10 @@ public class SaveRtnOrdRequest {
43 43
 
44 44
 
45 45
     @ApiModelProperty(value = "등록 품목리스트")
46
-    private List<SaveRtnItemList> gridInsertData;
46
+    private List<SaveRtnOdrItemList> gridInsertData;
47 47
 
48 48
 
49
-    public List<RtnOdrDtlPtclEntity> toCodeEntities(List<SaveRtnItemList> gridData) {
49
+    public List<RtnOdrDtlPtclEntity> toCodeEntities(List<SaveRtnOdrItemList> gridData) {
50 50
         List<RtnOdrDtlPtclEntity> entities = new ArrayList<>();
51 51
         if (gridData == null || gridData.size() == 0)
52 52
             return entities;
@@ -71,7 +71,7 @@ public class SaveRtnOrdRequest {
71 71
     @Getter
72 72
     @Builder
73 73
     @AllArgsConstructor(access = AccessLevel.PROTECTED)
74
-    static class SaveRtnItemList {
74
+    static class SaveRtnOdrItemList {
75 75
 
76 76
         @ApiModelProperty(value = "반품요청고유번호") private String rtnReqUnqNo;
77 77
         @ApiModelProperty(value = "반품요청상세번호") private String rtnReqDtlNo;

+ 40 - 0
src/main/java/com/oqpo/api/web/dto/response/inoutmng/RtnStockTargetResponse.java

@@ -0,0 +1,40 @@
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 RtnStockTargetResponse {
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 colPickUnqNo;
20
+    @ApiModelProperty(value = "수거서항번") private String colPickDtlNo;
21
+    @ApiModelProperty(value = "반품번호") private String rtnPodrUnqNo;
22
+    @ApiModelProperty(value = "반품항번") private String rtnPodrDtlNo;
23
+    @ApiModelProperty(value = "품목아이디") private String itemId;
24
+    @ApiModelProperty(value = "품목명") private String itemNm;
25
+    @ApiModelProperty(value = "수거수량") private Integer colQty;
26
+    @ApiModelProperty(value = "수거요청수량") private Integer colReqQty;
27
+    @ApiModelProperty(value = "수거금액") private Long colAmt;
28
+    @ApiModelProperty(value = "반품입고창고") private String whsId;
29
+    @ApiModelProperty(value = "반품입고창고location") private String location;
30
+    @ApiModelProperty(value = "반품입고창고명") private String whsNm;
31
+    @ApiModelProperty(value = "수거창고") private String rtnWhsId;
32
+    @ApiModelProperty(value = "수거LOCATION") private String rtnLocation;
33
+    @ApiModelProperty(value = "수거창고명") private String rtnWhsNm;
34
+    @ApiModelProperty(value = "수거예정일") private String colSchDt;
35
+    @ApiModelProperty(value = "수거담당자명") private String pickMgrNm;
36
+    @ApiModelProperty(value = "수거담당자연락처") private String pickMgrTelNo;
37
+    @ApiModelProperty(value = "공급사아이디") private String spplyId;
38
+    @ApiModelProperty(value = "공급사명") private String spplyNm;
39
+
40
+}

+ 4 - 0
src/main/java/com/oqpo/api/web/dto/response/rtnmng/rtnOrd/RtnOrdInitInfoResponse.java

@@ -81,6 +81,8 @@ public class RtnOrdInitInfoResponse {
81 81
                                 .rtnRsnDvsn(m.getRtnRsnDvsn() == null ? "" : m.getRtnRsnDvsn())
82 82
                                 .rtnRsnDvsnNm(m.getRtnRsnDvsnNm() == null ? "" : m.getRtnRsnDvsnNm())
83 83
                                 .rtnRsn(m.getRtnRsn() == null ? "" : m.getRtnRsn())
84
+                                .rtnDvsn(m.getRtnDvsn() == null ? "" : m.getRtnDvsn())
85
+                                .rtnDvsnNm(m.getRtnDvsnNm() == null ? "" : m.getRtnDvsnNm())
84 86
                                 .unitGubun(m.getUnitGubun() == null ? "" : m.getUnitGubun())
85 87
                                 .build())
86 88
                         .collect(Collectors.toList()))
@@ -129,6 +131,8 @@ public class RtnOrdInitInfoResponse {
129 131
         @ApiModelProperty(value = "반품사유구분") private String rtnRsnDvsn;
130 132
         @ApiModelProperty(value = "반품사유구분명") private String rtnRsnDvsnNm;
131 133
         @ApiModelProperty(value = "반품사유내용") private String rtnRsn;
134
+        @ApiModelProperty(value = "반품구분") private String rtnDvsn;
135
+        @ApiModelProperty(value = "반품구분명") private String rtnDvsnNm;
132 136
         @ApiModelProperty(value = "단가구분") private String unitGubun;
133 137
 
134 138
     }

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

@@ -556,5 +556,126 @@
556 556
 
557 557
     </select>
558 558
 
559
+    <select id="selectColRtnInstGridList" resultType="com.oqpo.api.entity.inoutmng.PickInfoMgntEntity">
560
+        select mgnt.brand_id, fn_brand_nm(mgnt.brand_id) as brand_nm
561
+               ,mgnt.col_pick_unq_no, dtl.col_pick_dtl_no as 'pickDtlInfo.col_pick_dtl_no'
562
+               , dtl.rtn_podr_unq_no as 'pickDtlInfo.rtn_podr_unq_no' , dtl.rtn_podr_dtl_no as 'pickDtlInfo.rtn_podr_dtl_no'
563
+               ,dtl.item_id as 'pickDtlInfo.item_id', dtl.item_nm as 'pickDtlInfo.item_nm'
564
+               , dtl.col_req_qty as 'pickDtlInfo.col_qty' , dtl.col_req_qty as 'pickDtlInfo.col_req_qty'
565
+               , dtl.col_amt as 'pickDtlInfo.col_amt', mgnt.whs_id, mgnt.location
566
+               , fn_whs_nm(mgnt.brand_id, mgnt.whs_id) as rtn_whs_nm, fn_whs_location_nm(mgnt.brand_id, mgnt.whs_id, mgnt.location) as rtn_location_nm
567
+               , date_format(mgnt.col_sch_dt,'%Y.%m.%d') as col_sch_dt, mgnt.pick_mgr_nm, fn_get_telno(mgnt.pick_mgr_tel_no) as pick_mgr_tel_no
568
+               , base.whs_id, base.location
569
+               , fn_whs_nm(mgnt.brand_id, base.whs_id) as whs_nm, fn_whs_location_nm(base.brand_id, base.whs_id, base.location) as location_nm
570
+               , mgnt.spply_id, fn_spply_nm(mgnt.spply_id) as spply_nm
571
+        from   pick_info_mgnt mgnt
572
+              ,pick_dtl_ptcl dtl
573
+              ,rtn_odr_dtl_ptcl ptcl
574
+              ,rtn_odr_base_info base
575
+        where mgnt.col_pick_unq_no = dtl.col_pick_unq_no
576
+        and   dtl.rtn_podr_unq_no = ptcl.rtn_podr_unq_no
577
+        and   dtl.rtn_podr_dtl_no = ptcl.rtn_podr_dtl_no
578
+        and   ptcl.rtn_podr_unq_no = base.rtn_podr_unq_no
579
+        and   mgnt.brand_id = #{sBrandId}
580
+        and   mgnt.store_id = #{sStoreId}
581
+        and   mgnt.col_sch_dt between #{fromDt} and #{toDt}
582
+        <if test="sRtnWhsId != null and sRtnWhsId != ''">
583
+        and   base.whs_id = #{sRtnWhsId}
584
+        </if>
585
+        <if test="spplyId != null and spplyId != ''">
586
+        and   mgnt.spply_id = #{spplyId}
587
+        </if>
588
+        <if test="sWhsId != null and sWhsId != ''">
589
+        and   dtl.whs_id = #{sWhsId}
590
+        </if>
591
+        <if test="sItemNm != null and sItemNm != ''">
592
+        and   (mgnt.col_pick_unq_no like concat('%',#{sItemNm},'%') or dtl.item_id like concat('%',#{sItemNm},'%') or dtl.item_nm  like concat('%',#{sItemNm},'%') )
593
+        </if>
594
+        <choose>
595
+            <when test="gridRequest.sidx != null and gridRequest.sidx != ''">
596
+                <if test="gridRequest.sidx == 'VIEW_NUM'.toString()">
597
+                    <if test="gridRequest.sord == 'asc'.toString()">
598
+                        order by mgnt.col_pick_unq_no asc
599
+                    </if>
600
+                    <if test="gridRequest.sord == 'desc'.toString()">
601
+                        order by mgnt.col_pick_unq_no desc
602
+                    </if>
603
+                </if>
604
+            </when>
605
+            <otherwise>
606
+                order by mgnt.col_pick_unq_no desc
607
+            </otherwise>
608
+        </choose>
609
+        <if test="gridRequest.pagingYn == true">
610
+            limit #{gridRequest.gridFirst}, #{gridRequest.gridSize}
611
+        </if>
612
+    </select>
613
+
614
+    <select id="selectColRtnInstGridCnt" resultType="int">
615
+        select count(*) as cnt
616
+        from   pick_info_mgnt mgnt
617
+        ,pick_dtl_ptcl dtl
618
+        ,rtn_odr_dtl_ptcl ptcl
619
+        ,rtn_odr_base_info base
620
+        where mgnt.col_pick_unq_no = dtl.col_pick_unq_no
621
+        and   dtl.rtn_podr_unq_no = ptcl.rtn_podr_unq_no
622
+        and   dtl.rtn_podr_dtl_no = ptcl.rtn_podr_dtl_no
623
+        and   ptcl.rtn_podr_unq_no = base.rtn_podr_unq_no
624
+        and   mgnt.brand_id = #{sBrandId}
625
+        and   mgnt.store_id = #{sStoreId}
626
+        and   mgnt.col_sch_dt between #{fromDt} and #{toDt}
627
+        <if test="sRtnWhsId != null and sRtnWhsId != ''">
628
+            and   base.whs_id = #{sRtnWhsId}
629
+        </if>
630
+        <if test="spplyId != null and spplyId != ''">
631
+            and   mgnt.spply_id = #{spplyId}
632
+        </if>
633
+        <if test="sWhsId != null and sWhsId != ''">
634
+            and   dtl.whs_id = #{sWhsId}
635
+        </if>
636
+        <if test="sItemNm != null and sItemNm != ''">
637
+            and   (mgnt.col_pick_unq_no like concat('%',#{sItemNm},'%') or dtl.item_id like concat('%',#{sItemNm},'%') or dtl.item_nm  like concat('%',#{sItemNm},'%') )
638
+        </if>
639
+        <choose>
640
+            <when test="gridRequest.sidx != null and gridRequest.sidx != ''">
641
+                <if test="gridRequest.sidx == 'VIEW_NUM'.toString()">
642
+                    <if test="gridRequest.sord == 'asc'.toString()">
643
+                        order by mgnt.col_pick_unq_no asc
644
+                    </if>
645
+                    <if test="gridRequest.sord == 'desc'.toString()">
646
+                        order by mgnt.col_pick_unq_no desc
647
+                    </if>
648
+                </if>
649
+            </when>
650
+            <otherwise>
651
+                order by mgnt.col_pick_unq_no desc
652
+            </otherwise>
653
+        </choose>
654
+        <if test="gridRequest.pagingYn == true">
655
+            limit #{gridRequest.gridFirst}, #{gridRequest.gridSize}
656
+        </if>
657
+    </select>
559 658
 
659
+    <insert id="insertRtnProcInfoPtcl">
660
+        insert into rtn_proc_info_ptcl
661
+            (rtn_mgnt_unq_no, brand_id, store_id, item_id, item_nm
662
+            , whs_id, location, unit, unit_amt, rtn_qty
663
+            , rtn_odr_qty, col_qty, col_req_dt, col_sch_dt, col_dt
664
+            , col_cnfm_nm, col_mgr_nm, col_mgr_tel_no, col_mgr_emal, col_mgr_mbl_no
665
+            , col_amt, col_agr_yn, col_cnfm_doc_file_no, sttl_yn, spply_id
666
+            , spply_nm, col_pick_unq_no, col_pick_dtl_no, col_cmd_unq_no, col_cmd_dtl_no
667
+            , rtn_podr_unq_no, rtn_podr_dtl_no, rtn_req_unq_no, rtn_req_dtl_no, sttl_mgnt_unq_no, sttl_mgnt_dtl_no
668
+            , sys_reg_dttm, sys_reg_id, sys_chg_dttm, sys_chg_id)
669
+        values
670
+        <foreach collection="gridInsertData" item="item" separator=",">
671
+            (#{item.rtnMgntUnqNo}, #{item.brandId}, #{item.storeId}, #{item.itemId}, #{item.itemNm}
672
+            , #{item.whsId}, #{item.location}, #{item.unit}, #{item.unitAmt}, #{item.rtnQty}
673
+            , #{item.rtnOdrQty}, #{item.colQty}, #{item.colReqDt}, #{item.colSchDt}, #{item.colDt}
674
+            , #{item.colCnfmNm}, #{item.colMgrNm}, #{item.colMgrTelNo}, #{item.colMgrEmal}, #{item.colMgrMblNo}
675
+            , #{item.colAmt}, #{item.colAgrYn}, #{item.colCnfmDocFileNo}, #{item.sttlYn}, #{item.spplyId}
676
+            , #{item.spplyNm}, #{item.colPickUnqNo}, #{item.colPickDtlNo}, #{item.colCmdUnqNo}, #{item.colCmdDtlNo}
677
+            , #{item.rtnPodrUnqNo}, #{item.rtnPodrDtlNo}, #{item.rtnReqUnqNo}, #{item.rtnReqDtlNo}, #{item.sttlMgntUnqNo}, #{item.sttlMgntDtlNo}
678
+            , now(), #{userId}, now(), #{userId})
679
+        </foreach>
680
+    </insert>
560 681
 </mapper>

+ 5 - 4
src/main/resources/mybatis/sqlmaps/rtnmng/RtnOrd.xml

@@ -32,11 +32,12 @@
32 32
             , ptcl.rtn_rsn_dvsn, ptcl.rtn_rsn, ptcl.unit_gubun
33 33
             , fn_code_nm('RTN_RSN_DVSN',ptcl.rtn_rsn_dvsn) as rtn_rsn_dvsn_nm
34 34
             ,date_format(base.col_req_dt , '%Y.%m.%d') as col_req_dt
35
+            , ptcl.rtn_dvsn , fn_code_nm('RTN_DVSN',ptcl.rtn_dvsn ) as rtn_dvsn_nm
35 36
         from rtn_req_base_info base
36 37
             , rtn_req_dtl_ptcl ptcl
37 38
         where 1 = 1
38 39
         and base.rtn_req_unq_no = ptcl.rtn_req_unq_no
39
-        and base.brand_id = 'BRD221000001'
40
+        and base.brand_id = #{brandId}
40 41
         and base.rtn_req_st_cd = 'RR20'
41 42
         and concat(base.rtn_req_unq_no, ptcl.rtn_req_dtl_no) in
42 43
         <foreach collection="gridUpdateData" item="item" separator="," open="(" close=")">
@@ -70,21 +71,21 @@
70 71
             insert into rtn_odr_dtl_ptcl
71 72
             (rtn_podr_unq_no, rtn_podr_dtl_no, rtn_req_unq_no, rtn_req_dtl_no, item_id
72 73
             , item_nm, unit, unit_amt, col_req_dt, rtn_dvsn, rtn_req_qty
73
-            , rtn_qty, rtn_amt, rtn_rsn_dvsn, rtn_rsn, rtn_odr_qty
74
+            , rtn_amt, rtn_rsn_dvsn, rtn_rsn, rtn_odr_qty
74 75
             , rtn_odr_amt, rodr_dtl_st_cd
75 76
             , sys_reg_dttm, sys_reg_id, sys_chg_dttm, sys_chg_id)
76 77
             values
77 78
             <foreach collection="gridInsertData" item="item" separator=",">
78 79
                (#{item.rtnPodrUnqNo}, #{item.rtnPodrDtlNo}, #{item.rtnReqUnqNo}, #{item.rtnReqDtlNo}, #{item.itemId}
79 80
             , #{item.itemNm}, #{item.unit}, #{item.unitAmt}, #{item.colReqDt}, #{item.rtnDvsn}, #{item.rtnReqQty}
80
-            , #{item.rtnQty}, #{item.rtnAmt}, #{item.rtnRsnDvsn}, #{item.rtnRsn}, #{item.rtnOdrQty}
81
+            , #{item.rtnAmt}, #{item.rtnRsnDvsn}, #{item.rtnRsn}, #{item.rtnOdrQty}
81 82
             , #{item.rtnOdrAmt}, 'ROD1', NOW(), #{userId}, NOW(), #{userId})
82 83
             </foreach>
83 84
         </insert>
84 85
 
85 86
 
86 87
         <select id="selectPoRtnDtlSaveInfo" resultType="com.oqpo.api.entity.rtnmng.RtnOdrDtlPtclEntity">
87
-            select ptcl.item_id, ptcl.item_nm,  ptcl.unit, ptcl.unit_amt, bunit.spply_id
88
+            select ptcl.item_id, ptcl.item_nm,  ptcl.unit, ptcl.unit_amt, bunit.spply_id, ptcl.rtn_qty
88 89
             from  rtn_req_dtl_ptcl ptcl
89 90
               join rtn_req_base_info base on ptcl.rtn_req_unq_no = base.rtn_req_unq_no
90 91
               join brand_item_unit_info bunit on ptcl.brand_unit_unq_no = bunit.brand_unit_unq_no

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

@@ -332,7 +332,7 @@
332 332
             A.col_mgr_nm, A.col_mgr_tel_no, A.col_mgr_emal, A.col_mgr_mbl_no, A.col_amt, A.col_agr_yn,
333 333
             A.col_cnfm_doc_file_no, A.sttl_yn, A.spply_id, A.spply_nm, A.col_cmd_unq_no, A.col_cmd_dtl_no,
334 334
             A.rtn_podr_unq_no, A.rtn_podr_dtl_no, A.rtn_req_unq_no, A.rtn_req_dtl_no, A.sttl_mgnt_unq_no,
335
-            A.sttl_mgnt_dtl_no,
335
+            A.sttl_mgnt_dtl_no, A.col_pick_unq_no, A.col_pick_dtl_no,
336 336
             DATE_FORMAT(A.sys_reg_dttm,'%Y.%m.%d %H:%i:%s') AS sys_reg_dttm, A.sys_reg_id, DATE_FORMAT(A.sys_chg_dttm,'%Y.%m.%d %H:%i:%s') AS sys_chg_dttm, A.sys_chg_id
337 337
         FROM rtn_proc_info_ptcl A
338 338
         WHERE A.rtn_mgnt_unq_no = #{rtnMgntUnqNo}