更新:单点登录更新appUser时,保留原有用户的userType字段(此字段用于政策查询)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user