fix: abnormal NE state alarm gen task
This commit is contained in:
@@ -1124,7 +1124,9 @@ type Alarm struct {
|
||||
PVFlag string `json:"pvFlag" xorm:"pv_flag"`
|
||||
NeName string `json:"neName"`
|
||||
NeType string `json:"neType"`
|
||||
ObjectUid string `json:"objectUid" xorm:"object_uid"`
|
||||
ObjectName string `json:"objectName" xorm:"object_name"`
|
||||
ObjectType string `json:"objectType" xorm:"object_type"`
|
||||
LocationInfo string `json:"locationInfo"`
|
||||
Province string `json:"province"`
|
||||
AlarmStatus int `json:"alarmStatus"`
|
||||
@@ -1864,3 +1866,36 @@ func XormInsertNeState(neState *NeState) (int64, error) {
|
||||
}
|
||||
return affected, err
|
||||
}
|
||||
|
||||
type AlarmDefine struct {
|
||||
AlarmId string `json:"alarmId" xorm:"alarm_id"`
|
||||
AlarmCode int `json:"alarmCode" xorm:"alarm_code"`
|
||||
AlarmTitle string `json:"alarmTitle" xorm:"alarm_title"`
|
||||
NeType string `json:"neType" xorm:"ne_type"`
|
||||
AlarmType string `json:"alarmType" xorm:"alarm_type"`
|
||||
OrigSeverity string `json:"origSeverity" xorm:"orig_severity"`
|
||||
ObjectUid string `json:"objectUid" xorm:"object_uid"`
|
||||
ObjectName string `json:"objectName" xorm:"object_name"`
|
||||
ObjectType string `json:"objectType" xorm:"object_type"`
|
||||
LocationInfo string `json:"locationInfo"`
|
||||
SpecificProblem string `json:"specificProblem"`
|
||||
SpecificProblemId string `json:"specificProblemId" xorm:"specific_problem_id"`
|
||||
AddInfo string `json:"addInfo" xorm:"add_info"`
|
||||
Threshold int64 `json:"threshold" xorm:"threshold"`
|
||||
Status string `json:"status" xorm:"status"`
|
||||
}
|
||||
|
||||
func XormGetAlarmDefine(alarmCode string) (*AlarmDefine, error) {
|
||||
log.Debug("XormGetAlarmDefine processing... ")
|
||||
|
||||
alarmDefine := new(AlarmDefine)
|
||||
_, err := xEngine.
|
||||
Where("alarm_code=? and status='Active'", alarmCode).
|
||||
Get(alarmDefine)
|
||||
if err != nil {
|
||||
log.Error("Failed to get table alarm_define from database:", err)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return alarmDefine, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user