作者 tangxvhui

调整规则

... ... @@ -39,7 +39,7 @@ func TestCreatTaskAnamaly(t *testing.T) {
"transactionContext": transactionContext,
})
_, taskRacordList, err := taskRecordRepo.Find(map[string]interface{}{
"ids": []int{1676429193136574464},
"ids": []int{1676621987880898560},
})
if err != nil {
t.Error(err)
... ...
... ... @@ -150,7 +150,7 @@ func (srv TaskService) listTaskAnomaly2(param *command.ListTaskAnomalyCommand) (
item.AnomalyDesc2 = map[string]string{
"types": "2",
"dayTime": recordBegin.Local().Format("2006-01-02"),
"interval": strconv.Itoa(subDay),
"interval": strconv.Itoa(val.AssessFlag),
"noticeWho": strings.Join(noticeWho, ","),
}
}
... ... @@ -315,7 +315,7 @@ func (srv TaskService) listTaskAnomaly3(param *command.ListTaskAnomalyCommand) (
item.AnomalyDesc2 = map[string]string{
"types": "2",
"dayTime": recordBegin.Local().Format("2006-01-02"),
"interval": strconv.Itoa(subDay),
"interval": strconv.Itoa(val.AssessFlag),
"noticeWho": strings.Join(noticeWho, ","),
}
}
... ... @@ -535,7 +535,7 @@ func (srv TaskService) ListTaskAnomaly1(param *command.ListTaskAnomalyCommand) (
item.AnomalyDesc2 = map[string]string{
"types": "2",
"dayTime": recordBegin.Local().Format("2006-01-02"),
"interval": strconv.Itoa(subDay),
"interval": strconv.Itoa(val.AssessFlag),
"noticeWho": strings.Join(noticeWho, ","),
}
}
... ... @@ -993,7 +993,7 @@ func (srv TaskService) TaskAnomalyInfo(param *command.GetTaskAnomalyCommand) (*a
result.AnomalyDesc2 = map[string]string{
"types": "2",
"dayTime": recordBegin.Local().Format("2006-01-02"),
"interval": strconv.Itoa(subDay),
"interval": strconv.Itoa(anomalyData.AssessFlag),
"noticeWho": strings.Join(noticeWho, ","),
}
}
... ... @@ -1301,7 +1301,7 @@ func (srv TaskService) ListTaskAnomaly4(param *command.ListTaskAnomalyCommand) (
item.AnomalyDesc2 = map[string]string{
"types": "2",
"dayTime": recordBegin.Local().Format("2006-01-02"),
"interval": strconv.Itoa(subDay),
"interval": strconv.Itoa(val.AssessFlag),
"noticeWho": strings.Join(noticeWho, ","),
}
}
... ...
... ... @@ -129,7 +129,7 @@ func (t *TaskAnomaly) IsAssessFlag(taskData *Task, taskRecordData *TaskRecord) b
CurrentStage: taskData.CurrentStage,
LastStage: taskData.LastStage,
TaskStageCheck: taskRecordData.TaskStageCheck,
AssessFlag: 1,
AssessFlag: taskData.AssistFlag,
WarnFlag: 0,
AssistFlag: 0,
IsLast: 1,
... ... @@ -195,7 +195,7 @@ func (t *TaskAnomaly) IsAssistFlag(taskData *Task, taskRecordData *TaskRecord) b
LastStage: taskData.LastStage,
TaskStageCheck: taskRecordData.TaskStageCheck,
AssessFlag: taskData.Anomaly,
WarnFlag: taskData.WarnFlag,
WarnFlag: 0,
AssistFlag: taskData.AssistFlag,
IsLast: 1,
RecordBegin: xtime.DayZeroTime(taskRecordData.CreatedAt).Unix(),
... ... @@ -205,5 +205,9 @@ func (t *TaskAnomaly) IsAssistFlag(taskData *Task, taskRecordData *TaskRecord) b
},
Remark: "",
}
nowTime := xtime.DayZeroTime(time.Now()).Unix()
if taskData.CurrentStage.Id > 0 && taskData.CurrentStage.PlanCompletedAt < nowTime {
t.WarnFlag = 1
}
return true
}
... ...