...
|
...
|
@@ -1292,13 +1292,24 @@ func (taskService *TaskService) UpdateTask(updateTaskCommand *command.UpdateTask |
|
|
}
|
|
|
employee, err := employeeRepository.FindOne(map[string]interface{}{
|
|
|
"uid": updateTaskCommand.AssignedPerson,
|
|
|
"status": 1,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
if employee == nil {
|
|
|
// 获取无效的发布人员信息
|
|
|
employeeInvalid, err := employeeRepository.FindOne(map[string]interface{}{
|
|
|
"uid": updateTaskCommand.AssignedPerson,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
if employeeInvalid == nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "无效的指派人员")
|
|
|
}
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "无效的指派人员:" + employeeInvalid.EmployeeInfo.EmployeeName)
|
|
|
}
|
|
|
updateData["assignedPerson"] = employee.EmployeeInfo
|
|
|
} else {
|
|
|
updateData["assignedPerson"] = &domain.EmployeeInfo{}
|
...
|
...
|
|