phpcjl
2024-12-13 cd993463b138f91e9216b01f6182b9afe06d2b5c
1.后台管理-评论
2.后台管理-门店特殊价
1个文件已修改
19 ■■■■ 已修改文件
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/VipCenterController.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/VipCenterController.java
@@ -10,10 +10,7 @@
import com.ruoyi.common.core.utils.bean.BeanUtils;
import com.ruoyi.common.security.service.TokenService;
import com.ruoyi.other.api.domain.*;
import com.ruoyi.other.api.feignClient.BaseSettingClient;
import com.ruoyi.other.api.feignClient.GoodsVipClient;
import com.ruoyi.other.api.feignClient.RemoteVipSettingClient;
import com.ruoyi.other.api.feignClient.VipGoodClient;
import com.ruoyi.other.api.feignClient.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@@ -46,6 +43,8 @@
    private VipCenterService vipCenterService;
    @Resource
    private VipGoodClient vipGoodClient;
    @Resource
    private GoodsClient goodsClient;
    @GetMapping("getVipLevelList")
@@ -95,13 +94,13 @@
                if (vipGoodList != null && !vipGoodList.isEmpty()) {
                    List<String> goodsNames = new ArrayList<>();
                    vipGoodList.forEach(vipGood -> {
                        String goodJson = vipGood.getGoodJson();
                        if (isValidJson(goodJson)) {
                            Goods goods = JSONObject.parseObject(goodJson, Goods.class);
                            goodsNames.add(goods.getName());
                        } else {
                            log.warn("JSON无效: " + goodJson);
                        Integer goodId = vipGood.getGoodId();
                        R<Goods> goodsR = goodsClient.getGoodsById(goodId);
                        if (R.isError(goodsR)) {
                         throw new ServiceException("商品信息获取失败");
                        }
                        Goods goods = goodsR.getData();
                        goodsNames.add(goods.getName());
                    });
                    level.setGoodsNames(goodsNames);
                }