| | |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import sun.rmi.runtime.Log; |
| | | |
| | | import javax.jws.soap.SOAPBinding; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.OutputStream; |
| | | import java.text.DateFormat; |
| | |
| | | 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.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{ |
| | |
| | | |
| | | @RequestMapping(value = "/listUser/{id}") |
| | | @ResponseBody |
| | | public Object listUser(@PathVariable Integer id,Integer state) { |
| | | public Object listUser(@PathVariable Integer id,Integer state, Integer offset,Integer limit) { |
| | | try { |
| | | Page<Object> page = new PageFactory<>().defaultPage(); |
| | | Page<CompetitionUser> data = competitionClient.getPeopleFromId |
| | | (new GetPeopleQuery(page.getSize(),page.getCurrent(),id,state)); |
| | | return super.packForBT(data); |
| | | // Page<Object> page = new PageFactory<>().defaultPage(); |
| | | // Page<CompetitionUser> data = competitionClient.getPeopleFromId(new GetPeopleQuery(limit,offset,id,state)); |
| | | List <CompetitionUser> data = competitionClient.getPeopleFromId1(new GetPeopleQuery(limit,offset,id,state)); |
| | | return data; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | |
| | | |
| | | |
| | | @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(); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |