|
@@ -359,9 +359,20 @@ public class EsignController extends ApiBaseController {
|
|
|
return AjaxResult.success("url",url);
|
|
|
}
|
|
|
}else {//没有注册
|
|
|
- //去注册
|
|
|
- SysUser euser = eSignService.createPersonalAccount(user);
|
|
|
- if (euser!=null) {
|
|
|
+ /*首先根据user.getLoginName()查询E签宝是否存在此账户*/
|
|
|
+ String accountId = eSignService.getAccountIdByThirdId(user.getLoginName());
|
|
|
+ System.out.println("查询E签宝accountId:"+accountId);
|
|
|
+ SysUser euser = new SysUser();
|
|
|
+ if( accountId != null ){
|
|
|
+ /*保存已注册信息*/
|
|
|
+ euser.setUserId(Long.parseLong(userId));
|
|
|
+ euser.setAccountId(accountId);
|
|
|
+ int i = userService.updateUserInfo(euser);
|
|
|
+ }else{
|
|
|
+ //去注册
|
|
|
+ euser = eSignService.createPersonalAccount(user);
|
|
|
+ }
|
|
|
+ if (euser != null) {
|
|
|
//注册完以后获取认证路径
|
|
|
String url = personRealnVerifyService.personRealnVerify(euser.getAccountId(),redirectUrl);
|
|
|
return AjaxResult.success("url", url);
|
|
@@ -422,8 +433,27 @@ public class EsignController extends ApiBaseController {
|
|
|
return AjaxResult.success("url",url);
|
|
|
}
|
|
|
}else {//未注册
|
|
|
- //去注册
|
|
|
- CustomersExt ecustomersExt = eSignService.createThirdParty(customersExt);
|
|
|
+ /*首先根据customersExt.getChainsCode()查询E签宝是否存在此账户*/
|
|
|
+ String orgId = eSignService.getOrgIdByThirdId(customersExt.getChainsCode());
|
|
|
+ System.out.println("查询E签宝orgId:"+orgId);
|
|
|
+ CustomersExt ecustomersExt=null;
|
|
|
+ if(orgId!=null){
|
|
|
+ ecustomersExt = customersExtService.selectCustomersExtById(user.getSysUserExt().getOrgCode());
|
|
|
+ if (ecustomersExt!=null){
|
|
|
+ ecustomersExt.setOrgId(orgId);
|
|
|
+ /*修改企业id*/
|
|
|
+ customersExtService.updateCustomersExt(ecustomersExt);
|
|
|
+ }else {
|
|
|
+ ecustomersExt = new CustomersExt();
|
|
|
+ ecustomersExt.setOrgId(orgId);
|
|
|
+ ecustomersExt.setCreator(user.getAccountId());
|
|
|
+ ecustomersExt.setChainsCode(user.getSysUserExt().getOrgCode());
|
|
|
+ customersExtService.insertCustomersExt(ecustomersExt);
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ //去注册
|
|
|
+ ecustomersExt = eSignService.createThirdParty(customersExt);
|
|
|
+ }
|
|
|
if (ecustomersExt!=null) {
|
|
|
//注册完以后获取认证路径
|
|
|
String url = organRealVerifyService.organRealVerify(ecustomersExt.getOrgId(),ecustomersExt.getCreator(),redirectUrl);
|