puzhibing
2024-12-17 91d448f7f2e396f76b2fec0df8881b574d40baa1
合并代码
2个文件已修改
21 ■■■■■ 已修改文件
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/VipSettingController.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/VipSettingController.java
@@ -9,6 +9,7 @@
import com.ruoyi.other.api.domain.VipGood;
import com.ruoyi.other.api.domain.VipSetting;
import com.ruoyi.other.api.feignClient.GoodsClient;
import com.ruoyi.other.dto.SetDto;
import com.ruoyi.other.dto.VipSetDto;
import com.ruoyi.other.service.BaseSettingService;
import com.ruoyi.other.service.VipGoodService;
@@ -195,8 +196,8 @@
    }
    @PostMapping("/manage/level/set")
    @ApiOperation(value = "设置", tags = {"后台-会员等级设置"})
    public R<Void> managelevelset(@RequestBody List<VipSetting> vipSettingList) {
        vipSettingService.updateBatchById(vipSettingList);
    public R<Void> managelevelset(@RequestBody SetDto setDto) {
        vipSettingService.updateBatchById(setDto.getVipSettingList());
        return R.ok();
    }
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,12 +198,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.saveBatch(goodsAreaList1);
            }
@@ -220,12 +234,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);
            }