update
This commit is contained in:
@@ -128,7 +128,25 @@ public class SsoService {
|
||||
// 转换成本地:app角色:0企业,1求职者,2网格员 3内部政府人员 4其他(浪潮用)
|
||||
String isCompanyUser = userJson.getString("userType");
|
||||
isCompanyUser = "01".equals(isCompanyUser) ? "1" : "0";
|
||||
//获取身份证号
|
||||
String personCardNo = null;
|
||||
JSONObject info = userJson.getJSONObject("info");;
|
||||
//保存企业信息
|
||||
if("0".equals(isCompanyUser)){
|
||||
personCardNo=info.getString("entCreditCode");
|
||||
if (personCardNo != null) {
|
||||
Company company=companyService.queryCodeCompany(personCardNo);
|
||||
if(company==null){
|
||||
JSONObject infoJson = userJson.getJSONObject("info");
|
||||
saveCompany(infoJson);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//1.先查appuser,不存在,则新增
|
||||
AppUser appUser = saveAppUser(userJson, isCompanyUser, webAppId, webAppSecret);
|
||||
//2.再查sysuser,不存在,则新增
|
||||
saveSysUser(userJson, appUser.getUserId(), isCompanyUser, webAppId, webAppSecret);
|
||||
//用户存在,生成本系统用户的token
|
||||
String token = loginAppUser(appUser, userJson.getString("userName"));
|
||||
JSONObject backJson = new JSONObject();
|
||||
@@ -161,7 +179,25 @@ public class SsoService {
|
||||
// 转换成本地:app角色:0企业,1求职者,2网格员 3内部政府人员 4其他(浪潮用)
|
||||
String isCompanyUser = userJson.getString("userType");
|
||||
isCompanyUser = "01".equals(isCompanyUser) ? "1" : "0";
|
||||
//获取身份证号
|
||||
String personCardNo = null;
|
||||
JSONObject info = userJson.getJSONObject("info");;
|
||||
//保存企业信息
|
||||
if("0".equals(isCompanyUser)){
|
||||
personCardNo=info.getString("entCreditCode");
|
||||
if (personCardNo != null) {
|
||||
Company company=companyService.queryCodeCompany(personCardNo);
|
||||
if(company==null){
|
||||
JSONObject infoJson = userJson.getJSONObject("info");
|
||||
saveCompany(infoJson);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//1.先查appuser,不存在,则新增
|
||||
AppUser appUser = saveAppUser(userJson, isCompanyUser, webAppId, webAppSecret);
|
||||
//2.再查sysuser,不存在,则新增
|
||||
saveSysUser(userJson, appUser.getUserId(), isCompanyUser, webAppId, webAppSecret);
|
||||
//用户存在,生成本系统用户的token
|
||||
String token = loginAppUser(appUser, userJson.getString("userName"));
|
||||
JSONObject backJson = new JSONObject();
|
||||
@@ -414,7 +450,7 @@ public class SsoService {
|
||||
String personCardNo = null;
|
||||
//0.企业 1.求职者 2.网格员
|
||||
if ("0".equals(isCompanyUser)) {
|
||||
appUser.setName(userJson.getString("nickName"));
|
||||
appUser.setName(info.getString("entName"));
|
||||
appUser.setAddress(info.getString("entRegisteredAddress"));
|
||||
appUser.setDomicileAddress(info.getString("entRegisteredAddress"));
|
||||
personCardNo = info.getString("entCreditCode");
|
||||
@@ -425,7 +461,6 @@ public class SsoService {
|
||||
phone = EncryptUtil.decryptByAppIdAndSecret(phone, appId, appSecret);
|
||||
appUser.setPhone(phone);
|
||||
}
|
||||
|
||||
} else {
|
||||
appUser.setName(info != null ? info.getString("personName") : userJson.getString("nickName"));
|
||||
appUser.setSex(info != null ? info.getString("personSex") : userJson.getString("sex"));
|
||||
|
||||
Reference in New Issue
Block a user