作者 tangxvhui

微调

@@ -43,9 +43,6 @@ func (srv TaskService) CreateTaskByProject(transactionContext application.Transa @@ -43,9 +43,6 @@ func (srv TaskService) CreateTaskByProject(transactionContext application.Transa
43 taskRepo := factory.CreateTaskRepository(map[string]interface{}{ 43 taskRepo := factory.CreateTaskRepository(map[string]interface{}{
44 "transactionContext": transactionContext, 44 "transactionContext": transactionContext,
45 }) 45 })
46 - // taskStageRepo := factory.CreateTaskStageRepository(map[string]interface{}{  
47 - // "transactionContext": transactionContext,  
48 - // })  
49 cnt, _, err := taskRepo.Find(map[string]interface{}{ 46 cnt, _, err := taskRepo.Find(map[string]interface{}{
50 "name": param.Name, 47 "name": param.Name,
51 "leaderId": strconv.Itoa(param.LeaderId), 48 "leaderId": strconv.Itoa(param.LeaderId),
@@ -106,10 +103,6 @@ func (srv TaskService) CreateTaskByProject(transactionContext application.Transa @@ -106,10 +103,6 @@ func (srv TaskService) CreateTaskByProject(transactionContext application.Transa
106 return application.ThrowError(application.INTERNAL_SERVER_ERROR, "创建任务失败:"+err.Error()) 103 return application.ThrowError(application.INTERNAL_SERVER_ERROR, "创建任务失败:"+err.Error())
107 } 104 }
108 newTaskStage := []*domain.TaskStage{} 105 newTaskStage := []*domain.TaskStage{}
109 - // err = taskStageRepo.Save(newTaskStage)  
110 - // if err != nil {  
111 - // return application.ThrowError(application.INTERNAL_SERVER_ERROR, "创建任务失败:"+err.Error())  
112 - // }  
113 //记录待执行的里程碑 106 //记录待执行的里程碑
114 newTask.SetCurrentStage(newTaskStage) 107 newTask.SetCurrentStage(newTaskStage)
115 err = taskRepo.Save(&newTask) 108 err = taskRepo.Save(&newTask)
@@ -65,6 +65,9 @@ func (t *TaskAnomaly) SetNoticeWho(u *User) { @@ -65,6 +65,9 @@ func (t *TaskAnomaly) SetNoticeWho(u *User) {
65 // 异常状况描述 65 // 异常状况描述
66 func (t *TaskAnomaly) AnomalyDesc() (str string) { 66 func (t *TaskAnomaly) AnomalyDesc() (str string) {
67 nowTime := t.CreatedAt 67 nowTime := t.CreatedAt
  68 + if nowTime.IsZero() {
  69 + nowTime = time.Now()
  70 + }
68 switch t.Category { 71 switch t.Category {
69 case 1: 72 case 1:
70 //里程碑异常 73 //里程碑异常