更新:单点登录更新appUser时,保留原有用户的userType字段(此字段用于政策查询)

This commit is contained in:
chenyanchang
2026-06-29 16:37:23 +08:00
parent 1393f1bd47
commit 48c62c7328

View File

@@ -123,20 +123,6 @@ public class SsoService {
if (ObjectUtils.isEmpty(userJson)) {
throw new RuntimeException("获取用户信息失败");
}
//获取身份证号
String personCardNo = null;
JSONObject info = null;
if (userJson.containsKey("info")) {
info = userJson.getJSONObject("info");
if (ObjectUtils.isNotEmpty(info) && info.containsKey("personCardNo")) {
personCardNo = info.getString("personCardNo");
//解密处理
if (StringUtils.isEmpty(personCardNo)) {
throw new RuntimeException("获取用户证件信息失败");
}
personCardNo = EncryptUtil.decryptByAppIdAndSecret(personCardNo, webAppId, webAppSecret);
}
}
//用身份证号查询用户 用户类型01个人02企业
// 转换成本地app角色0企业1求职者2网格员 3内部政府人员 4其他浪潮用
@@ -170,20 +156,6 @@ public class SsoService {
if (ObjectUtils.isEmpty(userJson)) {
throw new RuntimeException("获取用户信息失败");
}
//获取身份证号
String personCardNo = null;
JSONObject info = null;
if (userJson.containsKey("info")) {
info = userJson.getJSONObject("info");
if (ObjectUtils.isNotEmpty(info) && info.containsKey("personCardNo")) {
personCardNo = info.getString("personCardNo");
//解密处理
if (StringUtils.isEmpty(personCardNo)) {
throw new RuntimeException("获取用户证件信息失败");
}
personCardNo = EncryptUtil.decryptByAppIdAndSecret(personCardNo, webAppId, webAppSecret);
}
}
//用身份证号查询用户 用户类型01个人02企业
// 转换成本地app角色0企业1求职者2网格员 3内部政府人员 4其他浪潮用
@@ -440,7 +412,7 @@ public class SsoService {
//获取身份证,再获取年龄
String personCardNo = null;
//1.求职者 2.网格员
//0.企业 1.求职者 2.网格员
if ("0".equals(isCompanyUser)) {
appUser.setName(userJson.getString("nickName"));
appUser.setAddress(info.getString("entRegisteredAddress"));
@@ -480,6 +452,7 @@ public class SsoService {
AppUser checkUser = appUserService.selectAppuserByIdcardAndUserType(personCardNo, isCompanyUser);
if (checkUser != null) {
appUser.setUserId(checkUser.getUserId());
appUser.setUserType(checkUser.getUserType());
appUserService.updateAppUser(appUser);
} else {
appUserService.insertAppUser(appUser);