Преглед изворни кода

매장단가 신규등록시 초기세팅 api 추가

dwkim пре 2 година
родитељ
комит
eee0fda1dc

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

@@ -28,4 +28,6 @@ public interface StoreItemUnitMapper {
28 28
 
29 29
     int insertMergStoreItemUnitInfo(@Param("userId") String userId, @Param("brandId") String brandId, @Param("storeId") String storeId, @Param("contSttDt") String contSttDt, @Param("contEndDt") String contEndDt, List<StoreItemUnitEntity> gridUpdateData) throws Exception;
30 30
 
31
+    List<StoreItemUnitEntity> selectStoreNewItemUnitInfo(@Param("brandId") String brandId)throws Exception;
32
+
31 33
 }

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

@@ -245,6 +245,17 @@ public class ItemUnitService extends CommonService {
245 245
         return GridResponse.toDTO(gridPage, gridTotal, gridRecords, gridRows);
246 246
     }
247 247
     */
248
+    /* 신규 매장단가 정보 초기 세팅값 */
249
+
250
+
251
+    /* 매장 단가 정보 */
252
+    public StoreItemUnitInfoResponse selectStoreNewItemUnitInfo(String brandId) throws Exception {
253
+
254
+        List<StoreItemUnitEntity> entities = storeItemUnitMapper.selectStoreNewItemUnitInfo( brandId);
255
+        return StoreItemUnitInfoResponse.toDTO(entities);
256
+
257
+    }
258
+
248 259
 
249 260
     /* 매장 단가 정보 */
250 261
     public StoreItemUnitInfoResponse selectStoreItemUnitInfo(String brandId, String storeId, String contSttDt, String contEndDt) throws Exception {

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

@@ -148,6 +148,24 @@ public class ItemUnitController {
148 148
         return ResponseEntity.ok(itemUnitService.selectSstoreItemUnitGridList(sStoreItemUnitSearchGridRequest.getSBrandId(),sStoreItemUnitSearchGridRequest.getSStoreId(),  sStoreItemUnitSearchGridRequest.toDTO(sStoreItemUnitSearchGridRequest)));
149 149
     }
150 150
 */
151
+
152
+    /**
153
+     * 설명 : 매장 단가 신규 초기 정보
154
+     *
155
+     * @param brandId
156
+     * @return
157
+     * @throws Exception
158
+     */
159
+    @ApiImplicitParams({
160
+            @ApiImplicitParam(name = "X-AUTH-TOKEN", value = "CONN-KEY", required = true, dataType = "String", paramType = "header"),
161
+            @ApiImplicitParam(name = "brandId", value = "브랜드아이디", required = true, dataType = "String", paramType = "query")
162
+    })
163
+    @ApiOperation(value = "매장 단가 신규 초기 정보")
164
+    @GetMapping("/new-info-storeitemunit")
165
+    public ResponseEntity<StoreItemUnitInfoResponse> newInfoUnitItem(@RequestParam(value = "brandId") String brandId) throws Exception {
166
+        return ResponseEntity.ok(itemUnitService.selectStoreNewItemUnitInfo(brandId));
167
+    }
168
+
151 169
     /**
152 170
      * 설명 : 매장 단가 정보
153 171
      *

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

@@ -177,6 +177,21 @@
177 177
             , stdd_qty          = VALUES(stdd_qty)
178 178
     </insert>
179 179
 
180
+    <select id="selectStoreNewItemUnitInfo" resultType="com.oqpo.api.entity.stinfo.StoreItemUnitEntity">
181
+        select /*selectStoreNewItemUnitInfo*/
182
+                 'C' view_cd,
183
+                 '' as store_unit_unq_no, item.brand_id, item.item_id, item.item_nm,
184
+                 '' as cont_stt_dt, '' as cont_end_dt,
185
+                 item.unit, fn_code_nm('DSTRBT_COST_UNIT',item.unit) as unit_nm,
186
+                 item.stdd_qty, item.CURR, fn_code_nm('CURR',item.curr)  as curr_nm,
187
+                 item.store_sale_unit_amt as usit_amt, 'Y' as unit_target_cd,
188
+                 fn_code_nm('DSTRBT_COST_UNIT','Y') as unit_target_nm,
189
+                 item.unit_amt as spply_unit_amt,
190
+                 item.brand_unit_unq_no
191
+
192
+         from   brand_item_unit_info item
193
+         where  item.brand_id = #{brandId}
194
+    </select>
180 195
 
181 196
 
182 197
 </mapper>