Browse Source

update 双控告警事件 采用判断时间 避免 原有采用告警时间 导致的 首条详情可能被覆盖

dev
lucas 1 week ago
parent
commit
bf1393a610
  1. 8
      consumers/consumerAxySkAlarm.go

8
consumers/consumerAxySkAlarm.go

@ -313,8 +313,8 @@ func (the *consumerAxySkAlarm) skAlarmInfo(alarmInfoTemplate *models.EsAlarm, le
AlarmTypeCode: "3077",
AlarmCode: fmt.Sprintf("3077000%d", level),
Content: detail,
Time: alarmTime.Add(8 * time.Hour).Format("2006-01-02T15:04:05.000+0800"),
SourceTypeId: 2, // 0:DTU, 1:传感器, 2:测点
Time: time.Now().Format("2006-01-02T15:04:05.000+0800"), //避免历史告警触发 导致首次详情被覆盖//alarmTime.Add(8 * time.Hour).Format("2006-01-02T15:04:05.000+0800"),
SourceTypeId: 2, // 0:DTU, 1:传感器, 2:测点
Sponsor: "goInOut_axySkAlarm",
Extras: nil,
SubDevices: triggerTypeCodes,
@ -427,8 +427,6 @@ func (the *consumerAxySkAlarm) isRuleAlarm(trigger AXY_SK.AlarmTrigger, stationA
dt = stationAlarm.Alarm3007.EndTime
}
triggerTypeCodes = append(triggerTypeCodes, stationAlarm.Alarm3007.AlarmTypeCode)
} else {
detail += fmt.Sprintf("测量值恢复正常")
}
case 1:
if stationAlarm.Alarm3008 != nil && stationAlarm.Alarm3008.CurrentLevel <= trigger.AlarmLevel {
@ -438,8 +436,6 @@ func (the *consumerAxySkAlarm) isRuleAlarm(trigger AXY_SK.AlarmTrigger, stationA
dt = stationAlarm.Alarm3008.EndTime
}
triggerTypeCodes = append(triggerTypeCodes, stationAlarm.Alarm3008.AlarmTypeCode)
} else {
detail += fmt.Sprintf("变化速率恢复正常")
}
}

Loading…
Cancel
Save