作者 tangxvhui

微调

... ... @@ -43,9 +43,6 @@ func (srv TaskService) CreateTaskByProject(transactionContext application.Transa
taskRepo := factory.CreateTaskRepository(map[string]interface{}{
"transactionContext": transactionContext,
})
// taskStageRepo := factory.CreateTaskStageRepository(map[string]interface{}{
// "transactionContext": transactionContext,
// })
cnt, _, err := taskRepo.Find(map[string]interface{}{
"name": param.Name,
"leaderId": strconv.Itoa(param.LeaderId),
... ... @@ -106,10 +103,6 @@ func (srv TaskService) CreateTaskByProject(transactionContext application.Transa
return application.ThrowError(application.INTERNAL_SERVER_ERROR, "创建任务失败:"+err.Error())
}
newTaskStage := []*domain.TaskStage{}
// err = taskStageRepo.Save(newTaskStage)
// if err != nil {
// return application.ThrowError(application.INTERNAL_SERVER_ERROR, "创建任务失败:"+err.Error())
// }
//记录待执行的里程碑
newTask.SetCurrentStage(newTaskStage)
err = taskRepo.Save(&newTask)
... ...
... ... @@ -65,6 +65,9 @@ func (t *TaskAnomaly) SetNoticeWho(u *User) {
// 异常状况描述
func (t *TaskAnomaly) AnomalyDesc() (str string) {
nowTime := t.CreatedAt
if nowTime.IsZero() {
nowTime = time.Now()
}
switch t.Category {
case 1:
//里程碑异常
... ...