| | |
| | | @RequestMapping("/tCompetition_add") |
| | | public String tCompetitionAdd(Model model) { |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | model.addAttribute("list",list); |
| | | |
| | | List<TOperator> list1 = tOperatorService.list(); |
| | | model.addAttribute("yysList",list1); |
| | |
| | | // 查询这个运营商管理的省 |
| | | TOperator id = tOperatorService.getOne(new QueryWrapper<TOperator>().eq("id", UserExt.getUser().getObjectId())); |
| | | if (id.getType()==1){ |
| | | // 全国 |
| | | List<TCity> list3 = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | model.addAttribute("province",list3); |
| | | |
| | | }else{ |
| | | // 找到他管理的省 |
| | | List<TOperatorCity> list4 = operatorCityService.list(new QueryWrapper<TOperatorCity>().eq("operatorId", UserExt.getUser().getObjectId()).eq("pid", 0)); |
| | | model.addAttribute("province",list4); |
| | | List<Integer> collect = list4.stream().map(TOperatorCity::getCode).collect(Collectors.toList()); |
| | | list = cityService.list(new LambdaQueryWrapper<TCity>().in(TCity::getCode, collect)); |
| | | } |
| | | model.addAttribute("operator",objectId); |
| | | // 查询当前运营商管理了哪些门店 |
| | |
| | | if (UserExt.getUser().getObjectType()==3) model.addAttribute("operator",byId.getOperatorId()); |
| | | List<TOperator> list2 = tOperatorService.list(); |
| | | model.addAttribute("yysList",list2); |
| | | model.addAttribute("list",list); |
| | | |
| | | return PREFIX + "TCompetition_add.html"; |
| | | } |
| | | |
| | |
| | | model.addAttribute("storeIds",integers); |
| | | |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, competition.getProvinceCode())); |
| | | List<TCity> list1 = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId,one.getId())); |
| | | |
| | | List<TStore> list2 = storeService.list(new LambdaQueryWrapper<TStore>().eq(TStore::getCityCode,competition.getCityCode())); |
| | | if (UserExt.getUser().getObjectType()==2){ |
| | | // 查询这个运营商管理的省 |
| | | TOperator id1 = tOperatorService.getOne(new QueryWrapper<TOperator>().eq("id", UserExt.getUser().getObjectId())); |
| | | if (id1.getType()==1){ |
| | | |
| | | }else{ |
| | | // 找到他管理的省 |
| | | List<TOperatorCity> list4 = operatorCityService.list(new QueryWrapper<TOperatorCity>().eq("operatorId", UserExt.getUser().getObjectId()).eq("pid", 0)); |
| | | List<Integer> collect = list4.stream().map(TOperatorCity::getCode).collect(Collectors.toList()); |
| | | list = cityService.list(new LambdaQueryWrapper<TCity>().in(TCity::getCode, collect)); |
| | | // 找到他管理的市 |
| | | TOperatorCity one1 = operatorCityService.lambdaQuery().eq(TOperatorCity::getCode, competition.getProvinceCode()) |
| | | .eq(TOperatorCity::getOperatorId, UserExt.getUser().getObjectId()).one(); |
| | | |
| | | List<TOperatorCity> list3 = operatorCityService.lambdaQuery().eq(TOperatorCity::getPid, one1.getId()) |
| | | .eq(TOperatorCity::getOperatorId, UserExt.getUser().getObjectId()).list(); |
| | | if (list3.isEmpty()){ |
| | | // 管理整个市区 |
| | | }else{ |
| | | List<Integer> collect1 = list3.stream().map(TOperatorCity::getCode).collect(Collectors.toList()); |
| | | list1 = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId,one.getId()) |
| | | .in(TCity::getCode, collect1)); |
| | | } |
| | | |
| | | } |
| | | list2 = storeService.list(new LambdaQueryWrapper<TStore>().eq(TStore::getCityCode,competition.getCityCode()) |
| | | .eq(TStore::getOperatorId,UserExt.getUser().getObjectId())); |
| | | } |
| | | model.addAttribute("list",list); |
| | | model.addAttribute("list1",list1); |
| | | model.addAttribute("list2",list2); |
| | |
| | | @ResponseBody |
| | | public Object oneChangeNext(Integer oneId) { |
| | | try { |
| | | if (UserExt.getUser().getObjectType() == 2){ |
| | | return storeService.list(new LambdaQueryWrapper<TStore>().eq(TStore::getCityCode, oneId) |
| | | .eq(TStore::getOperatorId, UserExt.getUser().getObjectId())); |
| | | |
| | | } |
| | | return storeService.list(new LambdaQueryWrapper<TStore>().eq(TStore::getCityCode, oneId)); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |