| | |
| | | // 获取根区域编号 |
| | | String rootRegionId = getRootRegionId(hk); |
| | | // 查询摄像头统计数据(需要有在线状态) |
| | | hashMap.put("total",getCameraStatisticCount(rootRegionId,null)); |
| | | hashMap.put("onlineTotal",getCameraStatisticCount(rootRegionId,1)); |
| | | hashMap.put("offlineTotal",getCameraStatisticCount(rootRegionId,0)); |
| | | hashMap.put("total",getCameraStatisticCount(hk.getType(),rootRegionId,null)); |
| | | hashMap.put("onlineTotal",getCameraStatisticCount(hk.getType(),rootRegionId,1)); |
| | | hashMap.put("offlineTotal",getCameraStatisticCount(hk.getType(),rootRegionId,0)); |
| | | // 查询摄像头集合数据 |
| | | hashMap.put("list",getCameraStatisticList(rootRegionId, hk,query)); |
| | | hashMap.put("list",getCameraStatisticList(hk.getType(),rootRegionId, hk,query)); |
| | | // 返回数据 |
| | | return hashMap; |
| | | } |
| | |
| | | * @param cameraIndexCode |
| | | * @return |
| | | */ |
| | | private String getCameraAddress(String regionIndexCode,String cameraIndexCode) { |
| | | private String getCameraAddress(Integer type,String regionIndexCode,String cameraIndexCode) { |
| | | // 组装请求参数 |
| | | JSONObject jsonBody = new JSONObject(); |
| | | jsonBody.put("regionIndexCodes", Arrays.asList(regionIndexCode)); |
| | |
| | | list.add(map); |
| | | jsonBody.put("expressions", list); |
| | | String body = jsonBody.toJSONString(); |
| | | String result = GetCameraUtils.common(regionInfoUrls, body); |
| | | String result = GetCameraUtils.common(type,regionInfoUrls, body); |
| | | // 数据处理 |
| | | JSONObject jsonObject = JSONObject.parseObject(result); |
| | | JSONObject data = (JSONObject) jsonObject.get("data"); |
| | |
| | | * @param cameraIndexCode |
| | | * @return |
| | | */ |
| | | private JSONObject getCameraDetail(String cameraIndexCode) { |
| | | private JSONObject getCameraDetail(Integer type,String cameraIndexCode) { |
| | | // 组装请求参数 |
| | | JSONObject jsonBody = new JSONObject(); |
| | | jsonBody.put("cameraIndexCode", cameraIndexCode); |
| | | String body = jsonBody.toJSONString(); |
| | | String result = GetCameraUtils.common(camerasIndexCodeUrls, body); |
| | | String result = GetCameraUtils.common(type,camerasIndexCodeUrls, body); |
| | | // 数据处理 |
| | | JSONObject jsonObject = JSONObject.parseObject(result); |
| | | // 返回 |
| | |
| | | * @param query |
| | | * @return |
| | | */ |
| | | private JSONObject getCameraStatisticList(String regionId, HkVO hk,Query query) { |
| | | private JSONObject getCameraStatisticList(Integer type,String regionId, HkVO hk,Query query) { |
| | | // 组装请求参数 |
| | | JSONObject jsonBody = new JSONObject(); |
| | | jsonBody.put("regionId", regionId); |
| | |
| | | jsonBody.put("status",hk.getStatus()); |
| | | } |
| | | String body = jsonBody.toJSONString(); |
| | | String result = GetCameraUtils.common(onlineCameraGetUrls, body); |
| | | String result = GetCameraUtils.common(type,onlineCameraGetUrls, body); |
| | | // 数据处理 |
| | | JSONObject jsonObject = JSONObject.parseObject(result); |
| | | // 返回数据 |
| | |
| | | * @param status |
| | | * @return |
| | | */ |
| | | private String getCameraStatisticCount(String regionId,Integer status) { |
| | | private String getCameraStatisticCount(Integer type,String regionId,Integer status) { |
| | | // 组装请求参数 |
| | | JSONObject jsonBody = new JSONObject(); |
| | | jsonBody.put("regionId", regionId); |
| | |
| | | jsonBody.put("status",status); |
| | | } |
| | | String body = jsonBody.toJSONString(); |
| | | String result = GetCameraUtils.common(onlineCameraGetUrls, body); |
| | | String result = GetCameraUtils.common(type,onlineCameraGetUrls, body); |
| | | // 数据处理 |
| | | JSONObject jsonObject = JSONObject.parseObject(result); |
| | | JSONObject data = (JSONObject) jsonObject.get("data"); |
| | |
| | | // 组装请求参数 |
| | | JSONObject jsonBody = new JSONObject(); |
| | | String body = jsonBody.toJSONString(); |
| | | String result = GetCameraUtils.common(regionsRootUrls, body); |
| | | String result = GetCameraUtils.common(hk.getType(),regionsRootUrls, body); |
| | | // 数据处理 |
| | | JSONObject jsonObject = JSONObject.parseObject(result); |
| | | JSONObject data = (JSONObject) jsonObject.get("data"); |