作者 tangxvhui

更新

@@ -109,10 +109,13 @@ func (srv TaskService) CreateTask(transactionContext application.TransactionCont @@ -109,10 +109,13 @@ func (srv TaskService) CreateTask(transactionContext application.TransactionCont
109 Status: domain.TaskRunning, 109 Status: domain.TaskRunning,
110 Level: 0, 110 Level: 0,
111 LevelName: "", 111 LevelName: "",
112 - RelatedUser: []int{int(leaderData.Id), int(leaderData.ParentId)}, 112 + RelatedUser: []int{int(leaderData.Id)},
113 RunAt: nowTime.Unix(), 113 RunAt: nowTime.Unix(),
114 StopAt: 0, 114 StopAt: 0,
115 } 115 }
  116 + if int(leaderData.ParentId) != 0 {
  117 + newTask.RelatedUser = append(newTask.RelatedUser, int(leaderData.ParentId))
  118 + }
116 newTask.ApplyLevelName("战略任务") 119 newTask.ApplyLevelName("战略任务")
117 err = taskRepo.Save(&newTask) 120 err = taskRepo.Save(&newTask)
118 if err != nil { 121 if err != nil {
@@ -226,7 +229,10 @@ func (srv TaskService) UpdateTask(param *command.UpdateTaskCommand) (map[string] @@ -226,7 +229,10 @@ func (srv TaskService) UpdateTask(param *command.UpdateTaskCommand) (map[string]
226 } 229 }
227 leaderData := leaderList[0] 230 leaderData := leaderList[0]
228 //更新相关人员 231 //更新相关人员
229 - taskData.RelatedUser = []int{int(leaderData.Id), int(leaderData.ParentId)} 232 + taskData.RelatedUser = []int{int(leaderData.Id)}
  233 + if leaderData.ParentId != 0 {
  234 + taskData.RelatedUser = append(taskData.RelatedUser, int(leaderData.ParentId))
  235 + }
230 for _, val := range relatedUser { 236 for _, val := range relatedUser {
231 if val.Id == leaderData.Id || val.Id == leaderData.ParentId { 237 if val.Id == leaderData.Id || val.Id == leaderData.ParentId {
232 continue 238 continue