| | |
| | | if(0 == isStudent){ |
| | | isStudent = 2; |
| | | } |
| | | WorldCup worldCup = worldCupService.getById(worldCupPeople.getWorldCupId()); |
| | | if(null == worldCup){ |
| | | return ResultUtil.error("当前比赛不存在"); |
| | | } |
| | | if(worldCup.getStartTime().getTime()>System.currentTimeMillis() || worldCup.getEndTime().getTime()<System.currentTimeMillis()){ |
| | | return ResultUtil.error("二维码仅支持在赛事有效期使用"); |
| | | } |
| | | |
| | | |
| | | |
| | | WorldCupPaymentParticipant worldCupPaymentParticipant = worldCupPaymentParticipantService.getOne(new QueryWrapper<WorldCupPaymentParticipant>() |
| | | .eq("worldCupId", worldCupPeople.getWorldCupId()).eq("participantId", id).eq("participantType", isStudent) |
| | | .orderByDesc("createTime").last(" limit 0, 1")); |
| | |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil startWorldCup(StartWorldCup startWorldCup){ |
| | | return worldCupService.startWorldCup(startWorldCup); |
| | | } |
| | | @ResponseBody |
| | | @PostMapping("/api/worldCup/endWorldCup") |
| | | @ApiOperation(value = "裁判结束比赛【3.1】", tags = {"APP-个人中心"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil endWorldCup(StartWorldCup startWorldCup){ |
| | | return worldCupService.startWorldCup(startWorldCup); |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/worldCup/getWorldCupListFromRank") |
| | | @ApiOperation(value = "获取报名的赛事 排名使用【3.1】", tags = {"APP-个人中心"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<List<WorldCupListVo>> getWorldCupListFromRank(){ |
| | | try { |
| | | Integer uid = tokenUtil.getUserIdFormRedis(); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | List<WorldCupListVo> worldCupRank1 = worldCupCompetitorService.getWorldCupListFromRank(uid); |
| | | return ResultUtil.success(worldCupRank1); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取学员参与数量 |