| | |
| | | strings.add(cityManager.getCity()); |
| | | } |
| | | HashSet<String> set1 = new HashSet<String>(strings); |
| | | List<Store> stores = new ArrayList<>(); |
| | | if (objectType ==2 ){ |
| | | stores= storeClient.getStoreByCityManagerId(objectId); |
| | | }else if(objectType == 3){ |
| | | stores= storeClient.getStoreByStoreStaffId(objectId);; |
| | | List<TStore> stores = new ArrayList<>(); |
| | | // // 先判断 |
| | | // if (objectType ==2 ){ |
| | | // stores= storeClient.getStoreByCityManagerId(objectId); |
| | | // }else if(objectType == 3){ |
| | | // stores= storeClient.getStoreByStoreStaffId(objectId);; |
| | | // }else{ |
| | | // stores = storeClient.getStore(site.getCity()); |
| | | // } |
| | | // 根据门店id 确定是平台还是运营商的 |
| | | TStore byId = storeService.getById(site.getStoreId()); |
| | | if (byId.getType()==1){ |
| | | // 查询平台的门店 |
| | | if (objectType ==2 ){ |
| | | stores = storeService.list(new QueryWrapper<TStore>() |
| | | .eq("state", 1) |
| | | .eq("type", 1) |
| | | .eq("operatorId",objectId)); |
| | | }else if (objectType ==2 ){ |
| | | stores = storeService.list(new QueryWrapper<TStore>() |
| | | .eq("state", 1) |
| | | .eq("id",objectId)); |
| | | }else{ |
| | | stores = storeService.list(new QueryWrapper<TStore>() |
| | | .eq("state", 1) |
| | | .eq("type", 1) |
| | | ); |
| | | } |
| | | }else{ |
| | | stores = storeClient.getStore(site.getCity()); |
| | | // 查询平台的门店 |
| | | if(objectType == 2){ |
| | | stores = storeService.list(new QueryWrapper<TStore>() |
| | | .eq("state", 1) |
| | | .eq("type", 2) |
| | | .eq("operatorId",objectId)); |
| | | }else if (objectType == 3){ |
| | | stores = storeService.list(new QueryWrapper<TStore>() |
| | | .eq("state", 1) |
| | | .eq("id",objectId)); |
| | | }else{ |
| | | stores = storeService.list(new QueryWrapper<TStore>() |
| | | .eq("state", 1) |
| | | .eq("type", 2) |
| | | ); |
| | | } |
| | | |
| | | } |
| | | List<CityManager> accounts = cityManagerClient.getAccount(site.getCity()); |
| | | model.addAttribute("list",site); |
| | |
| | | model.addAttribute("type",1); |
| | | model.addAttribute("objectType",objectType); |
| | | model.addAttribute("objectId",objectId); |
| | | |
| | | model.addAttribute("stores",stores); |
| | | |
| | | String nextName = site.getNextName(); |
| | |
| | | site.setCityManagerId(cityManagerId); |
| | | site.setInsertTime(new Date()); |
| | | site.setState(1); |
| | | site.setOperatorId(UserExt.getUser().getObjectId()); |
| | | Integer integer1 = siteClient.addSite(site); |
| | | // site.setOperatorId(UserExt.getUser().getObjectId()); |
| | | |
| | | // 添加场地 |
| | | HashMap<String, String> map = new HashMap<>(); |
| | | map.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); |
| | | map.put("name",site.getName()); |
| | | map.put("space_id",site.getId().toString()); |
| | | map.put("area_id",store.getId().toString()); |
| | | map.put("space_id",store.getId().toString()); |
| | | String s = HttpRequestUtil.postRequest |
| | | ("https://try.daowepark.com/v7/user_api/general/addSpaceArea", map); |
| | | // 添加门禁 |
| | | JSONObject jsonObject = JSONObject.parseObject(s); |
| | | JSONObject data = jsonObject.getJSONObject("data"); |
| | | String area_id = data.getString("area_id"); |
| | | Integer integer = Integer.valueOf(area_id); |
| | | site.setId(integer); |
| | | Integer integer1 = siteClient.addSite1(site); |
| | | // Integer integer = Integer.valueOf(spaceId); |
| | | if(StringUtils.hasLength( site.getIds())) { |
| | | for (String s1 : site.getIds().split(",")) { |
| | | HashMap<String, String> map1 = new HashMap<>(); |
| | | map1.put("sign", "0DB011836143EEE2C2E072967C9F4E4B"); |
| | | map1.put("space_id", site.getId() + ""); |
| | | map1.put("device_id", s1); |
| | | map1.put("region_id", store.getId().toString() + ""); |
| | | String s2 = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addDevice", map1); |
| | | System.out.println("添加闸机:" + s2); |
| | | } |
| | | } |
| | | |
| | | return ResultUtil.success("添加成功"); |
| | | } |
| | | /** |
| | |
| | | site.setState(1); |
| | | siteClient.addSite(site); |
| | | |
| | | String ids = byId.getIds(); |
| | | HashMap<String, String> map = new HashMap<>(); |
| | | map.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); |
| | | if(StringUtils.hasLength(ids)) { |
| | | for (String s : ids.split(",")) { |
| | | String s1 = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/deleteDevice/ids/" + s, map); |
| | | System.out.println(s1); |
| | | } |
| | | } |
| | | if(StringUtils.hasLength( site.getIds())) { |
| | | for (String s : site.getIds().split(",")) { |
| | | HashMap<String, String> map1 = new HashMap<>(); |
| | | map1.put("sign", "0DB011836143EEE2C2E072967C9F4E4B"); |
| | | map1.put("space_id", store.getId() + ""); |
| | | map1.put("device_id", s); |
| | | map1.put("region_id", site.getId() + ""); |
| | | // 添加门禁 |
| | | String s1 = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addDevice", map1); |
| | | System.out.println(s1); |
| | | } |
| | | } |
| | | /** |
| | | * 取消闸机输入 新增模块闸机管理 |
| | | */ |
| | | // String ids = byId.getIds(); |
| | | // HashMap<String, String> map = new HashMap<>(); |
| | | // map.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); |
| | | // if(StringUtils.hasLength(ids)) { |
| | | // for (String s : ids.split(",")) { |
| | | // String s1 = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/deleteDevice/ids/" + s, map); |
| | | // System.out.println(s1); |
| | | // } |
| | | // } |
| | | // if(StringUtils.hasLength( site.getIds())) { |
| | | // for (String s : site.getIds().split(",")) { |
| | | // HashMap<String, String> map1 = new HashMap<>(); |
| | | // map1.put("sign", "0DB011836143EEE2C2E072967C9F4E4B"); |
| | | // map1.put("space_id", store.getId() + ""); |
| | | // map1.put("device_id", s); |
| | | // map1.put("region_id", site.getId() + ""); |
| | | // // 添加门禁 |
| | | // String s1 = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addDevice", map1); |
| | | // System.out.println(s1); |
| | | // } |
| | | // } |
| | | |
| | | |
| | | |
| | |
| | | vo.setObjectType(type); |
| | | vo.setObjectId(objectId); |
| | | vo.setOpId(opId); |
| | | return siteClient.listExipre(vo); |
| | | List<TSiteDTO> tSiteDTOS = siteClient.listExipre(vo); |
| | | for (TSiteDTO tSiteDTO : tSiteDTOS) { |
| | | Integer storeId = tSiteDTO.getStoreId(); |
| | | TStore byId = storeService.getById(storeId); |
| | | if (byId!=null){ |
| | | if (byId.getType()==1){ |
| | | tSiteDTO.setOperator("平台"); |
| | | }else{ |
| | | TOperator byId1 = tOperatorService.getById(tSiteDTO.getOperatorId()); |
| | | if (byId1!=null) |
| | | tSiteDTO.setOperator(byId1.getName()); |
| | | } |
| | | } |
| | | } |
| | | return tSiteDTOS; |
| | | } |
| | | |
| | | @Autowired |