| | |
| | | import com.ruoyi.other.api.domain.Shop; |
| | | 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.api.feignClient.ShopClient; |
| | | import com.ruoyi.other.api.feignClient.VipGoodClient; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | |
| | | private ShopClient shopClient; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private GoodsClient goodsClient; |
| | | |
| | | |
| | | @Override |
| | |
| | | List<VipGood> vipGoods = vipGoodsByVipId.getData(); |
| | | if (CollectionUtil.isNotEmpty(vipGoods)){ |
| | | for (VipGood vipGood : vipGoods) { |
| | | String goodJson = vipGood.getGoodJson(); |
| | | Goods goods = JSONObject.parseObject(goodJson, Goods.class); |
| | | Integer goodId = vipGood.getGoodId(); |
| | | R<Goods> goodsR = goodsClient.getGoodsById(goodId); |
| | | if (R.isError(goodsR)){ |
| | | throw new ServiceException("商品信息获取失败"); |
| | | } |
| | | Goods goods = goodsR.getData(); |
| | | R<List<Order>> orderListByUserIdAndGoodsId = remoteOrderGoodsClient.getOrderListByUserIdAndGoodsId(userId, goods.getId()); |
| | | if (R.isSuccess(orderListByUserIdAndGoodsId)){ |
| | | List<Order> orderList = orderListByUserIdAndGoodsId.getData(); |
| | |
| | | List<VipGood> vipGoods = vipGoodsByVipId.getData(); |
| | | if (CollectionUtil.isNotEmpty(vipGoods)){ |
| | | for (VipGood vipGood : vipGoods) { |
| | | String goodJson = vipGood.getGoodJson(); |
| | | Goods goods = JSONObject.parseObject(goodJson, Goods.class); |
| | | R<Goods> goodsR = goodsClient.getGoodsById(vipGood.getGoodId()); |
| | | if (R.isError(goodsR)){ |
| | | throw new ServiceException("商品信息获取失败"); |
| | | } |
| | | |
| | | Goods goods = goodsR.getData(); |
| | | R<List<Order>> orderListByUserIdAndGoodsId = remoteOrderGoodsClient.getOrderListByUserIdAndGoodsId(userId, goods.getId()); |
| | | if (R.isSuccess(orderListByUserIdAndGoodsId)){ |
| | | List<Order> orderList = orderListByUserIdAndGoodsId.getData(); |
| | |
| | | List<VipGood> vipGoods = vipGoodsByVipId.getData(); |
| | | if (CollectionUtil.isNotEmpty(vipGoods)){ |
| | | for (VipGood vipGood : vipGoods) { |
| | | String goodJson = vipGood.getGoodJson(); |
| | | Goods goods = JSONObject.parseObject(goodJson, Goods.class); |
| | | R<Goods> goodsR = goodsClient.getGoodsById(vipGood.getGoodId()); |
| | | if (R.isError(goodsR)){ |
| | | throw new ServiceException("商品信息获取失败"); |
| | | } |
| | | Goods goods = goodsR.getData(); |
| | | R<List<Order>> orderListByUserIdAndGoodsId = remoteOrderGoodsClient.getOrderListByUserIdAndGoodsId(userId, goods.getId()); |
| | | if (R.isSuccess(orderListByUserIdAndGoodsId)){ |
| | | List<Order> orderList = orderListByUserIdAndGoodsId.getData(); |