【登录】安眼统一认证

This commit is contained in:
2025-10-31 16:01:45 +08:00
parent 3016f15244
commit 5baa1b5479
2 changed files with 9 additions and 5 deletions
@@ -75,7 +75,7 @@ public class AnYanUserInfoResult {
private String mobile;
/**
* 性别
* 性别0男,1女
*/
@JsonProperty("gender")
private Integer gender;
@@ -171,7 +171,7 @@ public class LoginAnYanServiceImpl implements ILoginAnYanService {
AnYanUserInfoResult.EmployeeUnitDTO employeeUnitDTO = anYanUserInfo.getEmployeeUnitDTO();
String departId = checkDepartAndUpdate(employeeUnitDTO);
if (list.isEmpty()) {
UserEmployee user = getUserEmployee(anYanUserInfo, employeeUnitDTO);
UserEmployee user = getUserEmployee(employeeUnitDTO);
user.setUsername(anYanUserInfo.getLoginName());
user.setPassword(password);
user.setOrgCode(departId);
@@ -180,7 +180,7 @@ public class LoginAnYanServiceImpl implements ILoginAnYanService {
healthUserEmployeeExService.saveAndUser(user);
} else if (list.size() == 1) {
SysUser sysUser = list.get(0);
UserEmployee user = getUserEmployee(anYanUserInfo, employeeUnitDTO);
UserEmployee user = getUserEmployee(employeeUnitDTO);
HealthUserEmployeeEx extension = user.getExtension();
extension.setId(sysUser.getId());
user.setExtension(extension);
@@ -201,7 +201,7 @@ public class LoginAnYanServiceImpl implements ILoginAnYanService {
* @date 2025/10/27 11:29
*/
@NotNull
private static UserEmployee getUserEmployee(AnYanUserInfoResult anYanUserInfo, AnYanUserInfoResult.EmployeeUnitDTO employeeUnitDTO) {
private static UserEmployee getUserEmployee(AnYanUserInfoResult.EmployeeUnitDTO employeeUnitDTO) {
HealthUserEmployeeEx healthUserEmployeeEx = new HealthUserEmployeeEx();
healthUserEmployeeEx.setEmpSysno(employeeUnitDTO.getEmployeeNum());
UserEmployee user = new UserEmployee();
@@ -210,7 +210,11 @@ public class LoginAnYanServiceImpl implements ILoginAnYanService {
user.setRealname(employeeUnitDTO.getName());
user.setEmail(employeeUnitDTO.getEmail());
user.setPhone(employeeUnitDTO.getMobile());
user.setSex(anYanUserInfo.getGender());
if (employeeUnitDTO.getGender().equals(0)) {
user.setSex(2);
} else if (employeeUnitDTO.getGender().equals(1)) {
user.setSex(1);
}
return user;
}