...
|
...
|
@@ -95,7 +95,7 @@ func isNotWarnFlag(transactionContext application.TransactionContext, taskData * |
|
|
})
|
|
|
_, oldAnomaly, err := taskAnomalyRepo.Find(map[string]interface{}{
|
|
|
"isLast": 1,
|
|
|
"category": 2,
|
|
|
"category": 1,
|
|
|
"limit": 1,
|
|
|
"taskId": taskData.Id,
|
|
|
"taskStageCheck": fmt.Sprintf(`{"id":"%d"}`, taskRecord.TaskStageCheck.Id),
|
...
|
...
|
@@ -108,7 +108,10 @@ func isNotWarnFlag(transactionContext application.TransactionContext, taskData * |
|
|
}
|
|
|
oldAnomaly[0].IsLast = 2
|
|
|
err = taskAnomalyRepo.Save(oldAnomaly[0])
|
|
|
return fmt.Errorf("取消里程碑异常:%s", err)
|
|
|
if err != nil {
|
|
|
return fmt.Errorf("取消里程碑异常:%s", err)
|
|
|
}
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
// 处理里程碑异常的情况
|
...
|
...
|
@@ -123,7 +126,7 @@ func isWarnFlag(transactionContext application.TransactionContext, taskData *dom |
|
|
|
|
|
_, oldAnomaly, err := taskAnomalyRepo.Find(map[string]interface{}{
|
|
|
"isLast": 1,
|
|
|
"category": 2,
|
|
|
"category": 1,
|
|
|
"limit": 1,
|
|
|
"taskId": taskData.Id,
|
|
|
"taskStageCheck": fmt.Sprintf(`{"id":"%d"}`, taskRecord.TaskStageCheck.Id),
|
...
|
...
|
@@ -133,7 +136,7 @@ func isWarnFlag(transactionContext application.TransactionContext, taskData *dom |
|
|
}
|
|
|
|
|
|
anomalyDataTmp := domain.TaskAnomaly{
|
|
|
Id: taskData.Id,
|
|
|
Id: 0,
|
|
|
CreatedAt: time.Now(),
|
|
|
UpdatedAt: time.Now(),
|
|
|
CompanyId: taskData.CompanyId,
|
...
|
...
|
@@ -162,6 +165,7 @@ func isWarnFlag(transactionContext application.TransactionContext, taskData *dom |
|
|
return fmt.Errorf("更新里程碑异常记录:%s", err)
|
|
|
}
|
|
|
}
|
|
|
_ = anomalyDataTmp.AnomalyDesc()
|
|
|
// 异常就通知自己和上级
|
|
|
//获取任务Leader的数据
|
|
|
_, useList, err := userRepo.Find(map[string]interface{}{"id": taskData.Leader.Id, "limit": 1})
|
...
|
...
|
@@ -211,7 +215,10 @@ func isNotAssistFlag(transactionContext application.TransactionContext, taskData |
|
|
}
|
|
|
oldAnomaly[0].IsLast = 2
|
|
|
err = taskAnomalyRepo.Save(oldAnomaly[0])
|
|
|
return fmt.Errorf("取消辅导异常:%s", err)
|
|
|
if err != nil {
|
|
|
return fmt.Errorf("取消辅导异常:%s", err)
|
|
|
}
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
// 处理辅导异常的情况
|
...
|
...
|
@@ -235,7 +242,7 @@ func isAssistFlag(transactionContext application.TransactionContext, taskData *d |
|
|
}
|
|
|
// 辅导异常通知该条任务负责人的上级;辅导异常超过N天,通知任务负责人的上上级
|
|
|
anomalyDataTmp := domain.TaskAnomaly{
|
|
|
Id: taskData.Id,
|
|
|
Id: 0,
|
|
|
CreatedAt: time.Now(),
|
|
|
UpdatedAt: time.Now(),
|
|
|
CompanyId: taskData.CompanyId,
|
...
|
...
|
@@ -263,6 +270,7 @@ func isAssistFlag(transactionContext application.TransactionContext, taskData *d |
|
|
return fmt.Errorf("更新里程碑异常记录:%s", err)
|
|
|
}
|
|
|
}
|
|
|
_ = anomalyDataTmp.AnomalyDesc()
|
|
|
//获取任务Leader的数据
|
|
|
_, useList, err := userRepo.Find(map[string]interface{}{"id": taskData.Leader.Id, "limit": 1})
|
|
|
if err != nil {
|
...
|
...
|
@@ -311,7 +319,7 @@ func isNotAssessFlag(transactionContext application.TransactionContext, taskData |
|
|
|
|
|
_, oldAnomaly, err := taskAnomalyRepo.Find(map[string]interface{}{
|
|
|
"isLast": 1,
|
|
|
"category": 3,
|
|
|
"category": 2,
|
|
|
"limit": 1,
|
|
|
"taskId": taskData.Id,
|
|
|
})
|
...
|
...
|
@@ -323,8 +331,10 @@ func isNotAssessFlag(transactionContext application.TransactionContext, taskData |
|
|
}
|
|
|
oldAnomaly[0].IsLast = 2
|
|
|
err = taskAnomalyRepo.Save(oldAnomaly[0])
|
|
|
return fmt.Errorf("取消辅导异常:%s", err)
|
|
|
|
|
|
if err != nil {
|
|
|
return fmt.Errorf("取消辅导异常:%s", err)
|
|
|
}
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
// 处理反馈异常的情况
|
...
|
...
|
@@ -346,12 +356,12 @@ func isAssessFlag(transactionContext application.TransactionContext, taskData *d |
|
|
}
|
|
|
//
|
|
|
anomalyDataTmp := domain.TaskAnomaly{
|
|
|
Id: taskData.Id,
|
|
|
Id: 0,
|
|
|
CreatedAt: time.Now(),
|
|
|
UpdatedAt: time.Now(),
|
|
|
CompanyId: taskData.CompanyId,
|
|
|
TaskId: taskData.Id,
|
|
|
Category: 3,
|
|
|
Category: 2,
|
|
|
CurrentStage: taskData.CurrentStage,
|
|
|
LastStage: taskData.LastStage,
|
|
|
TaskStageCheck: taskRecord.TaskStageCheck,
|
...
|
...
|
@@ -373,6 +383,7 @@ func isAssessFlag(transactionContext application.TransactionContext, taskData *d |
|
|
return fmt.Errorf("更新里程碑异常记录:%s", err)
|
|
|
}
|
|
|
}
|
|
|
_ = anomalyDataTmp.AnomalyDesc()
|
|
|
// 2天未反馈通知被评估人自己;3天通知上级
|
|
|
// 获取任务Leader的数据
|
|
|
_, useList, err := userRepo.Find(map[string]interface{}{"id": taskData.Leader.Id, "limit": 1})
|
...
|
...
|
|