|
|
@@ -3,6 +3,7 @@ package com.ruoyi.tool.service;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.junziqian.sdk.bean.ResultInfo;
|
|
|
import com.junziqian.sdk.util.RequestUtils;
|
|
|
+import com.ruoyi.common.exception.ServiceException;
|
|
|
import com.ruoyi.common.filepathsplicing.FilePathSplicingUtil;
|
|
|
import com.ruoyi.tool.config.JzqProperties;
|
|
|
import com.ruoyi.tool.request.OcrRequest;
|
|
|
@@ -28,7 +29,7 @@ public class JzqService {
|
|
|
/**
|
|
|
* 上传个人自定义印章图片
|
|
|
*/
|
|
|
- public Boolean uploadPersSign(String identityCard, String signImgFile) {
|
|
|
+ public void uploadPersSign(String identityCard, String signImgFile) {
|
|
|
RequestUtils requestUtils = RequestUtils.init(jzqProperties.getBaseUrl(), jzqProperties.getAppKey(), jzqProperties.getAppSecret());
|
|
|
//构建请求参数
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
@@ -36,13 +37,15 @@ public class JzqService {
|
|
|
params.put("signImgFile", filePathSplicingUtil.getPrefix() + signImgFile);
|
|
|
ResultInfo<Void> ri = requestUtils.doPost(jzqProperties.getUploadPersSign(), params);
|
|
|
log.info("上传个人自定义印章图片:{}", ri.getMsg());
|
|
|
- return ri.isSuccess();
|
|
|
+ if (!ri.isSuccess()) {
|
|
|
+ throw new ServiceException("操作失败:" + ri.getMsg());
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 个人证书申请资料上传
|
|
|
*/
|
|
|
- public Boolean cloudCertiPerInfo(String fullName, String identityCard, String idenFront, String idenReverse) {
|
|
|
+ public void cloudCertiPerInfo(String fullName, String identityCard, String idenFront, String idenReverse) {
|
|
|
RequestUtils requestUtils = RequestUtils.init(jzqProperties.getBaseUrl(), jzqProperties.getAppKey(), jzqProperties.getAppSecret());
|
|
|
//构建请求参数
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
@@ -52,7 +55,9 @@ public class JzqService {
|
|
|
params.put("idenReverse", filePathSplicingUtil.getPrefix() + idenReverse);
|
|
|
ResultInfo<String> ri = requestUtils.doPost(jzqProperties.getCloudCertiPerInfo(), params);
|
|
|
log.info("个人证书申请资料上传:{}", ri.getMsg());
|
|
|
- return ri.isSuccess();
|
|
|
+ if (!ri.isSuccess()) {
|
|
|
+ throw new ServiceException("操作失败:" + ri.getMsg());
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -64,8 +69,9 @@ public class JzqService {
|
|
|
log.info("签约发起-模板类API:{}", ri.getMsg());
|
|
|
if (ri.isSuccess()) {
|
|
|
return ri.getData();
|
|
|
+ } else {
|
|
|
+ throw new ServiceException("操作失败:" + ri.getMsg());
|
|
|
}
|
|
|
- return null;
|
|
|
}
|
|
|
|
|
|
/**
|