|
@@ -95,7 +95,7 @@ func isNotWarnFlag(transactionContext application.TransactionContext, taskData * |
|
@@ -95,7 +95,7 @@ func isNotWarnFlag(transactionContext application.TransactionContext, taskData * |
95
|
})
|
95
|
})
|
96
|
_, oldAnomaly, err := taskAnomalyRepo.Find(map[string]interface{}{
|
96
|
_, oldAnomaly, err := taskAnomalyRepo.Find(map[string]interface{}{
|
97
|
"isLast": 1,
|
97
|
"isLast": 1,
|
98
|
- "category": 2,
|
98
|
+ "category": 1,
|
99
|
"limit": 1,
|
99
|
"limit": 1,
|
100
|
"taskId": taskData.Id,
|
100
|
"taskId": taskData.Id,
|
101
|
"taskStageCheck": fmt.Sprintf(`{"id":"%d"}`, taskRecord.TaskStageCheck.Id),
|
101
|
"taskStageCheck": fmt.Sprintf(`{"id":"%d"}`, taskRecord.TaskStageCheck.Id),
|
|
@@ -108,7 +108,10 @@ func isNotWarnFlag(transactionContext application.TransactionContext, taskData * |
|
@@ -108,7 +108,10 @@ func isNotWarnFlag(transactionContext application.TransactionContext, taskData * |
108
|
}
|
108
|
}
|
109
|
oldAnomaly[0].IsLast = 2
|
109
|
oldAnomaly[0].IsLast = 2
|
110
|
err = taskAnomalyRepo.Save(oldAnomaly[0])
|
110
|
err = taskAnomalyRepo.Save(oldAnomaly[0])
|
111
|
- return fmt.Errorf("取消里程碑异常:%s", err)
|
111
|
+ if err != nil {
|
|
|
112
|
+ return fmt.Errorf("取消里程碑异常:%s", err)
|
|
|
113
|
+ }
|
|
|
114
|
+ return nil
|
112
|
}
|
115
|
}
|
113
|
|
116
|
|
114
|
// 处理里程碑异常的情况
|
117
|
// 处理里程碑异常的情况
|
|
@@ -123,7 +126,7 @@ func isWarnFlag(transactionContext application.TransactionContext, taskData *dom |
|
@@ -123,7 +126,7 @@ func isWarnFlag(transactionContext application.TransactionContext, taskData *dom |
123
|
|
126
|
|
124
|
_, oldAnomaly, err := taskAnomalyRepo.Find(map[string]interface{}{
|
127
|
_, oldAnomaly, err := taskAnomalyRepo.Find(map[string]interface{}{
|
125
|
"isLast": 1,
|
128
|
"isLast": 1,
|
126
|
- "category": 2,
|
129
|
+ "category": 1,
|
127
|
"limit": 1,
|
130
|
"limit": 1,
|
128
|
"taskId": taskData.Id,
|
131
|
"taskId": taskData.Id,
|
129
|
"taskStageCheck": fmt.Sprintf(`{"id":"%d"}`, taskRecord.TaskStageCheck.Id),
|
132
|
"taskStageCheck": fmt.Sprintf(`{"id":"%d"}`, taskRecord.TaskStageCheck.Id),
|
|
@@ -133,7 +136,7 @@ func isWarnFlag(transactionContext application.TransactionContext, taskData *dom |
|
@@ -133,7 +136,7 @@ func isWarnFlag(transactionContext application.TransactionContext, taskData *dom |
133
|
}
|
136
|
}
|
134
|
|
137
|
|
135
|
anomalyDataTmp := domain.TaskAnomaly{
|
138
|
anomalyDataTmp := domain.TaskAnomaly{
|
136
|
- Id: taskData.Id,
|
139
|
+ Id: 0,
|
137
|
CreatedAt: time.Now(),
|
140
|
CreatedAt: time.Now(),
|
138
|
UpdatedAt: time.Now(),
|
141
|
UpdatedAt: time.Now(),
|
139
|
CompanyId: taskData.CompanyId,
|
142
|
CompanyId: taskData.CompanyId,
|
|
@@ -162,6 +165,7 @@ func isWarnFlag(transactionContext application.TransactionContext, taskData *dom |
|
@@ -162,6 +165,7 @@ func isWarnFlag(transactionContext application.TransactionContext, taskData *dom |
162
|
return fmt.Errorf("更新里程碑异常记录:%s", err)
|
165
|
return fmt.Errorf("更新里程碑异常记录:%s", err)
|
163
|
}
|
166
|
}
|
164
|
}
|
167
|
}
|
|
|
168
|
+ _ = anomalyDataTmp.AnomalyDesc()
|
165
|
// 异常就通知自己和上级
|
169
|
// 异常就通知自己和上级
|
166
|
//获取任务Leader的数据
|
170
|
//获取任务Leader的数据
|
167
|
_, useList, err := userRepo.Find(map[string]interface{}{"id": taskData.Leader.Id, "limit": 1})
|
171
|
_, useList, err := userRepo.Find(map[string]interface{}{"id": taskData.Leader.Id, "limit": 1})
|
|
@@ -211,7 +215,10 @@ func isNotAssistFlag(transactionContext application.TransactionContext, taskData |
|
@@ -211,7 +215,10 @@ func isNotAssistFlag(transactionContext application.TransactionContext, taskData |
211
|
}
|
215
|
}
|
212
|
oldAnomaly[0].IsLast = 2
|
216
|
oldAnomaly[0].IsLast = 2
|
213
|
err = taskAnomalyRepo.Save(oldAnomaly[0])
|
217
|
err = taskAnomalyRepo.Save(oldAnomaly[0])
|
214
|
- return fmt.Errorf("取消辅导异常:%s", err)
|
218
|
+ if err != nil {
|
|
|
219
|
+ return fmt.Errorf("取消辅导异常:%s", err)
|
|
|
220
|
+ }
|
|
|
221
|
+ return nil
|
215
|
}
|
222
|
}
|
216
|
|
223
|
|
217
|
// 处理辅导异常的情况
|
224
|
// 处理辅导异常的情况
|
|
@@ -235,7 +242,7 @@ func isAssistFlag(transactionContext application.TransactionContext, taskData *d |
|
@@ -235,7 +242,7 @@ func isAssistFlag(transactionContext application.TransactionContext, taskData *d |
235
|
}
|
242
|
}
|
236
|
// 辅导异常通知该条任务负责人的上级;辅导异常超过N天,通知任务负责人的上上级
|
243
|
// 辅导异常通知该条任务负责人的上级;辅导异常超过N天,通知任务负责人的上上级
|
237
|
anomalyDataTmp := domain.TaskAnomaly{
|
244
|
anomalyDataTmp := domain.TaskAnomaly{
|
238
|
- Id: taskData.Id,
|
245
|
+ Id: 0,
|
239
|
CreatedAt: time.Now(),
|
246
|
CreatedAt: time.Now(),
|
240
|
UpdatedAt: time.Now(),
|
247
|
UpdatedAt: time.Now(),
|
241
|
CompanyId: taskData.CompanyId,
|
248
|
CompanyId: taskData.CompanyId,
|
|
@@ -263,6 +270,7 @@ func isAssistFlag(transactionContext application.TransactionContext, taskData *d |
|
@@ -263,6 +270,7 @@ func isAssistFlag(transactionContext application.TransactionContext, taskData *d |
263
|
return fmt.Errorf("更新里程碑异常记录:%s", err)
|
270
|
return fmt.Errorf("更新里程碑异常记录:%s", err)
|
264
|
}
|
271
|
}
|
265
|
}
|
272
|
}
|
|
|
273
|
+ _ = anomalyDataTmp.AnomalyDesc()
|
266
|
//获取任务Leader的数据
|
274
|
//获取任务Leader的数据
|
267
|
_, useList, err := userRepo.Find(map[string]interface{}{"id": taskData.Leader.Id, "limit": 1})
|
275
|
_, useList, err := userRepo.Find(map[string]interface{}{"id": taskData.Leader.Id, "limit": 1})
|
268
|
if err != nil {
|
276
|
if err != nil {
|
|
@@ -311,7 +319,7 @@ func isNotAssessFlag(transactionContext application.TransactionContext, taskData |
|
@@ -311,7 +319,7 @@ func isNotAssessFlag(transactionContext application.TransactionContext, taskData |
311
|
|
319
|
|
312
|
_, oldAnomaly, err := taskAnomalyRepo.Find(map[string]interface{}{
|
320
|
_, oldAnomaly, err := taskAnomalyRepo.Find(map[string]interface{}{
|
313
|
"isLast": 1,
|
321
|
"isLast": 1,
|
314
|
- "category": 3,
|
322
|
+ "category": 2,
|
315
|
"limit": 1,
|
323
|
"limit": 1,
|
316
|
"taskId": taskData.Id,
|
324
|
"taskId": taskData.Id,
|
317
|
})
|
325
|
})
|
|
@@ -323,8 +331,10 @@ func isNotAssessFlag(transactionContext application.TransactionContext, taskData |
|
@@ -323,8 +331,10 @@ func isNotAssessFlag(transactionContext application.TransactionContext, taskData |
323
|
}
|
331
|
}
|
324
|
oldAnomaly[0].IsLast = 2
|
332
|
oldAnomaly[0].IsLast = 2
|
325
|
err = taskAnomalyRepo.Save(oldAnomaly[0])
|
333
|
err = taskAnomalyRepo.Save(oldAnomaly[0])
|
326
|
- return fmt.Errorf("取消辅导异常:%s", err)
|
|
|
327
|
-
|
334
|
+ if err != nil {
|
|
|
335
|
+ return fmt.Errorf("取消辅导异常:%s", err)
|
|
|
336
|
+ }
|
|
|
337
|
+ return nil
|
328
|
}
|
338
|
}
|
329
|
|
339
|
|
330
|
// 处理反馈异常的情况
|
340
|
// 处理反馈异常的情况
|
|
@@ -346,12 +356,12 @@ func isAssessFlag(transactionContext application.TransactionContext, taskData *d |
|
@@ -346,12 +356,12 @@ func isAssessFlag(transactionContext application.TransactionContext, taskData *d |
346
|
}
|
356
|
}
|
347
|
//
|
357
|
//
|
348
|
anomalyDataTmp := domain.TaskAnomaly{
|
358
|
anomalyDataTmp := domain.TaskAnomaly{
|
349
|
- Id: taskData.Id,
|
359
|
+ Id: 0,
|
350
|
CreatedAt: time.Now(),
|
360
|
CreatedAt: time.Now(),
|
351
|
UpdatedAt: time.Now(),
|
361
|
UpdatedAt: time.Now(),
|
352
|
CompanyId: taskData.CompanyId,
|
362
|
CompanyId: taskData.CompanyId,
|
353
|
TaskId: taskData.Id,
|
363
|
TaskId: taskData.Id,
|
354
|
- Category: 3,
|
364
|
+ Category: 2,
|
355
|
CurrentStage: taskData.CurrentStage,
|
365
|
CurrentStage: taskData.CurrentStage,
|
356
|
LastStage: taskData.LastStage,
|
366
|
LastStage: taskData.LastStage,
|
357
|
TaskStageCheck: taskRecord.TaskStageCheck,
|
367
|
TaskStageCheck: taskRecord.TaskStageCheck,
|
|
@@ -373,6 +383,7 @@ func isAssessFlag(transactionContext application.TransactionContext, taskData *d |
|
@@ -373,6 +383,7 @@ func isAssessFlag(transactionContext application.TransactionContext, taskData *d |
373
|
return fmt.Errorf("更新里程碑异常记录:%s", err)
|
383
|
return fmt.Errorf("更新里程碑异常记录:%s", err)
|
374
|
}
|
384
|
}
|
375
|
}
|
385
|
}
|
|
|
386
|
+ _ = anomalyDataTmp.AnomalyDesc()
|
376
|
// 2天未反馈通知被评估人自己;3天通知上级
|
387
|
// 2天未反馈通知被评估人自己;3天通知上级
|
377
|
// 获取任务Leader的数据
|
388
|
// 获取任务Leader的数据
|
378
|
_, useList, err := userRepo.Find(map[string]interface{}{"id": taskData.Leader.Id, "limit": 1})
|
389
|
_, useList, err := userRepo.Find(map[string]interface{}{"id": taskData.Leader.Id, "limit": 1})
|