|
@@ -36,6 +36,13 @@ type TaskAnomaly struct { |
|
@@ -36,6 +36,13 @@ type TaskAnomaly struct { |
36
|
Remark string `json:"remark"`
|
36
|
Remark string `json:"remark"`
|
37
|
}
|
37
|
}
|
38
|
|
38
|
|
|
|
39
|
+// 存储
|
|
|
40
|
+type TaskAnomalyRepository interface {
|
|
|
41
|
+ Save(param *TaskAnomaly) error
|
|
|
42
|
+ FindOne(queryOptions map[string]interface{}) (*TaskAnomaly, error)
|
|
|
43
|
+ Find(queryOptions map[string]interface{}) (int, []*TaskAnomaly, error)
|
|
|
44
|
+}
|
|
|
45
|
+
|
39
|
// 已点击“去更新”
|
46
|
// 已点击“去更新”
|
40
|
func (t *TaskAnomaly) MarkA() {
|
47
|
func (t *TaskAnomaly) MarkA() {
|
41
|
t.Marks["a"] = "已更新"
|
48
|
t.Marks["a"] = "已更新"
|
|
@@ -72,19 +79,10 @@ func (t *TaskAnomaly) AnomalyDesc() (str string) { |
|
@@ -72,19 +79,10 @@ func (t *TaskAnomaly) AnomalyDesc() (str string) { |
72
|
case 1:
|
79
|
case 1:
|
73
|
//里程碑异常
|
80
|
//里程碑异常
|
74
|
{
|
81
|
{
|
75
|
- if t.TaskStageCheck.RealCompletedAt == 0 {
|
|
|
76
|
//逾期未完成
|
82
|
//逾期未完成
|
77
|
- planCompletedAt := time.Unix(t.TaskStageCheck.PlanCompletedAt, 0)
|
83
|
+ planCompletedAt := time.Unix(t.CurrentStage.PlanCompletedAt, 0)
|
78
|
subDay := xtime.SubDayAbs(nowTime, planCompletedAt)
|
84
|
subDay := xtime.SubDayAbs(nowTime, planCompletedAt)
|
79
|
str = fmt.Sprintf("里程碑%s已逾期%d天", t.TaskStageCheck.Name, subDay)
|
85
|
str = fmt.Sprintf("里程碑%s已逾期%d天", t.TaskStageCheck.Name, subDay)
|
80
|
- } else {
|
|
|
81
|
- //逾期完成
|
|
|
82
|
- planCompletedAt := time.Unix(t.TaskStageCheck.PlanCompletedAt, 0)
|
|
|
83
|
- realCompletedAt := time.Unix(t.TaskStageCheck.RealCompletedAt, 0)
|
|
|
84
|
- subDay := xtime.SubDayAbs(realCompletedAt, planCompletedAt)
|
|
|
85
|
- str = fmt.Sprintf("里程碑%s逾期%d天完成", t.TaskStageCheck.Name, subDay)
|
|
|
86
|
-
|
|
|
87
|
- }
|
|
|
88
|
}
|
86
|
}
|
89
|
case 2:
|
87
|
case 2:
|
90
|
//反馈异常
|
88
|
//反馈异常
|
|
@@ -99,7 +97,7 @@ func (t *TaskAnomaly) AnomalyDesc() (str string) { |
|
@@ -99,7 +97,7 @@ func (t *TaskAnomaly) AnomalyDesc() (str string) { |
99
|
|
97
|
|
100
|
}
|
98
|
}
|
101
|
case 3:
|
99
|
case 3:
|
102
|
- // 辅导异常
|
100
|
+ // 辅导异常 TODO
|
103
|
{
|
101
|
{
|
104
|
recordBegin := time.Unix(t.RecordBegin, 0)
|
102
|
recordBegin := time.Unix(t.RecordBegin, 0)
|
105
|
subDay := xtime.SubDayAbs(nowTime, recordBegin)
|
103
|
subDay := xtime.SubDayAbs(nowTime, recordBegin)
|
|
@@ -115,16 +113,18 @@ func (t *TaskAnomaly) AnomalyDesc() (str string) { |
|
@@ -115,16 +113,18 @@ func (t *TaskAnomaly) AnomalyDesc() (str string) { |
115
|
return str
|
113
|
return str
|
116
|
}
|
114
|
}
|
117
|
|
115
|
|
118
|
-// 发生异常后的天数
|
|
|
119
|
-// func (t *TaskAnomaly) CountAnomalyDay() int {
|
|
|
120
|
-// t1 := t.CreatedAt
|
|
|
121
|
-// t2 := time.Unix(t.RecordBegin, 0)
|
|
|
122
|
-// return xtime.SubDayAbs(t1, t2)
|
|
|
123
|
-// }
|
116
|
+// 检查是否是反馈异常
|
|
|
117
|
+func (t *TaskAnomaly) IsAssessFlag(taskData *Task, taskRecordData *TaskRecord) bool {
|
124
|
|
118
|
|
125
|
-// 存储
|
|
|
126
|
-type TaskAnomalyRepository interface {
|
|
|
127
|
- Save(param *TaskAnomaly) error
|
|
|
128
|
- FindOne(queryOptions map[string]interface{}) (*TaskAnomaly, error)
|
|
|
129
|
- Find(queryOptions map[string]interface{}) (int, []*TaskAnomaly, error)
|
119
|
+ return false
|
|
|
120
|
+}
|
|
|
121
|
+
|
|
|
122
|
+// 检查是否是里程碑异常
|
|
|
123
|
+func (t *TaskAnomaly) IsWarnFlag(taskData *Task, taskRecordData *TaskRecord) bool {
|
|
|
124
|
+ return false
|
|
|
125
|
+}
|
|
|
126
|
+
|
|
|
127
|
+// 检查是否是辅导异常
|
|
|
128
|
+func (t *TaskAnomaly) IsAssistFlag(taskData *Task, taskRecordData *TaskRecord) bool {
|
|
|
129
|
+ return false
|
130
|
} |
130
|
} |