9060 2 روز پیش
والد
کامیت
4810db96a8

+ 29 - 27
properties/esign/esignConfig.properties

@@ -1,55 +1,57 @@
 shrAddr=http://172.16.105.191:8080/shr
 notifyUrl=http://hrtest.tenda.cn:8080/callback/callBackToOSF
-#应用ID
+#搴旂敤ID
 EsignAppId=7439075213
-#应用密钥
+#搴旂敤瀵嗛挜
 EsignAppSecret=8e4e6afcdd0eb159ef8e14af23e8d623
-#e签宝接口调用域名
-#e签宝接口调用域名(模拟环境)
+#e绛惧疂鎺ュ彛璋冪敤鍩熷悕
+#e绛惧疂鎺ュ彛璋冪敤鍩熷悕锛堟ā鎷熺幆澧冿級
 #https://smlopenapi.esign.cn
-#e签宝接口调用域名(正式环境)
+#e绛惧疂鎺ュ彛璋冪敤鍩熷悕锛堟�寮忕幆澧冿級
 #https://openapi.esign.cn
 EsignHost=https://smlopenapi.esign.cn
-#查询合同模板中控件详情
+#鏌ヨ�鍚堝悓妯℃澘涓�帶浠惰�鎯�
 docTemplatesDetailById=/v3/doc-templates/{0}
-#填写模板生成文件
+#濉�啓妯℃澘鐢熸垚鏂囦欢
 createByDocTemplate=/v3/files/create-by-doc-template
-#查询机构认证信息
+#鏌ヨ�鏈烘瀯璁よ瘉淇℃伅
 organizations.identity-info=/v3/organizations/identity-info
-#查询个人认证信息
+#鏌ヨ�涓�汉璁よ瘉淇℃伅
 persons.identity-info=/v3/persons/identity-info
-#添加签署区信息
+#娣诲姞绛剧讲鍖轰俊鎭�
 add.sign_fields=/v3/sign-flow/{0}/signers/sign-fields
-#查询签署流程详情
+#鏌ヨ�绛剧讲娴佺▼璇︽儏
 detail.sign_fields=/v3/sign-flow/{0}/detail
-#删除签署区
+#鍒犻櫎绛剧讲鍖�
 del.sign_fields=/v3/sign-flow/{0}/signers/sign-fields
-#添加抄送方
+#娣诲姞鎶勯€佹柟
 add.copiers=/v3/sign-flow/{0}/copiers
-#删除抄送方
+#鍒犻櫎鎶勯€佹柟
 del.copiers=/v3/sign-flow/{signFlowId}/copiers/delete
-#基于文件发起签署
+#鍩轰簬鏂囦欢鍙戣捣绛剧讲
 create_by_file=/v3/sign-flow/create-by-file
-#开启签署流程
+#寮€鍚��缃叉祦绋�
 start_by_file=/v3/sign-flow/{0}/start
-#开启签署流程
+#寮€鍚��缃叉祦绋�
 revoke_by_file=/v3/sign-flow/{0}/revoke
-#催签流程中签署人
+#鍌��娴佺▼涓��缃蹭汉
 urge_by_file=/v3/sign-flow/{0}/urge
-#下载已签署文件及附属材料
+#涓嬭浇宸茬�缃叉枃浠跺強闄勫睘鏉愭枡
 file_download_url=/v3/sign-flow/{0}/file-download-url
-#下载已签署文件及附属材料
+#涓嬭浇宸茬�缃叉枃浠跺強闄勫睘鏉愭枡
 preview_file_download_url=/v3/sign-flow/{0}/preview-file-download-url
-#查询企业内部印章
+#鏌ヨ�浼佷笟鍐呴儴鍗扮珷
 org_own_seal_list=/v3/seals/org-own-seal-list?orgId={0}&pageNum={1}&pageSize={2}
-#查询被外部企业授权印章
+#鏌ヨ�琚��閮ㄤ紒涓氭巿鏉冨嵃绔�
 org_authorized_seal_list=/v3/seals/org-authorized-seal-list?orgId={0}&pageNum={1}&pageSize={2}
-#查询被外部企业授权印章
+#鏌ヨ�琚��閮ㄤ紒涓氭巿鏉冨嵃绔�
 orgId=b7cef1b902dd42568baaf5865ac09536
-#查询文件上传状态
+#鏌ヨ�鏂囦欢涓婁紶鐘舵€�
 getFilesState=/v3/files/{0}
-#检索文件关键字坐标
+#妫€绱㈡枃浠跺叧閿�瓧鍧愭爣
 keyword_positions=/v3/files/{0}/keyword-positions
 
-#获取拖章定位页面
-get_seal_position_url=/v3/files/get-seal-position-url
+#鑾峰彇鎷栫珷瀹氫綅椤甸潰
+get_seal_position_url=/v3/files/get-seal-position-url
+#鏌ヨ�绛剧讲娴佺▼鍒楄〃
+sign_flow_list=/v3/organizations/sign-flow-list

+ 39 - 1
websrc/com/kingdee/eas/custom/esign/osf/Create_by_fileOSFService.java

@@ -439,6 +439,13 @@ public class Create_by_fileOSFService implements IHRMsfService {
             JSONObject fieldObject = (JSONObject) fileEntry.getValue();
             String docTemplateId = fieldObject.getString("id");
             String fileName = fieldObject.getString("name");
+
+            if (StringUtils.isBlank(docTemplateId)) {
+                docTemplateId = fieldObject.getString("tableId");
+            }
+            if (StringUtils.isBlank(fileName)) {
+                fileName = fieldObject.getString("tableName");
+            }
             Object order = fieldObject.get("order");
             String sourceId = jsonObject.getString("sourceId");
 
@@ -612,8 +619,36 @@ public class Create_by_fileOSFService implements IHRMsfService {
                                 field.put("signDateConfig", signDateConfig);
                             } else {
                                 //手动签章
-                                normalSignFieldConfig.put("freeMode", true);
+                                normalSignFieldConfig.put("freeMode", false);
                                 normalSignFieldConfig.put("autoSign", false);
+                                //印章id
+                                normalSignFieldConfig.put("assignedSealId", orgSignerInfo.getString("sealId"));
+                                //印章类型:1印章,2骑缝章
+                                normalSignFieldConfig.put("signFieldStyle", fieldMap.get("signFieldStyle"));
+                                Map<String, Object> signFieldPosition = Maps.newHashMap();
+                                if (1 == ((int) fieldMap.get("signFieldStyle"))) {
+                                    //正常章
+                                    if (null != fieldMap.get("positionPage") && null != fieldMap.get("positionX") && null != fieldMap.get("positionY")) {
+                                        signFieldPosition.put("positionPage", fieldMap.get("positionPage"));
+                                        signFieldPosition.put("positionX", fieldMap.get("positionX"));
+                                        signFieldPosition.put("positionY", fieldMap.get("positionY"));
+                                    } else {
+                                        Map<String, Object> res = Maps.newHashMap();
+                                        //失败
+                                        res.put("文件模板:"+doc.get("fileName"),signName+",未匹配到签署区,请检查模板的签署区命名规范。签署区命名规则:如(“甲方:(盖章)_签署方1_X50_Y50“)根据“_”分割字符串,第一个是要盖章的内容位置标识;第二个是签署方用来判断这个签署区是谁的;X50表示:印章位置向右移动50;Y50表示:印章位置向上移动50");
+                                        resulErrList.add(res);
+                                    }
+                                } else {
+                                    //骑缝章
+                                    signFieldPosition.put("positionY", fieldMap.get("positionY"));
+                                }
+                                normalSignFieldConfig.put("signFieldPosition", signFieldPosition);
+                                Map<String, Object> signDateConfig = (Map<String, Object>) fieldMap.get("signDateConfig");
+                                if(null==signDateConfig) {
+                                    signDateConfig = Maps.newHashMap();
+                                    //signDateConfig.put("showSignDate", 1);
+                                }
+                                field.put("signDateConfig", signDateConfig);
                             }
                             field.put("normalSignFieldConfig", normalSignFieldConfig);
                         } else {
@@ -871,6 +906,9 @@ public class Create_by_fileOSFService implements IHRMsfService {
             if (ComponentTypeEnum.DATESIGNATURE.getAlias().equals(dataType)) {
                 continue;
             }
+            if (null==fieldInfo.get("value")) {
+                continue;
+            }
             component.put("componentValue", fieldInfo.get("value"));
             components.add(component);
         }

+ 319 - 124
websrc/com/kingdee/eas/custom/esign/osf/EsignFlowListOSFService.java

@@ -8,6 +8,7 @@ import com.kingdee.bos.BOSException;
 import com.kingdee.bos.Context;
 import com.kingdee.bos.bsf.service.app.IHRMsfService;
 import com.kingdee.bos.dao.IObjectPK;
+import com.kingdee.bos.dao.ormapping.ObjectUuidPK;
 import com.kingdee.bos.rabbitmq.guava.Lists;
 import com.kingdee.bos.util.BOSUuid;
 import com.kingdee.eas.basedata.person.PersonInfo;
@@ -32,9 +33,10 @@ import java.time.*;
 import java.time.format.DateTimeFormatter;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.ScheduledThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
 
 /**
- *
  * description: EsignFlowListOSFService <br>
  * date: 4/1/2026 下午 4:23 <br>
  * author: lhbj <br>
@@ -61,7 +63,7 @@ public class EsignFlowListOSFService implements IHRMsfService {
         LocalTime time1 = LocalTime.now();
         LocalTime localT1 = LocalTime.of(time1.getHour(), 0, 0);
         LocalDateTime dateTime = LocalDateTime.of(localD1, localT1);
-        dateTime=dateTime.minusHours(1);
+        dateTime = dateTime.minusHours(1);
         return dateTime;
     }
 
@@ -102,148 +104,341 @@ public class EsignFlowListOSFService implements IHRMsfService {
             startDateTime = startDateTimeNow();
             endDateTime = endDateTimeNow();
         }
-        int pageNum=0;
-        int pageSize=100;
-        long totalNum=1;
+        int pageNum = 0;
+        int pageSize = 100;
+        long totalNum = 1;
+        IESignGlobalStatusOverview overview = ESignGlobalStatusOverviewFactory.getLocalInstance(context);
+        Map<String, Object> jsonMap = Maps.newHashMap();
+        long signFlowStartTimeFrom = startDateTime.atZone(ZoneId.systemDefault())
+                .toInstant()
+                .toEpochMilli();
+        long signFlowStartTimeTo = endDateTime.atZone(ZoneId.systemDefault())
+                .toInstant()
+                .toEpochMilli();
+        jsonMap.put("signFlowStartTimeFrom", signFlowStartTimeFrom);
+        jsonMap.put("signFlowStartTimeTo", signFlowStartTimeTo);
+//        List<String> list = Lists.newArrayList();
+//        list.add("2");
+//        jsonMap.put("signFlowStatus", list);
         do {
             pageNum++;
-            Map<String, Object> jsonMap = Maps.newHashMap();
-            long signFlowStartTimeFrom = startDateTime.atZone(ZoneId.systemDefault())
-                    .toInstant()
-                    .toEpochMilli();
-            long signFlowStartTimeTo = endDateTime.atZone(ZoneId.systemDefault())
-                    .toInstant()
-                    .toEpochMilli();
-            jsonMap.put("signFlowStartTimeFrom", signFlowStartTimeFrom);
-            jsonMap.put("signFlowStartTimeTo", signFlowStartTimeTo);
             jsonMap.put("pageNum", pageNum);
             jsonMap.put("pageSize", pageSize);
-            List<String> list = Lists.newArrayList();
-            list.add("2");
-            jsonMap.put("signFlowStatus", list);
             try {
-                IESignGlobalStatusOverview overview = ESignGlobalStatusOverviewFactory.getLocalInstance(context);
                 EsignHttpResponse response = EsignHttpUtil.sign_flow_list(context, jsonMap, "查询签署流程列表");
-                JSONObject jsonObject = JSON.parseObject(response.getBody());
-                int code =jsonObject.getInteger("code");
-                if (0==code){
+                if (response.getStatus() >= 200 && response.getStatus() < 300) {
+                    if (StringUtils.isBlank(response.getBody())) {
+                        continue;
+                    }
+                    //System.out.println(response.getBody());
+                    JSONObject jsonObject = JSON.parseObject(response.getBody());
+                    int code = jsonObject.getInteger("code");
+                    if (0 != code) {
+                        continue;
+                    }
                     JSONObject data = jsonObject.getJSONObject("data");
-                    if (null!=data){
-                        long total = data.getLong("total");
-                        if(total%pageSize==0){
-                            totalNum=total/pageSize;
-                        }else {
-                            totalNum=total/pageSize+1;
-                        }
-                        JSONArray signFlowInfos = data.getJSONArray("signFlowInfos");
-                        for (int i=0;i<signFlowInfos.size();i++){
-                            JSONObject signFlowInfo = signFlowInfos.getJSONObject(i);
-                            String signFlowId = signFlowInfo.getString("signFlowId");
-                            String sel = "select fid from CT_ESI_ESGSO where CFSignFlowId ='"+signFlowId+"'";
-                            IRowSet rowSet = DbUtil.executeQuery(context,sel);
-                            if(rowSet.size()<=0){
-                                ESignGlobalStatusOverviewInfo nowInfo = new ESignGlobalStatusOverviewInfo();
-                                nowInfo.setSignFlowId(signFlowId);
-                                nowInfo.setEsignStatus(EsignStatusEnum.COMPLETED);
-                                nowInfo.setEsignName(EsignConfigEnum.sign_flow_list);
-                                nowInfo.setRequestParams(response.getBody());
-                                nowInfo.setFiesign(true);
-                                nowInfo.setSendStatus(SendStatusEnum.SUCCESS);
-                                JSONArray signers = signFlowInfo.getJSONArray("signers");
-                                for(int x=0;x<signers.size();x++) {
-                                    JSONObject signer = signers.getJSONObject(x);
-                                    JSONObject psnSigner=signer.getJSONObject("psnSigner");
-                                    if (null==psnSigner){
-                                        continue;
-                                    }
-                                    JSONObject psnAccount=psnSigner.getJSONObject("psnAccount");
-                                    String accountMobile = psnAccount.getString("accountMobile");
-                                    String accountEmail = psnAccount.getString("accountEmail");
-                                    if(StringUtils.isNotBlank(accountMobile)){
-                                        String selp = "select fid from t_bd_person where FNCELL='"+accountMobile+"'";
-                                        IRowSet rs = DbUtil.executeQuery(context,selp);
-                                        if (rs.next()){
-                                            String fid = rs.getString("fid");
-                                            PersonInfo personInfo = new PersonInfo();
-                                            personInfo.setId(BOSUuid.read(fid));
-                                            nowInfo.setPerson(personInfo);
-                                        }
-                                    }else {
-                                        String selp = "select fid from t_bd_person where FEMail='"+accountEmail+"'";
-                                        IRowSet rs = DbUtil.executeQuery(context,selp);
-                                        if (rs.next()){
-                                            String fid = rs.getString("fid");
-                                            PersonInfo personInfo = new PersonInfo();
-                                            personInfo.setId(BOSUuid.read(fid));
-                                            nowInfo.setPerson(personInfo);
-                                        }
-                                    }
-                                }
-                                if(null!=nowInfo.getPerson()) {
-                                    IObjectPK pk = overview.addnew(nowInfo);
-                                    SyncSignedFilesUtil.syncAttachmentsForEmpPage(context,pk.toString());
-                                }
+                    if (null == data) {
+                        continue;
+                    }
+                    long total = data.getLong("total");
+                    if (total % pageSize == 0) {
+                        totalNum = total / pageSize;
+                    } else {
+                        totalNum = total / pageSize + 1;
+                    }
+                    JSONArray signFlowInfos = data.getJSONArray("signFlowInfos");
+                    for (int i = 0; i < signFlowInfos.size(); i++) {
+                        JSONObject signFlowInfo = signFlowInfos.getJSONObject(i);
+                        String signFlowId = signFlowInfo.getString("signFlowId");
+                        String signFlowTitle = signFlowInfo.getString("signFlowTitle");
+
+                        String sel = "select fid from CT_ESI_ESGSO where CFSignFlowId ='" + signFlowId + "'";
+                        IRowSet rowSet = DbUtil.executeQuery(context, sel);
+                        if (rowSet.next()) {
+                            String id = rowSet.getString("fid");
+                            updateSignFlow(context, overview, signFlowId, id);
+                        } else {
+                            if (signFlowTitle.indexOf("人资") < 0 && signFlowTitle.indexOf("人力资源") < 0) {
+                                continue;
                             }
+                            addNewSignFlow(context, overview, signFlowInfo, signFlowId, signFlowTitle);
                         }
                     }
                 }
             } catch (EsignException | SQLException e) {
                 e.printStackTrace();
             }
-        } while (pageNum<totalNum);
+        } while (pageNum < totalNum);
+
         return "ok";
     }
 
-    public static void main(String[] args) {
-        System.setProperty("EAS_HOME","D:\\project\\kingdeeV90\\Project_hty\\tengda");
-        LocalDateTime startDateTime = null;
-        LocalDateTime endDateTime = null;
-        if (null == startDateTime || null == endDateTime) {
-            startDateTime = formatter("2025-02-01");;
-            endDateTime = endDateTimeNow();
+    private boolean updateSignFlow(Context context, IESignGlobalStatusOverview overview, String signFlowId, String id) throws BOSException, EASBizException, EsignException, SQLException {
+        ESignGlobalStatusOverviewInfo oldInfo = overview.getESignGlobalStatusOverviewInfo(new ObjectUuidPK(id));
+        EsignHttpResponse respsf = EsignHttpUtil.getSign_fields(context, signFlowId, "查询签署流程详情");
+        if (respsf.getStatus() < 200 || respsf.getStatus() >= 300) {
+            return true;
         }
-        int pageNum=0;
-        int pageSize=20;
-        long totalNum=1;
-        do {
-            pageNum++;
-            Map<String, Object> jsonMap = Maps.newHashMap();
-            long signFlowStartTimeFrom = startDateTime.atZone(ZoneId.systemDefault())
-                    .toInstant()
-                    .toEpochMilli();
-            long signFlowStartTimeTo = endDateTime.atZone(ZoneId.systemDefault())
-                    .toInstant()
-                    .toEpochMilli();
-            jsonMap.put("signFlowStartTimeFrom", signFlowStartTimeFrom);
-            jsonMap.put("signFlowStartTimeTo", signFlowStartTimeTo);
-            jsonMap.put("pageNum", pageNum);
-            jsonMap.put("pageSize", pageSize);
-            List<String> list = Lists.newArrayList();
-            //list.add("1");
-            list.add("2");
-            //list.add("3");
-            jsonMap.put("signFlowStatus", list);
-            try {
-                EsignHttpResponse response = EsignHttpUtil.sign_flow_list(null, jsonMap, "查询签署流程列表");
-                System.out.println(response.getBody());
-                JSONObject jsonObject = JSON.parseObject(response.getBody());
-                int code =jsonObject.getInteger("code");
-                if (0==code){
-                    JSONObject data = jsonObject.getJSONObject("data");
-                    if (null!=data){
-                        JSONArray signFlowInfos = data.getJSONArray("signFlowInfos");
-                        System.out.println(signFlowInfos.size());
-                        long total = data.getLong("total");
-                        if(total%pageSize==0){
-                            totalNum=total/pageSize;
-                        }else {
-                            totalNum=total/pageSize+1;
-                        }
+        if (StringUtils.isBlank(respsf.getBody())) {
+            return true;
+        }
+        JSONObject jsonObjsf = JSON.parseObject(respsf.getBody());
+        int codesf = jsonObjsf.getInteger("code");
+        if (0 != codesf) {
+            return true;
+        }
+        JSONObject datasf = jsonObjsf.getJSONObject("data");
+        if (null == datasf) {
+            return true;
+        }
+        Integer signFlowStatus = datasf.getInteger("signFlowStatus");
+        String statusDescription = datasf.getString("statusDescription");
+        //签署中
+        if (null != signFlowStatus && 1 == signFlowStatus) {
+            JSONArray signers = datasf.getJSONArray("signers");
+            StringBuilder signNames = new StringBuilder();
+            for (int j = 0; j < signers.size(); j++) {
+                JSONObject signer = signers.getJSONObject(j);
+                JSONObject psnSigner = signer.getJSONObject("psnSigner");
+                JSONObject orgSigner = signer.getJSONObject("orgSigner");
+                JSONArray signFields = signer.getJSONArray("signFields");
+                boolean signFieldBool=false;
+                for (int x = 0; x < signFields.size(); x++) {
+                    JSONObject sign = signFields.getJSONObject(x);
+                    Integer signFieldStatus = Integer.parseInt(sign.getString("signFieldStatus"));
+                    //这三种情况的话说明是当前这个签署区所属的签署人在签署:1 - 执行中、2 - 执行失败、3 - 审批中
+                    if (signFieldStatus > 0 && signFieldStatus < 4) {
+                        signFieldBool=true;
                     }
                 }
-            } catch (EsignException e) {
-                e.printStackTrace();
+                oldInfo.setEsignStatus(EsignStatusEnum.getEnum(signFlowStatus));
+                oldInfo.setDescription(statusDescription);
+                oldInfo.setNowOperator("");
+                if (signFieldBool) {
+                    signNames = getPsnName(context, signNames, psnSigner);
+                    signNames = getOrgName(context, signNames, orgSigner);
+                }
+            }
+            if(signNames.indexOf(",") == 0) {
+                signNames.delete(0,1);
+            }
+            if (signNames.length() > 500) {
+                oldInfo.setNowOperator(signNames.substring(0, 500));
+            } else {
+                oldInfo.setNowOperator(signNames.toString());
+            }
+        } else {
+            String signFlowDescription = datasf.getString("signFlowDescription");
+            String revokeReason = datasf.getString("revokeReason");
+            oldInfo.setNowOperator("");
+            oldInfo.setDescription(signFlowDescription);
+            oldInfo.setDescription(revokeReason);
+        }
+        overview.save(oldInfo);
+        return false;
+    }
+
+    private StringBuilder getOrgName(Context context, StringBuilder signNames, JSONObject orgSigner) throws BOSException, SQLException {
+        if (null == orgSigner) {
+            return signNames;
+        }
+        String orgName = orgSigner.getString("orgName");
+        JSONObject transactor = orgSigner.getJSONObject("transactor");
+        if (null == transactor) {
+            return signNames;
+        }
+        String psnName = transactor.getString("psnName");
+        if (StringUtils.isNotBlank(psnName)) {
+            signNames.append("," + orgName + "(" + psnName + ")");
+            return signNames;
+        }
+        JSONObject psnAccount = transactor.getJSONObject("psnAccount");
+        if (null == psnAccount) {
+            return signNames;
+        }
+        String accountMobile = psnAccount.getString("accountMobile");
+        String accountEmail = psnAccount.getString("accountEmail");
+        if (StringUtils.isNotBlank(accountMobile)) {
+            String selp = "select fid,fname_l2,fnumber from t_bd_person where FNCELL='" + accountMobile + "'";
+            IRowSet rs = DbUtil.executeQuery(context, selp);
+            if (rs.next()) {
+                String fid = rs.getString("fid");
+                String fname_l2 = rs.getString("fname_l2");
+                String fnumber = rs.getString("fnumber");
+                signNames.append("," + orgName + "(" + fname_l2 + ")");
+                return signNames;
+            }
+        }
+        if (StringUtils.isNotBlank(accountEmail)) {
+            String selp = "select fid,fname_l2,fnumber from t_bd_person where FEMail='" + accountEmail + "'";
+            IRowSet rs = DbUtil.executeQuery(context, selp);
+            if (rs.next()) {
+                String fid = rs.getString("fid");
+                String fname_l2 = rs.getString("fname_l2");
+                String fnumber = rs.getString("fnumber");
+                signNames.append("," + orgName + "(" + fname_l2 + ")");
+                return signNames;
+            }
+        }
+
+        return signNames;
+    }
+
+    private StringBuilder getPsnName(Context context, StringBuilder signNames, JSONObject psnSigner) throws BOSException, SQLException {
+        if (null == psnSigner) {
+            return signNames;
+        }
+        String psnName = psnSigner.getString("psnName");
+        if (StringUtils.isNotBlank(psnName)) {
+            signNames.append("," + psnName);
+            return signNames;
+        }
+        JSONObject psnAccount = psnSigner.getJSONObject("psnAccount");
+        if (null == psnAccount) {
+            return signNames;
+        }
+        String accountMobile = psnAccount.getString("accountMobile");
+        String accountEmail = psnAccount.getString("accountEmail");
+        if (StringUtils.isNotBlank(accountMobile)) {
+            String selp = "select fid,fname_l2,fnumber from t_bd_person where FNCELL='" + accountMobile + "'";
+            IRowSet rs = DbUtil.executeQuery(context, selp);
+            if (rs.next()) {
+                String fid = rs.getString("fid");
+                String fname_l2 = rs.getString("fname_l2");
+                String fnumber = rs.getString("fnumber");
+                signNames.append("," + fname_l2);
+                return signNames;
+            }
+        }
+        if (StringUtils.isNotBlank(accountEmail)) {
+            String selp = "select fid,fname_l2,fnumber from t_bd_person where FEMail='" + accountEmail + "'";
+            IRowSet rs = DbUtil.executeQuery(context, selp);
+            if (rs.next()) {
+                String fid = rs.getString("fid");
+                String fname_l2 = rs.getString("fname_l2");
+                String fnumber = rs.getString("fnumber");
+                signNames.append("," + fname_l2);
+                return signNames;
             }
-        } while (pageNum<totalNum);
+        }
+
+        return signNames;
+    }
+
+    private void addNewSignFlow(Context context, IESignGlobalStatusOverview overview, JSONObject signFlowInfo, String signFlowId, String signFlowTitle) throws BOSException, SQLException, EASBizException {
+        ESignGlobalStatusOverviewInfo nowInfo = new ESignGlobalStatusOverviewInfo();
+        nowInfo.setSignFlowId(signFlowId);
+        nowInfo.setFileName(signFlowTitle);
+        nowInfo.setEsignStatus(EsignStatusEnum.COMPLETED);
+        nowInfo.setEsignName(EsignConfigEnum.sign_flow_list);
+        nowInfo.setRequestParams(signFlowInfo.toJSONString());
+        nowInfo.setFiesign(true);
+        nowInfo.setSendStatus(SendStatusEnum.SUCCESS);
+        JSONArray signers = signFlowInfo.getJSONArray("signers");
+        for (int x = 0; x < signers.size(); x++) {
+            JSONObject signer = signers.getJSONObject(x);
+            JSONObject psnSigner = signer.getJSONObject("psnSigner");
+            if (null == psnSigner) {
+                continue;
+            }
+            JSONObject psnAccount = psnSigner.getJSONObject("psnAccount");
+            String accountMobile = psnAccount.getString("accountMobile");
+            String accountEmail = psnAccount.getString("accountEmail");
+            if (StringUtils.isNotBlank(accountMobile)) {
+                String selp = "select fid from t_bd_person where FNCELL='" + accountMobile + "'";
+                IRowSet rs = DbUtil.executeQuery(context, selp);
+                if (rs.next()) {
+                    String fid = rs.getString("fid");
+                    PersonInfo personInfo = new PersonInfo();
+                    personInfo.setId(BOSUuid.read(fid));
+                    nowInfo.setPerson(personInfo);
+                }
+            } else {
+                String selp = "select fid from t_bd_person where FEMail='" + accountEmail + "'";
+                IRowSet rs = DbUtil.executeQuery(context, selp);
+                if (rs.next()) {
+                    String fid = rs.getString("fid");
+                    PersonInfo personInfo = new PersonInfo();
+                    personInfo.setId(BOSUuid.read(fid));
+                    nowInfo.setPerson(personInfo);
+                }
+            }
+        }
+        if (null != nowInfo.getPerson()) {
+            IObjectPK pk = overview.addnew(nowInfo);
+            ScheduledThreadPoolExecutor scheduledThreadPoolExecutor = new ScheduledThreadPoolExecutor(1);
+            scheduledThreadPoolExecutor.schedule(() -> {
+                try {
+                    this.updateSignFlow(context, overview, signFlowId, nowInfo.getId().toString());
+                    SyncSignedFilesUtil.syncAttachmentsForEmpPage(context, nowInfo.getId().toString());
+                } catch (BOSException e) {
+                    e.printStackTrace();
+                } catch (EASBizException e) {
+                    e.printStackTrace();
+                } catch (EsignException e) {
+                    e.printStackTrace();
+                } catch (SQLException throwables) {
+                    throwables.printStackTrace();
+                }
+            }, 1, TimeUnit.MINUTES);
+        }
+    }
+
+
+    public static void main(String[] args) throws EsignException {
+        System.setProperty("EAS_HOME","D:\\project\\kingdeeV90\\Project_hty\\tengda");
+//        LocalDateTime startDateTime = null;
+//        LocalDateTime endDateTime = null;
+//        if (null == startDateTime || null == endDateTime) {
+//            startDateTime = formatter("2025-02-01");;
+//            endDateTime = formatter("2026-02-01");;
+//        }
+//        int pageNum=0;
+//        int pageSize=100;
+//        long totalNum=1;
+//        do {
+//            pageNum++;
+//            Map<String, Object> jsonMap = Maps.newHashMap();
+//            long signFlowStartTimeFrom = startDateTime.atZone(ZoneId.systemDefault())
+//                    .toInstant()
+//                    .toEpochMilli();
+//            long signFlowStartTimeTo = endDateTime.atZone(ZoneId.systemDefault())
+//                    .toInstant()
+//                    .toEpochMilli();
+//            jsonMap.put("signFlowStartTimeFrom", signFlowStartTimeFrom);
+//            jsonMap.put("signFlowStartTimeTo", signFlowStartTimeTo);
+//            jsonMap.put("pageNum", pageNum);
+//            jsonMap.put("pageSize", pageSize);
+//            List<String> list = Lists.newArrayList();
+//            list.add("1");
+//            list.add("2");
+//            list.add("3");
+//            jsonMap.put("signFlowStatus", list);
+//            try {
+//                EsignHttpResponse response = EsignHttpUtil.sign_flow_list(null, jsonMap, "查询签署流程列表");
+//                System.out.println(response.getBody());
+//                JSONObject jsonObject = JSON.parseObject(response.getBody());
+//                int code =jsonObject.getInteger("code");
+//                if (0==code){
+//                    JSONObject data = jsonObject.getJSONObject("data");
+//                    if (null!=data){
+//                        JSONArray signFlowInfos = data.getJSONArray("signFlowInfos");
+//                        System.out.println(signFlowInfos.size());
+//                        long total = data.getLong("total");
+//                        if(total%pageSize==0){
+//                            totalNum=total/pageSize;
+//                        }else {
+//                            totalNum=total/pageSize+1;
+//                        }
+//                    }
+//                }
+//            } catch (EsignException e) {
+//                e.printStackTrace();
+//            }
+//        } while (pageNum<totalNum);
+        System.out.println(12 + (3 - 1) / 2 * 1);
+        EsignHttpResponse r = EsignHttpUtil.getSign_fields(null,"d4d12e6ed7374775a9dcb4747e1e5e59");
+        System.out.println(r.getBody());
+
     }
 }