| | |
| | | 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; |
| | |
| | | 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); |
| | |
| | | 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; |