package com.ruoyi.account.service.impl;
|
|
import cn.hutool.core.collection.CollectionUtil;
|
import com.alibaba.fastjson2.JSONObject;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.ruoyi.account.api.model.AppUser;
|
import com.ruoyi.account.service.AppUserService;
|
import com.ruoyi.account.service.VipCenterService;
|
import com.ruoyi.account.service.VipSettingService;
|
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.order.feignClient.RemoteOrderGoodsClient;
|
import com.ruoyi.order.model.Order;
|
import com.ruoyi.other.api.domain.Goods;
|
import com.ruoyi.other.api.domain.VipGood;
|
import com.ruoyi.other.api.domain.VipSetting;
|
import com.ruoyi.other.api.feignClient.VipGoodClient;
|
import org.springframework.stereotype.Service;
|
|
import javax.annotation.Resource;
|
import java.util.List;
|
import java.util.stream.Collectors;
|
|
@Service
|
public class VipCenterServiceImpl implements VipCenterService {
|
@Resource
|
private AppUserService appUserService;
|
@Resource
|
private RemoteOrderGoodsClient remoteOrderGoodsClient;
|
@Resource
|
private VipGoodClient vipGoodClient;
|
@Resource
|
private VipSettingService vipSettingService;
|
|
@Override
|
public Boolean checkReadyToBeProxy(Long userId,Integer vipId) {
|
AppUser appUser = appUserService.getById(userId);
|
// 消费积分
|
Integer shopPoint = appUser.getShopPoint();
|
// 返佣积分
|
Integer sharePoint = appUser.getSharePoint();
|
// 准代理会员设置
|
VipSetting vipSetting = vipSettingService.getVipSettingById(4);
|
// 消费积分阈值
|
Integer vipLevelUpShop = vipSetting.getVipLevelUpShop();
|
// 返佣积分阈值
|
Integer vipLevelUpShare = vipSetting.getVipLevelUpShare();
|
if (shopPoint >=vipLevelUpShop && sharePoint >= vipLevelUpShare){
|
return true;
|
}
|
// 直推钻石用户数阈值
|
Integer vipDirectNum = vipSetting.getVipDirectNum();
|
// 获取用户直推钻石用户数量
|
long userDiamondsCount = appUserService.count(new LambdaQueryWrapper<AppUser>()
|
.eq(AppUser::getInviteUserId, userId)
|
.eq(AppUser::getVipId, 3));
|
return false;
|
}
|
|
@Override
|
public Boolean checkReadyToBeAgent(Long userId) {
|
return false;
|
}
|
|
@Override
|
public Boolean checkReadyToBeTotalAgent(Long userId) {
|
return false;
|
}
|
|
@Override
|
public Boolean checkReadyToBePartner(Long userId) {
|
return false;
|
}
|
}
|