From 74c58e1877ead94a76bfa32baeb74a642988c400 Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期二, 17 十二月 2024 10:16:02 +0800 Subject: [PATCH] 合并代码 --- ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java index 211121b..b057bef 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java @@ -167,17 +167,29 @@ if (CollectionUtils.isEmpty(goodsShopList)){ throw new NullPointerException("请选择指定门店"); } + for (GoodsShop goodsShop : goodsShopList) { + goodsShop.setGoodsId(goods.getId()); + goodsShop.setId(null); + } goodsShopService.saveBatch(goodsShopList); } // 指定用户 List<GoodsAppUser> goodsAppUserList = goods.getGoodsAppUserList(); if (!CollectionUtils.isEmpty(goodsAppUserList)){ + for (GoodsAppUser goodsAppUser : goodsAppUserList) { + goodsAppUser.setId(null ); + goodsAppUser.setGoodsId(goods.getId()); + } goodsAppUserService.saveBatch(goodsAppUserList); } // 会员价格配置 List<GoodsVip> goodsVipList = goods.getGoodsVipList(); + for (GoodsVip goodsVip : goodsVipList) { + goodsVip.setId(null); + goodsVip.setGoodsId(goods.getId()); + } goodsVipService.saveBatch(goodsVipList); // 特殊地区售价设置 @@ -186,6 +198,7 @@ for (GoodsArea goodsArea : goodsAreaList) { List<GoodsArea> goodsAreaList1 = goodsArea.getGoodsAreaList(); for (GoodsArea area : goodsAreaList1) { + area.setGoodsId(goods.getId()); area.setProvince(goodsArea.getProvince()); area.setCity(goodsArea.getCity()); area.setDistricts(goodsArea.getDistricts()); @@ -220,12 +233,14 @@ for (GoodsArea goodsArea : goodsAreaList) { List<GoodsArea> goodsAreaList1 = goodsArea.getGoodsAreaList(); for (GoodsArea area : goodsAreaList1) { + area.setGoodsId(goods.getId()); area.setProvince(goodsArea.getProvince()); area.setCity(goodsArea.getCity()); area.setDistricts(goodsArea.getDistricts()); area.setProvinceCode(goodsArea.getProvinceCode()); area.setCityCode(goodsArea.getCityCode()); area.setDistrictsCode(goodsArea.getDistrictsCode()); + goodsAreaList1.add(area); } goodsAreaService.updateBatchById(goodsAreaList1); } -- Gitblit v1.7.1