From f8c9479d2f33515376e5c0d87734edec2e15ad6f Mon Sep 17 00:00:00 2001 From: 44323 <443237572@qq.com> Date: 星期三, 15 十一月 2023 09:31:27 +0800 Subject: [PATCH] 后台bug修改 --- cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TShopController.java | 66 ++++++++++---------------------- 1 files changed, 21 insertions(+), 45 deletions(-) diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TShopController.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TShopController.java index 7d52885..94b7e66 100644 --- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TShopController.java +++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TShopController.java @@ -86,6 +86,27 @@ private IUserService userService; + @RequestMapping("/tShop_addDevice/{id}") + public String addDevice(@PathVariable("id") Integer id,Model model) { + // 查询门店下的所有场地 + List<TSite> list = siteService.list(new QueryWrapper<TSite>().eq("storeId", id)); + // 门店id + model.addAttribute("id",id); + model.addAttribute("list",list); + return PREFIX + "TShop_add_device.html"; + } + @RequestMapping("/addDevice") + public Object addDevice(Integer id,Integer siteId,String device) { + HashMap<String, String> map = new HashMap<>(); + map.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); + map.put("space_id",id.toString()); + map.put("device_id",device); + map.put("region_id",siteId+""); + // 添加门禁 + String s1 = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addDevice", map); + return SUCCESS_TIP; + } + /** * 跳转到车辆管理首页 */ @@ -503,19 +524,7 @@ - // 添加场地 - 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++) { @@ -546,18 +555,6 @@ 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); - } - return new SuccessTip<>(); @@ -644,27 +641,6 @@ 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){ -- Gitblit v1.7.1