diff --git a/zc-business/src/main/java/com/zc/business/controller/VideoController.java b/zc-business/src/main/java/com/zc/business/controller/VideoController.java index e3ba32da..b4fcb900 100644 --- a/zc-business/src/main/java/com/zc/business/controller/VideoController.java +++ b/zc-business/src/main/java/com/zc/business/controller/VideoController.java @@ -249,8 +249,8 @@ public class VideoController extends BaseController { JSONObject children = data.getJSONObject(0); JSONArray jsonObject = children.getJSONArray("children"); JSONObject jsonObjectValue = jsonObject.getJSONObject(0);//济菏+德幸 - JSONArray array = jsonObjectValue.getJSONArray("children"); - JSONObject object = array.getJSONObject(0);//收费站 + JSONArray array = jsonObjectValue.getJSONArray("children");//济菏全部摄像头,0:旧+1:道路和摄像头+2:桥下 + JSONObject object = array.getJSONObject(1);//道路+收费站 JSONArray jsonArray = object.getJSONArray("children"); JSONArray objects = new JSONArray(); jsonArray.forEach(item->{ @@ -263,17 +263,21 @@ public class VideoController extends BaseController { } } }); - JSONObject arrayJSONObject = array.getJSONObject(1);//扩建 + JSONObject arrayJSONObject = array.getJSONObject(2);//桥下球机 JSONArray jiHeYunGuanG35 = arrayJSONObject.getJSONArray("children"); - for (int i = 0; i < objects.size(); i++) { - jiHeYunGuanG35.add(objects.get(i)); + for (int i = 0; i < jiHeYunGuanG35.size(); i++) { + JSONObject jiHeG35Value = jiHeYunGuanG35.getJSONObject(i); + if (jiHeG35Value.getJSONArray("children")!=null){ + JSONArray jiHeG35= jiHeG35Value.getJSONArray("children"); + for (int j=0;j list = new ArrayList<>(); - for (Object json : jiHeYunGuanG35) { + for (Object json : objects) { JSONObject item = JSONObject.parseObject(json.toString()); DcDevice device = new DcDevice(); if (item.get("status").equals(UniversalEnum.ZERO.getValue())) { diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcSwitchServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcSwitchServiceImpl.java index 48ca0ab4..5e457c14 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcSwitchServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcSwitchServiceImpl.java @@ -179,6 +179,7 @@ public class DcSwitchServiceImpl extends ServiceImpl i @Override public AjaxResult deviceDiagnostics(DcDeviceOfflineRecord device) throws Exception { String deviceIp = device.getDeviceIp(); + deviceIp = deviceIp.replaceAll("[\\r\\n]+", ""); String deviceType = device.getDeviceType(); RedisCache redisCache = SpringUtils.getBean(RedisCache.class); String cacheObject = redisCache.getCacheObject(DEVICEDIAGNOSTICS+deviceIp);//获取缓存是否存在诊断结果