...
|
...
|
@@ -509,20 +509,25 @@ func (srv StaffAssessServeice) buildTaskRecord(staffAssess *domain.StaffAssess) |
|
|
taskRecordList = append(taskRecordList, &newTaskRecord)
|
|
|
}
|
|
|
}
|
|
|
//TODO 设置手动创建的task
|
|
|
_, taskList, err := taskRepo.Find(map[string]interface{}{
|
|
|
//设置手动创建的task
|
|
|
_, taskList2, err := taskRepo.Find(map[string]interface{}{
|
|
|
"leaderId": projectData.PrincipalId,
|
|
|
"status": domain.TaskRunning,
|
|
|
"createdBy": 1,
|
|
|
"gtEndTime": time.Now().Unix(),
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.ARG_ERROR, "获取评估项指标任务task信息"+err.Error())
|
|
|
}
|
|
|
for index := range taskList {
|
|
|
nowTime := time.Now()
|
|
|
for index := range taskList2 {
|
|
|
if taskList2[index].UseEndTime > 0 {
|
|
|
if !(taskList2[index].EndTime > nowTime.Unix()) {
|
|
|
continue
|
|
|
}
|
|
|
}
|
|
|
//获取里程碑数据
|
|
|
_, taskStageList, err := taskStageRepo.Find(map[string]interface{}{
|
|
|
"taskId": taskList[index].Id,
|
|
|
"taskId": taskList2[index].Id,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.ARG_ERROR, "获取评估项指标任务里程碑TaskStage信息"+err.Error())
|
...
|
...
|
@@ -531,18 +536,18 @@ func (srv StaffAssessServeice) buildTaskRecord(staffAssess *domain.StaffAssess) |
|
|
Id: 0,
|
|
|
CompanyId: staffAssess.CompanyId,
|
|
|
StaffAssessId: staffAssess.Id,
|
|
|
TaskId: taskList[index].Id,
|
|
|
TaskId: taskList2[index].Id,
|
|
|
TaskCategory: "",
|
|
|
TaskName: taskList[index].Name,
|
|
|
TaskAlias: taskList[index].Alias,
|
|
|
TaskLeader: taskList[index].Leader,
|
|
|
TaskName: taskList2[index].Name,
|
|
|
TaskAlias: taskList2[index].Alias,
|
|
|
TaskLeader: taskList2[index].Leader,
|
|
|
AssistLevel: 0,
|
|
|
AssistContent: "",
|
|
|
AnomalyState: domain.AnomalyStateInit,
|
|
|
AssistState: domain.AssistStateInit,
|
|
|
TaskStages: []domain.TaskStage{},
|
|
|
TaskStageCheck: domain.TaskStage{},
|
|
|
TaskCreatedBy: taskList[index].CreatedBy,
|
|
|
TaskCreatedBy: taskList2[index].CreatedBy,
|
|
|
}
|
|
|
sort.Slice(taskStageList, func(i, j int) bool {
|
|
|
return taskStageList[i].SortBy < taskStageList[j].SortBy
|
...
|
...
|
|