瀏覽代碼

feat:非身份证也生成签章

Joburgess 3 年之前
父節點
當前提交
f8284852ce
共有 1 個文件被更改,包括 12 次插入9 次删除
  1. 12 9
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ContractServiceImpl.java

+ 12 - 9
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ContractServiceImpl.java

@@ -195,24 +195,27 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
 			String accountId = "";
 			String sealData = "";
 
-			try {
+			SysUser user = sysUserFeignService.queryUserById(userId);
+			if (user == null) {
+				throw new BizException("用户信息查询失败");
+			}
+
+			if(CertificateTypeEnum.IDENTITY.getCode().equals(user.getCertificateType())){
 				if(!debugMode){
 					realnameAuthenticationPluginContext.getRealnameAuthenticationPlugin(LinkfaceRealnameAuthenticationPlugin.getName()).verify(realName, idCardNo);
 				}
 
 				accountId = eSealPlugin.createUserAccount(realName, idCardNo, mobileNo);
 
-//				if (StringUtils.isBlank(accountId)) {
-//					throw new BizException("创建电子存证账户失败");
-//				}
+				if (StringUtils.isBlank(accountId)) {
+					throw new BizException("创建电子存证账户失败");
+				}
 
 				sealData = eSealPlugin.createUserSeal(accountId);
 
-//				if (StringUtils.isBlank(sealData)) {
-//					throw new BizException("创建电子存证印章失败");
-//				}
-			} catch (BizException e) {
-				logger.error("用户身份信息验证失败", e);
+				if (StringUtils.isBlank(sealData)) {
+					throw new BizException("创建电子存证印章失败");
+				}
 			}
 
 			sysUserTsign = new SysUserTsign(userId, accountId, sealData, realName, idCardNo);