소스 검색

电子签列表全域

9060 3 주 전
부모
커밋
bea74d7208

+ 23 - 12
src/com/kingdee/eas/custom/esign/callback/CallBackToOSFServlet.java

@@ -37,22 +37,28 @@ public class CallBackToOSFServlet extends HttpServlet {
     }
 
     protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
+        Map<String, Object> result = new HashMap<String, Object>();
         try {
-
             String TIMESTAMP = req.getHeader("X-Tsign-Open-TIMESTAMP");
             String ALGORITHM = req.getHeader("X-Tsign-Open-SIGNATURE-ALGORITHM");
             String appid = req.getHeader("X-Tsign-Open-App-Id");
             String SIGNATURE = req.getHeader("X-Tsign-Open-SIGNATURE");
-
             System.out.println("CallBackToOSFServlet");
+            // 方式2:使用 getRequestURI()(更精确)
+            String uri = req.getRequestURI();  // 返回 "/context/user/osfName"
+            String[] parts = uri.split("/");
+            String osfName = parts[parts.length - 1];  // 获取最后一段 "osfName"
+            if("callback".equals(osfName)){
+                osfName="CallBackToOSF";
+            }
             logger.error("CallBackToOSFServlet  start--------------------------------------------------------------------");
             logger.error("CallBackToOSFServlet  TIMESTAMP----------------->" + TIMESTAMP);
             logger.error("CallBackToOSFServlet  ALGORITHM----------------->" + ALGORITHM);
             logger.error("CallBackToOSFServlet  appid----------------->" + appid);
             logger.error("CallBackToOSFServlet  SIGNATURE----------------->" + SIGNATURE);
-            String data = req.getParameter("data");
+            String data = "";
             // 读取请求体
-            BufferedReader reader = new BufferedReader(new InputStreamReader(req.getInputStream()));
+            BufferedReader reader = req.getReader();
             StringBuilder jsonInput = new StringBuilder();
             String jsonPart;
             while ((jsonPart = reader.readLine()) != null) {
@@ -68,28 +74,33 @@ public class CallBackToOSFServlet extends HttpServlet {
             }else {
                 map.put("data", data);
             }
-
-            String response = client.proceedOSF(shrAddr, "CallBackToOSF", map);
+            String response = client.proceedOSF(shrAddr, osfName, map);
             if (response.indexOf("success") > 0) {
-                Map<String, Object> result = new HashMap<String, Object>();
                 result.put("code", "200");
                 result.put("msg", "success");
                 result.put("requestId", null);
                 result.put("data", response);
-                ResponseWriteUtil.writeObjectData(resp, result, "JSON");
-            } else {
+            } else if(response.indexOf("msg")>0){
                 JSONObject object = JSON.parseObject(response);
-                Map<String, Object> result = new HashMap<String, Object>();
-                result.put("code", 400);
+                result.put("code", "400");
                 result.put("msg", object.get("msg"));
                 result.put("requestId", null);
                 result.put("data", response);
-                ResponseWriteUtil.writeObjectData(resp, result, "JSON");
+            }else {
+                result.put("code", "400");
+                result.put("msg", response);
+                result.put("requestId", null);
+                result.put("data", response);
             }
         } catch (Exception e) {
             e.printStackTrace();
+            result.put("code", "400");
+            result.put("msg", e.getMessage());
+            result.put("requestId", null);
+            result.put("data", "");
         } finally {
             logger.error("CallBackToOSFServlet  end-----------------");
+            ResponseWriteUtil.writeObjectData(resp, result, "JSON");
         }
     }
 }

+ 7 - 1
src/com/kingdee/eas/custom/esign/tsign/hz/comm/EsignHttpResponse.java

@@ -10,7 +10,7 @@ package com.kingdee.eas.custom.esign.tsign.hz.comm;
 public class EsignHttpResponse {
     private int status;
     private String body;
-
+    private String logId;
 
 
     public int getStatus() {
@@ -29,5 +29,11 @@ public class EsignHttpResponse {
         this.body = body;
     }
 
+    public String getLogId() {
+        return logId;
+    }
 
+    public void setLogId(String logId) {
+        this.logId = logId;
+    }
 }

+ 138 - 56
src/com/kingdee/eas/custom/esign/util/EsignHttpUtil.java

@@ -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);
     }
 
 

+ 256 - 0
websrc/com/kingdee/eas/custom/esign/handler/ESignGlobalStatusOverviewListHandler.java

@@ -0,0 +1,256 @@
+package com.kingdee.eas.custom.esign.handler;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.google.common.collect.Lists;
+import com.kingdee.bos.Context;
+import com.kingdee.bos.dao.ormapping.ObjectUuidPK;
+import com.kingdee.bos.metadata.entity.SelectorItemCollection;
+import com.kingdee.bos.metadata.entity.SelectorItemInfo;
+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.bizEnum.SendStatusEnum;
+import com.kingdee.eas.custom.esign.tsign.hz.comm.EsignHttpResponse;
+import com.kingdee.eas.custom.esign.tsign.hz.exception.EsignException;
+import com.kingdee.eas.custom.esign.util.EsignHttpUtil;
+import com.kingdee.shr.base.syssetting.api.bean.BatchMessageTipsBody;
+import com.kingdee.shr.base.syssetting.api.bean.BatchMessageTipsHeader;
+import com.kingdee.shr.base.syssetting.context.SHRContext;
+import com.kingdee.shr.base.syssetting.exception.SHRWebException;
+import com.kingdee.shr.base.syssetting.exception.ShrWebBizException;
+import com.kingdee.shr.base.syssetting.web.handler.ListHandler;
+import org.springframework.ui.ModelMap;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * description: ESignGlobalStatusOverviewHandler <br>
+ * date: 21/11/2025 下午 4:19 <br>
+ * author: lhbj <br>
+ * version: 1.0 <br>
+ */
+public class ESignGlobalStatusOverviewListHandler extends ListHandler {
+    public Context getCtx() {
+        return SHRContext.getInstance().getContext();
+    }
+    /**
+     * 基于文件发起签署
+     * @param request
+     * @param response
+     * @param modelMap
+     * @return
+     * @throws SHRWebException
+     */
+    public String create_by_fileAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
+        BatchMessageTipsHeader batchMessageTipsHeader = new BatchMessageTipsHeader();
+        String billId = this.getBillId(request);
+        int failure = 0;
+        int success = 0;
+        try {
+            if(billId.indexOf(",")>=0){
+                throw new EsignException("请选择一行记录发起签署");
+            }
+            IESignGlobalStatusOverview globalStatusOverview = ESignGlobalStatusOverviewFactory.getLocalInstance(this.getCtx());
+            SelectorItemCollection selectorItemCollection = new SelectorItemCollection();
+            selectorItemCollection.add(new SelectorItemInfo("*"));
+            selectorItemCollection.add(new SelectorItemInfo("person.id"));
+            selectorItemCollection.add(new SelectorItemInfo("operator.id"));
+            ESignGlobalStatusOverviewInfo info = globalStatusOverview.getESignGlobalStatusOverviewInfo(new ObjectUuidPK(billId));
+            PersonInfo person = info.getPerson();
+            PersonInfo operator = info.getOperator();
+            String personId=null;
+            if(null!=person&&null!=person.getId()){
+                personId=person.getId().toString();
+            }
+            String operatorId=null;
+            if(null!=operator&&null!=operator.getId()){
+                operatorId=operator.getId().toString();
+            }
+            EsignHttpResponse httpRes =EsignHttpUtil.create_by_file(this.getCtx(),personId,info.getFileName(),operatorId,info.getEfileId(),
+                    info.getEsignStatus(),info.getRequestParams(),false);
+            if(httpRes.getStatus()>=200&&httpRes.getStatus()<300) {
+                JSONObject object = JSON.parseObject(httpRes.getBody());
+                if("0".equals(String.valueOf(object.get("code")))) {
+
+                    BatchMessageTipsBody body = new BatchMessageTipsBody();
+                    body.setMuitTipsState(Boolean.TRUE);
+                    body.setMuitTipsMessage(httpRes.getBody());
+                    body.setId(billId);
+                    batchMessageTipsHeader.addResult(body);
+                    success++;
+                }else {
+                    BatchMessageTipsBody body = new BatchMessageTipsBody();
+                    body.setMuitTipsState(Boolean.FALSE);
+                    body.setMuitTipsMessage(httpRes.getBody());
+                    body.setId(billId);
+                    batchMessageTipsHeader.addResult(body);
+                }
+            }else {
+                BatchMessageTipsBody body = new BatchMessageTipsBody();
+                body.setMuitTipsState(Boolean.FALSE);
+                body.setMuitTipsMessage(httpRes.getBody());
+                body.setId(billId);
+                batchMessageTipsHeader.addResult(body);
+            }
+            batchMessageTipsHeader.setBillId(billId);
+            batchMessageTipsHeader.setFailureCount((success>0?1:0));
+            batchMessageTipsHeader.setSuccessCount(success);
+            this.writeSuccessData(batchMessageTipsHeader);
+        }catch (EsignException e){
+            e.printStackTrace();
+            throw new ShrWebBizException(e);
+        }catch (Exception e){
+            e.printStackTrace();
+            throw new ShrWebBizException(e);
+        }
+        return null;
+    }
+    /**
+     * 撤销签署流程
+     * @param request
+     * @param response
+     * @param modelMap
+     * @return
+     * @throws SHRWebException
+     */
+    public String revoke_by_fileAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
+        BatchMessageTipsHeader batchMessageTipsHeader = new BatchMessageTipsHeader();
+        String billId = this.getBillId(request);
+        String revokeReason =request.getParameter("revokeReason");
+        int failure = 0;
+        int success = 0;
+        try {
+            if(billId.indexOf(",")>=0){
+                throw new EsignException("请选择一行记录发起签署");
+            }
+            IESignGlobalStatusOverview globalStatusOverview = ESignGlobalStatusOverviewFactory.getLocalInstance(this.getCtx());
+            SelectorItemCollection selectorItemCollection = new SelectorItemCollection();
+            selectorItemCollection.add(new SelectorItemInfo("*"));
+            selectorItemCollection.add(new SelectorItemInfo("person.id"));
+            selectorItemCollection.add(new SelectorItemInfo("operator.id"));
+            ESignGlobalStatusOverviewInfo info = globalStatusOverview.getESignGlobalStatusOverviewInfo(new ObjectUuidPK(billId));
+            PersonInfo person = info.getPerson();
+            PersonInfo operator = info.getOperator();
+            String personId=null;
+            if(null!=person&&null!=person.getId()){
+                personId=person.getId().toString();
+            }
+            String operatorId=null;
+            if(null!=operator&&null!=operator.getId()){
+                operatorId=operator.getId().toString();
+            }
+            EsignHttpResponse httpRes =EsignHttpUtil.revoke_by_file(this.getCtx(),info.getSignFlowId(),revokeReason,info.getEfileId());
+            if(httpRes.getStatus()>=200&&httpRes.getStatus()<300) {
+                JSONObject object = JSON.parseObject(httpRes.getBody());
+                if("0".equals(String.valueOf(object.get("code")))) {
+
+                    BatchMessageTipsBody body = new BatchMessageTipsBody();
+                    body.setMuitTipsState(Boolean.TRUE);
+                    body.setMuitTipsMessage(httpRes.getBody());
+                    body.setId(billId);
+                    batchMessageTipsHeader.addResult(body);
+                    success++;
+                }else {
+                    BatchMessageTipsBody body = new BatchMessageTipsBody();
+                    body.setMuitTipsState(Boolean.FALSE);
+                    body.setMuitTipsMessage(httpRes.getBody());
+                    body.setId(billId);
+                    batchMessageTipsHeader.addResult(body);
+                }
+            }else {
+                BatchMessageTipsBody body = new BatchMessageTipsBody();
+                body.setMuitTipsState(Boolean.FALSE);
+                body.setMuitTipsMessage(httpRes.getBody());
+                body.setId(billId);
+                batchMessageTipsHeader.addResult(body);
+            }
+            batchMessageTipsHeader.setBillId(billId);
+            batchMessageTipsHeader.setFailureCount((success>0?1:0));
+            batchMessageTipsHeader.setSuccessCount(success);
+            this.writeSuccessData(batchMessageTipsHeader);
+        }catch (EsignException e){
+            e.printStackTrace();
+            throw new ShrWebBizException(e);
+        }catch (Exception e){
+            e.printStackTrace();
+            throw new ShrWebBizException(e);
+        }
+        return null;
+    }
+    /**
+     * 催签流程中签署人
+     * @param request
+     * @param response
+     * @param modelMap
+     * @return
+     * @throws SHRWebException
+     */
+    public String urge_by_fileAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
+        BatchMessageTipsHeader batchMessageTipsHeader = new BatchMessageTipsHeader();
+        String billId = this.getBillId(request);
+        int failure = 0;
+        int success = 0;
+        try {
+            if(billId.indexOf(",")>=0){
+                throw new EsignException("请选择一行记录发起签署");
+            }
+            IESignGlobalStatusOverview globalStatusOverview = ESignGlobalStatusOverviewFactory.getLocalInstance(this.getCtx());
+            SelectorItemCollection selectorItemCollection = new SelectorItemCollection();
+            selectorItemCollection.add(new SelectorItemInfo("*"));
+            selectorItemCollection.add(new SelectorItemInfo("person.id"));
+            selectorItemCollection.add(new SelectorItemInfo("person.id"));
+            ESignGlobalStatusOverviewInfo info = globalStatusOverview.getESignGlobalStatusOverviewInfo(new ObjectUuidPK(billId));
+            PersonInfo person = info.getPerson();
+            PersonInfo operator = info.getOperator();
+            String personId=null;
+            if(null!=person&&null!=person.getId()){
+                personId=person.getId().toString();
+            }
+            String operatorId=null;
+            if(null!=operator&&null!=operator.getId()){
+                operatorId=operator.getId().toString();
+            }
+            EsignHttpResponse httpRes =EsignHttpUtil.urge_by_file(this.getCtx(),info.getSignFlowId(),null,info.getEfileId());
+            if(httpRes.getStatus()>=200&&httpRes.getStatus()<300) {
+                JSONObject object = JSON.parseObject(httpRes.getBody());
+                if("0".equals(String.valueOf(object.get("code")))) {
+
+                    BatchMessageTipsBody body = new BatchMessageTipsBody();
+                    body.setMuitTipsState(Boolean.TRUE);
+                    body.setMuitTipsMessage(httpRes.getBody());
+                    body.setId(billId);
+                    batchMessageTipsHeader.addResult(body);
+                    success++;
+                }else {
+                    BatchMessageTipsBody body = new BatchMessageTipsBody();
+                    body.setMuitTipsState(Boolean.FALSE);
+                    body.setMuitTipsMessage(httpRes.getBody());
+                    body.setId(billId);
+                    batchMessageTipsHeader.addResult(body);
+                }
+            }else {
+                BatchMessageTipsBody body = new BatchMessageTipsBody();
+                body.setMuitTipsState(Boolean.FALSE);
+                body.setMuitTipsMessage(httpRes.getBody());
+                body.setId(billId);
+                batchMessageTipsHeader.addResult(body);
+            }
+            batchMessageTipsHeader.setBillId(billId);
+            batchMessageTipsHeader.setFailureCount((success>0?1:0));
+            batchMessageTipsHeader.setSuccessCount(success);
+            this.writeSuccessData(batchMessageTipsHeader);
+        }catch (EsignException e){
+            e.printStackTrace();
+            throw new ShrWebBizException(e);
+        }catch (Exception e){
+            e.printStackTrace();
+            throw new ShrWebBizException(e);
+        }
+        return null;
+    }
+
+}