puzhibing
2024-12-24 7cddb7125f2095facea68c11068e269809ef4108
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/VipCenterController.java
@@ -1,5 +1,6 @@
package com.ruoyi.account.controller;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.account.service.VipCenterService;
import com.ruoyi.account.service.VipSettingService;
@@ -94,12 +95,7 @@
                if (vipGoodList != null && !vipGoodList.isEmpty()) {
                    List<String> goodsNames = new ArrayList<>();
                    vipGoodList.forEach(vipGood -> {
                        Integer goodId = vipGood.getGoodId();
                        R<Goods> goodsR = goodsClient.getGoodsById(goodId);
                        if (R.isError(goodsR)) {
                         throw new ServiceException("商品信息获取失败");
                        }
                        Goods goods = goodsR.getData();
                        Goods goods = JSON.parseObject(vipGood.getGood_json(), Goods.class);
                        goodsNames.add(goods.getName());
                    });
                    level.setGoodsNames(goodsNames);
@@ -130,7 +126,7 @@
    private Map<Integer, R<GoodsVip>> getGoodsVips(List<Integer> vipIds) {
        Map<Integer, R<GoodsVip>> result = new HashMap<>();
        for (Integer vipId : vipIds) {
            R<GoodsVip> goodsVipR = goodsVipClient.getGoodsVip(vipId);
            R<GoodsVip> goodsVipR = goodsVipClient.getGoodsVip(null, vipId);
            result.put(vipId, goodsVipR);
        }
        return result;