diff --git a/zfipc-server/zfipc-datasyn/src/main/java/com/inspur/datasyn/modbus/IPCDataSyncTask.java b/zfipc-server/zfipc-datasyn/src/main/java/com/inspur/datasyn/modbus/IPCDataSyncTask.java index 702b38f..72a2c55 100644 --- a/zfipc-server/zfipc-datasyn/src/main/java/com/inspur/datasyn/modbus/IPCDataSyncTask.java +++ b/zfipc-server/zfipc-datasyn/src/main/java/com/inspur/datasyn/modbus/IPCDataSyncTask.java @@ -28,8 +28,8 @@ public class IPCDataSyncTask implements ApplicationRunner { @Autowired private ThreadPoolTaskExecutor threadPoolTaskExecutor; - @Autowired - private IIpcAlarmRulesService ipcAlarmRulesService; +// @Autowired +// private IIpcAlarmRulesService ipcAlarmRulesService; @Value("${datasyn.modbus.host}") private String host; @@ -81,7 +81,7 @@ public class IPCDataSyncTask implements ApplicationRunner { } },1000,1000); - ipcAlarmRulesService.tran(); +// ipcAlarmRulesService.tran(); } } } diff --git a/zfipc-server/zfipc-system/src/main/java/com/inspur/industrial/service/IIpcAlarmRulesService.java b/zfipc-server/zfipc-system/src/main/java/com/inspur/industrial/service/IIpcAlarmRulesService.java index 0061540..bdee9f0 100644 --- a/zfipc-server/zfipc-system/src/main/java/com/inspur/industrial/service/IIpcAlarmRulesService.java +++ b/zfipc-server/zfipc-system/src/main/java/com/inspur/industrial/service/IIpcAlarmRulesService.java @@ -27,7 +27,7 @@ public interface IIpcAlarmRulesService */ public List selectIpcAlarmRulesList(IpcAlarmRules ipcAlarmRules); - public void tran(); +// public void tran(); /** * 新增设备报警规则 diff --git a/zfipc-server/zfipc-system/src/main/java/com/inspur/industrial/service/impl/IpcAlarmRulesServiceImpl.java b/zfipc-server/zfipc-system/src/main/java/com/inspur/industrial/service/impl/IpcAlarmRulesServiceImpl.java index ed86d0f..b454ce0 100644 --- a/zfipc-server/zfipc-system/src/main/java/com/inspur/industrial/service/impl/IpcAlarmRulesServiceImpl.java +++ b/zfipc-server/zfipc-system/src/main/java/com/inspur/industrial/service/impl/IpcAlarmRulesServiceImpl.java @@ -54,30 +54,30 @@ public class IpcAlarmRulesServiceImpl implements IIpcAlarmRulesService return ipcAlarmRulesMapper.selectIpcAlarmRulesList(ipcAlarmRules); } - public void tran(){ - List list = ipcMonitorDataInfoService.selectIpcMonitorDataInfoList(null); - AtomicInteger num = new AtomicInteger(1); - list.forEach(data ->{ - for(int t = 0; t <=1; t++){ - IpcAlarmRules ipcAlarmRules = new IpcAlarmRules(); - ipcAlarmRules.setId(IdUtils.simpleUUID()); - ipcAlarmRules.setAlarmName(data.getDataName()); - ipcAlarmRules.setEquipId(data.getEquipId()); - ipcAlarmRules.setAlarmInfoUnit(data.getDataUnit()); - ipcAlarmRules.setAlarmNameKey(data.getDataKey()); - ipcAlarmRules.setAlertLowerBound(BigDecimal.valueOf(0.81)); - ipcAlarmRules.setAlertUpperBound(BigDecimal.valueOf(1.52)); - ipcAlarmRules.setReferenceCon("区间外"); - ipcAlarmRules.setReferenceName(data.getDataName() + "超出 " + ipcAlarmRules.getAlertLowerBound() + "~" + ipcAlarmRules.getAlertUpperBound()); - ipcAlarmRules.setAlarmLevel(1); - ipcAlarmRules.setType(t); - ipcAlarmRules.setSort(num.get()); - ipcAlarmRulesMapper.insertIpcAlarmRules(ipcAlarmRules); - } - num.getAndIncrement(); - - }); - } +// public void tran(){ +// List list = ipcMonitorDataInfoService.selectIpcMonitorDataInfoList(null); +// AtomicInteger num = new AtomicInteger(1); +// list.forEach(data ->{ +// for(int t = 0; t <=1; t++){ +// IpcAlarmRules ipcAlarmRules = new IpcAlarmRules(); +// ipcAlarmRules.setId(IdUtils.simpleUUID()); +// ipcAlarmRules.setAlarmName(data.getDataName()); +// ipcAlarmRules.setEquipId(data.getEquipId()); +// ipcAlarmRules.setAlarmInfoUnit(data.getDataUnit()); +// ipcAlarmRules.setAlarmNameKey(data.getDataKey()); +// ipcAlarmRules.setAlertLowerBound(BigDecimal.valueOf(0.81)); +// ipcAlarmRules.setAlertUpperBound(BigDecimal.valueOf(1.52)); +// ipcAlarmRules.setReferenceCon("区间外"); +// ipcAlarmRules.setReferenceName(data.getDataName() + "超出 " + ipcAlarmRules.getAlertLowerBound() + "~" + ipcAlarmRules.getAlertUpperBound()); +// ipcAlarmRules.setAlarmLevel(1); +// ipcAlarmRules.setType(t); +// ipcAlarmRules.setSort(num.get()); +// ipcAlarmRulesMapper.insertIpcAlarmRules(ipcAlarmRules); +// } +// num.getAndIncrement(); +// +// }); +// } /** * 新增设备报警规则