| | |
| | | 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("/getProvinceYys") |
| | | @ResponseBody |
| | | public Object getProvinceYys(Integer operatorId) { |
| | | // 获取运营商管理的所有省 |
| | | List<TOperatorCity> list = operatorCityService.list(new QueryWrapper<TOperatorCity>().eq("operatorId", operatorId) |
| | | .eq("pid", 0)); |
| | | // 判断当前运营商是管理全国还是指定区域 |
| | | 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; |
| | | } |
| | | |
| | | 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)); |
| | |
| | | @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; |
| | | } |
| | |
| | | }else{ |
| | | tStore.setOperatorId(yyId); |
| | | } |
| | | storeService.save(tStore); |
| | | if (UserExt.getUser().getObjectType()==2){ |
| | | tStore.setOperatorId(UserExt.getUser().getObjectId()); |
| | | } |
| | | |
| | | user.setObjectId(tStore.getId()); |
| | | userService.updateById(user); |
| | | |
| | | |
| | | |
| | | // 添加场地 |
| | | TSite tSite = new TSite(); |
| | | tSite.setName(tStore.getName()); |
| | | tSite.setStoreId(tStore.getId()); |
| | | tSite.setSign(1); |
| | | siteService.save(tSite); |
| | | |
| | | 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); |
| | | |
| | | 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> 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",tSite.getId().toString()); |
| | | // 添加门禁 |
| | | 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(); |
| | |
| | | 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){ |
| | |
| | | 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; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |