| | |
| | | List<TStore> operatorId = storeService.list(new QueryWrapper<TStore>().eq("operatorId", objectId)); |
| | | model.addAttribute("stores",operatorId); |
| | | if (UserExt.getUser().getObjectType()==2){ |
| | | |
| | | // 查询这个运营商管理的省 |
| | | TOperator id = tOperatorService.getOne(new QueryWrapper<TOperator>().eq("id", UserExt.getUser().getObjectId())); |
| | | if (id.getType()==1){ |
| | |
| | | model.addAttribute("province",list4); |
| | | } |
| | | model.addAttribute("operator",objectId); |
| | | // 查询当前运营商管理了哪些门店 |
| | | List<TStore> stores = storeService |
| | | .list(new QueryWrapper<TStore>() |
| | | .eq("operatorId", UserExt.getUser().getObjectId())); |
| | | model.addAttribute("stores",stores); |
| | | } |
| | | if (UserExt.getUser().getObjectType()==1) |
| | | model.addAttribute("operator",0); |
| | | if (UserExt.getUser().getObjectType()==1) model.addAttribute("operator",0); |
| | | TStore byId = storeService.getById(UserExt.getUser().getObjectId()); |
| | | if (UserExt.getUser().getObjectType()==3) model.addAttribute("operator",byId.getOperatorId()); |
| | | List<TOperator> list2 = tOperatorService.list(); |
| | | model.addAttribute("yysList",list2); |
| | | return PREFIX + "TCompetition_add.html"; |
| | | } |
| | | |
| | |
| | | ids = operatorId; |
| | | } |
| | | Page<Competition> page = new PageFactory<Competition>().defaultPage(); |
| | | ListQuery listQuery = new ListQuery(page.getSize(),page.getCurrent(),provinceCode,cityCode,eventName,time,state,registerCondition,ids); |
| | | ListQuery listQuery = new ListQuery(page.getSize(),page.getCurrent(),provinceCode,cityCode,eventName,time,state,registerCondition,ids,UserExt.getUser().getObjectType()); |
| | | 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); |
| | |
| | | public Object listUser(@PathVariable Integer id,Integer state) { |
| | | try { |
| | | Page<Object> page = new PageFactory<>().defaultPage(); |
| | | Page<CompetitionUser> data = competitionClient.getPeopleFromId |
| | | Page<CompetitionUser> data = competitionClient.getPeopleFromId |
| | | (new GetPeopleQuery(page.getSize(),page.getCurrent(),id,state)); |
| | | return super.packForBT(data); |
| | | }catch (Exception e){ |
| | |
| | | |
| | | if (UserExt.getUser().getObjectType() == 1){ |
| | | competition.setAuditStatus(2); |
| | | }else { |
| | | }else if (UserExt.getUser().getObjectType() == 2){ |
| | | competition.setAuditStatus(1); |
| | | competition.setOperatorId(UserExt.getUser().getObjectId()); |
| | | } |
| | | |
| | | // SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | |
| | | |
| | | |
| | | @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(); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |