|
@@ -15,6 +15,7 @@ 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.OrganizeTemplateType;
|
|
|
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;
|
|
@@ -89,7 +90,7 @@ public class TsignPlugin implements ESealPlugin, InitializingBean, DisposableBea
|
|
|
AddAccountResult result = service.addAccount(personbean);
|
|
|
if (result.getErrCode() == 0) {
|
|
|
return result.getAccountId();
|
|
|
- }else if(result.getErrCode() == 1500012){
|
|
|
+ } else if (result.getErrCode() == 1500012) {
|
|
|
return queryAccountIdByIdNo(idcard);
|
|
|
}
|
|
|
throw new ThirdpartyException(result.getMsg());
|
|
@@ -121,19 +122,29 @@ public class TsignPlugin implements ESealPlugin, InitializingBean, DisposableBea
|
|
|
* @param accountId e签宝账户唯一标识
|
|
|
* @return 电子印章数据
|
|
|
*/
|
|
|
- public String createSeal(String accountId) {
|
|
|
- // 创建模板类型
|
|
|
- PersonTemplateType templateType = PersonTemplateType.RECTANGLE;
|
|
|
+ public String createUserSeal(String accountId) {
|
|
|
// 生成模板印章的颜色
|
|
|
- SealColor color = SealColor.BLUE;
|
|
|
+ SealColor color = SealColor.RED;
|
|
|
SealService service = serviceClient.sealService();
|
|
|
- AddSealResult result = service.addTemplateSeal(accountId, templateType, color);
|
|
|
+ AddSealResult result = service.addTemplateSeal(accountId, PersonTemplateType.RECTANGLE, color);
|
|
|
if (0 == result.getErrCode()) {
|
|
|
return result.getSealData();
|
|
|
}
|
|
|
throw new ThirdpartyException("个人模板印章接口调用失败code=" + result.getErrCode() + "msg=" + result.getMsg());
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public String createOrganSeal(String accountId, String hText, String qText) {
|
|
|
+ // 生成模板印章的颜色
|
|
|
+ SealColor color = SealColor.RED;
|
|
|
+ SealService service = serviceClient.sealService();
|
|
|
+ AddSealResult result = service.addTemplateSeal(accountId, OrganizeTemplateType.STAR, color, hText, qText);
|
|
|
+ if (0 == result.getErrCode()) {
|
|
|
+ return result.getSealData();
|
|
|
+ }
|
|
|
+ throw new ThirdpartyException("企业模板印章接口调用失败code=" + result.getErrCode() + "msg=" + result.getMsg());
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 平台自身PDF摘要签署(印章标识)
|
|
|
* @param srcPdfPath 源文件
|
|
@@ -230,20 +241,20 @@ public class TsignPlugin implements ESealPlugin, InitializingBean, DisposableBea
|
|
|
}
|
|
|
throw new ThirdpartyException("平台用户PDF摘要签署接口调用失败" + result.getErrCode() + "msg=" + result.getMsg());
|
|
|
}
|
|
|
-
|
|
|
- private String queryAccountIdByIdNo(String idcardNo){
|
|
|
-
|
|
|
+
|
|
|
+ private String queryAccountIdByIdNo(String idcardNo) {
|
|
|
+
|
|
|
AccountService service = serviceClient.accountService();
|
|
|
-
|
|
|
+
|
|
|
GetAccountProfileResult result = service.getAccountInfoByIdNo(idcardNo, LicenseQueryType.MAINLAND);
|
|
|
-
|
|
|
- if(result != null){
|
|
|
+
|
|
|
+ if (result != null) {
|
|
|
AccountProfile accountProfile = result.getAccountInfo();
|
|
|
- if(accountProfile != null){
|
|
|
+ if (accountProfile != null) {
|
|
|
return accountProfile.getAccountUid();
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
return null;
|
|
|
}
|
|
|
}
|