作者 tangxvhui

更新

@@ -895,18 +895,24 @@ func (srv TaskService) ReplyTaskStage(transactionContext application.Transaction @@ -895,18 +895,24 @@ func (srv TaskService) ReplyTaskStage(transactionContext application.Transaction
895 if err != nil { 895 if err != nil {
896 return application.ThrowError(application.INTERNAL_SERVER_ERROR, "找不到任务数据"+err.Error()) 896 return application.ThrowError(application.INTERNAL_SERVER_ERROR, "找不到任务数据"+err.Error())
897 } 897 }
898 - if val.AnomalyState == domain.AnomalyState1 {  
899 - taskData.Anomaly = 0  
900 - }  
901 - taskList = append(taskList, taskData)  
902 _, stageList, err := taskStageRepo.Find(map[string]interface{}{"ids": []int{val.TaskStageCheck.Id}}) 898 _, stageList, err := taskStageRepo.Find(map[string]interface{}{"ids": []int{val.TaskStageCheck.Id}})
903 if err != nil { 899 if err != nil {
904 return application.ThrowError(application.INTERNAL_SERVER_ERROR, "找不到任务里程碑数据"+err.Error()) 900 return application.ThrowError(application.INTERNAL_SERVER_ERROR, "找不到任务里程碑数据"+err.Error())
905 } 901 }
  902 + if val.AnomalyState == domain.AnomalyState1 {
  903 + taskData.Anomaly = 0
  904 + }
906 if len(stageList) > 0 { 905 if len(stageList) > 0 {
907 stageList[0].RealCompletedAt = val.TaskStageCheck.RealCompletedAt 906 stageList[0].RealCompletedAt = val.TaskStageCheck.RealCompletedAt
908 taskStages = append(taskStages, stageList[0]) 907 taskStages = append(taskStages, stageList[0])
  908 + if stageList[0].PlanCompletedAt < stageList[0].RealCompletedAt {
  909 + taskData.WarnFlag = domain.TaskWarn
  910 + } else {
  911 + taskData.WarnFlag = domain.TaskWarnNull
  912 + }
909 } 913 }
  914 +
  915 + taskList = append(taskList, taskData)
910 } 916 }
911 err := taskStageRepo.Save(taskStages) 917 err := taskStageRepo.Save(taskStages)
912 if err != nil { 918 if err != nil {