| | |
| | | import com.dsh.course.feignClient.account.model.CityListQuery; |
| | | import com.dsh.course.feignClient.account.model.TCityManager; |
| | | import com.dsh.course.feignClient.competition.CompetitionClient; |
| | | import com.dsh.course.feignClient.other.model.Site; |
| | | import com.dsh.course.mapper.UserMapper; |
| | | import com.dsh.guns.config.UserExt; |
| | | import com.dsh.guns.core.base.controller.BaseController; |
| | |
| | | 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; |
| | |
| | | @Autowired |
| | | private TOperatorService tOperatorService; |
| | | |
| | | @Autowired |
| | | private ITSiteService siteService; |
| | | @Autowired |
| | | private IUserService userService; |
| | | |
| | | |
| | | // 添加SUTU |
| | | @RequestMapping("/tShop_addDevice/{id}") |
| | | public String addDevice(@PathVariable("id") Integer id,Model model) { |
| | | // 门店id |
| | | model.addAttribute("id",id); |
| | | return PREFIX + "TShop_add_device.html"; |
| | | } |
| | | @RequestMapping("/addDevice") |
| | | public Object addDevice(Integer id,String device) { |
| | | HashMap<String, String> map = new HashMap<>(); |
| | | map.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); |
| | | map.put("space_id",id.toString()); |
| | | map.put("name",device); |
| | | map.put("city_code",""); |
| | | // 添加门禁 |
| | | String s1 = HttpRequestUtil.postRequest |
| | | ("https://try.daowepark.com/v7/user_api/general/addSpaceSutu", map); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到车辆管理首页 |
| | |
| | | */ |
| | | @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); |
| | | return PREFIX + "tShop_add.html"; |
| | | model.addAttribute("objectType",UserExt.getUser().getObjectType()); |
| | | return PREFIX + "TShop_add.html"; |
| | | } |
| | | // 运营商根据省筛选市区 |
| | | @RequestMapping("/getProvinceYys") |
| | | @ResponseBody |
| | | public Object getProvinceYys(Integer operatorId) { |
| | | // 判断当前运营商是管理全国还是指定区域 |
| | | TOperator byId = tOperatorService.getById(operatorId); |
| | | // 说明是管理全国 |
| | | if (byId.getType()==1){ |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | return list; |
| | | }else{ |
| | | // 获取运营商管理的所有省 |
| | | List<TOperatorCity> list = operatorCityService.list(new QueryWrapper<TOperatorCity>().eq("operatorId", operatorId) |
| | | .eq("pid", 0)); |
| | | return list; |
| | | } |
| | | |
| | | |
| | | } |
| | | // 运营商根据省筛选市区 |
| | | @RequestMapping("/getCityYys") |
| | | @ResponseBody |
| | | public Object getCityYys(String province,Integer operatorId) { |
| | | if (UserExt.getUser().getObjectType() == 2){ |
| | | operatorId = UserExt.getUser().getObjectId(); |
| | | } |
| | | // 通过选择的省 获取管理的市 |
| | | TOperatorCity byId = operatorCityService.getOne(new QueryWrapper<TOperatorCity>() |
| | | .eq("code",province).eq("operatorId",operatorId)); |
| | | // 如果为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", operatorId) |
| | | .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("/getStoresYys") |
| | | @ResponseBody |
| | | public Object getStoresYys(String cityCode) { |
| | | Integer objectId = UserExt.getUser().getObjectId(); |
| | | List<TStore> stores = storeService.list(new QueryWrapper<TStore>().eq("operatorId", objectId) |
| | | .eq("cityCode", cityCode)); |
| | | return stores; |
| | | } |
| | | |
| | | @RequestMapping("/tShop_add_one") |
| | | public String tCompetitionAddOne(Integer id,Model model) { |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | |
| | | String roleid = UserExt.getUser().getRoleid(); |
| | | model.addAttribute("id",id); |
| | | |
| | | return PREFIX + "tShop_add_one.html"; |
| | | return PREFIX + "TShop_add_one.html"; |
| | | } |
| | | @RequestMapping("/tShop_add_two") |
| | | public String tCompetitionAddTwo(Integer id,Model model) { |
| | |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | |
| | | // TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, byId.getProvinceCode())); |
| | | List<TOperatorCity> one = operatorCityService.list(new LambdaQueryWrapper<TOperatorCity>().eq(TOperatorCity::getOperatorId, byId.getOperatorId()).eq(TOperatorCity::getType, 1)); |
| | | List<TOperatorCity> ones = operatorCityService.list(new LambdaQueryWrapper<TOperatorCity>().eq(TOperatorCity::getOperatorId, byId.getOperatorId()).eq(TOperatorCity::getType, 1)); |
| | | List<TOperatorCity> ones = operatorCityService.list(new LambdaQueryWrapper<TOperatorCity>() |
| | | .eq(TOperatorCity::getOperatorId, byId.getOperatorId()) |
| | | .eq(TOperatorCity::getPid, 0)); |
| | | |
| | | if(ones.size()>0){ |
| | | model.addAttribute("list",ones); |
| | | TOperatorCity one1 = operatorCityService.getOne(new LambdaQueryWrapper<TOperatorCity>().eq(TOperatorCity::getOperatorId, byId.getOperatorId()).eq(TOperatorCity::getType, 1).eq(TOperatorCity::getCode,byId.getProvinceCode())); |
| | | TOperatorCity one1 = operatorCityService.getOne(new LambdaQueryWrapper<TOperatorCity>().eq(TOperatorCity::getOperatorId, byId.getOperatorId()).eq(TOperatorCity::getPid, 0).eq(TOperatorCity::getCode,byId.getProvinceCode())); |
| | | List<TOperatorCity> list3 = operatorCityService.list(new LambdaQueryWrapper<TOperatorCity>().in(TOperatorCity::getPid, one1.getId()).eq(TOperatorCity::getType, 2)); |
| | | model.addAttribute("list1",list3); |
| | | System.out.println("===list3======="+list3); |
| | |
| | | User byId1 = userMapper.selectById(byId.getStoreStaffId()); |
| | | model.addAttribute("city",byId1); |
| | | model.addAttribute("type",1); |
| | | return PREFIX + "tShop_edit.html"; |
| | | // 如果当前登陆人是运营商 |
| | | 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); |
| | | } |
| | | } |
| | | return PREFIX + "TShop_edit.html"; |
| | | } |
| | | @RequestMapping("/tShop_update1/{id}") |
| | | public String tCityUpdate1(@PathVariable Integer id, Model model) { |
| | | TStoreOther byId = storeOtherService.getById(id); |
| | | model.addAttribute("item",byId); |
| | | return PREFIX + "tShop_edit_one.html"; |
| | | return PREFIX + "TShop_edit_one.html"; |
| | | } |
| | | |
| | | |
| | |
| | | model.addAttribute("item",byId); |
| | | model.addAttribute("list1",list1); |
| | | |
| | | return PREFIX + "tShop_edit_two.html"; |
| | | return PREFIX + "TShop_edit_two.html"; |
| | | } |
| | | @RequestMapping("/tShop_update_one1/{id}") |
| | | public String tCityUpdateOne1(@PathVariable Integer id, Model model) { |
| | |
| | | model.addAttribute("list",list); |
| | | model.addAttribute("list1",list1); |
| | | |
| | | return PREFIX + "tShop_add_three.html"; |
| | | return PREFIX + "TShop_add_three.html"; |
| | | } |
| | | |
| | | |
| | |
| | | User byId1 = userMapper.selectById(byId.getStoreStaffId()); |
| | | model.addAttribute("city",byId1); |
| | | model.addAttribute("type",0); |
| | | return PREFIX + "tShop_edit.html"; |
| | | return PREFIX + "TShop_edit.html"; |
| | | } |
| | | @RequestMapping("/tShop_gift/{id}") |
| | | public String tCityGift(@PathVariable Integer id, Model model) { |
| | | TStore byId = storeService.getById(id); |
| | | model.addAttribute("welfarePicture",byId.getWelfarePicture()); |
| | | model.addAttribute("id",id); |
| | | return PREFIX + "tShop_img.html"; |
| | | return PREFIX + "TShop_img.html"; |
| | | } |
| | | @RequestMapping("/tShop_indexSet/{id}") |
| | | public String tCityIndexSet(@PathVariable Integer id, Model model) { |
| | |
| | | StoreConfig c8 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,8)); |
| | | model.addAttribute("c8",c8); |
| | | model.addAttribute("id",id); |
| | | return PREFIX + "tShop_imgAll.html"; |
| | | return PREFIX + "TShop_imgAll.html"; |
| | | } |
| | | |
| | | |
| | |
| | | @ResponseBody |
| | | public Object list(String provinceCode, String cityCode , String name, String phone,String shopName) { |
| | | Page<TStoreListVo> page = new PageFactory<TStoreListVo>().defaultPage(); |
| | | List<TStoreListVo> list = storeService.listAll(page,provinceCode,cityCode,name,phone,shopName); |
| | | String roleid = UserExt.getUser().getRoleid(); |
| | | List<TStoreListVo> list =new ArrayList<>(); |
| | | if("3".equals(roleid)){ |
| | | Integer objectId = UserExt.getUser().getObjectId(); |
| | | list = storeService.listAllStore(page,provinceCode,cityCode,name,phone,shopName,objectId); |
| | | }else { |
| | | Integer objectId = UserExt.getUser().getObjectId(); |
| | | list = storeService.listAll(page,provinceCode,cityCode,name,phone,shopName,objectId); |
| | | } |
| | | page.setRecords(list); |
| | | return super.packForBT(page); |
| | | } |
| | |
| | | @ResponseBody |
| | | public Object list(TStore tStore,String time,String userName,String userPhone,String ids,Integer type,Integer yyId,String lat,String lon,String pCode1,String cCode1) { |
| | | try { |
| | | |
| | | |
| | | if(yyId==null || type==1){ |
| | | yyId=0; |
| | | } |
| | | |
| | | if(yyId!=0) { |
| | | List<TOperatorCity> list1 = operatorCityService.list(new LambdaQueryWrapper<TOperatorCity>().eq(TOperatorCity::getOperatorId, yyId)); |
| | | if(list1.size()>0){ |
| | | if (ToolUtil.isNotEmpty(tStore.getProvinceCode())) { |
| | | TOperatorCity byId = operatorCityService.getById(tStore.getProvinceCode()); |
| | | TOperatorCity byId = operatorCityService.getOne(new QueryWrapper<TOperatorCity>().eq("code",tStore.getProvinceCode()) |
| | | .eq("operatorId",yyId)); |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, byId.getCode())); |
| | | tStore.setProvince(one.getName()); |
| | | tStore.setProvinceCode(one.getCode()); |
| | | List<TOperatorCity> list = operatorCityService.list(new LambdaQueryWrapper<TOperatorCity>().eq(TOperatorCity::getPid, byId.getId()).eq(TOperatorCity::getType, 2)); |
| | | if (list.size() > 0) { |
| | | TOperatorCity byId1 = operatorCityService.getById(tStore.getCityCode()); |
| | | TOperatorCity byId1 = operatorCityService.getOne(new QueryWrapper<TOperatorCity>().eq("code",tStore.getCityCode()) |
| | | .eq("operatorId",yyId)); |
| | | TCity one1 = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, byId1.getCode())); |
| | | tStore.setCity(one1.getName()); |
| | | tStore.setCityCode(one1.getCode()); |
| | | } else { |
| | | TCity byId1 = cityService.getById(tStore.getCityCode()); |
| | | TCity one1 = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, byId1.getCode())); |
| | | TCity one1 = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, tStore.getCityCode())); |
| | | tStore.setCity(one1.getName()); |
| | | tStore.setCityCode(one1.getCode()); |
| | | } |
| | |
| | | |
| | | }else { |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, pCode1)); |
| | | tStore.setProvince(one.getName()); |
| | | tStore.setProvinceCode(one.getCode()); |
| | | if (one !=null){ |
| | | tStore.setProvince(one.getName()); |
| | | tStore.setProvinceCode(one.getCode()); |
| | | } |
| | | TCity one1 = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, cCode1)); |
| | | tStore.setCity(one1.getName()); |
| | | tStore.setCityCode(one1.getCode()); |
| | | if (one1 !=null){ |
| | | tStore.setCity(one1.getName()); |
| | | tStore.setCityCode(one1.getCode()); |
| | | } |
| | | } |
| | | tStore.setStartTime(time.split(" - ")[0]); |
| | | tStore.setEndTime(time.split(" - ")[1]); |
| | | tStore.setIds(ids); |
| | | tStore.setType(type); |
| | | if (UserExt.getUser().getObjectType()==2){ |
| | | tStore.setType(2); |
| | | }else{ |
| | | tStore.setType(type); |
| | | } |
| | | |
| | | tStore.setOperatorId(yyId); |
| | | tStore.setState(1); |
| | | tStore.setCreateTime(new Date()); |
| | |
| | | } |
| | | user.setAccount(userPhone); |
| | | user.setName(userName); |
| | | user.setRoleid("2"); |
| | | user.setRoleid("3"); |
| | | user.setPhone(userPhone); |
| | | user.setPassword(SecureUtil.md5("a123456")); |
| | | user.setObjectType(3); |
| | | user.setStatus(1); |
| | | userMapper.insert(user); |
| | | tStore.setStoreStaffId(user.getId()); |
| | | tStore.setLon(lon); |
| | | tStore.setLat(lat); |
| | | |
| | | storeService.save(tStore); |
| | | |
| | | |
| | | |
| | | |
| | | ArrayList<StoreConfig> storeConfigs = new ArrayList<>(); |
| | | for (int i = 1; i < 9; i++) { |
| | | StoreConfig storeConfig = new StoreConfig(); |
| | | storeConfig.setIsOpen(1); |
| | | storeConfig.setSort(i); |
| | | storeConfig.setType(i); |
| | | storeConfig.setStoreId(tStore.getId()); |
| | | storeConfigs.add(storeConfig); |
| | | if (yyId == null || yyId == 0){ |
| | | tStore.setOperatorId(0); |
| | | }else{ |
| | | tStore.setOperatorId(yyId); |
| | | } |
| | | if (UserExt.getUser().getObjectType()==2){ |
| | | tStore.setOperatorId(UserExt.getUser().getObjectId()); |
| | | } |
| | | storeConfigService.saveBatch(storeConfigs); |
| | | |
| | | |
| | | user.setObjectId(tStore.getId()); |
| | | userService.updateById(user); |
| | | // 添加门店 |
| | | HashMap<String, String> map1 = new HashMap<>(); |
| | | map1.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); |
| | |
| | | map1.put("remark",tStore.getIntroduce()); |
| | | map1.put("lat",tStore.getLat()); |
| | | map1.put("lng",tStore.getLon()); |
| | | map1.put("space_id",tStore.getId().toString()); |
| | | String result = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addSpace", map1); |
| | | System.out.println(result); |
| | | |
| | | |
| | | |
| | | for (String s : tStore.getIds().split(",")) { |
| | | HashMap<String, String> map = new HashMap<>(); |
| | | map.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); |
| | | map.put("space_id",tStore.getId()+""); |
| | | map.put("device_id",s); |
| | | map.put("region_id",""); |
| | | // 添加门禁 |
| | | String s1 = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addDevice", map); |
| | | System.out.println(s1); |
| | | JSONObject jsonObject = JSONObject.parseObject(result); |
| | | JSONObject data = jsonObject.getJSONObject("data"); |
| | | String space_id = data.getString("space_id"); |
| | | Integer integer = Integer.valueOf(space_id); |
| | | tStore.setId(integer); |
| | | storeService.save(tStore); |
| | | System.err.println(tStore); |
| | | ArrayList<StoreConfig> storeConfigs = new ArrayList<>(); |
| | | for (int i = 1; i < 9; i++) { |
| | | StoreConfig storeConfig = new StoreConfig(); |
| | | storeConfig.setIsOpen(1); |
| | | storeConfig.setSort(i); |
| | | storeConfig.setType(i); |
| | | storeConfig.setStoreId(tStore.getId()); |
| | | storeConfigs.add(storeConfig); |
| | | } |
| | | storeConfigService.saveBatch(storeConfigs); |
| | | |
| | | |
| | | |
| | | // HashMap<String, String> mapSite = new HashMap<>(); |
| | | // mapSite.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); |
| | | // mapSite.put("name",tStore.getName()); |
| | | // mapSite.put("space_id",tStore.getId().toString()); |
| | | // mapSite.put("area_id",tSite.getId().toString()); |
| | | // HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addSpaceArea", mapSite); |
| | | // for (String s : tStore.getIds().split(",")) { |
| | | // HashMap<String, String> map = new HashMap<>(); |
| | | // map.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); |
| | | // map.put("space_id",tStore.getId()+""); |
| | | // map.put("device_id",s); |
| | | // map.put("region_id",tSite.getId().toString()); |
| | | // // 添加门禁 |
| | | // String s1 = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addDevice", map); |
| | | // System.out.println(s1); |
| | | // } |
| | | return new SuccessTip<>(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | List<TOperatorCity> list1 = operatorCityService.list(new LambdaQueryWrapper<TOperatorCity>().eq(TOperatorCity::getOperatorId, yyId)); |
| | | if(list1.size()>0){ |
| | | if (ToolUtil.isNotEmpty(tStore.getProvinceCode())) { |
| | | TOperatorCity byId = operatorCityService.getById(tStore.getProvinceCode()); |
| | | TOperatorCity byId = operatorCityService.getOne(new QueryWrapper<TOperatorCity>().eq("operatorId", yyId) |
| | | .eq("code", tStore.getProvinceCode())); |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, byId.getCode())); |
| | | tStore.setProvince(one.getName()); |
| | | tStore.setProvinceCode(one.getCode()); |
| | | List<TOperatorCity> list = operatorCityService.list(new LambdaQueryWrapper<TOperatorCity>().eq(TOperatorCity::getPid, byId.getId()).eq(TOperatorCity::getType, 2)); |
| | | List<TOperatorCity> list = operatorCityService.list(new LambdaQueryWrapper<TOperatorCity>() |
| | | .eq(TOperatorCity::getPid, byId.getId()).ne(TOperatorCity::getPid, 0)); |
| | | if (list.size() > 0) { |
| | | TOperatorCity byId1 = operatorCityService.getById(tStore.getCityCode()); |
| | | TOperatorCity byId1 = operatorCityService.getOne(new QueryWrapper<TOperatorCity>().eq("operatorId", yyId) |
| | | .eq("code", tStore.getCityCode())); |
| | | TCity one1 = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, byId1.getCode())); |
| | | tStore.setCity(one1.getName()); |
| | | tStore.setCityCode(one1.getCode()); |
| | | } else { |
| | | TCity byId1 = cityService.getById(tStore.getCityCode()); |
| | | TCity byId1 = cityService.getOne(new QueryWrapper<TCity>().eq("code",tStore.getCityCode())); |
| | | TCity one1 = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, byId1.getCode())); |
| | | tStore.setCity(one1.getName()); |
| | | tStore.setCityCode(one1.getCode()); |
| | |
| | | } |
| | | |
| | | }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"); |
| | | for (String s : ids1.split(",")) { |
| | | String post = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/deleteDevice/ids/" + s,mapx); |
| | | System.out.println(post); |
| | | } |
| | | |
| | | for (String s : ids.split(",")) { |
| | | HashMap<String, String> map1 = new HashMap<>(); |
| | | map1.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); |
| | | map1.put("space_id",tStore.getId()+""); |
| | | map1.put("device_id",s); |
| | | map1.put("region_id",""); |
| | | // 添加门禁 |
| | | String s1 = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addDevice", map1); |
| | | System.out.println(s1); |
| | | } |
| | | |
| | | |
| | | |
| | | return new SuccessTip<>(); |
| | | }catch (Exception e){ |
| | |
| | | @RequestMapping(value = "/deleteTwo") |
| | | public Object delete2(Integer id) { |
| | | try { |
| | | TStoreOtherConfigTrue byId = tStoreOtherConfigTrueService.getById(id); |
| | | storeOtherConfigService.removeById(id); |
| | | |
| | | byId.setState(2); |
| | | tStoreOtherConfigTrueService.updateById(byId); |
| | | return SUCCESS_TIP; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | @ResponseBody |
| | | public Object freeze(Integer id) { |
| | | try { |
| | | TStore byId = storeService.getById(id); |
| | | byId.setState(2); |
| | | storeService.updateById(byId); |
| | | // 查询门店 获取门店店长id |
| | | TStore store = storeService.getById(id); |
| | | // 冻结 |
| | | store.setState(2); |
| | | storeService.updateById(store); |
| | | Integer storeStaffId = store.getStoreStaffId(); |
| | | User user = userService.getById(storeStaffId); |
| | | user.setStatus(2); |
| | | userService.updateById(user); |
| | | return SUCCESS_TIP; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | @ResponseBody |
| | | public Object unfreeze(Integer id) { |
| | | try { |
| | | TStore byId = storeService.getById(id); |
| | | byId.setState(1); |
| | | storeService.updateById(byId); |
| | | // 查询门店 获取门店店长id |
| | | TStore store = storeService.getById(id); |
| | | // 解冻 |
| | | store.setState(1); |
| | | storeService.updateById(store); |
| | | Integer storeStaffId = store.getStoreStaffId(); |
| | | User user = userService.getById(storeStaffId); |
| | | user.setStatus(1); |
| | | userService.updateById(user); |
| | | return SUCCESS_TIP; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | } |
| | | @RequestMapping(value = "/addConfig") |
| | | @ResponseBody |
| | | public Object addConfig(String name,Integer id) { |
| | | public Object addConfig(String name,Integer id,Integer sort) { |
| | | try { |
| | | List<TStoreOtherConfig> list = storeOtherConfigService.list(); |
| | | if(list.size()>0){ |
| | | TStoreOther tStoreOther = new TStoreOther(); |
| | | tStoreOther.setName(name); |
| | | tStoreOther.setStoreId(id); |
| | | tStoreOther.setSort(sort); |
| | | storeOtherService.save(tStoreOther); |
| | | |
| | | // 找出temp表数据 |
| | |
| | | } |
| | | @RequestMapping(value = "/addConfig1") |
| | | @ResponseBody |
| | | public Object addConfig1(String name,Integer id) { |
| | | public Object addConfig1(String name,Integer id,Integer sort) { |
| | | try { |
| | | TStoreOther byId = storeOtherService.getById(id); |
| | | byId.setName( |
| | | name |
| | | ); |
| | | byId.setName(name); |
| | | byId.setSort(sort); |
| | | storeOtherService.updateById(byId); |
| | | |
| | | |
| | |
| | | byId.setUrl(url); |
| | | } |
| | | byId.setName(name); |
| | | TTurn byId1 = tTurnService.getById(page); |
| | | TTurn byId2 = tTurnService.getById(type); |
| | | byId.setPage(byId1.getName()); |
| | | byId.setType(byId2.getName()); |
| | | if(page!=null){ |
| | | TTurn byId1 = tTurnService.getById(page); |
| | | byId.setPage(byId1.getName()); |
| | | } |
| | | if(page!=null){ |
| | | TTurn byId2 = tTurnService.getById(type); |
| | | byId.setType(byId2.getName()); |
| | | } |
| | | byId.setTurnId(turnId); |
| | | byId.setSort(sort); |
| | | byId.setPageId(page); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/addConfigOne9") |
| | | @ResponseBody |
| | | public Object addConfigOne9(String url,String name,Integer page,Integer type,String turnId,Integer sort,Integer id) { |
| | | try { |
| | | TStoreOtherConfigTrue byId = new TStoreOtherConfigTrue(); |
| | | byId.setPid(id); |
| | | if(ToolUtil.isNotEmpty(url)){ |
| | | byId.setUrl(url); |
| | | } |
| | | byId.setName(name); |
| | | if(page!=null){ |
| | | TTurn byId1 = tTurnService.getById(page); |
| | | byId.setPage(byId1.getName()); |
| | | } |
| | | if(page!=null){ |
| | | TTurn byId2 = tTurnService.getById(type); |
| | | byId.setType(byId2.getName()); |
| | | } |
| | | byId.setTurnId(turnId); |
| | | byId.setSort(sort); |
| | | byId.setPageId(page); |
| | | byId.setTypeId(type); |
| | | byId.setState(1); |
| | | tStoreOtherConfigTrueService.save(byId); |
| | | return SUCCESS_TIP; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |