| | |
| | | |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.poi.excel.ExcelUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.OutputStream; |
| | | import java.io.PrintWriter; |
| | | import java.text.DateFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.concurrent.CompletionService; |
| | |
| | | public ResultUtil<List<CompetitionListVo>> queryCompetitionList(String cityCode, String content, Integer registerCondition, String heat){ |
| | | try { |
| | | List<CompetitionListVo> competitionListVos = cttService.queryCompetitionList(cityCode, content, registerCondition, heat); |
| | | return ResultUtil.success(competitionListVos); |
| | | List<CompetitionListVo> filteredList = competitionListVos.stream() |
| | | .filter(vo -> vo.getStatus() == 1 || vo.getStatus() == 2) |
| | | .collect(Collectors.toList()); |
| | | |
| | | return ResultUtil.success(filteredList); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | CompetitionInfo competitionInfo = cttService.queryCompetitionInfo(uid, id, lon, lat); |
| | | |
| | | |
| | | String dateString = competitionInfo.getRegisterEndTime(); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
| | | Date date = sdf.parse(dateString); |
| | | if (new Date().after(date)){ |
| | | competitionInfo.setHasPass(1); |
| | | }else { |
| | | competitionInfo.setHasPass(0); |
| | | |
| | | } |
| | | |
| | | |
| | | return ResultUtil.success(competitionInfo); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | if (byId.getRegisterCondition()==3){ |
| | | Integer counts = coursePackagePaymentClient.isHave(uid); |
| | | Integer counts = coursePackagePaymentClient.isHave(paymentCompetitionVo.getIds()); |
| | | if (counts==0){ |
| | | return new ResultUtil(0,"当前赛事仅限已购课学员报名"); |
| | | } |
| | |
| | | wrapper.like(Competition::getName,listQuery.getEventName()); |
| | | } |
| | | if(ToolUtil.isNotEmpty(listQuery.getTime())){ |
| | | wrapper.gt(Competition::getStartTime,listQuery.getTime().split(" - ")[0]+" 00:00:00"); |
| | | wrapper.lt(Competition::getEndTime,listQuery.getTime().split(" - ")[1]+" 23:59:59"); |
| | | wrapper.lt(Competition::getStartTime,listQuery.getTime().split(" - ")[0]+" 00:00:00"); |
| | | wrapper.gt(Competition::getEndTime,listQuery.getTime().split(" - ")[1]+" 23:59:59"); |
| | | } |
| | | if(ToolUtil.isNotEmpty(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); |
| | |
| | | wrapper.eq(Competition::getProvinceCode,listQuery.getProvinceCode()); |
| | | } |
| | | if(ToolUtil.isNotEmpty(listQuery.getCityCode())){ |
| | | wrapper.eq(Competition::getProvinceCode,listQuery.getCityCode()); |
| | | wrapper.eq(Competition::getCityCode,listQuery.getCityCode()); |
| | | } |
| | | if(ToolUtil.isNotEmpty(listQuery.getEventName())){ |
| | | wrapper.like(Competition::getName,listQuery.getEventName()); |
| | |
| | | e.printStackTrace(); |
| | | return null; |
| | | } |
| | | } |
| | | @PostMapping("/base/competition/getPeoples") |
| | | @ResponseBody |
| | | public List<CompetitionUser> getPeoples(@RequestBody GetPeopleQuery getPeopleQuery){ |
| | | List<CompetitionUser> list = participantService.getPeoples( |
| | | getPeopleQuery.getId(),getPeopleQuery.getState()); |
| | | return list; |
| | | } |
| | | |
| | | |
| | |
| | | map.put("monthsUser",monthsUser); |
| | | |
| | | return map; |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| | | |