44323
2024-03-08 db3e6f6d5a8f29a5dc576aba2eab76a8133ce03c
cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TSiteController.java
@@ -481,7 +481,6 @@
        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");
@@ -489,17 +488,7 @@
        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", store.getId().toString() + "");
                map1.put("device_id", s1);
                map1.put("region_id", integer1 + "");
                String s2 = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addDevice", map1);
                System.out.println("添加闸机:" + s2);
            }
        }
        return ResultUtil.success("添加成功");
    }
    /**
@@ -532,27 +521,30 @@
        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);
//            }
//        }