作者 tangxvhui

调整规则

@@ -39,7 +39,7 @@ func TestCreatTaskAnamaly(t *testing.T) { @@ -39,7 +39,7 @@ func TestCreatTaskAnamaly(t *testing.T) {
39 "transactionContext": transactionContext, 39 "transactionContext": transactionContext,
40 }) 40 })
41 _, taskRacordList, err := taskRecordRepo.Find(map[string]interface{}{ 41 _, taskRacordList, err := taskRecordRepo.Find(map[string]interface{}{
42 - "ids": []int{1676429193136574464}, 42 + "ids": []int{1676621987880898560},
43 }) 43 })
44 if err != nil { 44 if err != nil {
45 t.Error(err) 45 t.Error(err)
@@ -150,7 +150,7 @@ func (srv TaskService) listTaskAnomaly2(param *command.ListTaskAnomalyCommand) ( @@ -150,7 +150,7 @@ func (srv TaskService) listTaskAnomaly2(param *command.ListTaskAnomalyCommand) (
150 item.AnomalyDesc2 = map[string]string{ 150 item.AnomalyDesc2 = map[string]string{
151 "types": "2", 151 "types": "2",
152 "dayTime": recordBegin.Local().Format("2006-01-02"), 152 "dayTime": recordBegin.Local().Format("2006-01-02"),
153 - "interval": strconv.Itoa(subDay), 153 + "interval": strconv.Itoa(val.AssessFlag),
154 "noticeWho": strings.Join(noticeWho, ","), 154 "noticeWho": strings.Join(noticeWho, ","),
155 } 155 }
156 } 156 }
@@ -315,7 +315,7 @@ func (srv TaskService) listTaskAnomaly3(param *command.ListTaskAnomalyCommand) ( @@ -315,7 +315,7 @@ func (srv TaskService) listTaskAnomaly3(param *command.ListTaskAnomalyCommand) (
315 item.AnomalyDesc2 = map[string]string{ 315 item.AnomalyDesc2 = map[string]string{
316 "types": "2", 316 "types": "2",
317 "dayTime": recordBegin.Local().Format("2006-01-02"), 317 "dayTime": recordBegin.Local().Format("2006-01-02"),
318 - "interval": strconv.Itoa(subDay), 318 + "interval": strconv.Itoa(val.AssessFlag),
319 "noticeWho": strings.Join(noticeWho, ","), 319 "noticeWho": strings.Join(noticeWho, ","),
320 } 320 }
321 } 321 }
@@ -535,7 +535,7 @@ func (srv TaskService) ListTaskAnomaly1(param *command.ListTaskAnomalyCommand) ( @@ -535,7 +535,7 @@ func (srv TaskService) ListTaskAnomaly1(param *command.ListTaskAnomalyCommand) (
535 item.AnomalyDesc2 = map[string]string{ 535 item.AnomalyDesc2 = map[string]string{
536 "types": "2", 536 "types": "2",
537 "dayTime": recordBegin.Local().Format("2006-01-02"), 537 "dayTime": recordBegin.Local().Format("2006-01-02"),
538 - "interval": strconv.Itoa(subDay), 538 + "interval": strconv.Itoa(val.AssessFlag),
539 "noticeWho": strings.Join(noticeWho, ","), 539 "noticeWho": strings.Join(noticeWho, ","),
540 } 540 }
541 } 541 }
@@ -993,7 +993,7 @@ func (srv TaskService) TaskAnomalyInfo(param *command.GetTaskAnomalyCommand) (*a @@ -993,7 +993,7 @@ func (srv TaskService) TaskAnomalyInfo(param *command.GetTaskAnomalyCommand) (*a
993 result.AnomalyDesc2 = map[string]string{ 993 result.AnomalyDesc2 = map[string]string{
994 "types": "2", 994 "types": "2",
995 "dayTime": recordBegin.Local().Format("2006-01-02"), 995 "dayTime": recordBegin.Local().Format("2006-01-02"),
996 - "interval": strconv.Itoa(subDay), 996 + "interval": strconv.Itoa(anomalyData.AssessFlag),
997 "noticeWho": strings.Join(noticeWho, ","), 997 "noticeWho": strings.Join(noticeWho, ","),
998 } 998 }
999 } 999 }
@@ -1301,7 +1301,7 @@ func (srv TaskService) ListTaskAnomaly4(param *command.ListTaskAnomalyCommand) ( @@ -1301,7 +1301,7 @@ func (srv TaskService) ListTaskAnomaly4(param *command.ListTaskAnomalyCommand) (
1301 item.AnomalyDesc2 = map[string]string{ 1301 item.AnomalyDesc2 = map[string]string{
1302 "types": "2", 1302 "types": "2",
1303 "dayTime": recordBegin.Local().Format("2006-01-02"), 1303 "dayTime": recordBegin.Local().Format("2006-01-02"),
1304 - "interval": strconv.Itoa(subDay), 1304 + "interval": strconv.Itoa(val.AssessFlag),
1305 "noticeWho": strings.Join(noticeWho, ","), 1305 "noticeWho": strings.Join(noticeWho, ","),
1306 } 1306 }
1307 } 1307 }
@@ -129,7 +129,7 @@ func (t *TaskAnomaly) IsAssessFlag(taskData *Task, taskRecordData *TaskRecord) b @@ -129,7 +129,7 @@ func (t *TaskAnomaly) IsAssessFlag(taskData *Task, taskRecordData *TaskRecord) b
129 CurrentStage: taskData.CurrentStage, 129 CurrentStage: taskData.CurrentStage,
130 LastStage: taskData.LastStage, 130 LastStage: taskData.LastStage,
131 TaskStageCheck: taskRecordData.TaskStageCheck, 131 TaskStageCheck: taskRecordData.TaskStageCheck,
132 - AssessFlag: 1, 132 + AssessFlag: taskData.AssistFlag,
133 WarnFlag: 0, 133 WarnFlag: 0,
134 AssistFlag: 0, 134 AssistFlag: 0,
135 IsLast: 1, 135 IsLast: 1,
@@ -195,7 +195,7 @@ func (t *TaskAnomaly) IsAssistFlag(taskData *Task, taskRecordData *TaskRecord) b @@ -195,7 +195,7 @@ func (t *TaskAnomaly) IsAssistFlag(taskData *Task, taskRecordData *TaskRecord) b
195 LastStage: taskData.LastStage, 195 LastStage: taskData.LastStage,
196 TaskStageCheck: taskRecordData.TaskStageCheck, 196 TaskStageCheck: taskRecordData.TaskStageCheck,
197 AssessFlag: taskData.Anomaly, 197 AssessFlag: taskData.Anomaly,
198 - WarnFlag: taskData.WarnFlag, 198 + WarnFlag: 0,
199 AssistFlag: taskData.AssistFlag, 199 AssistFlag: taskData.AssistFlag,
200 IsLast: 1, 200 IsLast: 1,
201 RecordBegin: xtime.DayZeroTime(taskRecordData.CreatedAt).Unix(), 201 RecordBegin: xtime.DayZeroTime(taskRecordData.CreatedAt).Unix(),
@@ -205,5 +205,9 @@ func (t *TaskAnomaly) IsAssistFlag(taskData *Task, taskRecordData *TaskRecord) b @@ -205,5 +205,9 @@ func (t *TaskAnomaly) IsAssistFlag(taskData *Task, taskRecordData *TaskRecord) b
205 }, 205 },
206 Remark: "", 206 Remark: "",
207 } 207 }
  208 + nowTime := xtime.DayZeroTime(time.Now()).Unix()
  209 + if taskData.CurrentStage.Id > 0 && taskData.CurrentStage.PlanCompletedAt < nowTime {
  210 + t.WarnFlag = 1
  211 + }
208 return true 212 return true
209 } 213 }