From c46036c450d79be95029e94ab5a672d3074a4c16 Mon Sep 17 00:00:00 2001 From: wuweida <2918581207@qq.com> Date: Sat, 7 May 2022 18:21:24 +0800 Subject: [PATCH] 1 --- .../monitormanage/service/MonitorService.java | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/main/java/com/hisense/monitormanage/service/MonitorService.java b/src/main/java/com/hisense/monitormanage/service/MonitorService.java index 9de1d08..0e855d2 100644 --- a/src/main/java/com/hisense/monitormanage/service/MonitorService.java +++ b/src/main/java/com/hisense/monitormanage/service/MonitorService.java @@ -324,8 +324,40 @@ public class MonitorService { } if (forEntity == null) return; + List results = forEntity.getBody(); + +// log.debug("response {}", JSONObject.toJSONString(results)); + String sep = "->"; + + for (Map result : results) { + Boolean isParent = (Boolean) result.get("isParent"); + + if (isParent){ + CameraOrgan cameraOrgan = JSONObject.parseObject(JSONObject.toJSONString(result), CameraOrgan.class); + + cameraOrgenMapper.insert(cameraOrgan); + + videoService((String) result.get("id"),path + sep + result.get("name")); + }else { + if (result.get("channelId") != null){ + CameraChannel cameraChannel = JSONObject.parseObject(JSONObject.toJSONString(result), CameraChannel.class); + + String id = (String)result.get("parentId"); + + if (path != null && path.startsWith(sep)) { + path = path.substring(sep.length()); + } + cameraChannel.setNodeName(path); + + cameraChannel.setParentId(id); + + cameraChannelMapper.insert(cameraChannel); + + } } + } + } //查询视频点播巡检结果 public void listChannelPlayStates(Map map){