...
|
...
|
@@ -115,16 +115,95 @@ func (t *TaskAnomaly) AnomalyDesc() (str string) { |
|
|
|
|
|
// 检查是否是反馈异常
|
|
|
func (t *TaskAnomaly) IsAssessFlag(taskData *Task, taskRecordData *TaskRecord) bool {
|
|
|
|
|
|
if taskData.Anomaly <= 0 {
|
|
|
return false
|
|
|
}
|
|
|
*t = TaskAnomaly{
|
|
|
Id: 0,
|
|
|
CreatedAt: time.Now(),
|
|
|
UpdatedAt: time.Now(),
|
|
|
CompanyId: taskData.CompanyId,
|
|
|
TaskId: taskData.Id,
|
|
|
TaskRecordId: taskRecordData.Id,
|
|
|
Category: AnomalyCategoryType2,
|
|
|
CurrentStage: taskData.CurrentStage,
|
|
|
LastStage: taskData.LastStage,
|
|
|
TaskStageCheck: taskRecordData.TaskStageCheck,
|
|
|
AssessFlag: 1,
|
|
|
WarnFlag: 0,
|
|
|
AssistFlag: 0,
|
|
|
IsLast: 1,
|
|
|
RecordBegin: xtime.DayZeroTime(taskRecordData.CreatedAt).Unix(),
|
|
|
NoticeWho: []map[string]string{},
|
|
|
Marks: map[string]string{
|
|
|
"a": "去更新", "b": "去反馈", "c": "找上级", "d": "去辅导",
|
|
|
},
|
|
|
Remark: "",
|
|
|
}
|
|
|
return true
|
|
|
}
|
|
|
|
|
|
// 检查是否是里程碑异常
|
|
|
func (t *TaskAnomaly) IsWarnFlag(taskData *Task, taskRecordData *TaskRecord) bool {
|
|
|
if taskData.CurrentStage.Id == 0 {
|
|
|
// 没有新的里程碑
|
|
|
return false
|
|
|
}
|
|
|
if taskData.CurrentStage.PlanCompletedAt > time.Now().Unix() {
|
|
|
//新的里程碑未过期, 不计入异常情况
|
|
|
return false
|
|
|
}
|
|
|
*t = TaskAnomaly{
|
|
|
Id: 0,
|
|
|
CreatedAt: time.Now(),
|
|
|
UpdatedAt: time.Now(),
|
|
|
CompanyId: taskData.CompanyId,
|
|
|
TaskId: taskData.Id,
|
|
|
TaskRecordId: taskRecordData.Id,
|
|
|
Category: AnomalyCategoryType1,
|
|
|
CurrentStage: taskData.CurrentStage,
|
|
|
LastStage: taskData.LastStage,
|
|
|
TaskStageCheck: taskRecordData.TaskStageCheck,
|
|
|
AssessFlag: 0,
|
|
|
WarnFlag: 1,
|
|
|
AssistFlag: 0,
|
|
|
IsLast: 1,
|
|
|
RecordBegin: xtime.DayZeroTime(taskRecordData.CreatedAt).Unix(),
|
|
|
NoticeWho: []map[string]string{},
|
|
|
Marks: map[string]string{
|
|
|
"a": "去更新", "b": "去反馈", "c": "找上级", "d": "去辅导",
|
|
|
},
|
|
|
Remark: "",
|
|
|
}
|
|
|
return true
|
|
|
}
|
|
|
|
|
|
// 检查是否是辅导异常
|
|
|
// 检查是否是辅导异常,
|
|
|
func (t *TaskAnomaly) IsAssistFlag(taskData *Task, taskRecordData *TaskRecord) bool {
|
|
|
if taskData.AssistFlag < taskData.AssistFlagMax {
|
|
|
return false
|
|
|
}
|
|
|
*t = TaskAnomaly{
|
|
|
Id: 0,
|
|
|
CreatedAt: time.Now(),
|
|
|
UpdatedAt: time.Now(),
|
|
|
CompanyId: taskData.CompanyId,
|
|
|
TaskId: taskData.Id,
|
|
|
TaskRecordId: taskRecordData.Id,
|
|
|
Category: AnomalyCategoryType3,
|
|
|
CurrentStage: taskData.CurrentStage,
|
|
|
LastStage: taskData.LastStage,
|
|
|
TaskStageCheck: taskRecordData.TaskStageCheck,
|
|
|
AssessFlag: taskData.Anomaly,
|
|
|
WarnFlag: taskData.WarnFlag,
|
|
|
AssistFlag: taskData.AssistFlag,
|
|
|
IsLast: 1,
|
|
|
RecordBegin: xtime.DayZeroTime(taskRecordData.CreatedAt).Unix(),
|
|
|
NoticeWho: []map[string]string{},
|
|
|
Marks: map[string]string{
|
|
|
"a": "去更新", "b": "去反馈", "c": "找上级", "d": "去辅导",
|
|
|
},
|
|
|
Remark: "",
|
|
|
}
|
|
|
return true
|
|
|
} |
...
|
...
|
|