From 951f90b82993acc835cdf58a9f1f39aeecd86674 Mon Sep 17 00:00:00 2001 From: nickchange <126672920+nickchange@users.noreply.github.com> Date: 星期三, 15 十一月 2023 16:10:02 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TShopController.java | 133 +++++++++++++++++++++++--------------------- 1 files changed, 70 insertions(+), 63 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 9092db9..25dac6b 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; + } + /** * 跳转到车辆管理首页 */ @@ -151,7 +172,9 @@ @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)); @@ -497,26 +520,12 @@ }else{ tStore.setOperatorId(yyId); } + if (UserExt.getUser().getObjectType()==2){ + tStore.setOperatorId(UserExt.getUser().getObjectId()); + } storeService.save(tStore); 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(); @@ -546,20 +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<>(); @@ -646,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){ @@ -969,13 +943,14 @@ } @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表数据 @@ -1000,12 +975,11 @@ } @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); @@ -1048,10 +1022,14 @@ 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); @@ -1064,7 +1042,36 @@ } } - + @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; + } + } } -- Gitblit v1.7.1