|  | @@ -5,6 +5,7 @@ import org.springframework.beans.factory.InitializingBean;
 | 
	
		
			
				|  |  |  import org.springframework.beans.factory.annotation.Value;
 | 
	
		
			
				|  |  |  import org.springframework.stereotype.Service;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +import com.timevale.esign.sdk.tech.bean.AccountProfile;
 | 
	
		
			
				|  |  |  import com.timevale.esign.sdk.tech.bean.OrganizeBean;
 | 
	
		
			
				|  |  |  import com.timevale.esign.sdk.tech.bean.PersonBean;
 | 
	
		
			
				|  |  |  import com.timevale.esign.sdk.tech.bean.PosBean;
 | 
	
	
		
			
				|  | @@ -12,10 +13,12 @@ import com.timevale.esign.sdk.tech.bean.SignPDFFileBean;
 | 
	
		
			
				|  |  |  import com.timevale.esign.sdk.tech.bean.result.AddAccountResult;
 | 
	
		
			
				|  |  |  import com.timevale.esign.sdk.tech.bean.result.AddSealResult;
 | 
	
		
			
				|  |  |  import com.timevale.esign.sdk.tech.bean.result.FileDigestSignResult;
 | 
	
		
			
				|  |  | +import com.timevale.esign.sdk.tech.bean.result.GetAccountProfileResult;
 | 
	
		
			
				|  |  |  import com.timevale.esign.sdk.tech.bean.result.Result;
 | 
	
		
			
				|  |  |  import com.timevale.esign.sdk.tech.bean.seal.PersonTemplateType;
 | 
	
		
			
				|  |  |  import com.timevale.esign.sdk.tech.bean.seal.SealColor;
 | 
	
		
			
				|  |  |  import com.timevale.esign.sdk.tech.impl.constants.LegalAreaType;
 | 
	
		
			
				|  |  | +import com.timevale.esign.sdk.tech.impl.constants.LicenseQueryType;
 | 
	
		
			
				|  |  |  import com.timevale.esign.sdk.tech.impl.constants.OrganRegType;
 | 
	
		
			
				|  |  |  import com.timevale.esign.sdk.tech.impl.constants.SignType;
 | 
	
		
			
				|  |  |  import com.timevale.esign.sdk.tech.service.AccountService;
 | 
	
	
		
			
				|  | @@ -86,6 +89,8 @@ public class TsignPlugin implements ESealPlugin, InitializingBean, DisposableBea
 | 
	
		
			
				|  |  |  		AddAccountResult result = service.addAccount(personbean);
 | 
	
		
			
				|  |  |  		if (result.getErrCode() == 0) {
 | 
	
		
			
				|  |  |  			return result.getAccountId();
 | 
	
		
			
				|  |  | +		}else if(result.getErrCode() == 1500012){
 | 
	
		
			
				|  |  | +			return queryAccountIdByIdNo(idcard);
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  |  		throw new ThirdpartyException("创建个人账户接口调用失败code=" + result.getErrCode() + "msg=" + result.getMsg());
 | 
	
		
			
				|  |  |  	}
 | 
	
	
		
			
				|  | @@ -225,4 +230,20 @@ public class TsignPlugin implements ESealPlugin, InitializingBean, DisposableBea
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  |  		throw new ThirdpartyException("平台用户PDF摘要签署接口调用失败" + result.getErrCode() + "msg=" + result.getMsg());
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  | +	
 | 
	
		
			
				|  |  | +	private String queryAccountIdByIdNo(String idcardNo){
 | 
	
		
			
				|  |  | +		
 | 
	
		
			
				|  |  | +		AccountService service = serviceClient.accountService();
 | 
	
		
			
				|  |  | +		
 | 
	
		
			
				|  |  | +		GetAccountProfileResult result = service.getAccountInfoByIdNo(idcardNo, LicenseQueryType.MAINLAND);
 | 
	
		
			
				|  |  | +		
 | 
	
		
			
				|  |  | +		if(result != null){
 | 
	
		
			
				|  |  | +			AccountProfile accountProfile = result.getAccountInfo();
 | 
	
		
			
				|  |  | +			if(accountProfile != null){
 | 
	
		
			
				|  |  | +				return accountProfile.getAccountUid();
 | 
	
		
			
				|  |  | +			}
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +		
 | 
	
		
			
				|  |  | +		return null;
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  |  }
 |