作者 陈志颖

fix:评分员工信息

... ... @@ -342,7 +342,7 @@ func (taskService *TaskService) AcceptanceTask(acceptanceTaskCommand *command.Ac
employeeRepository = value
}
// 填充员工信息
// 填充百分比员工信息
for i, taskPercentage := range acceptanceTaskCommand.TaskPercentage {
getEmployee := map[string]interface{}{
"uid": taskPercentage.Contributor.Uid,
... ... @@ -356,6 +356,22 @@ func (taskService *TaskService) AcceptanceTask(acceptanceTaskCommand *command.Ac
}
acceptanceTaskCommand.TaskPercentage[i].Contributor = employeeFound.EmployeeInfo
}
// 填充百分比员工信息
for i, referenceResourceScore := range acceptanceTaskCommand.ReferenceResourceScore {
for j, solveScore := range referenceResourceScore.SolveScore {
getEmployee := map[string]interface{}{
"uid": solveScore.Contributor.Uid,
}
employeeFound, err := employeeRepository.FindOne(getEmployee)
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
if employeeFound == nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "无效的员工")
}
acceptanceTaskCommand.ReferenceResourceScore[i].SolveScore[j].Contributor = employeeFound.EmployeeInfo
}
}
if task, err := acceptanceTaskService.Acceptance(acceptanceTaskCommand.TaskId, acceptanceTaskCommand.Operator, acceptanceTaskCommand.Participators, acceptanceTaskCommand.SuMoney, acceptanceTaskCommand.TaskPercentage, acceptanceTaskCommand.ReferenceResourceScore, acceptanceTaskCommand.SolveReport, acceptanceTaskCommand.SolvePictureUrls, acceptanceTaskCommand.ActualCompletionTime); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
... ...