|
|
@ -116,10 +116,8 @@ public class AppEnterpriseLoginServiceImpl implements IAppEnterpriseLoginService |
|
|
*/ |
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
public Map<String, Object> siqLogin(AppEnterpriseLoginBo bo) { |
|
|
public Map<String, Object> siqLogin(AppEnterpriseLoginBo bo) { |
|
|
log.info("---> 深i企登录用户 code:{}", bo.getCode()); |
|
|
|
|
|
JSONObject userInfo = siqLoginInfo(bo); |
|
|
JSONObject userInfo = siqLoginInfo(bo); |
|
|
log.info("---> 深i企登录用户信息:{}", userInfo); |
|
|
log.info("---> 深i企登录用户信息:{}", userInfo); |
|
|
log.info("---> 后面为本地登录的验证了!!! <---"); |
|
|
|
|
|
return doSiqLoginWithLock(userInfo); |
|
|
return doSiqLoginWithLock(userInfo); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -290,30 +288,22 @@ public class AppEnterpriseLoginServiceImpl implements IAppEnterpriseLoginService |
|
|
public JSONObject siqLoginInfo(AppEnterpriseLoginBo bo) { |
|
|
public JSONObject siqLoginInfo(AppEnterpriseLoginBo bo) { |
|
|
try { |
|
|
try { |
|
|
Map<String, Object> params = new HashMap<>(); |
|
|
Map<String, Object> params = new HashMap<>(); |
|
|
log.info("调用深i企登录接口,参数: {}", bo); |
|
|
|
|
|
String accessKeySign = IdCardCryptoUtil.symmetricEncryptIdCard(secretKey, bo.getCode()); |
|
|
String accessKeySign = IdCardCryptoUtil.symmetricEncryptIdCard(secretKey, bo.getCode()); |
|
|
params.put("accessKeySign", accessKeySign); |
|
|
|
|
|
params.put("appCode", code); |
|
|
params.put("appCode", code); |
|
|
log.info("调用深i企登录接口,参数加密后: {}", params); |
|
|
params.put("accessKeySign", accessKeySign); |
|
|
|
|
|
|
|
|
String data = HttpUtil.httpSendPost( |
|
|
String data = HttpUtil.httpSendPost( |
|
|
siqUrl + ApiConstants.API_SIQUSERLOGIN, |
|
|
siqUrl + ApiConstants.API_SIQUSERLOGIN, |
|
|
JSONObject.toJSONString(params), |
|
|
JSONObject.toJSONString(params), |
|
|
new HashMap<>() |
|
|
new HashMap<>() |
|
|
); |
|
|
); |
|
|
log.info("调用深i企登录接口响应: {}", data); |
|
|
|
|
|
|
|
|
|
|
|
JSONObject jsonObject = JSONObject.parseObject(data); |
|
|
JSONObject jsonObject = JSONObject.parseObject(data); |
|
|
JSONObject userInfo = jsonObject.getJSONObject("data"); |
|
|
JSONObject userInfo = jsonObject.getJSONObject("data"); |
|
|
|
|
|
|
|
|
if (userInfo == null) { |
|
|
if (userInfo == null) { |
|
|
log.error("深i企接口返回数据为空: {}", data); |
|
|
log.error("深i企接口返回数据为空: {}", data); |
|
|
throw new BaseException("深i企接口返回数据异常"); |
|
|
throw new BaseException("深i企接口返回数据异常"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
log.info("解析深i企登录接口响应成功,用户信息: {}", userInfo); |
|
|
|
|
|
return userInfo; |
|
|
return userInfo; |
|
|
|
|
|
|
|
|
} catch (BaseException e) { |
|
|
} catch (BaseException e) { |
|
|
throw e; |
|
|
throw e; |
|
|
} catch (Exception e) { |
|
|
} catch (Exception e) { |
|
|
@ -336,8 +326,7 @@ public class AppEnterpriseLoginServiceImpl implements IAppEnterpriseLoginService |
|
|
EnterpriseInformation existingEnterprise = enterpriseInformationMapper.selectOne(queryWrapper); |
|
|
EnterpriseInformation existingEnterprise = enterpriseInformationMapper.selectOne(queryWrapper); |
|
|
|
|
|
|
|
|
if (existingEnterprise != null) { |
|
|
if (existingEnterprise != null) { |
|
|
log.info("企业已存在,执行更新操作: enterpriseNumber={}, enterpriseId={}", |
|
|
log.info("企业已存在,执行更新操作: enterpriseNumber={}, enterpriseId={}", enterpriseNumber, existingEnterprise.getId()); |
|
|
enterpriseNumber, existingEnterprise.getId()); |
|
|
|
|
|
|
|
|
|
|
|
existingEnterprise.setEnterpriseName(userInfo.getString("corpName")); |
|
|
existingEnterprise.setEnterpriseName(userInfo.getString("corpName")); |
|
|
existingEnterprise.setCompanyOrgType(userInfo.getString("companyOrgType")); |
|
|
existingEnterprise.setCompanyOrgType(userInfo.getString("companyOrgType")); |
|
|
|