|
|
@@ -1,15 +1,16 @@
|
|
|
package com.kingdee.eas.custom.esign.util;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.google.common.collect.Maps;
|
|
|
import com.kingdee.bos.BOSException;
|
|
|
import com.kingdee.bos.Context;
|
|
|
+import com.kingdee.bos.ContextUtils;
|
|
|
+import com.kingdee.bos.dao.IObjectPK;
|
|
|
+import com.kingdee.bos.dao.ormapping.ObjectUuidPK;
|
|
|
import com.kingdee.bos.util.BOSUuid;
|
|
|
-import com.kingdee.eas.base.permission.UserInfo;
|
|
|
import com.kingdee.eas.basedata.person.PersonInfo;
|
|
|
-import com.kingdee.eas.custom.esign.ESignGlobalStatusOverviewFactory;
|
|
|
-import com.kingdee.eas.custom.esign.ESignGlobalStatusOverviewInfo;
|
|
|
-import com.kingdee.eas.custom.esign.IESignGlobalStatusOverview;
|
|
|
+import com.kingdee.eas.custom.esign.*;
|
|
|
import com.kingdee.eas.custom.esign.bizEnum.EsignConfigEnum;
|
|
|
import com.kingdee.eas.custom.esign.bizEnum.EsignStatusEnum;
|
|
|
import com.kingdee.eas.custom.esign.bizEnum.SendStatusEnum;
|
|
|
@@ -17,15 +18,14 @@ import com.kingdee.eas.custom.esign.tsign.hz.comm.EsignHttpHelper;
|
|
|
import com.kingdee.eas.custom.esign.tsign.hz.comm.EsignHttpResponse;
|
|
|
import com.kingdee.eas.custom.esign.tsign.hz.enums.EsignRequestType;
|
|
|
import com.kingdee.eas.custom.esign.tsign.hz.exception.EsignException;
|
|
|
-import com.kingdee.eas.mobileaccess.hr.sHR.util.ContextUtils;
|
|
|
-import com.kingdee.eas.util.app.ContextUtil;
|
|
|
-import com.kingdee.shr.base.syssetting.app.filter.HRFilterUtils;
|
|
|
+import com.kingdee.eas.mobileaccess.hr.sHR.config.EASConfig;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.http.client.utils.URIBuilder;
|
|
|
|
|
|
import java.net.URI;
|
|
|
import java.net.URISyntaxException;
|
|
|
import java.text.MessageFormat;
|
|
|
+import java.util.Locale;
|
|
|
import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
@@ -46,13 +46,37 @@ public class EsignHttpUtil {
|
|
|
* @return
|
|
|
* @throws EsignException
|
|
|
*/
|
|
|
- public static EsignHttpResponse doCommHttp(Context ctx,String url, String jsonParm, EsignRequestType requestType, Boolean debug,String sourceId) throws EsignException {
|
|
|
+ public static EsignHttpResponse doCommHttp(Context ctx,String url, String jsonParm, EsignRequestType requestType, Boolean debug,String sourceId,EsignConfigEnum configEnum) throws EsignException {
|
|
|
+ EsignLogInfo esignLogInfo =new EsignLogInfo();
|
|
|
//
|
|
|
//生成签名鉴权方式的的header
|
|
|
Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(EsignConfig.getInstance().getEsignAppId(),
|
|
|
EsignConfig.getInstance().getEsignAppSecret(), jsonParm, requestType.name(), url, debug);
|
|
|
+ EsignHttpResponse response = EsignHttpHelper.doCommHttp(EsignConfig.getInstance().getEsignHost(), url, requestType, jsonParm, header, debug);
|
|
|
+ try{
|
|
|
+ if(null==ctx){
|
|
|
+ ctx = ContextUtils.getContextFromSession();
|
|
|
+ }
|
|
|
+ if(null==ctx) {
|
|
|
+ String currentSolutionName = EASConfig.getInstance().getSlnName();
|
|
|
+ String currentDatabaseCenter = EASConfig.getInstance().getDcCode();
|
|
|
+ ctx = new Context(new ObjectUuidPK(), currentSolutionName, currentDatabaseCenter, new Locale("l2"));
|
|
|
+ }
|
|
|
+ IEsignLog log = EsignLogFactory.getLocalInstance(ctx);
|
|
|
+ esignLogInfo.setEsiginName(configEnum);
|
|
|
+ esignLogInfo.setRequestState(String.valueOf(response.getStatus()));
|
|
|
+ esignLogInfo.setUrl(url);
|
|
|
+ esignLogInfo.setRequestData(jsonParm);
|
|
|
+ esignLogInfo.setResponseData(response.getBody());
|
|
|
+ esignLogInfo.setSource(sourceId);
|
|
|
+ IObjectPK pk = log.addnew(esignLogInfo);
|
|
|
+ response.setLogId(pk.toString());
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ }finally {
|
|
|
+ }
|
|
|
//发起接口请求
|
|
|
- return EsignHttpHelper.doCommHttp(EsignConfig.getInstance().getEsignHost(), url, requestType, jsonParm, header, debug);
|
|
|
+ return response;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -65,14 +89,14 @@ public class EsignHttpUtil {
|
|
|
* @return
|
|
|
* @throws EsignException
|
|
|
*/
|
|
|
- public static EsignHttpResponse POST(Context ctx,String url, String jsonParm, Boolean debug,String sourceId) throws EsignException {
|
|
|
+ public static EsignHttpResponse POST(Context ctx,String url, String jsonParm, Boolean debug,String sourceId,EsignConfigEnum configEnum) throws EsignException {
|
|
|
//请求方法
|
|
|
EsignRequestType requestType = EsignRequestType.POST;
|
|
|
- return doCommHttp(ctx,url, jsonParm, requestType, debug, sourceId);
|
|
|
+ return doCommHttp(ctx,url, jsonParm, requestType, debug, sourceId, configEnum);
|
|
|
}
|
|
|
|
|
|
- public static EsignHttpResponse POST(Context ctx,String url, String jsonParm,String sourceId) throws EsignException {
|
|
|
- return POST( ctx,url, jsonParm, false, sourceId);
|
|
|
+ public static EsignHttpResponse POST(Context ctx,String url, String jsonParm,String sourceId,EsignConfigEnum configEnum) throws EsignException {
|
|
|
+ return POST( ctx,url, jsonParm, false, sourceId, configEnum);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -85,22 +109,22 @@ public class EsignHttpUtil {
|
|
|
* @return
|
|
|
* @throws EsignException
|
|
|
*/
|
|
|
- public static EsignHttpResponse GET(Context ctx,String url, String jsonParm, Boolean debug,String sourceId) throws EsignException {
|
|
|
+ public static EsignHttpResponse GET(Context ctx,String url, String jsonParm, Boolean debug,String sourceId,EsignConfigEnum configEnum) throws EsignException {
|
|
|
//请求方法
|
|
|
EsignRequestType requestType = EsignRequestType.GET;
|
|
|
- return doCommHttp(ctx,url, jsonParm, requestType, debug, sourceId);
|
|
|
+ return doCommHttp(ctx,url, jsonParm, requestType, debug, sourceId, configEnum);
|
|
|
}
|
|
|
|
|
|
- public static EsignHttpResponse GET(Context ctx,String url, String jsonParm,String sourceId) throws EsignException {
|
|
|
- return GET(ctx,url, jsonParm, false, sourceId);
|
|
|
+ public static EsignHttpResponse GET(Context ctx,String url, String jsonParm,String sourceId,EsignConfigEnum configEnum) throws EsignException {
|
|
|
+ return GET(ctx,url, jsonParm, false, sourceId, configEnum);
|
|
|
}
|
|
|
- public static EsignHttpResponse DELETE(Context ctx,String url, String jsonParm,String sourceId) throws EsignException {
|
|
|
- return DELETE( ctx,url, jsonParm, false, sourceId);
|
|
|
+ public static EsignHttpResponse DELETE(Context ctx,String url, String jsonParm,String sourceId,EsignConfigEnum configEnum) throws EsignException {
|
|
|
+ return DELETE( ctx,url, jsonParm, false, sourceId, configEnum);
|
|
|
}
|
|
|
- public static EsignHttpResponse DELETE(Context ctx,String url, String jsonParm, Boolean debug,String sourceId) throws EsignException {
|
|
|
+ public static EsignHttpResponse DELETE(Context ctx,String url, String jsonParm, Boolean debug,String sourceId,EsignConfigEnum configEnum) throws EsignException {
|
|
|
//请求方法
|
|
|
EsignRequestType requestType = EsignRequestType.DELETE;
|
|
|
- return doCommHttp(ctx,url, jsonParm, requestType, debug, sourceId);
|
|
|
+ return doCommHttp(ctx,url, jsonParm, requestType, debug, sourceId, configEnum);
|
|
|
}
|
|
|
|
|
|
public static EsignHttpResponse getDocTemplatesDetailById(Context ctx,String id) throws EsignException {
|
|
|
@@ -118,10 +142,11 @@ public class EsignHttpUtil {
|
|
|
* @throws EsignException
|
|
|
*/
|
|
|
public static EsignHttpResponse getDocTemplatesDetailById(Context ctx,String id,String sourceId) throws EsignException {
|
|
|
- String apiaddr = EsignConfig.getInstance().get(EsignConfigEnum.DOCTEMPLATESDETAILBYID_VALUE);
|
|
|
+ EsignConfigEnum configEnum=EsignConfigEnum.docTemplatesDetailById;
|
|
|
+ String apiaddr = EsignConfig.getInstance().get(configEnum.getValue());
|
|
|
apiaddr = MessageFormat.format(apiaddr, id);
|
|
|
String jsonParm = null;
|
|
|
- return GET( ctx,apiaddr, jsonParm, sourceId);
|
|
|
+ return GET( ctx,apiaddr, jsonParm, sourceId,configEnum);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -137,8 +162,9 @@ public class EsignHttpUtil {
|
|
|
* @throws EsignException
|
|
|
*/
|
|
|
public static EsignHttpResponse createByDocTemplate(Context ctx,String json,String sourceId) throws EsignException {
|
|
|
- String apiaddr = EsignConfig.getInstance().get(EsignConfigEnum.CREATEBYDOCTEMPLATE_VALUE);
|
|
|
- return POST( ctx,apiaddr, json, sourceId);
|
|
|
+ EsignConfigEnum configEnum = EsignConfigEnum.createByDocTemplate;
|
|
|
+ String apiaddr = EsignConfig.getInstance().get(configEnum.getValue());
|
|
|
+ return POST( ctx,apiaddr, json, sourceId,configEnum);
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -162,7 +188,8 @@ public class EsignHttpUtil {
|
|
|
* @throws EsignException
|
|
|
*/
|
|
|
public static EsignHttpResponse getOrgIdentity_info(Context ctx,String orgId, String orgName,String orgIDCardNum,String orgIDCardType,String sourceId) throws EsignException, URISyntaxException {
|
|
|
- String apiaddr = EsignConfig.getInstance().get(EsignConfigEnum.ORGANIZATIONS_IDENTITY_INFO_VALUE);
|
|
|
+ EsignConfigEnum configEnum=EsignConfigEnum.organizations_identity_info;
|
|
|
+ String apiaddr = EsignConfig.getInstance().get(configEnum.getValue());
|
|
|
if (StringUtils.isBlank(orgId)&&StringUtils.isBlank(orgName)) {
|
|
|
if (StringUtils.isNotBlank(orgIDCardNum)&&StringUtils.isBlank(orgIDCardType)) {
|
|
|
throw new EsignException("传orgIDCardNum时,orgIDCardType参数为必传");
|
|
|
@@ -183,7 +210,7 @@ public class EsignHttpUtil {
|
|
|
}
|
|
|
URI uri = uriBuilder.build(); // 自动编码
|
|
|
apiaddr = uri.toString();
|
|
|
- return GET( ctx,apiaddr, null, sourceId);
|
|
|
+ return GET( ctx,apiaddr, null, sourceId,configEnum);
|
|
|
}
|
|
|
public static EsignHttpResponse getOrgIdentity_infoByOrgId(Context ctx,String orgId) throws EsignException, URISyntaxException {
|
|
|
return getOrgIdentity_info( ctx,orgId, null, null, null, null);
|
|
|
@@ -216,7 +243,8 @@ public class EsignHttpUtil {
|
|
|
* @throws EsignException
|
|
|
*/
|
|
|
public static EsignHttpResponse getPersonIdentity_info(Context ctx,String psnId, String psnAccount,String psnIDCardNum,String psnIDCardType,String sourceId) throws EsignException, URISyntaxException {
|
|
|
- String apiaddr = EsignConfig.getInstance().get(EsignConfigEnum.PERSONS_IDENTITY_INFO_VALUE);
|
|
|
+ EsignConfigEnum configEnum = EsignConfigEnum.persons_identity_info;
|
|
|
+ String apiaddr = EsignConfig.getInstance().get(configEnum.getValue());
|
|
|
if (StringUtils.isBlank(psnId)&&StringUtils.isBlank(psnAccount)) {
|
|
|
if (StringUtils.isNotBlank(psnIDCardNum)&&StringUtils.isBlank(psnIDCardType)) {
|
|
|
throw new EsignException("传orgIDCardNum时,psnIDCardType参数为必传");
|
|
|
@@ -237,7 +265,7 @@ public class EsignHttpUtil {
|
|
|
}
|
|
|
URI uri = uriBuilder.build(); // 自动编码
|
|
|
apiaddr = uri.toString();
|
|
|
- return GET( ctx,apiaddr, null, sourceId);
|
|
|
+ return GET( ctx,apiaddr, null, sourceId,configEnum);
|
|
|
}
|
|
|
public static EsignHttpResponse getPersonIdentity_infoByPsnId(Context ctx,String psnId) throws EsignException, URISyntaxException {
|
|
|
return getPersonIdentity_info( ctx,psnId, null, null, null, null);
|
|
|
@@ -259,9 +287,10 @@ public class EsignHttpUtil {
|
|
|
* @return
|
|
|
*/
|
|
|
public static EsignHttpResponse getSign_fields(Context ctx,String signFlowId,String sourceId) throws EsignException {
|
|
|
- String apiaddr = EsignConfig.getInstance().get(EsignConfigEnum.DETAIL_SIGN_FIELDS_VALUE);
|
|
|
+ EsignConfigEnum configEnum = EsignConfigEnum.detail_sign_fields;
|
|
|
+ String apiaddr = EsignConfig.getInstance().get(configEnum.getValue());
|
|
|
apiaddr = MessageFormat.format(apiaddr, signFlowId);
|
|
|
- return GET( ctx,apiaddr, null, sourceId);
|
|
|
+ return GET( ctx,apiaddr, null, sourceId,configEnum);
|
|
|
}
|
|
|
public static EsignHttpResponse getSign_fields(Context ctx,String signFlowId) throws EsignException {
|
|
|
return getSign_fields( ctx,signFlowId,null);
|
|
|
@@ -280,9 +309,10 @@ public class EsignHttpUtil {
|
|
|
* @return
|
|
|
*/
|
|
|
public static EsignHttpResponse addSign_fields(Context ctx,String signFlowId,String json,String sourceId) throws EsignException {
|
|
|
- String apiaddr = EsignConfig.getInstance().get(EsignConfigEnum.ADD_SIGN_FIELDS_VALUE);
|
|
|
+ EsignConfigEnum configEnum=EsignConfigEnum.add_sign_fields;
|
|
|
+ String apiaddr = EsignConfig.getInstance().get(configEnum.getValue());
|
|
|
apiaddr = MessageFormat.format(apiaddr, signFlowId);
|
|
|
- return POST( ctx,apiaddr, json, sourceId);
|
|
|
+ return POST( ctx,apiaddr, json, sourceId,configEnum);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -299,7 +329,8 @@ public class EsignHttpUtil {
|
|
|
* @return
|
|
|
*/
|
|
|
public static EsignHttpResponse delSign_fields(Context ctx,String signFlowId,String signFieldIds,String sourceId) throws EsignException, URISyntaxException {
|
|
|
- String apiaddr = EsignConfig.getInstance().get(EsignConfigEnum.DEL_SIGN_FIELDS_VALUE );
|
|
|
+ EsignConfigEnum configEnum=EsignConfigEnum.del_sign_fields;
|
|
|
+ String apiaddr = EsignConfig.getInstance().get(configEnum.getValue());
|
|
|
apiaddr = MessageFormat.format(apiaddr, signFlowId);
|
|
|
URIBuilder uriBuilder = new URIBuilder(apiaddr);
|
|
|
if (StringUtils.isNotBlank(signFieldIds)) {
|
|
|
@@ -307,7 +338,7 @@ public class EsignHttpUtil {
|
|
|
}
|
|
|
URI uri = uriBuilder.build(); // 自动编码
|
|
|
apiaddr = uri.toString();
|
|
|
- return DELETE( ctx,apiaddr, null, sourceId);
|
|
|
+ return DELETE( ctx,apiaddr, null, sourceId,configEnum);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -327,9 +358,10 @@ public class EsignHttpUtil {
|
|
|
* @return
|
|
|
*/
|
|
|
public static EsignHttpResponse addCopiers(Context ctx,String signFlowId,String json,String sourceId) throws EsignException {
|
|
|
- String apiaddr = EsignConfig.getInstance().get(EsignConfigEnum.ADD_COPIERS_VALUE );
|
|
|
+ EsignConfigEnum configEnum = EsignConfigEnum.add_copiers;
|
|
|
+ String apiaddr = EsignConfig.getInstance().get(configEnum.getValue());
|
|
|
apiaddr = MessageFormat.format(apiaddr, signFlowId);
|
|
|
- return POST( ctx,apiaddr, json, sourceId);
|
|
|
+ return POST( ctx,apiaddr, json, sourceId,configEnum);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -345,9 +377,10 @@ public class EsignHttpUtil {
|
|
|
* @return
|
|
|
*/
|
|
|
public static EsignHttpResponse delCopiers(Context ctx,String signFlowId,String json,String sourceId) throws EsignException {
|
|
|
- String apiaddr = EsignConfig.getInstance().get(EsignConfigEnum.DEL_COPIERS_VALUE);
|
|
|
+ EsignConfigEnum configEnum = EsignConfigEnum.del_copiers;
|
|
|
+ String apiaddr = EsignConfig.getInstance().get(configEnum.getValue());
|
|
|
apiaddr = MessageFormat.format(apiaddr, signFlowId);
|
|
|
- return POST( ctx,apiaddr, json, sourceId);
|
|
|
+ return POST( ctx,apiaddr, json, sourceId,configEnum);
|
|
|
}
|
|
|
/**
|
|
|
* 基于文件发起签署
|
|
|
@@ -379,24 +412,69 @@ public class EsignHttpUtil {
|
|
|
* @return
|
|
|
*/
|
|
|
public static EsignHttpResponse create_by_file(Context ctx,String personId,String fileName,String operatorId,String efileId,
|
|
|
- String json) throws EsignException, BOSException {
|
|
|
- String apiaddr = EsignConfig.getInstance().get(EsignConfigEnum.CREATE_BY_FILE_VALUE);
|
|
|
+ EsignStatusEnum esignStatus,
|
|
|
+ String json) throws BOSException {
|
|
|
+ EsignHttpResponse resp = create_by_file(ctx,personId,fileName,operatorId,efileId,esignStatus,json,true);
|
|
|
+ return resp;
|
|
|
+ }
|
|
|
+ public static EsignHttpResponse create_by_file(Context ctx,String personId,String fileName,String operatorId,String efileId,
|
|
|
+ EsignStatusEnum esignStatus,
|
|
|
+ String json,Boolean saveGlobal) throws BOSException {
|
|
|
+ EsignConfigEnum configEnum = EsignConfigEnum.create_by_file;
|
|
|
+ String apiaddr = EsignConfig.getInstance().get(configEnum.getValue());
|
|
|
+ EsignHttpResponse resp=new EsignHttpResponse();
|
|
|
+ resp.setStatus(500);
|
|
|
+
|
|
|
/**
|
|
|
* 发起签署前需要新增电子签全域状态总览表
|
|
|
*/
|
|
|
IESignGlobalStatusOverview globalStatusOverview = ESignGlobalStatusOverviewFactory.getLocalInstance(ctx);
|
|
|
- UserInfo userInfo = ContextUtil.getCurrentUserInfo(ctx);
|
|
|
- PersonInfo personInfo = new PersonInfo();
|
|
|
- personInfo.setId(BOSUuid.read(personId));
|
|
|
-
|
|
|
ESignGlobalStatusOverviewInfo info = new ESignGlobalStatusOverviewInfo();
|
|
|
- info.setEsignStatus(EsignStatusEnum.DRAFT);
|
|
|
+ info.setEsignStatus(esignStatus);
|
|
|
info.setSendStatus(SendStatusEnum.FAILURE);
|
|
|
- //info.setOperator();
|
|
|
- EsignHttpResponse resp = POST( ctx,apiaddr, json, efileId);
|
|
|
+ if(StringUtils.isNotBlank(personId)){
|
|
|
+ PersonInfo personInfo = new PersonInfo();
|
|
|
+ personInfo.setId(BOSUuid.read(personId));
|
|
|
+ info.setPerson(personInfo);
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotBlank(personId)){
|
|
|
+ PersonInfo operator = new PersonInfo();
|
|
|
+ operator.setId(BOSUuid.read(operatorId));
|
|
|
+ info.setOperator(operator);
|
|
|
+ }
|
|
|
+ info.setFileName(fileName);
|
|
|
+
|
|
|
+ info.setEfileId(efileId);
|
|
|
+
|
|
|
+ info.setRequestParams(json);
|
|
|
+ info.setEsignName(configEnum);
|
|
|
+ try {
|
|
|
+ resp = POST(ctx, apiaddr, json, efileId,configEnum);
|
|
|
+ if(resp.getStatus()>=200&&resp.getStatus()<300) {
|
|
|
+ JSONObject object = JSON.parseObject(resp.getBody());
|
|
|
+ if("0".equals(String.valueOf(object.get("code")))) {
|
|
|
+ JSONObject data = object.getJSONObject("data");
|
|
|
+ info.setSignFlowId(data.getString("signFlowId"));
|
|
|
+ info.setSendStatus(SendStatusEnum.SUCCESS);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ info.setSourceBillId(resp.getLogId());
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ info.setSendStatus(SendStatusEnum.FAILURE);
|
|
|
+ }finally {
|
|
|
+ try {
|
|
|
+ if(saveGlobal) {
|
|
|
+ globalStatusOverview.addnew(info);
|
|
|
+ }else {
|
|
|
+ //globalStatusOverview.save(info);
|
|
|
+ }
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
return resp;
|
|
|
}
|
|
|
-
|
|
|
/**
|
|
|
* 开启签署流程
|
|
|
* 参考文档:https://open.esign.cn/doc/opendoc/pdf-sign3/bdn9yt
|
|
|
@@ -409,9 +487,10 @@ public class EsignHttpUtil {
|
|
|
* @return
|
|
|
*/
|
|
|
public static EsignHttpResponse start_by_file(Context ctx,String signFlowId,String sourceId) throws EsignException {
|
|
|
- String apiaddr = EsignConfig.getInstance().get(EsignConfigEnum.START_BY_FILE_VALUE);
|
|
|
+ EsignConfigEnum configEnum = EsignConfigEnum.start_by_file;
|
|
|
+ String apiaddr = EsignConfig.getInstance().get(configEnum.getValue());
|
|
|
apiaddr = MessageFormat.format(apiaddr, signFlowId);
|
|
|
- return POST( ctx,apiaddr, null, sourceId);
|
|
|
+ return POST( ctx,apiaddr, null, sourceId,configEnum);
|
|
|
}
|
|
|
/**
|
|
|
* 撤销签署流程
|
|
|
@@ -426,12 +505,13 @@ public class EsignHttpUtil {
|
|
|
* @return
|
|
|
*/
|
|
|
public static EsignHttpResponse revoke_by_file(Context ctx,String signFlowId,String revokeReason,String sourceId) throws EsignException {
|
|
|
- String apiaddr = EsignConfig.getInstance().get(EsignConfigEnum.REVOKE_BY_FILE_VALUE);
|
|
|
+ EsignConfigEnum configEnum = EsignConfigEnum.revoke_by_file;
|
|
|
+ String apiaddr = EsignConfig.getInstance().get(configEnum.getValue());
|
|
|
apiaddr = MessageFormat.format(apiaddr, signFlowId);
|
|
|
Map<String,String> jsonMap = Maps.newHashMap();
|
|
|
jsonMap.put("revokeReason",(StringUtils.isNotBlank(revokeReason)?revokeReason:""));
|
|
|
String json = JSON.toJSONString(jsonMap);
|
|
|
- return POST( ctx,apiaddr, json, sourceId);
|
|
|
+ return POST( ctx,apiaddr, json, sourceId,configEnum);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -448,9 +528,10 @@ public class EsignHttpUtil {
|
|
|
* @return
|
|
|
*/
|
|
|
public static EsignHttpResponse urge_by_file(Context ctx,String signFlowId,String json,String sourceId) throws EsignException {
|
|
|
- String apiaddr = EsignConfig.getInstance().get(EsignConfigEnum.URGE_BY_FILE_VALUE);
|
|
|
+ EsignConfigEnum configEnum = EsignConfigEnum.urge_by_file;
|
|
|
+ String apiaddr = EsignConfig.getInstance().get(configEnum.getValue());
|
|
|
apiaddr = MessageFormat.format(apiaddr, signFlowId);
|
|
|
- return POST( ctx,apiaddr, json, sourceId);
|
|
|
+ return POST( ctx,apiaddr, json, sourceId,configEnum);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -469,6 +550,7 @@ public class EsignHttpUtil {
|
|
|
* @return
|
|
|
*/
|
|
|
public static EsignHttpResponse getFile_download_url(Context ctx,String signFlowId,Integer urlAvailableDate,String sourceId) throws EsignException, URISyntaxException {
|
|
|
+ EsignConfigEnum configEnum = EsignConfigEnum.file_download_url;
|
|
|
String apiaddr = EsignConfig.getInstance().get(EsignConfigEnum.FILE_DOWNLOAD_URL_VALUE);
|
|
|
apiaddr = MessageFormat.format(apiaddr, signFlowId);
|
|
|
if (null!=urlAvailableDate&&urlAvailableDate>0&&urlAvailableDate<=3600) {
|
|
|
@@ -477,7 +559,7 @@ public class EsignHttpUtil {
|
|
|
URI uri = uriBuilder.build(); // 自动编码
|
|
|
apiaddr = uri.toString();
|
|
|
}
|
|
|
- return GET( ctx,apiaddr, null, sourceId);
|
|
|
+ return GET( ctx,apiaddr, null, sourceId,configEnum);
|
|
|
}
|
|
|
|
|
|
|