Browse Source

诊断逻辑修改,机柜操作日志不记录

develop
wangsixiang 3 weeks ago
parent
commit
7977dce747
  1. 14
      zc-business/src/main/java/com/zc/business/constant/RedisStreamConstants.java
  2. 7
      zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java
  3. 5
      zc-business/src/main/java/com/zc/business/service/impl/DcSwitchServiceImpl.java

14
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";
}

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

5
zc-business/src/main/java/com/zc/business/service/impl/DcSwitchServiceImpl.java

@ -208,6 +208,11 @@ public class DcSwitchServiceImpl extends ServiceImpl<DcSwitchMapper, DcSwitch> 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("未查询到相关的交换机");
}

Loading…
Cancel
Save