Просмотр исходного кода

매장발주 생성 검색조건 추가 및 창고는 운영중 창고만 출력되어지도록 함

dwkim лет назад: 2
Родитель
Сommit
b33895110f

+ 2 - 2
src/main/java/com/oqpo/api/mapper/pomng/PchReqMapper.java

@@ -36,8 +36,8 @@ public interface PchReqMapper {
36 36
 
37 37
     PchReqBaseInfoEntity selectSumReqAmt(@Param("pchReqUnqNo") String pchReqUnqNo) throws Exception;
38 38
 
39
-    List<PchReqBaseInfoEntity> selectPchReqPoTargetGridList(@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;
40
-    int selectPchReqPoTargetGridCnt(@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;
39
+    List<PchReqBaseInfoEntity> selectPchReqPoTargetGridList(@Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sSpplyId") String sSpplyId , @Param("sWhsId") String sWhsId , @Param("sItemNm") String sItemNm , @Param("sDlvDvsn") String sDlvDvsn , GridRequest gridRequest)throws Exception;
40
+    int selectPchReqPoTargetGridCnt(@Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sSpplyId") String sSpplyId , @Param("sWhsId") String sWhsId , @Param("sItemNm") String sItemNm, @Param("sDlvDvsn") String sDlvDvsn )throws Exception;
41 41
 
42 42
     List<PchReqDtlPtclEntity> selectPchRejectPrTargetList(@Param("pchReqUnqNo") String pchReqUnqNo) ;
43 43
 

+ 3 - 3
src/main/java/com/oqpo/api/service/pomng/PchReqService.java

@@ -401,16 +401,16 @@ public class PchReqService extends CommonService {
401 401
     /*
402 402
       구매요청 그리드 리스트 조회
403 403
      */
404
-    public GridResponse selectPchReqPoTargetGridList(String sBrandId, String fromDt, String toDt, String sSpplyId, String sWhsId, String sItemNm, GridRequest gridRequest) throws Exception {
404
+    public GridResponse selectPchReqPoTargetGridList(String sBrandId, String fromDt, String toDt, String sSpplyId, String sWhsId, String sItemNm , String sDlvDvsn, GridRequest gridRequest) throws Exception {
405 405
         int gridPage = gridRequest.getGridPage();
406 406
         int gridSize = gridRequest.getGridSize();
407 407
 
408 408
         fromDt = fromDt == null ? null : fromDt.replace(".", "");
409 409
         toDt = toDt == null ? null : toDt.replace(".", "");
410 410
 
411
-        int gridRecords = pchReqMapper.selectPchReqPoTargetGridCnt( sBrandId,fromDt,  toDt, sSpplyId, sWhsId, sItemNm );
411
+        int gridRecords = pchReqMapper.selectPchReqPoTargetGridCnt( sBrandId,fromDt,  toDt, sSpplyId, sWhsId, sItemNm , sDlvDvsn);
412 412
         int gridTotal = fnCalculateGridTotal(gridSize, gridRecords);
413
-        List<PchReqBaseInfoEntity> entities = pchReqMapper.selectPchReqPoTargetGridList( sBrandId,fromDt,  toDt, sSpplyId, sWhsId, sItemNm, gridRequest);
413
+        List<PchReqBaseInfoEntity> entities = pchReqMapper.selectPchReqPoTargetGridList( sBrandId,fromDt,  toDt, sSpplyId, sWhsId, sItemNm, sDlvDvsn, gridRequest);
414 414
         List<Object> gridRows = entities.stream()
415 415
                 .map(m -> PchReqPoTargetSearchListResponse.builder()
416 416
                         .viewCd("R")

+ 1 - 1
src/main/java/com/oqpo/api/web/controller/pomng/PchReqController.java

@@ -124,7 +124,7 @@ public class PchReqController {
124 124
     @ApiOperation(value = " 구매발주 대상 그리드 리스트")
125 125
     @PostMapping("/po-target-grid-list")
126 126
     public ResponseEntity<GridResponse> detailPoGridList(@RequestBody @Valid PchReqPoTargetSearchGridRequest pchReqPoTargetSearchGridRequest) throws Exception {
127
-        return ResponseEntity.ok(pchReqService.selectPchReqPoTargetGridList(pchReqPoTargetSearchGridRequest.getSBrandId(), pchReqPoTargetSearchGridRequest.getFromDt(), pchReqPoTargetSearchGridRequest.getToDt(), pchReqPoTargetSearchGridRequest.getSSpplyId(), pchReqPoTargetSearchGridRequest.getSWhsId(), pchReqPoTargetSearchGridRequest.getSItemNm(),  pchReqPoTargetSearchGridRequest.toDTO(pchReqPoTargetSearchGridRequest)));
127
+        return ResponseEntity.ok(pchReqService.selectPchReqPoTargetGridList(pchReqPoTargetSearchGridRequest.getSBrandId(), pchReqPoTargetSearchGridRequest.getFromDt(), pchReqPoTargetSearchGridRequest.getToDt(), pchReqPoTargetSearchGridRequest.getSSpplyId(), pchReqPoTargetSearchGridRequest.getSWhsId(), pchReqPoTargetSearchGridRequest.getSItemNm(),  pchReqPoTargetSearchGridRequest.getSDlvDvsn(), pchReqPoTargetSearchGridRequest.toDTO(pchReqPoTargetSearchGridRequest)));
128 128
     }
129 129
 
130 130
 

+ 3 - 0
src/main/java/com/oqpo/api/web/dto/request/pomng/pchReq/PchReqPoTargetSearchGridRequest.java

@@ -33,6 +33,9 @@ public class PchReqPoTargetSearchGridRequest extends GridRequest {
33 33
     @ApiModelProperty(value = "품목명")
34 34
     private String sItemNm;
35 35
 
36
+    @ApiModelProperty(value = "배송구분")
37
+    private String sDlvDvsn;
38
+
36 39
 
37 40
 
38 41
     protected PchReqPoTargetSearchGridRequest(Integer gridSize, Integer gridPage, String sidx, String sord, Boolean pagingYn, Integer gridFirst) {

+ 16 - 0
src/main/resources/mybatis/sqlmaps/pomng/PchReq.xml

@@ -240,6 +240,14 @@
240 240
         <if test="sItemNm != null and sItemNm != ''">
241 241
         and (ptcl.item_id like concat('%', #{sItemNm}, '%') or ptcl.item_nm like concat('%', #{sItemNm}, '%'))
242 242
         </if>
243
+        <if test="sDlvDvsn == 'DL01'">
244
+            and base.store_id is not null  and base.store_id <![CDATA[ <> ]]> ''
245
+            and item.store_deli_type = '10'
246
+        </if>
247
+        <if test="sDlvDvsn == 'DL02'">
248
+            and (( (base.store_id is null or base.store_id = '') and item.store_deli_type in ('10', '20'))
249
+            or (base.store_id is not null and base.store_id  <![CDATA[ <> ]]> '' and item.store_deli_type = '20' ) )
250
+        </if>
243 251
         <choose>
244 252
             <when test="gridRequest.sidx != null and gridRequest.sidx != ''">
245 253
                 <if test="gridRequest.sidx == 'VIEW_NUM'.toString()">
@@ -284,6 +292,14 @@
284 292
         <if test="sItemNm != null and sItemNm != ''">
285 293
             and (ptcl.item_id like concat('%', #{sItemNm}, '%') or ptcl.item_nm like concat('%', #{sItemNm}, '%'))
286 294
         </if>
295
+        <if test="sDlvDvsn == 'DL01'">
296
+            and base.store_id is not null  and base.store_id <![CDATA[ <> ]]> ''
297
+            and item.store_deli_type = '10'
298
+        </if>
299
+        <if test="sDlvDvsn == 'DL02'">
300
+            and (( (base.store_id is null or base.store_id = '') and item.store_deli_type in ('10', '20'))
301
+            or (base.store_id is not null and base.store_id  <![CDATA[ <> ]]> '' and item.store_deli_type = '20' ) )
302
+        </if>
287 303
     </select>
288 304
 
289 305
     <select id="selectPchRejectPrTargetList" resultType="com.oqpo.api.entity.pomng.PchReqDtlPtclEntity">

+ 2 - 1
src/main/resources/mybatis/sqlmaps/stockmng/WhsMng.xml

@@ -265,7 +265,8 @@
265 265
                 locInfo.stck_dvsn as 'locationInfo.stck_dvsn', fn_code_nm('STCK_DVSN', locInfo.stck_dvsn) as 'locationInfo.stck_dvsn_nm'
266 266
         from  whs_mgnt_base_info whsInfo
267 267
         left outer join whs_mgnt_base_loc locInfo on whsInfo.brand_id = locInfo.brand_id and whsInfo.whs_id = locInfo.whs_id and locInfo.loc_st_cd = 'LOC001'
268
-        where 1=1 -- whsInfo.whs_st_cd = 'W001'
268
+        where 1=1
269
+        and  whsInfo.whs_st_cd = 'W001'
269 270
         and   whsInfo.brand_id = #{sBrandId}
270 271
         <if test="sWhsDvsn != null and sWhsDvsn != ''">
271 272
         and   whsInfo.whs_dvsn = #{sWhsDvsn}