| | |
| | | @ResponseBody |
| | | @RequestMapping("/base/competition/listAllPayment") |
| | | public List<PaymentCompetition> listAllPayment(@RequestBody CompetitionQuery query){ |
| | | Integer operatorId1 = query.getOperatorId(); |
| | | if (operatorId1!=null){ |
| | | // 赛事集合id |
| | | List<Integer> operatorId = cttService.list(new QueryWrapper<Competition>() |
| | | .eq("operatorId", operatorId1)).stream().map(Competition::getId).collect(Collectors.toList()); |
| | | query.setUserIds(operatorId); |
| | | } |
| | | List<PaymentCompetition> paymentCompetitions = paymentCompetitionService.listAll(query); |
| | | List<PaymentCompetition> result = new ArrayList<>(); |
| | | if (query.getOperatorId()!=null){ |
| | |
| | | |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | private CompetitionService competitionService; |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/competition/paymentCompetition") |
| | | @ApiOperation(value = "赛事报名", tags = {"APP-赛事活动列表"}) |
| | |
| | | }) |
| | | public ResultUtil paymentCompetition(PaymentCompetitionVo paymentCompetitionVo){ |
| | | 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,"已超过截至报名时间"); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | Integer uid = tokenUtil.getUserIdFormRedis(); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | |
| | | |
| | | |
| | | return cttService.paymentCompetition(uid, paymentCompetitionVo); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |