作者 陈志颖

fix:评分员工信息

@@ -342,7 +342,7 @@ func (taskService *TaskService) AcceptanceTask(acceptanceTaskCommand *command.Ac @@ -342,7 +342,7 @@ func (taskService *TaskService) AcceptanceTask(acceptanceTaskCommand *command.Ac
342 employeeRepository = value 342 employeeRepository = value
343 } 343 }
344 344
345 - // 填充员工信息 345 + // 填充百分比员工信息
346 for i, taskPercentage := range acceptanceTaskCommand.TaskPercentage { 346 for i, taskPercentage := range acceptanceTaskCommand.TaskPercentage {
347 getEmployee := map[string]interface{}{ 347 getEmployee := map[string]interface{}{
348 "uid": taskPercentage.Contributor.Uid, 348 "uid": taskPercentage.Contributor.Uid,
@@ -356,6 +356,22 @@ func (taskService *TaskService) AcceptanceTask(acceptanceTaskCommand *command.Ac @@ -356,6 +356,22 @@ func (taskService *TaskService) AcceptanceTask(acceptanceTaskCommand *command.Ac
356 } 356 }
357 acceptanceTaskCommand.TaskPercentage[i].Contributor = employeeFound.EmployeeInfo 357 acceptanceTaskCommand.TaskPercentage[i].Contributor = employeeFound.EmployeeInfo
358 } 358 }
  359 + // 填充百分比员工信息
  360 + for i, referenceResourceScore := range acceptanceTaskCommand.ReferenceResourceScore {
  361 + for j, solveScore := range referenceResourceScore.SolveScore {
  362 + getEmployee := map[string]interface{}{
  363 + "uid": solveScore.Contributor.Uid,
  364 + }
  365 + employeeFound, err := employeeRepository.FindOne(getEmployee)
  366 + if err != nil {
  367 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  368 + }
  369 + if employeeFound == nil {
  370 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "无效的员工")
  371 + }
  372 + acceptanceTaskCommand.ReferenceResourceScore[i].SolveScore[j].Contributor = employeeFound.EmployeeInfo
  373 + }
  374 + }
359 375
360 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 { 376 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 {
361 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 377 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())