...
|
...
|
@@ -36,6 +36,13 @@ type TaskAnomaly struct { |
|
|
Remark string `json:"remark"`
|
|
|
}
|
|
|
|
|
|
// 存储
|
|
|
type TaskAnomalyRepository interface {
|
|
|
Save(param *TaskAnomaly) error
|
|
|
FindOne(queryOptions map[string]interface{}) (*TaskAnomaly, error)
|
|
|
Find(queryOptions map[string]interface{}) (int, []*TaskAnomaly, error)
|
|
|
}
|
|
|
|
|
|
// 已点击“去更新”
|
|
|
func (t *TaskAnomaly) MarkA() {
|
|
|
t.Marks["a"] = "已更新"
|
...
|
...
|
@@ -72,19 +79,10 @@ func (t *TaskAnomaly) AnomalyDesc() (str string) { |
|
|
case 1:
|
|
|
//里程碑异常
|
|
|
{
|
|
|
if t.TaskStageCheck.RealCompletedAt == 0 {
|
|
|
//逾期未完成
|
|
|
planCompletedAt := time.Unix(t.TaskStageCheck.PlanCompletedAt, 0)
|
|
|
subDay := xtime.SubDayAbs(nowTime, planCompletedAt)
|
|
|
str = fmt.Sprintf("里程碑%s已逾期%d天", t.TaskStageCheck.Name, subDay)
|
|
|
} else {
|
|
|
//逾期完成
|
|
|
planCompletedAt := time.Unix(t.TaskStageCheck.PlanCompletedAt, 0)
|
|
|
realCompletedAt := time.Unix(t.TaskStageCheck.RealCompletedAt, 0)
|
|
|
subDay := xtime.SubDayAbs(realCompletedAt, planCompletedAt)
|
|
|
str = fmt.Sprintf("里程碑%s逾期%d天完成", t.TaskStageCheck.Name, subDay)
|
|
|
|
|
|
}
|
|
|
//逾期未完成
|
|
|
planCompletedAt := time.Unix(t.CurrentStage.PlanCompletedAt, 0)
|
|
|
subDay := xtime.SubDayAbs(nowTime, planCompletedAt)
|
|
|
str = fmt.Sprintf("里程碑%s已逾期%d天", t.TaskStageCheck.Name, subDay)
|
|
|
}
|
|
|
case 2:
|
|
|
//反馈异常
|
...
|
...
|
@@ -99,7 +97,7 @@ func (t *TaskAnomaly) AnomalyDesc() (str string) { |
|
|
|
|
|
}
|
|
|
case 3:
|
|
|
// 辅导异常
|
|
|
// 辅导异常 TODO
|
|
|
{
|
|
|
recordBegin := time.Unix(t.RecordBegin, 0)
|
|
|
subDay := xtime.SubDayAbs(nowTime, recordBegin)
|
...
|
...
|
@@ -115,16 +113,18 @@ func (t *TaskAnomaly) AnomalyDesc() (str string) { |
|
|
return str
|
|
|
}
|
|
|
|
|
|
// 发生异常后的天数
|
|
|
// func (t *TaskAnomaly) CountAnomalyDay() int {
|
|
|
// t1 := t.CreatedAt
|
|
|
// t2 := time.Unix(t.RecordBegin, 0)
|
|
|
// return xtime.SubDayAbs(t1, t2)
|
|
|
// }
|
|
|
// 检查是否是反馈异常
|
|
|
func (t *TaskAnomaly) IsAssessFlag(taskData *Task, taskRecordData *TaskRecord) bool {
|
|
|
|
|
|
// 存储
|
|
|
type TaskAnomalyRepository interface {
|
|
|
Save(param *TaskAnomaly) error
|
|
|
FindOne(queryOptions map[string]interface{}) (*TaskAnomaly, error)
|
|
|
Find(queryOptions map[string]interface{}) (int, []*TaskAnomaly, error)
|
|
|
return false
|
|
|
}
|
|
|
|
|
|
// 检查是否是里程碑异常
|
|
|
func (t *TaskAnomaly) IsWarnFlag(taskData *Task, taskRecordData *TaskRecord) bool {
|
|
|
return false
|
|
|
}
|
|
|
|
|
|
// 检查是否是辅导异常
|
|
|
func (t *TaskAnomaly) IsAssistFlag(taskData *Task, taskRecordData *TaskRecord) bool {
|
|
|
return false
|
|
|
} |
...
|
...
|
|