实现签名功能
This commit is contained in:
@@ -88,7 +88,8 @@ public class SaaSAPIFileUtils {
|
|||||||
|
|
||||||
|
|
||||||
public static void main(String[] args) throws EsignDemoException {
|
public static void main(String[] args) throws EsignDemoException {
|
||||||
String filePath = "D:\\home\\ruoyi\\uploadPath\\upload\\2023\\10\\7\\23893bfd3f2249ffa5c82850c11c482e.docx";
|
// String filePath = "D:\\home\\ruoyi\\uploadPath\\upload\\2023\\10\\7\\23893bfd3f2249ffa5c82850c11c482e.docx";
|
||||||
|
String filePath = "D:\\home\\ruoyi\\uploadPath\\upload\\2023\\12\\调解书测试.docx";
|
||||||
EsignHttpResponse uploadUrl = getUploadUrl(filePath);
|
EsignHttpResponse uploadUrl = getUploadUrl(filePath);
|
||||||
String body = uploadUrl.getBody();
|
String body = uploadUrl.getBody();
|
||||||
JSONObject jsonObject = new JSONObject(body);
|
JSONObject jsonObject = new JSONObject(body);
|
||||||
@@ -100,8 +101,8 @@ public class SaaSAPIFileUtils {
|
|||||||
//String fileUploadUrl = "https://esignoss.esign.cn/1111564182/ccf6db5a-92da-4523-89ba-385a30423596/23893bfd3f2249ffa5c82850c11c482e.docx?Expires=1697021257&OSSAccessKeyId=STS.NTmgvSC8n5Zg1y7EciQftF23N&Signature=CxVZmpwFksWmLYkxPjVz9K4mVyA%3D&callback-var=eyJ4OmZpbGVfa2V5IjoiJDAyODhjOTg3LWNlNzgtNDM1OC04NWYwLTdlNmUyM2NjOTJmNiQzNDk1NzQ3MjE5In0%3D%0A&callback=eyJjYWxsYmFja1VybCI6Imh0dHA6Ly9zbWx0YXBpLnRzaWduLmNuL2FueWRvb3IvZmlsZS1zeXN0ZW0vY2FsbGJhY2svYWxpb3NzIiwiY2FsbGJhY2tCb2R5IjogIntcIm1pbWVUeXBlXCI6JHttaW1lVHlwZX0sXCJzaXplXCI6ICR7c2l6ZX0sXCJidWNrZXRcIjogJHtidWNrZXR9LFwib2JqZWN0XCI6ICR7b2JqZWN0fSxcImV0YWdcIjogJHtldGFnfSxcImZpbGVfa2V5XCI6JHt4OmZpbGVfa2V5fX0iLCJjYWxsYmFja0JvZHlUeXBlIjogImFwcGxpY2F0aW9uL2pzb24ifQ%3D%3D%0A&security-token=CAIS%2BAF1q6Ft5B2yfSjIr5fYLMznrudPgpiMM1%2BGoWM8XelYqfeYrDz2IHtKdXRvBu8Xs%2F4wnmxX7f4YlqB6T55OSAmcNZEofT7katr4MeT7oMWQweEurv%2FMQBqyaXPS2MvVfJ%2BOLrf0ceusbFbpjzJ6xaCAGxypQ12iN%2B%2Fm6%2FNgdc9FHHPPD1x8CcxROxFppeIDKHLVLozNCBPxhXfKB0ca0WgVy0EHsPnvm5DNs0uH1AKjkbRM9r6ceMb0M5NeW75kSMqw0eBMca7M7TVd8RAi9t0t1%2FIVpGiY4YDAWQYLv0rda7DOltFiMkpla7MmXqlft%2BhzcgeQY0pc%2FRqAAaxcPCSY0Du8wgErfR1llD8t2zeFG%2B1mktU4Rsl7AgxsSFxrwILBUk2x7imVsFVA0kkS8rNBMDKGIsIZTCl5M7S2L%2BD8364htwcZgIZYHK2fCN6gCuy%2Bfk9C%2FfQaTc00IWBMw8OubuJ%2Fq2mdMh32yoi7dLuJyhwt1z%2F%2BWf5vIFHdIAA%3D";
|
//String fileUploadUrl = "https://esignoss.esign.cn/1111564182/ccf6db5a-92da-4523-89ba-385a30423596/23893bfd3f2249ffa5c82850c11c482e.docx?Expires=1697021257&OSSAccessKeyId=STS.NTmgvSC8n5Zg1y7EciQftF23N&Signature=CxVZmpwFksWmLYkxPjVz9K4mVyA%3D&callback-var=eyJ4OmZpbGVfa2V5IjoiJDAyODhjOTg3LWNlNzgtNDM1OC04NWYwLTdlNmUyM2NjOTJmNiQzNDk1NzQ3MjE5In0%3D%0A&callback=eyJjYWxsYmFja1VybCI6Imh0dHA6Ly9zbWx0YXBpLnRzaWduLmNuL2FueWRvb3IvZmlsZS1zeXN0ZW0vY2FsbGJhY2svYWxpb3NzIiwiY2FsbGJhY2tCb2R5IjogIntcIm1pbWVUeXBlXCI6JHttaW1lVHlwZX0sXCJzaXplXCI6ICR7c2l6ZX0sXCJidWNrZXRcIjogJHtidWNrZXR9LFwib2JqZWN0XCI6ICR7b2JqZWN0fSxcImV0YWdcIjogJHtldGFnfSxcImZpbGVfa2V5XCI6JHt4OmZpbGVfa2V5fX0iLCJjYWxsYmFja0JvZHlUeXBlIjogImFwcGxpY2F0aW9uL2pzb24ifQ%3D%3D%0A&security-token=CAIS%2BAF1q6Ft5B2yfSjIr5fYLMznrudPgpiMM1%2BGoWM8XelYqfeYrDz2IHtKdXRvBu8Xs%2F4wnmxX7f4YlqB6T55OSAmcNZEofT7katr4MeT7oMWQweEurv%2FMQBqyaXPS2MvVfJ%2BOLrf0ceusbFbpjzJ6xaCAGxypQ12iN%2B%2Fm6%2FNgdc9FHHPPD1x8CcxROxFppeIDKHLVLozNCBPxhXfKB0ca0WgVy0EHsPnvm5DNs0uH1AKjkbRM9r6ceMb0M5NeW75kSMqw0eBMca7M7TVd8RAi9t0t1%2FIVpGiY4YDAWQYLv0rda7DOltFiMkpla7MmXqlft%2BhzcgeQY0pc%2FRqAAaxcPCSY0Du8wgErfR1llD8t2zeFG%2B1mktU4Rsl7AgxsSFxrwILBUk2x7imVsFVA0kkS8rNBMDKGIsIZTCl5M7S2L%2BD8364htwcZgIZYHK2fCN6gCuy%2Bfk9C%2FfQaTc00IWBMw8OubuJ%2Fq2mdMh32yoi7dLuJyhwt1z%2F%2BWf5vIFHdIAA%3D";
|
||||||
EsignHttpResponse esignHttpResponse = uploadFile(fileUploadUrl, filePath);
|
EsignHttpResponse esignHttpResponse = uploadFile(fileUploadUrl, filePath);
|
||||||
System.out.println("这是上传文件流的结果:"+esignHttpResponse.getBody());
|
System.out.println("这是上传文件流的结果:"+esignHttpResponse.getBody());
|
||||||
// EsignHttpResponse fileStatus = getFileStatus(fileId);
|
EsignHttpResponse fileStatus = getFileStatus(fileId);
|
||||||
// System.out.println("这是获取文件上传状态的结果:"+fileStatus.getBody());
|
System.out.println("这是获取文件上传状态的结果:"+fileStatus.getBody());
|
||||||
// getFileStatus("a808f1f39a744357a2f018e4ab34c55d");
|
// getFileStatus("a808f1f39a744357a2f018e4ab34c55d");
|
||||||
// fileDownloadUrl("");
|
// fileDownloadUrl("");
|
||||||
|
|
||||||
|
|||||||
+14
@@ -23,6 +23,12 @@ public class SealSignRecord extends BaseEntity {
|
|||||||
private String pensonAccount;
|
private String pensonAccount;
|
||||||
/** 签名人姓名 */
|
/** 签名人姓名 */
|
||||||
private String pensonName;
|
private String pensonName;
|
||||||
|
|
||||||
|
/** 被申请人账户 */
|
||||||
|
private String pensonAccountRes;
|
||||||
|
/** 被申请人姓名 */
|
||||||
|
private String pensonNameRes;
|
||||||
|
|
||||||
/** 机构名称 */
|
/** 机构名称 */
|
||||||
private String orgnizeName;
|
private String orgnizeName;
|
||||||
/** 机构经办人 */
|
/** 机构经办人 */
|
||||||
@@ -52,6 +58,14 @@ public class SealSignRecord extends BaseEntity {
|
|||||||
private double positionXpsn;
|
private double positionXpsn;
|
||||||
/** 签名位置y坐标 */
|
/** 签名位置y坐标 */
|
||||||
private double positionYpsn;
|
private double positionYpsn;
|
||||||
|
|
||||||
|
/** 被申请人签名位置页数 */
|
||||||
|
private String positionPagepsnRes;
|
||||||
|
/** 被申请人签名位置x坐标 */
|
||||||
|
private double positionXpsnRes;
|
||||||
|
/** 被申请人签名位置y坐标 */
|
||||||
|
private double positionYpsnRes;
|
||||||
|
|
||||||
/** 印章位置页数 */
|
/** 印章位置页数 */
|
||||||
private String positionPageorg;
|
private String positionPageorg;
|
||||||
/** 印章位置x坐标 */
|
/** 印章位置x坐标 */
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ package com.ruoyi.wisdomarbitrate.utils;
|
|||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.JsonArray;
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
|
import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
|
||||||
import com.ruoyi.common.enums.EsignRequestType;
|
import com.ruoyi.common.enums.EsignRequestType;
|
||||||
import com.ruoyi.common.exception.EsignDemoException;
|
import com.ruoyi.common.exception.EsignDemoException;
|
||||||
@@ -13,6 +15,7 @@ import com.ruoyi.wisdomarbitrate.domain.vo.base.StringIdsReq;
|
|||||||
import com.ruoyi.wisdomarbitrate.domain.dto.dept.DeptIdentify;
|
import com.ruoyi.wisdomarbitrate.domain.dto.dept.DeptIdentify;
|
||||||
import com.ruoyi.wisdomarbitrate.domain.dto.mscase.SealSignRecord;
|
import com.ruoyi.wisdomarbitrate.domain.dto.mscase.SealSignRecord;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -28,23 +31,28 @@ public class SignAward {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* 发起签署*/
|
/* 发起签署*/
|
||||||
// EsignHttpResponse createByFile = createByFile(sealSignRecord);
|
// EsignHttpResponse createByFile = createByFileMediation(sealSignRecord,sealIdList);
|
||||||
// JsonObject createByFileJsonObject = gson.fromJson(createByFile.getBody(), JsonObject.class);
|
// JsonObject createByFileJsonObject = gson.fromJson(createByFile.getBody(), JsonObject.class);
|
||||||
// JsonObject createByFileData = createByFileJsonObject.getAsJsonObject("data");
|
// JsonObject createByFileData = createByFileJsonObject.getAsJsonObject("data");
|
||||||
// String signFlowId = createByFileData.get("signFlowId").getAsString();
|
// String signFlowId = createByFileData.get("signFlowId").getAsString();
|
||||||
// System.err.println("流程id:"+signFlowId);
|
// System.out.println("流程id:"+signFlowId);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* 获取文件签名印章位置*/
|
/* 获取文件签名印章位置*/
|
||||||
// EsignHttpResponse positions = getPositions(sealSignRecord);
|
// EsignHttpResponse positions = getPositionsMediation(sealSignRecord);
|
||||||
// JsonObject positionsJsonObject = gson.fromJson(positions.getBody(), JsonObject.class);
|
// JsonObject positionsJsonObject = gson.fromJson(positions.getBody(), JsonObject.class);
|
||||||
// JsonObject positionsData = positionsJsonObject.getAsJsonObject("data");
|
// JsonObject positionsData = positionsJsonObject.getAsJsonObject("data");
|
||||||
// JsonArray keywordPositions = positionsData.get("keywordPositions").getAsJsonArray();
|
// JsonArray keywordPositions = positionsData.get("keywordPositions").getAsJsonArray();
|
||||||
// System.out.println("获取文件签名印章位置:" +keywordPositions.toString());
|
// System.out.println("获取文件签名印章位置:" +keywordPositions.toString());
|
||||||
|
|
||||||
// String signFlowId = "c9955453716344f9971d308abdc13464";
|
// String signFlowId = "c9955453716344f9971d308abdc13464";
|
||||||
|
|
||||||
//获取合同文件签名链接
|
//获取合同文件签名链接
|
||||||
// EsignHttpResponse signUrl = signUrl(sealSignRecord);
|
// EsignHttpResponse signUrl = signUrlMediation(sealSignRecord);
|
||||||
// JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class);
|
// JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class);
|
||||||
// JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
|
// JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
|
||||||
// String shortUrl = signUrlData.get("shortUrl").getAsString();
|
// String shortUrl = signUrlData.get("shortUrl").getAsString();
|
||||||
@@ -274,6 +282,173 @@ public class SignAward {
|
|||||||
return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false);
|
return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发起签署
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* @throws EsignDemoException
|
||||||
|
*/
|
||||||
|
public static EsignHttpResponse createByFileMediation(SealSignRecord sealSignRecord ,List<String> sealIdList) throws EsignDemoException {
|
||||||
|
String apiaddr = "/v3/sign-flow/create-by-file";
|
||||||
|
|
||||||
|
String fileId = sealSignRecord.getFileid();
|
||||||
|
String fileName = sealSignRecord.getFilename();
|
||||||
|
|
||||||
|
String psnAccount = sealSignRecord.getPensonAccount();
|
||||||
|
String psnName = sealSignRecord.getPensonName();
|
||||||
|
|
||||||
|
String psnAccountRes = sealSignRecord.getPensonAccountRes();
|
||||||
|
String psnNameRes = sealSignRecord.getPensonNameRes();
|
||||||
|
|
||||||
|
String orgName = sealSignRecord.getOrgnizeName();
|
||||||
|
String orgNamePsnAccount = sealSignRecord.getOrgnizeNamePsnAccount();
|
||||||
|
String orgNamepsnName = sealSignRecord.getOrgnizeNamepsnName();
|
||||||
|
|
||||||
|
String positionPagepsn = sealSignRecord.getPositionPagepsn();
|
||||||
|
double positionXpsn = sealSignRecord.getPositionXpsn();
|
||||||
|
double positionYpsn = sealSignRecord.getPositionYpsn();
|
||||||
|
|
||||||
|
String positionPagepsnRes = sealSignRecord.getPositionPagepsnRes();
|
||||||
|
double positionXpsnRes = sealSignRecord.getPositionXpsnRes();
|
||||||
|
double positionYpsnRes = sealSignRecord.getPositionYpsnRes();
|
||||||
|
|
||||||
|
String positionPageorg = sealSignRecord.getPositionPageorg();
|
||||||
|
double positionXorg = sealSignRecord.getPositionXorg();
|
||||||
|
double positionYorg = sealSignRecord.getPositionYorg();
|
||||||
|
String availableSealId = "209af82b-5f87-4e0a-b0d8-cc4923b6e652";
|
||||||
|
|
||||||
|
|
||||||
|
String jsonParm = "{\n" +
|
||||||
|
" \"docs\": [\n" +
|
||||||
|
" {\n" +
|
||||||
|
" \"fileId\": \"" + fileId + "\",\n" +
|
||||||
|
" \"fileName\": \"" + fileName + "\"\n" +
|
||||||
|
" }\n" +
|
||||||
|
" ],\n" +
|
||||||
|
" \"signFlowConfig\": {\n" +
|
||||||
|
" \"signFlowTitle\": \"测试合同\",\n" +
|
||||||
|
" \"autoStart\": true,\n" +
|
||||||
|
" \"authConfig\": {\n" +
|
||||||
|
" \"willingnessAuthModes\": [\n" +
|
||||||
|
" \"CODE_SMS\"\n" +
|
||||||
|
" ],\n" +
|
||||||
|
" \"psnAvailableAuthModes\": [\n" +
|
||||||
|
" \"PSN_MOBILE3\"\n" +
|
||||||
|
" ],\n" +
|
||||||
|
" \"orgAvailableAuthModes\": [\n" +
|
||||||
|
" \"ORG_LEGALREP\"\n" +
|
||||||
|
" ]\n" +
|
||||||
|
" },\n" +
|
||||||
|
|
||||||
|
" \"signConfig\": {\n" +
|
||||||
|
" \"availableSignClientTypes\": \"1\"\n" +
|
||||||
|
" },\n" +
|
||||||
|
|
||||||
|
" \"autoFinish\": true\n" +
|
||||||
|
" },\n" +
|
||||||
|
|
||||||
|
" \"signers\": [\n" +
|
||||||
|
" {\n" +
|
||||||
|
" \"psnSignerInfo\": {\n" +
|
||||||
|
" \"psnAccount\": \"" + psnAccount + "\",\n" +
|
||||||
|
" \"psnInfo\": {\n" +
|
||||||
|
" \"psnName\": \"" + psnName + "\"\n" +
|
||||||
|
" }\n" +
|
||||||
|
" },\n" +
|
||||||
|
" \"signFields\": [\n" +
|
||||||
|
" {\n" +
|
||||||
|
" \"fileId\": \"" + fileId + "\",\n" +
|
||||||
|
" \"normalSignFieldConfig\": {\n" +
|
||||||
|
" \"autoSign\": false,\n" +
|
||||||
|
" \"freeMode\": false,\n" +
|
||||||
|
" \"movableSignField\": false,\n" +
|
||||||
|
" \"signFieldPosition\": {\n" +
|
||||||
|
" \"positionPage\": \"" + positionPagepsn + "\",\n" +
|
||||||
|
" \"positionX\": " + positionXpsn + ",\n" +
|
||||||
|
" \"positionY\": " + positionYpsn + "\n" +
|
||||||
|
" },\n" +
|
||||||
|
" \"signFieldStyle\": 1\n" +
|
||||||
|
" },\n" +
|
||||||
|
" \"signFieldType\": 0\n" +
|
||||||
|
" }\n" +
|
||||||
|
" ],\n" +
|
||||||
|
" \"signerType\": 0\n" +
|
||||||
|
" },\n" +
|
||||||
|
|
||||||
|
" {\n" +
|
||||||
|
" \"psnSignerInfo\": {\n" +
|
||||||
|
" \"psnAccount\": \"" + psnAccountRes + "\",\n" +
|
||||||
|
" \"psnInfo\": {\n" +
|
||||||
|
" \"psnName\": \"" + psnNameRes + "\"\n" +
|
||||||
|
" }\n" +
|
||||||
|
" },\n" +
|
||||||
|
" \"signFields\": [\n" +
|
||||||
|
" {\n" +
|
||||||
|
" \"fileId\": \"" + fileId + "\",\n" +
|
||||||
|
" \"normalSignFieldConfig\": {\n" +
|
||||||
|
" \"autoSign\": false,\n" +
|
||||||
|
" \"freeMode\": false,\n" +
|
||||||
|
" \"movableSignField\": false,\n" +
|
||||||
|
" \"signFieldPosition\": {\n" +
|
||||||
|
" \"positionPage\": \"" + positionPagepsnRes + "\",\n" +
|
||||||
|
" \"positionX\": " + positionXpsnRes + ",\n" +
|
||||||
|
" \"positionY\": " + positionYpsnRes + "\n" +
|
||||||
|
" },\n" +
|
||||||
|
" \"signFieldStyle\": 1\n" +
|
||||||
|
" },\n" +
|
||||||
|
" \"signFieldType\": 0\n" +
|
||||||
|
" }\n" +
|
||||||
|
" ],\n" +
|
||||||
|
" \"signerType\": 0\n" +
|
||||||
|
" },\n" +
|
||||||
|
|
||||||
|
" {\n" +
|
||||||
|
" \"orgSignerInfo\": {\n" +
|
||||||
|
" \"orgName\": \"" + orgName + "\",\n" +
|
||||||
|
" \"transactorInfo\": {\n" +
|
||||||
|
" \"psnAccount\": \"" + orgNamePsnAccount + "\",\n" +
|
||||||
|
" \"psnInfo\": {\n" +
|
||||||
|
" \"psnName\": \"" + orgNamepsnName + "\"\n" +
|
||||||
|
" }\n" +
|
||||||
|
" }\n" +
|
||||||
|
" },\n" +
|
||||||
|
|
||||||
|
" \"signFields\": [\n" +
|
||||||
|
" {\n" +
|
||||||
|
" \"fileId\": \"" + fileId + "\",\n" +
|
||||||
|
" \"normalSignFieldConfig\": {\n" +
|
||||||
|
" \"autoSign\": false,\n" +
|
||||||
|
" \"freeMode\": false,\n" +
|
||||||
|
|
||||||
|
/* " \"availableSealIds\": [\n" +
|
||||||
|
" \"" + availableSealId + "\"\n" +
|
||||||
|
" ],\n" +*/
|
||||||
|
// " \"availableSealIds\": " + new Gson().toJson(sealIdList) + ",\n" +
|
||||||
|
|
||||||
|
" \"signFieldPosition\": {\n" +
|
||||||
|
" \"positionPage\": \"" + positionPageorg + "\",\n" +
|
||||||
|
" \"positionX\": " + positionXorg + ",\n" +
|
||||||
|
" \"positionY\": " + positionYorg + "\n" +
|
||||||
|
" },\n" +
|
||||||
|
" \"signFieldStyle\": 1\n" +
|
||||||
|
" },\n" +
|
||||||
|
" \"signFieldType\": 0\n" +
|
||||||
|
" }\n" +
|
||||||
|
" ],\n" +
|
||||||
|
" \"signerType\": 1\n" +
|
||||||
|
" }\n" +
|
||||||
|
|
||||||
|
" ]\n" +
|
||||||
|
"}";
|
||||||
|
|
||||||
|
//请求方法
|
||||||
|
EsignRequestType requestType = EsignRequestType.POST;
|
||||||
|
//生成请求签名鉴权方式的Header
|
||||||
|
Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, false);
|
||||||
|
//发起接口请求
|
||||||
|
return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取合同文件签名链接
|
* 获取合同文件签名链接
|
||||||
*
|
*
|
||||||
@@ -301,6 +476,35 @@ public class SignAward {
|
|||||||
//发起接口请求
|
//发起接口请求
|
||||||
return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false);
|
return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取合同文件移动端签名链接
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* @throws EsignDemoException
|
||||||
|
*/
|
||||||
|
public static EsignHttpResponse signUrlMediation(SealSignRecord sealSignRecord) throws EsignDemoException {
|
||||||
|
|
||||||
|
String signFlowId = sealSignRecord.getSignFlowid();
|
||||||
|
String psnAccount = sealSignRecord.getPensonAccount();
|
||||||
|
|
||||||
|
String apiaddr = "/v3/sign-flow/" + signFlowId + "/sign-url";
|
||||||
|
String jsonParm = "{\n" +
|
||||||
|
|
||||||
|
" \"clientType\": \"H5\",\n" +
|
||||||
|
|
||||||
|
" \"operator\": {\n" +
|
||||||
|
" \"psnAccount\": \"" + psnAccount + "\"\n" +
|
||||||
|
" }\n" +
|
||||||
|
"}";
|
||||||
|
//请求方法
|
||||||
|
EsignRequestType requestType = EsignRequestType.POST;
|
||||||
|
//生成请求签名鉴权方式的Header
|
||||||
|
Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, false);
|
||||||
|
//发起接口请求
|
||||||
|
return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取批量签页面链接
|
* 获取批量签页面链接
|
||||||
*
|
*
|
||||||
@@ -474,6 +678,30 @@ public class SignAward {
|
|||||||
return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false);
|
return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取文件签名印章位置
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* @throws EsignDemoException
|
||||||
|
*/
|
||||||
|
public static EsignHttpResponse getPositionsMediation(SealSignRecord sealSignRecord) throws EsignDemoException {
|
||||||
|
String fileId = sealSignRecord.getFileid();
|
||||||
|
String apiaddr = "/v3/files/" + fileId + "/keyword-positions";
|
||||||
|
String jsonParm = "{\n" +
|
||||||
|
" \"keywords\": [\n" +
|
||||||
|
" \"申请人:\",\n" +
|
||||||
|
" \"被申请人:\",\n" +
|
||||||
|
" \"(盖章)\"\n" +
|
||||||
|
" ]\n" +
|
||||||
|
"}";
|
||||||
|
//请求方法
|
||||||
|
EsignRequestType requestType = EsignRequestType.POST;
|
||||||
|
//生成请求签名鉴权方式的Header
|
||||||
|
Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, false);
|
||||||
|
//发起接口请求
|
||||||
|
return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建机构图片印章
|
* 创建机构图片印章
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user