| | |
| | | import com.dsh.competition.entity.Participant; |
| | | import com.dsh.competition.entity.PaymentCompetition; |
| | | import com.dsh.competition.entity.UserCompetition; |
| | | import com.dsh.competition.feignclient.account.AppUserClient; |
| | | import com.dsh.competition.feignclient.account.model.AppUser; |
| | | import com.dsh.competition.feignclient.model.*; |
| | | import com.dsh.competition.model.CompetitionInfo; |
| | | import com.dsh.competition.model.CompetitionListVo; |
| | |
| | | @Autowired |
| | | private IParticipantService participantService; |
| | | |
| | | @Autowired |
| | | private AppUserClient appUserClient; |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/competition/getPayedCompetitions") |
| | | public List<PaymentCompetition> getAllCompetitionPayRecord(@RequestBody BillingDataRequestVo requestVo){ |
| | | List<Integer> integers = new ArrayList<>(); |
| | | integers.add(1); |
| | | integers.add(2); |
| | | return paymentCompetitionService.list(new QueryWrapper<PaymentCompetition>() |
| | | .in("payType",integers) |
| | | .eq("appUserId",requestVo.getAppUserId()) |
| | | .eq("payStatus",2) |
| | | .between("payTime",requestVo.getMonthStart(),requestVo.getMonthEnd())); |
| | | public BillingRequestVo getAllCompetitionPayRecord(@RequestBody BillingDataRequestVo requestVo){ |
| | | BillingRequestVo billingRequestVo = new BillingRequestVo(); |
| | | List<BillingRequest> integers = new ArrayList<>(); |
| | | integers = paymentCompetitionService.queryDatas(requestVo.getAppUserId(),requestVo.getMonthStart(),requestVo.getMonthEnd()); |
| | | System.out.println(integers); |
| | | if (integers.size() > 0 ){ |
| | | billingRequestVo.setRequests(integers); |
| | | } |
| | | return billingRequestVo; |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/competition/getCancelOrderOfUserPay") |
| | | public List<PaymentCompetition> getCancelOrderOfUserPayRecord(@RequestBody BillingDataRequestVo requestVo){ |
| | | List<Integer> integers = new ArrayList<>(); |
| | | integers.add(1); |
| | | integers.add(2); |
| | | return paymentCompetitionService.list(new QueryWrapper<PaymentCompetition>() |
| | | .in("payType",integers) |
| | | .eq("appUserId",requestVo.getAppUserId()) |
| | | .eq("payStatus",3) |
| | | .between("refundTime",requestVo.getMonthStart(),requestVo.getMonthEnd())); |
| | | public BillingRequestVo getCancelOrderOfUserPayRecord(@RequestBody BillingDataRequestVo requestVo){ |
| | | BillingRequestVo billingRequestVo = new BillingRequestVo(); |
| | | List<BillingRequest> integers = new ArrayList<>(); |
| | | integers = paymentCompetitionService.queryCancelDatas(requestVo.getAppUserId(),requestVo.getMonthStart(),requestVo.getMonthEnd()); |
| | | System.out.println(integers); |
| | | if (integers.size() > 0 ){ |
| | | billingRequestVo.setRequests(integers); |
| | | } |
| | | return billingRequestVo; |
| | | } |
| | | |
| | | |
| | |
| | | @ApiOperation(value = "赛事报名", tags = {"APP-赛事活动列表"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | |
| | | }) |
| | | public ResultUtil paymentCompetition(PaymentCompetitionVo paymentCompetitionVo){ |
| | | try { |
| | |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return cttService.paymentCompetition(uid, paymentCompetitionVo); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | @ResponseBody |
| | | @PostMapping("/api/competition/paymentCompetitionCourseList") |
| | | @ApiOperation(value = "赛事报名--支付可用课时列表", tags = {"APP-赛事活动列表"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | @ApiImplicitParam(value = "赛事id", name = "id", dataType = "int", required = true), |
| | | }) |
| | | public ResultUtil paymentCompetitionCourseList(Integer id){ |
| | | try { |
| | | Integer uid = tokenUtil.getUserIdFormRedis(); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return cttService.paymentCompetitionCourseList(uid, id); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | |
| | | |
| | | @PostMapping("/base/competition/queryById") |
| | | public Competition queryById(Integer id){ |
| | | public Competition queryById(@RequestBody Integer id){ |
| | | try { |
| | | return cttService.getById(id); |
| | | }catch (Exception e){ |
| | |
| | | wrapper.lt(Competition::getEndTime,listQuery.getTime().split(" - ")[1]+" 23:59:59"); |
| | | } |
| | | if(ToolUtil.isNotEmpty(listQuery.getState())){ |
| | | wrapper.eq(Competition::getState,listQuery.getState()); |
| | | wrapper.eq(Competition::getStatus,listQuery.getState()); |
| | | } |
| | | if(ToolUtil.isNotEmpty(listQuery.getRegisterCondition())){ |
| | | wrapper.eq(Competition::getRegisterCondition,listQuery.getRegisterCondition()); |
| | | } |
| | | wrapper.in(Competition::getStoreId,listQuery.getIds()); |
| | | wrapper.eq(Competition::getAuditStatus,2); |
| | | wrapper.orderByDesc(Competition::getInsertTime); |
| | | |
| | | Page<Competition> page = cttService.page(competitionPage, wrapper); |
| | | return page; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return new Page<Competition>(); |
| | | } |
| | | } |
| | | @PostMapping("/base/competition/listAudit") |
| | | public Page<Competition> listAudit(@RequestBody ListQuery listQuery){ |
| | | try { |
| | | Page<Competition> competitionPage = new Page<>(listQuery.getOffset(),listQuery.getLimit()); |
| | | LambdaQueryWrapper<Competition> wrapper = new LambdaQueryWrapper<>(); |
| | | if(ToolUtil.isNotEmpty(listQuery.getProvinceCode())){ |
| | | wrapper.eq(Competition::getProvinceCode,listQuery.getProvinceCode()); |
| | | } |
| | | if(ToolUtil.isNotEmpty(listQuery.getCityCode())){ |
| | | wrapper.eq(Competition::getProvinceCode,listQuery.getCityCode()); |
| | | } |
| | | if(ToolUtil.isNotEmpty(listQuery.getEventName())){ |
| | | wrapper.like(Competition::getName,listQuery.getEventName()); |
| | | } |
| | | if(ToolUtil.isNotEmpty(listQuery.getState())){ |
| | | wrapper.eq(Competition::getAuditStatus,listQuery.getState()); |
| | | } |
| | | if(ToolUtil.isNotEmpty(listQuery.getRegisterCondition())){ |
| | | wrapper.eq(Competition::getRegisterCondition,listQuery.getRegisterCondition()); |
| | | } |
| | | wrapper.in(Competition::getStoreId,listQuery.getIds()); |
| | | ArrayList<Integer> integers = new ArrayList<>(); |
| | | integers.add(1); |
| | | integers.add(3); |
| | | wrapper.in(Competition::getAuditStatus,integers); |
| | | wrapper.orderByDesc(Competition::getInsertTime); |
| | | |
| | | Page<Competition> page = cttService.page(competitionPage, wrapper); |
| | | return page; |
| | | }catch (Exception e){ |
| | |
| | | @PostMapping("/base/competition/add") |
| | | public void add(@RequestBody Competition competition){ |
| | | try { |
| | | competition.setInsertTime(new Date()); |
| | | cttService.save(competition); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | } |
| | | |
| | | |
| | | // @PostMapping("/base/competition/getPeopleFromId") |
| | | // public Page<Participant> getPeopleFromId(@RequestBody GetPeopleQuery getPeopleQuery){ |
| | | // try { |
| | | // Page<Participant> participantPage = new Page<>(); |
| | | // LambdaQueryWrapper<Participant> participantLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | // if(getPeopleQuery.getState()!=null){ |
| | | // participantLambdaQueryWrapper.eq(Participant::getState) |
| | | // } |
| | | // participantService.page() |
| | | // }catch (Exception e){ |
| | | // return null; |
| | | // } |
| | | // } |
| | | @PostMapping("/base/competition/getPeopleFromId") |
| | | public Page<CompetitionUser> getPeopleFromId(@RequestBody GetPeopleQuery getPeopleQuery){ |
| | | try { |
| | | Page<UserCompetition> participantPage = new Page<>(getPeopleQuery.getOffset(),getPeopleQuery.getLimit()); |
| | | Page<CompetitionUser> page = participantService.getPeopleFromId(participantPage,getPeopleQuery.getId(),getPeopleQuery.getState()); |
| | | return page; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |