luodangjia
2024-12-16 a8d2cb07f6440dc54dc4005b0b06d5a47cb1517d
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java
@@ -164,12 +164,20 @@
        goodsMapper.insert(goods);
        // 指定门店
        List<GoodsShop> goodsShopList = goods.getGoodsShopList();
        goodsShopService.saveBatch(goodsShopList);
        Integer appointStore = goods.getAppointStore();
        if (appointStore == 1){
            List<GoodsShop> goodsShopList = goods.getGoodsShopList();
            if (CollectionUtils.isEmpty(goodsShopList)){
                throw new NullPointerException("请选择指定门店");
            }
            goodsShopService.saveBatch(goodsShopList);
        }
        // 指定用户
        List<GoodsAppUser> goodsAppUserList = goods.getGoodsAppUserList();
        goodsAppUserService.saveBatch(goodsAppUserList);
        if (!CollectionUtils.isEmpty(goodsAppUserList)){
            goodsAppUserService.saveBatch(goodsAppUserList);
        }
        // 会员价格配置
        List<GoodsVip> goodsVipList = goods.getGoodsVipList();
@@ -177,7 +185,9 @@
        // 特殊地区售价设置
        List<GoodsArea> goodsAreaList = goods.getGoodsAreaList();
        goodsAreaService.saveBatch(goodsAreaList);
        if (!CollectionUtils.isEmpty(goodsAreaList)){
            goodsAreaService.saveBatch(goodsAreaList);
        }
    }
    @Override