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){