作者 陈志颖

fix:更新任务离职人员限制

... ... @@ -1292,12 +1292,23 @@ 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 {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "无效的指派人员")
// 获取无效的发布人员信息
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 {
... ...