From 7977dce747a8ba37e0558edd1de7a95da0d3efea Mon Sep 17 00:00:00 2001 From: wangsixiang <2970484253@qq.com> Date: Tue, 5 Nov 2024 18:57:14 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=8A=E6=96=AD=E9=80=BB=E8=BE=91=E4=BF=AE?= =?UTF-8?q?=E6=94=B9,=E6=9C=BA=E6=9F=9C=E6=93=8D=E4=BD=9C=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E4=B8=8D=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zc/business/constant/RedisStreamConstants.java | 14 +++++++------- .../zc/business/interfaces/OperationLogAspect.java | 7 ++++++- .../business/service/impl/DcSwitchServiceImpl.java | 5 +++++ 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/constant/RedisStreamConstants.java b/zc-business/src/main/java/com/zc/business/constant/RedisStreamConstants.java index 164aa588..c1a102da 100644 --- a/zc-business/src/main/java/com/zc/business/constant/RedisStreamConstants.java +++ b/zc-business/src/main/java/com/zc/business/constant/RedisStreamConstants.java @@ -10,7 +10,7 @@ public class RedisStreamConstants { */ public static class DeviceOnline { public final static String KEY = "device:online"; - public final static String GROUP = "group2"; + public final static String GROUP = "group1"; public final static String CONSUMER = "consumer1"; } @@ -19,7 +19,7 @@ public class RedisStreamConstants { */ public static class DeviceOffline { public final static String KEY = "device:offline"; - public final static String GROUP = "group2"; + public final static String GROUP = "group1"; public final static String CONSUMER = "consumer1"; } @@ -28,7 +28,7 @@ public class RedisStreamConstants { */ public static class DeviceEvent { public final static String KEY = "device:event"; - public final static String GROUP = "group2"; + public final static String GROUP = "group1"; public final static String CONSUMER = "consumer1"; } @@ -37,7 +37,7 @@ public class RedisStreamConstants { */ public static class DevicePropertyReport { public final static String KEY = "device:property:report"; - public final static String GROUP = "group2"; + public final static String GROUP = "group1"; public final static String CONSUMER = "consumer1"; } @@ -46,7 +46,7 @@ public class RedisStreamConstants { */ public static class DevicePropertyReadReply { public final static String KEY = "device:property:read:reply"; - public final static String GROUP = "group2"; + public final static String GROUP = "group1"; public final static String CONSUMER = "consumer1"; } @@ -56,7 +56,7 @@ public class RedisStreamConstants { */ public static class DevicePropertyWriteReply { public final static String KEY = "device:property:write:reply"; - public final static String GROUP = "group2"; + public final static String GROUP = "group1"; public final static String CONSUMER = "consumer1"; } @@ -65,7 +65,7 @@ public class RedisStreamConstants { */ public static class DeviceFunctionReply { public final static String KEY = "device:function:reply"; - public final static String GROUP = "group2"; + public final static String GROUP = "group1"; public final static String CONSUMER = "consumer1"; } diff --git a/zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java b/zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java index a976bb51..503c56ed 100644 --- a/zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java +++ b/zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java @@ -211,6 +211,9 @@ public class OperationLogAspect { String functionId = function.getString("functionId"); + if (deviceType.equals("17")||deviceType.equals("18")){ //动环数据操作日志暂不放进数据库 + return; + } if (Objects.equals(functionId, UniversalEnum.A_ONE.getValue()) || Objects.equals(functionId, UniversalEnum.A_TWO.getValue()) || Objects.equals(functionId, UniversalEnum.A_THREE.getValue()) || @@ -568,7 +571,9 @@ public class OperationLogAspect { String functionId = String.valueOf(pointArgs[UniversalEnum.ONE.getNumber()]); JSONObject params = (JSONObject) JSON.toJSON(pointArgs[UniversalEnum.TWO.getNumber()]); - + if (deviceType.equals("17")||deviceType.equals("18")){ //动环数据操作日志暂不放进数据库 + return; + } if (Objects.equals(functionId, UniversalEnum.A_ONE.getValue()) || Objects.equals(functionId, UniversalEnum.A_TWO.getValue()) || Objects.equals(functionId, UniversalEnum.A_THREE.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 f0161678..35e05223 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 @@ -208,6 +208,11 @@ public class DcSwitchServiceImpl extends ServiceImpl i .filter(dcSwitch -> dcSwitch.getDeviceList().contains(deviceIdString)) .findFirst().map(DcSwitch::getSwitchIp).orElse(null); if (StringUtils.isBlank(switchIp)){ //switchIp为空不存在交换机ip + InetAddress newDeviceIpCurrent = InetAddress.getByName(deviceIp);//传入的当前设备ip + if (!newDeviceIpCurrent.isReachable(UniversalEnum.FIVE_THOUSAND.getNumber())) { + redisCache.setCacheObject(DEVICEDIAGNOSTICS+deviceIp,"当前设备ip"+deviceIp+"网络异常",2, TimeUnit.MINUTES); + return AjaxResult.success("当前设备ip"+deviceIp+"网络异常"); + } redisCache.setCacheObject(DEVICEDIAGNOSTICS+deviceIp,"未查询到相关的交换机",2, TimeUnit.MINUTES); return AjaxResult.success("未查询到相关的交换机"); }