| | |
| | | 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; |
| | |
| | | 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 |
| | |
| | | VipSetting vipSetting = vipSettingService.getVipSettingById(4); |
| | | // 获取通过消费积分达成会员等级的开关 |
| | | Integer vipLevelUpShopRole = vipSetting.getVipLevelUpShopRole(); |
| | | if (vipLevelUpShopRole == 1){ |
| | | if (null != vipLevelUpShopRole && vipLevelUpShopRole == 1){ |
| | | // 消费积分阈值 |
| | | Integer vipLevelUpShop = vipSetting.getVipLevelUpShop(); |
| | | // 返佣积分阈值 |
| | |
| | | } |
| | | |
| | | Integer vipLevelUpNumRole = vipSetting.getVipLevelUpNumRole(); |
| | | if (vipLevelUpNumRole == 1){ |
| | | if (null != vipLevelUpNumRole && vipLevelUpNumRole == 1){ |
| | | // 直推钻石用户数阈值 |
| | | Integer vipDirectNum = vipSetting.getVipDirectNum(); |
| | | // 获取用户直推钻石用户数量 |
| | |
| | | List<VipGood> vipGoods = vipGoodsByVipId.getData(); |
| | | if (CollectionUtil.isNotEmpty(vipGoods)){ |
| | | for (VipGood vipGood : vipGoods) { |
| | | String goodJson = vipGood.getGoodJson(); |
| | | Goods goods = JSONObject.parseObject(goodJson, Goods.class); |
| | | 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(); |
| | |
| | | VipSetting vipSetting = vipSettingService.getVipSettingById(5); |
| | | // 获取通过消费积分达成会员等级的开关 |
| | | Integer vipLevelUpShopRole = vipSetting.getVipLevelUpShopRole(); |
| | | if (vipLevelUpShopRole == 1){ |
| | | if (null != vipLevelUpShopRole && vipLevelUpShopRole == 1){ |
| | | // 消费积分阈值 |
| | | Integer vipLevelUpShop = vipSetting.getVipLevelUpShop(); |
| | | // 返佣积分阈值 |
| | |
| | | } |
| | | |
| | | Integer vipLevelUpNumRole = vipSetting.getVipLevelUpNumRole(); |
| | | if (vipLevelUpNumRole == 1){ |
| | | if (null != vipLevelUpNumRole && vipLevelUpNumRole == 1){ |
| | | // 直推钻石用户数阈值 |
| | | Integer vipDirectNum = vipSetting.getVipDirectNum(); |
| | | // 获取用户直推钻石用户数量 |
| | |
| | | List<VipGood> vipGoods = vipGoodsByVipId.getData(); |
| | | if (CollectionUtil.isNotEmpty(vipGoods)){ |
| | | for (VipGood vipGood : vipGoods) { |
| | | String goodJson = vipGood.getGoodJson(); |
| | | Goods goods = JSONObject.parseObject(goodJson, Goods.class); |
| | | 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(); |
| | |
| | | Integer sharePoint = appUser.getSharePoint(); |
| | | // 获取通过消费积分达成会员等级的开关 |
| | | Integer vipLevelUpShopRole = vipSetting.getVipLevelUpShopRole(); |
| | | if (vipLevelUpShopRole == 1){ |
| | | if (null != vipLevelUpShopRole && vipLevelUpShopRole == 1){ |
| | | // 消费积分阈值 |
| | | Integer vipLevelUpShop = vipSetting.getVipLevelUpShop(); |
| | | // 返佣积分阈值 |
| | |
| | | } |
| | | |
| | | Integer vipLevelUpNumRole = vipSetting.getVipLevelUpNumRole(); |
| | | if (vipLevelUpNumRole == 1){ |
| | | if (null != vipLevelUpNumRole && vipLevelUpNumRole == 1){ |
| | | // 直推代理用户数阈值 |
| | | Integer vipDirectNum = vipSetting.getVipDirectNum(); |
| | | // 准代理用户数阈值 |
| | |
| | | List<VipGood> vipGoods = vipGoodsByVipId.getData(); |
| | | if (CollectionUtil.isNotEmpty(vipGoods)){ |
| | | for (VipGood vipGood : vipGoods) { |
| | | String goodJson = vipGood.getGoodJson(); |
| | | Goods goods = JSONObject.parseObject(goodJson, Goods.class); |
| | | 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(); |
| | |
| | | VipSetting vipSetting = vipSettingService.getVipSettingById(7); |
| | | // 获取通过消费积分达成会员等级的开关 |
| | | Integer vipLevelUpShopRole = vipSetting.getVipLevelUpShopRole(); |
| | | if (vipLevelUpShopRole == 1){ |
| | | if (null != vipLevelUpShopRole && vipLevelUpShopRole == 1){ |
| | | // 消费积分阈值 |
| | | Integer vipLevelUpShop = vipSetting.getVipLevelUpShop(); |
| | | // 返佣积分阈值 |
| | |
| | | } |
| | | |
| | | Integer vipLevelUpNumRole = vipSetting.getVipLevelUpNumRole(); |
| | | if (vipLevelUpNumRole == 1){ |
| | | if (null != vipLevelUpNumRole && vipLevelUpNumRole == 1){ |
| | | // 直推代理用户数阈值 |
| | | Integer vipDirectNum = vipSetting.getVipDirectNum(); |
| | | // 准代理用户数阈值 |
| | |
| | | |
| | | @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); |