| | |
| | | ListQuery listQuery = new ListQuery(page.getSize(),page.getCurrent(),provinceCode,cityCode,eventName,time,state,registerCondition,ids); |
| | | Page<Competition> competitions = competitionClient.list(listQuery); |
| | | List<Competition> records = new ArrayList<>(); |
| | | for (Competition competition : competitions.getRecords()) { |
| | | // 当前时间小于开始时间 |
| | | if (competition.getStartTime().after(new Date())){ |
| | | competition.setStatus(1); |
| | | } |
| | | if (competition.getStartTime().before(new Date())){ |
| | | if (competition.getEndTime().after(new Date())){ |
| | | competition.setStatus(2); |
| | | }else{ |
| | | competition.setStatus(3); |
| | | } |
| | | } |
| | | if (competition.getStatus()!=state && state != null){ |
| | | }else{ |
| | | records.add(competition); |
| | | } |
| | | for (TStore tStore : list) { |
| | | String[] split = competition.getStoreId().split(","); |
| | | for (String s : split) { |
| | | if(s.equals(String.valueOf(tStore.getId()))){ |
| | | if (competition.getStoreName()==null){ |
| | | competition.setStoreName(tStore.getName()); |
| | | }else { |
| | | competition.setStoreName(competition.getStoreName()+","+tStore.getName()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | // for (Competition competition : competitions.getRecords()) { |
| | | //// if (competition.getStatus()==4){ |
| | | //// continue; |
| | | //// } |
| | | // |
| | | // // 当前时间小于开始时间 |
| | | // if (competition.getStartTime().after(new Date())){ |
| | | // competition.setStatus(1); |
| | | // } |
| | | // if (competition.getStartTime().before(new Date())){ |
| | | // |
| | | // |
| | | // if (competition.getEndTime().after(new Date())){ |
| | | // competition.setStatus(2); |
| | | // }else{ |
| | | // competition.setStatus(3); |
| | | // } |
| | | // } |
| | | // if (competition.getStatus()!=state && state != null){ |
| | | // }else{ |
| | | // records.add(competition); |
| | | // } |
| | | // for (TStore tStore : list) { |
| | | // String[] split = competition.getStoreId().split(","); |
| | | // for (String s : split) { |
| | | // if(s.equals(String.valueOf(tStore.getId()))){ |
| | | // if (competition.getStoreName()==null){ |
| | | // competition.setStoreName(tStore.getName()); |
| | | // }else { |
| | | // competition.setStoreName(competition.getStoreName()+","+tStore.getName()); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | competitions.setRecords(records); |
| | | System.err.println(competitions.getRecords()); |
| | | return super.packForBT(competitions); |
| | |
| | | |
| | | |
| | | @RequestMapping(value = "/cancel") |
| | | public Object cancel(Integer id) { |
| | | public Object cancel(Integer TCompetitionId) { |
| | | try { |
| | | competitionClient.cancel(id); |
| | | competitionClient.cancel(TCompetitionId); |
| | | return SUCCESS_TIP; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |