| | |
| | | package com.ruoyi.other.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.other.mapper.VipSettingMapper; |
| | | import com.ruoyi.other.api.domain.VipSetting; |
| | | import com.ruoyi.other.service.VipSettingService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @Service |
| | | public class VipSettingServiceImpl extends ServiceImpl<VipSettingMapper, VipSetting> implements VipSettingService { |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | |
| | | @Override |
| | | public VipSetting getVipSettingByUserId(Long userId) { |
| | | AppUser appUser = appUserClient.getAppUserById(userId); |
| | | if(null == appUser){ |
| | | throw new ServiceException("用户不存在"); |
| | | } |
| | | return this.getById(appUser.getVipId()); |
| | | } |
| | | |
| | | @Override |
| | | public void downUsers() { |
| | | // //查出可能需要降级的人员 |
| | | // R<List<AppUser>> topUsers = appUserClient.getTopUsers(); |
| | | // //循环判断是否要展示 |
| | | // if (topUsers.getData()!=null && topUsers.getData().size()>0){ |
| | | // for (AppUser appUser : topUsers.getData()){ |
| | | // if (appUser.getVipId()==5){ |
| | | // VipSetting vipSetting = this.baseMapper.selectById(5); |
| | | // if (vipSetting.getKeepBuyPoint()!=null){ |
| | | // //如果消费不为空,查找对应天数的消费积分 |
| | | // |
| | | // //如果消费积分小于保级积分,设置用户降级标志并将降级信息 |
| | | // } |
| | | // |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | //然后设置降级提示 |
| | | |
| | | } |
| | | } |