| | |
| | | import com.ruoyi.goods.vo.TGoodsVO; |
| | | import com.ruoyi.study.api.domain.TUser; |
| | | import com.ruoyi.study.api.feignClient.StudyClient; |
| | | import com.ruoyi.system.api.model.LoginUserParent; |
| | | import org.redisson.api.RSemaphore; |
| | | import org.redisson.api.RedissonClient; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | } |
| | | // 校验用户积分是否足够兑换 |
| | | TUser user = studyClient.userInfo().getData(); |
| | | LoginUserParent loginUser1 = tokenService.getLoginUser1(); |
| | | if (user == null){ |
| | | user = studyClient.getUserById(loginUser1.getUserid()).getData(); |
| | | } |
| | | |
| | | int needIntegral = good.getIntegral() * number; |
| | | if (user.getIntegral() < needIntegral) { |
| | | throw new GlobalException("兑换失败,当前剩余积分不足!"); |