Commit 0ab617cc authored by tangwei's avatar tangwei

告警覆盖相同告警

parent eaea4466
......@@ -240,7 +240,7 @@ public class SelfSupportListener extends EmqxListener implements InitializingBea
//增建告警记录表
//告警记录
List<Alarm> curAlarmList = alarmService.findByQueryColumn(eqpId+"");
List<Alarm> curAlarmList = alarmService.findByQueryColumn(eqpId+metricKey);
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
if (curAlarmList != null && curAlarmList.size() > 0) {
// if("异常".equals(curAlarmList.get(0).getCurrentState())){
......@@ -251,6 +251,9 @@ public class SelfSupportListener extends EmqxListener implements InitializingBea
}else{
alarm.setCurrentState("正常");
}
alarm.setQueryColumn(eqpId+metricKey);
alarm.setAlarmSourceType(metricKey);
alarm.setClearPerson(metricKey);
iAlarmDao.save(alarm);
// }
} else {
......@@ -274,7 +277,7 @@ public class SelfSupportListener extends EmqxListener implements InitializingBea
alarm.setEnsurePerson("");
alarm.setOrgCode(orgCode1);
alarm.setUpdateDate(df.format(new Date()));
alarm.setQueryColumn(eqpId+"");
alarm.setQueryColumn(eqpId+metricKey);
iAlarmDao.save(alarm);
}
} catch (Exception e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment