Browse Source

매장단가 검색조건 변경

dwkim 2 years ago
parent
commit
be760e8fa8

+ 2 - 2
src/main/java/com/oqpo/api/mapper/stinfo/StoreItemUnitMapper.java

@@ -11,8 +11,8 @@ import java.util.List;
11
 @Mapper
11
 @Mapper
12
 public interface StoreItemUnitMapper {
12
 public interface StoreItemUnitMapper {
13
 
13
 
14
-    List<StoreItemUnitEntity> selectStoreItemUnitGridList(@Param("sBrandId") String sBrandId, @Param("sStoreId") String sStoreId , GridRequest gridRequest)throws Exception;
15
-    int selectStoreItemUnitGridCnt(@Param("sBrandId") String sBrandId, @Param("sStoreId") String sStoreId )throws Exception;
14
+    List<StoreItemUnitEntity> selectStoreItemUnitGridList(@Param("sBrandId") String sBrandId, @Param("sStoreNm") String sStoreNm , GridRequest gridRequest)throws Exception;
15
+    int selectStoreItemUnitGridCnt(@Param("sBrandId") String sBrandId, @Param("sStoreNm") String sStoreNm )throws Exception;
16
 
16
 
17
     List<StoreItemUnitEntity> selectStoreItemUnitInfo(@Param("brandId") String brandId, @Param("storeId") String storeId, @Param("contSttDt") String contSttDt, @Param("contEndDt") String contEndDt)throws Exception;
17
     List<StoreItemUnitEntity> selectStoreItemUnitInfo(@Param("brandId") String brandId, @Param("storeId") String storeId, @Param("contSttDt") String contSttDt, @Param("contEndDt") String contEndDt)throws Exception;
18
 
18
 

+ 3 - 3
src/main/java/com/oqpo/api/service/stinfo/ItemUnitService.java

@@ -155,13 +155,13 @@ public class ItemUnitService extends CommonService {
155
     /*
155
     /*
156
       브랜드 매장 단가 리스트 조회
156
       브랜드 매장 단가 리스트 조회
157
      */
157
      */
158
-    public GridResponse selectStoreItemUnitGridList(String sBrandId, String sStoreId,  GridRequest gridRequest) throws Exception {
158
+    public GridResponse selectStoreItemUnitGridList(String sBrandId, String sStoreNm,  GridRequest gridRequest) throws Exception {
159
         int gridPage = gridRequest.getGridPage();
159
         int gridPage = gridRequest.getGridPage();
160
         int gridSize = gridRequest.getGridSize();
160
         int gridSize = gridRequest.getGridSize();
161
 
161
 
162
-        int gridRecords = storeItemUnitMapper.selectStoreItemUnitGridCnt( sBrandId, sStoreId );
162
+        int gridRecords = storeItemUnitMapper.selectStoreItemUnitGridCnt( sBrandId, sStoreNm );
163
         int gridTotal = fnCalculateGridTotal(gridSize, gridRecords);
163
         int gridTotal = fnCalculateGridTotal(gridSize, gridRecords);
164
-        List<StoreItemUnitEntity> entities = storeItemUnitMapper.selectStoreItemUnitGridList(sBrandId, sStoreId, gridRequest);
164
+        List<StoreItemUnitEntity> entities = storeItemUnitMapper.selectStoreItemUnitGridList(sBrandId, sStoreNm, gridRequest);
165
         List<Object> gridRows = entities.stream()
165
         List<Object> gridRows = entities.stream()
166
                 .map(m -> StoreItemUnitSearchResponse.builder()
166
                 .map(m -> StoreItemUnitSearchResponse.builder()
167
                         .viewCd("R")
167
                         .viewCd("R")

+ 14 - 2
src/main/java/com/oqpo/api/service/stinfo/StoreBaseInfoService.java

@@ -213,6 +213,10 @@ public class StoreBaseInfoService extends CommonService {
213
                         } else {
213
                         } else {
214
                             loanInfoEntity.setCredtLimitUseYn("N");
214
                             loanInfoEntity.setCredtLimitUseYn("N");
215
                         }
215
                         }
216
+                } else if ("LD03".equals(entity.getLoanDvsn())) {   // 무정산
217
+                    loanInfoEntity.setChrgeLimitAmt(0);
218
+                    loanInfoEntity.setCredtLimitAmt(0);
219
+                    loanInfoEntity.setCredtLimitUseYn("N");
216
                 }
220
                 }
217
                 loanInfoEntity.setUseAmtTotal(0);
221
                 loanInfoEntity.setUseAmtTotal(0);
218
                 loanInfoEntity.setTmpRcvAcctTotal(0);
222
                 loanInfoEntity.setTmpRcvAcctTotal(0);
@@ -329,7 +333,7 @@ public class StoreBaseInfoService extends CommonService {
329
                         LoanInfoEntity loanInfoUEntity = new LoanInfoEntity();
333
                         LoanInfoEntity loanInfoUEntity = new LoanInfoEntity();
330
                         loanInfoUEntity.setLoanMgntUnqNo(entity.getLoanMgntUnqNo());
334
                         loanInfoUEntity.setLoanMgntUnqNo(entity.getLoanMgntUnqNo());
331
                         loanInfoUEntity.setLoanDvsn(entity.getLoanDvsn());
335
                         loanInfoUEntity.setLoanDvsn(entity.getLoanDvsn());
332
-                        if ("LD02".equals(entity.getLoanDvsn())) {
336
+                        if ("LD02".equals(entity.getLoanDvsn())) {  // 후불
333
                             loanInfoUEntity.setCredtLimitAmt(entity.getLimitAmt());
337
                             loanInfoUEntity.setCredtLimitAmt(entity.getLimitAmt());
334
                             loanInfoUEntity.setChrgeLimitAmt(0);
338
                             loanInfoUEntity.setChrgeLimitAmt(0);
335
                             if (entity.getLimitAmt() > 0 ) {
339
                             if (entity.getLimitAmt() > 0 ) {
@@ -337,10 +341,14 @@ public class StoreBaseInfoService extends CommonService {
337
                             } else {
341
                             } else {
338
                                 loanInfoUEntity.setCredtLimitUseYn("N");
342
                                 loanInfoUEntity.setCredtLimitUseYn("N");
339
                             }
343
                             }
340
-                        } else if ("LD01".equals(entity.getLoanDvsn())) {
344
+                        } else if ("LD01".equals(entity.getLoanDvsn())) {  // 선불
341
                             loanInfoUEntity.setCredtLimitAmt(0);
345
                             loanInfoUEntity.setCredtLimitAmt(0);
342
                             loanInfoUEntity.setChrgeLimitAmt(entity.getLimitAmt());
346
                             loanInfoUEntity.setChrgeLimitAmt(entity.getLimitAmt());
343
                             loanInfoUEntity.setCredtLimitUseYn("N");
347
                             loanInfoUEntity.setCredtLimitUseYn("N");
348
+                        } else if ("LD03".equals(entity.getLoanDvsn())) {  // 무정산
349
+                            loanInfoUEntity.setCredtLimitAmt(0);
350
+                            loanInfoUEntity.setChrgeLimitAmt(0);
351
+                            loanInfoUEntity.setCredtLimitUseYn("N");
344
                         }
352
                         }
345
                         loanMgntMapper.updateLoanChgLimitInfo(userId, loanInfoUEntity);
353
                         loanMgntMapper.updateLoanChgLimitInfo(userId, loanInfoUEntity);
346
                     }
354
                     }
@@ -362,6 +370,10 @@ public class StoreBaseInfoService extends CommonService {
362
                         loanInfoChEntity.setCredtLimitAmt(0);
370
                         loanInfoChEntity.setCredtLimitAmt(0);
363
                         loanInfoChEntity.setChrgeLimitAmt(entity.getLimitAmt());
371
                         loanInfoChEntity.setChrgeLimitAmt(entity.getLimitAmt());
364
                         loanInfoChEntity.setCredtLimitUseYn("N");
372
                         loanInfoChEntity.setCredtLimitUseYn("N");
373
+                    } else if ("LD03".equals(entity.getLoanDvsn())) {
374
+                        loanInfoChEntity.setCredtLimitAmt(0);
375
+                        loanInfoChEntity.setChrgeLimitAmt(0);
376
+                        loanInfoChEntity.setCredtLimitUseYn("N");
365
                     }
377
                     }
366
                     //신규 생성
378
                     //신규 생성
367
                     loanMgntMapper.insertAddLoanMgntInfo(userId, loanInfoChEntity) ;
379
                     loanMgntMapper.insertAddLoanMgntInfo(userId, loanInfoChEntity) ;

+ 1 - 1
src/main/java/com/oqpo/api/web/controller/stinfo/ItemUnitController.java

@@ -107,7 +107,7 @@ public class ItemUnitController {
107
     @ApiOperation(value = "  매장 단가 그리드 리스트")
107
     @ApiOperation(value = "  매장 단가 그리드 리스트")
108
     @PostMapping("/store-unit-grid-list")
108
     @PostMapping("/store-unit-grid-list")
109
     public ResponseEntity<GridResponse> storeDetailGridList(@RequestBody @Valid StoreItemUnitSearchGridRequest storeItemUnitSearchGridRequest) throws Exception {
109
     public ResponseEntity<GridResponse> storeDetailGridList(@RequestBody @Valid StoreItemUnitSearchGridRequest storeItemUnitSearchGridRequest) throws Exception {
110
-        return ResponseEntity.ok(itemUnitService.selectStoreItemUnitGridList(storeItemUnitSearchGridRequest.getSBrandId(),storeItemUnitSearchGridRequest.getSStoreId(),  storeItemUnitSearchGridRequest.toDTO(storeItemUnitSearchGridRequest)));
110
+        return ResponseEntity.ok(itemUnitService.selectStoreItemUnitGridList(storeItemUnitSearchGridRequest.getSBrandId(),storeItemUnitSearchGridRequest.getSStoreNm(),  storeItemUnitSearchGridRequest.toDTO(storeItemUnitSearchGridRequest)));
111
     }
111
     }
112
 
112
 
113
     /**
113
     /**

+ 2 - 2
src/main/java/com/oqpo/api/web/dto/request/stinfo/itemUnit/StoreItemUnitSearchGridRequest.java

@@ -14,8 +14,8 @@ public class StoreItemUnitSearchGridRequest extends GridRequest {
14
     @ApiModelProperty(value = "브랜드아이디")
14
     @ApiModelProperty(value = "브랜드아이디")
15
     private String sBrandId;
15
     private String sBrandId;
16
 
16
 
17
-    @ApiModelProperty(value = "매장아이디")
18
-    private String sStoreId;
17
+    @ApiModelProperty(value = "매장")
18
+    private String sStoreNm;
19
 
19
 
20
     protected StoreItemUnitSearchGridRequest(Integer gridSize, Integer gridPage, String sidx, String sord, Boolean pagingYn, Integer gridFirst) {
20
     protected StoreItemUnitSearchGridRequest(Integer gridSize, Integer gridPage, String sidx, String sord, Boolean pagingYn, Integer gridFirst) {
21
         super(gridSize, gridPage, sidx, sord, pagingYn, gridFirst);
21
         super(gridSize, gridPage, sidx, sord, pagingYn, gridFirst);

+ 0 - 2
src/main/java/com/oqpo/api/web/dto/response/pomng/pchReq/PchReqInfoResponse.java

@@ -2,11 +2,9 @@ package com.oqpo.api.web.dto.response.pomng.pchReq;
2
 
2
 
3
 import com.fasterxml.jackson.annotation.JsonInclude;
3
 import com.fasterxml.jackson.annotation.JsonInclude;
4
 import com.oqpo.api.entity.loanmng.LoanMgntBaseInfoEntity;
4
 import com.oqpo.api.entity.loanmng.LoanMgntBaseInfoEntity;
5
-import com.oqpo.api.entity.oper.FileEntity;
6
 import com.oqpo.api.entity.oper.UserMngEntity;
5
 import com.oqpo.api.entity.oper.UserMngEntity;
7
 import com.oqpo.api.entity.pomng.PchReqBaseInfoEntity;
6
 import com.oqpo.api.entity.pomng.PchReqBaseInfoEntity;
8
 import com.oqpo.api.entity.pomng.PchReqDtlPtclEntity;
7
 import com.oqpo.api.entity.pomng.PchReqDtlPtclEntity;
9
-import com.oqpo.api.entity.stinfo.BrandEntity;
10
 import io.swagger.annotations.ApiModelProperty;
8
 import io.swagger.annotations.ApiModelProperty;
11
 import lombok.*;
9
 import lombok.*;
12
 
10
 

+ 4 - 4
src/main/resources/mybatis/sqlmaps/stinfo/StoreItemUnit.xml

@@ -12,8 +12,8 @@
12
         select  brand_id, store_id, cont_stt_dt, cont_end_dt, min(sys_reg_dttm) as sys_reg_dttm, count(*) as item_cnt
12
         select  brand_id, store_id, cont_stt_dt, cont_end_dt, min(sys_reg_dttm) as sys_reg_dttm, count(*) as item_cnt
13
         from    store_item_unit_info
13
         from    store_item_unit_info
14
         where   brand_id = #{sBrandId}
14
         where   brand_id = #{sBrandId}
15
-        <if test="sStoreId != null and sStoreId != ''">
16
-            and     store_id = #{sStoreId}
15
+        <if test="sStoreNm != null and sStoreNm != ''">
16
+            and     store_nm = concat('%',#{sStoreNm},'%')
17
         </if>
17
         </if>
18
         and     unit_target_cd = 'Y'
18
         and     unit_target_cd = 'Y'
19
         group by brand_id, store_id, cont_stt_dt, cont_end_dt
19
         group by brand_id, store_id, cont_stt_dt, cont_end_dt
@@ -45,8 +45,8 @@
45
         select  distinct brand_id, store_id, cont_stt_dt, cont_end_dt
45
         select  distinct brand_id, store_id, cont_stt_dt, cont_end_dt
46
         from    store_item_unit_info
46
         from    store_item_unit_info
47
         where   brand_id = #{sBrandId}
47
         where   brand_id = #{sBrandId}
48
-        <if test="sStoreId != null and sStoreId != ''">
49
-            and     store_id = #{sStoreId}
48
+        <if test="sStoreNm != null and sStoreNm != ''">
49
+            and     store_nm = concat('%',#{sStoreNm},'%')
50
         </if>
50
         </if>
51
         and     unit_target_cd = 'Y'
51
         and     unit_target_cd = 'Y'
52
         ) iunit
52
         ) iunit