dwkim 2 роки тому
батько
коміт
69e0b1682c
17 змінених файлів з 536 додано та 240 видалено
  1. 1 0
      src/main/java/com/oqpo/api/entity/inoutmng/PickDtlPtclEntity.java
  2. 1 0
      src/main/java/com/oqpo/api/entity/rtnmng/RtnOdrBaseInfoEntity.java
  3. 1 0
      src/main/java/com/oqpo/api/enums/SystemMessageCode.java
  4. 8 0
      src/main/java/com/oqpo/api/mapper/inoutmng/ColOdrMapper.java
  5. 154 108
      src/main/java/com/oqpo/api/service/inoutmng/ColOdrService.java
  6. 44 26
      src/main/java/com/oqpo/api/web/controller/inoutmng/ColOdrController.java
  7. 56 0
      src/main/java/com/oqpo/api/web/dto/request/inoutmng/InstInitColOdrRequest.java
  8. 2 2
      src/main/java/com/oqpo/api/web/dto/response/inoutmng/ColInfoResponse.java
  9. 47 0
      src/main/java/com/oqpo/api/web/dto/response/inoutmng/ColInstInitOdrSearchListResponse.java
  10. 2 2
      src/main/java/com/oqpo/api/web/dto/response/inoutmng/ColTragetOdrSearchListResponse.java
  11. 2 2
      src/main/java/com/oqpo/api/web/dto/response/inoutmng/PickDtlSearchListResponse.java
  12. 44 0
      src/main/java/com/oqpo/api/web/dto/response/inoutmng/RtnColStockResultResponse.java
  13. 1 0
      src/main/java/com/oqpo/api/web/dto/response/inoutmng/RtnStockTargetResponse.java
  14. 2 2
      src/main/java/com/oqpo/api/web/dto/response/inoutmng/SpplyPickInitResponse.java
  15. 2 2
      src/main/java/com/oqpo/api/web/dto/response/inoutmng/SpplyTargerRtnSearchListResponse.java
  16. 168 95
      src/main/resources/mybatis/sqlmaps/inoutmng/ColOdr.xml
  17. 1 1
      src/main/resources/mybatis/sqlmaps/rtnmng/RtnOrd.xml

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

@@ -41,6 +41,7 @@ public class PickDtlPtclEntity implements Serializable {
41 41
     private String rtnRsnDvsn;
42 42
     private String rtnRsnDvsnNm;
43 43
     private String rtnRsn;
44
+    private Long colReqAmt;
44 45
 
45 46
 
46 47
 }

+ 1 - 0
src/main/java/com/oqpo/api/entity/rtnmng/RtnOdrBaseInfoEntity.java

@@ -53,6 +53,7 @@ public class RtnOdrBaseInfoEntity implements Serializable {
53 53
     private String sysChgDttm;
54 54
     private String sysChgId;
55 55
     private String pickTelNo;
56
+
56 57
     private RtnOdrDtlPtclEntity rtnOdrDtlInfo ;
57 58
 
58 59
 }

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

@@ -28,6 +28,7 @@ public enum SystemMessageCode {
28 28
     REJECT_OK (20022, "반려 되었습니다.", HttpStatus.OK),
29 29
     RTN_REQ_OK (20023, "반품요청 되었습니다.", HttpStatus.OK),
30 30
     CANCEL_OK (20024, "취소 되었습니다.", HttpStatus.OK),
31
+    COL_OK (20025, "수거지시 처리되었습니다.", HttpStatus.OK),
31 32
     ERR_PW(40001, "현재의 비밀번호가 틀립니다. ", HttpStatus.BAD_REQUEST),
32 33
     ERR_FIND_ID(40002, "입력하신  정보로 등록된 아이디가 없습니다.", HttpStatus.BAD_REQUEST),
33 34
     ERR_FIND_PW(40003, "입력하신  정보로 등록된 아이디가 없습니다.", HttpStatus.BAD_REQUEST),

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

@@ -21,6 +21,9 @@ public interface ColOdrMapper {
21 21
     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;
22 22
     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;
23 23
 
24
+
25
+    List<RtnOdrBaseInfoEntity> selectColInstRtnGridList(@Param("brandId") String brandId, List<RtnOdrDtlPtclEntity> gridUpdateData, GridRequest gridRequest)throws Exception;
26
+
24 27
     List<RtnOdrBaseInfoEntity> selectPickJobDataList(@Param("brandId") String brandId, List<RtnOdrDtlPtclEntity> gridInsertData)throws Exception;
25 28
 
26 29
     int insertColOdrBase(@Param("userId") String userId, ColOdrBaseEntity entity)throws Exception;
@@ -49,6 +52,11 @@ public interface ColOdrMapper {
49 52
 
50 53
     int insertRtnProcInfoPtcl(@Param("userId") String userId, List<RtnProcInfoPtclEntity> gridInsertData) throws Exception;
51 54
 
55
+    List<PickInfoMgntEntity> selectColRtnInstResultGridList(@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;
56
+    int selectColRtnInstResultGridCnt(@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;
57
+
58
+
59
+
52 60
     /*
53 61
     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;
54 62
     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;

+ 154 - 108
src/main/java/com/oqpo/api/service/inoutmng/ColOdrService.java

@@ -76,7 +76,7 @@ public class ColOdrService extends CommonService {
76 76
     /*
77 77
       수거 대상 그리드 리스트 조회
78 78
      */
79
-    public GridResponse selectShmtTargetOdrGridList(String sBrandId, String fromDt, String toDt, String sWhsId, String sRtnWhsId, String sItemNm, GridRequest gridRequest) throws Exception {
79
+    public GridResponse selectColTargetOdrGridList(String sBrandId, String fromDt, String toDt, String sWhsId, String sRtnWhsId, String sItemNm, GridRequest gridRequest) throws Exception {
80 80
         int gridPage = gridRequest.getGridPage();
81 81
         int gridSize = gridRequest.getGridSize();
82 82
 
@@ -99,13 +99,54 @@ public class ColOdrService extends CommonService {
99 99
                         .itemNm(m.getRtnOdrDtlInfo() == null ? "" : m.getRtnOdrDtlInfo().getItemNm() == null ? "" : m.getRtnOdrDtlInfo().getItemNm())
100 100
                         .rtnWhsId(m.getRtnWhsId() == null ? "" : m.getRtnWhsId())
101 101
                         .rtnLocation(m.getRtnLocation() == null ? "" : m.getRtnLocation())
102
-                        .rntWhsNm(m.getRtnWhsNm() == null ? "" : m.getRtnWhsNm())
102
+                        .rntWhsNm(m.getRtnWhsNm() == null ? "" : m.getRtnWhsNm() + " - " + m.getRtnLocationNm())
103 103
                         .whsId(m.getWhsId() == null ? "" : m.getWhsId())
104 104
                         .location(m.getLocation() == null ? "" : m.getLocation())
105
-                        .whsNm(m.getWhsNm() == null ? "" : m.getWhsNm())
105
+                        .whsNm(m.getWhsNm() == null ? "" : m.getWhsNm() + " - " + m.getLocationNm())
106 106
                         .unitAmt(m.getRtnOdrDtlInfo() == null ? 0 : m.getRtnOdrDtlInfo().getUnitAmt() == null ? 0 : m.getRtnOdrDtlInfo().getUnitAmt())
107 107
                         .rtnReqQty(m.getRtnOdrDtlInfo() == null ? 0 : m.getRtnOdrDtlInfo().getRtnReqQty() == null ? 0 : m.getRtnOdrDtlInfo().getRtnReqQty())
108
-                        .rtnQty(m.getRtnOdrDtlInfo() == null ? 0 : m.getRtnOdrDtlInfo().getRtnQty() == null ? 0 : m.getRtnOdrDtlInfo().getRtnQty())
108
+                        .rtnOdrQty(m.getRtnOdrDtlInfo() == null ? 0 : m.getRtnOdrDtlInfo().getRtnOdrQty() == null ? 0 : m.getRtnOdrDtlInfo().getRtnOdrQty())
109
+                        .rtnAmt(m.getRtnOdrDtlInfo() == null ? 0 : m.getRtnOdrDtlInfo().getRtnAmt() == null ? 0 : m.getRtnOdrDtlInfo().getRtnAmt())
110
+                        .colReqDt(m.getColReqDt() == null ? "" : m.getColReqDt())
111
+                        .storeId(m.getStoreId() == null ? "" : m.getStoreId())
112
+                        .build())
113
+                .collect(Collectors.toList());
114
+        return GridResponse.toDTO(gridPage, gridTotal, gridRecords, gridRows);
115
+    }
116
+
117
+    /*
118
+      수거지시 초기 그리드 리스트 조회
119
+*/
120
+    public GridResponse selectColInstOdrGridList(String sBrandId, InstInitColOdrRequest instInitColOdrRequest, GridRequest gridRequest) throws Exception {
121
+
122
+        int gridPage = gridRequest.getGridPage();
123
+        int gridSize = gridRequest.getGridSize();
124
+
125
+        List<RtnOdrBaseInfoEntity> entities = colOdrMapper.selectColInstRtnGridList(sBrandId,instInitColOdrRequest.toCodeEntities(instInitColOdrRequest.getGridUpdateData()), gridRequest);
126
+
127
+        int gridRecords = entities.size();
128
+        int gridTotal = fnCalculateGridTotal(gridSize, gridRecords);
129
+
130
+        List<Object> gridRows = entities.stream()
131
+                .map(m -> ColInstInitOdrSearchListResponse.builder()
132
+                        .viewCd("R")
133
+                        .brandId(m.getBrandId() == null ? "" : m.getBrandId())
134
+                        .brandNm(m.getBrandNm() == null ? "" : m.getBrandNm())
135
+                        .rtnPodrUnqNo(m.getRtnPodrUnqNo() == null ? "" : m.getRtnPodrUnqNo())
136
+                        .rtnPodrDtlNo(m.getRtnOdrDtlInfo() == null ? "" : m.getRtnOdrDtlInfo().getRtnPodrDtlNo() == null ? "" : m.getRtnOdrDtlInfo().getRtnPodrDtlNo())
137
+                        .rtnReqUnqNo(m.getRtnOdrDtlInfo() == null ? "" : m.getRtnOdrDtlInfo().getRtnReqUnqNo() == null ? "" : m.getRtnOdrDtlInfo().getRtnReqUnqNo())
138
+                        .rtnReqDtlNo(m.getRtnOdrDtlInfo() == null ? "" : m.getRtnOdrDtlInfo().getRtnReqDtlNo() == null ? "" : m.getRtnOdrDtlInfo().getRtnReqDtlNo())
139
+                        .itemId(m.getRtnOdrDtlInfo() == null ? "" : m.getRtnOdrDtlInfo().getItemId() == null ? "" : m.getRtnOdrDtlInfo().getItemId())
140
+                        .itemNm(m.getRtnOdrDtlInfo() == null ? "" : m.getRtnOdrDtlInfo().getItemNm() == null ? "" : m.getRtnOdrDtlInfo().getItemNm())
141
+                        .rtnWhsId(m.getRtnWhsId() == null ? "" : m.getRtnWhsId())
142
+                        .rtnLocation(m.getRtnLocation() == null ? "" : m.getRtnLocation())
143
+                        .rntWhsNm(m.getRtnWhsNm() == null ? "" : m.getRtnWhsNm() + " - " + m.getRtnLocationNm())
144
+                        .whsId(m.getWhsId() == null ? "" : m.getWhsId())
145
+                        .location(m.getLocation() == null ? "" : m.getLocation())
146
+                        .whsNm(m.getWhsNm() == null ? "" : m.getWhsNm() + " - " + m.getLocationNm())
147
+                        .unitAmt(m.getRtnOdrDtlInfo() == null ? 0 : m.getRtnOdrDtlInfo().getUnitAmt() == null ? 0 : m.getRtnOdrDtlInfo().getUnitAmt())
148
+                        .colQty(m.getRtnOdrDtlInfo() == null ? 0 : m.getRtnOdrDtlInfo().getColQty() == null ? 0 : m.getRtnOdrDtlInfo().getColQty())
149
+                        .rtnOdrQty(m.getRtnOdrDtlInfo() == null ? 0 : m.getRtnOdrDtlInfo().getRtnOdrQty() == null ? 0 : m.getRtnOdrDtlInfo().getRtnOdrQty())
109 150
                         .rtnAmt(m.getRtnOdrDtlInfo() == null ? 0 : m.getRtnOdrDtlInfo().getRtnAmt() == null ? 0 : m.getRtnOdrDtlInfo().getRtnAmt())
110 151
                         .colReqDt(m.getColReqDt() == null ? "" : m.getColReqDt())
111 152
                         .storeId(m.getStoreId() == null ? "" : m.getStoreId())
@@ -122,8 +163,6 @@ public class ColOdrService extends CommonService {
122 163
         try {
123 164
 
124 165
             List<RtnOdrDtlPtclEntity> gridInsertData = instColOdrRequest.toCodeEntities(instColOdrRequest.getGridInsertData());
125
-
126
-
127 166
             List<RtnOdrBaseInfoEntity> jobList = colOdrMapper.selectPickJobDataList(instColOdrRequest.getBrandId(), gridInsertData);
128 167
 
129 168
             String whsId = "";
@@ -205,8 +244,8 @@ public class ColOdrService extends CommonService {
205 244
                     pickDtlEntity.setUnit(entity.getRtnOdrDtlInfo().getUnit());
206 245
                     pickDtlEntity.setUnitAmt(entity.getRtnOdrDtlInfo().getUnitAmt());
207 246
                     pickDtlEntity.setRodrQty(entity.getRtnOdrDtlInfo().getRtnOdrQty());
208
-                    pickDtlEntity.setColQty(colQty);
209
-                    pickDtlEntity.setColAmt(colQty * entity.getRtnOdrDtlInfo().getUnitAmt());
247
+                    pickDtlEntity.setColReqQty(colQty);
248
+                    pickDtlEntity.setColReqAmt(colQty * entity.getRtnOdrDtlInfo().getUnitAmt());
210 249
 
211 250
                     pickDtlList.add(pickDtlEntity);
212 251
 
@@ -251,8 +290,8 @@ public class ColOdrService extends CommonService {
251 290
                     colOdrBaseEntity.setColPickUnqNo(colPickUnqNo);
252 291
                     colOdrBaseEntity.setItemQty(itemQty);
253 292
                     colOdrBaseEntity.setColTotalAmt(colTotalAmt);
254
-                    colOdrBaseEntity.setColReqDt(instColOdrRequest.getColSchDt().replaceAll("//.",""));
255
-                    colOdrBaseEntity.setColDvsn("C001");
293
+                    colOdrBaseEntity.setColReqDt(instColOdrRequest.getColSchDt().replaceAll("\\.",""));
294
+                    colOdrBaseEntity.setColDvsn(entity.getColDvsn());
256 295
                     colOdrBaseEntity.setColCmdStCd("COL1");
257 296
                     colOdrBaseEntity.setColReqMgrNm(entity.getRtnMgrNm());
258 297
                     colOdrBaseEntity.setColReqMgrId(entity.getRtnMgrId());
@@ -260,7 +299,7 @@ public class ColOdrService extends CommonService {
260 299
                     colOdrBaseEntity.setColCnfmNm(null);
261 300
                     colOdrBaseEntity.setColCnfmId(null);
262 301
                     colOdrBaseEntity.setColMgrNm(instColOdrRequest.getPickMgrNm());
263
-                    colOdrBaseEntity.setColMgrTelNo(instColOdrRequest.getPickMgrTelNo());
302
+                    colOdrBaseEntity.setColMgrTelNo(instColOdrRequest.getPickMgrTelNo().replaceAll("-",""));
264 303
                     colOdrBaseEntity.setColMgrEmal(null);
265 304
                     colOdrBaseEntity.setColMgrMblNo(null);
266 305
                     colOdrBaseEntity.setRtnWhsId(entity.getRtnWhsId());
@@ -283,28 +322,30 @@ public class ColOdrService extends CommonService {
283 322
                     colDtlEntity.setRtnPodrDtlNo(entity.getRtnOdrDtlInfo().getRtnPodrDtlNo());
284 323
                     colDtlEntity.setRtnReqUnqNo(entity.getRtnOdrDtlInfo().getRtnReqUnqNo());
285 324
                     colDtlEntity.setRtnReqDtlNo(entity.getRtnOdrDtlInfo().getRtnReqDtlNo());
286
-
325
+                    colDtlList.add(colDtlEntity);
287 326
 
288 327
                     pickInfoMgntEntity.setColPickUnqNo(colPickUnqNo);
289 328
                     pickInfoMgntEntity.setSpplyId(entity.getSpplyId());
290 329
                     pickInfoMgntEntity.setSpplyNm(entity.getSpplyNm());
291 330
                     pickInfoMgntEntity.setStoreId(entity.getStoreId());
292 331
                     pickInfoMgntEntity.setColTotAmt(colTotalAmt);
332
+                    pickInfoMgntEntity.setColDvsn(entity.getColDvsn());
293 333
                     pickInfoMgntEntity.setPickMgrNm(instColOdrRequest.getPickMgrNm());
294 334
                     pickInfoMgntEntity.setPickMgrTelNo(instColOdrRequest.getPickMgrTelNo().replaceAll("-",""));
295 335
                     pickInfoMgntEntity.setPndrTelNo(entity.getPickTelNo().replaceAll("-",""));
296 336
                     pickInfoMgntEntity.setPickStCd("PICK0");
297
-                    pickInfoMgntEntity.setColReqDt(instColOdrRequest.getColSchDt().replaceAll("-",""));
298
-                    pickInfoMgntEntity.setColSchDt(instColOdrRequest.getColSchDt().replaceAll("-",""));
337
+                    pickInfoMgntEntity.setColReqDt(instColOdrRequest.getColSchDt().replaceAll("\\.",""));
338
+                    pickInfoMgntEntity.setColSchDt(instColOdrRequest.getColSchDt().replaceAll("\\.",""));
299 339
                     pickInfoMgntEntity.setColCmpltDt(null);
300
-                    pickInfoMgntEntity.setWhsId(entity.getWhsId());
301
-                    pickInfoMgntEntity.setLocation(entity.getLocation());
302
-                    pickInfoMgntEntity.setColDvsn(entity.getColDvsn());
340
+                    pickInfoMgntEntity.setWhsId(entity.getRtnWhsId());
341
+                    pickInfoMgntEntity.setLocation(entity.getRtnLocation());
342
+                    //pickInfoMgntEntity.setColDvsn(entity.getColDvsn());
303 343
                     pickInfoMgntEntity.setWhsDvsn(entity.getColDvsn() == "C001" ? "W02" : "W01");  // 본사엣 수거면 매장,,, 공급사에서 수거면 본사
304 344
                     pickInfoMgntEntity.setBrandId(entity.getBrandId());
305 345
                     pickInfoMgntEntity.setColDesc(null);
306 346
 
307 347
 
348
+
308 349
                     pickDtlEntity.setColPickUnqNo(colPickUnqNo);
309 350
 
310 351
                     pickDtlEntity.setColPickDtlNo("10");
@@ -319,8 +360,8 @@ public class ColOdrService extends CommonService {
319 360
                     pickDtlEntity.setUnit(entity.getRtnOdrDtlInfo().getUnit());
320 361
                     pickDtlEntity.setUnitAmt(entity.getRtnOdrDtlInfo().getUnitAmt());
321 362
                     pickDtlEntity.setRodrQty(entity.getRtnOdrDtlInfo().getRtnOdrQty());
322
-                    pickDtlEntity.setColQty(colQty);
323
-                    pickDtlEntity.setColAmt(colQty * entity.getRtnOdrDtlInfo().getUnitAmt());
363
+                    pickDtlEntity.setColReqQty(colQty);
364
+                    pickDtlEntity.setColReqAmt(colQty * entity.getRtnOdrDtlInfo().getUnitAmt());
324 365
 
325 366
                     pickDtlList.add(pickDtlEntity);
326 367
                 }
@@ -486,11 +527,11 @@ public class ColOdrService extends CommonService {
486 527
                         .itemId(m.getRtnOdrDtlInfo() == null ? "" : m.getRtnOdrDtlInfo().getItemId() == null ? "" : m.getRtnOdrDtlInfo().getItemId())
487 528
                         .itemNm(m.getRtnOdrDtlInfo() == null ? "" : m.getRtnOdrDtlInfo().getItemNm() == null ? "" : m.getRtnOdrDtlInfo().getItemNm())
488 529
                         .rtnWhsId(m.getRtnWhsId() == null ? "" : m.getRtnWhsId())
489
-                        .rtnWhsNm(m.getRtnWhsNm() == null ? "" : m.getRtnWhsNm())
530
+                        .rtnWhsNm(m.getRtnWhsNm() == null ? "" : m.getRtnWhsNm() + " - " + m.getRtnLocationNm())
490 531
                         .rtnLocation(m.getRtnLocation() == null ? "" : m.getRtnLocation())
491 532
                         .unitAmt(m.getRtnOdrDtlInfo() == null ? 0 : m.getRtnOdrDtlInfo().getUnitAmt() == null ? 0 : m.getRtnOdrDtlInfo().getUnitAmt())
492
-                        .rtnQty(m.getRtnOdrDtlInfo() == null ? 0 : m.getRtnOdrDtlInfo().getRtnQty() == null ? 0 : m.getRtnOdrDtlInfo().getRtnQty())
493
-                        .rtnAmt(m.getRtnOdrDtlInfo() == null ? 0 : m.getRtnOdrDtlInfo().getRtnAmt() == null ? 0 : m.getRtnOdrDtlInfo().getRtnAmt())
533
+                        .rtnOdrQty(m.getRtnOdrDtlInfo() == null ? 0 : m.getRtnOdrDtlInfo().getRtnOdrQty() == null ? 0 : m.getRtnOdrDtlInfo().getRtnOdrQty())
534
+                        .rtnOdrAmt(m.getRtnOdrDtlInfo() == null ? 0 : m.getRtnOdrDtlInfo().getRtnOdrAmt() == null ? 0 : m.getRtnOdrDtlInfo().getRtnOdrAmt())
494 535
                         .colReqDt(m.getColReqDt() == null ? "" : m.getColReqDt())
495 536
                         .build())
496 537
                 .collect(Collectors.toList());
@@ -548,11 +589,11 @@ public class ColOdrService extends CommonService {
548 589
                     pickInfoMgntEntity.setPickMgrTelNo(saveSpplyPickRequest.getPickMgrTelNo().replaceAll("-",""));
549 590
                     pickInfoMgntEntity.setPndrTelNo(entity.getPickTelNo().replaceAll("-",""));
550 591
                     pickInfoMgntEntity.setPickStCd("PICK0");
551
-                    pickInfoMgntEntity.setColReqDt(saveSpplyPickRequest.getColSchDt().replaceAll("-",""));
552
-                    pickInfoMgntEntity.setColSchDt(saveSpplyPickRequest.getColSchDt().replaceAll("-",""));
592
+                    pickInfoMgntEntity.setColReqDt(saveSpplyPickRequest.getColSchDt().replaceAll("\\.",""));
593
+                    pickInfoMgntEntity.setColSchDt(saveSpplyPickRequest.getColSchDt().replaceAll("\\.",""));
553 594
                     pickInfoMgntEntity.setColCmpltDt(null);
554
-                    pickInfoMgntEntity.setWhsId(entity.getWhsId());
555
-                    pickInfoMgntEntity.setLocation(entity.getLocation());
595
+                    pickInfoMgntEntity.setWhsId(entity.getRtnWhsId());
596
+                    pickInfoMgntEntity.setLocation(entity.getRtnLocation());
556 597
                     pickInfoMgntEntity.setColDvsn(entity.getColDvsn());
557 598
                     pickInfoMgntEntity.setWhsDvsn(entity.getColDvsn() == "C001" ? "W02" : "W01");  // 본사엣 수거면 매장,,, 공급사에서 수거면 본사
558 599
                     pickInfoMgntEntity.setBrandId(entity.getBrandId());
@@ -567,40 +608,40 @@ public class ColOdrService extends CommonService {
567 608
                     pickDtlEntity.setRtnReqUnqNo(entity.getRtnOdrDtlInfo().getRtnReqUnqNo());
568 609
                     pickDtlEntity.setRtnReqDtlNo(entity.getRtnOdrDtlInfo().getRtnReqDtlNo());
569 610
                     pickDtlEntity.setColCmdUnqNo(null);
570
-                    pickDtlEntity.setColCmdDtlNo("10");
611
+                    pickDtlEntity.setColCmdDtlNo(null);
571 612
                     pickDtlEntity.setItemId(entity.getRtnOdrDtlInfo().getItemId());
572 613
                     pickDtlEntity.setItemNm(entity.getRtnOdrDtlInfo().getItemNm());
573 614
                     pickDtlEntity.setUnit(entity.getRtnOdrDtlInfo().getUnit());
574 615
                     pickDtlEntity.setUnitAmt(entity.getRtnOdrDtlInfo().getUnitAmt());
575 616
                     pickDtlEntity.setRodrQty(entity.getRtnOdrDtlInfo().getRtnOdrQty());
576
-                    pickDtlEntity.setColQty(colQty);
617
+                    pickDtlEntity.setColReqQty(colQty);
577 618
                     colTotalAmt = colQty * entity.getRtnOdrDtlInfo().getUnitAmt();
578
-                    pickDtlEntity.setColAmt(colTotalAmt);
619
+                    pickDtlEntity.setColReqAmt(colTotalAmt);
579 620
 
580 621
                     pickDtlList.add(pickDtlEntity);
581
-                }
622
+                } else {
623
+
624
+                    int dtlNo = (i + 1) * 10;
582 625
 
583
-                int dtlNo = (i+1) * 10;
584
-
585
-                PickDtlPtclEntity pickDtlEntity = new PickDtlPtclEntity();
586
-                pickDtlEntity.setColPickUnqNo(colPickUnqNo);
587
-
588
-                pickDtlEntity.setColPickDtlNo("10");
589
-                pickDtlEntity.setRtnPodrUnqNo(entity.getRtnPodrUnqNo());
590
-                pickDtlEntity.setRtnPodrDtlNo(entity.getRtnOdrDtlInfo().getRtnPodrDtlNo());
591
-                pickDtlEntity.setRtnReqUnqNo(entity.getRtnOdrDtlInfo().getRtnReqUnqNo());
592
-                pickDtlEntity.setRtnReqDtlNo(entity.getRtnOdrDtlInfo().getRtnReqDtlNo());
593
-                pickDtlEntity.setColCmdUnqNo(null);
594
-                pickDtlEntity.setColCmdDtlNo("10");
595
-                pickDtlEntity.setItemId(entity.getRtnOdrDtlInfo().getItemId());
596
-                pickDtlEntity.setItemNm(entity.getRtnOdrDtlInfo().getItemNm());
597
-                pickDtlEntity.setUnit(entity.getRtnOdrDtlInfo().getUnit());
598
-                pickDtlEntity.setUnitAmt(entity.getRtnOdrDtlInfo().getUnitAmt());
599
-                pickDtlEntity.setRodrQty(entity.getRtnOdrDtlInfo().getRtnOdrQty());
600
-                pickDtlEntity.setColQty(colQty);
601
-                pickDtlEntity.setColAmt(colQty * entity.getRtnOdrDtlInfo().getUnitAmt());
602
-                colTotalAmt = colTotalAmt + (colQty * entity.getRtnOdrDtlInfo().getUnitAmt());
603
-                pickDtlList.add(pickDtlEntity);
626
+                    PickDtlPtclEntity pickDtlEntity = new PickDtlPtclEntity();
627
+                    pickDtlEntity.setColPickUnqNo(colPickUnqNo);
628
+
629
+                    pickDtlEntity.setColPickDtlNo(Integer.toString(dtlNo));
630
+                    pickDtlEntity.setRtnPodrUnqNo(entity.getRtnPodrUnqNo());
631
+                    pickDtlEntity.setRtnPodrDtlNo(entity.getRtnOdrDtlInfo().getRtnPodrDtlNo());
632
+                    pickDtlEntity.setRtnReqUnqNo(entity.getRtnOdrDtlInfo().getRtnReqUnqNo());
633
+                    pickDtlEntity.setRtnReqDtlNo(entity.getRtnOdrDtlInfo().getRtnReqDtlNo());
634
+                    pickDtlEntity.setColCmdUnqNo(null);
635
+                    pickDtlEntity.setColCmdDtlNo(null);
636
+                    pickDtlEntity.setItemId(entity.getRtnOdrDtlInfo().getItemId());
637
+                    pickDtlEntity.setItemNm(entity.getRtnOdrDtlInfo().getItemNm());
638
+                    pickDtlEntity.setUnit(entity.getRtnOdrDtlInfo().getUnit());
639
+                    pickDtlEntity.setUnitAmt(entity.getRtnOdrDtlInfo().getUnitAmt());
640
+                    pickDtlEntity.setRodrQty(entity.getRtnOdrDtlInfo().getRtnOdrQty());
641
+                    pickDtlEntity.setColReqQty(colQty);
642
+                    pickDtlEntity.setColReqAmt(colQty * entity.getRtnOdrDtlInfo().getUnitAmt());
643
+                    pickDtlList.add(pickDtlEntity);
644
+                }
604 645
 
605 646
             }
606 647
 
@@ -636,51 +677,6 @@ public class ColOdrService extends CommonService {
636 677
     }
637 678
 
638 679
 
639
-    /*
640
-      납품서 현황 그리드 리스트 조회
641
-
642
-    public GridResponse selectDeliGridList(String sBrandId, String dtGubun,  String fromDt, String toDt, String sDlvStCd, String sSpplyId, String sWhsId, String sItemNm, GridRequest gridRequest) throws Exception {
643
-        int gridPage = gridRequest.getGridPage();
644
-        int gridSize = gridRequest.getGridSize();
645
-
646
-        fromDt = fromDt == null ? null : fromDt.replace(".", "");
647
-        toDt = toDt == null ? null : toDt.replace(".", "");
648
-
649
-        int gridRecords = shmtOdrMapper.selectDeliGridCnt(sBrandId, dtGubun, fromDt, toDt, sDlvStCd, sSpplyId, sWhsId, sItemNm);
650
-        int gridTotal = fnCalculateGridTotal(gridSize, gridRecords);
651
-        List<DeliInfoMgntEntity> entities = shmtOdrMapper.selectDeliGridList(sBrandId, dtGubun, fromDt, toDt, sDlvStCd, sSpplyId, sWhsId, sItemNm, gridRequest);
652
-        List<Object> gridRows = entities.stream()
653
-                .map(m -> DeliDtlSearchListResponse.builder()
654
-                        .viewCd("R")
655
-                        .brandId(m.getBrandId() == null ? "" : m.getBrandId())
656
-                        .brandNm(m.getBrandNm() == null ? "" : m.getBrandNm())
657
-                        .dlvSttmtUnqNo(m.getDlvSttmtUnqNo() == null ? "" : m.getDlvSttmtUnqNo())
658
-                        .spplyId(m.getSpplyId() == null ? "" : m.getSpplyId())
659
-                        .spplyNm(m.getSpplyNm() == null ? "" : m.getSpplyNm())
660
-                        .dlvStCd(m.getDlvStCd() == null ? "" : m.getDlvStCd())
661
-                        .dlvStNm(m.getDlvStNm() == null ? "" : m.getDlvStNm())
662
-                        .whsId(m.getWhsId() == null ? "" :m.getWhsId())
663
-                        .location(m.getLocation() == null ? "" : m.getLocation())
664
-                        .whsNm(m.getWhsNm() == null ? "" : m.getWhsNm() + " - " + m.getLocationNm())
665
-                        .podrRegDt(m.getPodrRegDt() == null ? "" : m.getPodrRegDt())
666
-                        .dlvRegDt(m.getDlvRegDt() == null ? "" : m.getDlvRegDt())
667
-                        .dlvReqDt(m.getDlvReqDt() == null ? "" : m.getDlvReqDt())
668
-                        .dlvSchDt(m.getDlvSchDt() == null ? "" : m.getDlvSchDt())
669
-                        .dlvCmpltDt(m.getDlvCmpltDt() == null ? "" : m.getDlvCmpltDt())
670
-                        .itemId(m.getDeliDtlMgntInfo() == null ? "" : m.getDeliDtlMgntInfo().getItemId() == null ? "" : m.getDeliDtlMgntInfo().getItemId())
671
-                        .itemNm(m.getDeliDtlMgntInfo() == null ? "" : m.getDeliDtlMgntInfo().getItemNm() == null ? "" : m.getDeliDtlMgntInfo().getItemNm())
672
-                        .podrQty(m.getDeliDtlMgntInfo() == null ? 0 : m.getDeliDtlMgntInfo().getPodrQty() == null ? 0 : m.getDeliDtlMgntInfo().getPodrQty())
673
-                        .dlvQty(m.getDeliDtlMgntInfo() == null ? 0 : m.getDeliDtlMgntInfo().getDlvQty() == null ? 0 : m.getDeliDtlMgntInfo().getDlvQty())
674
-                        .unit(m.getDeliDtlMgntInfo() == null ? "" : m.getDeliDtlMgntInfo().getUnit() == null ? "" : m.getDeliDtlMgntInfo().getUnit())
675
-                        .unitAmt(m.getDeliDtlMgntInfo() == null ? 0 : m.getDeliDtlMgntInfo().getUnitAmt() == null ? 0 : m.getDeliDtlMgntInfo().getUnitAmt())
676
-                        .dlvMgrNm(m.getDlvMgrNm() == null ? "" : m.getDlvMgrNm())
677
-                        .dlvMgrTelNo(m.getDlvMgrTelNo() == null ? "" : m.getDlvMgrTelNo())
678
-                        .build())
679
-                .collect(Collectors.toList());
680
-        return GridResponse.toDTO(gridPage, gridTotal, gridRecords, gridRows);
681
-    }
682
-*/
683
-
684 680
     /*
685 681
       공급사  - 수거서 현황 그리드 리스트 조회
686 682
  */
@@ -708,11 +704,11 @@ public class ColOdrService extends CommonService {
708 704
                         .colCmpltDt(m.getColCmpltDt() == null ? "" : m.getColCmpltDt())
709 705
                         .itemId(m.getPickDtlInfo() == null ? "" : m.getPickDtlInfo().getItemId() == null ? "" :  m.getPickDtlInfo().getItemId())
710 706
                         .itemNm(m.getPickDtlInfo() == null ? "" : m.getPickDtlInfo().getItemNm() == null ? "" :  m.getPickDtlInfo().getItemNm())
711
-                        .colQty(m.getPickDtlInfo() == null ? 0 : m.getPickDtlInfo().getColQty() == null ? 0 :  m.getPickDtlInfo().getColQty())
707
+                        .colReqQty(m.getPickDtlInfo() == null ? 0 : m.getPickDtlInfo().getColReqQty() == null ? 0 :  m.getPickDtlInfo().getColReqQty())
712 708
                         .rtnRsnDvsn(m.getPickDtlInfo() == null ? "" : m.getPickDtlInfo().getRtnRsnDvsn() == null ? "" :  m.getPickDtlInfo().getRtnRsnDvsn())
713 709
                         .rtnRsnDvsnNm(m.getPickDtlInfo() == null ? "" : m.getPickDtlInfo().getRtnRsnDvsnNm() == null ? "" :  m.getPickDtlInfo().getRtnRsnDvsnNm())
714 710
                         .unitAmt(m.getPickDtlInfo() == null ? 0 : m.getPickDtlInfo().getUnitAmt() == null ? 0 :  m.getPickDtlInfo().getUnitAmt())
715
-                        .colAmt(m.getPickDtlInfo() == null ? 0 : m.getPickDtlInfo().getColAmt() == null ? 0 :  m.getPickDtlInfo().getColAmt())
711
+                        .colReqAmt(m.getPickDtlInfo() == null ? 0 : m.getPickDtlInfo().getColReqAmt() == null ? 0 :  m.getPickDtlInfo().getColReqAmt())
716 712
                         .whsNm(m.getWhsNm() == null ? "" : m.getWhsNm() + " - " + m.getLocationNm())
717 713
                         .pickMgrNm(m.getPickMgrNm() == null ? "" : m.getPickMgrNm())
718 714
                         .pickMgrTelNo(m.getPickMgrTelNo() == null ? "" : m.getPickMgrTelNo())
@@ -721,7 +717,7 @@ public class ColOdrService extends CommonService {
721 717
         return GridResponse.toDTO(gridPage, gridTotal, gridRecords, gridRows);
722 718
     }
723 719
 
724
-    /*
720
+  /*
725 721
       반품처리 그리드 리스트 조회
726 722
  */
727 723
     public GridResponse selectRtnStockTargetList(String sBrandId, String sStoreId,  String fromDt, String toDt, String sRtnWhsId, String sSpplyId, String sWhsId, String sItemNm, GridRequest gridRequest) throws Exception {
@@ -740,17 +736,18 @@ public class ColOdrService extends CommonService {
740 736
                         .brandId(m.getBrandId() == null ? "" : m.getBrandId())
741 737
                         .brandNm(m.getBrandNm() == null ? "" : m.getBrandNm())
742 738
                         .colPickUnqNo(m.getColPickUnqNo() == null ? "" : m.getColPickUnqNo())
743
-                        .colPickDtlNo(m.getPickDtlInfo() == null ? "" : m.getPickDtlInfo().getColPickUnqNo() == null ? "" :m.getPickDtlInfo().getColPickUnqNo() )
739
+                        .colPickDtlNo(m.getPickDtlInfo() == null ? "" : m.getPickDtlInfo().getColPickDtlNo() == null ? "" :m.getPickDtlInfo().getColPickDtlNo() )
744 740
                         .rtnPodrUnqNo(m.getPickDtlInfo() == null ? "" : m.getPickDtlInfo().getRtnPodrUnqNo() == null ? "" :m.getPickDtlInfo().getRtnPodrUnqNo() )
745 741
                         .rtnPodrDtlNo(m.getPickDtlInfo() == null ? "" : m.getPickDtlInfo().getRtnPodrDtlNo() == null ? "" :m.getPickDtlInfo().getRtnPodrDtlNo() )
746 742
                         .itemId(m.getPickDtlInfo() == null ? "" : m.getPickDtlInfo().getItemId() == null ? "" :m.getPickDtlInfo().getItemId() )
747 743
                         .itemNm(m.getPickDtlInfo() == null ? "" : m.getPickDtlInfo().getItemNm() == null ? "" :m.getPickDtlInfo().getItemNm() )
748 744
                         .colQty(m.getPickDtlInfo() == null ? 0 : m.getPickDtlInfo().getColQty() == null ? 0 :m.getPickDtlInfo().getColQty() )
749 745
                         .colReqQty(m.getPickDtlInfo() == null ? 0 : m.getPickDtlInfo().getColReqQty() == null ? 0 :m.getPickDtlInfo().getColReqQty() )
746
+                        .rodrQty(m.getPickDtlInfo() == null ? 0 : m.getPickDtlInfo().getRodrQty() == null ? 0 :m.getPickDtlInfo().getRodrQty() )
750 747
                         .colAmt(m.getPickDtlInfo() == null ? 0 : m.getPickDtlInfo().getColAmt() == null ? 0 :m.getPickDtlInfo().getColAmt() )
751 748
                         .whsId(m.getWhsId() == null ? "" : m.getWhsId())
752 749
                         .location(m.getLocation() == null ? "" : m.getLocation())
753
-                        .whsNm(m.getWhsNm() == null ? "" : m.getWhsNm())
750
+                        .whsNm(m.getWhsNm() == null ? "" : m.getWhsNm() + " - " + m.getLocationNm())
754 751
                         .rtnWhsId(m.getRtnWhsId() == null ? "" : m.getRtnWhsId())
755 752
                         .rtnLocation(m.getRtnLocation() == null ? "" : m.getRtnLocation())
756 753
                         .rtnWhsNm(m.getRtnWhsNm() == null ? "" : m.getRtnWhsNm())
@@ -764,22 +761,26 @@ public class ColOdrService extends CommonService {
764 761
         return GridResponse.toDTO(gridPage, gridTotal, gridRecords, gridRows);
765 762
     }
766 763
 
764
+
765
+
766
+
767
+
767 768
     /* 입고처리 저장
768 769
     @Transactional
769 770
     public void saveRtnStockProc(String userId, SaveRtnStockProcRequest saveRtnStockProcRequest) throws Exception {
770 771
         try {
771 772
 
772 773
             List<RtnProcInfoPtclEntity> gridInsertData = saveRtnStockProcRequest.toCodeEntities(saveRtnStockProcRequest.getGridInsertData());
773
-            List<RtnProcInfoPtclEntity> serarchList = new ArrayList<RtnProcInfoPtclEntity>();
774
+            List<RtnProcInfoPtclEntity> searchList = new ArrayList<RtnProcInfoPtclEntity>();
774 775
             if (gridInsertData.size() > 0) {
775 776
                 for (int i = 0 ; i < gridInsertData.size() ; i++) {
776
-                    RtnProcInfoPtclEntity whsProcData = gridInsertData.get(i);
777
-                    DeliDtlMgntEntity deliData = new DeliDtlMgntEntity();
778
-                    deliData.setDlvSttmtDtlNo(whsProcData.getDlvSttmtUnqNo() + whsProcData.getDlvSttmtDtlNo());
779
-                    serarchList.add(deliData);
780
-                }
777
+                    RtnProcInfoPtclEntity targetData = gridInsertData.get(i);
778
+                    RtnProcInfoPtclEntity procData = new RtnProcInfoPtclEntity();
779
+                    procData.setColPickUnqNo (targetData.getColPickUnqNo() + targetData.getColPickDtlNo());
780
+                    searchList.add(procData);
781
+                }  ==> 여기까지
781 782
 
782
-                List<DeliInfoMgntEntity> targetList  =   shmtOdrMapper.selectWarehouseProcList(saveWarehouseProcRequest.getBrandId(), saveWarehouseProcRequest.getWhsId(), serarchList);
783
+                List<PickInfoMgntEntity> targetList  =   shmtOdrMapper.selectWarehouseProcList(saveWarehouseProcRequest.getBrandId(), saveWarehouseProcRequest.getWhsId(), serarchList);
783 784
 
784 785
                 List<WhsProcInfoPtclEntity> gridUpdateData = new ArrayList<WhsProcInfoPtclEntity>();
785 786
                 List<StckMgntBaseInfoEntity> wareGridUpdateData = new ArrayList<StckMgntBaseInfoEntity>();
@@ -963,7 +964,52 @@ public class ColOdrService extends CommonService {
963 964
         }
964 965
     }
965 966
 */
967
+    /*
968
+      반품처리현황 그리드 리스트 조회
969
+ */
970
+    public GridResponse selectRtnStockResultList(String sBrandId, String sStoreId,  String fromDt, String toDt, String sRtnWhsId, String sSpplyId, String sWhsId, String sItemNm, GridRequest gridRequest) throws Exception {
971
+        int gridPage = gridRequest.getGridPage();
972
+        int gridSize = gridRequest.getGridSize();
973
+
974
+        fromDt = fromDt == null ? null : fromDt.replace(".", "");
975
+        toDt = toDt == null ? null : toDt.replace(".", "");
966 976
 
977
+        int gridRecords = colOdrMapper.selectColRtnInstResultGridCnt(sBrandId, sStoreId, fromDt, toDt, sSpplyId, sRtnWhsId,  sWhsId,  sItemNm);
978
+        int gridTotal = fnCalculateGridTotal(gridSize, gridRecords);
979
+        List<PickInfoMgntEntity> entities = colOdrMapper.selectColRtnInstResultGridList(sBrandId, sStoreId, fromDt, toDt, sSpplyId, sRtnWhsId, sWhsId, sItemNm, gridRequest);
980
+        List<Object> gridRows = entities.stream()
981
+                .map(m -> RtnColStockResultResponse.builder()
982
+                        .viewCd("R")
983
+                        .brandId(m.getBrandId() == null ? "" : m.getBrandId())
984
+                        .brandNm(m.getBrandNm() == null ? "" : m.getBrandNm())
985
+                        .colPickUnqNo(m.getColPickUnqNo() == null ? "" : m.getColPickUnqNo())
986
+                        .colPickDtlNo(m.getPickDtlInfo() == null ? "" : m.getPickDtlInfo().getColPickDtlNo() == null ? "" :m.getPickDtlInfo().getColPickDtlNo() )
987
+                        .rtnPodrUnqNo(m.getPickDtlInfo() == null ? "" : m.getPickDtlInfo().getRtnPodrUnqNo() == null ? "" :m.getPickDtlInfo().getRtnPodrUnqNo() )
988
+                        .rtnPodrDtlNo(m.getPickDtlInfo() == null ? "" : m.getPickDtlInfo().getRtnPodrDtlNo() == null ? "" :m.getPickDtlInfo().getRtnPodrDtlNo() )
989
+                        .itemId(m.getPickDtlInfo() == null ? "" : m.getPickDtlInfo().getItemId() == null ? "" :m.getPickDtlInfo().getItemId() )
990
+                        .itemNm(m.getPickDtlInfo() == null ? "" : m.getPickDtlInfo().getItemNm() == null ? "" :m.getPickDtlInfo().getItemNm() )
991
+                        .colQty(m.getPickDtlInfo() == null ? 0 : m.getPickDtlInfo().getColQty() == null ? 0 :m.getPickDtlInfo().getColQty() )
992
+                        .colReqQty(m.getPickDtlInfo() == null ? 0 : m.getPickDtlInfo().getColReqQty() == null ? 0 :m.getPickDtlInfo().getColReqQty() )
993
+                        .rodrQty(m.getPickDtlInfo() == null ? 0 : m.getPickDtlInfo().getRodrQty() == null ? 0 :m.getPickDtlInfo().getRodrQty() )
994
+                        .colAmt(m.getPickDtlInfo() == null ? 0 : m.getPickDtlInfo().getColAmt() == null ? 0 :m.getPickDtlInfo().getColAmt() )
995
+                        .whsId(m.getWhsId() == null ? "" : m.getWhsId())
996
+                        .location(m.getLocation() == null ? "" : m.getLocation())
997
+                        .whsNm(m.getWhsNm() == null ? "" : m.getWhsNm() + " - " + m.getLocationNm())
998
+                        .rtnWhsId(m.getRtnWhsId() == null ? "" : m.getRtnWhsId())
999
+                        .rtnLocation(m.getRtnLocation() == null ? "" : m.getRtnLocation())
1000
+                        .rtnWhsNm(m.getRtnWhsNm() == null ? "" : m.getRtnWhsNm())
1001
+                        .colSchDt(m.getColSchDt() == null ? "" : m.getColSchDt())
1002
+                        .colCmpltDt(m.getColCmpltDt() == null ? "" : m.getColCmpltDt())
1003
+                        .pickDtlStCd(m.getPickDtlInfo() == null ? "" : m.getPickDtlInfo().getPickDtlStCd() == null ? "" : m.getPickDtlInfo().getPickDtlStCd())
1004
+                        .pickDtlStNm(m.getPickDtlInfo() == null ? "" : m.getPickDtlInfo().getPickDtlStNm() == null ? "" : m.getPickDtlInfo().getPickDtlStNm())
1005
+                        .pickMgrNm(m.getPickMgrNm() == null ? "" : m.getPickMgrNm())
1006
+                        .pickMgrTelNo(m.getPickMgrTelNo() == null ? "" : m.getPickMgrTelNo())
1007
+                        .spplyId(m.getSpplyId() == null ? "" : m.getSpplyId())
1008
+                        .spplyNm(m.getSpplyNm() == null ? "" : m.getSpplyNm())
1009
+                        .build())
1010
+                .collect(Collectors.toList());
1011
+        return GridResponse.toDTO(gridPage, gridTotal, gridRecords, gridRows);
1012
+    }
967 1013
     /*
968 1014
       입고 현황 그리드 리스트 조회  @Param("sBrandId") String sBrandId, @Param("sStoreId") String sStoreId,
969 1015
       @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sPchPodrUnqNo") String sPchPodrUnqNo, @Param("sSpplyId") String sSpplyId, @Param("sWhsId") String sWhsId, @Param("sItemNm") String sItemNm

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

@@ -42,14 +42,32 @@ public class ColOdrController {
42 42
     @ApiImplicitParams({
43 43
             @ApiImplicitParam(name = "X-AUTH-TOKEN", value = "CONN-KEY", required = true, dataType = "String", paramType = "header")
44 44
     })
45
-    @ApiOperation(value = " 수거지시 대상리스트트 그리 리스트")
45
+    @ApiOperation(value = " 수거지시 대상 그리 리스트")
46 46
     @PostMapping("/col-target-grid-list")
47 47
     public ResponseEntity<GridResponse> selectColTargetOdrGridList(@RequestBody @Valid ColOdrTargetRtnGridRequest colOdrTargetRtnGridRequest) throws Exception {
48
-        return ResponseEntity.ok(colOdrService.selectShmtTargetOdrGridList(colOdrTargetRtnGridRequest.getSBrandId(), colOdrTargetRtnGridRequest.getFromDt(), colOdrTargetRtnGridRequest.getToDt(), colOdrTargetRtnGridRequest.getSWhsId(), colOdrTargetRtnGridRequest.getSRtnWhsId(), colOdrTargetRtnGridRequest.getSItemNm(),  colOdrTargetRtnGridRequest.toDTO(colOdrTargetRtnGridRequest)));
48
+        return ResponseEntity.ok(colOdrService.selectColTargetOdrGridList(colOdrTargetRtnGridRequest.getSBrandId(), colOdrTargetRtnGridRequest.getFromDt(), colOdrTargetRtnGridRequest.getToDt(), colOdrTargetRtnGridRequest.getSWhsId(), colOdrTargetRtnGridRequest.getSRtnWhsId(), colOdrTargetRtnGridRequest.getSItemNm(),  colOdrTargetRtnGridRequest.toDTO(colOdrTargetRtnGridRequest)));
49 49
     }
50 50
 
51
+
51 52
     /**
52
-     * 설명 : 출하지시 정보 저장
53
+     * 설명 : 수거지시 초기 대상 정보 리스트
54
+     *
55
+     * @param colOdrTargetRtnGridRequest
56
+     * @return
57
+     * @throws Exception
58
+     */
59
+
60
+    @ApiImplicitParams({
61
+            @ApiImplicitParam(name = "X-AUTH-TOKEN", value = "CONN-KEY", required = true, dataType = "String", paramType = "header")
62
+    })
63
+    @ApiOperation(value = " 수거지시 초기정보 리스트\n")
64
+    @PostMapping("/col-inst-inti-grid-list")
65
+    public ResponseEntity<GridResponse> selectColInstOdrGridList(@RequestBody @Valid InstInitColOdrRequest instInitColOdrRequest) throws Exception {
66
+        return ResponseEntity.ok(colOdrService.selectColInstOdrGridList(instInitColOdrRequest.getBrandId(), instInitColOdrRequest, instInitColOdrRequest.toDTO(instInitColOdrRequest)));
67
+    }
68
+
69
+    /**
70
+     * 설명 : 수거지시 정보 저장
53 71
      *
54 72
      * @param userId
55 73
      * @param instShmtOdrRequest
@@ -64,11 +82,11 @@ public class ColOdrController {
64 82
     @PostMapping("/save-inst-col")
65 83
     public ResponseEntity<SaveResponse> instShmtOdr(@ApiIgnore String userId, @RequestBody @Valid InstColOdrRequest instColOdrRequest) throws Exception {
66 84
         colOdrService.instColOdr(userId,  instColOdrRequest);
67
-        return ResponseEntity.ok(SaveResponse.toDTO(SystemMessageCode.SAVE_OK));
85
+        return ResponseEntity.ok(SaveResponse.toDTO(SystemMessageCode.COL_OK));
68 86
     }
69 87
 
70 88
     /**
71
-     * 설명 : 출하현황 그리 리스트
89
+     * 설명 : 수거현황 그리 리스트
72 90
      *
73 91
      * @param ShmtOutSearchGridRequest
74 92
      * @return
@@ -120,7 +138,7 @@ public class ColOdrController {
120 138
 
121 139
 
122 140
     /**
123
-     * 설명 : 공급사 발주데이타 납품서 생성 초기데이타
141
+     * 설명 : 공급사 발주데이타 수거서 생성 초기데이타
124 142
      *
125 143
      * @param brandId, spplyId, rtnPodrUnqNo
126 144
      * @return
@@ -139,7 +157,7 @@ public class ColOdrController {
139 157
     }
140 158
 
141 159
     /**
142
-     * 설명 : 공급사 납품서 생성 저장
160
+     * 설명 : 공급사 수거서 생성 저장
143 161
      *
144 162
      * @param userId
145 163
      * @param instShmtOdrRequest
@@ -158,23 +176,6 @@ public class ColOdrController {
158 176
     }
159 177
 
160 178
 
161
-    /**
162
-     * 설명 : 납품서 현황 그리드 리스트
163
-     *
164
-     * @param DeliDtlGridRequest
165
-     * @return
166
-     * @throws Exception
167
-
168
-
169
-    @ApiImplicitParams({
170
-            @ApiImplicitParam(name = "X-AUTH-TOKEN", value = "CONN-KEY", required = true, dataType = "String", paramType = "header")
171
-    })
172
-    @ApiOperation(value = " 납품서 현황 그리드 리스트")
173
-    @PostMapping("/deli-grid-list")
174
-    public ResponseEntity<GridResponse> selectDeliGridList(@RequestBody @Valid DeliDtlGridRequest deliDtlGridRequest) throws Exception {
175
-        return ResponseEntity.ok(shmtOdrService.selectDeliGridList(deliDtlGridRequest.getSBrandId(), deliDtlGridRequest.getDtlGubun(), deliDtlGridRequest.getFromDt(), deliDtlGridRequest.getToDt(), deliDtlGridRequest.getSDlvStCd(),  deliDtlGridRequest.getSSpplyId(), deliDtlGridRequest.getSWhsId(), deliDtlGridRequest.getSItemNm(),  deliDtlGridRequest.toDTO(deliDtlGridRequest)));
176
-    }
177
-     */
178 179
     /**
179 180
      * 설명 : 공급사 수거서 현황 그리드 리스트
180 181
      *
@@ -186,7 +187,7 @@ public class ColOdrController {
186 187
     @ApiImplicitParams({
187 188
             @ApiImplicitParam(name = "X-AUTH-TOKEN", value = "CONN-KEY", required = true, dataType = "String", paramType = "header")
188 189
     })
189
-    @ApiOperation(value = " 공급사 - 납품서 현황 그리드 리스트")
190
+    @ApiOperation(value = " 공급사 - 수거서 현황 그리드 리스트")
190 191
     @PostMapping("/spply-pick-grid-list")
191 192
     public ResponseEntity<GridResponse> selectSpplyDeliGridList(@RequestBody @Valid SpplyPickDtlGridRequest spplyPickDtlGridRequest) throws Exception {
192 193
         return ResponseEntity.ok(colOdrService.selectSpplyPickGridList(spplyPickDtlGridRequest.getSBrandId(), spplyPickDtlGridRequest.getFromDt(), spplyPickDtlGridRequest.getToDt(),  spplyPickDtlGridRequest.getSSpplyId(), spplyPickDtlGridRequest.getSWhsId(), spplyPickDtlGridRequest.getSItemNm(),  spplyPickDtlGridRequest.toDTO(spplyPickDtlGridRequest)));
@@ -204,7 +205,7 @@ public class ColOdrController {
204 205
             @ApiImplicitParam(name = "X-AUTH-TOKEN", value = "CONN-KEY", required = true, dataType = "String", paramType = "header")
205 206
     })
206 207
     @ApiOperation(value = " 반품처리 대상 그리드 리스트")
207
-    @PostMapping("/warehouse-target-grid-list")
208
+    @PostMapping("/retstock-target-grid-list")
208 209
     public ResponseEntity<GridResponse> selectRtnStockTargetList(@RequestBody @Valid RtnStockTragetGridRequest rtnStockTragetGridRequest) throws Exception {
209 210
         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 211
     }
@@ -230,6 +231,23 @@ public class ColOdrController {
230 231
     }
231 232
      */
232 233
 
234
+    /**
235
+     * 설명 : 반품처리 현황 리스트
236
+     *
237
+     * @param RtnStockTragetGridRequest
238
+     * @return
239
+     * @throws Exception
240
+
241
+     */
242
+    @ApiImplicitParams({
243
+            @ApiImplicitParam(name = "X-AUTH-TOKEN", value = "CONN-KEY", required = true, dataType = "String", paramType = "header")
244
+    })
245
+    @ApiOperation(value = " 반품처리 현황 그리드 리스트")
246
+    @PostMapping("/retstock-result-grid-list")
247
+    public ResponseEntity<GridResponse> selectRtnStockResultList(@RequestBody @Valid RtnStockTragetGridRequest rtnStockTragetGridRequest) throws Exception {
248
+        return ResponseEntity.ok(colOdrService.selectRtnStockResultList(rtnStockTragetGridRequest.getSBrandId(),rtnStockTragetGridRequest.getSStoreId(), rtnStockTragetGridRequest.getFromDt(), rtnStockTragetGridRequest.getToDt(), rtnStockTragetGridRequest.getSRtnWhsId(), rtnStockTragetGridRequest.getSSpplyId(), rtnStockTragetGridRequest.getSWhsId(), rtnStockTragetGridRequest.getSItemNm(),  rtnStockTragetGridRequest.toDTO(rtnStockTragetGridRequest)));
249
+    }
250
+
233 251
     /**
234 252
      * 설명 : 입고 현황 그리드 리스트
235 253
      *

+ 56 - 0
src/main/java/com/oqpo/api/web/dto/request/inoutmng/InstInitColOdrRequest.java

@@ -0,0 +1,56 @@
1
+package com.oqpo.api.web.dto.request.inoutmng;
2
+
3
+import com.oqpo.api.entity.rtnmng.RtnOdrDtlPtclEntity;
4
+import com.oqpo.api.web.dto.request.GridRequest;
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 InstInitColOdrRequest  extends GridRequest {
15
+    @NotBlank
16
+    @ApiModelProperty(value = "CRUD")
17
+    private String viewCd;
18
+
19
+    @NotBlank
20
+    @ApiModelProperty(value = "브랜드아이디") private String brandId;
21
+
22
+    @ApiModelProperty(value = "수거지시대상 리스트")
23
+    private List<InstInitColItemDataList> gridUpdateData;
24
+
25
+
26
+    public List<RtnOdrDtlPtclEntity> toCodeEntities(List<InstInitColItemDataList> gridData) {
27
+        List<RtnOdrDtlPtclEntity> entities = new ArrayList<>();
28
+        if (gridData == null || gridData.size() == 0)
29
+            return entities;
30
+
31
+        gridData.forEach(x -> {
32
+            RtnOdrDtlPtclEntity entity = new RtnOdrDtlPtclEntity();
33
+            entity.setRtnPodrUnqNo(x.getRtnPodrUnqNo());
34
+            entity.setRtnPodrDtlNo(x.getRtnPodrDtlNo());
35
+            entities.add(entity);
36
+        });
37
+        return entities;
38
+    }
39
+
40
+    @Getter
41
+    @Builder
42
+    @AllArgsConstructor(access = AccessLevel.PROTECTED)
43
+    static class InstInitColItemDataList {
44
+
45
+        @NotBlank
46
+        @ApiModelProperty(value = "반품발주고유번호") private String rtnPodrUnqNo;
47
+
48
+        @NotBlank
49
+        @ApiModelProperty(value = "반품발주항번") private String rtnPodrDtlNo;
50
+
51
+    }
52
+
53
+    protected InstInitColOdrRequest(Integer gridSize, Integer gridPage, String sidx, String sord, Boolean pagingYn, Integer gridFirst) {
54
+        super(gridSize, gridPage, sidx, sord, pagingYn, gridFirst);
55
+    }
56
+}

+ 2 - 2
src/main/java/com/oqpo/api/web/dto/response/inoutmng/ColInfoResponse.java

@@ -74,7 +74,7 @@ public class ColInfoResponse {
74 74
                                 .itemId(m.getItemId() == null ? "" : m.getItemId())
75 75
                                 .itemNm(m.getItemNm() == null ? "" : m.getItemNm())
76 76
                                 .rodrQty(m.getRodrQty() == null ? 0 : m.getRodrQty())
77
-                                .colQty(m.getColQty() == null ? 0 : m.getColQty())
77
+                                .colReqQty(m.getColReqQty() == null ? 0 : m.getColReqQty())
78 78
                                 .rtnRsnDvsnNm(m.getRtnRsnDvsnNm() == null ? "" : m.getRtnRsnDvsnNm())
79 79
                                 .rtnRsn(m.getRtnRsn() == null ? "" : m.getRtnRsn())
80 80
                                 .build())
@@ -90,7 +90,7 @@ public class ColInfoResponse {
90 90
         @ApiModelProperty(value = "품목아이디") private String itemId;
91 91
         @ApiModelProperty(value = "품목명") private String itemNm;
92 92
         @ApiModelProperty(value = "반품수량") private Integer rodrQty;
93
-        @ApiModelProperty(value = "수거수량") private Integer colQty;
93
+        @ApiModelProperty(value = "수거수량") private Integer colReqQty;
94 94
         @ApiModelProperty(value = "반품사유구분") private String rtnRsnDvsnNm;
95 95
         @ApiModelProperty(value = "반품사유") private String rtnRsn;
96 96
     }

+ 47 - 0
src/main/java/com/oqpo/api/web/dto/response/inoutmng/ColInstInitOdrSearchListResponse.java

@@ -0,0 +1,47 @@
1
+package com.oqpo.api.web.dto.response.inoutmng;
2
+
3
+import com.fasterxml.jackson.annotation.JsonInclude;
4
+import com.oqpo.api.entity.oper.UserMngEntity;
5
+import com.oqpo.api.entity.rtnmng.RtnOdrBaseInfoEntity;
6
+import com.oqpo.api.entity.rtnmng.RtnOdrDtlPtclEntity;
7
+import com.oqpo.api.web.dto.response.rtnmng.rtnOrd.RtnOrdInitInfoResponse;
8
+import io.swagger.annotations.ApiModelProperty;
9
+import lombok.*;
10
+
11
+import java.util.List;
12
+import java.util.stream.Collectors;
13
+
14
+@Getter
15
+@Setter
16
+@Builder
17
+@AllArgsConstructor(access = AccessLevel.PROTECTED)
18
+@JsonInclude(JsonInclude.Include.ALWAYS)
19
+public class ColInstInitOdrSearchListResponse {
20
+
21
+    @ApiModelProperty(value = "CRUD")
22
+    private String viewCd;
23
+
24
+    @ApiModelProperty(value = "브랜드아이디") private String brandId;
25
+    @ApiModelProperty(value = "브랜드명") private String brandNm;
26
+    @ApiModelProperty(value = "반품발주번호") private String rtnPodrUnqNo;
27
+    @ApiModelProperty(value = "반품발주항번") private String rtnPodrDtlNo;
28
+    @ApiModelProperty(value = "반품요청번호") private String rtnReqUnqNo;
29
+    @ApiModelProperty(value = "반품요청항번") private String rtnReqDtlNo;
30
+    @ApiModelProperty(value = "품목아이디") private String itemId;
31
+    @ApiModelProperty(value = "품목명") private String itemNm;
32
+    @ApiModelProperty(value = "수거창고아이디") private String rtnWhsId;
33
+    @ApiModelProperty(value = "수거LOCATION") private String rtnLocation;
34
+    @ApiModelProperty(value = "수거창고명") private String rntWhsNm;
35
+    @ApiModelProperty(value = "입고창고아이디") private String whsId;
36
+    @ApiModelProperty(value = "입고LOCATION") private String location;
37
+    @ApiModelProperty(value = "입고창고명") private String whsNm;
38
+    @ApiModelProperty(value = "단가") private Long unitAmt;
39
+    @ApiModelProperty(value = "수거수량") private Integer colQty;
40
+    @ApiModelProperty(value = "반품발주수량") private Integer rtnOdrQty;
41
+    @ApiModelProperty(value = "발주금액") private Long rtnAmt;
42
+    @ApiModelProperty(value = "수거요청일") private String colReqDt;
43
+    @ApiModelProperty(value = "매장아이디") private String storeId;
44
+
45
+
46
+
47
+}

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

@@ -29,8 +29,8 @@ public class ColTragetOdrSearchListResponse {
29 29
     @ApiModelProperty(value = "입고LOCATION") private String location;
30 30
     @ApiModelProperty(value = "입고창고명") private String whsNm;
31 31
     @ApiModelProperty(value = "단가") private Long unitAmt;
32
-    @ApiModelProperty(value = "반품발주수량") private Integer rtnReqQty;
33
-    @ApiModelProperty(value = "수거수량") private Integer rtnQty;
32
+    @ApiModelProperty(value = "반품요청수량") private Integer rtnReqQty;
33
+    @ApiModelProperty(value = "반품발주수량") private Integer rtnOdrQty;
34 34
     @ApiModelProperty(value = "발주금액") private Long rtnAmt;
35 35
     @ApiModelProperty(value = "수거요청일") private String colReqDt;
36 36
     @ApiModelProperty(value = "매장아이디") private String storeId;

+ 2 - 2
src/main/java/com/oqpo/api/web/dto/response/inoutmng/PickDtlSearchListResponse.java

@@ -25,11 +25,11 @@ public class PickDtlSearchListResponse {
25 25
     @ApiModelProperty(value = "수거완료일") private String colCmpltDt;
26 26
     @ApiModelProperty(value = "품목아이디") private String itemId;
27 27
     @ApiModelProperty(value = "품목명") private String itemNm;
28
-    @ApiModelProperty(value = "수거수량") private Integer colQty;
28
+    @ApiModelProperty(value = "수거수량") private Integer colReqQty;
29 29
     @ApiModelProperty(value = "수거구분") private String rtnRsnDvsn;
30 30
     @ApiModelProperty(value = "수거구분명") private String rtnRsnDvsnNm;
31 31
     @ApiModelProperty(value = "수거단가") private Long unitAmt;
32
-    @ApiModelProperty(value = "수거금액") private Long colAmt;
32
+    @ApiModelProperty(value = "수거금액") private Long colReqAmt;
33 33
     @ApiModelProperty(value = "수거창고") private String whsNm;
34 34
     @ApiModelProperty(value = "납품담당자명") private String pickMgrNm;
35 35
     @ApiModelProperty(value = "납품담당자연락처") private String pickMgrTelNo;

+ 44 - 0
src/main/java/com/oqpo/api/web/dto/response/inoutmng/RtnColStockResultResponse.java

@@ -0,0 +1,44 @@
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 RtnColStockResultResponse {
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 Integer rodrQty;
28
+    @ApiModelProperty(value = "수거금액") private Long colAmt;
29
+    @ApiModelProperty(value = "반품입고창고") private String whsId;
30
+    @ApiModelProperty(value = "반품입고창고location") private String location;
31
+    @ApiModelProperty(value = "반품입고창고명") private String whsNm;
32
+    @ApiModelProperty(value = "수거창고") private String rtnWhsId;
33
+    @ApiModelProperty(value = "수거LOCATION") private String rtnLocation;
34
+    @ApiModelProperty(value = "수거창고명") private String rtnWhsNm;
35
+    @ApiModelProperty(value = "수거예정일") private String colSchDt;
36
+    @ApiModelProperty(value = "수거완료일") private String colCmpltDt;
37
+    @ApiModelProperty(value = "수거담당자명") private String pickMgrNm;
38
+    @ApiModelProperty(value = "수거담당자연락처") private String pickMgrTelNo;
39
+    @ApiModelProperty(value = "수거상태") private String pickDtlStCd;
40
+    @ApiModelProperty(value = "수거상태명") private String pickDtlStNm;
41
+    @ApiModelProperty(value = "공급사아이디") private String spplyId;
42
+    @ApiModelProperty(value = "공급사명") private String spplyNm;
43
+
44
+}

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

@@ -24,6 +24,7 @@ public class RtnStockTargetResponse {
24 24
     @ApiModelProperty(value = "품목명") private String itemNm;
25 25
     @ApiModelProperty(value = "수거수량") private Integer colQty;
26 26
     @ApiModelProperty(value = "수거요청수량") private Integer colReqQty;
27
+    @ApiModelProperty(value = "반품발주수량") private Integer rodrQty;
27 28
     @ApiModelProperty(value = "수거금액") private Long colAmt;
28 29
     @ApiModelProperty(value = "반품입고창고") private String whsId;
29 30
     @ApiModelProperty(value = "반품입고창고location") private String location;

+ 2 - 2
src/main/java/com/oqpo/api/web/dto/response/inoutmng/SpplyPickInitResponse.java

@@ -53,7 +53,7 @@ public class SpplyPickInitResponse {
53 53
                                 .itemNm(m.getItemNm() == null ? "" :m.getItemNm())
54 54
                                 .unit(m.getUnit() == null ? "" : m.getUnit())
55 55
                                 .unitAmt(m.getUnitAmt() == null ? 0 : m.getUnitAmt())
56
-                                .rtnQty(m.getRtnQty() == null ? 0 :m.getRtnQty())
56
+                                .rtnOdrQty(m.getRtnOdrQty() == null ? 0 :m.getRtnOdrQty())
57 57
                                 .coltQty(m.getColQty() == null ? 0 : m.getColQty())
58 58
                                 .rtnRsnDvsn(m.getRtnRsnDvsn() == null ? "" : m.getRtnRsnDvsn())
59 59
                                 .rtnRsn(m.getRtnRsn() == null ? "" : m.getRtnRsn())
@@ -72,7 +72,7 @@ public class SpplyPickInitResponse {
72 72
         @ApiModelProperty(value = "품목명") private String itemNm;
73 73
         @ApiModelProperty(value = "단위") private String unit;
74 74
         @ApiModelProperty(value = "단가") private Long unitAmt;
75
-        @ApiModelProperty(value = "반품수량") private Integer rtnQty;
75
+        @ApiModelProperty(value = "반품발주수량") private Integer rtnOdrQty;
76 76
         @ApiModelProperty(value = "수거수량") private Integer coltQty;
77 77
         @ApiModelProperty(value = "반품사유") private String rtnRsnDvsn;
78 78
         @ApiModelProperty(value = "비고") private String rtnRsn;

+ 2 - 2
src/main/java/com/oqpo/api/web/dto/response/inoutmng/SpplyTargerRtnSearchListResponse.java

@@ -24,8 +24,8 @@ public class SpplyTargerRtnSearchListResponse {
24 24
     @ApiModelProperty(value = "수거창고명") private String rtnWhsNm;
25 25
     @ApiModelProperty(value = "수거LOCATION") private String rtnLocation;
26 26
     @ApiModelProperty(value = "단가") private Long unitAmt;
27
-    @ApiModelProperty(value = "반품수량") private Integer rtnQty;
28
-    @ApiModelProperty(value = "반품금액") private Long rtnAmt;
27
+    @ApiModelProperty(value = "반품수량") private Integer rtnOdrQty;
28
+    @ApiModelProperty(value = "반품금액") private Long rtnOdrAmt;
29 29
     @ApiModelProperty(value = "수거요청일") private String colReqDt;
30 30
 
31 31
 }

+ 168 - 95
src/main/resources/mybatis/sqlmaps/inoutmng/ColOdr.xml

@@ -17,8 +17,10 @@
17 17
             , base.rtn_podr_unq_no, ptcl.rtn_podr_dtl_no as 'rtnOdrDtlInfo.rtn_podr_dtl_no'
18 18
             , ptcl.rtn_req_unq_no as 'rtnOdrDtlInfo.rtn_req_unq_no', ptcl.rtn_req_dtl_no as 'rtnOdrDtlInfo.rtn_req_dtl_no'
19 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'
20
+            , base.rtn_whs_id, base.rtn_location,  fn_whs_nm(base.brand_id, base.rtn_whs_id) as rtn_whs_nm
21
+            , fn_whs_location_nm(base.brand_id, base.rtn_whs_id, base.rtn_location) as rtn_location_nm
22
+            , ptcl.unit_amt as 'rtnOdrDtlInfo.unit_amt'
23
+            , ptcl.rtn_req_qty as 'rtnOdrDtlInfo.rtn_req_qty',  ptcl.rtn_odr_qty as 'rtnOdrDtlInfo.rtn_odr_qty'
22 24
             , date_format(base.col_req_dt,'%Y.%m.%d') as  col_req_dt, ptcl.rtn_amt as 'rtnOdrDtlInfo.rtn_amt'
23 25
             , base.whs_id,  fn_whs_nm(base.brand_id, base.whs_id) as whs_nm
24 26
             , base.location, fn_whs_location_nm(base.brand_id, base.whs_id, base.location) as location_nm
@@ -84,6 +86,31 @@
84 86
 
85 87
     </select>
86 88
 
89
+    <select id="selectColInstRtnGridList" resultType="com.oqpo.api.entity.rtnmng.RtnOdrBaseInfoEntity">
90
+        select base.brand_id, fn_brand_nm(base.brand_id) as brand_nm
91
+            , base.rtn_podr_unq_no, ptcl.rtn_podr_dtl_no as 'rtnOdrDtlInfo.rtn_podr_dtl_no'
92
+            , ptcl.rtn_req_unq_no as 'rtnOdrDtlInfo.rtn_req_unq_no', ptcl.rtn_req_dtl_no as 'rtnOdrDtlInfo.rtn_req_dtl_no'
93
+            , ptcl.item_id as 'rtnOdrDtlInfo.item_id', ptcl.item_nm as 'rtnOdrDtlInfo.item_nm'
94
+            , base.rtn_whs_id, base.rtn_location,  fn_whs_nm(base.brand_id, base.rtn_whs_id) as rtn_whs_nm
95
+            , fn_whs_location_nm(base.brand_id, base.rtn_whs_id, base.rtn_location) as rtn_location_nm
96
+            , ptcl.unit_amt as 'rtnOdrDtlInfo.unit_amt'
97
+            , ptcl.rtn_odr_qty as 'rtnOdrDtlInfo.col_qty',  ptcl.rtn_odr_qty as 'rtnOdrDtlInfo.rtn_odr_qty'
98
+            , date_format(base.col_req_dt,'%Y.%m.%d') as  col_req_dt, ptcl.rtn_amt as 'rtnOdrDtlInfo.rtn_amt'
99
+            , base.whs_id,  fn_whs_nm(base.brand_id, base.whs_id) as whs_nm
100
+            , base.location, fn_whs_location_nm(base.brand_id, base.whs_id, base.location) as location_nm
101
+            , base.store_id
102
+        from rtn_odr_base_info base
103
+            , rtn_odr_dtl_ptcl ptcl
104
+        where 1=1
105
+        and    base.rtn_podr_unq_no = ptcl.rtn_podr_unq_no
106
+        and    base.brand_id = #{brandId}
107
+        and concat(base.rtn_podr_unq_no, ptcl.rtn_podr_dtl_no) in
108
+        <foreach collection="gridUpdateData" item="item" separator="," open="(" close=")">
109
+            concat(#{item.rtnPodrUnqNo},#{item.rtnPodrDtlNo})
110
+        </foreach>
111
+    </select>
112
+
113
+
87 114
     <select id="selectPickJobDataList" resultType="com.oqpo.api.entity.rtnmng.RtnOdrBaseInfoEntity">
88 115
         select  base.brand_id,base.rtn_podr_unq_no, ptcl.rtn_podr_dtl_no as 'rtnOdrDtlInfo.rtn_podr_dtl_no'
89 116
             ,ptcl.item_id as 'rtnOdrDtlInfo.item_id' , ptcl.item_nm as 'rtnOdrDtlInfo.item_nm', base.whs_id
@@ -95,9 +122,9 @@
95 122
             , date_format(base.rtn_odr_reg_dt,'%Y%m%d') as rtn_odr_req_dt
96 123
             , base.spply_id, fn_spply_nm(base.spply_id) as spply_nm
97 124
             , ptcl.rtn_rsn_dvsn as  'rtnOdrDtlInfo.rtn_rsn_dvsn', ptcl.rtn_rsn as 'rtnOdrDtlInfo.rtn_rsn'
98
-            , base.col_dvsn
125
+            , base.col_dvsn, ptcl.unit as 'rtnOdrDtlInfo.unit'
99 126
         from   rtn_odr_base_info base
100
-        join rtn_odr_dtl_ptcl ptcl on base.rtn_podr_unq_no = ptcl.rtn_podr_unq_no and ptcl.rodr_dtl_st_cd = 'ROD0'
127
+        join rtn_odr_dtl_ptcl ptcl on base.rtn_podr_unq_no = ptcl.rtn_podr_unq_no and ptcl.rodr_dtl_st_cd = 'ROD1'
101 128
         join item_base_info itm on ptcl.item_id = itm.item_id
102 129
         and    base.brand_id = #{brandId}
103 130
         and    concat(base.rtn_podr_unq_no,ptcl.rtn_podr_dtl_no) in
@@ -117,7 +144,7 @@
117 144
             , sys_reg_dttm, sys_reg_id, sys_chg_dttm, sys_chg_id)
118 145
         values
119 146
             (#{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}
147
+            , #{entity.storeId}, #{entity.itemQty}, #{entity.colTotalAmt}, #{entity.colReqDt}, #{entity.colDvsn}
121 148
             , #{entity.colCmdStCd}, #{entity.colReqMgrNm}, #{entity.colReqMgrId}, #{entity.colDt}, #{entity.colCnfmNm}
122 149
             , #{entity.colCnfmId}, #{entity.colMgrNm}, #{entity.colMgrTelNo}, #{entity.colMgrEmal}, #{entity.colMgrMblNo}
123 150
             , #{entity.rtnWhsId}, #{entity.rtnLocation}, #{entity.spplyId}, #{entity.spplyNm}, #{entity.colPickUnqNo}
@@ -145,13 +172,13 @@
145 172
         (col_pick_unq_no, spply_id, spply_nm, store_id, col_reg_dt
146 173
         , col_tot_amt, pick_mgr_nm, pick_mgr_tel_no, pick_mgr_emal, pick_mgr_mbl_no
147 174
         , 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
175
+        , col_cmplt_dt, whs_id, location, whs_dvsn, brand_id, col_desc, col_dvsn
149 176
         , sys_reg_dttm, sys_reg_id, sys_chg_dttm, sys_chg_id)
150 177
         values
151 178
         (#{entity.colPickUnqNo}, #{entity.spplyId}, #{entity.spplyNm}, #{entity.storeId}, date_format(now(),'%Y%m%d')
152 179
         , #{entity.colTotAmt}, #{entity.pickMgrNm}, #{entity.pickMgrTelNo}, #{entity.pickMgrEmal}, #{entity.pickMgrMblNo}
153 180
         , #{entity.pndrTelNo}, #{entity.pickStCd}, date_format(now(),'%Y%m%d'), #{entity.colReqDt}, #{entity.colSchDt}
154
-        , #{entity.colCmpltDt}, #{entity.whsId}, #{entity.location}, #{entity.whsDvsn}, #{entity.brandId}, #{entity.colDesc}
181
+        , #{entity.colCmpltDt}, #{entity.whsId}, #{entity.location}, #{entity.whsDvsn}, #{entity.brandId}, #{entity.colDesc}, #{entity.colDvsn}
155 182
         , now(), #{userId}, now(), #{userId})
156 183
     </insert>
157 184
 
@@ -160,15 +187,15 @@
160 187
         (col_pick_unq_no, col_pick_dtl_no, rtn_podr_unq_no, rtn_podr_dtl_no, rtn_req_unq_no
161 188
         , rtn_req_dtl_no, col_cmd_unq_no, col_cmd_dtl_no, pick_dtl_st_cd, item_id
162 189
         , item_nm, unit, unit_amt, price_unit, rodr_qty
163
-        , col_qty, col_amt, delay_yn, delay_rsn
190
+        , col_req_qty, col_req_amt, delay_yn, delay_rsn
164 191
         , sys_reg_dttm, sys_reg_id, sys_chg_dttm, sys_chg_id)
165 192
         values
166 193
         <foreach collection="gridInsertData" item="item" separator=",">
167 194
         (#{item.colPickUnqNo}, #{item.colPickDtlNo}, #{item.rtnPodrUnqNo}, #{item.rtnPodrDtlNo}, #{item.rtnReqUnqNo}
168 195
         , #{item.rtnReqDtlNo}, #{item.colCmdUnqNo}, #{item.colCmdDtlNo}, 'PICKD0', #{item.itemId}
169 196
         , #{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})
197
+        , #{item.colReqQty}, #{item.colReqAmt}, #{item.delayYn}, #{item.delayRsn}
198
+        , now(), #{userId}, now(), #{userId})
172 199
         </foreach>
173 200
     </insert>
174 201
 
@@ -247,24 +274,7 @@
247 274
         <if test="sItemNm != null and sItemNm != ''">
248 275
             and   ( ptcl.item_id like concat('%',#{sItemNm},'%') or ptcl_item_nm like concat('%',#{sItemNm},'%') )
249 276
         </if>
250
-        <choose>
251
-            <when test="gridRequest.sidx != null and gridRequest.sidx != ''">
252
-                <if test="gridRequest.sidx == 'VIEW_NUM'.toString()">
253
-                    <if test="gridRequest.sord == 'asc'.toString()">
254
-                        order by base.col_cmd_unq_no asc , ptcl.col_cmd_dtl_no asc
255
-                    </if>
256
-                    <if test="gridRequest.sord == 'desc'.toString()">
257
-                        order by base.col_cmd_unq_no desc , ptcl.col_cmd_dtl_no asc
258
-                    </if>
259
-                </if>
260
-            </when>
261
-            <otherwise>
262
-                order by base.col_cmd_unq_no desc , ptcl.col_cmd_dtl_no asc
263
-            </otherwise>
264
-        </choose>
265
-        <if test="gridRequest.pagingYn == true">
266
-            limit #{gridRequest.gridFirst}, #{gridRequest.gridSize}
267
-        </if>
277
+
268 278
     </select>
269 279
 
270 280
     <select id="selectPickInfo" resultType="com.oqpo.api.entity.inoutmng.PickInfoMgntEntity">
@@ -287,11 +297,11 @@
287 297
             , ptcl.rtn_req_dtl_no, ptcl.col_cmd_unq_no, ptcl.col_cmd_dtl_no
288 298
             , ptcl.pick_dtl_st_cd, fn_code_nm('PICK_DTL_ST_CD',ptcl.pick_dtl_st_cd) as pick_dtl_st_nm, ptcl.item_id
289 299
             , ptcl.item_nm, ptcl.unit, ptcl.unit_amt, ptcl.price_unit, ptcl.rodr_qty
290
-            , ptcl.col_qty, ptcl.col_amt, ptcl.delay_yn, ptcl.delay_rsn
300
+            , ptcl.col_req_qty, ptcl.col_req_amt, ptcl.delay_yn, ptcl.delay_rsn
291 301
             , rptcl.rtn_rsn_dvsn, fn_code_nm('RTN_RSN_DVSN', rptcl.rtn_rsn_dvsn ) as rtn_rsn_dvsn_nm
292 302
             , rptcl.rtn_rsn
293 303
         from pick_info_mgnt base, pick_dtl_ptcl ptcl
294
-            , rtn_dor_dtl_ptcl rptcl
304
+            , rtn_odr_dtl_ptcl rptcl
295 305
         where base.col_pick_unq_no = ptcl.col_pick_unq_no
296 306
         and   ptcl.rtn_podr_unq_no = rptcl.rtn_podr_unq_no
297 307
         and   ptcl.rtn_podr_dtl_no = rptcl.rtn_podr_dtl_no
@@ -304,12 +314,14 @@
304 314
                 , base.rtn_podr_unq_no, ptcl.rtn_podr_dtl_no as 'rtnOdrDtlInfo.rtn_podr_dtl_no'
305 315
                 , ptcl.rtn_req_unq_no as 'rtnOdrDtlInfo.rtn_req_unq_no', ptcl.rtn_req_dtl_no as 'rtnOdrDtlInfo.rtn_req_dtl_no'
306 316
                 , ptcl.item_id as 'rtnOdrDtlInfo.item_id', ptcl.item_nm as 'rtnOdrDtlInfo.item_nm'
307
-                , 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'
308
-                , ptcl.rtn_qty as 'rtnOdrDtlInfo.rtn_qty',  ptcl.rtn_odr_qty as 'rtnOdrDtlInfo.rtn_odr_qty'
317
+                , base.rtn_whs_id, fn_whs_nm(base.brand_id, base.rtn_whs_id) as rtn_whs_nm
318
+                 , base.rtn_location, fn_whs_location_nm(base.brand_id, base.rtn_whs_id, base.rtn_location) as rtn_location_nm
319
+                , ptcl.unit_amt as 'rtnOdrDtlInfo.unit_amt'
320
+                , ptcl.rtn_odr_qty as 'rtnOdrDtlInfo.rtn_odr_qty'
309 321
                 , date_format(base.col_req_dt,'%Y.%m.%d') as  col_req_dt, ptcl.rtn_amt as 'rtnOdrDtlInfo.rtn_amt'
310 322
                 , base.whs_id,  fn_whs_nm(base.brand_id, base.whs_id) as whs_nm
311 323
                 , base.location, fn_whs_location_nm(base.brand_id, base.whs_id, base.location) as location_nm
312
-                , base.store_id
324
+                , base.store_id, ptcl.rtn_odr_amt  as 'rtnOdrDtlInfo.rtn_odr_amt'
313 325
         from rtn_odr_base_info base
314 326
         , rtn_odr_dtl_ptcl ptcl
315 327
         where 1=1
@@ -318,13 +330,13 @@
318 330
         and    base.spply_id = #{sSpplyId}
319 331
         and    base.col_req_dt between #{fromDt} and #{toDt}
320 332
         and    base.rtn_odr_st_cd = 'RO20'
321
-        and    ptcl.rodr_dtl_st_cd = 'ROD0'
333
+        and    ptcl.rodr_dtl_st_cd = 'ROD1'
322 334
         and    base.col_dvsn = 'C002'
323 335
         <if test="sRtnWhsId != null and sRtnWhsId != ''">
324 336
             and    base.rtn_whs_id = #{sRtnWhsId}
325 337
         </if>
326 338
         <if test="sItemNm != null and sItemNm != ''">
327
-            and   (ptcl.item_id like concat('%', '', '%') or ptcl.item_nm like concat('%', '', '%'))
339
+            and   (ptcl.item_id like concat('%', #{sItemNm}, '%') or ptcl.item_nm like concat('%', #{sItemNm}, '%'))
328 340
         </if>
329 341
         <choose>
330 342
             <when test="gridRequest.sidx != null and gridRequest.sidx != ''">
@@ -356,32 +368,15 @@
356 368
         and    base.spply_id = #{sSpplyId}
357 369
         and    base.col_req_dt between #{fromDt} and #{toDt}
358 370
         and    base.rtn_odr_st_cd = 'RO20'
359
-        and    ptcl.rodr_dtl_st_cd = 'ROD0'
371
+        and    ptcl.rodr_dtl_st_cd = 'ROD1'
360 372
         and    base.col_dvsn = 'C002'
361 373
         <if test="sRtnWhsId != null and sRtnWhsId != ''">
362 374
             and    base.rtn_whs_id = #{sRtnWhsId}
363 375
         </if>
364 376
         <if test="sItemNm != null and sItemNm != ''">
365
-            and   (ptcl.item_id like concat('%', '', '%') or ptcl.item_nm like concat('%', '', '%'))
366
-        </if>
367
-        <choose>
368
-            <when test="gridRequest.sidx != null and gridRequest.sidx != ''">
369
-                <if test="gridRequest.sidx == 'VIEW_NUM'.toString()">
370
-                    <if test="gridRequest.sord == 'asc'.toString()">
371
-                        order by base.rtn_podr_unq_no asc , ptcl.rtn_podr_dtl_no asc
372
-                    </if>
373
-                    <if test="gridRequest.sord == 'desc'.toString()">
374
-                        order by base.rtn_podr_unq_no desc , ptcl.rtn_podr_dtl_no asc
375
-                    </if>
376
-                </if>
377
-            </when>
378
-            <otherwise>
379
-                order by base.rtn_podr_unq_no asc , ptcl.rtn_podr_dtl_no asc
380
-            </otherwise>
381
-        </choose>
382
-        <if test="gridRequest.pagingYn == true">
383
-            limit #{gridRequest.gridFirst}, #{gridRequest.gridSize}
377
+            and   (ptcl.item_id like concat('%', #{sItemNm}, '%') or ptcl.item_nm like concat('%', #{sItemNm}, '%'))
384 378
         </if>
379
+
385 380
     </select>
386 381
 
387 382
 
@@ -390,7 +385,7 @@
390 385
                , (select sum(rtn_amt) from  rtn_odr_dtl_ptcl where rtn_podr_unq_no = #{rtnPodrUnqNo} and rodr_dtl_st_cd = 'ROD1' ) as rtn_dodr_total_amt
391 386
                , base.rtn_whs_id, fn_whs_nm(base.brand_id, base.rtn_whs_id) as rtn_whs_nm
392 387
                , base.rtn_location, fn_whs_location_nm(brand_id, base.rtn_whs_id, base.rtn_location) as rtn_location_nm
393
-               , fn_get_telno((select tel_no from store_base_info where store_id = base.store_id )) as rtn_tel_no
388
+               , fn_get_telno((select tel_no from store_base_info where store_id = base.store_id )) as pick_tel_no
394 389
         from    rtn_odr_base_info base
395 390
         where  1=1
396 391
         and    base.brand_id = #{brandId}
@@ -400,12 +395,12 @@
400 395
     </select>
401 396
 
402 397
     <select id="selectSpplyColRtnList" resultType="com.oqpo.api.entity.rtnmng.RtnOdrDtlPtclEntity">
403
-         select ptcl.rtn_podr_unq_no, ptcl.rtn_podr_dtl_no, ptcl.item_id, ptcl.item_nm, ptcl.unit, ptcl.rtn_qty, ptcl.rtn_qty as colt_qty
398
+         select ptcl.rtn_podr_unq_no, ptcl.rtn_podr_dtl_no, ptcl.item_id, ptcl.item_nm, ptcl.unit, ptcl.rtn_odr_qty, ptcl.rtn_odr_qty as col_qty
404 399
                  , ptcl.unit_amt
405 400
                  , ptcl.rtn_rsn_dvsn, rtn_rsn
406 401
          from   rtn_odr_dtl_ptcl ptcl
407 402
          where  ptcl.rtn_podr_unq_no = #{rtnPodrUnqNo}
408
-         and    ptcl.rtn_dtl_st_cd = 'ROD1'
403
+         and    ptcl.rodr_dtl_st_cd = 'ROD1'
409 404
     </select>
410 405
 
411 406
     <!--  어디에 쓰는 쿼리인지 찿을 필요 있음
@@ -480,20 +475,13 @@
480 475
     -->
481 476
 
482 477
 
483
-
484
-
485
-
486
-
487
-
488
-
489
-
490 478
     <select id="selectColSpplyPickGridList" resultType="com.oqpo.api.entity.inoutmng.PickInfoMgntEntity">
491 479
         select pmgnt.brand_id, fn_brand_nm(pmgnt.brand_id) as brand_nm
492 480
             , pmgnt.col_pick_unq_no , pmgnt.pick_st_cd, fn_code_nm('PICK_ST_CD',pmgnt.pick_st_cd) as pick_st_nm
493 481
             , date_format(pmgnt.col_reg_dt, '%Y.%m.%d') as col_reg_dt , date_format(pmgnt.col_req_dt, '%Y.%m.%d') as col_req_dt
494 482
             , date_format(pmgnt.col_sch_dt, '%Y.%m.%d') as col_sch_dt , date_format(pmgnt.col_cmplt_dt, '%Y.%m.%d') as col_cmplt_dt
495
-            , pptcl.item_id as 'pickDtlInfo.item_id' , pptcl.item_nm as 'pickDtlInfo.item_nm', pptcl.col_qty as 'pickDtlInfo.col_qty'
496
-            , pptcl.col_amt as 'pickDtlInfo.col_amt' , pptcl.unit_amt as 'pickDtlInfo.unit_amt', ptcl.rtn_rsn_dvsn as 'pickDtlInfo.rtn_rsn_dvsn'
483
+            , pptcl.item_id as 'pickDtlInfo.item_id' , pptcl.item_nm as 'pickDtlInfo.item_nm', pptcl.col_req_qty as 'pickDtlInfo.col_req_qty'
484
+            , pptcl.col_req_amt as 'pickDtlInfo.col_req_amt' , pptcl.unit_amt as 'pickDtlInfo.unit_amt', ptcl.rtn_rsn_dvsn as 'pickDtlInfo.rtn_rsn_dvsn'
497 485
             , fn_code_nm('RTN_RSN_DVSN', ptcl.rtn_rsn_dvsn) as 'pickDtlInfo.rtn_rsn_dvsn_nm', pmgnt.whs_id, pmgnt.location
498 486
             , fn_whs_nm(pmgnt.brand_id, pmgnt.whs_id) as whs_nm, fn_whs_location_nm(pmgnt.brand_id, pmgnt.whs_id, pmgnt.location) as location_nm
499 487
             , pmgnt.pick_mgr_nm, fn_get_telno(pmgnt.pick_mgr_tel_no) as pick_mgr_tel_no
@@ -561,12 +549,13 @@
561 549
                ,mgnt.col_pick_unq_no, dtl.col_pick_dtl_no as 'pickDtlInfo.col_pick_dtl_no'
562 550
                , dtl.rtn_podr_unq_no as 'pickDtlInfo.rtn_podr_unq_no' , dtl.rtn_podr_dtl_no as 'pickDtlInfo.rtn_podr_dtl_no'
563 551
                ,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
552
+               , dtl.rodr_qty as 'pickDtlInfo.rodr_qty' , dtl.col_req_qty as 'pickDtlInfo.col_req_qty'
553
+               , dtl.col_req_qty as 'pickDtlInfo.col_qty', dtl.col_amt as 'pickDtlInfo.col_amt'
567 554
                , 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
555
+               , mgnt.whs_id as rtn_whs_id , mgnt.location as rtn_location
556
+               , 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
568 557
                , 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
558
+               , fn_whs_nm(base.brand_id, base.whs_id) as whs_nm, fn_whs_location_nm(base.brand_id, base.whs_id, base.location) as location_nm
570 559
                , mgnt.spply_id, fn_spply_nm(mgnt.spply_id) as spply_nm
571 560
         from   pick_info_mgnt mgnt
572 561
               ,pick_dtl_ptcl dtl
@@ -577,13 +566,16 @@
577 566
         and   dtl.rtn_podr_dtl_no = ptcl.rtn_podr_dtl_no
578 567
         and   ptcl.rtn_podr_unq_no = base.rtn_podr_unq_no
579 568
         and   mgnt.brand_id = #{sBrandId}
580
-        and   mgnt.store_id = #{sStoreId}
581 569
         and   mgnt.col_sch_dt between #{fromDt} and #{toDt}
570
+        and   mgnt.pick_st_cd = 'PICK0'
571
+        <if test="sStoreId != null and sStoreId != ''">
572
+            and   mgnt.store_id = #{sStoreId}
573
+        </if>
582 574
         <if test="sRtnWhsId != null and sRtnWhsId != ''">
583 575
         and   base.whs_id = #{sRtnWhsId}
584 576
         </if>
585
-        <if test="spplyId != null and spplyId != ''">
586
-        and   mgnt.spply_id = #{spplyId}
577
+        <if test="sSpplyId != null and sSpplyId != ''">
578
+        and   mgnt.spply_id = #{sSpplyId}
587 579
         </if>
588 580
         <if test="sWhsId != null and sWhsId != ''">
589 581
         and   dtl.whs_id = #{sWhsId}
@@ -622,13 +614,16 @@
622 614
         and   dtl.rtn_podr_dtl_no = ptcl.rtn_podr_dtl_no
623 615
         and   ptcl.rtn_podr_unq_no = base.rtn_podr_unq_no
624 616
         and   mgnt.brand_id = #{sBrandId}
625
-        and   mgnt.store_id = #{sStoreId}
626 617
         and   mgnt.col_sch_dt between #{fromDt} and #{toDt}
618
+        and   mgnt.pick_st_cd = 'PICK0'
619
+        <if test="sStoreId != null and sStoreId != ''">
620
+            and   mgnt.store_id = #{sStoreId}
621
+        </if>
627 622
         <if test="sRtnWhsId != null and sRtnWhsId != ''">
628 623
             and   base.whs_id = #{sRtnWhsId}
629 624
         </if>
630
-        <if test="spplyId != null and spplyId != ''">
631
-            and   mgnt.spply_id = #{spplyId}
625
+        <if test="sSpplyId != null and sSpplyId != ''">
626
+            and   mgnt.spply_id = #{sSpplyId}
632 627
         </if>
633 628
         <if test="sWhsId != null and sWhsId != ''">
634 629
             and   dtl.whs_id = #{sWhsId}
@@ -636,24 +631,7 @@
636 631
         <if test="sItemNm != null and sItemNm != ''">
637 632
             and   (mgnt.col_pick_unq_no like concat('%',#{sItemNm},'%') or dtl.item_id like concat('%',#{sItemNm},'%') or dtl.item_nm  like concat('%',#{sItemNm},'%') )
638 633
         </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>
634
+
657 635
     </select>
658 636
 
659 637
     <insert id="insertRtnProcInfoPtcl">
@@ -678,4 +656,99 @@
678 656
             , now(), #{userId}, now(), #{userId})
679 657
         </foreach>
680 658
     </insert>
659
+
660
+
661
+    <select id="selectColRtnInstResultGridList" resultType="com.oqpo.api.entity.inoutmng.PickInfoMgntEntity">
662
+        select mgnt.brand_id, fn_brand_nm(mgnt.brand_id) as brand_nm
663
+            ,mgnt.col_pick_unq_no, dtl.col_pick_dtl_no as 'pickDtlInfo.col_pick_dtl_no'
664
+            , dtl.rtn_podr_unq_no as 'pickDtlInfo.rtn_podr_unq_no' , dtl.rtn_podr_dtl_no as 'pickDtlInfo.rtn_podr_dtl_no'
665
+            ,dtl.item_id as 'pickDtlInfo.item_id', dtl.item_nm as 'pickDtlInfo.item_nm'
666
+            , dtl.rodr_qty as 'pickDtlInfo.rodr_qty' , dtl.col_req_qty as 'pickDtlInfo.col_req_qty'
667
+            , dtl.col_qty as 'pickDtlInfo.col_qty', dtl.col_amt as 'pickDtlInfo.col_amt'
668
+            , date_format(mgnt.col_sch_dt,'%Y.%m.%d') as col_sch_dt, date_format(mgnt.col_cmplt_dt,'%Y.%m.%d') as col_cmplt_dt
669
+            , mgnt.pick_mgr_nm, fn_get_telno(mgnt.pick_mgr_tel_no) as pick_mgr_tel_no
670
+            , mgnt.whs_id as rtn_whs_id , mgnt.location as rtn_location
671
+            , 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
672
+            , base.whs_id, base.location
673
+            , fn_whs_nm(base.brand_id, base.whs_id) as whs_nm, fn_whs_location_nm(base.brand_id, base.whs_id, base.location) as location_nm
674
+            , mgnt.spply_id, fn_spply_nm(mgnt.spply_id) as spply_nm
675
+            , dtl.pick_dtl_st_cd as 'pickDtlInfo.pick_dtl_st_cd'
676
+            , fn_code_nm('PICK_DTL_ST_CD', dtl.pick_dtl_st_cd) as  'pickDtlInfo.pick_dtl_st_nm'
677
+        from   pick_info_mgnt mgnt
678
+            ,pick_dtl_ptcl dtl
679
+            ,rtn_odr_dtl_ptcl ptcl
680
+            ,rtn_odr_base_info base
681
+        where mgnt.col_pick_unq_no = dtl.col_pick_unq_no
682
+        and   dtl.rtn_podr_unq_no = ptcl.rtn_podr_unq_no
683
+        and   dtl.rtn_podr_dtl_no = ptcl.rtn_podr_dtl_no
684
+        and   ptcl.rtn_podr_unq_no = base.rtn_podr_unq_no
685
+        and   mgnt.brand_id = #{sBrandId}
686
+        and   mgnt.col_cmplt_dt between #{fromDt} and #{toDt}
687
+        <if test="sStoreId != null and sStoreId != ''">
688
+            and   mgnt.store_id = #{sStoreId}
689
+        </if>
690
+        <if test="sRtnWhsId != null and sRtnWhsId != ''">
691
+            and   base.whs_id = #{sRtnWhsId}
692
+        </if>
693
+        <if test="sSpplyId != null and sSpplyId != ''">
694
+            and   mgnt.spply_id = #{sSpplyId}
695
+        </if>
696
+        <if test="sWhsId != null and sWhsId != ''">
697
+            and   dtl.whs_id = #{sWhsId}
698
+        </if>
699
+        <if test="sItemNm != null and sItemNm != ''">
700
+            and   (mgnt.col_pick_unq_no like concat('%',#{sItemNm},'%') or dtl.item_id like concat('%',#{sItemNm},'%') or dtl.item_nm  like concat('%',#{sItemNm},'%') )
701
+        </if>
702
+        <choose>
703
+            <when test="gridRequest.sidx != null and gridRequest.sidx != ''">
704
+                <if test="gridRequest.sidx == 'VIEW_NUM'.toString()">
705
+                    <if test="gridRequest.sord == 'asc'.toString()">
706
+                        order by mgnt.col_pick_unq_no asc
707
+                    </if>
708
+                    <if test="gridRequest.sord == 'desc'.toString()">
709
+                        order by mgnt.col_pick_unq_no desc
710
+                    </if>
711
+                </if>
712
+            </when>
713
+            <otherwise>
714
+                order by mgnt.col_pick_unq_no desc
715
+            </otherwise>
716
+        </choose>
717
+        <if test="gridRequest.pagingYn == true">
718
+            limit #{gridRequest.gridFirst}, #{gridRequest.gridSize}
719
+        </if>
720
+    </select>
721
+
722
+    <select id="selectColRtnInstResultGridCnt" resultType="int">
723
+        select count(*) as cnt
724
+        from   pick_info_mgnt mgnt
725
+        ,pick_dtl_ptcl dtl
726
+        ,rtn_odr_dtl_ptcl ptcl
727
+        ,rtn_odr_base_info base
728
+        where mgnt.col_pick_unq_no = dtl.col_pick_unq_no
729
+        and   dtl.rtn_podr_unq_no = ptcl.rtn_podr_unq_no
730
+        and   dtl.rtn_podr_dtl_no = ptcl.rtn_podr_dtl_no
731
+        and   ptcl.rtn_podr_unq_no = base.rtn_podr_unq_no
732
+        and   mgnt.brand_id = #{sBrandId}
733
+        and   mgnt.col_cmplt_dt between #{fromDt} and #{toDt}
734
+        <if test="sStoreId != null and sStoreId != ''">
735
+            and   mgnt.store_id = #{sStoreId}
736
+        </if>
737
+        <if test="sRtnWhsId != null and sRtnWhsId != ''">
738
+            and   base.whs_id = #{sRtnWhsId}
739
+        </if>
740
+        <if test="sSpplyId != null and sSpplyId != ''">
741
+            and   mgnt.spply_id = #{sSpplyId}
742
+        </if>
743
+        <if test="sWhsId != null and sWhsId != ''">
744
+            and   dtl.whs_id = #{sWhsId}
745
+        </if>
746
+        <if test="sItemNm != null and sItemNm != ''">
747
+            and   (mgnt.col_pick_unq_no like concat('%',#{sItemNm},'%') or dtl.item_id like concat('%',#{sItemNm},'%') or dtl.item_nm  like concat('%',#{sItemNm},'%') )
748
+        </if>
749
+
750
+    </select>
751
+
752
+
753
+
681 754
 </mapper>

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

@@ -229,7 +229,7 @@
229 229
                   , rtn_req_dvsn, fn_code_nm('RTN_REQ_DVSN', rtn_req_dvsn) as rtn_req_dvsn_nm, rtn_dodr_total_amt
230 230
                   , rtn_dodr_item_qty, rtn_mgr_nm, rtn_mgr_id, fn_get_telno(rtn_mgr_tel_no) as rtn_mgr_tel_no
231 231
                     , rtn_odr_st_cd , fn_code_nm('RTN_ODR_ST_CD',rtn_odr_st_cd) AS rtn_odr_st_nm
232
-                  , spply_id, fn_spply_nm(spply_id) as spply_id,  whs_id, fn_whs_nm(brand_id, whs_id) as whs_nm
232
+                  , spply_id, fn_spply_nm(spply_id) as spply_nm,  whs_id, fn_whs_nm(brand_id, whs_id) as whs_nm
233 233
                     , location, fn_whs_location_nm(brand_id, whs_id, location) as location_nm
234 234
                     , col_dvsn, fn_code_nm('COL_DVSN', col_dvsn) as col_dvsn_nm,  date_format(col_req_dt ,'%Y.%m.%d') as col_req_dt
235 235
                   , store_id, fn_store_nm( brand_id, store_id) as store_nm,  rtn_whs_id, rtn_location