Pu Zhibing
2024-12-26 1dd7045966f82add2346aee6db8c7035e7f54d97
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/VipCenterServiceImpl.java
@@ -1,6 +1,7 @@
package com.ruoyi.account.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.account.api.model.AppUser;
@@ -87,12 +88,7 @@
            List<VipGood> vipGoods = vipGoodsByVipId.getData();
            if (CollectionUtil.isNotEmpty(vipGoods)){
                for (VipGood vipGood : vipGoods) {
                    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);
                    R<List<Order>> orderListByUserIdAndGoodsId = remoteOrderGoodsClient.getOrderListByUserIdAndGoodsId(userId, goods.getId());
                    if (R.isSuccess(orderListByUserIdAndGoodsId)){
                        List<Order> orderList = orderListByUserIdAndGoodsId.getData();
@@ -149,12 +145,7 @@
            List<VipGood> vipGoods = vipGoodsByVipId.getData();
            if (CollectionUtil.isNotEmpty(vipGoods)){
                for (VipGood vipGood : vipGoods) {
                    R<Goods> goodsR = goodsClient.getGoodsById(vipGood.getGoodId());
                    if (R.isError(goodsR)){
                        throw new ServiceException("商品信息获取失败");
                    }
                    Goods goods = goodsR.getData();
                    Goods goods = JSON.parseObject(vipGood.getGood_json(), Goods.class);
                    R<List<Order>> orderListByUserIdAndGoodsId = remoteOrderGoodsClient.getOrderListByUserIdAndGoodsId(userId, goods.getId());
                    if (R.isSuccess(orderListByUserIdAndGoodsId)){
                        List<Order> orderList = orderListByUserIdAndGoodsId.getData();
@@ -226,11 +217,7 @@
            List<VipGood> vipGoods = vipGoodsByVipId.getData();
            if (CollectionUtil.isNotEmpty(vipGoods)){
                for (VipGood vipGood : vipGoods) {
                    R<Goods> goodsR = goodsClient.getGoodsById(vipGood.getGoodId());
                    if (R.isError(goodsR)){
                        throw new ServiceException("商品信息获取失败");
                    }
                    Goods goods = goodsR.getData();
                    Goods goods = JSON.parseObject(vipGood.getGood_json(), Goods.class);
                    R<List<Order>> orderListByUserIdAndGoodsId = remoteOrderGoodsClient.getOrderListByUserIdAndGoodsId(userId, goods.getId());
                    if (R.isSuccess(orderListByUserIdAndGoodsId)){
                        List<Order> orderList = orderListByUserIdAndGoodsId.getData();
@@ -324,7 +311,7 @@
    @Override
    public Boolean check(Integer type) {
        LoginUser loginUser = tokenService.getLoginUser();
        LoginUser loginUser = tokenService.getLoginUserApplet();
        Long userid = loginUser.getUserid();
        if (type == 4){
            return checkReadyToBeProxy(userid, type);