| | |
| | | import com.dsh.guns.modular.system.util.HttpRequestUtil; |
| | | import io.swagger.models.auth.In; |
| | | import org.apache.poi.ss.formula.functions.T; |
| | | import org.bouncycastle.math.raw.Mod; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | |
| | | */ |
| | | @RequestMapping("/tShop_add") |
| | | public String tCompetitionAdd(Model model) { |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | model.addAttribute("list",list); |
| | | |
| | | String roleid = UserExt.getUser().getRoleid(); |
| | | model.addAttribute("role",roleid); |
| | | List<TOperator> list1 = tOperatorService.list(); |
| | | |
| | | if (UserExt.getUser().getObjectType()==2){ |
| | | // 查询这个运营商管理的省 |
| | | TOperator id = tOperatorService.getOne(new QueryWrapper<TOperator>().eq("id", UserExt.getUser().getObjectId())); |
| | | if (id.getType()==1){ |
| | | // 全国 |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | model.addAttribute("list",list); |
| | | }else{ |
| | | // 找到他管理的省 |
| | | List<TOperatorCity> list = operatorCityService.list(new QueryWrapper<TOperatorCity>().eq("operatorId", UserExt.getUser().getObjectId()).eq("pid", 0)); |
| | | model.addAttribute("list",list); |
| | | } |
| | | }else{ |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | model.addAttribute("list",list); |
| | | } |
| | | |
| | | // if (!roleid.equals("1")){ |
| | | TOperator operator1 = tOperatorService.getOne(new QueryWrapper<TOperator>().eq("userId", UserExt.getUser().getId())); |
| | |
| | | // } |
| | | |
| | | model.addAttribute("yysList",list1); |
| | | model.addAttribute("objectType",UserExt.getUser().getObjectType()); |
| | | return PREFIX + "TShop_add.html"; |
| | | } |
| | | |
| | | // 运营商根据省筛选市区 |
| | | @RequestMapping("/getCityYys") |
| | | @ResponseBody |
| | | public Object getCityYys(String province) { |
| | | Integer objectId = UserExt.getUser().getObjectId(); |
| | | |
| | | // 通过选择的省 获取管理的市 |
| | | TOperatorCity byId = operatorCityService.getOne(new QueryWrapper<TOperatorCity>() |
| | | .eq("code",province).eq("operatorId",objectId)); |
| | | // 如果为null 则说明管理的全国 |
| | | if (byId == null){ |
| | | TCity code = cityService.getOne(new QueryWrapper<TCity>().eq("code", province)); |
| | | return cityService.list(new QueryWrapper<TCity>().eq("parent_id",code.getId())); |
| | | }else{ |
| | | List<TOperatorCity> list = operatorCityService.list(new QueryWrapper<TOperatorCity>() |
| | | .eq("operatorId", UserExt.getUser().getObjectId()) |
| | | .eq("pid",byId.getId())); |
| | | if (list.size() == 0){ |
| | | // 说明管理整个省 |
| | | TCity code = cityService.getOne(new QueryWrapper<TCity>().eq("code", byId.getCode())); |
| | | // 获取省下面的所有市 |
| | | return cityService.list(new QueryWrapper<TCity>().eq("parent_id", code.getId())); |
| | | }else{ |
| | | // 没有管理整个省 获取对应的市 |
| | | return list; |
| | | } |
| | | } |
| | | } |
| | | |
| | | @RequestMapping("/tShop_add_one") |
| | | public String tCompetitionAddOne(Integer id,Model model) { |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | |
| | | User byId1 = userMapper.selectById(byId.getStoreStaffId()); |
| | | model.addAttribute("city",byId1); |
| | | model.addAttribute("type",1); |
| | | // 如果当前登陆人是运营商 |
| | | if (UserExt.getUser().getObjectType()==2){ |
| | | // 查询这个运营商管理的省 |
| | | TOperator id1 = tOperatorService.getOne(new QueryWrapper<TOperator>().eq("id", UserExt.getUser().getObjectId())); |
| | | if (id1.getType()==1){ |
| | | // 全国 |
| | | List<TCity> list3 = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | model.addAttribute("list",list3); |
| | | }else{ |
| | | // 找到他管理的省 |
| | | List<TOperatorCity> list4 = operatorCityService.list(new QueryWrapper<TOperatorCity>().eq("operatorId", UserExt.getUser().getObjectId()).eq("pid", 0)); |
| | | model.addAttribute("list",list4); |
| | | } |
| | | }else{ |
| | | List<TCity> list5 = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | model.addAttribute("list",list5); |
| | | } |
| | | return PREFIX + "TShop_edit.html"; |
| | | } |
| | | @RequestMapping("/tShop_update1/{id}") |
| | |
| | | } |
| | | |
| | | }else { |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getId, tStore.getProvinceCode())); |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, tStore.getProvinceCode())); |
| | | tStore.setProvince(one.getName()); |
| | | tStore.setProvinceCode(one.getCode()); |
| | | TCity one1 = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getId, tStore.getCityCode())); |
| | | TCity one1 = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, tStore.getCityCode())); |
| | | tStore.setCity(one1.getName()); |
| | | tStore.setCityCode(one1.getCode()); |
| | | } |
| | |
| | | userMapper.updateById(user); |
| | | tStore.setLon(lon); |
| | | tStore.setLat(lat); |
| | | // 运营商编辑 |
| | | if (UserExt.getUser().getObjectType()==2){ |
| | | tStore.setOperatorId(null); |
| | | } |
| | | storeService.updateById(tStore); |
| | | String ids1 = byIdc.getIds(); |
| | | |
| | | |
| | | |
| | | HashMap<String, String> mapx = new HashMap<>(); |
| | | mapx.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); |