机构管理.公章管理优化

This commit is contained in:
hejinbo
2023-11-15 18:27:09 +08:00
parent 044cffeb7f
commit 8b0eae8dca
13 changed files with 495 additions and 554 deletions
@@ -18,6 +18,7 @@ import java.io.File;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.UUID;
public class SignAward {
@@ -119,10 +120,7 @@ public class SignAward {
// System.out.println(signFlowDetailJsonObject);
DeptIdentify deptIdentify = new DeptIdentify();
deptIdentify.setOrgId("db279dd50d844e6fa64770d9a6edc7dd");
EsignHttpResponse orgByImage = createOrgByImage(deptIdentify, "D:\\develop\\2.jpg");
System.out.println("这是结果===============" + orgByImage);
}
@@ -150,7 +148,7 @@ public class SignAward {
* @return
* @throws EsignDemoException
*/
public static EsignHttpResponse createByFile(SealSignRecord sealSignRecord) throws EsignDemoException {
public static EsignHttpResponse createByFile(SealSignRecord sealSignRecord ,List<String> sealIdList) throws EsignDemoException {
String apiaddr = "/v3/sign-flow/create-by-file";
String fileId = sealSignRecord.getFileid();
@@ -248,10 +246,10 @@ public class SignAward {
" \"autoSign\": false,\n" +
" \"freeMode\": false,\n" +
" \"availableSealIds\": [\n" +
/* " \"availableSealIds\": [\n" +
" \"" + availableSealId + "\"\n" +
" ],\n" +
" ],\n" +*/
" \"availableSealIds\": " + new Gson().toJson(sealIdList) + "\n" +
" \"signFieldPosition\": {\n" +
" \"positionPage\": \"" + positionPageorg + "\",\n" +
@@ -343,16 +341,16 @@ public class SignAward {
*/
public static EsignHttpResponse deptIdentifyUrl(DeptIdentify deptIdentify) throws EsignDemoException {
String apiaddr = "/v3/org-auth-url";
String nickName = deptIdentify.getNickName();
String phonenumber = deptIdentify.getPhonenumber();
String deptName = deptIdentify.getDeptName();
String psnName = deptIdentify.getOperName();
String phonenumber = deptIdentify.getOperPhone();
String orgName = deptIdentify.getIdentifyName();
String jsonParm = "{\n" +
" \"orgAuthConfig\": {\n" +
" \"orgName\": \"" + deptName + " \",\n" +
" \"orgName\": \"" + orgName + " \",\n" +
" \"transactorInfo\": {\n" +
" \"psnAccount\": \"" + phonenumber + "\",\n" +
" \"psnInfo\": {\n" +
" \"psnName\": \"" + nickName + "\",\n" +
" \"psnName\": \"" + psnName + "\",\n" +
" \"psnMobile\": \"" + phonenumber + "\"\n" +
" }\n" +
" }\n" +
@@ -381,7 +379,7 @@ public class SignAward {
* 查询企业认证状态
*/
public static EsignHttpResponse getDeptIdentifyInfo(DeptIdentify deptIdentify) throws EsignDemoException {
String apiaddr = "/v3/organizations/identity-info?orgName=" + deptIdentify.getDeptName();
String apiaddr = "/v3/organizations/identity-info?orgName=" + deptIdentify.getIdentifyName();
String jsonParm = "{}";
//请求方法
@@ -392,8 +390,9 @@ public class SignAward {
return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false);
}
/**
* 查询企业认证印章信息
* 查询企业内部印章
*/
public static EsignHttpResponse deptIdentifySealList(String orgId) throws EsignDemoException {
int pageNum = 1;
@@ -437,7 +436,7 @@ public class SignAward {
*
* @return
*/
public static EsignHttpResponse createOrgByImage(DeptIdentify deptIdentify, String filePath) throws EsignDemoException {
public static EsignHttpResponse createOrgByImage(DeptIdentify deptIdentify,String sealName, String filePath) throws EsignDemoException {
String apiaddr = "/v3/seals/org-seals/create-by-image";
String orgId = deptIdentify.getOrgId();
//上传印章图片
@@ -452,7 +451,7 @@ public class SignAward {
if (errCode == 0) { //业务码,0表示成功,非0表示异常。
//获取步骤一里面的fileKey
String sealImageFileKey = jsonObject1.getJSONObject("data").getString("fileKey");
String sealName = deptIdentify.getSealName();
//请求参数body体,json格式。get或者delete请求时jsonString传空json:"{}"或者null
String jsonParm = "{\n" +
" \"orgId\": \"" + orgId + "\",\n" +
@@ -473,26 +472,8 @@ public class SignAward {
return null;
}
/**
* 查询企业内部印章
*/
public static EsignHttpResponse orgOwnSealList(DeptIdentify deptIdentify) throws EsignDemoException {
String orgId = deptIdentify.getOrgId();
int pageNum = 1;
int pageSize = 20;
String apiaddr = "/v3/seals/org-own-seal-list?orgId=" + orgId + "&pageNum=" + pageNum + "&pageSize=" + pageSize;
//请求参数body体,json格式。get或者delete请求时jsonString传空json:"{}"或者null
String jsonParm = null;
//请求方法
EsignRequestType requestType = EsignRequestType.GET;
//生成签名鉴权方式的的header
Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, false);
//发起接口请求
return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false);
}
/**
* 查询指定印章详情(机构)