| | |
| | | import com.dsh.competition.entity.UserCompetition; |
| | | import com.dsh.competition.feignclient.account.AppUserClient; |
| | | import com.dsh.competition.feignclient.account.StudentClient; |
| | | import com.dsh.competition.feignclient.account.StudentHonorClient; |
| | | import com.dsh.competition.feignclient.account.model.AppUser; |
| | | import com.dsh.competition.feignclient.account.model.StudentHonor; |
| | | import com.dsh.competition.feignclient.account.model.TStudent; |
| | | import com.dsh.competition.feignclient.course.CoursePackagePaymentClient; |
| | | import com.dsh.competition.feignclient.course.model.PaymentDeductionClassHour; |
| | |
| | | |
| | | @Autowired |
| | | private AppUserClient appUserClient; |
| | | |
| | | @Resource |
| | | private StudentHonorClient studentHonorClient; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据门店ids 获取对应的赛事 根据赛事支付记录获取用户ids |
| | |
| | | try { |
| | | Competition byId = competitionService.getById(paymentCompetitionVo.getId()); |
| | | Date date = byId.getEndTime(); |
| | | // Assuming you have a Date object |
| | | // Check if the date is past the current time |
| | | boolean isPast = date.after(new Date()); |
| | | if (!isPast) { |
| | | return new ResultUtil(0, "已超过截至报名时间"); |
| | |
| | | } else { |
| | | competition.setStatus(3); |
| | | } |
| | | |
| | | if(competition.getStatus() == 2){ |
| | | //添加勋章数据 |
| | | List<PaymentCompetition> list = paymentCompetitionService.list(new QueryWrapper<PaymentCompetition>() |
| | | .eq("competitionId", competition.getId()).eq("payStatus", 2).eq("state", 1)); |
| | | Set<Integer> collect = list.stream().map(PaymentCompetition::getAppUserId).collect(Collectors.toSet()); |
| | | for (Integer integer : collect) { |
| | | int count = paymentCompetitionService.count(new QueryWrapper<PaymentCompetition>() |
| | | .eq("appUserId", integer).eq("payStatus", 2).eq("state", 1)); |
| | | StudentHonor studentHonor = new StudentHonor(); |
| | | studentHonor.setAppUserId(integer); |
| | | studentHonor.setHonorType(2); |
| | | studentHonor.setNumber(count); |
| | | studentHonorClient.saveStudentHonor(studentHonor); |
| | | } |
| | | } |
| | | } |
| | | competition.setInsertTime(new Date()); |
| | | cttService.save(competition); |
| | | |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | } else { |
| | | competition.setStatus(3); |
| | | } |
| | | |
| | | if(competition.getStatus() == 2){ |
| | | //添加勋章数据 |
| | | List<PaymentCompetition> list = paymentCompetitionService.list(new QueryWrapper<PaymentCompetition>() |
| | | .eq("competitionId", competition.getId()).eq("payStatus", 2).eq("state", 1)); |
| | | Set<Integer> collect = list.stream().map(PaymentCompetition::getAppUserId).collect(Collectors.toSet()); |
| | | for (Integer integer : collect) { |
| | | int count = paymentCompetitionService.count(new QueryWrapper<PaymentCompetition>() |
| | | .eq("appUserId", integer).eq("payStatus", 2).eq("state", 1)); |
| | | StudentHonor studentHonor = new StudentHonor(); |
| | | studentHonor.setAppUserId(integer); |
| | | studentHonor.setHonorType(2); |
| | | studentHonor.setNumber(count); |
| | | studentHonorClient.saveStudentHonor(studentHonor); |
| | | } |
| | | } |
| | | } |
| | | cttService.updateById(competition); |
| | | |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |