| | |
| | | employee = employeeService.getEmployee(employeeId); |
| | | } |
| | | if (employee == null && userId != null) { |
| | | // 约定 user_id 存 system_users.id;但历史上前端也有把「员工主键」塞进 userId 的情况,两种都兼容 |
| | | employee = employeeService.getEmployeeByUserId(userId); |
| | | if (employee == null) { |
| | | employee = employeeService.getEmployee(userId); |
| | | } |
| | | } |
| | | // 以员工档案上的 user_id 为准(前端可能把员工主键塞在 userId 字段里,直接用会写错申请人) |
| | | if (employee != null && employee.getUserId() != null) { |
| | | userId = employee.getUserId(); |
| | | } |
| | | if (userId == null && employee != null) { |
| | | userId = employee.getUserId(); |
| | |
| | | if (user != null) { |
| | | respVO.setUserName(user.getNickname()); |
| | | } |
| | | // 表里只存了 user_id,前端修改时需要用 employeeId 回显「被调岗员工」,这里按用户反查员工档案 |
| | | // user_id 正常存 system_users.id;历史数据也有存「员工主键」的,两种都兼容 |
| | | HrmEmployeeDO employee = employeeService.getEmployeeByUserId(application.getUserId()); |
| | | if (employee == null) { |
| | | employee = employeeService.getEmployee(application.getUserId()); |
| | | } |
| | | if (employee != null) { |
| | | respVO.setEmployeeId(employee.getId()); |
| | | if (user == null) { |
| | | respVO.setUserName(employee.getName()); |
| | | } |
| | | } |
| | | } |
| | | fillDeptNames(respVO, application); |