| | |
| | | import com.dsh.competition.feignclient.account.model.Student; |
| | | import com.dsh.competition.feignclient.course.CoursePackagePaymentClient; |
| | | import com.dsh.competition.feignclient.course.model.PaymentDeductionClassHour; |
| | | import com.dsh.competition.feignclient.model.CompetitionUser; |
| | | import com.dsh.competition.feignclient.other.StoreClient; |
| | | import com.dsh.competition.feignclient.other.model.Store; |
| | | import com.dsh.competition.mapper.CompetitionMapper; |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 赛事报名 |
| | | * @param uid |
| | |
| | | AppUser appUser = appUserClient.queryAppUser(uid); |
| | | String[] split = paymentCompetitionVo.getIds().split(";"); |
| | | Competition competition = this.getById(paymentCompetitionVo.getId()); |
| | | if ((competition.getBaseNumber()+split.length)>competition.getApplicantsNumber()){ |
| | | int competitionId = userCompetitionService.count(new QueryWrapper<UserCompetition>().eq("competitionId", paymentCompetitionVo.getId())); |
| | | if ((competitionId+split.length)>competition.getApplicantsNumber()){ |
| | | return ResultUtil.error("报名人数超过最大限制"); |
| | | |
| | | } |
| | | BigDecimal money = null; |
| | | if(paymentCompetitionVo.getPayType() == 1 || paymentCompetitionVo.getPayType() == 2){ |
| | |
| | | if(paymentCompetitionVo.getPayType() == 3){//玩湃币 |
| | | money = new BigDecimal(competition.getPlayPaiCoin()).multiply(new BigDecimal(split.length)).setScale(2, RoundingMode.HALF_EVEN); |
| | | if(money.compareTo(new BigDecimal(appUser.getPlayPaiCoins())) > 0){ |
| | | return ResultUtil.error("报名失败,玩湃币不足,请充值"); |
| | | |
| | | return new ResultUtil(2,"报名失败,玩湃币不足,请充值"); |
| | | } |
| | | } |
| | | if(paymentCompetitionVo.getPayType() == 4){//课程 |
| | |
| | | // 2.0 |
| | | Integer integer = coursePackagePaymentClient.queryResidueClassHourById(paymentCompetitionVo.getCoursePaymentId()); |
| | | if(new BigDecimal(integer).compareTo(new BigDecimal(competition.getClassPrice())) < 0){ |
| | | return ResultUtil.error( "剩余课时不足,无法完成支付。"); |
| | | return new ResultUtil(3,"剩余课时不足,无法完成支付。"); |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | public void taskSetStatus() { |
| | | this.baseMapper.taskSetStatusStart(); |
| | | this.baseMapper.taskSetStatusEnd(); |
| | | this.baseMapper.deleteTenMinutes(); |
| | | } |
| | | |
| | | @Override |