puzhibing
2024-12-17 74c58e1877ead94a76bfa32baeb74a642988c400
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);
            }