|
@@ -198,7 +198,7 @@ func (srv TaskService) UpdateTask(param *command.UpdateTaskCommand) (map[string] |
|
@@ -198,7 +198,7 @@ func (srv TaskService) UpdateTask(param *command.UpdateTaskCommand) (map[string] |
198
|
if err != nil {
|
198
|
if err != nil {
|
199
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
199
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
200
|
}
|
200
|
}
|
201
|
- //任务的相关人员
|
201
|
+ //更新任务的相关人员
|
202
|
relatedUserIds := []int{}
|
202
|
relatedUserIds := []int{}
|
203
|
for _, val := range param.RelatedUserId {
|
203
|
for _, val := range param.RelatedUserId {
|
204
|
id, _ := strconv.Atoi(val)
|
204
|
id, _ := strconv.Atoi(val)
|
|
@@ -218,10 +218,12 @@ func (srv TaskService) UpdateTask(param *command.UpdateTaskCommand) (map[string] |
|
@@ -218,10 +218,12 @@ func (srv TaskService) UpdateTask(param *command.UpdateTaskCommand) (map[string] |
218
|
for _, val := range relatedUser {
|
218
|
for _, val := range relatedUser {
|
219
|
taskData.RelatedUser = append(taskData.RelatedUser, int(val.Id))
|
219
|
taskData.RelatedUser = append(taskData.RelatedUser, int(val.Id))
|
220
|
}
|
220
|
}
|
221
|
- //更新任务名称
|
221
|
+ //更新任务名称,任务分类
|
222
|
taskData.Alias = param.Alias
|
222
|
taskData.Alias = param.Alias
|
223
|
taskData.ApplyLevelName(param.LevelName)
|
223
|
taskData.ApplyLevelName(param.LevelName)
|
|
|
224
|
+
|
224
|
nowTime := time.Now()
|
225
|
nowTime := time.Now()
|
|
|
226
|
+ //更新里程碑数据
|
225
|
stageMap := map[int]*domain.TaskStage{}
|
227
|
stageMap := map[int]*domain.TaskStage{}
|
226
|
for _, val := range stageList {
|
228
|
for _, val := range stageList {
|
227
|
val.DeletedAt = &nowTime
|
229
|
val.DeletedAt = &nowTime
|
|
@@ -229,7 +231,7 @@ func (srv TaskService) UpdateTask(param *command.UpdateTaskCommand) (map[string] |
|
@@ -229,7 +231,7 @@ func (srv TaskService) UpdateTask(param *command.UpdateTaskCommand) (map[string] |
229
|
}
|
231
|
}
|
230
|
lastPlanCompletedAt := time.Time{}
|
232
|
lastPlanCompletedAt := time.Time{}
|
231
|
newStageList := []*domain.TaskStage{}
|
233
|
newStageList := []*domain.TaskStage{}
|
232
|
- //标记完成时间变更的里程碑
|
234
|
+ //标记 变更完成时间的 里程碑
|
233
|
markStage := []domain.TaskStage{}
|
235
|
markStage := []domain.TaskStage{}
|
234
|
for i, val2 := range param.StageList {
|
236
|
for i, val2 := range param.StageList {
|
235
|
t, err := time.ParseInLocation("2006-01-02", val2.PlanCompletedAt, time.Local)
|
237
|
t, err := time.ParseInLocation("2006-01-02", val2.PlanCompletedAt, time.Local)
|
|
@@ -303,6 +305,7 @@ func (srv TaskService) UpdateTask(param *command.UpdateTaskCommand) (map[string] |
|
@@ -303,6 +305,7 @@ func (srv TaskService) UpdateTask(param *command.UpdateTaskCommand) (map[string] |
303
|
}
|
305
|
}
|
304
|
|
306
|
|
305
|
taskData.UseEndTime = param.UseEndtime
|
307
|
taskData.UseEndTime = param.UseEndtime
|
|
|
308
|
+ taskData.AssistFlagMax = param.AssistFlagMax
|
306
|
err = taskRepo.Save(taskData)
|
309
|
err = taskRepo.Save(taskData)
|
307
|
if err != nil {
|
310
|
if err != nil {
|
308
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
311
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
@@ -449,13 +452,6 @@ func (srv TaskService) GetTaskInfo(param *command.GetTaskCommand) (*adapter.Task |
|
@@ -449,13 +452,6 @@ func (srv TaskService) GetTaskInfo(param *command.GetTaskCommand) (*adapter.Task |
449
|
taskRecordRepo := factory.CreateTaskRecordRepository(map[string]interface{}{
|
452
|
taskRecordRepo := factory.CreateTaskRecordRepository(map[string]interface{}{
|
450
|
"transactionContext": transactionContext,
|
453
|
"transactionContext": transactionContext,
|
451
|
})
|
454
|
})
|
452
|
- // cnt, _, err := taskRecordRepo.Find(map[string]interface{}{
|
|
|
453
|
- // "taskId": param.TaskId,
|
|
|
454
|
- // "limit": 1,
|
|
|
455
|
- // })
|
|
|
456
|
- // if err != nil {
|
|
|
457
|
- // return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "相关联的任务反馈信息"+err.Error())
|
|
|
458
|
- // }
|
|
|
459
|
result := adapter.TaskInfoAdapter{
|
455
|
result := adapter.TaskInfoAdapter{
|
460
|
Id: taskData.Id,
|
456
|
Id: taskData.Id,
|
461
|
Name: taskData.Name,
|
457
|
Name: taskData.Name,
|
|
@@ -477,6 +473,7 @@ func (srv TaskService) GetTaskInfo(param *command.GetTaskCommand) (*adapter.Task |
|
@@ -477,6 +473,7 @@ func (srv TaskService) GetTaskInfo(param *command.GetTaskCommand) (*adapter.Task |
477
|
RelatedUserId: []string{},
|
473
|
RelatedUserId: []string{},
|
478
|
RelatedUser: []adapter.UserData{},
|
474
|
RelatedUser: []adapter.UserData{},
|
479
|
StageList: []adapter.TaskStage{},
|
475
|
StageList: []adapter.TaskStage{},
|
|
|
476
|
+ AssistFlagMax: taskData.AssistFlagMax,
|
480
|
}
|
477
|
}
|
481
|
for _, val := range relatedUserList {
|
478
|
for _, val := range relatedUserList {
|
482
|
idStr := strconv.Itoa(int(val.Id))
|
479
|
idStr := strconv.Itoa(int(val.Id))
|
|
@@ -487,6 +484,7 @@ func (srv TaskService) GetTaskInfo(param *command.GetTaskCommand) (*adapter.Task |
|
@@ -487,6 +484,7 @@ func (srv TaskService) GetTaskInfo(param *command.GetTaskCommand) (*adapter.Task |
487
|
Name: val.Name,
|
484
|
Name: val.Name,
|
488
|
ParentId: val.ParentId,
|
485
|
ParentId: val.ParentId,
|
489
|
})
|
486
|
})
|
|
|
487
|
+
|
490
|
}
|
488
|
}
|
491
|
|
489
|
|
492
|
for _, val := range stageList {
|
490
|
for _, val := range stageList {
|