ソースを参照

오더퀸 메뉴 연동

marseyes 2 年 前
コミット
3fb9d344a6

+ 19 - 16
src/main/java/com/oqpo/api/mapper/stinfo/BrandMapper.java

@@ -13,43 +13,46 @@ import java.util.List;
13 13
 @Mapper
14 14
 public interface BrandMapper {
15 15
 
16
-    List<BrandEntity> selectTargetBrandGridList(@Param("userId") String userId, @Param("authTpCd") String authTpCd)throws Exception;
16
+    List<BrandEntity> selectTargetBrandGridList(@Param("userId") String userId, @Param("authTpCd") String authTpCd) throws Exception;
17 17
 
18
-    List<BrandEntity> selectPopBrandGridList(@Param("userId") String userId, @Param("authTpCd") String authTpCd, @Param("afflShopId") String afflShopId, @Param("brandNm") String brandNm , GridRequest gridRequest)throws Exception;
19
-    int selectPopBrandGridCnt(@Param("userId") String userId, @Param("authTpCd") String authTpCd,  @Param("afflShopId") String afflShopId, @Param("brandNm") String brandNm )throws Exception;
18
+    List<BrandEntity> selectPopBrandGridList(@Param("userId") String userId, @Param("authTpCd") String authTpCd, @Param("afflShopId") String afflShopId, @Param("brandNm") String brandNm, GridRequest gridRequest) throws Exception;
20 19
 
21
-    List<BrandEntity> selectAfflBrandList(@Param("afflShopId") String afflShopId)throws Exception;
20
+    int selectPopBrandGridCnt(@Param("userId") String userId, @Param("authTpCd") String authTpCd, @Param("afflShopId") String afflShopId, @Param("brandNm") String brandNm) throws Exception;
22 21
 
23
-    List<BrandEntity> selectBrandGridList(  @Param("sAfflShopId") String sAfflShopId, @Param("sBrandId") String sBrandId, @Param("sBrandNm") String sBrandNm, @Param("sBrandType") String sBrandType , @Param("sStCd") String sStCd  , GridRequest gridRequest)throws Exception;
24
-    int selectBrandGridCnt(@Param("sAfflShopId") String sAfflShopId, @Param("sBrandId") String sBrandId, @Param("sBrandNm") String sBrandNm, @Param("sBrandType") String sBrandType , @Param("sStCd") String sStCd )throws Exception;
22
+    List<BrandEntity> selectAfflBrandList(@Param("afflShopId") String afflShopId) throws Exception;
25 23
 
26
-    BrandEntity selectBrandInfo(@Param("brandId") String brandId)throws Exception;
24
+    List<BrandEntity> selectBrandGridList(@Param("sAfflShopId") String sAfflShopId, @Param("sBrandId") String sBrandId, @Param("sBrandNm") String sBrandNm, @Param("sBrandType") String sBrandType, @Param("sStCd") String sStCd, GridRequest gridRequest) throws Exception;
25
+
26
+    int selectBrandGridCnt(@Param("sAfflShopId") String sAfflShopId, @Param("sBrandId") String sBrandId, @Param("sBrandNm") String sBrandNm, @Param("sBrandType") String sBrandType, @Param("sStCd") String sStCd) throws Exception;
27
+
28
+    BrandEntity selectBrandInfo(@Param("brandId") String brandId) throws Exception;
27 29
 
28 30
     int insertBrandInfo(@Param("userId") String userId, BrandEntity entity) throws Exception;
31
+
29 32
     int updateBrandInfo(@Param("userId") String userId, BrandEntity entity) throws Exception;
30 33
 
31
-    String selectBrandInitPw(@Param("brandId") String brandId )throws Exception;
34
+    String selectBrandInitPw(@Param("brandId") String brandId) throws Exception;
32 35
 
33
-    List<BrandEntity> selectBsnsBrandList(@Param("bsnsRegNo") String bsnsRegNo)throws Exception;
36
+    List<BrandEntity> selectBsnsBrandList(@Param("bsnsRegNo") String bsnsRegNo) throws Exception;
34 37
 
35 38
     int updateCloseBrand(@Param("userId") String userId, @Param("brandId") String brandId, @Param("afflShopId") String afflShopId) throws Exception;
36 39
 
37
-    String selectBrandNo(@Param("brandId") String brandId)throws Exception;
40
+    String selectBrandNo(@Param("brandId") String brandId) throws Exception;
38 41
 
39
-    BrandEntity selectBrandNmInfo( @Param("brandId") String brandId)throws Exception;
42
+    BrandEntity selectBrandNmInfo(@Param("brandId") String brandId) throws Exception;
40 43
 
41
-    int selectAfflBrandExist( @Param("brandId") String brandId, @Param("afflShopId") String afflShopId)throws Exception;
44
+    int selectAfflBrandExist(@Param("brandId") String brandId, @Param("afflShopId") String afflShopId) throws Exception;
42 45
 
43 46
     int insertPgKiccBaseInfo(@Param("userId") String userId, PgKiccBaseInfoEntity entity) throws Exception;
44 47
 
45 48
     String selectPgMallId(@Param("brandId") String brandId) throws Exception;
46 49
 
47
-    int updatePgKiccBaseInfo(@Param("userId") String userId, @Param("brandId") String brandId, @Param("mallId") String mallId, @Param("useYn") String useYn)  throws Exception;
50
+    int updatePgKiccBaseInfo(@Param("userId") String userId, @Param("brandId") String brandId, @Param("mallId") String mallId, @Param("useYn") String useYn) throws Exception;
48 51
 
49
-    BrandEntity selectBrandPgInfo(@Param("brandId") String brandId)throws Exception;
52
+    BrandEntity selectBrandPgInfo(@Param("brandId") String brandId) throws Exception;
50 53
 
51
-    List<BrandEntity> selectPgMallIdList(@Param("brandId") String brandId)throws Exception;
54
+    List<BrandEntity> selectPgMallIdList(@Param("brandId") String brandId) throws Exception;
52 55
 
53
-    BrandEntity selectBrandOptionInfo(@Param("brandId") String brandId)throws Exception;
56
+    BrandEntity selectBrandOptionInfo(@Param("brandId") String brandId) throws Exception;
54 57
 
55 58
 }

+ 24 - 13
src/main/java/com/oqpo/api/mapper/stinfo/ItemMapper.java

@@ -14,36 +14,47 @@ import java.util.List;
14 14
 @Mapper
15 15
 public interface ItemMapper {
16 16
 
17
-    List<ItemEntity> selectPopItemGridList(@Param("sBrandId") String sBrandId, @Param("sPodrPssblDvsn") String sPodrPssblDvsn, @Param("sItemNm") String sItemNm, GridRequest gridRequest)throws Exception;
18
-    int selectPopItemGridCnt(@Param("sBrandId") String sBrandId, @Param("sPodrPssblDvsn") String sPodrPssblDvsn, @Param("sItemNm") String sItemNm)throws Exception;
17
+    List<ItemEntity> selectPopItemGridList(@Param("sBrandId") String sBrandId, @Param("sPodrPssblDvsn") String sPodrPssblDvsn, @Param("sItemNm") String sItemNm, GridRequest gridRequest) throws Exception;
19 18
 
20
-    List<ItemEntity> selectItemGridList(@Param("sBrandId") String sBrandId, @Param("sSpplyId") String sSpplyId, @Param("sItemStCd") String sItemStCd, @Param("sPodrPssblDvsn") String sPodrPssblDvsn, @Param("sItemType") String sItemType, @Param("sItemGubun") String sItemGubun, @Param("sClass1") String sClass1, @Param("sClass2") String sClass2, @Param("sClass3") String sClass3, @Param("sClass4") String sClass4, @Param("sItemNm") String sItemNm, GridRequest gridRequest)throws Exception;
21
-    int selectItemGridCnt(@Param("sBrandId") String sBrandId, @Param("sSpplyId") String sSpplyId, @Param("sItemStCd") String sItemStCd, @Param("sPodrPssblDvsn") String sPodrPssblDvsn, @Param("sItemType") String sItemType, @Param("sItemGubun") String sItemGubun, @Param("sClass1") String sClass1, @Param("sClass2") String sClass2, @Param("sClass3") String sClass3, @Param("sClass4") String sClass4, @Param("sItemNm") String sItemNm)throws Exception;
19
+    int selectPopItemGridCnt(@Param("sBrandId") String sBrandId, @Param("sPodrPssblDvsn") String sPodrPssblDvsn, @Param("sItemNm") String sItemNm) throws Exception;
22 20
 
23
-    ItemEntity selectItemInfo(@Param("brandId") String brandId, @Param("itemId") String itemId)throws Exception;
21
+    List<ItemEntity> selectItemGridList(@Param("sBrandId") String sBrandId, @Param("sSpplyId") String sSpplyId, @Param("sItemStCd") String sItemStCd, @Param("sPodrPssblDvsn") String sPodrPssblDvsn, @Param("sItemType") String sItemType, @Param("sItemGubun") String sItemGubun, @Param("sClass1") String sClass1, @Param("sClass2") String sClass2, @Param("sClass3") String sClass3, @Param("sClass4") String sClass4, @Param("sItemNm") String sItemNm, GridRequest gridRequest) throws Exception;
22
+
23
+    int selectItemGridCnt(@Param("sBrandId") String sBrandId, @Param("sSpplyId") String sSpplyId, @Param("sItemStCd") String sItemStCd, @Param("sPodrPssblDvsn") String sPodrPssblDvsn, @Param("sItemType") String sItemType, @Param("sItemGubun") String sItemGubun, @Param("sClass1") String sClass1, @Param("sClass2") String sClass2, @Param("sClass3") String sClass3, @Param("sClass4") String sClass4, @Param("sItemNm") String sItemNm) throws Exception;
24
+
25
+    ItemEntity selectItemInfo(@Param("brandId") String brandId, @Param("itemId") String itemId) throws Exception;
24 26
 
25 27
     int insertItemInfo(@Param("userId") String userId, ItemEntity entity) throws Exception;
28
+
26 29
     int insertItemClassInfo(@Param("userId") String userId, ItemClassEntity entity) throws Exception;
27 30
 
28 31
     int updateItemInfo(@Param("userId") String userId, ItemEntity entity) throws Exception;
32
+
33
+    int updateItemInfo4OqLinik(@Param("userId") String userId, ItemEntity entity) throws Exception;
34
+
29 35
     int updateItemClassInfo(@Param("userId") String userId, ItemClassEntity entity) throws Exception;
30
-    int deleteItemClassInfo( @Param("itemId") String itemId) throws Exception;
31 36
 
37
+    int deleteItemClassInfo(@Param("itemId") String itemId) throws Exception;
32 38
 
33
-    ItemClassMngEntity selectItemClassMngNo(@Param("brandId") String brandId, @Param("class1") String class1, @Param("class2") String class2 , @Param("class3") String class3,  @Param("class4") String class4)throws Exception;
39
+
40
+    ItemClassMngEntity selectItemClassMngNo(@Param("brandId") String brandId, @Param("class1") String class1, @Param("class2") String class2, @Param("class3") String class3, @Param("class4") String class4) throws Exception;
34 41
 
35 42
     int insertItemClassMngInfo(@Param("userId") String userId, ItemClassMngEntity entity) throws Exception;
43
+
36 44
     int updateItemClassMngInfo(@Param("userId") String userId, ItemClassMngEntity entity) throws Exception;
37
-    int deleteItemClassMngInfo(@Param("userId") String userId, List<ItemClassMngEntity> gridDeleteData ) throws Exception;
38 45
 
46
+    int deleteItemClassMngInfo(@Param("userId") String userId, List<ItemClassMngEntity> gridDeleteData) throws Exception;
47
+
48
+
49
+    List<ItemClassMngEntity> selectItemClassMngGridList(@Param("sBrandId") String sBrandId, @Param("sItemClass1") String sItemClass1, @Param("sItemClass2") String sItemClass2, @Param("sItemClass3") String sItemClass3, @Param("sItemClass4") String sItemClass4, @Param("sItemClassNm") String sItemClassNm, GridRequest gridRequest) throws Exception;
50
+
51
+    int selectItemClassMngGridCnt(@Param("sBrandId") String sBrandId, @Param("sItemClass1") String sItemClass1, @Param("sItemClass2") String sItemClass2, @Param("sItemClass3") String sItemClass3, @Param("sItemClass4") String sItemClass4, @Param("sItemClassNm") String sItemClassNm) throws Exception;
39 52
 
40
-    List<ItemClassMngEntity> selectItemClassMngGridList(@Param("sBrandId") String sBrandId, @Param("sItemClass1") String sItemClass1, @Param("sItemClass2") String sItemClass2,  @Param("sItemClass3") String sItemClass3, @Param("sItemClass4") String sItemClass4,@Param("sItemClassNm") String sItemClassNm, GridRequest gridRequest)throws Exception;
41
-    int selectItemClassMngGridCnt(@Param("sBrandId") String sBrandId, @Param("sItemClass1") String sItemClass1, @Param("sItemClass2") String sItemClass2,  @Param("sItemClass3") String sItemClass3, @Param("sItemClass4") String sItemClass4,@Param("sItemClassNm") String sItemClassNm)throws Exception;
42
-    ItemClassMngEntity selectItemClassMngInfo(@Param("brandId") String brandId, @Param("itemClassMgntNo") String itemClassMgntNo)throws Exception;
53
+    ItemClassMngEntity selectItemClassMngInfo(@Param("brandId") String brandId, @Param("itemClassMgntNo") String itemClassMgntNo) throws Exception;
43 54
 
44
-    int selectItemClassMaxClass(@Param("sBrandId") String sBrandId, @Param("itemLevel") Integer itemLevel, @Param("sItemClass1") String sItemClass1, @Param("sItemClass2") String sItemClass2,  @Param("sItemClass3") String sItemClass3, @Param("sItemClass4") String sItemClass4);
55
+    int selectItemClassMaxClass(@Param("sBrandId") String sBrandId, @Param("itemLevel") Integer itemLevel, @Param("sItemClass1") String sItemClass1, @Param("sItemClass2") String sItemClass2, @Param("sItemClass3") String sItemClass3, @Param("sItemClass4") String sItemClass4);
45 56
 
46
-    List<ItemClassMngEntity> selectItemLevelList(@Param("sBrandId") String sBrandId, @Param("sItemLevel") int sItemLevel, @Param("sItemClass1") String sItemClass1, @Param("sItemClass2") String sItemClass2,  @Param("sItemClass3") String sItemClass3)throws Exception;
57
+    List<ItemClassMngEntity> selectItemLevelList(@Param("sBrandId") String sBrandId, @Param("sItemLevel") int sItemLevel, @Param("sItemClass1") String sItemClass1, @Param("sItemClass2") String sItemClass2, @Param("sItemClass3") String sItemClass3) throws Exception;
47 58
 
48 59
 
49 60
     List<ItemClassMngEntity> selectItemClassBeLongList(@Param("brandId") String brandId, @Param("itemClassMgntNo") String itemClassMgntNo) throws Exception;

+ 64 - 36
src/main/java/com/oqpo/api/service/stinfo/ItemService.java

@@ -7,17 +7,12 @@ import com.oqpo.api.client.oqlink.dto.OqScmMenuRegReqModel;
7 7
 import com.oqpo.api.client.oqlink.dto.OqScmMenuRegResModel;
8 8
 import com.oqpo.api.client.oqlink.util.HmacUtil;
9 9
 import com.oqpo.api.constant.ApiConstants;
10
-import com.oqpo.api.entity.CodeEntity;
11 10
 import com.oqpo.api.entity.oper.FileEntity;
12
-import com.oqpo.api.entity.oper.UserMngEntity;
13
-import com.oqpo.api.entity.pomng.PchWishListItemEntity;
14 11
 import com.oqpo.api.entity.stinfo.*;
15
-import com.oqpo.api.entity.stockmng.StckMgntBaseInfoEntity;
16 12
 import com.oqpo.api.entity.stockmng.WhsMgntBaseInfoEntity;
17 13
 import com.oqpo.api.enums.*;
18 14
 import com.oqpo.api.exception.GlobalException;
19 15
 import com.oqpo.api.mapper.FileMapper;
20
-import com.oqpo.api.mapper.oper.UserMngMapper;
21 16
 import com.oqpo.api.mapper.stinfo.BrandMapper;
22 17
 import com.oqpo.api.mapper.stinfo.ItemMapper;
23 18
 import com.oqpo.api.mapper.stinfo.ItemUnitMapper;
@@ -26,24 +21,13 @@ import com.oqpo.api.service.CommonService;
26 21
 import com.oqpo.api.service.SessionService;
27 22
 import com.oqpo.api.util.StringUtil;
28 23
 import com.oqpo.api.web.dto.request.GridRequest;
29
-import com.oqpo.api.web.dto.request.stinfo.brand.SaveBrandInfolRequest;
30 24
 import com.oqpo.api.web.dto.request.stinfo.item.*;
31 25
 import com.oqpo.api.web.dto.response.GridResponse;
32
-import com.oqpo.api.web.dto.response.SelectResponse;
33
-import com.oqpo.api.web.dto.response.code.CodeDtlResponse;
34
-import com.oqpo.api.web.dto.response.code.CodeSearchListResponse;
35
-import com.oqpo.api.web.dto.response.pomng.pchReq.PchWishListItem;
36
-import com.oqpo.api.web.dto.response.stinfo.brand.AfflBrandSearchResponse;
37
-import com.oqpo.api.web.dto.response.stinfo.brand.BrandInfoResponse;
38
-import com.oqpo.api.web.dto.response.stinfo.brand.BrandSearchListResponse;
39
-import com.oqpo.api.web.dto.response.stinfo.brand.BrandSearchResponse;
40 26
 import com.oqpo.api.web.dto.response.stinfo.item.*;
41 27
 import com.oqpo.api.web.dto.response.stinfo.itemUnit.StroeWhsListResponse;
42 28
 import com.oqpo.api.web.dto.response.stinfo.itemUnit.StroeWishListResponse;
43
-import com.oqpo.api.web.dto.response.stockmng.BarcodeWhsItemInfoResponse;
44 29
 import lombok.extern.slf4j.Slf4j;
45 30
 import org.springframework.beans.factory.annotation.Autowired;
46
-import org.springframework.security.crypto.password.PasswordEncoder;
47 31
 import org.springframework.stereotype.Service;
48 32
 import org.springframework.transaction.annotation.Transactional;
49 33
 
@@ -54,16 +38,19 @@ import java.util.stream.Collectors;
54 38
 @Service
55 39
 @Slf4j
56 40
 public class ItemService extends CommonService {
41
+
57 42
     @Autowired
58 43
     private ItemMapper itemMapper;
59 44
 
45
+    @Autowired
46
+    private BrandMapper brandMapper;
47
+
60 48
     @Autowired
61 49
     private ItemUnitMapper itemUnitMapper;
62 50
 
63 51
     @Autowired
64 52
     private WhsMngMapper whsMngMapper;
65 53
 
66
-
67 54
     @Autowired
68 55
     private FileMapper fileMapper;
69 56
 
@@ -264,16 +251,7 @@ public class ItemService extends CommonService {
264 251
 
265 252
             // 품목 class 정보 등록
266 253
             if (!"".toString().equals(saveItemInfolRequest.getItemClass1())) {
267
-                ItemClassEntity iClassEntity = new ItemClassEntity();
268
-                iClassEntity.setItemId(entity.getItemId());
269
-                iClassEntity.setItemNm(entity.getItemNm());
270
-                iClassEntity.setItemClass1(saveItemInfolRequest.getItemClass1());
271
-                iClassEntity.setItemClass2(saveItemInfolRequest.getItemClass2());
272
-                iClassEntity.setItemClass3(saveItemInfolRequest.getItemClass3());
273
-                iClassEntity.setItemClass4(saveItemInfolRequest.getItemClass4());
274
-                ItemClassMngEntity itemClassInfo = itemMapper.selectItemClassMngNo(entity.getBrandId(), iClassEntity.getItemClass1(), iClassEntity.getItemClass2(), iClassEntity.getItemClass3(), iClassEntity.getItemClass4());
275
-                iClassEntity.setItemClassMgntNo(itemClassInfo.getItemClassMgntNo());
276
-
254
+                ItemClassEntity iClassEntity = toItemClassEntity(saveItemInfolRequest, entity);
277 255
                 itemMapper.insertItemClassInfo(userId, iClassEntity);
278 256
             }
279 257
 
@@ -301,8 +279,12 @@ public class ItemService extends CommonService {
301 279
                     res = oqlinkClient.changeScmMenu(HmacUtil.makeHmacValue4OqLink(req), req);
302 280
                 }
303 281
                 if (SystemMessageCode.BO_IF_OK.getId() == Integer.parseInt(res.getCode())) {
304
-                    // TODO 오더퀸 메뉴코드 업데이트
305
-
282
+                    // 오더퀸 메뉴코드 업데이트
283
+                    ItemEntity itemEntity = null;
284
+                    for (OqScmMenuModel item : res.getMenuList()) {
285
+                        itemEntity = toItemEntity4OqLink(item);
286
+                        itemMapper.updateItemInfo4OqLinik(userId, itemEntity);
287
+                    }
306 288
                 } else {
307 289
                     throw new GlobalException(SystemMessageCode.valueOf(Integer.valueOf(res.getCode())));
308 290
                 }
@@ -316,6 +298,26 @@ public class ItemService extends CommonService {
316 298
         }
317 299
     }
318 300
 
301
+    private ItemClassEntity toItemClassEntity(SaveItemInfolRequest saveItemInfolRequest, ItemEntity entity) throws Exception {
302
+        ItemClassEntity iClassEntity = new ItemClassEntity();
303
+        iClassEntity.setItemId(entity.getItemId());
304
+        iClassEntity.setItemNm(entity.getItemNm());
305
+        iClassEntity.setItemClass1(saveItemInfolRequest.getItemClass1());
306
+        iClassEntity.setItemClass2(saveItemInfolRequest.getItemClass2());
307
+        iClassEntity.setItemClass3(saveItemInfolRequest.getItemClass3());
308
+        iClassEntity.setItemClass4(saveItemInfolRequest.getItemClass4());
309
+        ItemClassMngEntity itemClassInfo = itemMapper.selectItemClassMngNo(entity.getBrandId(), iClassEntity.getItemClass1(), iClassEntity.getItemClass2(), iClassEntity.getItemClass3(), iClassEntity.getItemClass4());
310
+        iClassEntity.setItemClassMgntNo(itemClassInfo.getItemClassMgntNo());
311
+        return iClassEntity;
312
+    }
313
+
314
+    private ItemEntity toItemEntity4OqLink(OqScmMenuModel item) {
315
+        ItemEntity itemEntity = new ItemEntity();
316
+        itemEntity.setItemId(item.getItemId());
317
+        itemEntity.setOqMenuCd(item.getMenuCd());
318
+        return itemEntity;
319
+    }
320
+
319 321
     private ItemEntity toItemEntity(SaveItemInfolRequest saveItemInfolRequest) {
320 322
         ItemEntity entity = new ItemEntity();
321 323
         entity.setBrandId(saveItemInfolRequest.getBrandId());
@@ -360,16 +362,41 @@ public class ItemService extends CommonService {
360 362
         try {
361 363
             List<SaveItemListData> list = saveItemListRequest.getList();
362 364
             for (SaveItemListData item : list) {
363
-                ItemEntity entity = toItemEntity(userId, saveItemListRequest, item);
364
-
365 365
                 // 품목 아이디 부여  22  entity.setContentsNo(fnGetKeyNo(17));
366 366
                 // entity.setItemId(fnGetDealNo(26, ""));  // 품목아이디 생성
367
-                entity.setItemId(sessionService.getKeyInfo("It").getKeyData());  // 품목아이디 생성
367
+                item.setItemId(sessionService.getKeyInfo("It").getKeyData()); // 품목아이디 생성
368
+                ItemEntity entity = toItemEntity(userId, saveItemListRequest, item);
368 369
                 itemMapper.insertItemInfo(userId, entity);
369 370
             }
370 371
 
371
-            // TODO 오더퀸 연동 - 오더퀸연동 정보가 없어 진행불가
372
+            // 오더퀸 연동
373
+            BrandEntity brandEntity = brandMapper.selectBrandInfo(saveItemListRequest.getBrandId());
374
+            if (!StringUtil.isEmpty(brandEntity.getOqBrandId())) {
375
+                List<OqScmMenuModel> menuList = new ArrayList<>();
376
+                for (SaveItemListData item : list) {
377
+                    OqScmMenuModel menu = new OqScmMenuModel();
378
+                    menu.setItemId(item.getItemId()); // 품목아이디
379
+                    menu.setItemNm(item.getItemNm()); // 품목명
380
+                    menu.setBarcodeNo(item.getBarcode()); // 바코드번호
381
+                    menuList.add(menu);
382
+                }
383
+
384
+                OqScmMenuRegReqModel req = new OqScmMenuRegReqModel();
385
+                req.setBrandCd(brandEntity.getOqBrandId());
386
+                req.setMenuList(menuList);
387
+                OqScmMenuRegResModel res = oqlinkClient.regScmMenu(HmacUtil.makeHmacValue4OqLink(req), req);
372 388
 
389
+                if (SystemMessageCode.BO_IF_OK.getId() == Integer.parseInt(res.getCode())) {
390
+                    // 오더퀸 메뉴코드 업데이트
391
+                    ItemEntity itemEntity = null;
392
+                    for (OqScmMenuModel item : res.getMenuList()) {
393
+                        itemEntity = toItemEntity4OqLink(item);
394
+                        itemMapper.updateItemInfo4OqLinik(userId, itemEntity);
395
+                    }
396
+                } else {
397
+                    throw new GlobalException(SystemMessageCode.valueOf(Integer.valueOf(res.getCode())));
398
+                }
399
+            }
373 400
         } catch (GlobalException e) {
374 401
             e.getStackTrace();
375 402
             throw new GlobalException(e.getSystemMessageCode());
@@ -381,6 +408,7 @@ public class ItemService extends CommonService {
381 408
 
382 409
     private ItemEntity toItemEntity(String userId, SaveItemListRequest saveItemListRequest, SaveItemListData item) {
383 410
         ItemEntity entity = new ItemEntity();
411
+        entity.setItemId(item.getItemId());
384 412
         entity.setItemNm(item.getItemNm());
385 413
         entity.setItemStCd("IS00"); // 사용
386 414
         entity.setBrandId(saveItemListRequest.getBrandId());
@@ -653,7 +681,7 @@ public class ItemService extends CommonService {
653 681
         return GridResponse.toDTO(gridPage, gridTotal, gridRecords, gridRows);
654 682
     }
655 683
 
656
-    public GridResponse selectPopWishListItem(String userId, String wishListMgntNo, String brandId, String storeId , GridRequest gridRequest) throws Exception {
684
+    public GridResponse selectPopWishListItem(String userId, String wishListMgntNo, String brandId, String storeId, GridRequest gridRequest) throws Exception {
657 685
 
658 686
         int gridPage = gridRequest.getGridPage();
659 687
         int gridSize = gridRequest.getGridSize();
@@ -661,7 +689,7 @@ public class ItemService extends CommonService {
661 689
         int gridRecords = 0;
662 690
         int gridTotal = 0;
663 691
 
664
-        List<ItemUnitEntity> entities = itemUnitMapper.selectPopWishListItem( userId, wishListMgntNo, brandId, storeId );
692
+        List<ItemUnitEntity> entities = itemUnitMapper.selectPopWishListItem(userId, wishListMgntNo, brandId, storeId);
665 693
         List<Object> gridRows = entities.stream().
666 694
                 map(m -> ItemPopSearchResponse.builder()
667 695
                         .viewCd("R")
@@ -680,7 +708,7 @@ public class ItemService extends CommonService {
680 708
                         .storeUnitUnqNo(m.getStoreUnitUnqNo() == null ? "" : m.getStoreUnitUnqNo())
681 709
                         .build())
682 710
                 .collect(Collectors.toList()
683
-        );
711
+                );
684 712
         return GridResponse.toDTO(gridPage, gridTotal, gridRecords, gridRows);
685 713
     }
686 714
 

+ 4 - 0
src/main/java/com/oqpo/api/web/dto/request/stinfo/item/SaveItemListData.java

@@ -1,5 +1,6 @@
1 1
 package com.oqpo.api.web.dto.request.stinfo.item;
2 2
 
3
+import com.fasterxml.jackson.annotation.JsonIgnore;
3 4
 import io.swagger.annotations.ApiModelProperty;
4 5
 import lombok.Getter;
5 6
 import lombok.Setter;
@@ -80,4 +81,7 @@ public class SaveItemListData {
80 81
     private String barcode;
81 82
     @ApiModelProperty(value = "매장배송구분")
82 83
     private String storeDeliTypeNm;
84
+
85
+    @JsonIgnore
86
+    private String itemId;
83 87
 }

+ 8 - 0
src/main/resources/mybatis/sqlmaps/stinfo/Item.xml

@@ -284,6 +284,14 @@
284 284
         and   item_id            =  #{entity.itemId}
285 285
     </update>
286 286
 
287
+    <update id="updateItemInfo4OqLinik">
288
+        UPDATE item_base_info SET
289
+            oq_menu_cd = #{entity.oqMenuCd},
290
+            sys_chg_dttm = NOW(),
291
+            sys_chg_id = #{userId}
292
+        WHERE item_id = #{entity.itemId}
293
+    </update>
294
+
287 295
     <update id="updateItemClassInfo">
288 296
         update item_class_ptcl
289 297
             set item_nm            =  #{entity.itemNm}