...
|
...
|
@@ -198,7 +198,7 @@ func (srv TaskService) UpdateTask(param *command.UpdateTaskCommand) (map[string] |
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
//任务的相关人员
|
|
|
//更新任务的相关人员
|
|
|
relatedUserIds := []int{}
|
|
|
for _, val := range param.RelatedUserId {
|
|
|
id, _ := strconv.Atoi(val)
|
...
|
...
|
@@ -218,10 +218,12 @@ func (srv TaskService) UpdateTask(param *command.UpdateTaskCommand) (map[string] |
|
|
for _, val := range relatedUser {
|
|
|
taskData.RelatedUser = append(taskData.RelatedUser, int(val.Id))
|
|
|
}
|
|
|
//更新任务名称
|
|
|
//更新任务名称,任务分类
|
|
|
taskData.Alias = param.Alias
|
|
|
taskData.ApplyLevelName(param.LevelName)
|
|
|
|
|
|
nowTime := time.Now()
|
|
|
//更新里程碑数据
|
|
|
stageMap := map[int]*domain.TaskStage{}
|
|
|
for _, val := range stageList {
|
|
|
val.DeletedAt = &nowTime
|
...
|
...
|
@@ -229,7 +231,7 @@ func (srv TaskService) UpdateTask(param *command.UpdateTaskCommand) (map[string] |
|
|
}
|
|
|
lastPlanCompletedAt := time.Time{}
|
|
|
newStageList := []*domain.TaskStage{}
|
|
|
//标记完成时间变更的里程碑
|
|
|
//标记 变更完成时间的 里程碑
|
|
|
markStage := []domain.TaskStage{}
|
|
|
for i, val2 := range param.StageList {
|
|
|
t, err := time.ParseInLocation("2006-01-02", val2.PlanCompletedAt, time.Local)
|
...
|
...
|
@@ -303,6 +305,7 @@ func (srv TaskService) UpdateTask(param *command.UpdateTaskCommand) (map[string] |
|
|
}
|
|
|
|
|
|
taskData.UseEndTime = param.UseEndtime
|
|
|
taskData.AssistFlagMax = param.AssistFlagMax
|
|
|
err = taskRepo.Save(taskData)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
...
|
...
|
@@ -449,13 +452,6 @@ func (srv TaskService) GetTaskInfo(param *command.GetTaskCommand) (*adapter.Task |
|
|
taskRecordRepo := factory.CreateTaskRecordRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
// cnt, _, err := taskRecordRepo.Find(map[string]interface{}{
|
|
|
// "taskId": param.TaskId,
|
|
|
// "limit": 1,
|
|
|
// })
|
|
|
// if err != nil {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "相关联的任务反馈信息"+err.Error())
|
|
|
// }
|
|
|
result := adapter.TaskInfoAdapter{
|
|
|
Id: taskData.Id,
|
|
|
Name: taskData.Name,
|
...
|
...
|
@@ -477,6 +473,7 @@ func (srv TaskService) GetTaskInfo(param *command.GetTaskCommand) (*adapter.Task |
|
|
RelatedUserId: []string{},
|
|
|
RelatedUser: []adapter.UserData{},
|
|
|
StageList: []adapter.TaskStage{},
|
|
|
AssistFlagMax: taskData.AssistFlagMax,
|
|
|
}
|
|
|
for _, val := range relatedUserList {
|
|
|
idStr := strconv.Itoa(int(val.Id))
|
...
|
...
|
@@ -487,6 +484,7 @@ func (srv TaskService) GetTaskInfo(param *command.GetTaskCommand) (*adapter.Task |
|
|
Name: val.Name,
|
|
|
ParentId: val.ParentId,
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
for _, val := range stageList {
|
...
|
...
|
|