From 4e99ee60b28fed0558a64e6d7fffbbf6c451549c Mon Sep 17 00:00:00 2001 From: rengp Date: Mon, 24 Jun 2024 19:21:48 +0800 Subject: [PATCH] no message --- com/cloudstore/eccom/MessageReceiveTest.java | 44 + .../archives/action/WorkflowToDocCus.java | 6 +- .../archives/corn/PushArchivesCorn.java | 31 +- .../corn/PushArchivesCornMultiThread.java | 63 + .../service/ReceivingPushArchivesService.java | 376 ++- .../service/SendingPushArchivesService.java | 125 +- .../SignReportPushArchivesService.java | 135 +- ...rstBranchReceivingPushArchivesService.java | 720 +++++ ...FirstBranchSendingPushArchivesService.java | 571 ++++ ...stBranchSignReportPushArchivesService.java | 541 ++++ .../service/impl/HtmlToPdfServiceCusImpl.java | 113 +- ...ondBranchReceivingPushArchivesService.java | 722 +++++ ...econdBranchSendingPushArchivesService.java | 575 ++++ .../custom/archives/util/ArchivesUtil.java | 113 +- com/engine/custom/archives/util/KeyWord.java | 25 + .../biz/requestForm/WfToDocBizCus.java | 5 +- .../biz/requestLog/RequestLogCusBiz.java | 3 +- .../custom/audit/corn/OA2AuditCorn.java | 36 + .../audit/service/PushAuditService.java | 350 +++ com/engine/custom/msg/MessageReceiveTest.java | 120 + .../GetReserveCodeNewInfosCmd.java | 671 +++++ demo/demoDate.jsp | 66 - docment/字段映射_1694422244889.xlsx | Bin 32308 -> 0 bytes docment/字段映射_1694514327253.xlsx | Bin 30968 -> 0 bytes docment/补贴报销单.wewf | Bin 46100 -> 0 bytes .../阿里差旅推送财务系统_字段梳理_V4.0.xlsx | Bin 13014 -> 0 bytes .../transfer/HistoryDataPushArchiveLog.jsp | 84 + .../HistoryDataPushArchiveLog2023.jsp | 84 + .../HistoryDataPushArchiveLog202312.jsp | 84 + .../HistoryDataPushArchiveLog202312.zip | Bin 0 -> 1463 bytes interface/transfer/reportApp.jsp | 60 - interface/transfer/reportGjc.jsp | 119 - .../{testDemo2.jsp => syncDepartment.jsp} | 17 +- interface/transfer/testDemo.jsp | 1188 -------- interface/transfer/testError.jsp | 812 ------ interface/transfer/testError2.jsp | 99 - interface/transfer/testError3.jsp | 52 - interface/transfer/testXML.jsp | 75 - interface/transfer/最终测试一下1106.html | 2580 ----------------- .../ecology/interface/transfer/transfer.zip | Bin 4422 -> 0 bytes opt/weaver/ecology/interface/transfer/x2.zip | Bin 1357 -> 0 bytes opt/weaver/ecology/interface/transfer/x6.jsp | 21 + produce/23/transfer/SJWfToMode.jsp | 176 ++ produce/23/transfer/WfToSJ.jsp | 69 + produce/23/transfer/mobile/ssoUrl.zip | Bin 0 -> 7547 bytes produce/23/transfer/workflowtest.jsp | 16 + weaver/filter/LoginEMFilter.java | 19 +- .../action/javacode/Action20231113045722.java | 102 +- .../action/javacode/Action20231123035106.java | 838 +++--- .../action/javacode/Action20240511020255.java | 28 + .../video/consumer/YealinkVideoClient.java | 645 +++++ .../workflow/request/RequestDeleteUtils.java | 1175 ++++++++ .../com/ReceivingPushArchivesService.jsp | 712 +++++ .../com/SendingPushArchivesService.jsp | 618 ++++ .../com/SignReportPushArchivesService.jsp | 588 ++++ weavernorth/com/testDateKey.jsp | 25 - weavernorth/custom/avatar/zipAvatar.jsp | 69 + .../custom/businessTravel/getdeleType.jsp | 90 + weavernorth/custom/dept/CommUtil.class | Bin 0 -> 3285 bytes weavernorth/custom/dept/deptTest.jsp | 22 + 60 files changed, 10175 insertions(+), 5703 deletions(-) create mode 100644 com/cloudstore/eccom/MessageReceiveTest.java create mode 100644 com/engine/custom/archives/corn/PushArchivesCornMultiThread.java create mode 100644 com/engine/custom/archives/service/firstBranch/FirstBranchReceivingPushArchivesService.java create mode 100644 com/engine/custom/archives/service/firstBranch/FirstBranchSendingPushArchivesService.java create mode 100644 com/engine/custom/archives/service/firstBranch/FirstBranchSignReportPushArchivesService.java create mode 100644 com/engine/custom/archives/service/secondBranch/SecondBranchReceivingPushArchivesService.java create mode 100644 com/engine/custom/archives/service/secondBranch/SecondBranchSendingPushArchivesService.java create mode 100644 com/engine/custom/archives/util/KeyWord.java create mode 100644 com/engine/custom/audit/corn/OA2AuditCorn.java create mode 100644 com/engine/custom/audit/service/PushAuditService.java create mode 100644 com/engine/custom/msg/MessageReceiveTest.java create mode 100644 com/engine/workflow/cmd/codeMaintenance/GetReserveCodeNewInfosCmd.java delete mode 100644 demo/demoDate.jsp delete mode 100644 docment/字段映射_1694422244889.xlsx delete mode 100644 docment/字段映射_1694514327253.xlsx delete mode 100644 docment/补贴报销单.wewf delete mode 100644 docment/阿里差旅推送财务系统_字段梳理_V4.0.xlsx create mode 100644 interface/transfer/HistoryDataPushArchiveLog.jsp create mode 100644 interface/transfer/HistoryDataPushArchiveLog2023.jsp create mode 100644 interface/transfer/HistoryDataPushArchiveLog202312.jsp create mode 100644 interface/transfer/HistoryDataPushArchiveLog202312.zip delete mode 100644 interface/transfer/reportApp.jsp delete mode 100644 interface/transfer/reportGjc.jsp rename interface/transfer/{testDemo2.jsp => syncDepartment.jsp} (79%) delete mode 100644 interface/transfer/testDemo.jsp delete mode 100644 interface/transfer/testError.jsp delete mode 100644 interface/transfer/testError2.jsp delete mode 100644 interface/transfer/testError3.jsp delete mode 100644 interface/transfer/testXML.jsp delete mode 100644 interface/transfer/最终测试一下1106.html delete mode 100644 opt/weaver/ecology/interface/transfer/transfer.zip delete mode 100644 opt/weaver/ecology/interface/transfer/x2.zip create mode 100644 opt/weaver/ecology/interface/transfer/x6.jsp create mode 100644 produce/23/transfer/SJWfToMode.jsp create mode 100644 produce/23/transfer/WfToSJ.jsp create mode 100644 produce/23/transfer/mobile/ssoUrl.zip create mode 100644 produce/23/transfer/workflowtest.jsp create mode 100644 weaver/interfaces/workflow/action/javacode/Action20240511020255.java create mode 100644 weaver/meeting/video/consumer/YealinkVideoClient.java create mode 100644 weaver/workflow/request/RequestDeleteUtils.java create mode 100644 weavernorth/com/ReceivingPushArchivesService.jsp create mode 100644 weavernorth/com/SendingPushArchivesService.jsp create mode 100644 weavernorth/com/SignReportPushArchivesService.jsp delete mode 100644 weavernorth/com/testDateKey.jsp create mode 100644 weavernorth/custom/avatar/zipAvatar.jsp create mode 100644 weavernorth/custom/businessTravel/getdeleType.jsp create mode 100644 weavernorth/custom/dept/CommUtil.class create mode 100644 weavernorth/custom/dept/deptTest.jsp diff --git a/com/cloudstore/eccom/MessageReceiveTest.java b/com/cloudstore/eccom/MessageReceiveTest.java new file mode 100644 index 0000000..1795519 --- /dev/null +++ b/com/cloudstore/eccom/MessageReceiveTest.java @@ -0,0 +1,44 @@ +package com.cloudstore.eccom; + +import com.alibaba.fastjson.JSONObject; +import com.weaver.base.msgcenter.channel.IMessageReceive; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import weaver.general.BaseBean; + +import java.util.List; +import java.util.Map; + +public class MessageReceiveTest implements IMessageReceive { + public static Logger log = LoggerFactory.getLogger("Archives"); + private BaseBean bean=new BaseBean(); + @Override + public void onMessage(String s) { + log.error("onMessage:{}",s); + bean.writeLog("onMessage:{}",s); + } + + @Override + public void onStart() { + log.error("onStartExecute"); + bean.writeLog("onStartExecute"); + } + + @Override + public void onEnd() { + log.error("onEndExecute"); + bean.writeLog("onEndExecute"); + } + + @Override + public void setProp(Map map) { + log.error("setProp:{}",map); + bean.writeLog("setProp:{}"+map); + } + + @Override + public void setList(List list) { + log.error("setList:{}", JSONObject.toJSONString(list)); + bean.writeLog("setList:{}"+ JSONObject.toJSONString(list)); + } +} diff --git a/com/engine/custom/archives/action/WorkflowToDocCus.java b/com/engine/custom/archives/action/WorkflowToDocCus.java index e99234f..89b6479 100644 --- a/com/engine/custom/archives/action/WorkflowToDocCus.java +++ b/com/engine/custom/archives/action/WorkflowToDocCus.java @@ -73,7 +73,7 @@ public class WorkflowToDocCus { private String aescode=""; //底部签字意见列表显示数量 - private int pageSize =100; + private int pageSize =99999; public static Class class_MultiLangFilter; static { @@ -184,7 +184,7 @@ public class WorkflowToDocCus { //离线html/pdf WfToDocBizCus wfToDocBiz = new WfToDocBizCus(user,pageSize,keepsign,docfiles,modeid,isOpenWaterMark); wfToDocBiz.setOnlineHtmlMethod(onlineHtmlMethod); - wfToDocBiz.generatepdfandhtml(requestid,filename,temppath,src,reqType); + wfToDocBiz.generatepdfandhtml(requestid,filename,temppath,src,reqType,workflowid); fileids.putAll(wfToDocBiz.getfileids(requestname,filename,temppath)); //保存 List docids = saveDocDetail(requestname, workflowid, requestid, wfdocpath, userid, fileids, requestManager, wfbiz); @@ -210,7 +210,7 @@ public class WorkflowToDocCus { //离线html/pdf WfToDocBizCus wfToDocBiz = new WfToDocBizCus(user,pageSize,keepsign,docfiles,modeid,isOpenWaterMark); wfToDocBiz.setOnlineHtmlMethod(onlineHtmlMethod); - wfToDocBiz.generatepdfandhtml(requestid,filename,temppath,src, reqType); + wfToDocBiz.generatepdfandhtml(requestid,filename,temppath,src, reqType,workflowid); fileids.putAll(wfToDocBiz.getfileids(requestname,filename,temppath)); //保存 saveDocDetail(requestname, workflowid,requestid, wfdocpath,userid,fileids,requestManager,wfbiz); diff --git a/com/engine/custom/archives/corn/PushArchivesCorn.java b/com/engine/custom/archives/corn/PushArchivesCorn.java index 458b91a..db43df7 100644 --- a/com/engine/custom/archives/corn/PushArchivesCorn.java +++ b/com/engine/custom/archives/corn/PushArchivesCorn.java @@ -3,10 +3,16 @@ package com.engine.custom.archives.corn; import com.engine.custom.archives.service.ReceivingPushArchivesService; import com.engine.custom.archives.service.SendingPushArchivesService; import com.engine.custom.archives.service.SignReportPushArchivesService; +import com.engine.custom.archives.service.firstBranch.FirstBranchReceivingPushArchivesService; +import com.engine.custom.archives.service.firstBranch.FirstBranchSendingPushArchivesService; +import com.engine.custom.archives.service.firstBranch.FirstBranchSignReportPushArchivesService; +import com.engine.custom.archives.service.secondBranch.SecondBranchReceivingPushArchivesService; +import com.engine.custom.archives.service.secondBranch.SecondBranchSendingPushArchivesService; import com.engine.custom.archives.util.ArchivesUtil; import lombok.extern.slf4j.Slf4j; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import weaver.general.Util; import weaver.interfaces.schedule.BaseCronJob; @@ -25,6 +31,7 @@ public class PushArchivesCorn extends BaseCronJob { public String filePath = "/opt/weaver/archivesFile"; public String Url = "http://14.1.206.240:18080/fcscloud/composite/upload"; public String templatePath = "/opt/weaver/archivesFile/template/"; + public String endTime = "7"; public String reqid = ""; public static Logger log = LoggerFactory.getLogger("Archives"); @@ -32,6 +39,12 @@ public class PushArchivesCorn extends BaseCronJob { SendingPushArchivesService sendingservice = new SendingPushArchivesService(); SignReportPushArchivesService signReportservice =new SignReportPushArchivesService(); + FirstBranchReceivingPushArchivesService firstBranchReceivingPushArchivesService =new FirstBranchReceivingPushArchivesService(); + FirstBranchSendingPushArchivesService firstBranchSendingPushArchivesService =new FirstBranchSendingPushArchivesService(); + FirstBranchSignReportPushArchivesService firstBranchSignReportPushArchivesService =new FirstBranchSignReportPushArchivesService(); + SecondBranchReceivingPushArchivesService secondBranchReceivingPushArchivesService =new SecondBranchReceivingPushArchivesService(); + SecondBranchSendingPushArchivesService secondBranchSendingPushArchivesService =new SecondBranchSendingPushArchivesService(); + @Override public void execute() { log.info("PushArchivesCorn====Begin========"); @@ -40,14 +53,24 @@ public class PushArchivesCorn extends BaseCronJob { HashMap param = new HashMap<>(); param.put("filePath",filePath+ File.separator+dateStr); param.put("Url",Url); - param.put("requestid",reqid); + param.put("endTime", endTime); + // param.put("requestid",reqid); param.put("templatePath",templatePath); - // receivingservice.setProp(param); - // receivingservice.pushArchives(param); sendingservice.setProp(param); sendingservice.pushArchives(param); signReportservice.setProp(param); signReportservice.pushArchives(param); - + receivingservice.setProp(param); + receivingservice.pushArchives(param); + firstBranchReceivingPushArchivesService.setProp(param); + firstBranchReceivingPushArchivesService.pushArchives(param); + firstBranchSendingPushArchivesService.setProp(param); + firstBranchSendingPushArchivesService.pushArchives(param); + firstBranchSignReportPushArchivesService.setProp(param); + firstBranchSignReportPushArchivesService.pushArchives(param); + secondBranchReceivingPushArchivesService.setProp(param); + secondBranchReceivingPushArchivesService.pushArchives(param); + secondBranchSendingPushArchivesService.setProp(param); + secondBranchSendingPushArchivesService.pushArchives(param); } } diff --git a/com/engine/custom/archives/corn/PushArchivesCornMultiThread.java b/com/engine/custom/archives/corn/PushArchivesCornMultiThread.java new file mode 100644 index 0000000..3a7c206 --- /dev/null +++ b/com/engine/custom/archives/corn/PushArchivesCornMultiThread.java @@ -0,0 +1,63 @@ +package com.engine.custom.archives.corn; + +import com.engine.custom.archives.service.ReceivingPushArchivesService; +import com.engine.custom.archives.service.SendingPushArchivesService; +import com.engine.custom.archives.service.SignReportPushArchivesService; +import com.engine.custom.archives.util.ArchivesUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import weaver.interfaces.schedule.BaseCronJob; + +import java.io.File; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; + +/*** + * 推送档案系统定时任务 + * @author rengp + * @date 2024/4/7 + */ + +public class PushArchivesCornMultiThread extends BaseCronJob { + public String filePath = "/opt/weaver/archivesFile"; + public String Url = "http://14.1.206.240:18080/fcscloud/composite/upload"; + public String templatePath = "/opt/weaver/archivesFile/template/"; + public String reqid = ""; + public static Logger log = LoggerFactory.getLogger("Archives"); + + + @Override + public void execute() { + log.info("PushArchivesCorn====Begin========"); + Date date = ArchivesUtil.getDate(); + String dateStr = new SimpleDateFormat("yyyyMMdd").format(date); + HashMap param = new HashMap<>(); + param.put("filePath",filePath+ File.separator+dateStr); + param.put("Url",Url); + // param.put("requestid",reqid); + param.put("templatePath",templatePath); + ExecutorService executor = Executors.newFixedThreadPool(3); + executor.submit(new Thread(() -> { + ReceivingPushArchivesService receivingservice = new ReceivingPushArchivesService(); + receivingservice.setProp(param); + receivingservice.pushArchives(param); + })); + + executor.submit(new Thread(() -> { + ReceivingPushArchivesService receivingservice = new ReceivingPushArchivesService(); + receivingservice.setProp(param); + receivingservice.pushArchives(param); + })); + + + executor.submit(new Thread(() -> { + SignReportPushArchivesService signReportservice =new SignReportPushArchivesService(); + signReportservice.setProp(param); + signReportservice.pushArchives(param); + })); + + } +} diff --git a/com/engine/custom/archives/service/ReceivingPushArchivesService.java b/com/engine/custom/archives/service/ReceivingPushArchivesService.java index 6309e30..e509353 100644 --- a/com/engine/custom/archives/service/ReceivingPushArchivesService.java +++ b/com/engine/custom/archives/service/ReceivingPushArchivesService.java @@ -2,18 +2,15 @@ package com.engine.custom.archives.service; import com.dcfs.fts.common.error.FtpException; +import com.engine.custom.archives.entity.PushArchivesBean; import com.engine.custom.archives.util.ArchivesUtil; import com.engine.custom.hg.util.HgUtils; -import com.icbc.api.internal.apache.http.impl.cookie.S; -import lombok.extern.slf4j.Slf4j; -import java.text.ParseException; import java.text.SimpleDateFormat; import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.util.Calendar; import java.util.Date; -import java.nio.charset.StandardCharsets; import java.io.*; import java.util.*; @@ -26,36 +23,13 @@ import weaver.general.Util; import com.alibaba.fastjson.JSONObject; import weaver.file.ImageFileManager; -import java.net.URL; - -import org.apache.commons.io.FileUtils; -import okhttp3.*; - -import java.net.URLEncoder; - +import weaver.hrm.company.DepartmentComInfo; import weaver.soa.workflow.request.RequestService; import weaver.soa.workflow.request.RequestInfo; -import com.engine.custom.archives.action.WorkflowToDocCus; -import weaver.docs.docs.DocRecycleManager; import weaver.hrm.User; -import com.api.workflow.service.RequestAuthenticationService; -import weaver.workflow.workflow.WorkflowConfigComInfo; -import weaver.hrm.resource.ResourceComInfo; -import weaver.crm.Maint.CustomerInfoComInfo; -import com.alibaba.fastjson.JSON; -import weaver.workflow.monitor.Monitor; -import com.engine.workflow.biz.RobotNode.RobotNodeServiceBiz; -import com.api.workflow.util.ServiceUtil; -import com.engine.workflow.biz.RobotNode.RobotNodeBiz; -import weaver.general.TimeUtil; -import org.apache.poi.xwpf.usermodel.XWPFDocument; -import cn.afterturn.easypoi.word.WordExportUtil; +import weaver.workflow.workflow.WorkflowBillComInfo; +import weaver.workflow.workflow.WorkflowComInfo; import cn.hutool.core.util.ZipUtil; -import freemarker.template.Configuration; -import freemarker.template.TemplateExceptionHandler; -import freemarker.template.Template; -import java.nio.charset.StandardCharsets; - public class ReceivingPushArchivesService { @@ -68,6 +42,13 @@ public class ReceivingPushArchivesService { private static final String zlcdir = "承办单" + File.separator + "子流程"; private static final String lzxxdir = "流转信息"; private static final String fjFile = "附件"; + private static final String lcfjWord = "流程附件"; + private static final String qzyjfjWord = "签字意见附件"; + private static final String xbbmfjWord = "协办部门附件"; + private static final String wjcldWord = "文件处理单"; + private static final String wjlzxxWord = "文件流转信息"; + private int endTime= 7; + public static Logger log = LoggerFactory.getLogger("Archives"); @@ -75,13 +56,13 @@ public class ReceivingPushArchivesService { filePath = Util.null2String(param.get("filePath")); Url = Util.null2String(param.get("Url")); templatePath = Util.null2String(param.get("templatePath")); + endTime = Util.getIntValue(param.get("endTime"),7); } public void pushArchives(Map param) { log.info("PushArchivesCorn====Begin========{}", param); try { - ZipUtil zipUtil = new ZipUtil(); Date date = ArchivesUtil.getDate(); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); @@ -92,23 +73,41 @@ public class ReceivingPushArchivesService { // 获取当前时间的最后一秒 String lastSecond = yyyyMMddHHmmss.format(getLastSecondOfDate(date)); - Integer requestid = Util.getIntValue(param.get("requestid")); - log.error("requestid:{}", requestid); - String context = extracted(requestid); - log.error("context:{}", context); + RecordSet recordSet = new RecordSet(); + List result = ArchivesUtil.getResultList(recordSet, firstSecond, lastSecond, 1); + log.error("推送收文的数量:{}", result.size()); File file = ArchivesUtil.crFile(filePath + "/togd_" + new SimpleDateFormat("yyyyMMdd000000").format(date)); log.error("textfile:{}", file.getAbsolutePath()); - ArchivesUtil.writeToTxt(file.getPath(), file.getName(), context, true); - File txtzip = new File(filePath + File.separator + "togd_" + new SimpleDateFormat("yyyyMMdd000000").format(date) + ".zip"); - log.error("textZipFile:{}", txtzip.getAbsolutePath()); - OutputStream outputStream = new FileOutputStream(txtzip); - File writename = new File(file.getPath() + "/" + file.getName() + ".txt"); - com.engine.custom.hg.util.ZipUtil.filesToZip(writename, outputStream, writename.getName()); - log.error("writename:{}",writename.getName()); - String s = HgUtils.putFile(txtzip.getAbsolutePath(), txtzip.getName()); - updateRecord(requestid, s); - log.error("textZip:{}", s); + for (PushArchivesBean pushArchivesBean : result) { + if (ArchivesUtil.isAfterSevenAM(endTime)){ + log.info("超过执行时间:{}点暂停计划任务",endTime); + break; + } + int requestid = pushArchivesBean.getRequest(); + try { + log.error("requestid:{}", requestid); + //1.生成文件及推送的txt + String context = extracted(requestid); + log.error("context:{}", context); + //1.生成文件及推送的txt + ArchivesUtil.writeToTxt(file.getPath(), file.getName(), context, true); + File txtzip = new File(filePath + File.separator + "togd_" + new SimpleDateFormat("yyyyMMdd000000").format(date) + ".zip"); + log.error("textZipFile:{}", txtzip.getAbsolutePath()); + OutputStream outputStream = new FileOutputStream(txtzip); + File writename = new File(file.getPath() + "/" + file.getName() + ".txt"); + com.engine.custom.hg.util.ZipUtil.filesToZip(writename, outputStream, writename.getName()); + log.error("writename:{}",writename.getName()); + String s = HgUtils.putFile(txtzip.getAbsolutePath(), txtzip.getName()); + // updateRecord(requestid, s); + updateRecord(requestid,"esbtxtml",s); + updateRecord(requestid,"zt","0"); + log.error("textZip:{}", s); + }catch (Exception e){ + e.printStackTrace(); + log.error("推送档案requestid:{}异常,异常原因为:{}",requestid,e.getMessage()); + } + } } catch (Exception e) { log.info("PushArchivesCorn====Exception========{}", e.getMessage()); e.printStackTrace(); @@ -123,17 +122,36 @@ public class ReceivingPushArchivesService { } private String extracted(int requestid) throws FtpException, IOException { + String newRequestid = "togd"+requestid; + RequestService requestService = new RequestService(); + RequestInfo requestInfo = requestService.getRequest(Util.getIntValue(requestid), 100); + String workflowid = requestInfo.getWorkflowid(); Map requesData = getRequestByid(requestid); log.info("requesData:{}", requesData); String fj = Util.null2String(requesData.get("fj")); String zwkbj = Util.null2String(requesData.get("zwkbj")); + String lczw = Util.null2String(requesData.get("lczw")); + String gwly = Util.null2String(requesData.get("gwly")); //增加签字意见中的附件到附件文件夹中 Map signFiles = ArchivesUtil.getSignFiles(requestid,true); List docids = new ArrayList<>(); // docids.addAll(Arrays.asList(fj.split(","))); // docids.addAll(Arrays.asList(zwkbj.split(","))); Map fjMap = ArchivesUtil.getFileIdByDocId(fj); - Map zwkbjMap = ArchivesUtil.getFileIdByDocId(zwkbj); + + // Map zwkbjMap = ArchivesUtil.getFileIdByDocId(zwkbj); + // Map lczwMap = ArchivesUtil.getFileIdByDocId(lczw); + Map lczwMap = new HashMap<>(); + //判断公文来源 + if ("0".equals(gwly)){ + lczwMap = ArchivesUtil.getFileIdByDocId(lczw); + }else { + lczwMap = ArchivesUtil.getFileIdByDocId(zwkbj); + } + + + + List zwFileName = new ArrayList<>(); List fjFileName = new ArrayList<>(); final int[] i = {1}; @@ -143,8 +161,8 @@ public class ReceivingPushArchivesService { imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); InputStream inputStream = imageFileManager.getInputStream(); //中文路径/中文文件名 - String imageFileName = filePath + File.separator + requestid + File.separator + fjdir + File.separator + imageFileManager.getImageFileName(); - fjFileName.add(imageFileManager.getImageFileName()); + String imageFileName = filePath + File.separator + newRequestid + File.separator + fjdir + File.separator + lcfjWord+ i[0] +"-" + (imageFileManager.getImageFileName().replaceAll("/","-")); + fjFileName.add(lcfjWord+ i[0] +"-" + imageFileManager.getImageFileName().replaceAll("/","-")); log.info("生成附件路径:{}", imageFileName); imageFileName = ArchivesUtil.codeUtf8(imageFileName); try { @@ -157,21 +175,30 @@ public class ReceivingPushArchivesService { JSONObject data = result.getJSONObject("data"); String destFileName = data.getString("destFileName"); String viewUrl = data.getString("viewUrl"); - ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + requestid + File.separator + fjdir + File.separator + imageFileManager.getImageFileName() + ".pdf"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + fjdir + File.separator + lcfjWord+ i[0] + "-" + (imageFileManager.getImageFileName().replaceAll("/","-")) + ".pdf"); } } catch (IOException e) { e.printStackTrace(); + }finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } } + i[0]++; }); - + i[0] = 1; //签字意见附件 signFiles.forEach((docid, imageid) -> { ImageFileManager imageFileManager = new ImageFileManager(); imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); InputStream inputStream = imageFileManager.getInputStream(); //中文路径/中文文件名 - String imageFileName = filePath + File.separator + requestid + File.separator + fjdir + File.separator + imageFileManager.getImageFileName(); - fjFileName.add(imageFileManager.getImageFileName()); + String imageFileName = filePath + File.separator + newRequestid + File.separator + fjdir + File.separator + qzyjfjWord + i[0] + "-" +imageFileManager.getImageFileName(); + fjFileName.add(qzyjfjWord + i[0] + "-" +imageFileManager.getImageFileName()); log.info("生成签字意见附件路径:{}", imageFileName); imageFileName = ArchivesUtil.codeUtf8(imageFileName); try { @@ -184,21 +211,107 @@ public class ReceivingPushArchivesService { JSONObject data = result.getJSONObject("data"); String destFileName = data.getString("destFileName"); String viewUrl = data.getString("viewUrl"); - ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + requestid + File.separator + fjdir + File.separator + imageFileManager.getImageFileName() + ".pdf"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + fjdir + File.separator + qzyjfjWord + i[0] + "-" + imageFileManager.getImageFileName() + ".pdf"); } + i[0]++; } catch (IOException e) { e.printStackTrace(); + }finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } } + }); + i[0] = 1; + Map coReqFile = getCoReqFile(requestid, workflowid); + //协办要求 + coReqFile.forEach((docid, imageid) -> { + ImageFileManager imageFileManager = new ImageFileManager(); + imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + InputStream inputStream = imageFileManager.getInputStream(); + zwFileName.add(xbbmfjWord+ i[0] +"-"+ imageFileManager.getImageFileName()); + //中文路径/中文文件名 + String imageFileName = filePath + File.separator + newRequestid + File.separator + fjdir + File.separator +xbbmfjWord+ i[0] +"-"+ imageFileManager.getImageFileName(); + log.info("生成协办部门路径:{}", imageFileName); + imageFileName = ArchivesUtil.codeUtf8(imageFileName); + try { + File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + String jsonStr = ArchivesUtil.callApi(Url, file); + log.error("永中接口返回:{}", jsonStr); + JSONObject result = JSONObject.parseObject(jsonStr); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + fjdir + File.separator+xbbmfjWord+ i[0] +"-" + imageFileManager.getImageFileName() + ".pdf"); + } + i[0]++; + } catch (IOException e) { + e.printStackTrace(); + }finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + }); + + // i[0] = 1; + // //正文 + // zwkbjMap.forEach((docid, imageid) -> { + // ImageFileManager imageFileManager = new ImageFileManager(); + // imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + // InputStream inputStream = imageFileManager.getInputStream(); + // zwFileName.add(imageFileManager.getImageFileName()); + // //中文路径/中文文件名 + // String imageFileName = filePath + File.separator + newRequestid + File.separator + zwdir + File.separator + imageFileManager.getImageFileName(); + // log.info("生成正文路径:{}", imageFileName); + // imageFileName = ArchivesUtil.codeUtf8(imageFileName); + // try { + // File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + // String jsonStr = ArchivesUtil.callApi(Url, file); + // log.error("永中接口返回:{}", jsonStr); + // JSONObject result = JSONObject.parseObject(jsonStr); + // String errorcode = result.getString("errorcode"); + // if ("0".equals(errorcode)) { + // JSONObject data = result.getJSONObject("data"); + // String destFileName = data.getString("destFileName"); + // String viewUrl = data.getString("viewUrl"); + // ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + zwdir + File.separator + imageFileManager.getImageFileName() + ".pdf"); + // } + // + // } catch (IOException e) { + // e.printStackTrace(); + // }finally { + // if(inputStream!=null) { + // try { + // inputStream.close(); + // } catch (IOException e) { + // e.printStackTrace(); + // } + // } + // } + // }); + + i[0] = 1; //正文 - zwkbjMap.forEach((docid, imageid) -> { + lczwMap.forEach((docid, imageid) -> { ImageFileManager imageFileManager = new ImageFileManager(); imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); InputStream inputStream = imageFileManager.getInputStream(); zwFileName.add(imageFileManager.getImageFileName()); //中文路径/中文文件名 - String imageFileName = filePath + File.separator + requestid + File.separator + zwdir + File.separator + imageFileManager.getImageFileName(); + String imageFileName = filePath + File.separator + newRequestid + File.separator + zwdir + File.separator + (imageFileManager.getImageFileName().replaceAll("/","-")); log.info("生成正文路径:{}", imageFileName); imageFileName = ArchivesUtil.codeUtf8(imageFileName); try { @@ -211,10 +324,19 @@ public class ReceivingPushArchivesService { JSONObject data = result.getJSONObject("data"); String destFileName = data.getString("destFileName"); String viewUrl = data.getString("viewUrl"); - ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + requestid + File.separator + zwdir + File.separator + imageFileManager.getImageFileName() + ".pdf"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + zwdir + File.separator + (imageFileManager.getImageFileName().replaceAll("/","-")) + ".pdf"); } + } catch (IOException e) { e.printStackTrace(); + }finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } } }); //开始承办单 先获取主流程的承办单 @@ -229,13 +351,15 @@ public class ReceivingPushArchivesService { docids.addAll(requestDocid); // 3.去掉生成子流程承办单 // docids.addAll(subRequestDocid); - //附件 + //承办单 reqDocMap.forEach((docid, imageid) -> { ImageFileManager imageFileManager = new ImageFileManager(); imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); InputStream inputStream = imageFileManager.getInputStream(); //中文路径/中文文件名 - String imageFileName = filePath + File.separator + requestid + File.separator + cbddir + File.separator + fjFile + i[0] + "_" + imageFileManager.getImageFileName(); + // String imageFileName = filePath + File.separator + requestid + File.separator + cbddir + File.separator + fjFile + i[0] + "_" + imageFileManager.getImageFileName(); + String imageFileName = filePath + File.separator + newRequestid + File.separator + cbddir + File.separator + wjcldWord+".pdf"; + log.info("主流程承办单路径:{}", imageFileName); imageFileName = ArchivesUtil.codeUtf8(imageFileName); try { @@ -248,11 +372,19 @@ public class ReceivingPushArchivesService { JSONObject data = result.getJSONObject("data"); String destFileName = data.getString("destFileName"); String viewUrl = data.getString("viewUrl"); - ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + requestid + File.separator + cbddir + File.separator + fjFile + i[0] + "_" + imageFileManager.getImageFileName() + ".pdf"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + cbddir + File.separator + wjcldWord + ".pdf" + ".pdf"); } i[0]++; } catch (IOException e) { e.printStackTrace(); + }finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } } }); //正文 @@ -291,10 +423,9 @@ public class ReceivingPushArchivesService { ArchivesUtil.deleteDocByid(docid); } //-------------------------------------------------------------------- - RequestService requestService = new RequestService(); - RequestInfo requestInfo = requestService.getRequest(Util.getIntValue(requestid), 100); - String logFile = ArchivesUtil.getSignLog(requestid, cbddir+File.separator+lzxxdir, requestInfo.getCreatorid() + requestInfo.getDescription(),templatePath,filePath,true); + + String logFile = ArchivesUtil.getSignLog(requestid, cbddir+File.separator+lzxxdir, requestInfo.getCreatorid() + requestInfo.getDescription(),templatePath,filePath,true,workflowid); String s = ArchivesUtil.callApi(Url, new File(logFile)); log.error(s); JSONObject result = JSONObject.parseObject(s); @@ -305,16 +436,19 @@ public class ReceivingPushArchivesService { String viewUrl = data.getString("viewUrl"); ArchivesUtil.downloadFile(viewUrl, logFile + ".pdf"); } - String zipName = filePath + File.separator + requestid + ".zip"; - ZipUtil.zip(filePath + File.separator + requestid, zipName); + String zipName = filePath + File.separator + newRequestid + ".zip"; + ZipUtil.zip(filePath + File.separator + newRequestid, zipName); log.error("zipName:{}", zipName); - String ftpFilePath = HgUtils.putFile(zipName, requestid + ".zip"); + String ftpFilePath = HgUtils.putFile(zipName, newRequestid + ".zip"); + ArchivesUtil.deleteDirectory(filePath + File.separator + newRequestid); + updateRecord(requestid,"esbwjml",ftpFilePath); log.error("ftpFilePath:{}", ftpFilePath); - String ftpFilePathNew = HgUtils.putFile(zipName, "test" + File.separator + requestid + ".zip"); - log.error("ftpFilePathNew:{}", ftpFilePathNew); - String context = getContext(requestid, requesData, requestid + ".zip", zwFileName, fjFileName); - insertRecord(requestid, context, ftpFilePath); + // String ftpFilePathNew = HgUtils.putFile(zipName, "test" + File.separator + newRequestid + ".zip"); + // log.error("ftpFilePathNew:{}", ftpFilePathNew); + String context = getContext(requestid, requesData, newRequestid + ".zip", zwFileName, fjFileName); + // insertRecord(requestid, context, ftpFilePath); log.error("context:{}", context); + updateRecord(requestid,"content",context); return context; } @@ -392,6 +526,9 @@ public class ReceivingPushArchivesService { record.put("yffbm", Util.null2String(rs.getString("yffbm"))); record.put("ffbmb", Util.null2String(rs.getString("ffbmb"))); record.put("yffbm", Util.null2String(rs.getString("yffbm"))); + record.put("lczw", Util.null2String(rs.getString("lczw"))); + record.put("gwly", Util.null2String(rs.getString("gwly"))); + record.put("lwdwsx", Util.null2String(rs.getString("lwdwsx"))); } rs.executeQuery(reqsql, requestid); if (rs.next()) { @@ -405,18 +542,19 @@ public class ReceivingPushArchivesService { StringBuilder context = new StringBuilder(); try { - String swrq = Util.null2String(requesData.get("swrq")); + String swrq = Util.null2String(requesData.get("lwrq")); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); LocalDate date = LocalDate.parse(swrq, formatter); int year = date.getYear(); context.append(year).append("|"); String jghwt = Util.null2String(requesData.get("jghwt")); context.append(jghwt).append("|"); - String swh = Util.null2String(requesData.get("swh")); + // String swh = Util.null2String(requesData.get("swh")); + String swh = Util.null2String(requesData.get("lwh")); context.append(swh).append("|"); String requestname = Util.null2String(requesData.get("REQUESTNAME")); context.append(requestname).append("|"); - String lwdwmc = Util.null2String(requesData.get("lwdwmc")); //5 责任者 -> 来文单位 + String lwdwmc = Util.null2String(requesData.get("lwdwsx")); //5 责任者 -> 来文单位 context.append(lwdwmc).append("|"); String bgqx = Util.null2String(requesData.get("bgqx")); //6 保管期限 -> 保管期限 context.append(bgqx).append("|"); @@ -428,8 +566,10 @@ public class ReceivingPushArchivesService { context.append(wz).append("|"); String ngbm = Util.null2String(requesData.get("ngbm")); String[] deptData = ArchivesUtil.getDeptNameAndCode(ngbm); - context.append(deptData[0]).append("|"); //10 行编号 -> 拟稿部门 - context.append(deptData[1]).append("|"); //11 行名称 + String[] subData = ArchivesUtil.getSubCom(ngbm); + context.append("D10001").append("|"); //10 行编号 -> 拟稿部门 + + context.append("总行机关").append("|"); //11 行名称 context.append("").append("|"); // 12 保管期限编号 context.append("").append("|"); // 13 保管期限及编号 context.append("").append("|"); // 14 是否开放 @@ -439,7 +579,8 @@ public class ReceivingPushArchivesService { //TODO String xgbm = Util.null2String(getAssociatedDepts(requesData)); context.append(xgbm).append("|"); //17 相关部门 -> 流经部门 - String lwh = Util.null2String(requesData.get("lwh"));// 18 收文号 -> 来文文号 + // String lwh = Util.null2String(requesData.get("lwh"));// 18 收文号 -> 来文文号 + String lwh = Util.null2String(requesData.get("swh"));// 18 收文号 -> 来文文号 context.append(lwh).append("|"); String fs = ""; context.append(fs).append("|"); // 19 份数 -> 份数 @@ -463,7 +604,7 @@ public class ReceivingPushArchivesService { context.append(year).append("|"); // 30 形成年度 -> 年份 context.append(String.join("&&", zwFileName)).append("|"); // 31 正文名称 context.append(String.join("&&", fjFileName)).append("|"); // 32 附件名称 - context.append(requestid).append("|"); // 33 主键 + context.append("togd"+requestid).append("|"); // 33 主键 context.append("").append("|"); // 34 关联主键 context.append("").append("|"); // 35 被关联主键 context.append(zipName);// 36 压缩包名称 @@ -482,7 +623,88 @@ public class ReceivingPushArchivesService { records.addAll(Arrays.asList(Util.null2String(requesData.get("yffbm")).split(","))); records.addAll(Arrays.asList(Util.null2String(requesData.get("ffbmb")).split(","))); records.addAll(Arrays.asList(Util.null2String(requesData.get("zfbm")).split(","))); - return String.join("&&", records); + ArrayList deptName = new ArrayList<>(); + DepartmentComInfo departmentComInfo = new DepartmentComInfo(); + for (String record : records) { + try { + if (StringUtil.isEmpty(record)){ + continue; + } + String departmentName = departmentComInfo.getDepartmentmark(record); + deptName.add(departmentName); + } catch (Exception e) { + e.printStackTrace(); + } + } + + return String.join("&&", deptName); + } + + private Map getCoReqFile(int requestid , String workflowid){ + try { + RecordSet rs = new RecordSet(); + rs.executeQuery("select * from uf_ArchivesSet where mainwfid = ?",workflowid); + boolean isCo = false; + String cowfid = ""; + String cofield = ""; + String cofieldid = ""; + if (rs.next()){ + cowfid = Util.null2String(rs.getString("cowfid")); + if (!StringUtils.isBlank(cowfid)){ + isCo = true; + cofield = Util.null2String(rs.getString("cofield")); + cofieldid = Util.null2String(rs.getString("cofieldid")); + } + } + log.info("isCo:{};cowfid:{};cofield:{};cofieldid:{}",isCo,cowfid,cofield,cofieldid); + + + if(isCo){ + ArrayList CoSubRequest = new ArrayList<>(); + Map subRequest = ArchivesUtil.getSubRequest(Util.null2String(requestid) , 6); + log.info("subRequest:{}",subRequest); + for (Map.Entry subRequestEntry : subRequest.entrySet()) { + String subWFid = subRequestEntry.getValue(); + if (cowfid.equals(subWFid)){ + CoSubRequest.add(subRequestEntry.getKey()); + } + } + log.info("CoSubRequest.size:{}",CoSubRequest.size()); + if (CoSubRequest.size() == 0){ + return new HashMap<>(); + } + WorkflowComInfo wf = new WorkflowComInfo(); + WorkflowBillComInfo wcInfo = new WorkflowBillComInfo(); + String formId = wf.getFormId(cowfid); + String tablename = wcInfo.getTablename(formId); + String cosql = "select "+cofield+" from " + tablename + " where " + + " requestid in ( " + String.join(",",CoSubRequest) + " ) " + + " order by requestid asc "; + log.info("cosql:{}",cosql); + + rs.executeQuery(cosql); + log.info("rs.getExceptionMsg():{}",rs.getExceptionMsg()); + String fieldValue = ""; + String[] cofieldsplit = cofield.split(","); + String coFile = cofieldsplit[2]; //协办部门 + ArrayList docids = new ArrayList<>(); + while (rs.next()){ + String coFileValue = rs.getString(coFile); + docids.addAll(Arrays.asList(coFileValue.split(","))); + } + log.info("fieldValue:{}",fieldValue); + return ArchivesUtil.getFileIdByDocId(String.join(",",docids)); + } + return new HashMap<>(); + }catch (Exception e){ + log.error("getCoReqFile:[}",e.getMessage()); + return new HashMap<>(); + } } + private void updateRecord(int requestid, String field , String fieldvalue) { + String sql = "update uf_pushArchivesLog set "+field+" = ? where request = ?"; + RecordSet recordSet = new RecordSet(); + recordSet.executeUpdate(sql, fieldvalue, requestid); + } } diff --git a/com/engine/custom/archives/service/SendingPushArchivesService.java b/com/engine/custom/archives/service/SendingPushArchivesService.java index 34f7c80..473a5c2 100644 --- a/com/engine/custom/archives/service/SendingPushArchivesService.java +++ b/com/engine/custom/archives/service/SendingPushArchivesService.java @@ -33,6 +33,7 @@ public class SendingPushArchivesService { private static String filePath; private static String Url; private static String templatePath; // 模板文件路径 + private int endTime= 7; private static final String zwdir = "正文"; private static final String fjdir = "附件"; private static final String cbddir = "承办单"; @@ -51,6 +52,7 @@ public class SendingPushArchivesService { filePath = Util.null2String(param.get("filePath")); Url = Util.null2String(param.get("Url")); templatePath = Util.null2String(param.get("templatePath")); + endTime = Util.getIntValue(param.get("endTime"),7); } public void pushArchives(Map param) { @@ -69,11 +71,18 @@ public class SendingPushArchivesService { File file = ArchivesUtil.crFile(filePath + "/togd_" + new SimpleDateFormat("yyyyMMdd000000").format(date)); log.error("textfile:{}", file.getAbsolutePath()); for (PushArchivesBean pushArchivesBean : result) { - int id = pushArchivesBean.getId(); + if (ArchivesUtil.isAfterSevenAM(endTime)){ + log.info("超过执行时间:{}点暂停计划任务",endTime); + break; + } + // int id = pushArchivesBean.getId(); int request = pushArchivesBean.getRequest(); log.error("推送的requestId:{}", request); try { String context = generateFile(request); + if ("-1".equals(context)){ + continue; + } ArchivesUtil.writeToTxt(file.getPath(), file.getName(), context, true); File txtzip = new File(filePath + File.separator + "togd_" + new SimpleDateFormat("yyyyMMdd000000").format(date) + ".zip"); log.error("textZipFile:{}", txtzip.getAbsolutePath()); @@ -82,12 +91,18 @@ public class SendingPushArchivesService { com.engine.custom.hg.util.ZipUtil.filesToZip(writename, outputStream, writename.getName()); log.error("writename:{}", writename.getName()); String s = HgUtils.putFile(txtzip.getAbsolutePath(), txtzip.getName()); - updateRecord(request, s); + updateRecord(request,"esbtxtml",s); + updateRecord(request,"zt","0"); log.error("textZip:{}", s); } catch (FtpException e) { e.printStackTrace(); + log.error("推送档案requestid:{}异常,异常原因为:{}",request,e.getMessage()); } catch (IOException e) { e.printStackTrace(); + log.error("推送档案requestid:{}异常,异常原因为:{}",request,e.getMessage()); + } catch (Exception e){ + e.printStackTrace(); + log.error("推送档案requestid:{}异常,异常原因为:{}",request,e.getMessage()); } } @@ -96,7 +111,12 @@ public class SendingPushArchivesService { private String generateFile(int requestid) throws FtpException, IOException { Map requesData = getRequestByid(requestid); + String newRequestid = "togd"+requestid; log.info("requesData:{}", requesData); + String bh = requesData.get("bh"); + if (StringUtil.isEmpty(bh)){ + return "-1"; + } String fj = Util.null2String(requesData.get("fj")); String dwd = Util.null2String(requesData.get("dwd")); String zw = Util.null2String(requesData.get("zw")); @@ -123,8 +143,8 @@ public class SendingPushArchivesService { imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); InputStream inputStream = imageFileManager.getInputStream(); //中文路径/中文文件名 - String imageFileName = filePath + File.separator + requestid + File.separator + fjdir + File.separator + lcfjWord + "-" +imageFileManager.getImageFileName(); - fjFileName.add(imageFileManager.getImageFileName()); + String imageFileName = filePath + File.separator + newRequestid + File.separator + fjdir + File.separator + lcfjWord + "-" +imageFileManager.getImageFileName(); + fjFileName.add(lcfjWord + "-" +imageFileManager.getImageFileName()); log.info("生成附件路径:{}", imageFileName); imageFileName = ArchivesUtil.codeUtf8(imageFileName); try { @@ -137,10 +157,18 @@ public class SendingPushArchivesService { JSONObject data = result.getJSONObject("data"); String destFileName = data.getString("destFileName"); String viewUrl = data.getString("viewUrl"); - ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + requestid + File.separator + fjdir + File.separator + lcfjWord + "-" + imageFileManager.getImageFileName() + ".pdf"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + fjdir + File.separator + lcfjWord + "-" + imageFileManager.getImageFileName() + ".pdf"); } } catch (IOException e) { e.printStackTrace(); + }finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } } }); @@ -150,8 +178,8 @@ public class SendingPushArchivesService { imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); InputStream inputStream = imageFileManager.getInputStream(); //中文路径/中文文件名 - String imageFileName = filePath + File.separator + requestid + File.separator + fjdir + File.separator + qzyjfjWord+ "-" +imageFileManager.getImageFileName(); - fjFileName.add(imageFileManager.getImageFileName()); + String imageFileName = filePath + File.separator + newRequestid + File.separator + fjdir + File.separator + qzyjfjWord+ "-" +imageFileManager.getImageFileName(); + fjFileName.add(qzyjfjWord+ "-" +imageFileManager.getImageFileName()); log.info("生成签字意见附件路径:{}", imageFileName); imageFileName = ArchivesUtil.codeUtf8(imageFileName); try { @@ -164,10 +192,18 @@ public class SendingPushArchivesService { JSONObject data = result.getJSONObject("data"); String destFileName = data.getString("destFileName"); String viewUrl = data.getString("viewUrl"); - ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + requestid + File.separator + fjdir + File.separator + qzyjfjWord+ "-" + imageFileManager.getImageFileName() + ".pdf"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + fjdir + File.separator + qzyjfjWord+ "-" + imageFileManager.getImageFileName() + ".pdf"); } } catch (IOException e) { e.printStackTrace(); + }finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } } }); @@ -204,9 +240,9 @@ public class SendingPushArchivesService { imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); InputStream inputStream = imageFileManager.getInputStream(); - String newFile = fjWord + i[0] + "_" + zwWord + "-" + imageFileManager.getImageFileName(); + String newFile = fjWord + i[0] + "_" + zwWord + "-" + (imageFileManager.getImageFileName().replaceAll("/","-")); //中文路径/中文文件名 - String imageFileName = filePath + File.separator + requestid + File.separator + zwdir + File.separator + newFile; + String imageFileName = filePath + File.separator + newRequestid + File.separator + zwdir + File.separator + newFile; zwFileName.add(newFile); log.info("生成正文路径:{}", imageFileName); imageFileName = ArchivesUtil.codeUtf8(imageFileName); @@ -220,10 +256,18 @@ public class SendingPushArchivesService { JSONObject data = result.getJSONObject("data"); String destFileName = data.getString("destFileName"); String viewUrl = data.getString("viewUrl"); - ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + requestid + File.separator + zwdir + File.separator + newFile + ".pdf"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + zwdir + File.separator + newFile + ".pdf"); } } catch (IOException e) { e.printStackTrace(); + }finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } } i[0]++; }); @@ -233,10 +277,10 @@ public class SendingPushArchivesService { imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); InputStream inputStream = imageFileManager.getInputStream(); - String newFile = fjWord + i[0] + "_" + lhgWord + "-" + imageFileManager.getImageFileName(); + String newFile = fjWord + i[0] + "_" + lhgWord + "-" + (imageFileManager.getImageFileName().replaceAll("/","-")); zwFileName.add(newFile); //中文路径/中文文件名 - String imageFileName = filePath + File.separator + requestid + File.separator + zwdir + File.separator + newFile; + String imageFileName = filePath + File.separator + newRequestid + File.separator + zwdir + File.separator + newFile; log.info("生成清稿前痕迹路径:{}", imageFileName); imageFileName = ArchivesUtil.codeUtf8(imageFileName); try { @@ -249,10 +293,18 @@ public class SendingPushArchivesService { JSONObject data = result.getJSONObject("data"); String destFileName = data.getString("destFileName"); String viewUrl = data.getString("viewUrl"); - ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + requestid + File.separator + zwdir + File.separator + newFile + ".pdf"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + zwdir + File.separator + newFile + ".pdf"); } } catch (IOException e) { e.printStackTrace(); + }finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } } i[0]++; }); @@ -304,7 +356,8 @@ public class SendingPushArchivesService { InputStream inputStream = imageFileManager.getInputStream(); //中文路径/中文文件名 // String imageFileName = filePath + File.separator + requestid + File.separator + cbddir + File.separator + fjFile + i[0] + "_" + imageFileManager.getImageFileName(); - String imageFileName = filePath + File.separator + requestid + File.separator + cbddir + File.separator + fjFile + i[0] + "_" + wjcldWord+".pdf"; + // String imageFileName = filePath + File.separator + newRequestid + File.separator + cbddir + File.separator + fjFile + i[0] + "_" + wjcldWord+".pdf"; + String imageFileName = filePath + File.separator + newRequestid + File.separator + cbddir + File.separator + wjcldWord+".pdf"; log.info("主流程承办单路径:{}", imageFileName); imageFileName = ArchivesUtil.codeUtf8(imageFileName); try { @@ -317,11 +370,19 @@ public class SendingPushArchivesService { JSONObject data = result.getJSONObject("data"); String destFileName = data.getString("destFileName"); String viewUrl = data.getString("viewUrl"); - ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + requestid + File.separator + cbddir + File.separator + fjFile + i[0] + "_" + wjcldWord + ".pdf" + ".pdf"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + cbddir + File.separator + wjcldWord + ".pdf" + ".pdf"); } i[0]++; } catch (IOException e) { e.printStackTrace(); + }finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } } }); //正文 @@ -347,15 +408,18 @@ public class SendingPushArchivesService { String viewUrl = data.getString("viewUrl"); ArchivesUtil.downloadFile(viewUrl, logFile + ".pdf"); } - String zipName = filePath + File.separator + requestid + ".zip"; - ZipUtil.zip(filePath + File.separator + requestid, zipName); + String zipName = filePath + File.separator + newRequestid + ".zip"; + ZipUtil.zip(filePath + File.separator + newRequestid, zipName); log.error("zipName:{}", zipName); - String ftpFilePath = HgUtils.putFile(zipName, requestid + ".zip"); + String ftpFilePath = HgUtils.putFile(zipName, newRequestid + ".zip"); log.error("ftpFilePath:{}", ftpFilePath); + updateRecord(requestid,"esbwjml",ftpFilePath); + ArchivesUtil.deleteDirectory(filePath + File.separator + newRequestid); // String ftpFilePathNew = HgUtils.putFile(zipName, "test" + File.separator + requestid + ".zip"); // log.error("ftpFilePathNew:{}", ftpFilePathNew); - String context = getContext(requestid, requesData, requestid + ".zip", zwFileName, fjFileName); + String context = getContext(requestid, requesData, newRequestid + ".zip", zwFileName, fjFileName); // insertRecord(requestid, context, ftpFilePath); + updateRecord(requestid,"content",context); log.error("context:{}", context); return context; } @@ -430,8 +494,10 @@ public class SendingPushArchivesService { context.append(wz).append("|"); String ngbm = Util.null2String(requesData.get("ngbm")); String[] deptData = ArchivesUtil.getDeptNameAndCode(ngbm); - context.append(deptData[0]).append("|"); //10 行编号 -> 拟稿部门 - context.append(deptData[1]).append("|"); //11 行名称 + String[] subData = ArchivesUtil.getSubCom(ngbm); + context.append("D10001").append("|"); //10 行编号 -> 拟稿部门 + + context.append("总行机关").append("|"); //11 行名称 context.append("").append("|"); // 12 保管期限编号 context.append("").append("|"); // 13 保管期限及编号 context.append("").append("|"); // 14 是否开放 @@ -465,7 +531,7 @@ public class SendingPushArchivesService { context.append(year).append("|"); // 30 形成年度 -> 年份 context.append(String.join("&&", zwFileName)).append("|"); // 31 正文名称 context.append(String.join("&&", fjFileName)).append("|"); // 32 附件名称 - context.append(requestid).append("|"); // 33 主键 + context.append("togd"+requestid).append("|"); // 33 主键 context.append("").append("|"); // 34 关联主键 context.append("").append("|"); // 35 被关联主键 context.append(zipName);// 36 压缩包名称 @@ -478,6 +544,8 @@ public class SendingPushArchivesService { } + + private String getAssociatedDepts(Map requesData) { HashSet records = new HashSet<>(); records.addAll(Arrays.asList(Util.null2String(requesData.get("hqbm")).split(","))); // 会签部门 @@ -494,7 +562,10 @@ public class SendingPushArchivesService { DepartmentComInfo departmentComInfo = new DepartmentComInfo(); for (String record : records) { try { - String departmentName = departmentComInfo.getDepartmentName(record); + if (StringUtil.isEmpty(record)){ + continue; + } + String departmentName = departmentComInfo.getDepartmentmark(record); deptName.add(departmentName); } catch (Exception e) { e.printStackTrace(); @@ -504,10 +575,10 @@ public class SendingPushArchivesService { return String.join("&&", deptName); } - private void updateRecord(int requestid, String s) { - String sql = "update uf_pushArchivesLog set esbtxtml = ? where request = ?"; + private void updateRecord(int requestid, String field , String fieldvalue) { + String sql = "update uf_pushArchivesLog set "+field+" = ? where request = ?"; RecordSet recordSet = new RecordSet(); - recordSet.executeUpdate(sql, s, requestid); + recordSet.executeUpdate(sql, fieldvalue, requestid); } diff --git a/com/engine/custom/archives/service/SignReportPushArchivesService.java b/com/engine/custom/archives/service/SignReportPushArchivesService.java index 107f6a3..a0235a4 100644 --- a/com/engine/custom/archives/service/SignReportPushArchivesService.java +++ b/com/engine/custom/archives/service/SignReportPushArchivesService.java @@ -10,6 +10,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import weaver.conn.RecordSet; import weaver.file.ImageFileManager; +import weaver.general.StringUtil; import weaver.general.Util; import weaver.hrm.User; import weaver.hrm.company.DepartmentComInfo; @@ -40,11 +41,13 @@ public class SignReportPushArchivesService { private static final String qzyjfjWord = "签字意见附件"; private static final String wjcldWord = "文件处理单"; private static final String wjlzxxWord = "文件流转信息"; + private int endTime= 7; public void setProp(Map param) { filePath = Util.null2String(param.get("filePath")); Url = Util.null2String(param.get("Url")); templatePath = Util.null2String(param.get("templatePath")); + endTime = Util.getIntValue(param.get("endTime"),7); } public void pushArchives(Map param) { @@ -63,11 +66,18 @@ public class SignReportPushArchivesService { File file = ArchivesUtil.crFile(filePath + "/togd_" + new SimpleDateFormat("yyyyMMdd000000").format(date)); log.error("textfile:{}", file.getAbsolutePath()); for (PushArchivesBean pushArchivesBean : result) { + if (ArchivesUtil.isAfterSevenAM(endTime)){ + log.info("超过执行时间:{}点暂停计划任务",endTime); + break; + } int id = pushArchivesBean.getId(); int request = pushArchivesBean.getRequest(); log.error("推送的requestId:{}", request); try { String context = generateFile(request); + if ("-1".equals(context)){ + continue; + } ArchivesUtil.writeToTxt(file.getPath(), file.getName(), context, true); File txtzip = new File(filePath + File.separator + "togd_" + new SimpleDateFormat("yyyyMMdd000000").format(date) + ".zip"); log.error("textZipFile:{}", txtzip.getAbsolutePath()); @@ -77,10 +87,18 @@ public class SignReportPushArchivesService { log.error("writename:{}", writename.getName()); String s = HgUtils.putFile(txtzip.getAbsolutePath(), txtzip.getName()); // updateRecord(request, s); + updateRecord(request,"esbtxtml",s); + updateRecord(request,"zt","0"); log.error("textZip:{}", s); } catch (FtpException e) { + log.error("推送档案requestid:{}异常,异常原因为:{}",request,e.getMessage()); e.printStackTrace(); } catch (IOException e) { + log.error("推送档案requestid:{}异常,异常原因为:{}",request,e.getMessage()); + e.printStackTrace(); + } catch (Exception e) { + log.error("推送档案requestid:{}异常,异常原因为:{}",request,e.getMessage()); + e.printStackTrace(); } } @@ -90,11 +108,19 @@ public class SignReportPushArchivesService { private String generateFile(int requestid) throws FtpException, IOException { Map requesData = getRequestByid(requestid); + String newRequestid = "togd"+requestid; log.info("requesData:{}", requesData); + String bhnew = requesData.get("bhnew"); + log.info("流程id:{}:文号为空不推送", requestid); + if (StringUtil.isEmpty(bhnew)){ + return "-1"; + } String fj = Util.null2String(requesData.get("fj")); String dwd = Util.null2String(requesData.get("dwd")); String zw = Util.null2String(requesData.get("zw")); String qgqhj = Util.null2String(requesData.get("qgqhj")); + //可能有多个,获取id最大的一个 + qgqhj = Util.null2String(ArchivesUtil.findMaxValue(qgqhj)); //增加签字意见中的附件到附件文件夹中 Map signFiles = ArchivesUtil.getSignFiles(requestid,true); @@ -113,7 +139,7 @@ public class SignReportPushArchivesService { imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); InputStream inputStream = imageFileManager.getInputStream(); //中文路径/中文文件名 - String imageFileName = filePath + File.separator + requestid + File.separator + fjdir + File.separator + lcfjWord + "-" +imageFileManager.getImageFileName(); + String imageFileName = filePath + File.separator + newRequestid + File.separator + fjdir + File.separator + lcfjWord + "-" +imageFileManager.getImageFileName(); fjFileName.add(imageFileManager.getImageFileName()); log.info("生成附件路径:{}", imageFileName); imageFileName = ArchivesUtil.codeUtf8(imageFileName); @@ -127,10 +153,18 @@ public class SignReportPushArchivesService { JSONObject data = result.getJSONObject("data"); String destFileName = data.getString("destFileName"); String viewUrl = data.getString("viewUrl"); - ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + requestid + File.separator + fjdir + File.separator + lcfjWord + "-" + imageFileManager.getImageFileName() + ".pdf"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + fjdir + File.separator + lcfjWord + "-" + imageFileManager.getImageFileName() + ".pdf"); } } catch (IOException e) { e.printStackTrace(); + } finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } } }); @@ -140,7 +174,7 @@ public class SignReportPushArchivesService { imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); InputStream inputStream = imageFileManager.getInputStream(); //中文路径/中文文件名 - String imageFileName = filePath + File.separator + requestid + File.separator + fjdir + File.separator + qzyjfjWord+ "-" +imageFileManager.getImageFileName(); + String imageFileName = filePath + File.separator + newRequestid + File.separator + fjdir + File.separator + qzyjfjWord+ "-" +imageFileManager.getImageFileName(); fjFileName.add(imageFileManager.getImageFileName()); log.info("生成签字意见附件路径:{}", imageFileName); imageFileName = ArchivesUtil.codeUtf8(imageFileName); @@ -154,10 +188,18 @@ public class SignReportPushArchivesService { JSONObject data = result.getJSONObject("data"); String destFileName = data.getString("destFileName"); String viewUrl = data.getString("viewUrl"); - ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + requestid + File.separator + fjdir + File.separator + qzyjfjWord+ "-" + imageFileManager.getImageFileName() + ".pdf"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + fjdir + File.separator + qzyjfjWord+ "-" + imageFileManager.getImageFileName() + ".pdf"); } } catch (IOException e) { e.printStackTrace(); + } finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } } }); @@ -168,9 +210,9 @@ public class SignReportPushArchivesService { imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); InputStream inputStream = imageFileManager.getInputStream(); - String newFile = fjWord + i[0] + "_" + zwWord + "-" + imageFileManager.getImageFileName(); + String newFile = fjWord + i[0] + "_" + zwWord + "-" + (imageFileManager.getImageFileName().replaceAll("/","-")); //中文路径/中文文件名 - String imageFileName = filePath + File.separator + requestid + File.separator + zwdir + File.separator + newFile; + String imageFileName = filePath + File.separator + newRequestid + File.separator + zwdir + File.separator + newFile; zwFileName.add(newFile); log.info("生成正文路径:{}", imageFileName); imageFileName = ArchivesUtil.codeUtf8(imageFileName); @@ -184,10 +226,18 @@ public class SignReportPushArchivesService { JSONObject data = result.getJSONObject("data"); String destFileName = data.getString("destFileName"); String viewUrl = data.getString("viewUrl"); - ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + requestid + File.separator + zwdir + File.separator + newFile + ".pdf"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + zwdir + File.separator + newFile + ".pdf"); } } catch (IOException e) { e.printStackTrace(); + } finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } } i[0]++; }); @@ -197,10 +247,10 @@ public class SignReportPushArchivesService { imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); InputStream inputStream = imageFileManager.getInputStream(); - String newFile = fjWord + i[0] + "_" + lhgWord + "-" + imageFileManager.getImageFileName(); + String newFile = fjWord + i[0] + "_" + lhgWord + "-" + (imageFileManager.getImageFileName().replaceAll("/","-")); zwFileName.add(newFile); //中文路径/中文文件名 - String imageFileName = filePath + File.separator + requestid + File.separator + zwdir + File.separator + newFile; + String imageFileName = filePath + File.separator + newRequestid + File.separator + zwdir + File.separator + newFile; log.info("生成清稿前痕迹路径:{}", imageFileName); imageFileName = ArchivesUtil.codeUtf8(imageFileName); try { @@ -213,10 +263,18 @@ public class SignReportPushArchivesService { JSONObject data = result.getJSONObject("data"); String destFileName = data.getString("destFileName"); String viewUrl = data.getString("viewUrl"); - ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + requestid + File.separator + zwdir + File.separator + newFile + ".pdf"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + zwdir + File.separator + newFile + ".pdf"); } } catch (IOException e) { e.printStackTrace(); + } finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } } i[0]++; }); @@ -268,7 +326,8 @@ public class SignReportPushArchivesService { InputStream inputStream = imageFileManager.getInputStream(); //中文路径/中文文件名 // String imageFileName = filePath + File.separator + requestid + File.separator + cbddir + File.separator + fjFile + i[0] + "_" + imageFileManager.getImageFileName(); - String imageFileName = filePath + File.separator + requestid + File.separator + cbddir + File.separator + fjFile + i[0] + "_" + wjcldWord+".pdf"; + // String imageFileName = filePath + File.separator + newRequestid + File.separator + cbddir + File.separator + fjFile + i[0] + "_" + wjcldWord+".pdf"; + String imageFileName = filePath + File.separator + newRequestid + File.separator + cbddir + File.separator + wjcldWord+".pdf"; log.info("主流程承办单路径:{}", imageFileName); imageFileName = ArchivesUtil.codeUtf8(imageFileName); try { @@ -281,11 +340,20 @@ public class SignReportPushArchivesService { JSONObject data = result.getJSONObject("data"); String destFileName = data.getString("destFileName"); String viewUrl = data.getString("viewUrl"); - ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + requestid + File.separator + cbddir + File.separator + fjFile + i[0] + "_" + wjcldWord + ".pdf" + ".pdf"); + // ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + cbddir + File.separator + fjFile + i[0] + "_" + wjcldWord + ".pdf" + ".pdf"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + cbddir + File.separator + wjcldWord + ".pdf" + ".pdf"); } i[0]++; } catch (IOException e) { e.printStackTrace(); + }finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } } }); //正文 @@ -311,15 +379,19 @@ public class SignReportPushArchivesService { String viewUrl = data.getString("viewUrl"); ArchivesUtil.downloadFile(viewUrl, logFile + ".pdf"); } - String zipName = filePath + File.separator + requestid + ".zip"; - ZipUtil.zip(filePath + File.separator + requestid, zipName); + String zipName = filePath + File.separator + newRequestid + ".zip"; + ZipUtil.zip(filePath + File.separator + newRequestid, zipName); log.error("zipName:{}", zipName); - String ftpFilePath = HgUtils.putFile(zipName, requestid + ".zip"); + String ftpFilePath = HgUtils.putFile(zipName, newRequestid + ".zip"); log.error("ftpFilePath:{}", ftpFilePath); + updateRecord(requestid,"esbwjml",ftpFilePath); + ArchivesUtil.deleteDirectory(filePath + File.separator + newRequestid); + // String ftpFilePathNew = HgUtils.putFile(zipName, "test" + File.separator + requestid + ".zip"); // log.error("ftpFilePathNew:{}", ftpFilePathNew); - String context = getContext(requestid, requesData, requestid + ".zip", zwFileName, fjFileName); + String context = getContext(requestid, requesData, newRequestid + ".zip", zwFileName, fjFileName); // insertRecord(requestid, context, ftpFilePath); + updateRecord(requestid,"content",context); log.error("context:{}", context); return context; } @@ -338,7 +410,8 @@ public class SignReportPushArchivesService { rs.executeQuery(sql, requestid); if (rs.next()) { record.put("bh", Util.null2String(rs.getString("bh"))); - record.put("ngbm", Util.null2String(rs.getString("ngbm "))); + record.put("bhnew", Util.null2String(rs.getString("bhnew"))); + record.put("ngbm", Util.null2String(rs.getString("ngbm"))); record.put("ngr", Util.null2String(rs.getString("ngr"))); record.put("ngrq", Util.null2String(rs.getString("ngrq"))); record.put("lxfs", Util.null2String(rs.getString("lxfs"))); @@ -374,7 +447,7 @@ public class SignReportPushArchivesService { context.append(year).append("|"); //1.年度 -> 拟稿日期 String jghwt = Util.null2String(requesData.get("jghwt"));//2.机构或问题 -> 机构或问题 context.append(jghwt).append("|"); - String bh = Util.null2String(requesData.get("bh"));// 3.文号 -> 编号 + String bh = Util.null2String(requesData.get("bhnew"));// 3.文号 -> 编号 context.append(bh).append("|"); String requestname = Util.null2String(requesData.get("REQUESTNAME")); // 4.文件题名 -> 流程名称 context.append(requestname).append("|"); @@ -382,16 +455,18 @@ public class SignReportPushArchivesService { context.append(ngbmName).append("|"); String bgqx = Util.null2String(requesData.get("bgqx")); //6 保管期限 -> 保管期限 context.append(bgqx).append("|"); - String cwrq = Util.null2String(requesData.get("cwrq")); //7 日期 -> 成文日期 - context.append(cwrq).append("|"); + // String cwrq = Util.null2String(requesData.get("cwrq")); //7 日期 -> 成文日期 + context.append(ngrq).append("|"); String ys = Util.null2String(requesData.get("ys")); //8 页数 -> 页数 context.append(ys).append("|"); String wz = Util.null2String(requesData.get("wz")); //9 文种 -> 文种 context.append(wz).append("|"); String ngbm = Util.null2String(requesData.get("ngbm")); String[] deptData = ArchivesUtil.getDeptNameAndCode(ngbm); - context.append(deptData[0]).append("|"); //10 行编号 -> 拟稿部门 - context.append(deptData[1]).append("|"); //11 行名称 + String[] subData = ArchivesUtil.getSubCom(ngbm); + context.append("D10001").append("|"); //10 行编号 -> 拟稿部门 + + context.append("总行机关").append("|"); //11 行名称 context.append("").append("|"); // 12 保管期限编号 context.append("").append("|"); // 13 保管期限及编号 context.append("").append("|"); // 14 是否开放 @@ -412,20 +487,20 @@ public class SignReportPushArchivesService { String wjlx = Util.null2String(requesData.get("wjlx")); context.append("").append("|"); // 22 文件类型 -> 空 String fwlx = Util.null2String(requesData.get("fwlx")); - context.append("总行发文").append("|"); // 23 发文类型 -> 空 + context.append("总行签报").append("|"); // 23 发文类型 -> 空 String f = Util.null2String(requesData.get("f")); context.append(f).append("|"); // 24 发 -> 空 String ngr = Util.null2String(requesData.get("ngr")); context.append(new User(Util.getIntValue(ngr)).getLoginid()).append("|"); // 25 拟稿人 -> 拟稿人 context.append(ngbmName).append("|"); // 26 拟稿部门 -> 拟稿部门名称 - context.append("发文").append("|"); // 27 公文类型 -> "收文" + context.append("签报").append("|"); // 27 公文类型 -> "收文" //TODO context.append(ArchivesUtil.getAssociatedPersons(requestid,false)).append("|"); // 28 相关人员 -> 参与人员 context.append("智慧OA").append("|"); // 29 数据来源 -> 数据来源 context.append(year).append("|"); // 30 形成年度 -> 年份 context.append(String.join("&&", zwFileName)).append("|"); // 31 正文名称 context.append(String.join("&&", fjFileName)).append("|"); // 32 附件名称 - context.append(requestid).append("|"); // 33 主键 + context.append("togd"+requestid).append("|"); // 33 主键 context.append("").append("|"); // 34 关联主键 context.append("").append("|"); // 35 被关联主键 context.append(zipName);// 36 压缩包名称 @@ -448,7 +523,10 @@ public class SignReportPushArchivesService { DepartmentComInfo departmentComInfo = new DepartmentComInfo(); for (String record : records) { try { - String departmentName = departmentComInfo.getDepartmentName(record); + if (StringUtil.isEmpty(record)){ + continue; + } + String departmentName = departmentComInfo.getDepartmentmark(record); deptName.add(departmentName); } catch (Exception e) { e.printStackTrace(); @@ -463,4 +541,9 @@ public class SignReportPushArchivesService { RecordSet recordSet = new RecordSet(); recordSet.executeUpdate(sql, s, requestid); } + private void updateRecord(int requestid, String field , String fieldvalue) { + String sql = "update uf_pushArchivesLog set "+field+" = ? where request = ?"; + RecordSet recordSet = new RecordSet(); + recordSet.executeUpdate(sql, fieldvalue, requestid); + } } diff --git a/com/engine/custom/archives/service/firstBranch/FirstBranchReceivingPushArchivesService.java b/com/engine/custom/archives/service/firstBranch/FirstBranchReceivingPushArchivesService.java new file mode 100644 index 0000000..2ef9245 --- /dev/null +++ b/com/engine/custom/archives/service/firstBranch/FirstBranchReceivingPushArchivesService.java @@ -0,0 +1,720 @@ +package com.engine.custom.archives.service.firstBranch; + + +import cn.hutool.core.util.ZipUtil; +import com.alibaba.fastjson.JSONObject; +import com.dcfs.fts.common.error.FtpException; +import com.engine.custom.archives.entity.PushArchivesBean; +import com.engine.custom.archives.util.ArchivesUtil; +import com.engine.custom.archives.util.KeyWord; +import com.engine.custom.hg.util.HgUtils; +import org.apache.commons.lang.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import weaver.conn.RecordSet; +import weaver.file.ImageFileManager; +import weaver.general.StringUtil; +import weaver.general.Util; +import weaver.hrm.User; +import weaver.hrm.company.DepartmentComInfo; +import weaver.soa.workflow.request.RequestInfo; +import weaver.soa.workflow.request.RequestService; +import weaver.workflow.workflow.WorkflowBillComInfo; +import weaver.workflow.workflow.WorkflowComInfo; + +import java.io.*; +import java.text.SimpleDateFormat; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.*; + + +public class FirstBranchReceivingPushArchivesService implements KeyWord { + private static String filePath; + private static String Url; + private static String templatePath; // 模板文件路径 + private int endTime= 7; + + public static Logger log = LoggerFactory.getLogger("Archives"); + + public void setProp(Map param) { + filePath = Util.null2String(param.get("filePath")); + Url = Util.null2String(param.get("Url")); + templatePath = Util.null2String(param.get("templatePath")); + endTime = Util.getIntValue(param.get("endTime"),7); + } + + + public void pushArchives(Map param) { + log.info("FirstBranchReceivingPushArchivesService ====Begin========{}", param); + try { + ZipUtil zipUtil = new ZipUtil(); + Date date = ArchivesUtil.getDate(); + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); + String format = dateFormat.format(date); + SimpleDateFormat yyyyMMddHHmmss = new SimpleDateFormat("yyyy-MM-dd HH:mm"); + // 获取当前时间的第一秒 + String firstSecond = yyyyMMddHHmmss.format(getFirstSecondOfDate(date)); + // 获取当前时间的最后一秒 + String lastSecond = yyyyMMddHHmmss.format(getLastSecondOfDate(date)); + + + RecordSet recordSet = new RecordSet(); + List result = ArchivesUtil.getResultList(recordSet, firstSecond, lastSecond, 4); + log.error("推送分行收文的数量:{}", result.size()); + File file = ArchivesUtil.crFile(filePath + "/togd_" + new SimpleDateFormat("yyyyMMdd000000").format(date)); + log.error("textfile:{}", file.getAbsolutePath()); + for (PushArchivesBean pushArchivesBean : result) { + if (ArchivesUtil.isAfterSevenAM(endTime)){ + log.info("超过执行时间:{}点暂停计划任务",endTime); + break; + } + int requestid = pushArchivesBean.getRequest(); + try { + log.error("requestid:{}", requestid); + //1.生成文件及推送的txt + String context = extracted(requestid); + log.error("context:{}", context); + //1.生成文件及推送的txt + ArchivesUtil.writeToTxt(file.getPath(), file.getName(), context, true); + File txtzip = new File(filePath + File.separator + "togd_" + new SimpleDateFormat("yyyyMMdd000000").format(date) + ".zip"); + log.error("textZipFile:{}", txtzip.getAbsolutePath()); + OutputStream outputStream = new FileOutputStream(txtzip); + File writename = new File(file.getPath() + "/" + file.getName() + ".txt"); + com.engine.custom.hg.util.ZipUtil.filesToZip(writename, outputStream, writename.getName()); + log.error("writename:{}",writename.getName()); + String s = HgUtils.putFile(txtzip.getAbsolutePath(), txtzip.getName()); + // updateRecord(requestid, s); + updateRecord(requestid,"esbtxtml",s); + updateRecord(requestid,"zt","0"); + log.error("textZip:{}", s); + }catch (Exception e){ + e.printStackTrace(); + log.error("推送档案requestid:{}异常,异常原因为:{}",requestid,e.getMessage()); + } + } + } catch (Exception e) { + log.info("PushArchivesCorn====Exception========{}", e.getMessage()); + e.printStackTrace(); + } + + } + + private void updateRecord(int requestids, String s) { + String sql = "update uf_pushArchivesLog set esbtxtml = ? where request in ( " + requestids + " )"; + RecordSet recordSet = new RecordSet(); + recordSet.executeUpdate(sql, s); + } + + private String extracted(int requestid) throws FtpException, IOException { + String newRequestid = "togd"+requestid; + RequestService requestService = new RequestService(); + RequestInfo requestInfo = requestService.getRequest(Util.getIntValue(requestid), 100); + String workflowid = requestInfo.getWorkflowid(); + Map requesData = getRequestByid(requestid); + log.info("requesData:{}", requesData); + String fj = Util.null2String(requesData.get("fj")); + String zwkbj = Util.null2String(requesData.get("zwkbj")); + String lczw = Util.null2String(requesData.get("lczw")); + String gwly = Util.null2String(requesData.get("gwly")); + //增加签字意见中的附件到附件文件夹中 + Map signFiles = ArchivesUtil.getSignFiles(requestid,false); + List docids = new ArrayList<>(); + // docids.addAll(Arrays.asList(fj.split(","))); + // docids.addAll(Arrays.asList(zwkbj.split(","))); + Map fjMap = ArchivesUtil.getFileIdByDocId(fj); + + // Map zwkbjMap = ArchivesUtil.getFileIdByDocId(zwkbj); + // Map lczwMap = ArchivesUtil.getFileIdByDocId(lczw); + Map lczwMap = new HashMap<>(); + //判断公文来源 + if ("0".equals(gwly)){ + lczwMap = ArchivesUtil.getFileIdByDocId(lczw); + }else { + lczwMap = ArchivesUtil.getFileIdByDocId(zwkbj); + } + + + + + List zwFileName = new ArrayList<>(); + List fjFileName = new ArrayList<>(); + final int[] i = {1}; + //附件 + fjMap.forEach((docid, imageid) -> { + ImageFileManager imageFileManager = new ImageFileManager(); + imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + InputStream inputStream = imageFileManager.getInputStream(); + //中文路径/中文文件名 + String imageFileName = filePath + File.separator + newRequestid + File.separator + FJDIR + File.separator + LCFJWORD + i[0] +"-" + imageFileManager.getImageFileName(); + fjFileName.add(LCFJWORD+ i[0] +"-" + imageFileManager.getImageFileName()); + log.info("生成附件路径:{}", imageFileName); + imageFileName = ArchivesUtil.codeUtf8(imageFileName); + try { + File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + String jsonStr = ArchivesUtil.callApi(Url, file); + log.error("永中接口返回数据:{}", jsonStr); + JSONObject result = JSONObject.parseObject(jsonStr); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + FJDIR + File.separator + LCFJWORD+ i[0] + "-" + imageFileManager.getImageFileName() + ".pdf"); + } + } catch (IOException e) { + e.printStackTrace(); + }finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + i[0]++; + }); + i[0] = 1; + //签字意见附件 + signFiles.forEach((docid, imageid) -> { + ImageFileManager imageFileManager = new ImageFileManager(); + imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + InputStream inputStream = imageFileManager.getInputStream(); + //中文路径/中文文件名 + String imageFileName = filePath + File.separator + newRequestid + File.separator + FJDIR + File.separator + QZYJFJWORD + i[0] + "-" +imageFileManager.getImageFileName(); + fjFileName.add(QZYJFJWORD + i[0] + "-" +imageFileManager.getImageFileName()); + log.info("生成签字意见附件路径:{}", imageFileName); + imageFileName = ArchivesUtil.codeUtf8(imageFileName); + try { + File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + String jsonStr = ArchivesUtil.callApi(Url, file); + log.error("永中接口返回数据:{}", jsonStr); + JSONObject result = JSONObject.parseObject(jsonStr); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + FJDIR + File.separator + QZYJFJWORD + i[0] + "-" + imageFileManager.getImageFileName() + ".pdf"); + } + i[0]++; + } catch (IOException e) { + e.printStackTrace(); + }finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + }); + + i[0] = 1; + Map coReqFile = getCoReqFile(requestid, workflowid); + //协办要求 + coReqFile.forEach((docid, imageid) -> { + ImageFileManager imageFileManager = new ImageFileManager(); + imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + InputStream inputStream = imageFileManager.getInputStream(); + zwFileName.add(XBBMFJWORD+ i[0] +"-"+ imageFileManager.getImageFileName()); + //中文路径/中文文件名 + String imageFileName = filePath + File.separator + newRequestid + File.separator + FJDIR + File.separator + XBBMFJWORD + i[0] +"-"+ imageFileManager.getImageFileName(); + log.info("生成协办部门路径:{}", imageFileName); + imageFileName = ArchivesUtil.codeUtf8(imageFileName); + try { + File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + String jsonStr = ArchivesUtil.callApi(Url, file); + log.error("永中接口返回:{}", jsonStr); + JSONObject result = JSONObject.parseObject(jsonStr); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + FJDIR + File.separator+XBBMFJWORD+ i[0] +"-" + imageFileManager.getImageFileName() + ".pdf"); + } + i[0]++; + } catch (IOException e) { + e.printStackTrace(); + }finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + }); + + // i[0] = 1; + // //正文 + // zwkbjMap.forEach((docid, imageid) -> { + // ImageFileManager imageFileManager = new ImageFileManager(); + // imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + // InputStream inputStream = imageFileManager.getInputStream(); + // zwFileName.add(imageFileManager.getImageFileName()); + // //中文路径/中文文件名 + // String imageFileName = filePath + File.separator + newRequestid + File.separator + zwdir + File.separator + imageFileManager.getImageFileName(); + // log.info("生成正文路径:{}", imageFileName); + // imageFileName = ArchivesUtil.codeUtf8(imageFileName); + // try { + // File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + // String jsonStr = ArchivesUtil.callApi(Url, file); + // log.error("永中接口返回:{}", jsonStr); + // JSONObject result = JSONObject.parseObject(jsonStr); + // String errorcode = result.getString("errorcode"); + // if ("0".equals(errorcode)) { + // JSONObject data = result.getJSONObject("data"); + // String destFileName = data.getString("destFileName"); + // String viewUrl = data.getString("viewUrl"); + // ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + zwdir + File.separator + imageFileManager.getImageFileName() + ".pdf"); + // } + // + // } catch (IOException e) { + // e.printStackTrace(); + // }finally { + // if(inputStream!=null) { + // try { + // inputStream.close(); + // } catch (IOException e) { + // e.printStackTrace(); + // } + // } + // } + // }); + + i[0] = 1; + //正文 + lczwMap.forEach((docid, imageid) -> { + ImageFileManager imageFileManager = new ImageFileManager(); + imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + InputStream inputStream = imageFileManager.getInputStream(); + zwFileName.add(imageFileManager.getImageFileName()); + //中文路径/中文文件名 + String imageFileName = filePath + File.separator + newRequestid + File.separator + ZWDIR + File.separator + (imageFileManager.getImageFileName().replaceAll("/","-")); + log.info("生成正文路径:{}", imageFileName); + imageFileName = ArchivesUtil.codeUtf8(imageFileName); + try { + File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + String jsonStr = ArchivesUtil.callApi(Url, file); + log.error("永中接口返回:{}", jsonStr); + JSONObject result = JSONObject.parseObject(jsonStr); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + ZWDIR + File.separator + (imageFileManager.getImageFileName().replaceAll("/","-")) + ".pdf"); + } + + } catch (IOException e) { + e.printStackTrace(); + }finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + }); + //开始承办单 先获取主流程的承办单 + List requestDocid = ArchivesUtil.generaRequestFormPdf(requestid,0); + // 1.去掉生成子流程承办单 + // List subRequestDocid = generaSubRequestFormPdf(requestid); + Map reqDocMap = ArchivesUtil.getFileIdByDocId(String.join(",", requestDocid)); + // 2.去掉生成子流程承办单 + // Map subReqDocMap = getFileIdByDocId(String.join(",", subRequestDocid)); + log.error("reqDocMap:{}", JSONObject.toJSONString(reqDocMap)); + //log.error("subReqDocMap:{}", JSONObject.toJSONString(subReqDocMap)); + docids.addAll(requestDocid); + // 3.去掉生成子流程承办单 + // docids.addAll(subRequestDocid); + //承办单 + reqDocMap.forEach((docid, imageid) -> { + ImageFileManager imageFileManager = new ImageFileManager(); + imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + InputStream inputStream = imageFileManager.getInputStream(); + //中文路径/中文文件名 + // String imageFileName = filePath + File.separator + requestid + File.separator + cbddir + File.separator + fjFile + i[0] + "_" + imageFileManager.getImageFileName(); + String imageFileName = filePath + File.separator + newRequestid + File.separator + CBDDIR + File.separator + WJCLDWORD+".pdf"; + + log.info("主流程承办单路径:{}", imageFileName); + imageFileName = ArchivesUtil.codeUtf8(imageFileName); + try { + File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + String jsonStr = ArchivesUtil.callApi(Url, file); + log.error("永中接口返回:{}", jsonStr); + JSONObject result = JSONObject.parseObject(jsonStr); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + CBDDIR + File.separator + WJCLDWORD + ".pdf" + ".pdf"); + } + i[0]++; + } catch (IOException e) { + e.printStackTrace(); + }finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + }); +//正文 + + i[0] = 1; + // 4.去掉生成子流程承办单 + // subReqDocMap.forEach((docid, imageid) -> { + // ImageFileManager imageFileManager = new ImageFileManager(); + // imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + // InputStream inputStream = imageFileManager.getInputStream(); + // //中文路径/中文文件名 + // String imageFileName = filePath + File.separator + requestid + File.separator + zlcdir + File.separator + fjFile + i[0] + "_" + (imageFileManager.getImageFileName().contains("-")?imageFileManager.getImageFileName().split("\\-")[1]:imageFileManager.getImageFileName()); + // imageFileName = codeUtf8(imageFileName); + // log.info("子流程承办单路径:{}", imageFileName); + // try { + // File file = saveInputStreamToFile(inputStream, imageFileName); + // String jsonStr = callApi(Url, file); + // log.error("永中接口返回:{}", jsonStr); + // JSONObject result = JSONObject.parseObject(jsonStr); + // String errorcode = result.getString("errorcode"); + // if ("0".equals(errorcode)) { + // JSONObject data = result.getJSONObject("data"); + // String destFileName = data.getString("destFileName"); + // String viewUrl = data.getString("viewUrl"); + // downloadFile(viewUrl, filePath + File.separator + requestid + File.separator + zlcdir + File.separator + fjFile + i[0] + "_" + (imageFileManager.getImageFileName().contains("-")?imageFileManager.getImageFileName().split("\\-")[1]:imageFileManager.getImageFileName() )+ ".pdf"); + // } + // i[0]++; + // } catch (IOException e) { + // e.printStackTrace(); + // } + // }); + log.error(JSONObject.toJSONString(requestDocid)); + // log.error(JSONObject.toJSONString(subRequestDocid)); + for (String docid : docids) { + log.error("删除了" + docid); + ArchivesUtil.deleteDocByid(docid); + } + //-------------------------------------------------------------------- + + + String logFile = ArchivesUtil.getSignLog(requestid, CBDDIR+File.separator+LZXXDIR, requestInfo.getCreatorid() + requestInfo.getDescription(),templatePath,filePath,false,workflowid); + String s = ArchivesUtil.callApi(Url, new File(logFile)); + log.error(s); + JSONObject result = JSONObject.parseObject(s); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, logFile + ".pdf"); + } + String zipName = filePath + File.separator + newRequestid + ".zip"; + ZipUtil.zip(filePath + File.separator + newRequestid, zipName); + log.error("zipName:{}", zipName); + String ftpFilePath = HgUtils.putFile(zipName, newRequestid + ".zip"); + ArchivesUtil.deleteDirectory(filePath + File.separator + newRequestid); + updateRecord(requestid,"esbwjml",ftpFilePath); + log.error("ftpFilePath:{}", ftpFilePath); + // String ftpFilePathNew = HgUtils.putFile(zipName, "test" + File.separator + newRequestid + ".zip"); + // log.error("ftpFilePathNew:{}", ftpFilePathNew); + String context = getContext(requestid, requesData, newRequestid + ".zip", zwFileName, fjFileName); + // insertRecord(requestid, context, ftpFilePath); + log.error("context:{}", context); + updateRecord(requestid,"content",context); + return context; + } + + + + private void insertRecord(int requestid, String context, String ftpFilePath) { + String sql = "insert into uf_pushArchivesLog (request ,content,esbwjml) VALUES (?,?,?)"; + RecordSet recordSet = new RecordSet(); + recordSet.executeUpdate(sql, requestid, context, ftpFilePath); + } + + + // 获取指定日期的第一秒 + public static Date getFirstSecondOfDate(Date date) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + calendar.set(Calendar.HOUR_OF_DAY, 0); + calendar.set(Calendar.MINUTE, 0); + calendar.set(Calendar.SECOND, 0); + calendar.set(Calendar.MILLISECOND, 0); + return calendar.getTime(); + } + + // 获取指定日期的最后一秒 + public static Date getLastSecondOfDate(Date date) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + calendar.set(Calendar.HOUR_OF_DAY, 23); + calendar.set(Calendar.MINUTE, 59); + calendar.set(Calendar.SECOND, 59); + calendar.set(Calendar.MILLISECOND, 999); + return calendar.getTime(); + } + + + + /*** + * 封装数据 + * @param requestid + * @return + */ + public Map getRequestByid(int requestid) { + HashMap record = new HashMap<>(); + String sql = "select * from formtable_main_55 where requestid = ?"; + String reqsql = "select REQUESTNAME from WORKFLOW_REQUESTBASE where REQUESTID = ?"; + RecordSet rs = new RecordSet(); + rs.executeQuery(sql, requestid); + if (rs.next()) { + String fj = Util.null2String(rs.getString("fj")); + String zwkbj = Util.null2String(rs.getString("zwkbj")); // 正文可编辑字段 + record.put("fj", fj); + record.put("zwkbj", zwkbj); + record.put("zwyyglgwmk", Util.null2String(rs.getString("zwyyglgwmk"))); + record.put("lwh", Util.null2String(rs.getString("lwh"))); + record.put("mj", Util.null2String(rs.getString("mj"))); + record.put("lwrq", Util.null2String(rs.getString("lwrq"))); + record.put("swrq", Util.null2String(rs.getString("swrq"))); + record.put("blqx", Util.null2String(rs.getString("blqx"))); + record.put("sfdb", Util.null2String(rs.getString("sfdb"))); + record.put("wjlx", Util.null2String(rs.getString("wjlx"))); + record.put("fssj", Util.null2String(rs.getString("fssj"))); + record.put("gdh", Util.null2String(rs.getString("gdh"))); + record.put("swh", Util.null2String(rs.getString("swh"))); + record.put("ngbm", Util.null2String(rs.getString("ngbm"))); + record.put("ngr", Util.null2String(rs.getString("ngr"))); + record.put("ngrq", Util.null2String(rs.getString("ngrq"))); + record.put("swlx", Util.null2String(rs.getString("swlx"))); + record.put("jghwt", Util.null2String(rs.getString("jghwt"))); + record.put("lwdwmc", Util.null2String(rs.getString("lwdwmc"))); + record.put("bgqx", Util.null2String(rs.getString("bgqx"))); + record.put("ys", Util.null2String(rs.getString("ys"))); + record.put("wz", Util.null2String(rs.getString("wz"))); + record.put("lb", Util.null2String(rs.getString("lb"))); + record.put("bz", Util.null2String(rs.getString("bz"))); + record.put("yffbm", Util.null2String(rs.getString("yffbm"))); + record.put("ffbmb", Util.null2String(rs.getString("ffbmb"))); + record.put("yffbm", Util.null2String(rs.getString("yffbm"))); + record.put("lczw", Util.null2String(rs.getString("lczw"))); + record.put("gwly", Util.null2String(rs.getString("gwly"))); + record.put("lwdwsx", Util.null2String(rs.getString("lwdwsx"))); + record.put("fb", Util.null2String(rs.getString("fb"))); + record.put("xjdw", Util.null2String(rs.getString("xjdw"))); + record.put("ejzx", Util.null2String(rs.getString("ejzx"))); + record.put("yjbm", Util.null2String(rs.getString("yjbm"))); + record.put("yjfxxldbm", Util.null2String(rs.getString("yjfxxldbm"))); + } + rs.executeQuery(reqsql, requestid); + if (rs.next()) { + record.put("REQUESTNAME", Util.null2String(rs.getString("REQUESTNAME"))); + } + return record; + } + + + private String getContext(int requestid, Map requesData, String zipName, List zwFileName, List fjFileName) { + StringBuilder context = new StringBuilder(); + try { + + String swrq = Util.null2String(requesData.get("swrq")); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + LocalDate date = LocalDate.parse(swrq, formatter); + int year = date.getYear(); + context.append(year).append("|"); + String jghwt = Util.null2String(requesData.get("jghwt")); + context.append(jghwt).append("|"); + // String swh = Util.null2String(requesData.get("swh")); + String swh = Util.null2String(requesData.get("lwh")); + context.append(swh).append("|"); + String requestname = Util.null2String(requesData.get("REQUESTNAME")); + context.append(requestname).append("|"); + String lwdwmc = Util.null2String(requesData.get("lwdwsx")); //5 责任者 -> 来文单位 + context.append(lwdwmc).append("|"); + String bgqx = Util.null2String(requesData.get("bgqx")); //6 保管期限 -> 保管期限 + context.append(bgqx).append("|"); + String lwrq = Util.null2String(requesData.get("lwrq")); //7 日期 -> 原发文日期 + context.append(lwrq).append("|"); + String ys = Util.null2String(requesData.get("ys")); //8 页数 -> 页数 + context.append(ys).append("|"); + String wz = Util.null2String(requesData.get("wz")); //9 文种 -> 文种 + context.append(wz).append("|"); + String ngbm = Util.null2String(requesData.get("ngbm")); + String fb = Util.null2String(requesData.get("fb")); + String[] deptData = ArchivesUtil.getDeptNameAndCode(ngbm); + String[] subData = getSubCom(fb); + context.append(subData[0]).append("|"); //10 行编号 -> 拟稿部门 + + context.append(subData[1]).append("|"); //11 行名称 + context.append("").append("|"); // 12 保管期限编号 + context.append("").append("|"); // 13 保管期限及编号 + context.append("").append("|"); // 14 是否开放 + context.append("").append("|"); // 15 互见号 + String lb = Util.null2String(requesData.get("lb")); + context.append(lb).append("|"); //16 类别 -> 类别 + //TODO + String xgbm = Util.null2String(getAssociatedDepts(requesData)); + context.append(xgbm).append("|"); //17 相关部门 -> 流经部门 + // String lwh = Util.null2String(requesData.get("lwh"));// 18 收文号 -> 来文文号 + String lwh = Util.null2String(requesData.get("swh"));// 18 收文号 -> 来文文号 + context.append(lwh).append("|"); + String fs = ""; + context.append(fs).append("|"); // 19 份数 -> 份数 + String bz = Util.null2String(requesData.get("bz")); + context.append(bz).append("|"); // 20 备注 -> 备注 + String yywh = Util.null2String(requesData.get("yywh")); + context.append(yywh).append("|"); // 21 引用文号 -> 引用文号 + String wjlx = Util.null2String(requesData.get("wjlx")); + context.append(wjlx).append("|"); // 22 文件类型 -> 空 + String fwlx = Util.null2String(requesData.get("fwlx")); + context.append(fwlx).append("|"); // 23 文件类型 -> 空 + String f = Util.null2String(requesData.get("f")); + context.append(f).append("|"); // 24 发 -> 空 + String ngr = Util.null2String(requesData.get("ngr")); + context.append(new User(Util.getIntValue(ngr)).getLoginid()).append("|"); // 25 拟稿人 -> 拟稿人 + context.append(deptData[1]).append("|"); // 26 拟稿部门 -> 拟稿部门名称 + context.append("收文").append("|"); // 27 公文类型 -> "收文" + //TODO + context.append(ArchivesUtil.getAssociatedPersons(requestid,false)).append("|"); // 28 相关人员 -> 参与人员 + context.append("智慧OA").append("|"); // 29 数据来源 -> 数据来源 + context.append(year).append("|"); // 30 形成年度 -> 年份 + context.append(String.join("&&", zwFileName)).append("|"); // 31 正文名称 + context.append(String.join("&&", fjFileName)).append("|"); // 32 附件名称 + context.append("togd"+requestid).append("|"); // 33 主键 + context.append("").append("|"); // 34 关联主键 + context.append("").append("|"); // 35 被关联主键 + context.append(zipName);// 36 压缩包名称 + } catch (Exception e) { + e.printStackTrace(); + log.error("getContextError:{}", e.getMessage()); + } + + return context.toString(); + } + + private String getAssociatedDepts(Map requesData) { + HashSet records = new HashSet<>(); + records.addAll(Arrays.asList(Util.null2String(requesData.get("ngbm")).split(","))); + records.addAll(Arrays.asList(Util.null2String(requesData.get("ffbm")).split(","))); + records.addAll(Arrays.asList(Util.null2String(requesData.get("yffbm")).split(","))); + records.addAll(Arrays.asList(Util.null2String(requesData.get("ffbmb")).split(","))); + records.addAll(Arrays.asList(Util.null2String(requesData.get("xjdw")).split(","))); + records.addAll(Arrays.asList(Util.null2String(requesData.get("ejzx")).split(","))); + records.addAll(Arrays.asList(Util.null2String(requesData.get("yjbm")).split(","))); + records.addAll(Arrays.asList(Util.null2String(requesData.get("yjfxxldbm")).split(","))); + ArrayList deptName = new ArrayList<>(); + DepartmentComInfo departmentComInfo = new DepartmentComInfo(); + for (String record : records) { + try { + if (StringUtil.isEmpty(record)){ + continue; + } + String departmentName = departmentComInfo.getDepartmentName(record); + deptName.add(departmentName); + } catch (Exception e) { + e.printStackTrace(); + } + } + + return String.join("&&", deptName); + } + + private Map getCoReqFile(int requestid , String workflowid){ + try { + RecordSet rs = new RecordSet(); + rs.executeQuery("select * from uf_ArchivesSet where mainwfid = ?",workflowid); + boolean isCo = false; + String cowfid = ""; + String cofield = ""; + String cofieldid = ""; + if (rs.next()){ + cowfid = Util.null2String(rs.getString("cowfid")); + if (!StringUtils.isBlank(cowfid)){ + isCo = true; + cofield = Util.null2String(rs.getString("cofield")); + cofieldid = Util.null2String(rs.getString("cofieldid")); + } + } + log.info("isCo:{};cowfid:{};cofield:{};cofieldid:{}",isCo,cowfid,cofield,cofieldid); + + + if(isCo){ + ArrayList CoSubRequest = new ArrayList<>(); + Map subRequest = ArchivesUtil.getSubRequest(Util.null2String(requestid) , 6); + log.info("subRequest:{}",subRequest); + for (Map.Entry subRequestEntry : subRequest.entrySet()) { + String subWFid = subRequestEntry.getValue(); + if (cowfid.equals(subWFid)){ + CoSubRequest.add(subRequestEntry.getKey()); + } + } + log.info("CoSubRequest.size:{}",CoSubRequest.size()); + if (CoSubRequest.size() == 0){ + return new HashMap<>(); + } + WorkflowComInfo wf = new WorkflowComInfo(); + WorkflowBillComInfo wcInfo = new WorkflowBillComInfo(); + String formId = wf.getFormId(cowfid); + String tablename = wcInfo.getTablename(formId); + String cosql = "select "+cofield+" from " + tablename + " where " + + " requestid in ( " + String.join(",",CoSubRequest) + " ) " + + " order by requestid asc "; + log.info("cosql:{}",cosql); + + rs.executeQuery(cosql); + log.info("rs.getExceptionMsg():{}",rs.getExceptionMsg()); + String fieldValue = ""; + String[] cofieldsplit = cofield.split(","); + String coFile = cofieldsplit[2]; //协办部门 + ArrayList docids = new ArrayList<>(); + while (rs.next()){ + String coFileValue = rs.getString(coFile); + docids.addAll(Arrays.asList(coFileValue.split(","))); + } + log.info("fieldValue:{}",fieldValue); + return ArchivesUtil.getFileIdByDocId(String.join(",",docids)); + } + return new HashMap<>(); + }catch (Exception e){ + log.error("getCoReqFile:[}",e.getMessage()); + return new HashMap<>(); + } + } + + private void updateRecord(int requestid, String field , String fieldvalue) { + String sql = "update uf_pushArchivesLog set "+field+" = ? where request = ?"; + RecordSet recordSet = new RecordSet(); + recordSet.executeUpdate(sql, fieldvalue, requestid); + } + + + public static String[] getSubCom(String ngbm) { + RecordSet rs = new RecordSet(); + rs.executeQuery("select sub.id subid , SUBCOMPANYNAME from HRMSUBCOMPANY sub where sub.id = ? ",ngbm); + rs.next(); + String subcompanyname = rs.getString("SUBCOMPANYNAME"); + String subid = rs.getString("subid"); + if ("总行".equals(subcompanyname)){ + subcompanyname = "总行机关"; + } + rs.executeQuery("select DAPYBH from HRMSUBCOMPANYDEFINED where SUBCOMID = ?",subid); + rs.next(); + String DAPYBH = rs.getString("DAPYBH"); + return new String[]{DAPYBH,subcompanyname}; + } +} diff --git a/com/engine/custom/archives/service/firstBranch/FirstBranchSendingPushArchivesService.java b/com/engine/custom/archives/service/firstBranch/FirstBranchSendingPushArchivesService.java new file mode 100644 index 0000000..50d1e25 --- /dev/null +++ b/com/engine/custom/archives/service/firstBranch/FirstBranchSendingPushArchivesService.java @@ -0,0 +1,571 @@ +package com.engine.custom.archives.service.firstBranch; + +import cn.hutool.core.util.ZipUtil; +import com.alibaba.fastjson.JSONObject; +import com.dcfs.fts.common.error.FtpException; +import com.engine.custom.archives.entity.PushArchivesBean; +import com.engine.custom.archives.util.ArchivesUtil; +import com.engine.custom.archives.util.KeyWord; +import com.engine.custom.hg.util.HgUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import weaver.conn.RecordSet; +import weaver.file.ImageFileManager; +import weaver.general.StringUtil; +import weaver.general.Util; +import weaver.hrm.User; +import weaver.hrm.company.DepartmentComInfo; +import weaver.soa.workflow.request.RequestInfo; +import weaver.soa.workflow.request.RequestService; + +import java.io.*; +import java.text.SimpleDateFormat; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.*; + +/*** + * @Des: 一级分行发文推送档案系统服务 + */ +public class FirstBranchSendingPushArchivesService implements KeyWord { + public static Logger log = LoggerFactory.getLogger("Archives"); + private static String filePath; + private static String Url; + private static String templatePath; // 模板文件路径 + private int endTime= 7; + + public void setProp(Map param) { + filePath = Util.null2String(param.get("filePath")); + Url = Util.null2String(param.get("Url")); + templatePath = Util.null2String(param.get("templatePath")); + endTime = Util.getIntValue(param.get("endTime"),7); + } + + public void pushArchives(Map param) { + log.info("PushArchivesCorn====Begin========{}", param); + Date date = ArchivesUtil.getDate(); + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); + String format = dateFormat.format(date); + SimpleDateFormat yyyyMMddHHmmss = new SimpleDateFormat("yyyy-MM-dd HH:mm"); + // 获取当前时间的第一秒 + String firstSecond = yyyyMMddHHmmss.format(ArchivesUtil.getFirstSecondOfDate(date)); + // 获取当前时间的最后一秒 + String lastSecond = yyyyMMddHHmmss.format(ArchivesUtil.getLastSecondOfDate(date)); + RecordSet recordSet = new RecordSet(); + List result = ArchivesUtil.getResultList(recordSet, firstSecond, lastSecond, 3); + log.error("推送分行发文的数量:{}", result.size()); + File file = ArchivesUtil.crFile(filePath + "/togd_" + new SimpleDateFormat("yyyyMMdd000000").format(date)); + log.error("textfile:{}", file.getAbsolutePath()); + for (PushArchivesBean pushArchivesBean : result) { + if (ArchivesUtil.isAfterSevenAM(endTime)){ + log.info("超过执行时间:{}点暂停计划任务",endTime); + break; + } + // int id = pushArchivesBean.getId(); + int request = pushArchivesBean.getRequest(); + log.error("推送的requestId:{}", request); + try { + String context = generateFile(request); + if ("-1".equals(context)){ + continue; + } + ArchivesUtil.writeToTxt(file.getPath(), file.getName(), context, true); + File txtzip = new File(filePath + File.separator + "togd_" + new SimpleDateFormat("yyyyMMdd000000").format(date) + ".zip"); + log.error("textZipFile:{}", txtzip.getAbsolutePath()); + OutputStream outputStream = new FileOutputStream(txtzip); + File writename = new File(file.getPath() + "/" + file.getName() + ".txt"); + com.engine.custom.hg.util.ZipUtil.filesToZip(writename, outputStream, writename.getName()); + log.error("writename:{}", writename.getName()); + String s = HgUtils.putFile(txtzip.getAbsolutePath(), txtzip.getName()); + updateRecord(request,"esbtxtml",s); + updateRecord(request,"zt","0"); + log.error("textZip:{}", s); + } catch (FtpException e) { + e.printStackTrace(); + log.error("推送档案requestid:{}异常,异常原因为:{}",request,e.getMessage()); + } catch (IOException e) { + e.printStackTrace(); + log.error("推送档案requestid:{}异常,异常原因为:{}",request,e.getMessage()); + } catch (Exception e){ + e.printStackTrace(); + log.error("推送档案requestid:{}异常,异常原因为:{}",request,e.getMessage()); + } + } + + } + + + private String generateFile(int requestid) throws FtpException, IOException { + Map requesData = getRequestByid(requestid); + String newRequestid = "togd"+requestid; + log.info("requesData:{}", requesData); + String bh = requesData.get("bh"); + if (StringUtil.isEmpty(bh)){ + return "-1"; + } + String fj = Util.null2String(requesData.get("fj")); + String dwd = Util.null2String(requesData.get("dwd")); + String zw = Util.null2String(requesData.get("zw")); + String qgqhj = Util.null2String(requesData.get("qgqhj")); + String thhlh = Util.null2String(requesData.get("thhlh")); + + + //增加签字意见中的附件到附件文件夹中 + Map signFiles = ArchivesUtil.getSignFiles(requestid,false); + List docids = new ArrayList<>(); + // docids.addAll(Arrays.asList(fj.split(","))); + // docids.addAll(Arrays.asList(zwkbj.split(","))); + Map fjMap = ArchivesUtil.getFileIdByDocId(fj); + Map dwdMap = ArchivesUtil.getFileIdByDocId(dwd); + Map zwMap = ArchivesUtil.getFileIdByDocId(zw); + Map qgqhjMap = ArchivesUtil.getFileIdByDocId(qgqhj); + Map thhlhMap = ArchivesUtil.getFileIdByDocId(thhlh); + List zwFileName = new ArrayList<>(); + List fjFileName = new ArrayList<>(); + final int[] i = {1}; + //附件 + fjMap.forEach((docid, imageid) -> { + ImageFileManager imageFileManager = new ImageFileManager(); + imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + InputStream inputStream = imageFileManager.getInputStream(); + //中文路径/中文文件名 + String imageFileName = filePath + File.separator + newRequestid + File.separator + FJDIR + File.separator + LCFJWORD + "-" +imageFileManager.getImageFileName(); + fjFileName.add(LCFJWORD + "-" +imageFileManager.getImageFileName()); + log.info("生成附件路径:{}", imageFileName); + imageFileName = ArchivesUtil.codeUtf8(imageFileName); + try { + File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + String jsonStr = ArchivesUtil.callApi(Url, file); + log.error("永中接口返回数据:{}", jsonStr); + JSONObject result = JSONObject.parseObject(jsonStr); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + FJDIR + File.separator + LCFJWORD + "-" + imageFileManager.getImageFileName() + ".pdf"); + } + } catch (IOException e) { + e.printStackTrace(); + }finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + }); + + //签字意见附件 + signFiles.forEach((docid, imageid) -> { + ImageFileManager imageFileManager = new ImageFileManager(); + imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + InputStream inputStream = imageFileManager.getInputStream(); + //中文路径/中文文件名 + String imageFileName = filePath + File.separator + newRequestid + File.separator + FJDIR + File.separator + QZYJFJWORD+ "-" +imageFileManager.getImageFileName(); + fjFileName.add(QZYJFJWORD+ "-" +imageFileManager.getImageFileName()); + log.info("生成签字意见附件路径:{}", imageFileName); + imageFileName = ArchivesUtil.codeUtf8(imageFileName); + try { + File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + String jsonStr = ArchivesUtil.callApi(Url, file); + log.error("永中接口返回数据:{}", jsonStr); + JSONObject result = JSONObject.parseObject(jsonStr); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + FJDIR + File.separator + QZYJFJWORD+ "-" + imageFileManager.getImageFileName() + ".pdf"); + } + } catch (IOException e) { + e.printStackTrace(); + }finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + }); + + //多文档 + // dwdMap.forEach((docid, imageid) -> { + // ImageFileManager imageFileManager = new ImageFileManager(); + // imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + // InputStream inputStream = imageFileManager.getInputStream(); + // zwFileName.add(imageFileManager.getImageFileName()); + // //中文路径/中文文件名 + // String imageFileName = filePath + File.separator + requestid + File.separator + zwdir + File.separator + fjWord + i[0] + "_" + zwWord + "_" + imageFileManager.getImageFileName(); + // log.info("生成多文档路径:{}", imageFileName); + // imageFileName = ArchivesUtil.codeUtf8(imageFileName); + // try { + // File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + // String jsonStr = ArchivesUtil.callApi(Url, file); + // log.error("永中接口返回:{}", jsonStr); + // JSONObject result = JSONObject.parseObject(jsonStr); + // String errorcode = result.getString("errorcode"); + // if ("0".equals(errorcode)) { + // JSONObject data = result.getJSONObject("data"); + // String destFileName = data.getString("destFileName"); + // String viewUrl = data.getString("viewUrl"); + // ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + requestid + File.separator + zwdir + File.separator + fjWord + i[0] + "_" + zwWord + "_" + imageFileManager.getImageFileName() + ".pdf"); + // } + // } catch (IOException e) { + // e.printStackTrace(); + // } + // i[0]++; + // }); + //正文 + zwMap.forEach((docid, imageid) -> { + ImageFileManager imageFileManager = new ImageFileManager(); + imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + InputStream inputStream = imageFileManager.getInputStream(); + + String newFile = FJWORD + i[0] + "_" + ZWWORD + "-" + (imageFileManager.getImageFileName().replaceAll("/","-")); + //中文路径/中文文件名 + String imageFileName = filePath + File.separator + newRequestid + File.separator + ZWDIR + File.separator + newFile; + zwFileName.add(newFile); + log.info("生成正文路径:{}", imageFileName); + imageFileName = ArchivesUtil.codeUtf8(imageFileName); + try { + File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + String jsonStr = ArchivesUtil.callApi(Url, file); + log.error("永中接口返回:{}", jsonStr); + JSONObject result = JSONObject.parseObject(jsonStr); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + ZWDIR + File.separator + newFile + ".pdf"); + } + } catch (IOException e) { + e.printStackTrace(); + }finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + i[0]++; + }); + //清稿前痕迹 + qgqhjMap.forEach((docid, imageid) -> { + ImageFileManager imageFileManager = new ImageFileManager(); + imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + InputStream inputStream = imageFileManager.getInputStream(); + + String newFile = FJWORD + i[0] + "_" + LHGWORD + "-" + (imageFileManager.getImageFileName().replaceAll("/","-")); + zwFileName.add(newFile); + //中文路径/中文文件名 + String imageFileName = filePath + File.separator + newRequestid + File.separator + ZWDIR + File.separator + newFile; + log.info("生成清稿前痕迹路径:{}", imageFileName); + imageFileName = ArchivesUtil.codeUtf8(imageFileName); + try { + File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + String jsonStr = ArchivesUtil.callApi(Url, file); + log.error("永中接口返回:{}", jsonStr); + JSONObject result = JSONObject.parseObject(jsonStr); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + ZWDIR + File.separator + newFile + ".pdf"); + } + } catch (IOException e) { + e.printStackTrace(); + }finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + i[0]++; + }); + //套红后留痕 + // thhlhMap.forEach((docid, imageid) -> { + // ImageFileManager imageFileManager = new ImageFileManager(); + // imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + // InputStream inputStream = imageFileManager.getInputStream(); + // zwFileName.add(imageFileManager.getImageFileName()); + // //中文路径/中文文件名 + // String imageFileName = filePath + File.separator + requestid + File.separator + zwdir + File.separator + fjWord + i[0] + "_" + lhgWord + "_" + imageFileManager.getImageFileName(); + // log.info("生成套红后留痕路径:{}", imageFileName); + // imageFileName = ArchivesUtil.codeUtf8(imageFileName); + // try { + // File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + // String jsonStr = ArchivesUtil.callApi(Url, file); + // log.error("永中接口返回:{}", jsonStr); + // JSONObject result = JSONObject.parseObject(jsonStr); + // String errorcode = result.getString("errorcode"); + // if ("0".equals(errorcode)) { + // JSONObject data = result.getJSONObject("data"); + // String destFileName = data.getString("destFileName"); + // String viewUrl = data.getString("viewUrl"); + // ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + requestid + File.separator + zwdir + File.separator + fjWord + i[0] + "_" + lhgWord + "_" + imageFileManager.getImageFileName() + ".pdf"); + // } + // } catch (IOException e) { + // e.printStackTrace(); + // } + // i[0]++; + // }); + + //开始承办单 先获取主流程的承办单 + List requestDocid = ArchivesUtil.generaRequestFormPdf(requestid, 0); + // 1.去掉生成子流程承办单 + // List subRequestDocid = generaSubRequestFormPdf(requestid); + Map reqDocMap = ArchivesUtil.getFileIdByDocId(String.join(",", requestDocid)); + // 2.去掉生成子流程承办单 + // Map subReqDocMap = getFileIdByDocId(String.join(",", subRequestDocid)); + log.error("reqDocMap:{}", JSONObject.toJSONString(reqDocMap)); + //log.error("subReqDocMap:{}", JSONObject.toJSONString(subReqDocMap)); + docids.addAll(requestDocid); + // 3.去掉生成子流程承办单 + // docids.addAll(subRequestDocid); + i[0] = 1; + //主流程承办单 + reqDocMap.forEach((docid, imageid) -> { + ImageFileManager imageFileManager = new ImageFileManager(); + imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + InputStream inputStream = imageFileManager.getInputStream(); + //中文路径/中文文件名 + // String imageFileName = filePath + File.separator + requestid + File.separator + cbddir + File.separator + fjFile + i[0] + "_" + imageFileManager.getImageFileName(); + // String imageFileName = filePath + File.separator + newRequestid + File.separator + cbddir + File.separator + fjFile + i[0] + "_" + wjcldWord+".pdf"; + String imageFileName = filePath + File.separator + newRequestid + File.separator + CBDDIR + File.separator + WJCLDWORD+".pdf"; + log.info("主流程承办单路径:{}", imageFileName); + imageFileName = ArchivesUtil.codeUtf8(imageFileName); + try { + File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + String jsonStr = ArchivesUtil.callApi(Url, file); + log.error("永中接口返回:{}", jsonStr); + JSONObject result = JSONObject.parseObject(jsonStr); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + CBDDIR + File.separator + WJCLDWORD + ".pdf" + ".pdf"); + } + i[0]++; + } catch (IOException e) { + e.printStackTrace(); + }finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + }); +//正文 + + + log.error(JSONObject.toJSONString(requestDocid)); + for (String docid : docids) { + log.error("删除了" + docid); + ArchivesUtil.deleteDocByid(docid); + } + //-------------------------------------------------------------------- + RequestService requestService = new RequestService(); + RequestInfo requestInfo = requestService.getRequest(Util.getIntValue(requestid), 100); + String workflowid = requestInfo.getWorkflowid(); + String logFile = ArchivesUtil.getSignLog(requestid, CBDDIR + File.separator + LZXXDIR, requestInfo.getCreatorid() + requestInfo.getDescription(), templatePath, filePath,false,workflowid); + String s = ArchivesUtil.callApi(Url, new File(logFile)); + log.error(s); + JSONObject result = JSONObject.parseObject(s); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, logFile + ".pdf"); + } + String zipName = filePath + File.separator + newRequestid + ".zip"; + ZipUtil.zip(filePath + File.separator + newRequestid, zipName); + log.error("zipName:{}", zipName); + String ftpFilePath = HgUtils.putFile(zipName, newRequestid + ".zip"); + log.error("ftpFilePath:{}", ftpFilePath); + updateRecord(requestid,"esbwjml",ftpFilePath); + ArchivesUtil.deleteDirectory(filePath + File.separator + newRequestid); + // String ftpFilePathNew = HgUtils.putFile(zipName, "test" + File.separator + requestid + ".zip"); + // log.error("ftpFilePathNew:{}", ftpFilePathNew); + String context = getContext(requestid, requesData, newRequestid + ".zip", zwFileName, fjFileName); + // insertRecord(requestid, context, ftpFilePath); + updateRecord(requestid,"content",context); + log.error("context:{}", context); + return context; + } + + + /*** + * 封装数据 + * @param requestid + * @return + */ + public Map getRequestByid(int requestid) { + HashMap record = new HashMap<>(); + String sql = "select * from formtable_main_49 where requestid = ?"; + String reqsql = "select REQUESTNAME from WORKFLOW_REQUESTBASE where REQUESTID = ?"; + RecordSet rs = new RecordSet(); + rs.executeQuery(sql, requestid); + if (rs.next()) { + record.put("fj", Util.null2String(rs.getString("fj"))); + record.put("dwd", Util.null2String(rs.getString("dwd"))); + record.put("zw", Util.null2String(rs.getString("zw"))); + record.put("ngrq", Util.null2String(rs.getString("ngrq"))); + record.put("jghwt", Util.null2String(rs.getString("jghwt"))); + record.put("bh", Util.null2String(rs.getString("bh"))); + record.put("ngbm", Util.null2String(rs.getString("ngbm"))); + record.put("bgqx", Util.null2String(rs.getString("bgqx"))); + record.put("cwrq", Util.null2String(rs.getString("cwrq"))); + record.put("ys", Util.null2String(rs.getString("ys"))); + record.put("wz", Util.null2String(rs.getString("wz"))); + record.put("ngbm", Util.null2String(rs.getString("ngbm"))); + record.put("lb", Util.null2String(rs.getString("lb"))); + record.put("bz", Util.null2String(rs.getString("bz"))); + record.put("yywh", Util.null2String(rs.getString("yywh"))); + record.put("wjlx", Util.null2String(rs.getString("wjlx"))); + record.put("fwlx", Util.null2String(rs.getString("fwlx"))); + record.put("f", Util.null2String(rs.getString("f"))); + record.put("ngr", Util.null2String(rs.getString("ngr"))); + record.put("qgqhj", Util.null2String(rs.getString("qgqhj"))); + record.put("thhlh", Util.null2String(rs.getString("thhlh"))); + + } + rs.executeQuery(reqsql, requestid); + if (rs.next()) { + record.put("REQUESTNAME", Util.null2String(rs.getString("REQUESTNAME"))); + } + return record; + } + + private String getContext(int requestid, Map requesData, String zipName, List zwFileName, List fjFileName) { + StringBuilder context = new StringBuilder(); + try { + DepartmentComInfo departmentComInfo = new DepartmentComInfo(); + String ngrq = Util.null2String(requesData.get("ngrq")); //拟稿日期 + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + LocalDate date = LocalDate.parse(ngrq, formatter); + int year = date.getYear(); + context.append(year).append("|"); //1.年度 -> 拟稿日期 + String jghwt = Util.null2String(requesData.get("jghwt"));//2.机构或问题 -> 机构或问题 + context.append(jghwt).append("|"); + String bh = Util.null2String(requesData.get("bh"));// 3.文号 -> 编号 + context.append(bh).append("|"); + String requestname = Util.null2String(requesData.get("REQUESTNAME")); // 4.文件题名 -> 流程名称 + context.append(requestname).append("|"); + String ngbmName = Util.null2String(departmentComInfo.getDepartmentmark(requesData.get("ngbm"))); //5 责任者 -> 拟稿部门 + context.append(ngbmName).append("|"); + String bgqx = Util.null2String(requesData.get("bgqx")); //6 保管期限 -> 保管期限 + context.append(bgqx).append("|"); + String cwrq = Util.null2String(requesData.get("cwrq")); //7 日期 -> 成文日期 + context.append(cwrq).append("|"); + String ys = Util.null2String(requesData.get("ys")); //8 页数 -> 页数 + context.append(ys).append("|"); + String wz = Util.null2String(requesData.get("wz")); //9 文种 -> 文种 + context.append(wz).append("|"); + String ngbm = Util.null2String(requesData.get("ngbm")); + String[] deptData = ArchivesUtil.getDeptNameAndCode(ngbm); + String[] subData = ArchivesUtil.getSubCom(ngbm); + context.append(subData[0]).append("|"); //10 行编号 -> 拟稿部门 + + context.append(subData[1]).append("|"); //11 行名称 + context.append("").append("|"); // 12 保管期限编号 + context.append("").append("|"); // 13 保管期限及编号 + context.append("").append("|"); // 14 是否开放 + context.append("").append("|"); // 15 互见号 + String lb = Util.null2String(requesData.get("lb")); + context.append(lb).append("|"); //16 类别 -> 类别 + //TODO + String xgbm = Util.null2String(getAssociatedDepts(requesData)); + context.append(xgbm).append("|"); //17 相关部门 -> 流经部门 + // String lwh = Util.null2String(requesData.get("lwh")); + context.append("").append("|");// 18 收文号 -> 空 + String fs = ""; + context.append(fs).append("|"); // 19 份数 -> 份数 + String bz = Util.null2String(requesData.get("bz")); + context.append("").append("|"); // 20 备注 -> 备注 + String yywh = Util.null2String(requesData.get("yywh")); + context.append("").append("|"); // 21 引用文号 -> 引用文号 + String wjlx = Util.null2String(requesData.get("wjlx")); + context.append("").append("|"); // 22 文件类型 -> 空 + String fwlx = Util.null2String(requesData.get("fwlx")); + context.append("分行发文").append("|"); // 23 发文类型 -> 空 + String f = Util.null2String(requesData.get("f")); + context.append(f).append("|"); // 24 发 -> 空 + String ngr = Util.null2String(requesData.get("ngr")); + context.append(new User(Util.getIntValue(ngr)).getLoginid()).append("|"); // 25 拟稿人 -> 拟稿人 + context.append(ngbmName).append("|"); // 26 拟稿部门 -> 拟稿部门名称 + context.append("发文").append("|"); // 27 公文类型 -> "收文" + //TODO + context.append(ArchivesUtil.getAssociatedPersons(requestid,false)).append("|"); // 28 相关人员 -> 参与人员 + context.append("智慧OA").append("|"); // 29 数据来源 -> 数据来源 + context.append(year).append("|"); // 30 形成年度 -> 年份 + context.append(String.join("&&", zwFileName)).append("|"); // 31 正文名称 + context.append(String.join("&&", fjFileName)).append("|"); // 32 附件名称 + context.append("togd"+requestid).append("|"); // 33 主键 + context.append("").append("|"); // 34 关联主键 + context.append("").append("|"); // 35 被关联主键 + context.append(zipName);// 36 压缩包名称 + } catch (Exception e) { + e.printStackTrace(); + log.error("getContextError:{}", e.getMessage()); + } + + return context.toString(); + } + + + + + private String getAssociatedDepts(Map requesData) { + HashSet records = new HashSet<>(); + records.addAll(Arrays.asList(Util.null2String(requesData.get("hqbm")).split(","))); // 会签部门 + records.addAll(Arrays.asList(Util.null2String(requesData.get("ngbm")).split(","))); // 拟稿部门 + records.addAll(Arrays.asList(Util.null2String(requesData.get("bmyb")).split(","))); // 部门阅办 + records.addAll(Arrays.asList(Util.null2String(requesData.get("cs")).split(","))); // 抄送 + records.addAll(Arrays.asList(Util.null2String(requesData.get("nbfs")).split(","))); // 本行发送 + records.addAll(Arrays.asList(Util.null2String(requesData.get("zs")).split(","))); // 主送 + records.addAll(Arrays.asList(Util.null2String(requesData.get("dqbm")).split(","))); // 当前部门 + records.addAll(Arrays.asList(Util.null2String(requesData.get("cb")).split(","))); // 抄报 + records.addAll(Arrays.asList(Util.null2String(requesData.get("bmhqzj")).split(","))); // 部门会签(追加) + records.addAll(Arrays.asList(Util.null2String(requesData.get("bmybzj")).split(","))); // 部门阅办(追加) + ArrayList deptName = new ArrayList<>(); + DepartmentComInfo departmentComInfo = new DepartmentComInfo(); + for (String record : records) { + try { + if (StringUtil.isEmpty(record)){ + continue; + } + String departmentName = departmentComInfo.getDepartmentmark(record); + deptName.add(departmentName); + } catch (Exception e) { + e.printStackTrace(); + } + } + + return String.join("&&", deptName); + } + + private void updateRecord(int requestid, String field , String fieldvalue) { + String sql = "update uf_pushArchivesLog set "+field+" = ? where request = ?"; + RecordSet recordSet = new RecordSet(); + recordSet.executeUpdate(sql, fieldvalue, requestid); + } + + +} diff --git a/com/engine/custom/archives/service/firstBranch/FirstBranchSignReportPushArchivesService.java b/com/engine/custom/archives/service/firstBranch/FirstBranchSignReportPushArchivesService.java new file mode 100644 index 0000000..56a8d2b --- /dev/null +++ b/com/engine/custom/archives/service/firstBranch/FirstBranchSignReportPushArchivesService.java @@ -0,0 +1,541 @@ +package com.engine.custom.archives.service.firstBranch; + +import cn.hutool.core.util.ZipUtil; +import com.alibaba.fastjson.JSONObject; +import com.dcfs.fts.common.error.FtpException; +import com.engine.custom.archives.entity.PushArchivesBean; +import com.engine.custom.archives.util.ArchivesUtil; +import com.engine.custom.archives.util.KeyWord; +import com.engine.custom.hg.util.HgUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import weaver.conn.RecordSet; +import weaver.file.ImageFileManager; +import weaver.general.StringUtil; +import weaver.general.Util; +import weaver.hrm.User; +import weaver.hrm.company.DepartmentComInfo; +import weaver.soa.workflow.request.RequestInfo; +import weaver.soa.workflow.request.RequestService; + +import java.io.*; +import java.text.SimpleDateFormat; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.*; + +public class FirstBranchSignReportPushArchivesService implements KeyWord { + public static Logger log = LoggerFactory.getLogger("Archives"); + private static String filePath; + private static String Url; + private static String templatePath; // 模板文件路径 + + private int endTime= 7; + + public void setProp(Map param) { + filePath = Util.null2String(param.get("filePath")); + Url = Util.null2String(param.get("Url")); + templatePath = Util.null2String(param.get("templatePath")); + endTime = Util.getIntValue(param.get("endTime"),7); + } + + public void pushArchives(Map param) { + Date date = ArchivesUtil.getDate(); + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); + String format = dateFormat.format(date); + SimpleDateFormat yyyyMMddHHmmss = new SimpleDateFormat("yyyy-MM-dd HH:mm"); + // 获取当前时间的第一秒 + String firstSecond = yyyyMMddHHmmss.format(ArchivesUtil.getFirstSecondOfDate(date)); + // 获取当前时间的最后一秒 + String lastSecond = yyyyMMddHHmmss.format(ArchivesUtil.getLastSecondOfDate(date)); + RecordSet recordSet = new RecordSet(); + //签报 type = 2 + List result = ArchivesUtil.getResultList(recordSet, firstSecond, lastSecond, 5); + log.error("推送发文的数量:{}", result.size()); + File file = ArchivesUtil.crFile(filePath + "/togd_" + new SimpleDateFormat("yyyyMMdd000000").format(date)); + log.error("textfile:{}", file.getAbsolutePath()); + for (PushArchivesBean pushArchivesBean : result) { + if (ArchivesUtil.isAfterSevenAM(endTime)){ + log.info("超过执行时间:{}点暂停计划任务",endTime); + break; + } + int id = pushArchivesBean.getId(); + int request = pushArchivesBean.getRequest(); + log.error("推送的requestId:{}", request); + try { + String context = generateFile(request); + if ("-1".equals(context)){ + continue; + } + ArchivesUtil.writeToTxt(file.getPath(), file.getName(), context, true); + File txtzip = new File(filePath + File.separator + "togd_" + new SimpleDateFormat("yyyyMMdd000000").format(date) + ".zip"); + log.error("textZipFile:{}", txtzip.getAbsolutePath()); + OutputStream outputStream = new FileOutputStream(txtzip); + File writename = new File(file.getPath() + "/" + file.getName() + ".txt"); + com.engine.custom.hg.util.ZipUtil.filesToZip(writename, outputStream, writename.getName()); + log.error("writename:{}", writename.getName()); + String s = HgUtils.putFile(txtzip.getAbsolutePath(), txtzip.getName()); + // updateRecord(request, s); + updateRecord(request,"esbtxtml",s); + updateRecord(request,"zt","0"); + log.error("textZip:{}", s); + } catch (FtpException e) { + log.error("推送档案requestid:{}异常,异常原因为:{}",request,e.getMessage()); + e.printStackTrace(); + } catch (IOException e) { + log.error("推送档案requestid:{}异常,异常原因为:{}",request,e.getMessage()); + e.printStackTrace(); + } catch (Exception e) { + log.error("推送档案requestid:{}异常,异常原因为:{}",request,e.getMessage()); + + e.printStackTrace(); + } + } + } + + + + private String generateFile(int requestid) throws FtpException, IOException { + Map requesData = getRequestByid(requestid); + String newRequestid = "togd"+requestid; + log.info("requesData:{}", requesData); + String bhnew = requesData.get("bhnew"); + log.info("流程id:{}:文号为空不推送", requestid); + if (StringUtil.isEmpty(bhnew)){ + return "-1"; + } + String fj = Util.null2String(requesData.get("fj")); + String dwd = Util.null2String(requesData.get("dwd")); + String zw = Util.null2String(requesData.get("zw")); + String qgqhj = Util.null2String(requesData.get("qgqhj")); + //可能有多个,获取id最大的一个 + qgqhj = Util.null2String(ArchivesUtil.findMaxValue(qgqhj)); + + //增加签字意见中的附件到附件文件夹中 + Map signFiles = ArchivesUtil.getSignFiles(requestid,true); + List docids = new ArrayList<>(); + // docids.addAll(Arrays.asList(fj.split(","))); + // docids.addAll(Arrays.asList(zwkbj.split(","))); + Map fjMap = ArchivesUtil.getFileIdByDocId(fj); + Map zwMap = ArchivesUtil.getFileIdByDocId(zw); + Map qgqhjMap = ArchivesUtil.getFileIdByDocId(qgqhj); + List zwFileName = new ArrayList<>(); + List fjFileName = new ArrayList<>(); + final int[] i = {1}; + //附件 + fjMap.forEach((docid, imageid) -> { + ImageFileManager imageFileManager = new ImageFileManager(); + imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + InputStream inputStream = imageFileManager.getInputStream(); + //中文路径/中文文件名 + String imageFileName = filePath + File.separator + newRequestid + File.separator + FJDIR + File.separator + LCFJWORD + "-" +imageFileManager.getImageFileName(); + fjFileName.add(imageFileManager.getImageFileName()); + log.info("生成附件路径:{}", imageFileName); + imageFileName = ArchivesUtil.codeUtf8(imageFileName); + try { + File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + String jsonStr = ArchivesUtil.callApi(Url, file); + log.error("永中接口返回数据:{}", jsonStr); + JSONObject result = JSONObject.parseObject(jsonStr); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + FJDIR + File.separator + LCFJWORD + "-" + imageFileManager.getImageFileName() + ".pdf"); + } + } catch (IOException e) { + e.printStackTrace(); + } finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + }); + + //签字意见附件 + signFiles.forEach((docid, imageid) -> { + ImageFileManager imageFileManager = new ImageFileManager(); + imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + InputStream inputStream = imageFileManager.getInputStream(); + //中文路径/中文文件名 + String imageFileName = filePath + File.separator + newRequestid + File.separator + FJDIR + File.separator + QZYJFJWORD+ "-" +imageFileManager.getImageFileName(); + fjFileName.add(imageFileManager.getImageFileName()); + log.info("生成签字意见附件路径:{}", imageFileName); + imageFileName = ArchivesUtil.codeUtf8(imageFileName); + try { + File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + String jsonStr = ArchivesUtil.callApi(Url, file); + log.error("永中接口返回数据:{}", jsonStr); + JSONObject result = JSONObject.parseObject(jsonStr); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + FJDIR + File.separator + QZYJFJWORD+ "-" + imageFileManager.getImageFileName() + ".pdf"); + } + } catch (IOException e) { + e.printStackTrace(); + } finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + }); + + + //正文 + zwMap.forEach((docid, imageid) -> { + ImageFileManager imageFileManager = new ImageFileManager(); + imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + InputStream inputStream = imageFileManager.getInputStream(); + + String newFile = FJWORD + i[0] + "_" + ZWWORD + "-" + (imageFileManager.getImageFileName().replaceAll("/","-")); + //中文路径/中文文件名 + String imageFileName = filePath + File.separator + newRequestid + File.separator + ZWDIR + File.separator + newFile; + zwFileName.add(newFile); + log.info("生成正文路径:{}", imageFileName); + imageFileName = ArchivesUtil.codeUtf8(imageFileName); + try { + File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + String jsonStr = ArchivesUtil.callApi(Url, file); + log.error("永中接口返回:{}", jsonStr); + JSONObject result = JSONObject.parseObject(jsonStr); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + ZWDIR + File.separator + newFile + ".pdf"); + } + } catch (IOException e) { + e.printStackTrace(); + } finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + i[0]++; + }); + //清稿前痕迹 + qgqhjMap.forEach((docid, imageid) -> { + ImageFileManager imageFileManager = new ImageFileManager(); + imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + InputStream inputStream = imageFileManager.getInputStream(); + + String newFile = FJWORD + i[0] + "_" + LHGWORD + "-" + (imageFileManager.getImageFileName().replaceAll("/","-")); + zwFileName.add(newFile); + //中文路径/中文文件名 + String imageFileName = filePath + File.separator + newRequestid + File.separator + ZWDIR + File.separator + newFile; + log.info("生成清稿前痕迹路径:{}", imageFileName); + imageFileName = ArchivesUtil.codeUtf8(imageFileName); + try { + File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + String jsonStr = ArchivesUtil.callApi(Url, file); + log.error("永中接口返回:{}", jsonStr); + JSONObject result = JSONObject.parseObject(jsonStr); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + ZWDIR + File.separator + newFile + ".pdf"); + } + } catch (IOException e) { + e.printStackTrace(); + } finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + i[0]++; + }); + //套红后留痕 + // thhlhMap.forEach((docid, imageid) -> { + // ImageFileManager imageFileManager = new ImageFileManager(); + // imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + // InputStream inputStream = imageFileManager.getInputStream(); + // zwFileName.add(imageFileManager.getImageFileName()); + // //中文路径/中文文件名 + // String imageFileName = filePath + File.separator + requestid + File.separator + zwdir + File.separator + fjWord + i[0] + "_" + lhgWord + "_" + imageFileManager.getImageFileName(); + // log.info("生成套红后留痕路径:{}", imageFileName); + // imageFileName = ArchivesUtil.codeUtf8(imageFileName); + // try { + // File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + // String jsonStr = ArchivesUtil.callApi(Url, file); + // log.error("永中接口返回:{}", jsonStr); + // JSONObject result = JSONObject.parseObject(jsonStr); + // String errorcode = result.getString("errorcode"); + // if ("0".equals(errorcode)) { + // JSONObject data = result.getJSONObject("data"); + // String destFileName = data.getString("destFileName"); + // String viewUrl = data.getString("viewUrl"); + // ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + requestid + File.separator + zwdir + File.separator + fjWord + i[0] + "_" + lhgWord + "_" + imageFileManager.getImageFileName() + ".pdf"); + // } + // } catch (IOException e) { + // e.printStackTrace(); + // } + // i[0]++; + // }); + + //开始承办单 先获取主流程的承办单 + List requestDocid = ArchivesUtil.generaRequestFormPdf(requestid, 0); + // 1.去掉生成子流程承办单 + // List subRequestDocid = generaSubRequestFormPdf(requestid); + Map reqDocMap = ArchivesUtil.getFileIdByDocId(String.join(",", requestDocid)); + // 2.去掉生成子流程承办单 + // Map subReqDocMap = getFileIdByDocId(String.join(",", subRequestDocid)); + log.error("reqDocMap:{}", JSONObject.toJSONString(reqDocMap)); + //log.error("subReqDocMap:{}", JSONObject.toJSONString(subReqDocMap)); + docids.addAll(requestDocid); + // 3.去掉生成子流程承办单 + // docids.addAll(subRequestDocid); + i[0] = 1; + //主流程承办单 + reqDocMap.forEach((docid, imageid) -> { + ImageFileManager imageFileManager = new ImageFileManager(); + imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + InputStream inputStream = imageFileManager.getInputStream(); + //中文路径/中文文件名 + // String imageFileName = filePath + File.separator + requestid + File.separator + cbddir + File.separator + fjFile + i[0] + "_" + imageFileManager.getImageFileName(); + // String imageFileName = filePath + File.separator + newRequestid + File.separator + cbddir + File.separator + fjFile + i[0] + "_" + wjcldWord+".pdf"; + String imageFileName = filePath + File.separator + newRequestid + File.separator + CBDDIR + File.separator + WJCLDWORD+".pdf"; + log.info("主流程承办单路径:{}", imageFileName); + imageFileName = ArchivesUtil.codeUtf8(imageFileName); + try { + File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + String jsonStr = ArchivesUtil.callApi(Url, file); + log.error("永中接口返回:{}", jsonStr); + JSONObject result = JSONObject.parseObject(jsonStr); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + // ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + cbddir + File.separator + fjFile + i[0] + "_" + wjcldWord + ".pdf" + ".pdf"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + CBDDIR + File.separator + WJCLDWORD + ".pdf" + ".pdf"); + } + i[0]++; + } catch (IOException e) { + e.printStackTrace(); + }finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + }); +//正文 + + + log.error(JSONObject.toJSONString(requestDocid)); + for (String docid : docids) { + log.error("删除了" + docid); + ArchivesUtil.deleteDocByid(docid); + } + //-------------------------------------------------------------------- + RequestService requestService = new RequestService(); + RequestInfo requestInfo = requestService.getRequest(Util.getIntValue(requestid), 100); + String workflowid = requestInfo.getWorkflowid(); + String logFile = ArchivesUtil.getSignLog(requestid, CBDDIR + File.separator + LZXXDIR, requestInfo.getCreatorid() + requestInfo.getDescription(), templatePath, filePath,false,workflowid); + String s = ArchivesUtil.callApi(Url, new File(logFile)); + log.error(s); + JSONObject result = JSONObject.parseObject(s); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, logFile + ".pdf"); + } + String zipName = filePath + File.separator + newRequestid + ".zip"; + ZipUtil.zip(filePath + File.separator + newRequestid, zipName); + log.error("zipName:{}", zipName); + String ftpFilePath = HgUtils.putFile(zipName, newRequestid + ".zip"); + log.error("ftpFilePath:{}", ftpFilePath); + updateRecord(requestid,"esbwjml",ftpFilePath); + ArchivesUtil.deleteDirectory(filePath + File.separator + newRequestid); + + // String ftpFilePathNew = HgUtils.putFile(zipName, "test" + File.separator + requestid + ".zip"); + // log.error("ftpFilePathNew:{}", ftpFilePathNew); + String context = getContext(requestid, requesData, newRequestid + ".zip", zwFileName, fjFileName); + // insertRecord(requestid, context, ftpFilePath); + updateRecord(requestid,"content",context); + log.error("context:{}", context); + return context; + } + + + /*** + * 封装数据 + * @param requestid + * @return + */ + public Map getRequestByid(int requestid) { + HashMap record = new HashMap<>(); + String sql = "select * from formtable_main_69 where requestid = ?"; + String reqsql = "select REQUESTNAME from WORKFLOW_REQUESTBASE where REQUESTID = ?"; + RecordSet rs = new RecordSet(); + rs.executeQuery(sql, requestid); + if (rs.next()) { + record.put("bh", Util.null2String(rs.getString("bh"))); + record.put("bhnew", Util.null2String(rs.getString("bhnew"))); + record.put("ngbm", Util.null2String(rs.getString("ngbm"))); + record.put("ngr", Util.null2String(rs.getString("ngr"))); + record.put("ngrq", Util.null2String(rs.getString("ngrq"))); + record.put("lxfs", Util.null2String(rs.getString("lxfs"))); + record.put("bt", Util.null2String(rs.getString("bt"))); + record.put("zw", Util.null2String(rs.getString("zw"))); + record.put("fj", Util.null2String(rs.getString("fj"))); + record.put("hqbm", Util.null2String(rs.getString("hqbm"))); + record.put("hqbmzhwy", Util.null2String(rs.getString("hqbmzhwy"))); + record.put("hqdqbm", Util.null2String(rs.getString("hqdqbm"))); + record.put("ffbm", Util.null2String(rs.getString("ffbm"))); + record.put("hqbmzjhqbmzj", Util.null2String(rs.getString("hqbmzj"))); + record.put("dwd", Util.null2String(rs.getString("dwd"))); + record.put("bmffzj", Util.null2String(rs.getString("bmffzj"))); + record.put("dqnf", Util.null2String(rs.getString("dqnf"))); + record.put("qgqhj", Util.null2String(rs.getString("qgqhj"))); + } + rs.executeQuery(reqsql, requestid); + if (rs.next()) { + record.put("REQUESTNAME", Util.null2String(rs.getString("REQUESTNAME"))); + } + return record; + } + + + private String getContext(int requestid, Map requesData, String zipName, List zwFileName, List fjFileName) { + StringBuilder context = new StringBuilder(); + try { + DepartmentComInfo departmentComInfo = new DepartmentComInfo(); + String ngrq = Util.null2String(requesData.get("ngrq")); //拟稿日期 + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + LocalDate date = LocalDate.parse(ngrq, formatter); + int year = date.getYear(); + context.append(year).append("|"); //1.年度 -> 拟稿日期 + String jghwt = Util.null2String(requesData.get("jghwt"));//2.机构或问题 -> 机构或问题 + context.append(jghwt).append("|"); + String bh = Util.null2String(requesData.get("bhnew"));// 3.文号 -> 编号 + context.append(bh).append("|"); + String requestname = Util.null2String(requesData.get("REQUESTNAME")); // 4.文件题名 -> 流程名称 + context.append(requestname).append("|"); + String ngbmName = Util.null2String(departmentComInfo.getDepartmentname(requesData.get("ngbm"))); //5 责任者 -> 拟稿部门 + context.append(ngbmName).append("|"); + String bgqx = Util.null2String(requesData.get("bgqx")); //6 保管期限 -> 保管期限 + context.append(bgqx).append("|"); + // String cwrq = Util.null2String(requesData.get("cwrq")); //7 日期 -> 成文日期 + context.append(ngrq).append("|"); + String ys = Util.null2String(requesData.get("ys")); //8 页数 -> 页数 + context.append(ys).append("|"); + String wz = Util.null2String(requesData.get("wz")); //9 文种 -> 文种 + context.append(wz).append("|"); + String ngbm = Util.null2String(requesData.get("ngbm")); + String[] deptData = ArchivesUtil.getDeptNameAndCode(ngbm); + String[] subData = ArchivesUtil.getSubCom(ngbm); + context.append(subData[0]).append("|"); //10 行编号 -> 拟稿部门 + + context.append(subData[1]).append("|"); //11 行名称 + context.append("").append("|"); // 12 保管期限编号 + context.append("").append("|"); // 13 保管期限及编号 + context.append("").append("|"); // 14 是否开放 + context.append("").append("|"); // 15 互见号 + String lb = Util.null2String(requesData.get("lb")); + context.append(lb).append("|"); //16 类别 -> 类别 + //TODO + String xgbm = Util.null2String(getAssociatedDepts(requesData)); + context.append(xgbm).append("|"); //17 相关部门 -> 流经部门 + // String lwh = Util.null2String(requesData.get("lwh")); + context.append("").append("|");// 18 收文号 -> 空 + String fs = ""; + context.append(fs).append("|"); // 19 份数 -> 份数 + String bz = Util.null2String(requesData.get("bz")); + context.append("").append("|"); // 20 备注 -> 备注 + String yywh = Util.null2String(requesData.get("yywh")); + context.append("").append("|"); // 21 引用文号 -> 引用文号 + String wjlx = Util.null2String(requesData.get("wjlx")); + context.append("").append("|"); // 22 文件类型 -> 空 + String fwlx = Util.null2String(requesData.get("fwlx")); + context.append("分行签报").append("|"); // 23 发文类型 -> 空 + String f = Util.null2String(requesData.get("f")); + context.append(f).append("|"); // 24 发 -> 空 + String ngr = Util.null2String(requesData.get("ngr")); + context.append(new User(Util.getIntValue(ngr)).getLoginid()).append("|"); // 25 拟稿人 -> 拟稿人 + context.append(ngbmName).append("|"); // 26 拟稿部门 -> 拟稿部门名称 + context.append("签报").append("|"); // 27 公文类型 -> "收文" + //TODO + context.append(ArchivesUtil.getAssociatedPersons(requestid,false)).append("|"); // 28 相关人员 -> 参与人员 + context.append("智慧OA").append("|"); // 29 数据来源 -> 数据来源 + context.append(year).append("|"); // 30 形成年度 -> 年份 + context.append(String.join("&&", zwFileName)).append("|"); // 31 正文名称 + context.append(String.join("&&", fjFileName)).append("|"); // 32 附件名称 + context.append("togd"+requestid).append("|"); // 33 主键 + context.append("").append("|"); // 34 关联主键 + context.append("").append("|"); // 35 被关联主键 + context.append(zipName);// 36 压缩包名称 + } catch (Exception e) { + e.printStackTrace(); + log.error("getContextError:{}", e.getMessage()); + } + + return context.toString(); + } + private String getAssociatedDepts(Map requesData) { + HashSet records = new HashSet<>(); + records.addAll(Arrays.asList(Util.null2String(requesData.get("ngbm")).split(","))); // 会签部门 + records.addAll(Arrays.asList(Util.null2String(requesData.get("hqbm")).split(","))); // 拟稿部门 + records.addAll(Arrays.asList(Util.null2String(requesData.get("ffbm")).split(","))); // 部门阅办 + records.addAll(Arrays.asList(Util.null2String(requesData.get("hqbmzj")).split(","))); // 抄送 + // records.addAll(Arrays.asList(Util.null2String(requesData.get("bmffzj")).split(","))); // 本行发送 + + ArrayList deptName = new ArrayList<>(); + DepartmentComInfo departmentComInfo = new DepartmentComInfo(); + for (String record : records) { + try { + if (StringUtil.isEmpty(record)){ + continue; + } + String departmentName = departmentComInfo.getDepartmentName(record); + deptName.add(departmentName); + } catch (Exception e) { + e.printStackTrace(); + } + } + + return String.join("&&", deptName); + } + + private void updateRecord(int requestid, String s) { + String sql = "update uf_pushArchivesLog set esbtxtml = ? where request = ?"; + RecordSet recordSet = new RecordSet(); + recordSet.executeUpdate(sql, s, requestid); + } + private void updateRecord(int requestid, String field , String fieldvalue) { + String sql = "update uf_pushArchivesLog set "+field+" = ? where request = ?"; + RecordSet recordSet = new RecordSet(); + recordSet.executeUpdate(sql, fieldvalue, requestid); + } +} + + +//secondBranch \ No newline at end of file diff --git a/com/engine/custom/archives/service/impl/HtmlToPdfServiceCusImpl.java b/com/engine/custom/archives/service/impl/HtmlToPdfServiceCusImpl.java index 0dadc36..56f7c49 100644 --- a/com/engine/custom/archives/service/impl/HtmlToPdfServiceCusImpl.java +++ b/com/engine/custom/archives/service/impl/HtmlToPdfServiceCusImpl.java @@ -4,10 +4,12 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.engine.core.impl.Service; import com.engine.custom.archives.service.HtmlToPdfServiceCus; +import com.engine.custom.archives.util.ArchivesUtil; import com.engine.custom.archives.workflow.cmd.requestLog.LoadRequestLogDataCusCmd; import com.engine.workflow.biz.RequestLogBiz; import com.engine.workflow.biz.requestForm.LayoutInfoBiz; import com.engine.workflow.cmd.requestForm.*; +import com.engine.workflow.entity.requestForm.FieldValueBean; import com.engine.workflow.entity.requestForm.TableInfo; import org.apache.commons.lang.StringUtils; @@ -17,14 +19,14 @@ import weaver.conn.RecordSet; import weaver.general.BaseBean; import weaver.general.Util; import weaver.hrm.User; +import weaver.hrm.company.DepartmentComInfo; import weaver.workflow.request.RequestManagerForTipsinfo; import weaver.workflow.request.WFLinkInfo; +import weaver.workflow.workflow.WorkflowBillComInfo; +import weaver.workflow.workflow.WorkflowComInfo; import javax.servlet.http.HttpServletRequest; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; public class HtmlToPdfServiceCusImpl extends Service implements HtmlToPdfServiceCus { public static Logger log = LoggerFactory.getLogger("Archives"); @@ -39,6 +41,7 @@ public class HtmlToPdfServiceCusImpl extends Service implements HtmlToPdfService Map result =new HashMap(); String requestid = Util.null2String(reqpParams.get("requestid")); String modeid = Util.null2String(reqpParams.get("modeid")); + String workflowid = Util.null2String(reqpParams.get("workflowid")); //只需要转换html int onlyHtml = Util.getIntValue(Util.null2String(reqpParams.get("onlyHtml")),0); //用wktohtml转换 @@ -92,6 +95,105 @@ public class HtmlToPdfServiceCusImpl extends Service implements HtmlToPdfService Map maindata = commandExecutor.execute(new FormDataCmd(requestMap, user, params, (Map) forminfo.get("tableInfo"))); apidatas.put("maindata", maindata.get("datas")); + //根据流程id获取是否需要协办 + RecordSet rs = new RecordSet(); + rs.executeQuery("select * from uf_ArchivesSet where mainwfid = ?",workflowid); + //是否有协办流程 + //------------------------------start---------------------------- + try { + + + boolean isCo = false; + String cowfid = ""; + String cofield = ""; + String cofieldid = ""; + if (rs.next()){ + cowfid = Util.null2String(rs.getString("cowfid")); + if (!StringUtils.isBlank(cowfid)){ + isCo = true; + cofield = Util.null2String(rs.getString("cofield")); + cofieldid = Util.null2String(rs.getString("cofieldid")); + } + } + log.info("isCo:{};cowfid:{};cofield:{};cofieldid:{}",isCo,cowfid,cofield,cofieldid); + + + if(isCo){ + ArrayList CoSubRequest = new ArrayList<>(); + List Cowfids = Arrays.asList(cowfid.split(",")); + Map subRequest = ArchivesUtil.getSubRequest(requestid, 6); + log.info("subRequest:{}",subRequest); + for (Map.Entry subRequestEntry : subRequest.entrySet()) { + String subWFid = subRequestEntry.getValue(); + if (Cowfids.contains(subWFid)){ + CoSubRequest.add(subRequestEntry.getKey()); + } + } + log.info("CoSubRequest.size:{}",CoSubRequest.size()); + if (CoSubRequest.size() != 0){ + WorkflowComInfo wf = new WorkflowComInfo(); + WorkflowBillComInfo wcInfo = new WorkflowBillComInfo(); + String formId = wf.getFormId(Cowfids.get(0)); + String tablename = wcInfo.getTablename(formId); + String cosql = "select "+cofield+" from " + tablename + " where " + + " requestid in ( " + String.join(",",CoSubRequest) + " ) " + + " order by requestid asc "; + log.info("cosql:{}",cosql); + + rs.executeQuery(cosql); + log.info("rs.getExceptionMsg():{}",rs.getExceptionMsg()); + String fieldValue = ""; + String[] cofieldsplit = cofield.split(","); + String codept = cofieldsplit[0]; //协办部门 + String corequirement = cofieldsplit[1]; //协办要求 + + while (rs.next()){ + String codeptValue = Util.null2String(rs.getString(codept)); + String corequirementText = Util.null2String(rs.getString(corequirement)); + log.info("codeptValue:{}",codeptValue); + log.info("corequirementText:{}",corequirementText); + String codeptText = ""; + String[] split = codeptValue.split(","); + DepartmentComInfo deptCom = new DepartmentComInfo(); + for (String item : split) { + try { + String departmentName = deptCom.getDepartmentName(item); + codeptText = codeptText + "," + departmentName; + } catch (Exception e) { + e.printStackTrace(); + } + } + log.info("codeptText:{}",codeptText); + if (codeptText.startsWith(",")){ + codeptText = codeptText.substring(1); + } + if (!StringUtils.isBlank(codeptText)) { + fieldValue = fieldValue + "\n" + codeptText + " : " + corequirementText; + } + } + log.info("fieldValue:{}",fieldValue); + if (fieldValue.startsWith("\n")){ + fieldValue = fieldValue.substring(1); + } + log.info("fieldValue:{}",fieldValue); + HashMap cofieldMap = new HashMap<>(); + cofieldMap.put("value",fieldValue); + log.info("maindataold:{}",maindata); + FieldValueBean fieldValueBean = new FieldValueBean(); + fieldValueBean.setValue(fieldValue); + Map datas = (Map)maindata.get("datas"); + log.info("datas:{}",datas); + log.info("datas:{}", datas.getClass().getName() ); + + datas.put(cofieldid,fieldValueBean); + log.info("maindatanew:{}",maindata); + } + } + }catch (Exception e){ + e.printStackTrace(); + log.error(e.getMessage()); + } + //------------------------------end---------------------------- //明细表数据 Map tableinfomap = (Map)forminfo.get("tableInfo"); List detailmark = new ArrayList (); @@ -150,7 +252,7 @@ public class HtmlToPdfServiceCusImpl extends Service implements HtmlToPdfService } //获取签字意见 HttpServletRequest request = null; - int workflowid = (int) params.get("workflowid"); + // int workflowid = (int) params.get("workflowid"); int nodeid =(int) params.get("nodeid"); String isFormSignature = ""; recordSet.executeSql("select isFormSignature from workflow_flownode where workflowId=" + workflowid + " and nodeId=" + nodeid); @@ -178,6 +280,7 @@ public class HtmlToPdfServiceCusImpl extends Service implements HtmlToPdfService long end2 = System.currentTimeMillis()-start2; BaseBean baseBean = new BaseBean(); log.error("loadform接口+底部签字意见+detail耗时:"+end2); + log.error("apidata"+JSONObject.toJSONString(apidatas)); //是否开启水印 apidatas.put("isOpenWaterMark",reqpParams.get("isOpenWaterMark")); diff --git a/com/engine/custom/archives/service/secondBranch/SecondBranchReceivingPushArchivesService.java b/com/engine/custom/archives/service/secondBranch/SecondBranchReceivingPushArchivesService.java new file mode 100644 index 0000000..f05b285 --- /dev/null +++ b/com/engine/custom/archives/service/secondBranch/SecondBranchReceivingPushArchivesService.java @@ -0,0 +1,722 @@ +package com.engine.custom.archives.service.secondBranch; + + +import cn.hutool.core.util.ZipUtil; +import com.alibaba.fastjson.JSONObject; +import com.dcfs.fts.common.error.FtpException; +import com.engine.custom.archives.entity.PushArchivesBean; +import com.engine.custom.archives.util.ArchivesUtil; +import com.engine.custom.archives.util.KeyWord; +import com.engine.custom.hg.util.HgUtils; +import org.apache.commons.lang.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import weaver.conn.RecordSet; +import weaver.file.ImageFileManager; +import weaver.general.StringUtil; +import weaver.general.Util; +import weaver.hrm.User; +import weaver.hrm.company.DepartmentComInfo; +import weaver.soa.workflow.request.RequestInfo; +import weaver.soa.workflow.request.RequestService; +import weaver.workflow.workflow.WorkflowBillComInfo; +import weaver.workflow.workflow.WorkflowComInfo; + +import java.io.*; +import java.text.SimpleDateFormat; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.*; + + +public class SecondBranchReceivingPushArchivesService implements KeyWord { + private static String filePath; + private static String Url; + private static String templatePath; // 模板文件路径 + private int endTime= 7; + + public static Logger log = LoggerFactory.getLogger("Archives"); + + public void setProp(Map param) { + filePath = Util.null2String(param.get("filePath")); + Url = Util.null2String(param.get("Url")); + templatePath = Util.null2String(param.get("templatePath")); + endTime = Util.getIntValue(param.get("endTime"),7); + } + + + public void pushArchives(Map param) { + log.info("FirstBranchReceivingPushArchivesService ====Begin========{}", param); + try { + ZipUtil zipUtil = new ZipUtil(); + Date date = ArchivesUtil.getDate(); + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); + String format = dateFormat.format(date); + SimpleDateFormat yyyyMMddHHmmss = new SimpleDateFormat("yyyy-MM-dd HH:mm"); + // 获取当前时间的第一秒 + String firstSecond = yyyyMMddHHmmss.format(getFirstSecondOfDate(date)); + // 获取当前时间的最后一秒 + String lastSecond = yyyyMMddHHmmss.format(getLastSecondOfDate(date)); + + + RecordSet recordSet = new RecordSet(); + List result = ArchivesUtil.getResultList(recordSet, firstSecond, lastSecond, 7); + log.error("推送分行收文的数量:{}", result.size()); + File file = ArchivesUtil.crFile(filePath + "/togd_" + new SimpleDateFormat("yyyyMMdd000000").format(date)); + log.error("textfile:{}", file.getAbsolutePath()); + for (PushArchivesBean pushArchivesBean : result) { + if (ArchivesUtil.isAfterSevenAM(endTime)){ + log.info("超过执行时间:{}点暂停计划任务",endTime); + break; + } + int requestid = pushArchivesBean.getRequest(); + try { + log.error("requestid:{}", requestid); + //1.生成文件及推送的txt + String context = extracted(requestid); + log.error("context:{}", context); + //1.生成文件及推送的txt + ArchivesUtil.writeToTxt(file.getPath(), file.getName(), context, true); + File txtzip = new File(filePath + File.separator + "togd_" + new SimpleDateFormat("yyyyMMdd000000").format(date) + ".zip"); + log.error("textZipFile:{}", txtzip.getAbsolutePath()); + OutputStream outputStream = new FileOutputStream(txtzip); + File writename = new File(file.getPath() + "/" + file.getName() + ".txt"); + com.engine.custom.hg.util.ZipUtil.filesToZip(writename, outputStream, writename.getName()); + log.error("writename:{}",writename.getName()); + String s = HgUtils.putFile(txtzip.getAbsolutePath(), txtzip.getName()); + // updateRecord(requestid, s); + updateRecord(requestid,"esbtxtml",s); + updateRecord(requestid,"zt","0"); + log.error("textZip:{}", s); + }catch (Exception e){ + e.printStackTrace(); + log.error("推送档案requestid:{}异常,异常原因为:{}",requestid,e.getMessage()); + } + } + } catch (Exception e) { + log.info("PushArchivesCorn====Exception========{}", e.getMessage()); + e.printStackTrace(); + } + + } + + private void updateRecord(int requestids, String s) { + String sql = "update uf_pushArchivesLog set esbtxtml = ? where request in ( " + requestids + " )"; + RecordSet recordSet = new RecordSet(); + recordSet.executeUpdate(sql, s); + } + + private String extracted(int requestid) throws FtpException, IOException { + String newRequestid = "togd"+requestid; + RequestService requestService = new RequestService(); + RequestInfo requestInfo = requestService.getRequest(Util.getIntValue(requestid), 100); + String workflowid = requestInfo.getWorkflowid(); + Map requesData = getRequestByid(requestid); + log.info("requesData:{}", requesData); + String fj = Util.null2String(requesData.get("fj")); + String zwkbj = Util.null2String(requesData.get("zwkbj")); + String lczw = Util.null2String(requesData.get("lczw")); + String gwly = Util.null2String(requesData.get("gwly")); + //增加签字意见中的附件到附件文件夹中 + Map signFiles = ArchivesUtil.getSignFiles(requestid,false); + List docids = new ArrayList<>(); + // docids.addAll(Arrays.asList(fj.split(","))); + // docids.addAll(Arrays.asList(zwkbj.split(","))); + Map fjMap = ArchivesUtil.getFileIdByDocId(fj); + + // Map zwkbjMap = ArchivesUtil.getFileIdByDocId(zwkbj); + // Map lczwMap = ArchivesUtil.getFileIdByDocId(lczw); + Map lczwMap = new HashMap<>(); + //判断公文来源 + if ("0".equals(gwly)){ + lczwMap = ArchivesUtil.getFileIdByDocId(lczw); + }else { + lczwMap = ArchivesUtil.getFileIdByDocId(zwkbj); + } + + + + + List zwFileName = new ArrayList<>(); + List fjFileName = new ArrayList<>(); + final int[] i = {1}; + //附件 + fjMap.forEach((docid, imageid) -> { + ImageFileManager imageFileManager = new ImageFileManager(); + imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + InputStream inputStream = imageFileManager.getInputStream(); + //中文路径/中文文件名 + String imageFileName = filePath + File.separator + newRequestid + File.separator + FJDIR + File.separator + LCFJWORD + i[0] +"-" + imageFileManager.getImageFileName(); + fjFileName.add(LCFJWORD+ i[0] +"-" + imageFileManager.getImageFileName()); + log.info("生成附件路径:{}", imageFileName); + imageFileName = ArchivesUtil.codeUtf8(imageFileName); + try { + File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + String jsonStr = ArchivesUtil.callApi(Url, file); + log.error("永中接口返回数据:{}", jsonStr); + JSONObject result = JSONObject.parseObject(jsonStr); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + FJDIR + File.separator + LCFJWORD+ i[0] + "-" + imageFileManager.getImageFileName() + ".pdf"); + } + } catch (IOException e) { + e.printStackTrace(); + }finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + i[0]++; + }); + i[0] = 1; + //签字意见附件 + signFiles.forEach((docid, imageid) -> { + ImageFileManager imageFileManager = new ImageFileManager(); + imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + InputStream inputStream = imageFileManager.getInputStream(); + //中文路径/中文文件名 + String imageFileName = filePath + File.separator + newRequestid + File.separator + FJDIR + File.separator + QZYJFJWORD + i[0] + "-" +imageFileManager.getImageFileName(); + fjFileName.add(QZYJFJWORD + i[0] + "-" +imageFileManager.getImageFileName()); + log.info("生成签字意见附件路径:{}", imageFileName); + imageFileName = ArchivesUtil.codeUtf8(imageFileName); + try { + File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + String jsonStr = ArchivesUtil.callApi(Url, file); + log.error("永中接口返回数据:{}", jsonStr); + JSONObject result = JSONObject.parseObject(jsonStr); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + FJDIR + File.separator + QZYJFJWORD + i[0] + "-" + imageFileManager.getImageFileName() + ".pdf"); + } + i[0]++; + } catch (IOException e) { + e.printStackTrace(); + }finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + }); + + i[0] = 1; + Map coReqFile = getCoReqFile(requestid, workflowid); + //协办要求 + coReqFile.forEach((docid, imageid) -> { + ImageFileManager imageFileManager = new ImageFileManager(); + imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + InputStream inputStream = imageFileManager.getInputStream(); + zwFileName.add(XBBMFJWORD+ i[0] +"-"+ imageFileManager.getImageFileName()); + //中文路径/中文文件名 + String imageFileName = filePath + File.separator + newRequestid + File.separator + FJDIR + File.separator + XBBMFJWORD + i[0] +"-"+ imageFileManager.getImageFileName(); + log.info("生成协办部门路径:{}", imageFileName); + imageFileName = ArchivesUtil.codeUtf8(imageFileName); + try { + File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + String jsonStr = ArchivesUtil.callApi(Url, file); + log.error("永中接口返回:{}", jsonStr); + JSONObject result = JSONObject.parseObject(jsonStr); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + FJDIR + File.separator+XBBMFJWORD+ i[0] +"-" + imageFileManager.getImageFileName() + ".pdf"); + } + i[0]++; + } catch (IOException e) { + e.printStackTrace(); + }finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + }); + + // i[0] = 1; + // //正文 + // zwkbjMap.forEach((docid, imageid) -> { + // ImageFileManager imageFileManager = new ImageFileManager(); + // imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + // InputStream inputStream = imageFileManager.getInputStream(); + // zwFileName.add(imageFileManager.getImageFileName()); + // //中文路径/中文文件名 + // String imageFileName = filePath + File.separator + newRequestid + File.separator + zwdir + File.separator + imageFileManager.getImageFileName(); + // log.info("生成正文路径:{}", imageFileName); + // imageFileName = ArchivesUtil.codeUtf8(imageFileName); + // try { + // File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + // String jsonStr = ArchivesUtil.callApi(Url, file); + // log.error("永中接口返回:{}", jsonStr); + // JSONObject result = JSONObject.parseObject(jsonStr); + // String errorcode = result.getString("errorcode"); + // if ("0".equals(errorcode)) { + // JSONObject data = result.getJSONObject("data"); + // String destFileName = data.getString("destFileName"); + // String viewUrl = data.getString("viewUrl"); + // ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + zwdir + File.separator + imageFileManager.getImageFileName() + ".pdf"); + // } + // + // } catch (IOException e) { + // e.printStackTrace(); + // }finally { + // if(inputStream!=null) { + // try { + // inputStream.close(); + // } catch (IOException e) { + // e.printStackTrace(); + // } + // } + // } + // }); + + i[0] = 1; + //正文 + lczwMap.forEach((docid, imageid) -> { + ImageFileManager imageFileManager = new ImageFileManager(); + imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + InputStream inputStream = imageFileManager.getInputStream(); + zwFileName.add(imageFileManager.getImageFileName()); + //中文路径/中文文件名 + String imageFileName = filePath + File.separator + newRequestid + File.separator + ZWDIR + File.separator + (imageFileManager.getImageFileName().replaceAll("/","-")); + log.info("生成正文路径:{}", imageFileName); + imageFileName = ArchivesUtil.codeUtf8(imageFileName); + try { + File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + String jsonStr = ArchivesUtil.callApi(Url, file); + log.error("永中接口返回:{}", jsonStr); + JSONObject result = JSONObject.parseObject(jsonStr); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + ZWDIR + File.separator + (imageFileManager.getImageFileName().replaceAll("/","-")) + ".pdf"); + } + + } catch (IOException e) { + e.printStackTrace(); + }finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + }); + //开始承办单 先获取主流程的承办单 + List requestDocid = ArchivesUtil.generaRequestFormPdf(requestid,0); + // 1.去掉生成子流程承办单 + // List subRequestDocid = generaSubRequestFormPdf(requestid); + Map reqDocMap = ArchivesUtil.getFileIdByDocId(String.join(",", requestDocid)); + // 2.去掉生成子流程承办单 + // Map subReqDocMap = getFileIdByDocId(String.join(",", subRequestDocid)); + log.error("reqDocMap:{}", JSONObject.toJSONString(reqDocMap)); + //log.error("subReqDocMap:{}", JSONObject.toJSONString(subReqDocMap)); + docids.addAll(requestDocid); + // 3.去掉生成子流程承办单 + // docids.addAll(subRequestDocid); + //承办单 + reqDocMap.forEach((docid, imageid) -> { + ImageFileManager imageFileManager = new ImageFileManager(); + imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + InputStream inputStream = imageFileManager.getInputStream(); + //中文路径/中文文件名 + // String imageFileName = filePath + File.separator + requestid + File.separator + cbddir + File.separator + fjFile + i[0] + "_" + imageFileManager.getImageFileName(); + String imageFileName = filePath + File.separator + newRequestid + File.separator + CBDDIR + File.separator + WJCLDWORD+".pdf"; + + log.info("主流程承办单路径:{}", imageFileName); + imageFileName = ArchivesUtil.codeUtf8(imageFileName); + try { + File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + String jsonStr = ArchivesUtil.callApi(Url, file); + log.error("永中接口返回:{}", jsonStr); + JSONObject result = JSONObject.parseObject(jsonStr); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + CBDDIR + File.separator + WJCLDWORD + ".pdf" + ".pdf"); + } + i[0]++; + } catch (IOException e) { + e.printStackTrace(); + }finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + }); +//正文 + + i[0] = 1; + // 4.去掉生成子流程承办单 + // subReqDocMap.forEach((docid, imageid) -> { + // ImageFileManager imageFileManager = new ImageFileManager(); + // imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + // InputStream inputStream = imageFileManager.getInputStream(); + // //中文路径/中文文件名 + // String imageFileName = filePath + File.separator + requestid + File.separator + zlcdir + File.separator + fjFile + i[0] + "_" + (imageFileManager.getImageFileName().contains("-")?imageFileManager.getImageFileName().split("\\-")[1]:imageFileManager.getImageFileName()); + // imageFileName = codeUtf8(imageFileName); + // log.info("子流程承办单路径:{}", imageFileName); + // try { + // File file = saveInputStreamToFile(inputStream, imageFileName); + // String jsonStr = callApi(Url, file); + // log.error("永中接口返回:{}", jsonStr); + // JSONObject result = JSONObject.parseObject(jsonStr); + // String errorcode = result.getString("errorcode"); + // if ("0".equals(errorcode)) { + // JSONObject data = result.getJSONObject("data"); + // String destFileName = data.getString("destFileName"); + // String viewUrl = data.getString("viewUrl"); + // downloadFile(viewUrl, filePath + File.separator + requestid + File.separator + zlcdir + File.separator + fjFile + i[0] + "_" + (imageFileManager.getImageFileName().contains("-")?imageFileManager.getImageFileName().split("\\-")[1]:imageFileManager.getImageFileName() )+ ".pdf"); + // } + // i[0]++; + // } catch (IOException e) { + // e.printStackTrace(); + // } + // }); + log.error(JSONObject.toJSONString(requestDocid)); + // log.error(JSONObject.toJSONString(subRequestDocid)); + for (String docid : docids) { + log.error("删除了" + docid); + ArchivesUtil.deleteDocByid(docid); + } + //-------------------------------------------------------------------- + + + String logFile = ArchivesUtil.getSignLog(requestid, CBDDIR+File.separator+LZXXDIR, requestInfo.getCreatorid() + requestInfo.getDescription(),templatePath,filePath,false,workflowid); + String s = ArchivesUtil.callApi(Url, new File(logFile)); + log.error(s); + JSONObject result = JSONObject.parseObject(s); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, logFile + ".pdf"); + } + String zipName = filePath + File.separator + newRequestid + ".zip"; + ZipUtil.zip(filePath + File.separator + newRequestid, zipName); + log.error("zipName:{}", zipName); + String ftpFilePath = HgUtils.putFile(zipName, newRequestid + ".zip"); + ArchivesUtil.deleteDirectory(filePath + File.separator + newRequestid); + updateRecord(requestid,"esbwjml",ftpFilePath); + log.error("ftpFilePath:{}", ftpFilePath); + // String ftpFilePathNew = HgUtils.putFile(zipName, "test" + File.separator + newRequestid + ".zip"); + // log.error("ftpFilePathNew:{}", ftpFilePathNew); + String context = getContext(requestid, requesData, newRequestid + ".zip", zwFileName, fjFileName); + // insertRecord(requestid, context, ftpFilePath); + log.error("context:{}", context); + updateRecord(requestid,"content",context); + return context; + } + + + + private void insertRecord(int requestid, String context, String ftpFilePath) { + String sql = "insert into uf_pushArchivesLog (request ,content,esbwjml) VALUES (?,?,?)"; + RecordSet recordSet = new RecordSet(); + recordSet.executeUpdate(sql, requestid, context, ftpFilePath); + } + + + // 获取指定日期的第一秒 + public static Date getFirstSecondOfDate(Date date) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + calendar.set(Calendar.HOUR_OF_DAY, 0); + calendar.set(Calendar.MINUTE, 0); + calendar.set(Calendar.SECOND, 0); + calendar.set(Calendar.MILLISECOND, 0); + return calendar.getTime(); + } + + // 获取指定日期的最后一秒 + public static Date getLastSecondOfDate(Date date) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + calendar.set(Calendar.HOUR_OF_DAY, 23); + calendar.set(Calendar.MINUTE, 59); + calendar.set(Calendar.SECOND, 59); + calendar.set(Calendar.MILLISECOND, 999); + return calendar.getTime(); + } + + + + /*** + * 封装数据 + * @param requestid + * @return + */ + public Map getRequestByid(int requestid) { + HashMap record = new HashMap<>(); + String sql = "select * from formtable_main_137 where requestid = ?"; + String reqsql = "select REQUESTNAME from WORKFLOW_REQUESTBASE where REQUESTID = ?"; + RecordSet rs = new RecordSet(); + rs.executeQuery(sql, requestid); + if (rs.next()) { + String fj = Util.null2String(rs.getString("fj")); + String zwkbj = Util.null2String(rs.getString("zwkbj")); // 正文可编辑字段 + record.put("fj", fj); + record.put("zwkbj", zwkbj); + record.put("zwyyglgwmk", Util.null2String(rs.getString("zwyyglgwmk"))); + record.put("lwh", Util.null2String(rs.getString("lwh"))); + record.put("mj", Util.null2String(rs.getString("mj"))); + record.put("lwrq", Util.null2String(rs.getString("lwrq"))); + record.put("swrq", Util.null2String(rs.getString("swrq"))); + record.put("blqx", Util.null2String(rs.getString("blqx"))); + record.put("sfdb", Util.null2String(rs.getString("sfdb"))); + record.put("wjlx", Util.null2String(rs.getString("wjlx"))); + record.put("fssj", Util.null2String(rs.getString("fssj"))); + record.put("gdh", Util.null2String(rs.getString("gdh"))); + record.put("swh", Util.null2String(rs.getString("swh"))); + record.put("ngbm", Util.null2String(rs.getString("ngbm"))); + record.put("ngr", Util.null2String(rs.getString("ngr"))); + record.put("ngrq", Util.null2String(rs.getString("ngrq"))); + record.put("swlx", Util.null2String(rs.getString("swlx"))); + record.put("jghwt", Util.null2String(rs.getString("jghwt"))); + record.put("lwdwmc", Util.null2String(rs.getString("lwdwmc"))); + record.put("bgqx", Util.null2String(rs.getString("bgqx"))); + record.put("ys", Util.null2String(rs.getString("ys"))); + record.put("wz", Util.null2String(rs.getString("wz"))); + record.put("lb", Util.null2String(rs.getString("lb"))); + record.put("bz", Util.null2String(rs.getString("bz"))); + record.put("yffbm", Util.null2String(rs.getString("yffbm"))); + record.put("ffbmb", Util.null2String(rs.getString("ffbmb"))); + record.put("yffbm", Util.null2String(rs.getString("yffbm"))); + record.put("lczw", Util.null2String(rs.getString("lczw"))); + record.put("gwly", Util.null2String(rs.getString("gwly"))); + record.put("lwdwsx", Util.null2String(rs.getString("lwdwsx"))); + record.put("fb", Util.null2String(rs.getString("fb"))); + record.put("xjdw", Util.null2String(rs.getString("xjdw"))); + record.put("ejzx", Util.null2String(rs.getString("ejzx"))); + record.put("yjbm", Util.null2String(rs.getString("yjbm"))); + record.put("yjfxxldbm", Util.null2String(rs.getString("yjfxxldbm"))); + } + rs.executeQuery(reqsql, requestid); + if (rs.next()) { + record.put("REQUESTNAME", Util.null2String(rs.getString("REQUESTNAME"))); + } + return record; + } + + + private String getContext(int requestid, Map requesData, String zipName, List zwFileName, List fjFileName) { + StringBuilder context = new StringBuilder(); + try { + + String swrq = Util.null2String(requesData.get("swrq")); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + LocalDate date = LocalDate.parse(swrq, formatter); + int year = date.getYear(); + context.append(year).append("|"); + String jghwt = Util.null2String(requesData.get("jghwt")); + context.append(jghwt).append("|"); + // String swh = Util.null2String(requesData.get("swh")); + String swh = Util.null2String(requesData.get("lwh")); + context.append(swh).append("|"); + String requestname = Util.null2String(requesData.get("REQUESTNAME")); + context.append(requestname).append("|"); + String lwdwmc = Util.null2String(requesData.get("lwdwsx")); //5 责任者 -> 来文单位 + context.append(lwdwmc).append("|"); + String bgqx = Util.null2String(requesData.get("bgqx")); //6 保管期限 -> 保管期限 + context.append(bgqx).append("|"); + String lwrq = Util.null2String(requesData.get("lwrq")); //7 日期 -> 原发文日期 + context.append(lwrq).append("|"); + String ys = Util.null2String(requesData.get("ys")); //8 页数 -> 页数 + context.append(ys).append("|"); + String wz = Util.null2String(requesData.get("wz")); //9 文种 -> 文种 + context.append(wz).append("|"); + String ngbm = Util.null2String(requesData.get("ngbm")); + String fb = Util.null2String(requesData.get("fb")); + String yjbm = Util.null2String(requesData.get("yjbm")); + String[] deptData = ArchivesUtil.getDeptNameAndCode(ngbm); + String[] yjbmdeptData = ArchivesUtil.getDeptNameAndCode(yjbm); + String[] subData = getSubCom(fb); + context.append(yjbmdeptData[0]).append("|"); //10 行编号 -> 拟稿部门 + + context.append(yjbmdeptData[1]).append("|"); //11 行名称 + context.append("").append("|"); // 12 保管期限编号 + context.append("").append("|"); // 13 保管期限及编号 + context.append("").append("|"); // 14 是否开放 + context.append("").append("|"); // 15 互见号 + String lb = Util.null2String(requesData.get("lb")); + context.append(lb).append("|"); //16 类别 -> 类别 + //TODO + String xgbm = Util.null2String(getAssociatedDepts(requesData)); + context.append(xgbm).append("|"); //17 相关部门 -> 流经部门 + // String lwh = Util.null2String(requesData.get("lwh"));// 18 收文号 -> 来文文号 + String lwh = Util.null2String(requesData.get("swh"));// 18 收文号 -> 来文文号 + context.append(lwh).append("|"); + String fs = ""; + context.append(fs).append("|"); // 19 份数 -> 份数 + String bz = Util.null2String(requesData.get("bz")); + context.append(bz).append("|"); // 20 备注 -> 备注 + String yywh = Util.null2String(requesData.get("yywh")); + context.append(yywh).append("|"); // 21 引用文号 -> 引用文号 + String wjlx = Util.null2String(requesData.get("wjlx")); + context.append(wjlx).append("|"); // 22 文件类型 -> 空 + String fwlx = Util.null2String(requesData.get("fwlx")); + context.append(fwlx).append("|"); // 23 文件类型 -> 空 + String f = Util.null2String(requesData.get("f")); + context.append(f).append("|"); // 24 发 -> 空 + String ngr = Util.null2String(requesData.get("ngr")); + context.append(new User(Util.getIntValue(ngr)).getLoginid()).append("|"); // 25 拟稿人 -> 拟稿人 + context.append(deptData[1]).append("|"); // 26 拟稿部门 -> 拟稿部门名称 + context.append("收文").append("|"); // 27 公文类型 -> "收文" + //TODO + context.append(ArchivesUtil.getAssociatedPersons(requestid,false)).append("|"); // 28 相关人员 -> 参与人员 + context.append("智慧OA").append("|"); // 29 数据来源 -> 数据来源 + context.append(year).append("|"); // 30 形成年度 -> 年份 + context.append(String.join("&&", zwFileName)).append("|"); // 31 正文名称 + context.append(String.join("&&", fjFileName)).append("|"); // 32 附件名称 + context.append("togd"+requestid).append("|"); // 33 主键 + context.append("").append("|"); // 34 关联主键 + context.append("").append("|"); // 35 被关联主键 + context.append(zipName);// 36 压缩包名称 + } catch (Exception e) { + e.printStackTrace(); + log.error("getContextError:{}", e.getMessage()); + } + + return context.toString(); + } + + private String getAssociatedDepts(Map requesData) { + HashSet records = new HashSet<>(); + records.addAll(Arrays.asList(Util.null2String(requesData.get("ngbm")).split(","))); + records.addAll(Arrays.asList(Util.null2String(requesData.get("ffbm")).split(","))); + records.addAll(Arrays.asList(Util.null2String(requesData.get("yffbm")).split(","))); + records.addAll(Arrays.asList(Util.null2String(requesData.get("ffbmb")).split(","))); + records.addAll(Arrays.asList(Util.null2String(requesData.get("xjdw")).split(","))); + records.addAll(Arrays.asList(Util.null2String(requesData.get("ejzx")).split(","))); + records.addAll(Arrays.asList(Util.null2String(requesData.get("yjbm")).split(","))); + records.addAll(Arrays.asList(Util.null2String(requesData.get("yjfxxldbm")).split(","))); + ArrayList deptName = new ArrayList<>(); + DepartmentComInfo departmentComInfo = new DepartmentComInfo(); + for (String record : records) { + try { + if (StringUtil.isEmpty(record)){ + continue; + } + String departmentName = departmentComInfo.getDepartmentName(record); + deptName.add(departmentName); + } catch (Exception e) { + e.printStackTrace(); + } + } + + return String.join("&&", deptName); + } + + private Map getCoReqFile(int requestid , String workflowid){ + try { + RecordSet rs = new RecordSet(); + rs.executeQuery("select * from uf_ArchivesSet where mainwfid = ?",workflowid); + boolean isCo = false; + String cowfid = ""; + String cofield = ""; + String cofieldid = ""; + if (rs.next()){ + cowfid = Util.null2String(rs.getString("cowfid")); + if (!StringUtils.isBlank(cowfid)){ + isCo = true; + cofield = Util.null2String(rs.getString("cofield")); + cofieldid = Util.null2String(rs.getString("cofieldid")); + } + } + log.info("isCo:{};cowfid:{};cofield:{};cofieldid:{}",isCo,cowfid,cofield,cofieldid); + + + if(isCo){ + ArrayList CoSubRequest = new ArrayList<>(); + Map subRequest = ArchivesUtil.getSubRequest(Util.null2String(requestid) , 6); + log.info("subRequest:{}",subRequest); + for (Map.Entry subRequestEntry : subRequest.entrySet()) { + String subWFid = subRequestEntry.getValue(); + if (cowfid.equals(subWFid)){ + CoSubRequest.add(subRequestEntry.getKey()); + } + } + log.info("CoSubRequest.size:{}",CoSubRequest.size()); + if (CoSubRequest.size() == 0){ + return new HashMap<>(); + } + WorkflowComInfo wf = new WorkflowComInfo(); + WorkflowBillComInfo wcInfo = new WorkflowBillComInfo(); + String formId = wf.getFormId(cowfid); + String tablename = wcInfo.getTablename(formId); + String cosql = "select "+cofield+" from " + tablename + " where " + + " requestid in ( " + String.join(",",CoSubRequest) + " ) " + + " order by requestid asc "; + log.info("cosql:{}",cosql); + + rs.executeQuery(cosql); + log.info("rs.getExceptionMsg():{}",rs.getExceptionMsg()); + String fieldValue = ""; + String[] cofieldsplit = cofield.split(","); + String coFile = cofieldsplit[2]; //协办部门 + ArrayList docids = new ArrayList<>(); + while (rs.next()){ + String coFileValue = rs.getString(coFile); + docids.addAll(Arrays.asList(coFileValue.split(","))); + } + log.info("fieldValue:{}",fieldValue); + return ArchivesUtil.getFileIdByDocId(String.join(",",docids)); + } + return new HashMap<>(); + }catch (Exception e){ + log.error("getCoReqFile:[}",e.getMessage()); + return new HashMap<>(); + } + } + + private void updateRecord(int requestid, String field , String fieldvalue) { + String sql = "update uf_pushArchivesLog set "+field+" = ? where request = ?"; + RecordSet recordSet = new RecordSet(); + recordSet.executeUpdate(sql, fieldvalue, requestid); + } + + + public static String[] getSubCom(String ngbm) { + RecordSet rs = new RecordSet(); + rs.executeQuery("select sub.id subid , SUBCOMPANYNAME from HRMSUBCOMPANY sub where sub.id = ? ",ngbm); + rs.next(); + String subcompanyname = rs.getString("SUBCOMPANYNAME"); + String subid = rs.getString("subid"); + if ("总行".equals(subcompanyname)){ + subcompanyname = "总行机关"; + } + rs.executeQuery("select DAPYBH from HRMSUBCOMPANYDEFINED where SUBCOMID = ?",subid); + rs.next(); + String DAPYBH = rs.getString("DAPYBH"); + return new String[]{DAPYBH,subcompanyname}; + } +} diff --git a/com/engine/custom/archives/service/secondBranch/SecondBranchSendingPushArchivesService.java b/com/engine/custom/archives/service/secondBranch/SecondBranchSendingPushArchivesService.java new file mode 100644 index 0000000..6285560 --- /dev/null +++ b/com/engine/custom/archives/service/secondBranch/SecondBranchSendingPushArchivesService.java @@ -0,0 +1,575 @@ +package com.engine.custom.archives.service.secondBranch; + +import cn.hutool.core.util.ZipUtil; +import com.alibaba.fastjson.JSONObject; +import com.dcfs.fts.common.error.FtpException; +import com.engine.custom.archives.entity.PushArchivesBean; +import com.engine.custom.archives.util.ArchivesUtil; +import com.engine.custom.archives.util.KeyWord; +import com.engine.custom.hg.util.HgUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import weaver.conn.RecordSet; +import weaver.file.ImageFileManager; +import weaver.general.StringUtil; +import weaver.general.Util; +import weaver.hrm.User; +import weaver.hrm.company.DepartmentComInfo; +import weaver.soa.workflow.request.RequestInfo; +import weaver.soa.workflow.request.RequestService; + +import java.io.*; +import java.text.SimpleDateFormat; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.*; + +/*** + * @Des: 一级分行发文推送档案系统服务 + */ +public class SecondBranchSendingPushArchivesService implements KeyWord { + public static Logger log = LoggerFactory.getLogger("Archives"); + private static String filePath; + private static String Url; + private static String templatePath; // 模板文件路径 + private int endTime= 7; + + public void setProp(Map param) { + filePath = Util.null2String(param.get("filePath")); + Url = Util.null2String(param.get("Url")); + templatePath = Util.null2String(param.get("templatePath")); + endTime = Util.getIntValue(param.get("endTime"),7); + } + + public void pushArchives(Map param) { + log.info("PushArchivesCorn====Begin========{}", param); + Date date = ArchivesUtil.getDate(); + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); + String format = dateFormat.format(date); + SimpleDateFormat yyyyMMddHHmmss = new SimpleDateFormat("yyyy-MM-dd HH:mm"); + // 获取当前时间的第一秒 + String firstSecond = yyyyMMddHHmmss.format(ArchivesUtil.getFirstSecondOfDate(date)); + // 获取当前时间的最后一秒 + String lastSecond = yyyyMMddHHmmss.format(ArchivesUtil.getLastSecondOfDate(date)); + RecordSet recordSet = new RecordSet(); + List result = ArchivesUtil.getResultList(recordSet, firstSecond, lastSecond, 6); + log.error("推送分行发文的数量:{}", result.size()); + File file = ArchivesUtil.crFile(filePath + "/togd_" + new SimpleDateFormat("yyyyMMdd000000").format(date)); + log.error("textfile:{}", file.getAbsolutePath()); + for (PushArchivesBean pushArchivesBean : result) { + if (ArchivesUtil.isAfterSevenAM(endTime)){ + log.info("超过执行时间:{}点暂停计划任务",endTime); + break; + } + // int id = pushArchivesBean.getId(); + int request = pushArchivesBean.getRequest(); + log.error("推送的requestId:{}", request); + try { + String context = generateFile(request); + if ("-1".equals(context)){ + continue; + } + ArchivesUtil.writeToTxt(file.getPath(), file.getName(), context, true); + File txtzip = new File(filePath + File.separator + "togd_" + new SimpleDateFormat("yyyyMMdd000000").format(date) + ".zip"); + log.error("textZipFile:{}", txtzip.getAbsolutePath()); + OutputStream outputStream = new FileOutputStream(txtzip); + File writename = new File(file.getPath() + "/" + file.getName() + ".txt"); + com.engine.custom.hg.util.ZipUtil.filesToZip(writename, outputStream, writename.getName()); + log.error("writename:{}", writename.getName()); + String s = HgUtils.putFile(txtzip.getAbsolutePath(), txtzip.getName()); + updateRecord(request,"esbtxtml",s); + updateRecord(request,"zt","0"); + log.error("textZip:{}", s); + } catch (FtpException e) { + e.printStackTrace(); + log.error("推送档案requestid:{}异常,异常原因为:{}",request,e.getMessage()); + } catch (IOException e) { + e.printStackTrace(); + log.error("推送档案requestid:{}异常,异常原因为:{}",request,e.getMessage()); + } catch (Exception e){ + e.printStackTrace(); + log.error("推送档案requestid:{}异常,异常原因为:{}",request,e.getMessage()); + } + } + + } + + + private String generateFile(int requestid) throws FtpException, IOException { + Map requesData = getRequestByid(requestid); + String newRequestid = "togd"+requestid; + log.info("requesData:{}", requesData); + String bh = requesData.get("bh"); + if (StringUtil.isEmpty(bh)){ + return "-1"; + } + String fj = Util.null2String(requesData.get("fj")); + String dwd = Util.null2String(requesData.get("dwd")); + String zw = Util.null2String(requesData.get("zw")); + String qgqhj = Util.null2String(requesData.get("qgqhj")); + String thhlh = Util.null2String(requesData.get("thhlh")); + + + //增加签字意见中的附件到附件文件夹中 + Map signFiles = ArchivesUtil.getSignFiles(requestid,false); + List docids = new ArrayList<>(); + // docids.addAll(Arrays.asList(fj.split(","))); + // docids.addAll(Arrays.asList(zwkbj.split(","))); + Map fjMap = ArchivesUtil.getFileIdByDocId(fj); + Map dwdMap = ArchivesUtil.getFileIdByDocId(dwd); + Map zwMap = ArchivesUtil.getFileIdByDocId(zw); + Map qgqhjMap = ArchivesUtil.getFileIdByDocId(qgqhj); + Map thhlhMap = ArchivesUtil.getFileIdByDocId(thhlh); + List zwFileName = new ArrayList<>(); + List fjFileName = new ArrayList<>(); + final int[] i = {1}; + //附件 + fjMap.forEach((docid, imageid) -> { + ImageFileManager imageFileManager = new ImageFileManager(); + imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + InputStream inputStream = imageFileManager.getInputStream(); + //中文路径/中文文件名 + String imageFileName = filePath + File.separator + newRequestid + File.separator + FJDIR + File.separator + LCFJWORD + "-" +imageFileManager.getImageFileName(); + fjFileName.add(LCFJWORD + "-" +imageFileManager.getImageFileName()); + log.info("生成附件路径:{}", imageFileName); + imageFileName = ArchivesUtil.codeUtf8(imageFileName); + try { + File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + String jsonStr = ArchivesUtil.callApi(Url, file); + log.error("永中接口返回数据:{}", jsonStr); + JSONObject result = JSONObject.parseObject(jsonStr); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + FJDIR + File.separator + LCFJWORD + "-" + imageFileManager.getImageFileName() + ".pdf"); + } + } catch (IOException e) { + e.printStackTrace(); + }finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + }); + + //签字意见附件 + signFiles.forEach((docid, imageid) -> { + ImageFileManager imageFileManager = new ImageFileManager(); + imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + InputStream inputStream = imageFileManager.getInputStream(); + //中文路径/中文文件名 + String imageFileName = filePath + File.separator + newRequestid + File.separator + FJDIR + File.separator + QZYJFJWORD+ "-" +imageFileManager.getImageFileName(); + fjFileName.add(QZYJFJWORD+ "-" +imageFileManager.getImageFileName()); + log.info("生成签字意见附件路径:{}", imageFileName); + imageFileName = ArchivesUtil.codeUtf8(imageFileName); + try { + File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + String jsonStr = ArchivesUtil.callApi(Url, file); + log.error("永中接口返回数据:{}", jsonStr); + JSONObject result = JSONObject.parseObject(jsonStr); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + FJDIR + File.separator + QZYJFJWORD+ "-" + imageFileManager.getImageFileName() + ".pdf"); + } + } catch (IOException e) { + e.printStackTrace(); + }finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + }); + + //多文档 + // dwdMap.forEach((docid, imageid) -> { + // ImageFileManager imageFileManager = new ImageFileManager(); + // imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + // InputStream inputStream = imageFileManager.getInputStream(); + // zwFileName.add(imageFileManager.getImageFileName()); + // //中文路径/中文文件名 + // String imageFileName = filePath + File.separator + requestid + File.separator + zwdir + File.separator + fjWord + i[0] + "_" + zwWord + "_" + imageFileManager.getImageFileName(); + // log.info("生成多文档路径:{}", imageFileName); + // imageFileName = ArchivesUtil.codeUtf8(imageFileName); + // try { + // File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + // String jsonStr = ArchivesUtil.callApi(Url, file); + // log.error("永中接口返回:{}", jsonStr); + // JSONObject result = JSONObject.parseObject(jsonStr); + // String errorcode = result.getString("errorcode"); + // if ("0".equals(errorcode)) { + // JSONObject data = result.getJSONObject("data"); + // String destFileName = data.getString("destFileName"); + // String viewUrl = data.getString("viewUrl"); + // ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + requestid + File.separator + zwdir + File.separator + fjWord + i[0] + "_" + zwWord + "_" + imageFileManager.getImageFileName() + ".pdf"); + // } + // } catch (IOException e) { + // e.printStackTrace(); + // } + // i[0]++; + // }); + //正文 + zwMap.forEach((docid, imageid) -> { + ImageFileManager imageFileManager = new ImageFileManager(); + imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + InputStream inputStream = imageFileManager.getInputStream(); + + String newFile = FJWORD + i[0] + "_" + ZWWORD + "-" + (imageFileManager.getImageFileName().replaceAll("/","-")); + //中文路径/中文文件名 + String imageFileName = filePath + File.separator + newRequestid + File.separator + ZWDIR + File.separator + newFile; + zwFileName.add(newFile); + log.info("生成正文路径:{}", imageFileName); + imageFileName = ArchivesUtil.codeUtf8(imageFileName); + try { + File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + String jsonStr = ArchivesUtil.callApi(Url, file); + log.error("永中接口返回:{}", jsonStr); + JSONObject result = JSONObject.parseObject(jsonStr); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + ZWDIR + File.separator + newFile + ".pdf"); + } + } catch (IOException e) { + e.printStackTrace(); + }finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + i[0]++; + }); + //清稿前痕迹 + qgqhjMap.forEach((docid, imageid) -> { + ImageFileManager imageFileManager = new ImageFileManager(); + imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + InputStream inputStream = imageFileManager.getInputStream(); + + String newFile = FJWORD + i[0] + "_" + LHGWORD + "-" + (imageFileManager.getImageFileName().replaceAll("/","-")); + zwFileName.add(newFile); + //中文路径/中文文件名 + String imageFileName = filePath + File.separator + newRequestid + File.separator + ZWDIR + File.separator + newFile; + log.info("生成清稿前痕迹路径:{}", imageFileName); + imageFileName = ArchivesUtil.codeUtf8(imageFileName); + try { + File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + String jsonStr = ArchivesUtil.callApi(Url, file); + log.error("永中接口返回:{}", jsonStr); + JSONObject result = JSONObject.parseObject(jsonStr); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + ZWDIR + File.separator + newFile + ".pdf"); + } + } catch (IOException e) { + e.printStackTrace(); + }finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + i[0]++; + }); + //套红后留痕 + // thhlhMap.forEach((docid, imageid) -> { + // ImageFileManager imageFileManager = new ImageFileManager(); + // imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + // InputStream inputStream = imageFileManager.getInputStream(); + // zwFileName.add(imageFileManager.getImageFileName()); + // //中文路径/中文文件名 + // String imageFileName = filePath + File.separator + requestid + File.separator + zwdir + File.separator + fjWord + i[0] + "_" + lhgWord + "_" + imageFileManager.getImageFileName(); + // log.info("生成套红后留痕路径:{}", imageFileName); + // imageFileName = ArchivesUtil.codeUtf8(imageFileName); + // try { + // File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + // String jsonStr = ArchivesUtil.callApi(Url, file); + // log.error("永中接口返回:{}", jsonStr); + // JSONObject result = JSONObject.parseObject(jsonStr); + // String errorcode = result.getString("errorcode"); + // if ("0".equals(errorcode)) { + // JSONObject data = result.getJSONObject("data"); + // String destFileName = data.getString("destFileName"); + // String viewUrl = data.getString("viewUrl"); + // ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + requestid + File.separator + zwdir + File.separator + fjWord + i[0] + "_" + lhgWord + "_" + imageFileManager.getImageFileName() + ".pdf"); + // } + // } catch (IOException e) { + // e.printStackTrace(); + // } + // i[0]++; + // }); + + //开始承办单 先获取主流程的承办单 + List requestDocid = ArchivesUtil.generaRequestFormPdf(requestid, 0); + // 1.去掉生成子流程承办单 + // List subRequestDocid = generaSubRequestFormPdf(requestid); + Map reqDocMap = ArchivesUtil.getFileIdByDocId(String.join(",", requestDocid)); + // 2.去掉生成子流程承办单 + // Map subReqDocMap = getFileIdByDocId(String.join(",", subRequestDocid)); + log.error("reqDocMap:{}", JSONObject.toJSONString(reqDocMap)); + //log.error("subReqDocMap:{}", JSONObject.toJSONString(subReqDocMap)); + docids.addAll(requestDocid); + // 3.去掉生成子流程承办单 + // docids.addAll(subRequestDocid); + i[0] = 1; + //主流程承办单 + reqDocMap.forEach((docid, imageid) -> { + ImageFileManager imageFileManager = new ImageFileManager(); + imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + InputStream inputStream = imageFileManager.getInputStream(); + //中文路径/中文文件名 + // String imageFileName = filePath + File.separator + requestid + File.separator + cbddir + File.separator + fjFile + i[0] + "_" + imageFileManager.getImageFileName(); + // String imageFileName = filePath + File.separator + newRequestid + File.separator + cbddir + File.separator + fjFile + i[0] + "_" + wjcldWord+".pdf"; + String imageFileName = filePath + File.separator + newRequestid + File.separator + CBDDIR + File.separator + WJCLDWORD+".pdf"; + log.info("主流程承办单路径:{}", imageFileName); + imageFileName = ArchivesUtil.codeUtf8(imageFileName); + try { + File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + String jsonStr = ArchivesUtil.callApi(Url, file); + log.error("永中接口返回:{}", jsonStr); + JSONObject result = JSONObject.parseObject(jsonStr); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + CBDDIR + File.separator + WJCLDWORD + ".pdf" + ".pdf"); + } + i[0]++; + } catch (IOException e) { + e.printStackTrace(); + }finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + }); +//正文 + + + log.error(JSONObject.toJSONString(requestDocid)); + for (String docid : docids) { + log.error("删除了" + docid); + ArchivesUtil.deleteDocByid(docid); + } + //-------------------------------------------------------------------- + RequestService requestService = new RequestService(); + RequestInfo requestInfo = requestService.getRequest(Util.getIntValue(requestid), 100); + String workflowid = requestInfo.getWorkflowid(); + String logFile = ArchivesUtil.getSignLog(requestid, CBDDIR + File.separator + LZXXDIR, requestInfo.getCreatorid() + requestInfo.getDescription(), templatePath, filePath,false,workflowid); + String s = ArchivesUtil.callApi(Url, new File(logFile)); + log.error(s); + JSONObject result = JSONObject.parseObject(s); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, logFile + ".pdf"); + } + String zipName = filePath + File.separator + newRequestid + ".zip"; + ZipUtil.zip(filePath + File.separator + newRequestid, zipName); + log.error("zipName:{}", zipName); + String ftpFilePath = HgUtils.putFile(zipName, newRequestid + ".zip"); + log.error("ftpFilePath:{}", ftpFilePath); + updateRecord(requestid,"esbwjml",ftpFilePath); + ArchivesUtil.deleteDirectory(filePath + File.separator + newRequestid); + // String ftpFilePathNew = HgUtils.putFile(zipName, "test" + File.separator + requestid + ".zip"); + // log.error("ftpFilePathNew:{}", ftpFilePathNew); + String context = getContext(requestid, requesData, newRequestid + ".zip", zwFileName, fjFileName); + // insertRecord(requestid, context, ftpFilePath); + updateRecord(requestid,"content",context); + log.error("context:{}", context); + return context; + } + + + /*** + * 封装数据 + * @param requestid + * @return + */ + public Map getRequestByid(int requestid) { + HashMap record = new HashMap<>(); + String sql = "select * from formtable_main_170 where requestid = ?"; + String reqsql = "select REQUESTNAME from WORKFLOW_REQUESTBASE where REQUESTID = ?"; + RecordSet rs = new RecordSet(); + rs.executeQuery(sql, requestid); + if (rs.next()) { + record.put("fj", Util.null2String(rs.getString("fj"))); + record.put("dwd", Util.null2String(rs.getString("dwd"))); + record.put("zw", Util.null2String(rs.getString("zw"))); + record.put("ngrq", Util.null2String(rs.getString("ngrq"))); + record.put("jghwt", Util.null2String(rs.getString("jghwt"))); + record.put("bh", Util.null2String(rs.getString("bh"))); + record.put("ngbm", Util.null2String(rs.getString("ngbm"))); + record.put("bgqx", Util.null2String(rs.getString("bgqx"))); + record.put("cwrq", Util.null2String(rs.getString("cwrq"))); + record.put("ys", Util.null2String(rs.getString("ys"))); + record.put("wz", Util.null2String(rs.getString("wz"))); + record.put("ngbm", Util.null2String(rs.getString("ngbm"))); + record.put("lb", Util.null2String(rs.getString("lb"))); + record.put("bz", Util.null2String(rs.getString("bz"))); + record.put("yywh", Util.null2String(rs.getString("yywh"))); + record.put("wjlx", Util.null2String(rs.getString("wjlx"))); + record.put("fwlx", Util.null2String(rs.getString("fwlx"))); + record.put("f", Util.null2String(rs.getString("f"))); + record.put("ngr", Util.null2String(rs.getString("ngr"))); + record.put("qgqhj", Util.null2String(rs.getString("qgqhj"))); + record.put("thhlh", Util.null2String(rs.getString("thhlh"))); + record.put("yjbm", Util.null2String(rs.getString("yjbm"))); + + } + rs.executeQuery(reqsql, requestid); + if (rs.next()) { + record.put("REQUESTNAME", Util.null2String(rs.getString("REQUESTNAME"))); + } + return record; + } + + private String getContext(int requestid, Map requesData, String zipName, List zwFileName, List fjFileName) { + StringBuilder context = new StringBuilder(); + try { + DepartmentComInfo departmentComInfo = new DepartmentComInfo(); + String ngrq = Util.null2String(requesData.get("ngrq")); //拟稿日期 + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + LocalDate date = LocalDate.parse(ngrq, formatter); + int year = date.getYear(); + context.append(year).append("|"); //1.年度 -> 拟稿日期 + String jghwt = Util.null2String(requesData.get("jghwt"));//2.机构或问题 -> 机构或问题 + context.append(jghwt).append("|"); + String bh = Util.null2String(requesData.get("bh"));// 3.文号 -> 编号 + context.append(bh).append("|"); + String requestname = Util.null2String(requesData.get("REQUESTNAME")); // 4.文件题名 -> 流程名称 + context.append(requestname).append("|"); + String ngbmName = Util.null2String(departmentComInfo.getDepartmentmark(requesData.get("ngbm"))); //5 责任者 -> 拟稿部门 + context.append(ngbmName).append("|"); + String bgqx = Util.null2String(requesData.get("bgqx")); //6 保管期限 -> 保管期限 + context.append(bgqx).append("|"); + String cwrq = Util.null2String(requesData.get("cwrq")); //7 日期 -> 成文日期 + context.append(cwrq).append("|"); + String ys = Util.null2String(requesData.get("ys")); //8 页数 -> 页数 + context.append(ys).append("|"); + String wz = Util.null2String(requesData.get("wz")); //9 文种 -> 文种 + context.append(wz).append("|"); + String ngbm = Util.null2String(requesData.get("ngbm")); + String yjbm = Util.null2String(requesData.get("yjbm")); + + String[] deptData = ArchivesUtil.getDeptNameAndCode(ngbm); + String[] yjbmdeptData = ArchivesUtil.getDeptNameAndCode(yjbm); + String[] subData = ArchivesUtil.getSubCom(ngbm); + context.append(yjbmdeptData[0]).append("|"); //10 行编号 -> 拟稿部门 + + context.append(yjbmdeptData[1]).append("|"); //11 行名称 + context.append("").append("|"); // 12 保管期限编号 + context.append("").append("|"); // 13 保管期限及编号 + context.append("").append("|"); // 14 是否开放 + context.append("").append("|"); // 15 互见号 + String lb = Util.null2String(requesData.get("lb")); + context.append(lb).append("|"); //16 类别 -> 类别 + //TODO + String xgbm = Util.null2String(getAssociatedDepts(requesData)); + context.append(xgbm).append("|"); //17 相关部门 -> 流经部门 + // String lwh = Util.null2String(requesData.get("lwh")); + context.append("").append("|");// 18 收文号 -> 空 + String fs = ""; + context.append(fs).append("|"); // 19 份数 -> 份数 + String bz = Util.null2String(requesData.get("bz")); + context.append("").append("|"); // 20 备注 -> 备注 + String yywh = Util.null2String(requesData.get("yywh")); + context.append("").append("|"); // 21 引用文号 -> 引用文号 + String wjlx = Util.null2String(requesData.get("wjlx")); + context.append("").append("|"); // 22 文件类型 -> 空 + String fwlx = Util.null2String(requesData.get("fwlx")); + context.append("分行发文").append("|"); // 23 发文类型 -> 空 + String f = Util.null2String(requesData.get("f")); + context.append(f).append("|"); // 24 发 -> 空 + String ngr = Util.null2String(requesData.get("ngr")); + context.append(new User(Util.getIntValue(ngr)).getLoginid()).append("|"); // 25 拟稿人 -> 拟稿人 + context.append(ngbmName).append("|"); // 26 拟稿部门 -> 拟稿部门名称 + context.append("发文").append("|"); // 27 公文类型 -> "收文" + //TODO + context.append(ArchivesUtil.getAssociatedPersons(requestid,false)).append("|"); // 28 相关人员 -> 参与人员 + context.append("智慧OA").append("|"); // 29 数据来源 -> 数据来源 + context.append(year).append("|"); // 30 形成年度 -> 年份 + context.append(String.join("&&", zwFileName)).append("|"); // 31 正文名称 + context.append(String.join("&&", fjFileName)).append("|"); // 32 附件名称 + context.append("togd"+requestid).append("|"); // 33 主键 + context.append("").append("|"); // 34 关联主键 + context.append("").append("|"); // 35 被关联主键 + context.append(zipName);// 36 压缩包名称 + } catch (Exception e) { + e.printStackTrace(); + log.error("getContextError:{}", e.getMessage()); + } + + return context.toString(); + } + + + + + private String getAssociatedDepts(Map requesData) { + HashSet records = new HashSet<>(); + records.addAll(Arrays.asList(Util.null2String(requesData.get("hqbm")).split(","))); // 会签部门 + records.addAll(Arrays.asList(Util.null2String(requesData.get("ngbm")).split(","))); // 拟稿部门 + records.addAll(Arrays.asList(Util.null2String(requesData.get("bmyb")).split(","))); // 部门阅办 + records.addAll(Arrays.asList(Util.null2String(requesData.get("cs")).split(","))); // 抄送 + records.addAll(Arrays.asList(Util.null2String(requesData.get("nbfs")).split(","))); // 本行发送 + records.addAll(Arrays.asList(Util.null2String(requesData.get("zs")).split(","))); // 主送 + records.addAll(Arrays.asList(Util.null2String(requesData.get("dqbm")).split(","))); // 当前部门 + records.addAll(Arrays.asList(Util.null2String(requesData.get("cb")).split(","))); // 抄报 + records.addAll(Arrays.asList(Util.null2String(requesData.get("bmhqzj")).split(","))); // 部门会签(追加) + records.addAll(Arrays.asList(Util.null2String(requesData.get("bmybzj")).split(","))); // 部门阅办(追加) + ArrayList deptName = new ArrayList<>(); + DepartmentComInfo departmentComInfo = new DepartmentComInfo(); + for (String record : records) { + try { + if (StringUtil.isEmpty(record)){ + continue; + } + String departmentName = departmentComInfo.getDepartmentmark(record); + deptName.add(departmentName); + } catch (Exception e) { + e.printStackTrace(); + } + } + + return String.join("&&", deptName); + } + + private void updateRecord(int requestid, String field , String fieldvalue) { + String sql = "update uf_pushArchivesLog set "+field+" = ? where request = ?"; + RecordSet recordSet = new RecordSet(); + recordSet.executeUpdate(sql, fieldvalue, requestid); + } + + +} diff --git a/com/engine/custom/archives/util/ArchivesUtil.java b/com/engine/custom/archives/util/ArchivesUtil.java index 39e403f..eff25d8 100644 --- a/com/engine/custom/archives/util/ArchivesUtil.java +++ b/com/engine/custom/archives/util/ArchivesUtil.java @@ -35,14 +35,15 @@ import java.lang.reflect.Field; import java.net.URL; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; +import java.time.LocalTime; import java.util.*; public class ArchivesUtil { public static Logger log = LoggerFactory.getLogger("Archives"); - public static final String SQL = "select * from uf_pushArchivesLog where ddsj >= ? and ddsj <= ? " + - " and type = ? and ( zt is null or zt = 1 ) "; + public static final String SQL = "select request from uf_pushArchivesLog where ddsj <= ? " + + " and type = ? and ( zt is null or zt = 1 ) group by REQUEST"; /** * 获取前一天的date @@ -105,13 +106,13 @@ public class ArchivesUtil { public static List getResultList(RecordSet rs, String beginTime, String endTime, int type) { - rs.executeQuery(SQL, beginTime, endTime, type); + rs.executeQuery(SQL, endTime, type); // Field[] fields = PushArchivesBean.class.getDeclaredFields(); - + log.info("getResultListSQL:{}?{}?{}",SQL,endTime,type); LinkedList result = new LinkedList<>(); while (rs.next()) { PushArchivesBean pushArchivesBean = new PushArchivesBean(); - pushArchivesBean.setId(Util.getIntValue(rs.getString("id"))); + // pushArchivesBean.setId(Util.getIntValue(rs.getString("id"))); pushArchivesBean.setRequest(Util.getIntValue(rs.getString("request"))); result.add(pushArchivesBean); } @@ -121,7 +122,7 @@ public class ArchivesUtil { /** * 获取流程自动发起的节点 * - * @param mainAndSubRequestId + * @param workflowid * @return */ public static List getAutoInitNodeIds(String workflowid) { @@ -139,7 +140,7 @@ public class ArchivesUtil { recordSet.executeQuery(sql,workflowid); String exclusenodeid= ""; if (recordSet.next()){ - recordSet.getString("exclusenodeid"); + exclusenodeid = recordSet.getString("exclusenodeid"); } return Arrays.asList(exclusenodeid.split(",")); } @@ -296,7 +297,7 @@ public class ArchivesUtil { HashMap params = new HashMap<>(); params.put("requestid", reqid); params.put("desremark", "all"); - params.put("pageSize", "999"); + params.put("pageSize", "9999"); params.put("isfirst", "true"); // params.put("request", request); Map data = ArchivesUtil.getSignLogCmd(params, new User(1)); @@ -389,7 +390,7 @@ public class ArchivesUtil { // 加载模板并填充数据 log.error("模板路径:{}", TemplatePath); // 导出Word文档 - String outputPath = filePath + File.separator + requestid + File.separator + dirName + File.separator + "文件流转信息" + ".docx"; // 输出文件路径 + String outputPath = filePath + File.separator + "togd" +requestid + File.separator + dirName + File.separator + "文件流转信息" + ".docx"; // 输出文件路径 log.error("生成文件路径:{}", TemplatePath); return generate(TemplatePath, TemplateName, dataMap, outputPath); @@ -1047,16 +1048,17 @@ public class ArchivesUtil { /** - * 获取当前流程下的所有子流程(最大5层) + * 获取当前流程下的所有子流程 * - * @param requestid + * @param requestid 主流程id + * @param max 遍历次数 * @return */ - public static Map getSubRequest(String requestid) { + public static Map getSubRequest(String requestid,int max) { HashMap records = new HashMap<>(); RecordSet rs = new RecordSet(); String ids = requestid; - for (int i = 0; i < 5; i++) { + for (int i = 0; i < max; i++) { ArrayList idList = new ArrayList<>(); String sql = "select requestid , workflowid from workflow_requestbase where mainrequestid in ( " + ids + " )"; rs.executeQuery(sql); @@ -1065,7 +1067,7 @@ public class ArchivesUtil { String workflowid = Util.null2String(rs.getString("workflowid")); idList.add(subrequestid); // 使用map自动去重,一种流程类型只取一个requestid - records.put(workflowid, subrequestid); + records.put(subrequestid, workflowid); } ids = String.join(",", idList); } @@ -1278,7 +1280,7 @@ public class ArchivesUtil { } else if (extName.matches("(ofd|OFD)")) { convertType = "57"; } else if (extName.matches("(GIF|JPEG|JPG|BMP|PNG|gif|jpeg|jpg|bmp|png)")) { - convertType = "44"; + convertType = "32"; } else if (extName.matches("(PDF|pdf)")) { convertType = "34"; } @@ -1367,6 +1369,9 @@ public class ArchivesUtil { if (loginid.length() > 8) { loginid = loginid.substring(0, 8); } + if ("fenfa".equals(loginid)){ + continue; + } set.add(loginid); } return String.join("&&", set); @@ -1379,7 +1384,8 @@ public class ArchivesUtil { List subRequest = ArchivesUtil.getSubRequestIds(requestid, isSubReq); String sql = "select * from WORKFLOW_REQUESTLOG where REQUESTID in ( " + String.join(",", subRequest) + " )" + - " and (annexdocids is not null or annexdocids <> '')"; + "and logtype != '1' and (annexdocids is not null or annexdocids <> '' ) "; + log.error("getSignFilessql:{}",sql); recordSet.executeQuery(sql); while (recordSet.next()) { String annexdocids = Util.null2String(recordSet.getString("annexdocids")); @@ -1402,7 +1408,7 @@ public class ArchivesUtil { */ public static List generaSubRequestFormPdf(String requestid) { log.error("generaSubRequestFormPdf,requestid:{}", requestid); - Map subRequest = ArchivesUtil.getSubRequest(requestid); + Map subRequest = ArchivesUtil.getSubRequest(requestid,5); for (String s : subRequest.keySet()) { requestid = subRequest.get(s); break; @@ -1440,4 +1446,77 @@ public class ArchivesUtil { return workflowToDoc.execute(requestInfo, reqType); } + // + public static int findMaxValue(String commaSeparatedValues) { + try { +// 分割字符串 + String[] numbers = commaSeparatedValues.split(","); + // 初始化最大值为整数的最小值 + int max = 0; + + // 遍历字符串数组 + for (String number : numbers) { + // 转换为整数 + int value = Integer.parseInt(number.trim()); // 使用trim()移除可能的空格 + // 检查是否为最大值 + if (value > max) { + max = value; + } + } + return max; + }catch (NumberFormatException e){ + log.error("ConversionException:"+commaSeparatedValues); + return 0; + } + + + } + + + + public static String[] getSubCom(String ngbm) { + RecordSet rs = new RecordSet(); + rs.executeQuery("select sub.id subid , SUBCOMPANYNAME from HRMDEPARTMENT dept left join HRMSUBCOMPANY sub " + + " on dept.SUBCOMPANYID1 = sub.ID " + + " where dept.id = ? ",ngbm); + rs.next(); + String subcompanyname = rs.getString("SUBCOMPANYNAME"); + String subid = rs.getString("subid"); + if ("总行".equals(subcompanyname)){ + subcompanyname = "总行机关"; + } + rs.executeQuery("select DAPYBH from HRMSUBCOMPANYDEFINED where SUBCOMID = ?",subid); + rs.next(); + String DAPYBH = rs.getString("DAPYBH"); + return new String[]{DAPYBH,subcompanyname}; + } + + + + public static void deleteDirectory( String directoryPath ){ + // 创建File对象 + File directory = new File(directoryPath); + + try { + // 使用FileUtils.deleteDirectory删除目录及其子目录和文件 + FileUtils.deleteDirectory(directory); + log.info("目录删除成功:{}",directory); + } catch (IOException e) { + e.printStackTrace(); + log.error("目录删除失败:{}",directory); + log.error("失败原因:{}",e.getMessage()); + } + } + + public static boolean isAfterSevenAM(int time) { + // 获取当前时间 + LocalTime currentTime = LocalTime.now(); + + // 定义早上7点的时间 + LocalTime sevenAM = LocalTime.of(time, 0); + + // 比较当前时间和早上7点 + return currentTime.isAfter(sevenAM); + } + } diff --git a/com/engine/custom/archives/util/KeyWord.java b/com/engine/custom/archives/util/KeyWord.java new file mode 100644 index 0000000..140b076 --- /dev/null +++ b/com/engine/custom/archives/util/KeyWord.java @@ -0,0 +1,25 @@ +package com.engine.custom.archives.util; + +import java.io.File; + +public interface KeyWord { + public static final String ZWDIR = "正文"; + public static final String FJDIR = "附件"; + public static final String CBDDIR = "承办单"; + public static final String ZLCDIR = "承办单" + File.separator + "子流程"; + public static final String LZXXDIR = "流转信息"; + public static final String FJFILE = "附件"; + public static final String FJWORD = "附件"; + public static final String ZWWORD = "正文"; + public static final String LHGWORD = "留痕稿"; + public static final String LCFJWORD = "流程附件"; + public static final String QZYJFJWORD = "签字意见附件"; + public static final String WJCLDWORD = "文件处理单"; + public static final String WJLZXXWORD = "文件流转信息"; + public static final String XBBMFJWORD = "协办部门附件"; + + + + + +} diff --git a/com/engine/custom/archives/workflow/biz/requestForm/WfToDocBizCus.java b/com/engine/custom/archives/workflow/biz/requestForm/WfToDocBizCus.java index 566c497..674e334 100644 --- a/com/engine/custom/archives/workflow/biz/requestForm/WfToDocBizCus.java +++ b/com/engine/custom/archives/workflow/biz/requestForm/WfToDocBizCus.java @@ -34,7 +34,7 @@ public class WfToDocBizCus extends BaseBean { public static Logger log = LoggerFactory.getLogger("Archives"); //底部签字意见列表显示数量 - private int pageSize =100; + private int pageSize =99999; //是否用wk转换 private String useWk=""; private int keepsign; @@ -154,7 +154,7 @@ public class WfToDocBizCus extends BaseBean { /* * 生成html和pdf */ - public void generatepdfandhtml(String requestid, String filename, String temppath, String src, int reqType){ + public void generatepdfandhtml(String requestid, String filename, String temppath, String src, int reqType ,String workflowid){ int onlyHtml =0; if (docfiles.contains("2")&&!docfiles.contains("3")){ //只选了生成离线html 没选pdf onlyHtml =1; @@ -174,6 +174,7 @@ public class WfToDocBizCus extends BaseBean { params.put("src",src); params.put("modeid",useModeid); params.put("isSubrequest",reqType == 1); + params.put("workflowid",workflowid); //是否使用wk,在config表中读配置 WorkflowConfigComInfo configComInfo = new WorkflowConfigComInfo(); useWk = Util.null2String(configComInfo.getValue("htmltopdf_usewk")); diff --git a/com/engine/custom/archives/workflow/biz/requestLog/RequestLogCusBiz.java b/com/engine/custom/archives/workflow/biz/requestLog/RequestLogCusBiz.java index 28a1654..d6955de 100644 --- a/com/engine/custom/archives/workflow/biz/requestLog/RequestLogCusBiz.java +++ b/com/engine/custom/archives/workflow/biz/requestLog/RequestLogCusBiz.java @@ -98,7 +98,7 @@ public class RequestLogCusBiz { public static ArrayList getRequestLog(int requestid, int workflowid, String viewLogIds, String orderby, int pageSize, int pagenumber, String sqlwhere , boolean isSubrequest) { ArrayList logs = new ArrayList(); RecordSet rs = new RecordSet(); - + pageSize = 999999; int min = (pagenumber - 1) * pageSize; int max = pagenumber * pageSize; @@ -121,6 +121,7 @@ public class RequestLogCusBiz { splitinertSql.append(" select t.*,rownum rn from (" + sql + ") t "); splitinertSql.append(" ) t1 where rn >").append(min).append(" and rn <=").append(max); } + log.error("splitinertSql:{}"+splitinertSql); rs.execute(splitinertSql.toString()); while (rs.next()) { Hashtable hashtable = addLogItem(rs); diff --git a/com/engine/custom/audit/corn/OA2AuditCorn.java b/com/engine/custom/audit/corn/OA2AuditCorn.java new file mode 100644 index 0000000..faaaaec --- /dev/null +++ b/com/engine/custom/audit/corn/OA2AuditCorn.java @@ -0,0 +1,36 @@ +package com.engine.custom.audit.corn; + +import com.engine.custom.audit.service.PushAuditService; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import weaver.general.BaseBean; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; + +public class OA2AuditCorn extends weaver.interfaces.schedule.BaseCronJob { + public static Logger log = LoggerFactory.getLogger("Audit"); + public String filePath = "/opt/weaver/auditFile"; + + PushAuditService service = new PushAuditService(); + + @Override + public void execute() { + log.info("OA2AuditCorn====Begin========"); + System.out.println("OA2AuditCorn====Begin========"); + Date date = new Date(); + // Calendar calendar = Calendar.getInstance(); + // calendar.setTime(date); + // //把日期往后增加一天.整数往后推,负数往前移动(1:表示明天、-1:表示昨天,0:表示今天) + // calendar.add(Calendar.DATE, -1); + // date = calendar.getTime(); + SimpleDateFormat yyyyMMdd = new SimpleDateFormat("yyyyMMdd"); + String format = yyyyMMdd.format(date); + HashMap param = new HashMap<>(); + param.put("filePath",filePath); + service.initData(param); + service.genDocTxt(format,"SJ"); + } +} diff --git a/com/engine/custom/audit/service/PushAuditService.java b/com/engine/custom/audit/service/PushAuditService.java new file mode 100644 index 0000000..e0646f1 --- /dev/null +++ b/com/engine/custom/audit/service/PushAuditService.java @@ -0,0 +1,350 @@ +package com.engine.custom.audit.service; + + +import com.engine.custom.hg.entity.HGBean; +import com.engine.custom.hg.util.HgUtils; +import com.engine.custom.hg.util.ZipUtil; +import org.apache.tools.zip.ZipOutputStream; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import weaver.conn.RecordSet; +import weaver.file.ImageFileManager; +import weaver.general.BaseBean; +import weaver.general.Util; + +import java.io.*; +import java.nio.charset.StandardCharsets; +import java.nio.file.Path; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.*; + +public class PushAuditService { + private static ZipUtil zipUtil= new ZipUtil(); + BaseBean bean = new BaseBean(); + public static Logger log = LoggerFactory.getLogger("Audit"); + + private String filePath = "/opt/weaver/auditFile"; + // private static final String filePath = "E:\\test"; + //出巡时间内推送失败或未推送的数据 + public static final String getrqBydatesql = "select * from uf_tosjLog where ddsj > ? and ddsj < ? "; + public static final String updatesql = "update uf_tosjLog set esbml = ? where id = ?"; + public static final String updatetxtsql = "update uf_tosjLog set zt = 1 , esbtxtml = ? where id in ("; + + public void initData(Map param){ + filePath = param.get("filePath"); + } + + public void genDocTxt(String day, String tranCode) { + String dirDate = zipUtil.mkTemper(filePath); + RecordSet recordSet = new RecordSet(); + log.info("dirDate====="+dirDate); + Date date = getDate(day); + // 获取当前时间的第一秒 + SimpleDateFormat yyyyMMddHHmmss = new SimpleDateFormat("yyyy-MM-dd HH:mm"); + String firstSecond = yyyyMMddHHmmss.format(getFirstSecondOfDate(date)); + + // 获取当前时间的最后一秒 + String lastSecond =yyyyMMddHHmmss.format(getLastSecondOfDate(date)); + File file = null; + List HGBeans = getData(firstSecond, lastSecond); + String dateDir = "tosj_" + new SimpleDateFormat("yyyyMMdd000000").format(date); + if ("SJ".equals(tranCode)) { + file = zipUtil.crFile(dirDate + "/tosj_" + new SimpleDateFormat("yyyyMMdd000000").format(date)); + log.info("推送合规系统"+file.getPath()+file.getName()); + } else { + // log.info("无此系统" + tranCode + ",拒绝推送"); + } + ArrayList ids = new ArrayList<>(); + + if (HGBeans.size() == 0) { + // zipUtil.writeToTxt(file.getPath(), file.getName(), "", false); + }else{ + for (HGBean hgBean : HGBeans) { + if (!isEnd(hgBean.getRequestId()+"")){ + continue; + } + //生成TXT + // String s1 = new String(hgBean.getContent().getBytes(StandardCharsets.UTF_8)); + zipUtil.writeToTxt(file.getPath(), file.getName(), hgBean.getContent() , true); + // zipUtil.writeToTxt(file.getPath(), file.getName(), s1 , true); + + //生成附件 + Map fjIdName = new HashMap(); + Map fjIdPath = new HashMap(); + Map zwIdName = new HashMap(); + Map zwIdPath = new HashMap(); + Map fjIdimg = new HashMap(); + Map zwIdimg = new HashMap(); + Map reqESBpathMap = new HashMap(); + getIdPathName(hgBean.getFjid(),fjIdPath,fjIdName); + getIdPathName(hgBean.getZwid(),zwIdPath,zwIdName); + // log.info(fjIdName.toString()); + // log.info(fjIdPath.toString()); + // log.info(zwIdName.toString()); + // log.info(zwIdPath.toString()); + getIdIMIDName(hgBean.getFjid(),fjIdimg); + getIdIMIDName(hgBean.getZwid(),zwIdimg); + //压缩 =正文附件文件 + log.info("压缩文件开始====="+file.getPath() + File.separator + "sj"+hgBean.getRequestId()+".zip"); + File filezip = new File(file.getPath() + File.separator + "sj"+hgBean.getRequestId()+".zip"); + ZipOutputStream zos =null; + try { + zos = new ZipOutputStream( new FileOutputStream(filezip)); + // zos.setEncoding("gbk"); + addFile2zip(file, hgBean, fjIdimg,1,zos); + addFile2zip(file, hgBean, zwIdimg,2,zos); + + // } catch (UnsupportedEncodingException e) { + // log.info("压缩文件异常====="+file.getPath() + File.separator + hgBean.getRequestId()+".zip"); + // log.info("压缩文件异常信息====="+e.getMessage()); + // e.printStackTrace(); + } catch ( FileNotFoundException e) { + log.info("压缩文件异常====="+file.getPath() + File.separator + "sj"+hgBean.getRequestId()+".zip"); + log.info("压缩文件异常信息====="+e.getMessage()); + e.printStackTrace(); + } finally { + try { + zos.close(); + log.info("压缩文件结束====="+file.getPath() + File.separator + "sj"+hgBean.getRequestId()+".zip"); + } catch (IOException e) { + e.printStackTrace(); + } + } + + try { + log.info("filezip.getAbsolutePath()==="+filezip.getAbsolutePath()); + log.info("hgBean.getRequestId()+\".zip\"==="+"sj"+hgBean.getRequestId()+".zip"); + //推送附件 + // String s = HgUtils.putFile(filezip.getAbsolutePath(), dateDir+File.separator+hgBean.getRequestId() + ".zip"); + String s = HgUtils.putFile(filezip.getAbsolutePath(), "sj"+hgBean.getRequestId() + ".zip"); + if (s.length()>0){ + ids.add(hgBean.getId()+""); + recordSet.executeUpdate(updatesql,s,hgBean.getId()); + } + log.info("ESB返回==="+s); + } catch (com.dcfs.fts.common.error.FtpException e) { + log.info("FTP异常==="+e.getMessage()); + } catch (IOException e) { + log.info("FTP异常==="+e.getMessage()); + e.printStackTrace(); + } + + } + // 压缩txt推送 + File writename = new File(file.getPath() + File.separator+"tosj_" + new SimpleDateFormat("yyyyMMdd000000").format(date)+".txt"); + File txtzip = new File(file.getPath() + File.separator + "tosj_" + new SimpleDateFormat("yyyyMMdd000000").format(date)+".zip"); + log.info("writename ==== "+writename.getAbsolutePath() +"===="+ writename.getName()); + log.info("txtzip ==== "+txtzip.getAbsolutePath() +"===="+ txtzip.getName()); + try { + OutputStream outputStream = new FileOutputStream(txtzip); + ZipUtil.filesToZip(writename , outputStream ,"tosj_" + new SimpleDateFormat("yyyyMMdd000000").format(date)+File.separator+writename.getName()); + // String s = HgUtils.putFile(txtzip.getAbsolutePath(), dateDir+File.separator+dateDir + ".zip"); + String s = HgUtils.putFile(txtzip.getAbsolutePath(), dateDir + ".zip"); + log.info("ESB返回==="+s); + if (s.length()>0){ + String idstr = String.join(",",ids); + recordSet.executeUpdate(updatetxtsql+idstr+" )",s); + } + } catch (Exception e) { + log.info("FTP异常==="+e.getMessage()); + e.printStackTrace(); + } + + } + } + + private void addFile2zip(File file, HGBean hgBean, Map Idimg, int type, ZipOutputStream zos) { + String fileType = ""; + + if (type == 1){ + fileType = "sj"+hgBean.getRequestId()+File.separator+"附件"+File.separator; + }else if(type == 2){ + fileType = "sj"+hgBean.getRequestId()+File.separator+"正文"+File.separator; + } + // String path = new String(fileType.getBytes(StandardCharsets.UTF_8)); + // File filepath = zipUtil.crFile(file.getPath() + File.separator + hgBean.getRequestId()); + + + String finalFileType = fileType; + ArrayList fileNameList = new ArrayList<>(); + + Idimg.forEach((key, value) ->{ + FileOutputStream fos = null; + try { + // fos = new FileOutputStream(filezip); + // org.apache.tools.zip.ZipOutputStream zos = new org.apache.tools.zip.ZipOutputStream(fos); + // + // zos.setEncoding("utf-8"); + + ImageFileManager ifm = new ImageFileManager(); + ifm.getImageFileInfoById(Integer.parseInt(value)); + //writeLogs("2622 downloadFlag=" + downloadFlag); + InputStream imagefile = ifm.getInputStream(); + String filename = finalFileType +ifm.getImageFileName(); + if (fileNameList.contains(filename)){ + String tepName= filename.contains(".")? filename.substring(0, filename.indexOf(".")) : ""; + if(tepName!=null&&!"".equals(tepName)){ + String extNameTemp = filename.contains(".")? filename.substring(filename.lastIndexOf(".") + 1) : ""; + filename = tepName + "_"+value+"."+extNameTemp; + + } + }else { + fileNameList.add(filename); + } + log.info("filename===="+filename); + String filename2 = new String(filename.getBytes(StandardCharsets.UTF_8)); + log.info("filename2===="+filename2); + ZipUtil.addInputStreamToZip(imagefile,zos,filename); + } catch (Exception e) { + e.printStackTrace(); + } + + }); + } + + // 1 附件 2 正文 + private void addFile2Temp(Path tempFile, Map IdPath, Map IdName, int type) throws UnsupportedEncodingException { + String fileType = "";; + if (type == 1){ + fileType = File.separator+"附件"; + }else if(type == 2){ + fileType = File.separator+"正文"; + } + String finalFileType = new String(fileType.getBytes(StandardCharsets.UTF_8)); + IdPath.forEach((key , value) ->{ + // ZipUtil.zipToFolder(value,tempFile.toString()+ finalFileType,IdName.get(key) , ); + }); + } + + + private Date getDate(String day) { + Date date = new Date(); + if (day != null) { + try { + date = new SimpleDateFormat("yyyyMMdd").parse(day); + } catch (ParseException e) { + // writeLog("时间格式错误,重新发送指定日期失败"); + e.printStackTrace(); + } + } + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + //把日期往后增加一天.整数往后推,负数往前移动(1:表示明天、-1:表示昨天,0:表示今天) + calendar.add(Calendar.DATE, -1); + date = calendar.getTime(); + return date; + } + + + + private List getData(String startTime, String endTime){ + log.info("获取推送审计系统数据start"); + RecordSet recordSet = new RecordSet(); + recordSet.executeQuery(getrqBydatesql , startTime ,endTime); + log.info("getrqBydatesql=="+getrqBydatesql + startTime + endTime); + ArrayList hgBeans = new ArrayList<>(); + while (recordSet.next()){ + HGBean hgBean = new HGBean(); + hgBean.setId(Util.getIntValue(recordSet.getString("id"))); + hgBean.setRequestId(Util.getIntValue(recordSet.getString("request"))); + hgBean.setContent(Util.null2String(recordSet.getString("content"))); + hgBean.setZt(Util.getIntValue(recordSet.getString("zt"))); + hgBean.setDdsj(Util.null2String(recordSet.getString("ddsj"))); + hgBean.setTssj(Util.null2String(recordSet.getString("tssj"))); + hgBean.setZwid(Util.null2String(recordSet.getString("zwid"))); + hgBean.setFjid(Util.null2String(recordSet.getString("fjid"))); + String ml = Util.null2String(recordSet.getString("ml")); + hgBean.setMl(Arrays.asList(ml.split(","))); + String fjml = Util.null2String(recordSet.getString("fjml")); + hgBean.setMl(Arrays.asList(fjml.split(","))); + hgBeans.add(hgBean); + } + log.info("数据条数="+hgBeans.size()); + return hgBeans; + } + + // 获取指定日期的第一秒 + public static Date getFirstSecondOfDate(Date date) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + calendar.set(Calendar.HOUR_OF_DAY, 0); + calendar.set(Calendar.MINUTE, 0); + calendar.set(Calendar.SECOND, 0); + calendar.set(Calendar.MILLISECOND, 0); + return calendar.getTime(); + } + + // 获取指定日期的最后一秒 + public static Date getLastSecondOfDate(Date date) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + calendar.set(Calendar.HOUR_OF_DAY, 23); + calendar.set(Calendar.MINUTE, 59); + calendar.set(Calendar.SECOND, 59); + calendar.set(Calendar.MILLISECOND, 999); + return calendar.getTime(); + } + + /** + * + * @param ids + * @return id 路径 + */ + public static void getIdPathName(String ids ,Map idFilePathMap ,Map idFileNameMap ){ + String sql = "select docid,df.imagefilename filename,filerealpath filepath from docimagefile df left join imagefile imf on df.imagefileid = imf.imagefileid where DOCID in ("+ids+")"; + RecordSet recordSet = new RecordSet(); + recordSet.execute(sql); + while (recordSet.next()){ + String docid = Util.null2String(recordSet.getString("docid")); + String filename = Util.null2String(recordSet.getString("filename")); + String filepath = Util.null2String(recordSet.getString("filepath")); + idFileNameMap.put(docid,filename); + idFilePathMap.put(docid,filepath); + } + }; + + public static void getIdIMIDName(String ids ,Map idimageIDMap ){ + String sql = "select docid,df.imagefileid imgid from docimagefile df left join imagefile imf on df.imagefileid = imf.imagefileid where DOCID in ("+ids+")"; + RecordSet recordSet = new RecordSet(); + recordSet.execute(sql); + while (recordSet.next()){ + String docid = Util.null2String(recordSet.getString("docid")); + String imgid = Util.null2String(recordSet.getString("imgid")); + idimageIDMap.put(docid,imgid); + } + }; + + public static boolean isEnd(String requestid ){ + String sql = "select CURRENTNODETYPE,CURRENTNODEID from WORKFLOW_REQUESTBASE where requestid = ?"; + RecordSet recordSet = new RecordSet(); + recordSet.executeQuery(sql,requestid); + String CURRENTNODETYPE = ""; + String CURRENTNODEID = ""; + if(recordSet.next()){ + CURRENTNODETYPE = recordSet.getString("CURRENTNODETYPE"); + CURRENTNODEID = recordSet.getString("CURRENTNODEID"); + } + log.error("isEnd"+CURRENTNODETYPE); + return "3".equals(CURRENTNODETYPE); + }; + + // public void put(String filenameL, String filenameR, String tranCode, int flg) throws FtpException { + // FtpClientConfig config = FtpClientConfig.getInstance(); + // log.info("配置文件路径________________________________________________________________"+filePath); + // config.loadConf(filePath); + // FtpPut put = new FtpPut(filenameL, filenameR, tranCode, flg, config); + // log.info("PUT————————>response:[" + put.doPutFile() + "]"); + // put.close(); + // } + + // public static String putFile(String localFileName, String remoteFileName, String tranCode) throws FtpException, IOException, com.dcfs.fts.common.error.FtpException { + // FtpClientConfig config = FtpClientConfig.getInstance(); + // FtpPut ftpPut = new FtpPut(localFileName, remoteFileName, tranCode, true, true, config); + // String filePath = ftpPut.doPutFile(); + // return filePath; + // } + + + +} diff --git a/com/engine/custom/msg/MessageReceiveTest.java b/com/engine/custom/msg/MessageReceiveTest.java new file mode 100644 index 0000000..3c44a4c --- /dev/null +++ b/com/engine/custom/msg/MessageReceiveTest.java @@ -0,0 +1,120 @@ +package com.engine.custom.msg; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; + +import com.cloudstore.dev.api.bean.MessageBean; +import com.weaver.base.msgcenter.channel.IMessageReceive; +import com.weaver.general.Util; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import weaver.conn.RecordSet; +import weaver.general.BaseBean; +import weaver.general.StringUtil; +import weaver.hrm.HrmUserVarify; +import weaver.hrm.User; + +import java.util.List; +import java.util.Map; + +public class MessageReceiveTest implements IMessageReceive { + public static Logger log = LoggerFactory.getLogger("Archives"); + private BaseBean bean=new BaseBean(); + @Override + public void onMessage(String s) { + log.error("onMessage:{}",s); + bean.writeLog("onMessage:{}",s); + List localList = JSONArray.parseArray(s, MessageBean.class); + for (MessageBean messageBean : localList) { + String customContext = getCustomContext(messageBean); + log.error("customContext:{}",customContext); + } + } + + @Override + public void onStart() { + log.error("onStartExecute"); + bean.writeLog("onStartExecute"); + } + + @Override + public void onEnd() { + log.error("onEndExecute"); + bean.writeLog("onEndExecute"); + } + + @Override + public void setProp(Map map) { + log.error("setProp:{}",map); + bean.writeLog("setProp:{}"+map); + } + + @Override + public void setList(List list) { + log.error("setList:{}", JSONObject.toJSONString(list)); + bean.writeLog("setList:{}"+ JSONObject.toJSONString(list)); + } + + private String getCustomContext(MessageBean messageBean) { + log.error("onMessage:{}",messageBean); + String customContext = ""; + if (messageBean == null ){ + bean.writeLog("messageBean==null,异常"); + return customContext; + } + String messageGroupTypeName = Util.null2String(messageBean.getMessageGroupTypeName()); + if (messageGroupTypeName.contains("流程")){ + RecordSet rs = new RecordSet(); + String targetId = messageBean.getTargetId(); + if (StringUtil.isEmpty(targetId)||targetId.contains("|")){ + return Util.null2String(messageBean.getContext()); + } + rs.executeQuery("select * from WORKFLOW_REQUESTBASE where REQUESTID = ?",targetId); + if (rs.next()){ + int creater = Util.getIntValue(rs.getString("creater")); + User user = new User(creater); + String createdate = Util.null2String(rs.getString("createdate")); + String createtime = Util.null2String(rs.getString("createtime")); + customContext = messageGroupTypeName + "-" + (StringUtil.isEmpty(messageBean.getContext()) ? messageBean.getTitle() : messageBean.getContext() ) + ",创建人:" + user.getLastname() + +",创建时间:"+createdate + " " + createtime + " ,请您登录到办公网进行处理。"; + } + }else if(messageGroupTypeName.contains("邮件") || messageGroupTypeName.contains("信件")){ + // String date = messageBean.getDate(); + // String time = messageBean.getTime(); + customContext = messageGroupTypeName + "-" + (StringUtil.isEmpty(messageBean.getContext()) ? messageBean.getTitle() : messageBean.getContext() ) + " ,请您登录到办公网进行处理。"; + }else { + customContext = Util.null2String(messageBean.getContext()); + } + return customContext; + } + + + public static String getStringValue(JSONObject jsonObject, String key) { + return jsonObject.containsKey(key) ? jsonObject.getString(key) : null; + } + + public static Integer getIntegerValue(JSONObject jsonObject, String key) { + return jsonObject.containsKey(key) ? jsonObject.getInteger(key) : null; + } + + + public static void main(String[] args) { + // 示例 JSON 字符串 + String jsonString = "{\"name\":\"John\", \"age\":30}"; + + // 将 JSON 字符串解析为 JSONObject + JSONObject jsonObject = JSONObject.parseObject(jsonString); + + // 检查 key 是否存在并获取值 + String name = getStringValue(jsonObject, "name"); + String age = getStringValue(jsonObject, "age"); + String address = getStringValue(jsonObject, "address"); // key 不存在 + + // 输出结果 + System.out.println("Name: " + name); // 输出: Name: John + System.out.println("Age: " + age); // 输出: Age: 30 + System.out.println("Address: " + address); // 输出: Address: null + } + +} diff --git a/com/engine/workflow/cmd/codeMaintenance/GetReserveCodeNewInfosCmd.java b/com/engine/workflow/cmd/codeMaintenance/GetReserveCodeNewInfosCmd.java new file mode 100644 index 0000000..8be7fb7 --- /dev/null +++ b/com/engine/workflow/cmd/codeMaintenance/GetReserveCodeNewInfosCmd.java @@ -0,0 +1,671 @@ +package com.engine.workflow.cmd.codeMaintenance; + +import java.util.ArrayList; +import java.util.Calendar; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import weaver.conn.RecordSet; +import weaver.general.Util; +import weaver.hrm.User; +import weaver.hrm.company.DepartmentComInfo; +import weaver.hrm.company.SubCompanyComInfo; +import weaver.system.code.CodeBuild; +import weaver.system.code.CoderBean; +import weaver.systeminfo.SystemEnv; + +import com.api.browser.bean.SearchConditionItem; +import com.api.browser.bean.SearchConditionOption; +import com.api.browser.util.ConditionFactory; +import com.api.browser.util.ConditionType; +import com.engine.core.interceptor.Command; +import com.engine.core.interceptor.CommandContext; + +/** + * 预留编号新建页面信息 + * @author longxx + * */ +public class GetReserveCodeNewInfosCmd implements Command>{ + + private Map params; + private User user; + protected String formId; + protected String isBill; + protected ConditionFactory conditionFactory; + + public GetReserveCodeNewInfosCmd(Map params,User user) { + this.params = params; + this.user = user; + conditionFactory = new ConditionFactory(user); + } + + @Override + public Map execute(CommandContext commandContext) { + return getReserveCodeNewInfos(); + } + + /** + * 获取预留编号新建页面信息 + * */ + public Map getReserveCodeNewInfos(){ + Map finalReturnMap = new HashMap(); + Map conditionInfos = new HashMap(); + + String workflowId = Util.null2String(params.get("workflowid")); + boolean isFromForm = "1".equals(Util.null2String(params.get("isFromForm")));//是否由表单中进来 + + if(!isFromForm) { + int subCompanyId = Util.getIntValue(Util.null2String(params.get("subCompanyId")),-1); + subCompanyId = WorkflowCodeUtil.getSubComIdByWfId(workflowId,subCompanyId); + String isFromPathSet = Util.null2String(params.get("isFromPathSet")); + String codeType = "1"; + //编号设置进来,校验流程编号权限 + if ("1".equals(isFromPathSet)) { + codeType = "2"; + } + int operateLevel = WorkflowCodeUtil.getCodeOperateLevel(user, subCompanyId, codeType); + if (operateLevel < 0) { + conditionInfos.put("newInfo_state", "noright"); + return conditionInfos; + } + } + + //从表单过来的参数 + String form_yearId = Util.null2String(params.get("yearId")); + String form_monthId = Util.null2String(params.get("monthId")); + String form_dateId = Util.null2String(params.get("dateId")); + String form_fieldId = Util.null2String(params.get("fieldId")); + String form_fieldValue = Util.null2String(params.get("fieldValue")); + String form_supSubCompanyId = Util.null2String(params.get("supSubCompanyId")); + String form_subCompanyId = Util.null2String(params.get("subCompanyId")); + String form_departmentId = Util.null2String(params.get("departmentId")); + List formYearIdList = Util.splitString2List(form_yearId, ","); + List formMonthIdList = Util.splitString2List(form_monthId, ","); + List formDateIdList = Util.splitString2List(form_dateId, ","); + List formFieldIdList = Util.splitString2List(form_fieldId, ","); + List formFieldValueList = Util.splitString2List(form_fieldValue, ","); + List formSupSubcompanyIdList = Util.splitString2List(form_supSubCompanyId, ","); + List formSubcompanyIdList = Util.splitString2List(form_subCompanyId, ","); + List formDepartmentIdList = Util.splitString2List(form_departmentId, ","); + int yearIndex = 0; + int monthIndex = 0; + int dateIndex = 0; + int supSubCompanyIndex = 0; + int subCompanyIndex = 0; + int departmentIndex = 0; + + Map formInfo = WorkflowCodeUtil.getFormInfo(workflowId); + isBill = Util.null2String(formInfo.get("isbill")); + formId = Util.null2String(formInfo.get("formid")); + Map> codeInfos = getCodeRegulateInfo(workflowId); + List conCreteFieldList = codeInfos.get("concreteFields"); + List codeValueList = codeInfos.get("codeValues"); + + List> groupList = new ArrayList>(); + + Map codeSetGroupItem = new HashMap(); + Map seqSetGroupItem = new HashMap(); + List codeSetItemList = new ArrayList(); + List seqSetItemList = new ArrayList(); + + codeSetGroupItem.put("defaultshow", true); + codeSetGroupItem.put("items", codeSetItemList); + codeSetGroupItem.put("title", SystemEnv.getHtmlLabelName(83549, user.getLanguage())); + + seqSetGroupItem.put("defaultshow", true); + seqSetGroupItem.put("items", seqSetItemList); + seqSetGroupItem.put("title", SystemEnv.getHtmlLabelName(10000891, Util.getIntValue(user.getLanguage()))); + + groupList.add(codeSetGroupItem); + groupList.add(seqSetGroupItem); + + //当前流水号 + SearchConditionItem currentSeqId = conditionFactory.createCondition(ConditionType.INPUT, 125356, "currentSeqId"); + currentSeqId.setViewAttr(1); + currentSeqId.setFieldcol(16); + currentSeqId.setLabelcol(6); + Map cruuentSeqIdOtherParams = new HashMap(); + cruuentSeqIdOtherParams.put("hasBorder", true); + currentSeqId.setOtherParams(cruuentSeqIdOtherParams); + seqSetItemList.add(currentSeqId); + + int strNum = 0;//记录字符串个数 + int selectedMonthId = 0; + int selectedYearId = 0; + + CodeBuild cbuild = new CodeBuild(Util.getIntValue(formId),isBill,Util.getIntValue(workflowId)); + CoderBean cbean = cbuild.getFlowCBuild(); + String dateSeqAlone = cbean.getDateSeqAlone();//1:日期单独流水 + String dateSeqSelect = cbean.getDateSeqSelect();//获取日期单独流水方式 + String dateSeqFieldId = cbean.getCorrespondDate();//获取日期单独流水字段 + + boolean seqYearExists = false; + boolean seqMonthExists = false; + //先遍历一遍,查看日期单独流水字段年月日,是否都存在编号组成中 + for(int i = 0;i < conCreteFieldList.size();i++) { + String conCreteField = conCreteFieldList.get(i); + String codeValue = codeValueList.get(i); + if(Util.null2String(dateSeqFieldId).equals(codeValue)) { + if(conCreteField.equals("4")) { + seqYearExists = true; + }else if(conCreteField.equals("5")) { + seqMonthExists = true; + } + } + } + + for(int i = 0;i < conCreteFieldList.size();i++){ + String conCreteField = conCreteFieldList.get(i); + String codeValue = codeValueList.get(i);//codevalue存放的是字段的id,如果是文本类型,就是字符串或者流水号位数,如果是选择框,则为value + + Calendar today = Calendar.getInstance(); + int yearIdToday = today.get(Calendar.YEAR); + int monthIdToday = today.get(Calendar.MONTH) + 1; + int dateIdToday = today.get(Calendar.DAY_OF_MONTH); + + if(conCreteField.equals("0")){//选择框 + Map> selectInfos = getSelectInfos(codeValue, isBill);//这里的codevalue为字段id + String selectItemName = "selectValue" + codeValue;//前端name组成为selectValue+字段id + String selectValue = ""; + if(isFromForm) { + int index = formFieldIdList.indexOf(codeValue); + if(index != -1) { + selectValue = formFieldValueList.get(index); + } + } + if(selectValue.equals("")){ + selectValue = "0"; + } + SearchConditionItem selectItem = conditionFactory.createCondition(ConditionType.SELECT, 22755, selectItemName,getSelectOptions(selectInfos,selectValue)); + Map otherParams = new HashMap(); + otherParams.put("hasBorder", true); + selectItem.setFieldcol(16); + selectItem.setLabelcol(6); + selectItem.setOtherParams(otherParams); + if(isFromForm) selectItem.setViewAttr(1); + codeSetItemList.add(selectItem); + }else if(conCreteField.equals("1")){//部门 + String deptItemName = "deptId"; + if(codeValue.equals("-2")) + deptItemName += "_2";//创建人部门 + else + deptItemName += codeValue;//来自表单字段,codeValue为deptid + + String deptId = ""; + if(isFromForm) { + deptId = formDepartmentIdList.get(departmentIndex); + departmentIndex++; + } + + SearchConditionItem deptItem = conditionFactory.createCondition(ConditionType.BROWSER, 124, deptItemName,"4"); + deptItem.setViewAttr(isFromForm ? 1 : 3); + deptItem.setRules("required|string"); + deptItem.setFieldcol(16); + deptItem.setLabelcol(6); + if(!deptId.equals("")){ + List> replaceDatas = new ArrayList>(); + Map datas = getDefaultDept(deptId); + replaceDatas.add(datas);//用于页面浏览框默认显示 + deptItem.getBrowserConditionParam().setReplaceDatas(replaceDatas); + } + deptItem.getBrowserConditionParam().setHasBorder(true); + codeSetItemList.add(deptItem); + }else if(conCreteField.equals("2")){//分部 + String subComItemName = "subComId"; + if(codeValue.equals("-2")) + subComItemName += "_2";//创建人分部 + else + subComItemName += codeValue;//来自表单字段 + + String subComId = ""; + if(isFromForm) { + subComId = formSubcompanyIdList.get(subCompanyIndex); + subCompanyIndex++; + } + + SearchConditionItem subComItem = conditionFactory.createCondition(ConditionType.BROWSER, 141, subComItemName,"164"); + subComItem.setViewAttr(isFromForm ? 1 : 3); + subComItem.setFieldcol(16); + subComItem.setLabelcol(6); + subComItem.setRules("required|string"); + if(!subComId.equals("")){ + List> replaceDatas = new ArrayList>(); + Map datas = getDefaultSubCom(subComId); + replaceDatas.add(datas); + subComItem.getBrowserConditionParam().setReplaceDatas(replaceDatas); + } + subComItem.getBrowserConditionParam().setHasBorder(true); + codeSetItemList.add(subComItem); + }else if(conCreteField.equals("3")){//上级分部 + String supSubComItemName = "supSubComId"; + if(codeValue.equals("-2")) + supSubComItemName += "_2";//创建人分部 + else + supSubComItemName += codeValue;//来自表单字段 + + String supSubComId = ""; + if(isFromForm) { + supSubComId = formSupSubcompanyIdList.get(supSubCompanyIndex); + supSubCompanyIndex++; + } + + SearchConditionItem supSubComItem = conditionFactory.createCondition(ConditionType.BROWSER, 22753, supSubComItemName,"164"); + supSubComItem.setViewAttr(isFromForm ? 1 : 3); + supSubComItem.setFieldcol(16); + supSubComItem.setLabelcol(6); + supSubComItem.setRules("required|string"); + if(!supSubComId.equals("")){ + List> replaceDatas = new ArrayList>(); + Map datas = getDefaultSubCom(supSubComId); + replaceDatas.add(datas); + supSubComItem.getBrowserConditionParam().setReplaceDatas(replaceDatas); + } + supSubComItem.getBrowserConditionParam().setHasBorder(true); + codeSetItemList.add(supSubComItem); + }else if(conCreteField.equals("4")){//年 + + String yearItemName = getFieldMark("yearId", codeValue); + + String yearId = ""; + if(isFromForm) { + if(codeValue.equals("-2")) { + yearId = yearIdToday + ""; + } else { + String fieldValue = Util.null2String(params.get("field" + codeValue)); + yearId = fieldValue.split("-").length > 1 ? fieldValue.split("-")[0] : fieldValue; + } + } + + //获取默认选中值 + String yearValue = getYearDefaultValue(yearId); + selectedYearId = Util.getIntValue(yearValue); + codeSetItemList.add(getYearItem(yearItemName, yearValue, isFromForm)); + } + if(conCreteField.equals("5")){//月 + + String yearItemName = getFieldMark("yearId", codeValue); + String monthItemName = getFieldMark("monthId", codeValue); + + String yearId = ""; + String monthId = ""; + if(isFromForm) { + if(codeValue.equals("-2")) { + yearId = yearIdToday + ""; + monthId = monthIdToday + ""; + } else { + String fieldValue = Util.null2String(params.get("field" + codeValue)); + yearId = fieldValue.split("-").length > 1 ? fieldValue.split("-")[0] : fieldValue; + monthId = fieldValue.split("-").length > 1 ? fieldValue.split("-")[1] : fieldValue; + } + } + + + //获取默认选中月 + String defaultSelectMonth = getMonthDefaultValue(monthId); + + //按月单独流水,当前字段为单独流水字段,且未设置年编号组成,补充一个年选择框,让用户选择年份 + if("1".equals(dateSeqAlone) && dateSeqSelect.equals("2") && codeValue.equals(dateSeqFieldId) && !seqYearExists) { + codeSetItemList.add(getYearItem(yearItemName, getYearDefaultValue(yearId), isFromForm)); + } + + selectedMonthId = Util.getIntValue(defaultSelectMonth);//用户选中的月份 + codeSetItemList.add(getMonthItem(monthItemName, defaultSelectMonth, isFromForm)); + } + if(conCreteField.equals("6")){//日 + + String yearItemName = getFieldMark("yearId", codeValue); + String monthItemName = getFieldMark("monthId", codeValue); + String dateItemName = getFieldMark("dateId", codeValue); + + String yearId = ""; + String monthId = ""; + String dateId = ""; + if(isFromForm) { + if(codeValue.equals("-2")) { + yearId = yearIdToday + ""; + monthId = monthIdToday + ""; + dateId = dateIdToday + ""; + } else { + String fieldValue = Util.null2String(params.get("field" + codeValue)); + yearId = fieldValue.split("-").length == 3 ? fieldValue.split("-")[0] : fieldValue; + monthId = fieldValue.split("-").length == 3 ? fieldValue.split("-")[1] : fieldValue; + dateId = fieldValue.split("-").length == 3 ? fieldValue.split("-")[2] : fieldValue; + } + } + + String defaultSelectDate = ""; + if(!dateId.equals("")){ + defaultSelectDate = dateId; + }else{ + String dateIdStr = ""; + if(dateIdToday < 10) + dateIdStr = "0" + dateIdToday; + else + dateIdStr = "" + dateIdToday; + defaultSelectDate = dateIdStr; + } + + //按日单独流水,当前字段为单独流水字段 + if("1".equals(dateSeqAlone) && dateSeqSelect.equals("3") && codeValue.equals(dateSeqFieldId)) { + //未设置年编号组成,补充一个年选择框,让用户选择年份 + if(!seqYearExists) { + codeSetItemList.add(getYearItem(yearItemName, getYearDefaultValue(yearId), isFromForm)); + } + + if (!seqMonthExists) { + codeSetItemList.add(getMonthItem(monthItemName, getMonthDefaultValue(monthId), isFromForm)); + } + } + + codeSetItemList.add(getDateItem(dateItemName, selectedYearId, selectedMonthId, defaultSelectDate, isFromForm)); + }else if(conCreteField.equals("7")){//字符串 + strNum++; + Map otherParams = new HashMap(); + String strItemName = "str_" + strNum; + String labelName = SystemEnv.getHtmlLabelName(27903, user.getLanguage()) + strNum; + otherParams.put("hasBorder", true); + SearchConditionItem strItem = conditionFactory.createCondition(ConditionType.INPUT, 0, strItemName); + strItem.setValue(codeValue); + strItem.setLabel(labelName); + strItem.setViewAttr(1); + strItem.setOtherParams(otherParams); + strItem.setFieldcol(16); + strItem.setLabelcol(6); + codeSetItemList.add(strItem); + }else if(conCreteField.equals("8")){//这里获取流水号 + //流水号 + SearchConditionItem codeItem = conditionFactory.createCondition(ConditionType.INPUT, 383362, "flowcode"); + codeItem.setViewAttr(3); + codeItem.setFieldcol(16); + codeItem.setLabelcol(6); + codeItem.setRules("required|string"); + seqSetItemList.add(codeItem); + }else if(conCreteField.equals("9")){//字母 + SearchConditionItem strItem = conditionFactory.createCondition(ConditionType.INPUT, 27903, "letter"); + strItem.setValue(codeValue); + strItem.setViewAttr(1); + strItem.setFieldcol(16); + strItem.setLabelcol(6); + codeSetItemList.add(strItem); + } + } + + + //描述,可编辑 + SearchConditionItem descItem = conditionFactory.createCondition(ConditionType.TEXTAREA, 433, "desc"); + descItem.setFieldcol(16); + descItem.setLabelcol(6); + seqSetItemList.add(descItem); + + conditionInfos.put("conditioninfo", groupList); + + + finalReturnMap = conditionInfos; + return finalReturnMap; + } + + + public String getFieldMark(String typeMark, String codeValue) { + if(codeValue.equals("-2")) + typeMark += "_2"; + else + typeMark += codeValue;//来自表单字段 + return typeMark; + } + + /** + * 获取年默认选中值,未设置则选中当前日期 + * @param yearId + * @return + */ + public String getYearDefaultValue(String yearId) { + Calendar today = Calendar.getInstance(); + int yearIdToday = today.get(Calendar.YEAR); + + String yearValue = ""; + if(!yearId.equals("")){ + yearValue = yearId; + }else{ + yearValue = yearIdToday + ""; + } + return yearValue; + } + + /** + * 获取年组件 + */ + public SearchConditionItem getYearItem(String yearItemName, String yearValue, boolean isFromForm) { + Map otherParamMap = new HashMap<>(); + otherParamMap.put("format", "yyyy"); + otherParamMap.put("hasBorder", true); + SearchConditionItem yearItem = conditionFactory.createCondition(ConditionType.DATEPICKER, 445, yearItemName); + yearItem.setValue(yearValue); + yearItem.setFieldcol(10); + yearItem.setLabelcol(6); + yearItem.setOtherParams(otherParamMap); + //if(isFromForm) yearItem.setViewAttr(1); + return yearItem; + } + + /** + * 获取月默认选中值,未设置则选中当前月 + * @param monthId + * @return + */ + public String getMonthDefaultValue(String monthId) { + + Calendar today = Calendar.getInstance(); + int monthIdToday = today.get(Calendar.MONTH) + 1; + + String defaultSelectMonth = ""; + if(!monthId.equals("")){ + defaultSelectMonth = monthId; + }else{ + defaultSelectMonth = monthIdToday + ""; + } + + if (defaultSelectMonth.length() == 1) { + defaultSelectMonth = "0" + defaultSelectMonth; + } + return defaultSelectMonth; + } + + /** + * 获取月组件 + */ + public SearchConditionItem getMonthItem(String monthItemName, String defaultSelectMonth, boolean isFromForm) { + SearchConditionItem monthItem = conditionFactory.createCondition(ConditionType.SELECT, 6076, monthItemName,WorkflowCodeUtil.getMonthOptions(defaultSelectMonth)); + monthItem.setFieldcol(8); + monthItem.setLabelcol(6); + Map otherParams = new HashMap(); + otherParams.put("hasBorder", true); + monthItem.setOtherParams(otherParams); + monthItem.setValue(defaultSelectMonth); + if(isFromForm) monthItem.setViewAttr(1); + return monthItem; + } + + /** + * 获取日组件 + * @param dateItemName + * @param selectedYearId + * @param selectedMonthId + * @param defaultSelectDate + * @param isFromForm + * @return + */ + public SearchConditionItem getDateItem(String dateItemName, int selectedYearId, int selectedMonthId, String defaultSelectDate, boolean isFromForm) { + + if (selectedYearId <= 0) { + selectedYearId = Util.getIntValue(getYearDefaultValue("")); + } + + //月份未设置,取为31天的月 + if (selectedMonthId <= 0) { + selectedMonthId = 1; + } + + + SearchConditionItem dateItem = conditionFactory.createCondition(ConditionType.SELECT, 390, dateItemName,WorkflowCodeUtil.getDateOptions(defaultSelectDate,selectedYearId,selectedMonthId)); + dateItem.setFieldcol(8); + dateItem.setLabelcol(6); + Map otherParams = new HashMap(); + otherParams.put("hasBorder", true); + dateItem.setOtherParams(otherParams); + + //只有一位,前面添加一个0 + if (Util.null2String(defaultSelectDate).length() == 1) { + defaultSelectDate = "0" + defaultSelectDate; + } + + dateItem.setValue(defaultSelectDate); + //if(isFromForm) dateItem.setViewAttr(1); + return dateItem; + } + + //获取下拉框选项 + public static Map> getSelectInfos(String fieldId,String isBill){ + Map> selectInfos = new HashMap>(); + List selectNames = new ArrayList(); + List selectValues = new ArrayList(); + String sql = "select selectvalue,selectname from workflow_selectitem where fieldid=? and isbill=? order by listorder"; + RecordSet rs = new RecordSet(); + rs.executeQuery(sql, fieldId, isBill); + while(rs.next()){ + String selectValue = Util.null2String(rs.getString("selectvalue")); + String selectName = Util.null2String(rs.getString("selectname")); + selectNames.add(selectName); + selectValues.add(selectValue); + } + selectInfos.put("selectNames", selectNames); + selectInfos.put("selectValues", selectValues); + return selectInfos; + } + //获取选择框流水的选项 + public List getSelectOptions(Map> selectInfos,String defaultSelectValue){ + List options = new ArrayList(); + SearchConditionOption optionItem = null; + List selectNames = selectInfos.get("selectNames"); + List selectValues = selectInfos.get("selectValues"); + String selectName = ""; + String selectValue = ""; + for(int i = 0;i < selectValues.size();i++){ + selectName = selectNames.get(i); + selectValue = selectValues.get(i); + optionItem = new SearchConditionOption(selectValue,selectName,(selectValue.equals(defaultSelectValue)) ? true : false ); + options.add(optionItem); + } + return options; + } + + //得到编号组成 + public Map> getCodeRegulateInfo(String workflowId){ + Map> codeInfos = new HashMap>(); + List conCreteFieldList = new ArrayList(); + List codeValueList = new ArrayList(); + List enableCodeList = new ArrayList(); + CodeBuild cb = new CodeBuild(); + boolean isWorkflowSeqAlone = cb.isWorkflowSeqAlone(new RecordSet(), Util.getIntValue(workflowId)); + RecordSet rs = new RecordSet(); + if(isWorkflowSeqAlone) { + rs.executeQuery("select * from workflow_coderegulate where workflowId = ? order by codeorder", workflowId); + } else { + rs.executeQuery("select * from workflow_coderegulate where formid = ? and isbill = ? order by codeorder", formId, isBill); + } + while(rs.next()){ + conCreteFieldList.add(rs.getString("concreteField")); + codeValueList.add(rs.getString("codeValue")); + enableCodeList.add(rs.getString("enablecode")); + } + + codeInfos.put("concreteFields", conCreteFieldList); + codeInfos.put("codeValues", codeValueList); + codeInfos.put("enableCodes", enableCodeList); + return codeInfos; + } + + //获取选中选择框预览选项 + public static String getSelectDefaultPreView(Map> selectInfos,String selectValue){ + String returnStr = ""; + List selectValues = selectInfos.get("selectValues"); + List selectNames = selectInfos.get("selectNames"); + for(int i = 0;i < selectValues.size();i++){ + if(selectValues.get(i).equals(selectValue)){ + returnStr = selectNames.get(i); + } + } + return returnStr; + } + + //用于默认显示部门 + public Map getDefaultDept(String deptId){ + Map deptInfoMap = new HashMap(); + DepartmentComInfo depCom = new DepartmentComInfo(); + String deptName = depCom.getDepartmentname(deptId); + deptInfoMap.put("id", deptId); + deptInfoMap.put("name", deptName); + return deptInfoMap; + } + + //获取默认分部,用于默认显示 + public Map getDefaultSubCom(String subComId){ + Map subComInfoMap = new HashMap(); + SubCompanyComInfo subCom = new SubCompanyComInfo(); + String subName = subCom.getSubCompanyname(subComId); + subComInfoMap.put("id", subComId); + subComInfoMap.put("name", subName); + return subComInfoMap; + } + + /** + * 校验流水号,只能输入数字和-范围分隔符 + * */ + public String validateFlowCode(String flowCode){ + String returnCode = ""; + + //1 判断有没有-字符 + if(flowCode.indexOf("-") == -1){//没有 + //判断字符串里面是否有非数字 + int flowCodeNum = Util.getIntValue(flowCode,-1); + if(flowCodeNum != -1){ + if(flowCodeNum !=0 && flowCode.matches("^[0-9]+")){ + returnCode = flowCodeNum + ""; + } + } + }else{//有 + String[] values = flowCode.split("-");// -5这样的解析成["","5"],也存在05-06这样的情况啊,这个时候需要解析 + if(values.length == 2){ + if(values[0].trim().matches("^[0-9]+")){ + if(values[1].trim().matches("^[0-9]+")){ + returnCode = Util.getIntValue(values[0].trim()) + "-" + Util.getIntValue(values[1].trim()); + } + + } + } + if(values.length == 1){ + if(values[0].trim().matches("^[0-9]+")){ + returnCode = Util.getIntValue(values[0].trim()) + "-"; + } + } + } + return returnCode; + } + + public Map getParams() { + return params; + } + + public void setParams(Map params) { + this.params = params; + } + + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } + +} diff --git a/demo/demoDate.jsp b/demo/demoDate.jsp deleted file mode 100644 index 9b822b1..0000000 --- a/demo/demoDate.jsp +++ /dev/null @@ -1,66 +0,0 @@ -<%@ page import="java.io.FileInputStream" %> -<%@ page import="java.net.URLEncoder" %> -<%@ page import="com.api.login.util.LoginUtil" %> -<%@ page import="weaver.conn.RecordSet" %> -<%@ page import="com.icbc.api.internal.apache.http.impl.cookie.S" %> -<%@ page import="weaver.hrm.HrmUserVarify" %> -<%@ page import="weaver.hrm.User" %> -<%@ page import="com.alibaba.fastjson.JSONArray" %> -<%@ page import="com.alibaba.fastjson.JSONObject" %> -<%@ page import="java.time.LocalDate" %> -<%@ page import="java.time.format.DateTimeFormatter" %> -<%@ page import="weaver.general.Util" %> -<%@ page import="weaver.general.StringUtil" %> -<%@ page import="java.time.DayOfWeek" %> -<%@ page import="weaver.file.Prop" %> -<%@ page import="java.io.IOException" %> -<%@ page import="java.util.*" %> -<%@ page language="java" contentType="text/html; charset=UTF-8" %> - - -<% - List weekends = getAllWeekendsOfYear(LocalDate.now().getYear()); - for (String weekend : weekends) { - out.print(weekend+"
"); - } - out.print(weekends.size()); - -%> -<%! - private static List getAllWeekendsOfYear(int year) { - //将本年的周六周日加到list中 - List weekendDates = new ArrayList<>(); - LocalDate date = LocalDate.of(year, 1, 1); - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); - while (date.getYear() == year) { - if (date.getDayOfWeek() == DayOfWeek.SATURDAY || date.getDayOfWeek() == DayOfWeek.SUNDAY) { - weekendDates.add(date.format(formatter)); - } - date = date.plusDays(1); - } - //查询库里的节假日设置 - RecordSet recordSet = new RecordSet(); - // String groupid = Util.null2String(Prop.getPropValue("year_report_set", "groupid"),"24") ; - String groupid = "24" ; - recordSet.executeQuery("select changeType ,holidayDate from KQ_HolidaySet where groupid = ?",groupid); - //去掉调配工作日,加上公众假日和调配休息日 - List WorkDates = new ArrayList<>(); - List holidayDates = new ArrayList<>(); - while (recordSet.next()){ - String changeType = recordSet.getString("changeType"); - String holidayDate = recordSet.getString("holidayDate"); - if ("2".equals(changeType)){ - WorkDates.add(holidayDate); - }else if("1".equals(changeType) || "3".equals(changeType)){ - holidayDates.add(holidayDate); - } - } - weekendDates.removeAll(WorkDates); - HashSet set = new HashSet<>(); - set.addAll(weekendDates); - set.addAll(holidayDates); - return new ArrayList<>(set); - } - - -%> \ No newline at end of file diff --git a/docment/字段映射_1694422244889.xlsx b/docment/字段映射_1694422244889.xlsx deleted file mode 100644 index 521d8f49358e6717a772ca0f392981778907e19c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32308 zcmeFZQ;=ob*Dsj1ZQEw0ZQHhO80McC;$);5CE#7)M^0#R!wk`XDVvAugTbnf1gAkNU zr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-gC*E`2u-YYrGx4wnHOW)02b(5p&??MWXT?Uu_-*UG7 z4sLVuSl_~5{S{wu@K?+AAzuiZqK{=4u{|AFvV ztm)rH?}oei=U8$*x)uFBP}}bScjKVkM8)~LoN?U(+>LtjyYSthA2*>={w_e?TjBpD zaLVsEcm3aQwk7{v9QgiH;=clh{El+hW1RMH2>7=$q2E#d)pP!Lz`Opj|5U40_;I#Bcxr diff --git a/docment/字段映射_1694514327253.xlsx b/docment/字段映射_1694514327253.xlsx deleted file mode 100644 index dee2bd0d0e1e11cd262ded25776ff3063a7354c0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 30968 zcmeFZQ zW5l!OoNKL!HA7Ak7z70X0s;cyM*@v1z<>Ec|5@wW8(BKg(f)O;il3Glpoa;$_6nzX zUfkq^$ZPJ966+vj#v>rP!fy&I7!0_33KU0%VQ3$S7We-87?WwszM$BmAI#PwO>rXx z<&-XVu_D!Vj*0MSt8S?D9G15mAFO_sFC;>zUS)U(_bugWq&hm7ElLUYSI&&i1Fd<; z)d*CU-{5~4i*+I!gjBJVCLLI!DO&Mz?F5mPp10VD-O_aY5KYky6H>_&u0CMy=L*_Q zG95)$>Q~QNWO1_9cLba44^hHz9eKGl6yq&AhZujyEX(*^G*tsYQ_mQVY6|tzGpDLQ zeEO6gF!w%cXp#w+R-g$*2qDd*44^#GFjWkpB^Rn`W3aX1zKryj|a$|q2>3a;T5=}EdtS}m?rA?CtU5d z&`=+vwW-*&TTV$4g1=dxgA4GQp+cbH34ACtQM?^lGNGH!hKH&lr(Nc+I>ldFG-zZb zWld+n3dlvhX}3i{eoSEtnd+U3lI3cR`jWW?eZQoLDQO_iR~ZAOaF$_>V{4tPH#>k# z%$tKZ5T2W>f7lV~NgS#V(oD@qh5Gn*vW3QEDMyJj8BNvt&UnSb%4845ipL8h{5GAe z8yfjaGuGV5`i$Ho*jKzpY|%DhXmu#Q1m0H@Lu6i7zzqNKwVS(NFUL8A-~mONz zh}G_m%5x{H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UGkxq9#@i)i(SK!X?C^zqK{S#$c z<-el*+Clm|O81TP`G2A)8~s<5Uw6iSN4dGw{}UzK=D(u+VghPPw~(tI3d(KdA35?} JkK^^H{{a_BQ-uHk diff --git a/docment/补贴报销单.wewf b/docment/补贴报销单.wewf deleted file mode 100644 index 9ae0a3089638543bee0351f527cdc74ddea8d824..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 46100 zcmYhj19W7~^FJKhwr$%RTN~TiXktukV`FEN4R$xSZDTjKZSz07&-ZuUcjlZseY>i= ztLj$Qt$RLoM^yn53JVMl^vz0U(gyqgeULzHPbU{UD|;tT7B2_;(+;4k!H7HUW0xp& zT2J-f+N4$|=}e)Z7)D}qAB~`F{mOCx+7s0;Lb0AOi8}pntej~bCz*bsBrA;;9rh#h zv2D}}oVEJw_g;f-d2tz$#46>UJmq(aUgj!V;3nW@txc-Daz=qm(SbUjn`*C}Cogg~ zMqD{WZ=PS;1nn*cW_nDTJ$DGav5oa(fc|(ezywDF;O=_I{d3i8FRQN=7g2n`9`5|S zNS(9iPFx&N-_Fx z5w6nMBptGHdAmaYu}0LN3pkrQ$ck!jz~$D zJ5W(}w$tL-6Go%&~r9;?5#+^FO^Io!O5@bX;PuXemG!9HyG)cNht0_wA`vm8YUkWn8F>JO#+ zXvs@z+|Mdn5*u$qZqmVN+_6w=+ex^px=%w6vVC4p*ihNh%@c3$S#o`R;$w+PkRFDL zdWwdS$Gj-4I8pPRz65aHPM@f)*6j2E6=ct5a2r)RojWI1K7CwHuhs56+VDM_m?nEi zMof~5@>pjS!IAcwD@O^Qz9WeE#3-_KMT4%L%Ls&yJ&Jde(X7W-F zlf*mio?bKdMuSl)SVNq^R{YYNy=Q1$kP=EJPb0)jmc&g6PtvkFgW#aK+b=7WD(8>- zOkr~O_d4;!$U@qJH))++xIQ>BY4zB!&!O14p;7wHg-HEkIV=LcQ*?D-;re4sBZ0(8 zY0Km)g$e?;r%)GTm)zX*V}*U5L9|TQ1;}^R&q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zACsg)AdxI-bwc}LcSw4^LNfLY1f#bdh?s&+-`$nM$Mv5kr4Gc*gV|G#c0>;-9Uq;u;U=vjl z*b@#>Uj@JTk70KlN>O92#`G{xyt7IusOd$QLIUcsPiA- z0}S2TgtZ_N?>5X+AQq!D{NNdD=zR$0z}|tKg7A{6V&RWZ9wCi?_^5Gm1oeihuoxUX zz0liQErv0>UtoO@PQBbGyh|7rkim!KX(}coCxOet%{^`(_Y>nTe>Tq~F6ZEtbH7|N zACq@(Z2lhfIqe_E<7%0=N`NVc4x^$;jxzseQ=ql&Yu5L(x=s01nb|{4=%CLh7^62# zN4Xix3PF&my4`L`@;&a7Np9QMDm1RXP+r$)Q6OTgQwF66QEy0EUW9mUrp;+PSiSdC zHqnLhjTh!OUqu->csD%$)reXEK>ZZ~peO?Yi3Pv{z<+Gu-;C=2bssX|e|>$ocd|CK dvH$+r-PT4?1_t(@{SY4;@5k8t@rwY!{{RBsm2v<8 diff --git a/docment/阿里差旅推送财务系统_字段梳理_V4.0.xlsx b/docment/阿里差旅推送财务系统_字段梳理_V4.0.xlsx deleted file mode 100644 index f2e4433b68204de18d9fe8119afc42617f9d1de8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 13014 zcmaJ|1z23kvc@I226uN0?iSqLJ@~-jL4&)y1`SS-;O_2DaCdimWcS{?yLtD${=S(r zGhNly{nzO_)!qLnNP|PX1Nl{gt>RqVOczNL=1w5yS>KGR)Mq4Y=luP;QuGDj+TJUsamOfNGv|;9-pdx&z6DZVo!P8j< z2cW*jg@V37%s$0%?`FjC8gKTi!ES2lIm@;w=975(JEF)FKl+cxQ*4THH_RR{SZ(}2 z1+Gg1^ABu$KrvF*;&Bbi*~KnbY~vPYNV?*TT-rl5Z`S}V^g=pyJ-QZxLV@12nX^HJ z(L`W`L5S<}gVLWJnly7sh$V4i#Uv&XB=_j@{hOWq#vYnnMT7|YUj35kI85ZGxH9M| zyV1VxIb?ZSw4vqkuU$E!LC`!M<-nR$a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=lA9RU+o|f|M$&+-&^?o@b0e`;xPVf;Xg-t z{~uWY9J|3=7V;lP$nO?^r;hw(G3f7Ve-TN3Z{YWI=dT9PssFJ1ci8^FPX8ir|5<){ y*zZpd|5E-BmHVIf_U~lwU%G#Kt>S;_{zdIpkcRwYvZB2GI|BMmu7Tl~-v0pS4M+n3 diff --git a/interface/transfer/HistoryDataPushArchiveLog.jsp b/interface/transfer/HistoryDataPushArchiveLog.jsp new file mode 100644 index 0000000..56a46fd --- /dev/null +++ b/interface/transfer/HistoryDataPushArchiveLog.jsp @@ -0,0 +1,84 @@ +<%@ page import="java.text.SimpleDateFormat" %> +<%@ page import="weaver.hrm.HrmUserVarify" %> +<%@ page import="weaver.hrm.User" %> +<%@ page import="weaver.conn.RecordSet" %> +<%@ page import="java.util.*" %> +<%@ page import="weaver.general.Util" %> +<%@ page import="weaver.workflow.workflow.WorkflowComInfo" %> +<%@ page import="weaver.workflow.workflow.WorkflowBillComInfo" %> +<%@ page import="weaver.conn.BatchRecordSet" %> +<%@ page language="java" contentType="text/html; charset=UTF-8" %> + + +<% + // out.print(Prop.getPropValue("qwe","host")); + User user = HrmUserVarify.getUser(request, response); + if (user == null){ + out.print("暂无权限"); + } + if (!(1 == (user.getUID()))){ + out.print("暂无权限"); + return; + } + out.print("开始执行"); + out.print("
"); + long startTime = System.currentTimeMillis(); + RecordSet recordSet = new RecordSet(); + String sql = "select MAINWFID , endnodeid , type from uf_ArchivesSet"; + recordSet.executeQuery(sql); + ArrayList> wfids = new ArrayList<>(); + while (recordSet.next()){ + HashMap map = new HashMap<>(); + String wfid = Util.null2String(recordSet.getString("MAINWFID")); + String endnodeid = Util.null2String(recordSet.getString("endnodeid")); + String type = Util.null2String(recordSet.getString("type")); + map.put("wfid",wfid); + map.put("endnodeid",endnodeid); + map.put("type",type); + + wfids.add(map); + } + WorkflowComInfo wf = new WorkflowComInfo(); + WorkflowBillComInfo wcInfo = new WorkflowBillComInfo(); + ArrayList insertParam = new ArrayList<>(); + String sep = Util.getSeparator()+""; + BatchRecordSet brs = new BatchRecordSet(); + String timestamp = generateTimestamp(); + String insertSql = "insert into uf_pushArchivesLog (request,ddsj,type) values (?,?,?)"; + for (HashMap map : wfids) { + String wfid = map.get("wfid"); + String endnodeid = map.get("endnodeid"); + endnodeid = endnodeid.length() > 0 ? endnodeid : "-1"; + String type = map.get("type"); + String formId = wf.getFormId(wfid); + String tablename = wcInfo.getTablename(formId); + String wfsql = "select base.requestid reqid from "+ tablename +" business left join " + + " WORKFLOW_REQUESTBASE base on business.requestid = base.requestid " + + " left join uf_pushArchivesLog log on business.requestid = log.request " + + " where ( base.currentnodeid in ( "+ endnodeid +" ) or currentnodetype = 3 ) " + + " and log.id is null"; + recordSet.executeQuery( wfsql); + out.println("查询sql:"+wfsql); + out.print("
"); + while (recordSet.next()){ + String reqid = recordSet.getString("reqid"); + String insertStr = reqid + sep + timestamp + sep + type; + out.print(insertStr); + out.print("
"); + insertParam.add(insertStr); + } + } + brs.executeSqlBatchNew(insertSql,insertParam); + long endTime = System.currentTimeMillis(); + long executionTime = endTime - startTime; + out.print("执行完成 ->"+ "程序执行时间: " + executionTime + " 毫秒"); + +%> +<%! + public static String generateTimestamp() { + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Date currentDate = new Date(); + return dateFormat.format(currentDate); + } + +%> \ No newline at end of file diff --git a/interface/transfer/HistoryDataPushArchiveLog2023.jsp b/interface/transfer/HistoryDataPushArchiveLog2023.jsp new file mode 100644 index 0000000..8ac2abb --- /dev/null +++ b/interface/transfer/HistoryDataPushArchiveLog2023.jsp @@ -0,0 +1,84 @@ +<%@ page import="java.text.SimpleDateFormat" %> +<%@ page import="weaver.hrm.HrmUserVarify" %> +<%@ page import="weaver.hrm.User" %> +<%@ page import="weaver.conn.RecordSet" %> +<%@ page import="java.util.*" %> +<%@ page import="weaver.general.Util" %> +<%@ page import="weaver.workflow.workflow.WorkflowComInfo" %> +<%@ page import="weaver.workflow.workflow.WorkflowBillComInfo" %> +<%@ page import="weaver.conn.BatchRecordSet" %> +<%@ page language="java" contentType="text/html; charset=UTF-8" %> + + +<% + // out.print(Prop.getPropValue("qwe","host")); + User user = HrmUserVarify.getUser(request, response); + if (user == null){ + out.print("暂无权限"); + } + if (!(1 == (user.getUID()))){ + out.print("暂无权限"); + return; + } + out.print("开始执行"); + out.print("
"); + long startTime = System.currentTimeMillis(); + RecordSet recordSet = new RecordSet(); + String sql = "select MAINWFID , endnodeid , type from uf_ArchivesSet"; + recordSet.executeQuery(sql); + ArrayList> wfids = new ArrayList<>(); + while (recordSet.next()){ + HashMap map = new HashMap<>(); + String wfid = Util.null2String(recordSet.getString("MAINWFID")); + String endnodeid = Util.null2String(recordSet.getString("endnodeid")); + String type = Util.null2String(recordSet.getString("type")); + map.put("wfid",wfid); + map.put("endnodeid",endnodeid); + map.put("type",type); + + wfids.add(map); + } + WorkflowComInfo wf = new WorkflowComInfo(); + WorkflowBillComInfo wcInfo = new WorkflowBillComInfo(); + ArrayList insertParam = new ArrayList<>(); + String sep = Util.getSeparator()+""; + BatchRecordSet brs = new BatchRecordSet(); + String timestamp = generateTimestamp(); + String insertSql = "insert into uf_pushArchivesLog (request,ddsj,type) values (?,?,?)"; + for (HashMap map : wfids) { + String wfid = map.get("wfid"); + String endnodeid = map.get("endnodeid"); + endnodeid = endnodeid.length() > 0 ? endnodeid : "-1"; + String type = map.get("type"); + String formId = wf.getFormId(wfid); + String tablename = wcInfo.getTablename(formId); + String wfsql = "select base.requestid reqid from "+ tablename +" business left join " + + " WORKFLOW_REQUESTBASE base on business.requestid = base.requestid " + + " left join uf_pushArchivesLog log on business.requestid = log.request " + + " where ( base.currentnodeid in ( "+ endnodeid +" ) or currentnodetype = 3 ) and createdate >= '2023-01-01' and createdate <= '2023-12-31'" + + " and log.id is null "; + recordSet.executeQuery( wfsql); + out.println("查询sql:"+wfsql); + out.print("
"); + while (recordSet.next()){ + String reqid = recordSet.getString("reqid"); + String insertStr = reqid + sep + timestamp + sep + type; + out.print(insertStr); + out.print("
"); + insertParam.add(insertStr); + } + } + brs.executeSqlBatchNew(insertSql,insertParam); + long endTime = System.currentTimeMillis(); + long executionTime = endTime - startTime; + out.print("执行完成 ->"+ "程序执行时间: " + executionTime + " 毫秒"); + +%> +<%! + public static String generateTimestamp() { + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Date currentDate = new Date(); + return dateFormat.format(currentDate); + } + +%> \ No newline at end of file diff --git a/interface/transfer/HistoryDataPushArchiveLog202312.jsp b/interface/transfer/HistoryDataPushArchiveLog202312.jsp new file mode 100644 index 0000000..ccb82e9 --- /dev/null +++ b/interface/transfer/HistoryDataPushArchiveLog202312.jsp @@ -0,0 +1,84 @@ +<%@ page import="java.text.SimpleDateFormat" %> +<%@ page import="weaver.hrm.HrmUserVarify" %> +<%@ page import="weaver.hrm.User" %> +<%@ page import="weaver.conn.RecordSet" %> +<%@ page import="java.util.*" %> +<%@ page import="weaver.general.Util" %> +<%@ page import="weaver.workflow.workflow.WorkflowComInfo" %> +<%@ page import="weaver.workflow.workflow.WorkflowBillComInfo" %> +<%@ page import="weaver.conn.BatchRecordSet" %> +<%@ page language="java" contentType="text/html; charset=UTF-8" %> + + +<% + // out.print(Prop.getPropValue("qwe","host")); + User user = HrmUserVarify.getUser(request, response); + if (user == null){ + out.print("暂无权限"); + } + if (!(1 == (user.getUID()))){ + out.print("暂无权限"); + return; + } + out.print("开始执行"); + out.print("
"); + long startTime = System.currentTimeMillis(); + RecordSet recordSet = new RecordSet(); + String sql = "select MAINWFID , endnodeid , type from uf_ArchivesSet"; + recordSet.executeQuery(sql); + ArrayList> wfids = new ArrayList<>(); + while (recordSet.next()){ + HashMap map = new HashMap<>(); + String wfid = Util.null2String(recordSet.getString("MAINWFID")); + String endnodeid = Util.null2String(recordSet.getString("endnodeid")); + String type = Util.null2String(recordSet.getString("type")); + map.put("wfid",wfid); + map.put("endnodeid",endnodeid); + map.put("type",type); + + wfids.add(map); + } + WorkflowComInfo wf = new WorkflowComInfo(); + WorkflowBillComInfo wcInfo = new WorkflowBillComInfo(); + ArrayList insertParam = new ArrayList<>(); + String sep = Util.getSeparator()+""; + BatchRecordSet brs = new BatchRecordSet(); + String timestamp = generateTimestamp(); + String insertSql = "insert into uf_pushArchivesLog (request,ddsj,type) values (?,?,?)"; + for (HashMap map : wfids) { + String wfid = map.get("wfid"); + String endnodeid = map.get("endnodeid"); + endnodeid = endnodeid.length() > 0 ? endnodeid : "-1"; + String type = map.get("type"); + String formId = wf.getFormId(wfid); + String tablename = wcInfo.getTablename(formId); + String wfsql = "select base.requestid reqid from "+ tablename +" business left join " + + " WORKFLOW_REQUESTBASE base on business.requestid = base.requestid " + + " left join uf_pushArchivesLog log on business.requestid = log.request " + + " where ( base.currentnodeid in ( "+ endnodeid +" ) or currentnodetype = 3 ) and createdate >= '2023-12-01' and createdate <= '2023-12-31'" + + " and log.id is null "; + recordSet.executeQuery( wfsql); + out.println("查询sql:"+wfsql); + out.print("
"); + while (recordSet.next()){ + String reqid = recordSet.getString("reqid"); + String insertStr = reqid + sep + timestamp + sep + type; + out.print(insertStr); + out.print("
"); + insertParam.add(insertStr); + } + } + brs.executeSqlBatchNew(insertSql,insertParam); + long endTime = System.currentTimeMillis(); + long executionTime = endTime - startTime; + out.print("执行完成 ->"+ "程序执行时间: " + executionTime + " 毫秒"); + +%> +<%! + public static String generateTimestamp() { + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Date currentDate = new Date(); + return dateFormat.format(currentDate); + } + +%> \ No newline at end of file diff --git a/interface/transfer/HistoryDataPushArchiveLog202312.zip b/interface/transfer/HistoryDataPushArchiveLog202312.zip new file mode 100644 index 0000000000000000000000000000000000000000..39af52e85fa08ae7c4e3a40f95418b5aeaecc1c3 GIT binary patch literal 1463 zcma)+X*ARe7{>o%hRDRVPF;~@BE~Xbh8c#_R$Zz?&BNkX%XO!P(&b=5b`&I3B~qKX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? zH8;n0zJ7jgdARDaXbE&B3Mcee^pF96i*}0yHy6`v(O$OipaoNUO6%7K2kzX3Q}mOB6d literal 0 HcmV?d00001 diff --git a/interface/transfer/reportApp.jsp b/interface/transfer/reportApp.jsp deleted file mode 100644 index e50cdfa..0000000 --- a/interface/transfer/reportApp.jsp +++ /dev/null @@ -1,60 +0,0 @@ -<%@ page import="weaver.conn.RecordSetDataSource" %> -<%@ page import="weaver.conn.RecordSet" %> -<%@ page import="com.engine.custom.corn.util.ReportUtil" %> -<%@ page language="java" contentType="text/html; charset=UTF-8" %> - -<% - out.print("
最爱用APP更新开始执行"); - execute(); - out.print("
最爱用APP更新结束"); - -%> -<%! - - - public void execute() { - - RecordSet rs = new RecordSet(); - updateAppAndNum(rs); - - - - } - - private int updateAppAndNum(RecordSet rs) { - rs.executeUpdate("UPDATE uf_personreport " + - "SET " + - " (zaydyy, ljsycs) = ( " + - " SELECT MaxField, MaxValue " + - " FROM ( " + - " SELECT id , " + - " GREATEST( " + - " NVL(gsznzydjs, 0), " + - " NVL(itptdjs, 0), " + - " NVL(ygzs, 0), " + - " NVL(sktx, 0), " + - " NVL(sxsp, 0) " + - " ) AS MaxValue, " + - " CASE GREATEST( " + - " NVL(gsznzydjs, 0), " + - " NVL(itptdjs, 0), " + - " NVL(ygzs, 0), " + - " NVL(sktx, 0), " + - " NVL(sxsp, 0) " + - " ) " + - " WHEN NVL(gsznzydjs, 0) THEN '公司智能作业' " + - " WHEN NVL(itptdjs, 0) THEN 'IT项目审批' " + - " WHEN NVL(ygzs, 0) THEN '云工作室' " + - " WHEN NVL(sktx, 0) THEN '数看天行' " + - " WHEN NVL(sxsp, 0) THEN '授信审批' " + - " END AS MaxField " + - " FROM uf_personreport " + - " ) " + - " WHERE uf_personreport.id = id " + - " ) " + - "WHERE gsznzydjs is not null or itptdjs is not null or ygzs is not null or sktx is not null or sxsp is not null"); - return rs.getUpdateCount(); - } - - -%> \ No newline at end of file diff --git a/interface/transfer/reportGjc.jsp b/interface/transfer/reportGjc.jsp deleted file mode 100644 index 08ff074..0000000 --- a/interface/transfer/reportGjc.jsp +++ /dev/null @@ -1,119 +0,0 @@ -<%@ page import="weaver.conn.RecordSetDataSource" %> -<%@ page import="weaver.conn.RecordSet" %> -<%@ page import="com.engine.custom.corn.util.ReportUtil" %> -<%@ page language="java" contentType="text/html; charset=UTF-8" %> - -<% - out.print("
关键词更新开始执行"); - String execute = execute(); - out.print(execute); - out.print("
关键词更新结束"); - -%> -<%! - public String execute() { - RecordSetDataSource em7rs = new RecordSetDataSource("em7"); - RecordSetDataSource emprs = new RecordSetDataSource("emp_msg"); - RecordSet rs = new RecordSet(); - RecordSet rs2 = new RecordSet(); - RecordSet rs3 = new RecordSet(); - String roleMember = ReportUtil.getRoleMember(rs); - String out = ""; - int i = updateRoleGjc(rs, roleMember); - out = out + "
updateRoleGjc==>" + i; - int i1 = updateGjcOfficialWf(rs, 650); - out = out + "
updateGjcOfficialWf==>" + i1; - int i2 = updateGjcAffairsWf(rs, 650); - out = out + "
updateGjcAffairsWf==>" + i2; - int i3 = updateGjcBusinessWf(rs, 650); - out = out + "
updateGjcBusinessWf==>" + i3; - int i4 = updateGjcShareDoc(rs, 650); - out = out + "
updateGjcShareDoc==>" + i4; - int i5 = updateGjcMeeting(rs, 650); - out = out + "
updateGjcMeeting==>" + i5; - int i6 = updateGjcLogin(rs, 650); - out = out + "
updateGjcLogin==>" + i6; - int i7 = updateGjcMsg(rs, 650); - out = out + "
updateGjcMsg==>" + i7; - int i8 = updateGjcNull(rs); - out = out + "
updateGjcNull==>" + i8; - return out; - - } - - private int updateRoleGjc(RecordSet rs, String roleMember) { - rs.executeUpdate(" update uf_personreport set gjc = '统筹全局' where ry in ( " + roleMember + ")"); - return rs.getUpdateCount(); - } - - //更新公文办理数前10%的人 - private int updateGjcOfficialWf(RecordSet rs, int rownum) { - rs.executeUpdate(" update uf_personreport set gjc = '人形公文处理机' where id in( " + - " select rk.id from ( " + - " select ROW_NUMBER() OVER (ORDER BY qnljclgw DESC) AS rank , * from uf_personreport where qnljclgw is not null and qnljclgw != 0 and gjc is null" + - " ) rk where rk.rank < " + rownum + ")"); - return rs.getUpdateCount(); - } - - //更新事务审批数前10%的人 - private int updateGjcAffairsWf(RecordSet rs, int rownum) { - rs.executeUpdate(" update uf_personreport set gjc = '宝藏事务挖掘机' where id in( " + - " select rk.id from ( " + - " select ROW_NUMBER() OVER (ORDER BY grswsps DESC) AS rank , * from uf_personreport where grswsps is not null and grswsps != 0 and gjc is null" + - " ) rk where rk.rank < " + rownum + ")"); - return rs.getUpdateCount(); - } - - //更新商旅使用数前10%的人 - private int updateGjcBusinessWf(RecordSet rs, int rownum) { - rs.executeUpdate(" update uf_personreport set gjc = '走南闯北 遥遥领先' where id in( " + - " select rk.id from ( " + - " select ROW_NUMBER() OVER (ORDER BY ljsyslcs DESC) AS rank , * from uf_personreport where ljsyslcs is not null and ljsyslcs != 0 and gjc is null" + - " ) rk where rk.rank < " + rownum+ ")"); - return rs.getUpdateCount(); - } - - - //更新分享文档数前10%的人 - private int updateGjcShareDoc(RecordSet rs, int rownum) { - rs.executeUpdate(" update uf_personreport set gjc = '知识分享之光' where id in( " + - " select rk.id from ( " + - " select ROW_NUMBER() OVER (ORDER BY grwdgx DESC) AS rank , * from uf_personreport where grwdgx is not null and grwdgx != 0 and gjc is null" + - " ) rk where rk.rank < " + rownum + ")"); - return rs.getUpdateCount(); - } - - //更新创建会议数前10%的人 - private int updateGjcMeeting(RecordSet rs, int rownum) { - rs.executeUpdate(" update uf_personreport set gjc = '会议守护者' where id in( " + - " select rk.id from ( " + - " select ROW_NUMBER() OVER (ORDER BY grhycycs DESC) AS rank , * from uf_personreport where grhycycs is not null and grhycycs != 0 and gjc is null" + - " ) rk where rk.rank < " + rownum + ")"); - return rs.getUpdateCount(); - } - - //更新登录次数前10%的人 - private int updateGjcLogin(RecordSet rs, int rownum) { - rs.executeUpdate(" update uf_personreport set gjc = '智慧OA最亲密的朋友' where id in( " + - " select rk.id from ( " + - " select ROW_NUMBER() OVER (ORDER BY ljdloacs DESC) AS rank , * from uf_personreport where ljdloacs is not null and ljdloacs != 0 and gjc is null" + - " ) rk where rk.rank < " + rownum + ")"); - return rs.getUpdateCount(); - } - - //更新聊天次数前10%的人 - private int updateGjcMsg(RecordSet rs, int rownum) { - rs.executeUpdate(" update uf_personreport set gjc = '社交天花板' where id in( " + - " select rk.id from ( " + - " select ROW_NUMBER() OVER (ORDER BY grcylts DESC) AS rank , * from uf_personreport where grcylts is not null and grcylts != 0 and gjc is null" + - " ) rk where rk.rank < " + rownum + ")"); - return rs.getUpdateCount(); - } - - //无关键词的人 - private int updateGjcNull(RecordSet rs) { - rs.executeUpdate(" update uf_personreport set gjc = '智慧OA探索家' where gjc = '' or gjc is null"); - return rs.getUpdateCount(); - } - -%> \ No newline at end of file diff --git a/interface/transfer/testDemo2.jsp b/interface/transfer/syncDepartment.jsp similarity index 79% rename from interface/transfer/testDemo2.jsp rename to interface/transfer/syncDepartment.jsp index 23b5ce5..85eeaaa 100644 --- a/interface/transfer/testDemo2.jsp +++ b/interface/transfer/syncDepartment.jsp @@ -10,13 +10,16 @@ <%@ page import="weaver.conn.RecordSet" %> <%@ page import="com.engine.custom.archives.entity.Dept" %> <%@ page import="com.alibaba.fastjson.JSONObject" %> +<%@ page import="weaver.general.BaseBean" %> <% - List depts = readExcelFile("/opt/weaver/filesys/zzxx.xlsx"); + List depts = readExcelFile("/opt/weaver/archivesFile/template/zzxx.xlsx"); // 输出或处理dept列表 out.println(depts.size()); out.println(JSONObject.toJSONString(depts)); + BaseBean bb = new BaseBean(); + bb.writeLog(JSONObject.toJSONString(depts)); RecordSet recordSet = new RecordSet(); String comSql = "update hrmsubcompanydefined set DAPYBH = ? where SUBCOMID = (select id from hrmsubcompany where SUBCOMPANYNAME = ? )"; // String deptByDeptSql = "update hrmdepartmentdefined set DAPYBH = ? where SUBCOMPANYNAME = ? and SUPDEPID = (select * from hrmdepartmentdefined where DAPYBH = ? )"; @@ -24,21 +27,27 @@ String deptSql = "update hrmdepartmentdefined set DAPYBH = ? where deptid in (select id from hrmdepartment where DEPARTMENTNAME = ? ) and deptid in (select id from hrmdepartment where SUBCOMPANYID1 = (select SUBCOMID from hrmsubcompanydefined where DAPYBH = ? ) or SUPDEPID = (select DEPTID from hrmdepartmentdefined where DAPYBH = ? ) )"; for (Dept dept : depts) { + bb.writeLog(JSONObject.toJSONString(dept)); if ("zgs".equals(dept.getType())) { continue; } if ("zonghang".equals(dept.getType())) { + recordSet.executeUpdate(comSql, dept.getId(), dept.getName()); + bb.writeLog(comSql+ "_"+dept.getId()+"_"+ dept.getName()); } if ("zhih".equals(dept.getType()) || "fh".equals(dept.getType())) { if ("10".equals(dept.getParentId())) { recordSet.executeUpdate(comSql, dept.getId(), dept.getName()); + bb.writeLog(comSql+ "_"+dept.getId()+"_"+ dept.getName()); } else { recordSet.executeUpdate(deptSql, dept.getId(), dept.getName(), dept.getParentId(), dept.getParentId()); + bb.writeLog(deptSql+ "_"+dept.getId()+"_"+ dept.getName()+"_"+dept.getParentId()+"_"+dept.getParentId()); } } if ("ld".equals(dept.getType()) || "bm".equals(dept.getType())) { recordSet.executeUpdate(deptSql, dept.getId(), dept.getName(), dept.getParentId(), dept.getParentId()); + bb.writeLog(deptSql +"_"+ dept.getId()+"_"+ dept.getName()+"_"+ dept.getParentId()+"_"+ dept.getParentId()); } } @@ -63,9 +72,9 @@ Dept Dept = new Dept(); Dept.setId(row.getCell(0).getStringCellValue()); Dept.setName(row.getCell(1).getStringCellValue()); - Dept.setType(row.getCell(2).getStringCellValue()); - Dept.setParentId(row.getCell(3).getStringCellValue()); - Dept.setAllName(row.getCell(4).getStringCellValue()); + Dept.setType(row.getCell(3).getStringCellValue()); + Dept.setParentId(row.getCell(4).getStringCellValue()); + Dept.setAllName(row.getCell(2).getStringCellValue()); // 假设第一列是姓名,第二列是年龄 dept.add(Dept); } diff --git a/interface/transfer/testDemo.jsp b/interface/transfer/testDemo.jsp deleted file mode 100644 index 442b232..0000000 --- a/interface/transfer/testDemo.jsp +++ /dev/null @@ -1,1188 +0,0 @@ -<%@ page import="java.nio.charset.StandardCharsets" %> -<%@ page import="java.io.*" %> -<%@ page import="java.util.*" %> -<%@ page import="weaver.conn.RecordSet" %> -<%@ page import="weaver.general.Util" %> -<%@ page import="com.alibaba.fastjson.JSONObject" %> -<%@ page import="weaver.file.ImageFileManager" %> -<%@ page import="java.net.URL" %> -<%@ page import="org.apache.commons.io.FileUtils" %> -<%@ page import="okhttp3.*" %> -<%@ page import="java.net.URLEncoder" %> -<%@ page import="weaver.soa.workflow.request.RequestService" %> -<%@ page import="weaver.soa.workflow.request.RequestInfo" %> -<%@ page import="com.engine.custom.archives.action.WorkflowToDocCus" %> -<%@ page import="weaver.docs.docs.DocRecycleManager" %> -<%@ page import="weaver.hrm.User" %> -<%@ page import="com.api.workflow.service.RequestAuthenticationService" %> -<%@ page import="weaver.workflow.workflow.WorkflowConfigComInfo" %> -<%@ page import="weaver.hrm.resource.ResourceComInfo" %> -<%@ page import="weaver.crm.Maint.CustomerInfoComInfo" %> -<%@ page import="com.alibaba.fastjson.JSON" %> -<%@ page import="weaver.workflow.monitor.Monitor" %> -<%@ page import="com.engine.workflow.biz.RobotNode.RobotNodeServiceBiz" %> -<%@ page import="com.api.workflow.util.ServiceUtil" %> -<%@ page import="com.engine.workflow.biz.RobotNode.RobotNodeBiz" %> -<%@ page import="weaver.general.TimeUtil" %> -<%@ page import="org.apache.poi.xwpf.usermodel.XWPFDocument" %> -<%@ page import="cn.afterturn.easypoi.word.WordExportUtil" %> -<%@ page import="com.icbc.api.internal.apache.http.impl.cookie.F" %> -<%@ page import="cn.hutool.core.util.ZipUtil" %> - - -<% - String requestid = "607615"; - String filePath = "/opt/weaver/filesys/test"; - String zwdir = getKeyword("7"); - String fjdir = getKeyword("8"); - String cbddir = getKeyword("9"); - String zlcdir = getKeyword("9") + File.separator + getKeyword("10"); - String lzxxdir = getKeyword("11"); - String Url = "http://14.1.206.240:18080/fcscloud/composite/upload"; - String fjFile = fjdir; - - Map subRequest = getSubRequest(requestid); - - Map requesData = getRequestByid(requestid); - String fj = Util.null2String(requesData.get("fj")); - String zwkbj = Util.null2String(requesData.get("zwkbj")); - List docids = new ArrayList<>(); - docids.addAll(Arrays.asList(fj.split(","))); - docids.addAll(Arrays.asList(zwkbj.split(","))); - Map fjMap = getFileIdByDocId(fj); - Map zwkbjMap = getFileIdByDocId(zwkbj); - final int[] i = {1}; -// //--------------------------------------------------------------------------- -// //附件 -// fjMap.forEach((docid, imageid) -> { -// ImageFileManager imageFileManager = new ImageFileManager(); -// imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); -// InputStream inputStream = imageFileManager.getInputStream(); -// //中文路径/中文文件名 -// String imageFileName = filePath + File.separator + fjdir + File.separator + imageFileManager.getImageFileName(); -// imageFileName = codeUtf8(imageFileName); -// try { -// File file = saveInputStreamToFile(inputStream, imageFileName); -// String s = callApi(Url, file); -// System.out.println(s); -// JSONObject result = JSONObject.parseObject(s); -// String errorcode = result.getString("errorcode"); -// if ("0".equals(errorcode)) { -// JSONObject data = result.getJSONObject("data"); -// String destFileName = data.getString("destFileName"); -// String viewUrl = data.getString("viewUrl"); -// downloadFile(viewUrl, filePath + File.separator + fjdir + File.separator + imageFileManager.getImageFileName() + ".pdf"); -// } -// } catch (IOException e) { -// e.printStackTrace(); -// } -// }); -// //正文 -// zwkbjMap.forEach((docid, imageid) -> { -// ImageFileManager imageFileManager = new ImageFileManager(); -// imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); -// InputStream inputStream = imageFileManager.getInputStream(); -// //中文路径/中文文件名 -// String imageFileName = filePath + File.separator + zwdir + File.separator + imageFileManager.getImageFileName(); -// imageFileName = codeUtf8(imageFileName); -// try { -// File file = saveInputStreamToFile(inputStream, imageFileName); -// String s = callApi(Url, file); -// System.out.println(s); -// JSONObject result = JSONObject.parseObject(s); -// String errorcode = result.getString("errorcode"); -// if ("0".equals(errorcode)) { -// JSONObject data = result.getJSONObject("data"); -// String destFileName = data.getString("destFileName"); -// String viewUrl = data.getString("viewUrl"); -// downloadFile(viewUrl, filePath + File.separator + zwdir + File.separator + imageFileManager.getImageFileName() + ".pdf"); -// } -// } catch (IOException e) { -// e.printStackTrace(); -// } -// }); -// //开始承办单 先获取主流程的承办单 -// -// List requestDocid = generaRequestFormPdf(requestid); -// List requestDocid1 = generaSubRequestFormPdf(requestid); -// Map map1 = getFileIdByDocId(String.join(",",requestDocid)); -// Map map2 = getFileIdByDocId(String.join(",",requestDocid1)); -// out.print("
"); -// out.print("map1:"+JSONObject.toJSONString(map1)); -// out.print("
"); -// out.print("map2:"+JSONObject.toJSONString(map2)); -// out.print("
"); -// -// docids.addAll(requestDocid); -// docids.addAll(requestDocid1); -// -// //附件 -// map1.forEach((docid, imageid) -> { -// ImageFileManager imageFileManager = new ImageFileManager(); -// imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); -// InputStream inputStream = imageFileManager.getInputStream(); -// //中文路径/中文文件名 -// String imageFileName = filePath + File.separator + cbddir + File.separator + fjFile + i[0] +"_"+ imageFileManager.getImageFileName(); -// imageFileName = codeUtf8(imageFileName); -// try { -// File file = saveInputStreamToFile(inputStream, imageFileName); -// String s = callApi(Url, file); -// System.out.println(s); -// JSONObject result = JSONObject.parseObject(s); -// String errorcode = result.getString("errorcode"); -// if ("0".equals(errorcode)) { -// JSONObject data = result.getJSONObject("data"); -// String destFileName = data.getString("destFileName"); -// String viewUrl = data.getString("viewUrl"); -// downloadFile(viewUrl, filePath + File.separator + cbddir + File.separator +fjFile + i[0] +"_"+ imageFileManager.getImageFileName() + ".pdf"); -// } -// i[0]++; -// } catch (IOException e) { -// e.printStackTrace(); -// } -// }); -// //正文 -// i[0] = 1; -// map2.forEach((docid, imageid) -> { -// ImageFileManager imageFileManager = new ImageFileManager(); -// imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); -// InputStream inputStream = imageFileManager.getInputStream(); -// //中文路径/中文文件名 -// String imageFileName = filePath + File.separator + zlcdir + File.separator + fjFile + i[0] +"_"+ imageFileManager.getImageFileName(); -// imageFileName = codeUtf8(imageFileName); -// try { -// File file = saveInputStreamToFile(inputStream, imageFileName); -// String s = callApi(Url, file); -// System.out.println(s); -// JSONObject result = JSONObject.parseObject(s); -// String errorcode = result.getString("errorcode"); -// if ("0".equals(errorcode)) { -// JSONObject data = result.getJSONObject("data"); -// String destFileName = data.getString("destFileName"); -// String viewUrl = data.getString("viewUrl"); -// downloadFile(viewUrl, filePath + File.separator + zlcdir + File.separator + fjFile + i[0] +"_"+ imageFileManager.getImageFileName() + ".pdf"); -// } -// i[0]++; -// } catch (IOException e) { -// e.printStackTrace(); -// } -// }); -// // -// out.print(JSONObject.toJSONString(requestDocid)); -// out.print(JSONObject.toJSONString(requestDocid1)); -// for (String docid : docids) { -// out.print("删除了"+docids); -// out.print("
"); -// deleteDocByid(docid); -// } -// //-------------------------------------------------------------------- - RequestService requestService = new RequestService(); - RequestInfo requestInfo = requestService.getRequest(Util.getIntValue(requestid), 100); - String logFile = getSignLog(requestid, lzxxdir, requestInfo.getCreatorid() + requestInfo.getDescription()); - String s = callApi(Url, new File(logFile)); - System.out.println(s); - JSONObject result = JSONObject.parseObject(s); - String errorcode = result.getString("errorcode"); - if ("0".equals(errorcode)) { - JSONObject data = result.getJSONObject("data"); - String destFileName = data.getString("destFileName"); - String viewUrl = data.getString("viewUrl"); - downloadFile(viewUrl, logFile + ".pdf"); - } - ZipUtil.zip(filePath,filePath+"test.zip"); -%> - -<%! - /** - * 生成子流程承办单 - * @param requestid 主流程id - */ - private List generaSubRequestFormPdf(String requestid) { - Map subRequest = getSubRequest(requestid); - List docids = new ArrayList<>(); - for (String wfid : subRequest.keySet()) { - RequestService requestService = new RequestService(); - RequestInfo requestInfo = requestService.getRequest(Util.getIntValue(subRequest.get(wfid)), 100); - WorkflowToDocCus workflowToDoc = new WorkflowToDocCus(); - requestInfo.setLastoperator("1"); - requestInfo.setDescription(getWfNameByid(requestInfo.getWorkflowid()) + "-" + requestInfo.getDescription()); - List subDocids = workflowToDoc.execute(requestInfo, 1); - docids.addAll(subDocids); - } - return docids; - } - - /** - * 生成主流程承办单 - * @param requestid - */ - private static List generaRequestFormPdf(String requestid) { - RequestService requestService = new RequestService(); - RequestInfo requestInfo = requestService.getRequest(Util.getIntValue(requestid), 100); - WorkflowToDocCus workflowToDoc = new WorkflowToDocCus(); - requestInfo.setLastoperator("1"); - requestInfo.setDescription(getWfNameByid(requestInfo.getWorkflowid()) + "-" + requestInfo.getDescription()); - - return workflowToDoc.execute(requestInfo, 0); - } - - /*** - * 封装数据 - * @param requestid - * @return - */ - public Map getRequestByid(String requestid) { - HashMap record = new HashMap<>(); - String sql = "select * from formtable_main_30 where requestid = ?"; - RecordSet rs = new RecordSet(); - rs.executeQuery(sql, requestid); - if (rs.next()) { - String fj = Util.null2String(rs.getString("fj")); - String zwkbj = Util.null2String(rs.getString("zwkbj")); // 正文可编辑字段 - record.put("fj", fj); - record.put("zwkbj", zwkbj); - } - return record; - } - - - /** - * 将gbk转为UTF-8,创建ISO-8859-1编码的字符串, - * ISO-8859-1编码是一个字节对应一个字符,因此不会使最后一个字节错误。 - * @param text - * @return - */ - public static String codeUtf8(String text) { - String ISOtext = null; - ISOtext = new String(text.getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1); - return new String(ISOtext.getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8); - - } - - /** - * 获取当前流程下的所有子流程(最大5层) - * @param requestid - * @return - */ - public static Map getSubRequest(String requestid) { - HashMap records = new HashMap<>(); - RecordSet rs = new RecordSet(); - String ids = requestid; - for (int i = 0; i < 5; i++) { - ArrayList idList = new ArrayList<>(); - String sql = "select requestid , workflowid from workflow_requestbase where mainrequestid in ( " + ids + " )"; - rs.executeQuery(sql); - while (rs.next()) { - String subrequestid = Util.null2String(rs.getString("requestid")); - String workflowid = Util.null2String(rs.getString("workflowid")); - idList.add(subrequestid); - // 使用map自动去重,一种流程类型只取一个requestid - records.put(workflowid, subrequestid); - } - ids = String.join(",", idList); - } - - - // String sql = "select requestid from workflow_requestbase where mainrequestid = ?"; - // RecordSet rs = new RecordSet(); - // rs.executeQuery(sql, requestid); - // if (rs.next()) { - // String subrequestid = Util.null2String(rs.getString("requestid")); - // records.add(subrequestid); - // } - return records; - } - - /** - * 获取imageid Map - * @param ids - * @return - */ - public static Map getFileIdByDocId(String ids) { - HashMap records = new HashMap<>(); - - String sql = "select docid,df.imagefileid imgid from docimagefile df left join imagefile imf on df.imagefileid = imf.imagefileid where DOCID in (" + ids + ")"; - RecordSet recordSet = new RecordSet(); - recordSet.execute(sql); - while (recordSet.next()) { - String docid = Util.null2String(recordSet.getString("docid")); - String imgid = Util.null2String(recordSet.getString("imgid")); - records.put(docid, imgid); - } - return records; - } - - /** - * 将InputStream写入本地文件 - * @param inputStream 输入流 - * @param localFilePath 本地文件路径 - * @throws IOException 如果发生输入输出异常 - * @return - */ - public static File saveInputStreamToFile(InputStream inputStream, String localFilePath) throws IOException { - File targetFile = new File(localFilePath); - - // 确保目标文件的父目录存在 - File parentDir = targetFile.getParentFile(); - if (parentDir != null && !parentDir.exists()) { - parentDir.mkdirs(); - } - - - // 使用try-with-resources语句确保流的正确关闭 - try (InputStream in = inputStream; - OutputStream outputStream = new FileOutputStream(targetFile)) { - int read; - byte[] bytes = new byte[1024]; - while ((read = in.read(bytes)) != -1) { - outputStream.write(bytes, 0, read); - } - } // 自动关闭 in 和 outputStream - return targetFile; - } - - - /** - * 根据链接下载文件 - * @param fileURL - * @param saveDir - */ - public static void downloadFile(String fileURL, String saveDir) { - - try { - saveDir = codeUtf8(saveDir); - URL url = new URL(fileURL); - File file = new File(saveDir); - FileUtils.copyURLToFile(url, file); - System.out.println("Download completed successfully."); - } catch (IOException e) { - e.printStackTrace(); - System.out.println("Download failed."); - } - } - - - /** - * 调用永中接口 - * @param BASE_URL - * @param file - * @return - * @throws IOException - */ - public static String callApi(String BASE_URL, File file) throws IOException { - OkHttpClient client = new OkHttpClient(); - // Debugging: Check if the file exists and can be read - if (file.exists() && file.canRead()) { - System.out.println("File exists and is readable. File path: " + file.getAbsolutePath()); - } else { - System.out.println("File does not exist or cannot be read. File path: " + file.getAbsolutePath()); - } - RequestBody requestBody = null; - String code = getCodeByFileType(file.getName()); - String fileName = URLEncoder.encode(file.getName(), StandardCharsets.UTF_8.toString()); - try { - requestBody = new MultipartBody.Builder() - .setType(MultipartBody.FORM) - .addFormDataPart("convertType", code) - .addFormDataPart("file", fileName, RequestBody.create(MediaType.parse("application/zip"), file)) - .build(); - } catch (Exception e) { - System.out.println(e); - e.printStackTrace(); - } - - Request request = new Request.Builder() - .url(BASE_URL) - .post(requestBody) - .build(); - - try (Response response = client.newCall(request).execute()) { - return response.body().string(); - } - } - - /** - * 根据文件类型获取转为pdf的编码 - * @param FileName - * @return - */ - - public static String getCodeByFileType(String FileName) { - String extName = FileName.substring(FileName.lastIndexOf(".") + 1); - String convertType = ""; - if (extName.matches("(doc|dot|dtd|docx|docm|dotx|ppt|pptx|ppsx|potx|xlsx|xlsm|wps|dps|et|wpt|xls|xlc|xlt|xlm|xlw|DOC|DOT|DTD|DOCX|DOCM|DOTX|PPT|PPTX|PPSX|POTX|XLSX|XLSM|WPS|DPS|ET|WPT|XLS|XLC|XLT|XLM|XLW)")) { - convertType = "3"; - } else if (extName.matches("(ofd|OFD)")) { - convertType = "57"; - } else if (extName.matches("(GIF|JPEG|JPG|BMP|PNG|gif|jpeg|jpg|bmp|png)")) { - convertType = "44"; - } else if (extName.matches("(PDF|pdf)")) { - convertType = "34"; - } - return convertType; - } - - - /*** - * 获取关键词 - * @param id - * @return - */ - public static String getKeyword(String id) { - String sql = "select * from uf_test where id = ?"; - RecordSet rs = new RecordSet(); - rs.executeQuery(sql, id); - rs.next(); - return Util.null2String(rs.getString("label")); - } - - /** - * 删除文档及附件,调用移到回收站,再从回收站删除 - * @param docid - */ - public static void deleteDocByid(String docid) { - DocRecycleManager docRecycleManager = new DocRecycleManager(); - User user = new User(1); - docRecycleManager.moveDocToRecycle(user.getUID(), user.getLogintype(), Util.getIntValue(docid), "127.0.0.1"); - docRecycleManager.deleteDocFromRecycle(user.getUID(), user.getLogintype(), weaver.general.Util.getIntValue(docid), "127.0.0.1"); - } - - /** - * 获取流程类型名称 - * @param wfid - * @return - */ - - public static String getWfNameByid(String wfid) { - String sql = "select WORKFLOWNAME from WORKFLOW_BASE where id = ?"; - RecordSet rs = new RecordSet(); - rs.executeQuery(sql, wfid); - rs.next(); - return Util.null2String(rs.getString("WORKFLOWNAME")); - } - - /** - * 生成流转意见 意见 - * @param params - * @param user - * @return - */ - public static String getSignLog(String requestid, String dirName, String requestName) { - HashMap params = new HashMap<>(); - params.put("requestid", requestid); - params.put("desremark", "all"); - params.put("pageSize", "50"); - params.put("isfirst", "true"); - // params.put("request", request); - Map data = getSignLogCmd(params, new User(1)); - System.out.println("data===>"); - System.out.println(JSONObject.toJSONString(data)); - Map datas = (Map) data.get("datas"); - List> entries = new ArrayList<>(datas.entrySet()); - entries.sort(new Comparator>() { - @Override - public int compare(Map.Entry o1, Map.Entry o2) { - Integer key1 = Util.getIntValue((Util.null2String(o1.getKey())).replace("key", "")); - Integer key2 = Util.getIntValue((Util.null2String(o2.getKey())).replace("key", "")); - return key1 - key2; - } - }); // 自然顺序 - - ArrayList> results = new ArrayList<>(); - // out.print(JSONObject.toJSONString(entries)); - for (Map.Entry entry : entries) { - Map value = (Map) entry.getValue(); - List> list = (List) value.get("list"); - for (Map item : list) { - String operator = (String) item.get("operator"); - String operatorid = (String) item.get("operatorid"); - String operatortype = (String) item.get("operatortype"); - String operatedate = (String) item.get("operatedate"); - String nodename = (String) value.get("nodename"); - HashMap itemMap = new HashMap<>(); - itemMap.put("operator", operator); - itemMap.put("operatorid", operatorid); - itemMap.put("operatortype", operatortype); - itemMap.put("operatedate", operatedate); - itemMap.put("nodename", nodename); - results.add(itemMap); - } - } - - System.out.println("results===>"); - System.out.println(JSONObject.toJSONString(results)); - try { - Map dataMap = new HashMap<>(); - dataMap.put("results", results); // 将用户列表添加到数据映射中 - dataMap.put("name", requestName); // 将用户列表添加到数据映射中 - - // 加载模板并填充数据 - String templatePath = "/opt/weaver/filesys/template.docx"; // 模板文件路径 - System.out.println(dataMap); - XWPFDocument doc = WordExportUtil.exportWord07(templatePath, dataMap); - // 导出Word文档 - String outputPath = "/opt/weaver/filesys/test" + File.separator + dirName + File.separator + requestName + ".docx"; // 输出文件路径 - outputPath = codeUtf8(outputPath); - - File targetFile = new File(outputPath); - - // 确保目标文件的父目录存在 - File parentDir = targetFile.getParentFile(); - if (parentDir != null && !parentDir.exists()) { - parentDir.mkdirs(); - } - FileOutputStream fos = new FileOutputStream(outputPath); - doc.write(fos); - fos.close(); - return outputPath; - } catch (Exception e) { - System.out.println("errorerrorerror"); - System.out.println(e.getMessage()); - e.printStackTrace(); - } - return requestid; - } - - - public static Map getSignLogCmd(Map params, User user) { - Map result = new HashMap(); - RequestAuthenticationService authService = new RequestAuthenticationService(); - authService.setUser(user); - - long date1 = new Date().getTime(); - try { - RecordSet rs = new RecordSet(); - RecordSet rs1 = new RecordSet(); - int pageSize = Util.getIntValue(Util.null2String(params.get("pageSize")), 30); - int desrequestid = Util.getIntValue(Util.null2String(params.get("desrequestid")), 0); - String isfirst = Util.null2String(params.get("isfirst")); - String isurger = Util.null2String(params.get("isurger")); - String desremark = Util.null2String(params.get("desremark")); - int desremarkIndex = desremark.indexOf("_"); - boolean isAdSearch = false;//是否有过滤条件 - if (desremarkIndex > -1) { - isAdSearch = true; - desremark = desremark.substring(0, desremarkIndex); - } - String parameter = Util.null2String(params.get("parameter")); - int selectedNode = Util.getIntValue(Util.null2String(params.get("selectedNode")), -1);//选中的节点 - String selectedOperator = Util.null2String(params.get("selectedOperator"));//选中的操作者 - int requestid = Util.getIntValue(Util.null2String(params.get("requestid")), 0); - int workflowid = -1; - rs.executeQuery("select workflowid from workflow_requestbase where requestid=" + requestid); - if (rs.next()) - workflowid = Util.getIntValue(rs.getString("workflowid")); - - // 将json字符串转换成jsonObject - int currentMaxId = 0; - int currentMinId = 0; - int currentId = 0; - int currentId2 = 0; - int lastNodeId = 0; - String viewlogids = ""; - int index = 0; - try { - if (!"true".equals(isfirst)) { - Map parameterMap = JSON.parseObject(parameter, Map.class);//Weibo类在下边定义 - currentMaxId = Util.getIntValue(parameterMap.get("currentMaxId"), 0); - currentMinId = Util.getIntValue(parameterMap.get("currentMinId"), 0); - String currentId12 = Util.null2String(parameterMap.get("currentId")); - if (currentId12.contains("_")) { - String[] currentId12Arr = currentId12.split("_"); - currentId = Util.getIntValue(currentId12Arr[0]); - currentId2 = Util.getIntValue(currentId12Arr[1]); - } else { - currentId = Util.getIntValue(currentId12); - } - viewlogids = Util.null2String(parameterMap.get("viewlogids")); - index = Util.getIntValue(parameterMap.get("nodeindex"), 0); - lastNodeId = Util.getIntValue(parameterMap.get("lastNodeId"), 0); - } - } catch (Exception e) { - e.printStackTrace(); - } - Map putpara = new HashMap(); - - Monitor monitor = new Monitor(); -// String joinStr = ("oracle".equalsIgnoreCase(rs.getDBType()) || "mysql".equalsIgnoreCase(rs.getDBType())) ? " left join " : " left hash join "; - String joinStr = " left join "; -// if (isurger.equals("true") || monitor.hasMonitor(requestid+"", user.getUID() + "")) { -// StringBuffer sqlsb = new StringBuffer(); -// sqlsb.append(" select a.id,a.nodeid, "); -// sqlsb.append(" b.nodename, "); -// sqlsb.append(" a.userid, "); -// sqlsb.append(" a.isremark, "); -// sqlsb.append(" a.lastisremark, "); -// sqlsb.append(" a.usertype, "); -// sqlsb.append(" a.agentorbyagentid, "); -// sqlsb.append(" a.agenttype, "); -// sqlsb.append(" a.receivedate, "); -// sqlsb.append(" a.receivetime, "); -// sqlsb.append(" a.operatedate, "); -// sqlsb.append(" a.operatetime, "); -// sqlsb.append(" a.viewtype, "); -// sqlsb.append(" a.nodetype "); -// sqlsb.append(" ,a.operator "); -// sqlsb.append(" from (SELECT distinct top ").append(pageSize); -// sqlsb.append(" o.id, " ); -// sqlsb.append(" o.requestid, " ); -// sqlsb.append(" o.userid, "); -// sqlsb.append(" o.workflowid, "); -// sqlsb.append(" o.workflowtype, "); -// sqlsb.append(" o.isremark, "); -// sqlsb.append(" o.lastisremark, "); -// sqlsb.append(" o.usertype, "); -// sqlsb.append(" o.nodeid, "); -// sqlsb.append(" o.agentorbyagentid, "); -// sqlsb.append(" o.agenttype, "); -// sqlsb.append(" o.receivedate, "); -// sqlsb.append(" o.receivetime, "); -// sqlsb.append(" o.viewtype, "); -// sqlsb.append(" o.iscomplete, "); -// sqlsb.append(" o.operatedate, "); -// sqlsb.append(" o.operatetime, "); -// sqlsb.append(" nodetype "); -// sqlsb.append(" ,wr.operator "); -// sqlsb.append(" FROM workflow_currentoperator o "); -// -// sqlsb.append(" left join workflow_requestlog wr"); -// sqlsb.append(" on wr.requestid=o.requestid"); -// sqlsb.append(" and wr.nodeid=o.nodeid"); -// sqlsb.append(" and wr.operator = o.userid"); -// sqlsb.append(" and wr.logtype <> '1'"); -// -// sqlsb.append(" , workflow_flownode "); -// -// sqlsb.append(" where o.nodeid = "); -// sqlsb.append(" workflow_flownode.nodeid "); -// if(desremark ==1){//1:已提交 -// sqlsb.append(" AND o.isremark='2' AND wr.operator IS NOT null "); -// }else if(desremark == 2){//2:未提交 -// sqlsb.append(" and ((o.isremark = '0' and (o.takisremark is null or o.takisremark=0)) or o.isremark in ('1','5','7','8','9') )"); -// }else if(desremark == 3){//3:已查看 -// sqlsb.append(" and (((o.isremark = '2' AND wr.operator IS NULL) or o.isremark in ('0','1','4','5','7','8','9')) AND o.viewtype IN (-1,-2)) "); -// }else if(desremark == 4){//4:未查看 -// sqlsb.append(" AND o.viewtype = 0 "); -// } -// sqlsb.append(" and o.id > ").append(currentId); -// sqlsb.append(" and o.requestid = " + requestid + ") a, "); -// sqlsb.append(" workflow_nodebase b "); -// sqlsb.append(" where a.nodeid = b.id "); -// sqlsb.append(" and a.requestid = " + requestid + " "); -// sqlsb.append(" and a.agenttype <> 1 "); -// sqlsb.append(" order by a.id "); -// //System.out.println("20170309 =====> sqlsb.toString() = "+sqlsb.toString()); -// rs.executeSql(sqlsb.toString()); -// -// } else { - // 处理相关流程的查看权限 -// if ("".equals(viewlogids)) { -// viewlogids = this.getViewLogids(); -// } - StringBuffer sqlsb = new StringBuffer(); - if ("sqlserver".equalsIgnoreCase(rs.getDBType())) { // sqlserver 排序提到这里 - sqlsb.append(" select top ").append(pageSize).append(" a.id,a.nodeid, "); - } else { - sqlsb.append(" select a.id,a.nodeid, "); - } - sqlsb.append("(CASE WHEN a.nodeid < -1 THEN (SELECT nodename FROM workflow_freenode t WHERE t.id = a.nodeid) ELSE (SELECT nodename FROM workflow_nodebase t1 WHERE t1.id = a.nodeid) END) AS nodename,"); - sqlsb.append(" a.userid, "); - sqlsb.append(" a.isremark, "); - sqlsb.append(" a.preisremark, "); - sqlsb.append(" a.lastisremark, "); - sqlsb.append(" a.usertype, "); - sqlsb.append(" a.agentorbyagentid, "); - sqlsb.append(" a.agenttype, "); - sqlsb.append(" a.receivedate, "); - sqlsb.append(" a.receivetime, "); - sqlsb.append(" a.operatedate, "); - sqlsb.append(" a.operatetime, "); - sqlsb.append(" a.processuser, "); - sqlsb.append(" a.viewtype, "); - sqlsb.append(" a.nodetype "); - sqlsb.append(" ,a.operator "); - sqlsb.append(" ,a.tab "); - //if("true".equals(isfirst)){ - /*if("oracle".equals(rs.getDBType()) || "mysql".equals(rs.getDBType())){ - sqlsb.append(" from (SELECT distinct "); - }else{ - sqlsb.append(" from (SELECT distinct top ").append(pageSize); // sqlserver排序提到外层查询 - }*/ - sqlsb.append(" from (SELECT distinct "); -// }else{ -// sqlsb.append(" from (SELECT distinct "); -// } - sqlsb.append(" o.id, "); - sqlsb.append(" o.requestid, "); - sqlsb.append(" o.userid, "); - sqlsb.append(" o.workflowid, "); - sqlsb.append(" o.workflowtype, "); - //workflow_otheroperator表中isremark为字符型,这里转下字符 - if (rs.getDBType().toLowerCase().equals("oracle") || rs.getDBType().toLowerCase().equals("postgresql")) { - sqlsb.append(" to_char(o.isremark) as isremark, "); - sqlsb.append(" to_char(o.preisremark) AS preisremark, "); - sqlsb.append(" to_char(o.lastisremark) AS lastisremark, "); - } else if (rs.getDBType().toLowerCase().equals("mysql")) { - sqlsb.append(" o.isremark, "); - sqlsb.append(" o.preisremark, "); - sqlsb.append(" o.lastisremark, "); - } else { - sqlsb.append(" cast(o.isremark as varchar) as isremark, "); - sqlsb.append(" cast(o.preisremark as varchar) as preisremark, "); - sqlsb.append(" cast(o.lastisremark as varchar) as lastisremark, "); - } - sqlsb.append(" o.usertype, "); - sqlsb.append(" o.nodeid, "); - sqlsb.append(" o.agentorbyagentid, "); - sqlsb.append(" o.agenttype, "); - sqlsb.append(" o.receivedate, "); - sqlsb.append(" o.receivetime, "); - sqlsb.append(" o.viewtype, "); - sqlsb.append(" o.iscomplete, "); - sqlsb.append(" o.operatedate, "); - sqlsb.append(" o.operatetime, "); - sqlsb.append(" o.processuser, "); - sqlsb.append("(case when o.nodeid < -1 then (select nodetype from workflow_freenode t where t.id = o.nodeid) else (select nodetype from workflow_flownode t1 where t1.nodeid = o.nodeid) end) as nodetype "); - sqlsb.append(" ,wr.operator "); - sqlsb.append(" ,1 as tab "); - sqlsb.append(" FROM workflow_currentoperator o "); - sqlsb.append(" " + joinStr + " workflow_requestlog wr"); - sqlsb.append(" on wr.requestid=o.requestid"); - sqlsb.append(" and wr.nodeid=o.nodeid"); - sqlsb.append(" and wr.operator = o.userid"); - sqlsb.append(" and wr.logtype <> '1'"); - sqlsb.append(" and o.operatedate = wr.operatedate"); - sqlsb.append(" and o.operatetime = wr.operatetime");//再通过时间关联一下,防止流程状态操作状态显示错误 - sqlsb.append(" where o.id > ").append(currentId); - if ("submit".equals(desremark)) {//1:已提交----isremark等于4,preisremark=11实际对应已提交数据 - sqlsb.append(" AND (o.isremark='2' or (o.isremark=4 and o.preisremark=11)) AND (wr.operator IS NOT null or o.userid = o.processuser)"); - } else if ("nosubmit".equals(desremark)) {//2:未提交 - sqlsb.append(" AND( (o.isremark != '2' AND o.isremark != '4') OR (o.isremark = '4' AND o.viewtype = 0 and o.preisremark != 11) ) "); - } else if ("view".equals(desremark)) {//3:已查看 - sqlsb.append(" and ((o.isremark = '2' AND wr.operator IS NULL) or o.isremark in ('0','1','5','7','8','9','11') or (o.isremark=4 and o.preisremark!=11)) AND o.viewtype IN (-1,-2) "); - } else if ("noview".equals(desremark)) {//4:未查看 - sqlsb.append(" AND o.viewtype=0 AND (o.isremark IN ('0','1','5','7','8','9','11') or (o.isremark = '2' AND wr.operator IS NULL) or (o.isremark=4 and o.preisremark!=11)) "); - } - sqlsb.append(" and o.requestid = " + requestid); - sqlsb.append(" union "); - sqlsb.append(" SELECT DISTINCT "); - sqlsb.append(" o.id, "); - sqlsb.append(" o.requestid, "); - sqlsb.append(" o.userid, "); - sqlsb.append(" o.workflowid, "); - sqlsb.append(" 0 as workflowtype, "); - sqlsb.append(" o.isremark, "); - sqlsb.append(" o.isremark as preisremark, "); - sqlsb.append(" o.isremark as lastisremark, "); - sqlsb.append(" o.usertype, "); - sqlsb.append(" o.nodeid, "); - sqlsb.append(" 0 as agentorbyagentid, "); - sqlsb.append(" '0' as agenttype, "); - sqlsb.append(" o.receivedate, "); - sqlsb.append(" o.receivetime, "); - sqlsb.append(" o.viewtype, "); - sqlsb.append(" 1 as iscomplete, "); - sqlsb.append(" o.operatedate, "); - sqlsb.append(" o.operatetime, "); - sqlsb.append(" wr.operator as processuser, "); - sqlsb.append("(case when o.nodeid < -1 then (select nodetype from workflow_freenode t where t.id = o.nodeid) else (select nodetype from workflow_flownode t1 where t1.nodeid = o.nodeid) end) as nodetype, "); - sqlsb.append(" wr.operator "); - sqlsb.append(" ,2 as tab "); - sqlsb.append(" FROM workflow_otheroperator o LEFT JOIN workflow_requestlog wr ON wr.requestid = o.requestid "); - sqlsb.append(" AND wr.nodeid = o.nodeid "); - sqlsb.append(" AND wr.operator = o.userid "); - sqlsb.append(" AND wr.logtype <> '1' "); - sqlsb.append(" WHERE o.requestid = " + requestid + " "); - sqlsb.append(" and o.id > ").append(currentId2); - sqlsb.append(" ) a "); - sqlsb.append(" where a.requestid = " + requestid + " "); - sqlsb.append(" and a.agenttype <> 1 "); - if (!"".equals(viewlogids)) { - sqlsb.append(" and a.nodeid in (" + viewlogids + ") "); - } - if (selectedNode != -1) { - sqlsb.append(" AND a.nodeid = " + selectedNode + " "); - } - if (!"".equals(selectedOperator)) { - sqlsb.append(" AND a.userid = " + selectedOperator + " "); - } - - WorkflowConfigComInfo configComInfo = new WorkflowConfigComInfo(); - boolean showdelFreeNodeInfo = "1".equals(configComInfo.getValue("showdelete_freenode_info")); - - sqlsb.append(" and (a.nodeid > -1 or (a.nodeid < -1 and exists (select id from workflow_freenode where id = a.nodeid and requestid = " + requestid + (showdelFreeNodeInfo ? "" : " and groupid > 0 ") + " ))) "); - - //搜索时返回状态 - if (isAdSearch && "true".equals(isfirst)) { - rs.executeQuery("select count(id) as count from (" + sqlsb.toString().replace("top " + pageSize, "") + ") t"); - result.put("countTime", new Date().getTime() - date1); - if (rs.next()) { - result.put("count", Util.null2String(rs.getString("count"))); - } - } - - sqlsb.append(" order by a.receivedate, a.receivetime,a.id , a.nodetype"); - - //System.out.println("20170309 =====> sqlsb.toString() = "+sqlsb.toString()); - if ("oracle".equals(rs.getDBType())) { //必须排序后再限制rownum - String sql_oracle = sqlsb.toString(); - sqlsb.setLength(0); - sqlsb.append("select * from (" + sql_oracle + ") where rownum < ").append(pageSize); - } else if ("mysql".equals(rs.getDBType())) { - sqlsb.append(" LIMIT " + pageSize); - } else if ("postgresql".equals(rs.getDBType())) { - sqlsb.append(" LIMIT " + pageSize); - } - if (requestid > 0) { - rs.executeSql(sqlsb.toString()); - } - result.put("dataTime", new Date().getTime() - date1); -// } - List> statuslist = new ArrayList>(); - int tmpnodeid = 0; - while (rs.next()) { - int tab = rs.getInt("tab"); - if (tab == 1) { - currentId = rs.getInt("id"); - } else { - currentId2 = rs.getInt("id"); - } - tmpnodeid = rs.getInt("nodeid"); - String tmpnodename = rs.getString("nodename"); - Map nodekv = null; - if (statuslist.size() == 0) { - currentMinId = currentId; - nodekv = new HashMap(); - statuslist.add(nodekv); - } else { - Map temmap = statuslist.get(statuslist.size() - 1); - int tnodeid = Util.getIntValue(temmap.get("nodeid"), 0); - if (tnodeid == tmpnodeid) { - nodekv = temmap; - } else { - currentMinId = currentId; - nodekv = new HashMap(); - statuslist.add(nodekv); - } - } - nodekv.put("nodeid", tmpnodeid + ""); - nodekv.put("nodename", tmpnodename + ""); - } - int nextlistcount = 0; - int nextsubmitCount = 0; - int nextviewCount = 0; - int nextnoviewCount = 0; - if ("all".equals(desremark) && !isAdSearch) { - currentMaxId = currentId; - String maxsql = " select a.id,a.nodeid from workflow_currentoperator a where a.id > " + currentId + " and a.requestid=" + requestid + " order by a.id ,a.receivedate, a.receivetime"; - rs1.executeSql(maxsql); - while (rs1.next()) { - int currentid = rs1.getInt("id"); - int currentnodeid = rs1.getInt("nodeid"); - if (currentnodeid == tmpnodeid) { - currentMaxId = currentid; - } else { - break; - } - } - String listcountsql = " select count(id) num from workflow_currentoperator where id > " + currentId + " and id <= " + currentMaxId + " and requestid=" + requestid + " and nodeid=" + tmpnodeid + " and agenttype <> 1 and usertype <> 1 "; - //String submitCountsql = " select count(id) num from workflow_currentoperator where id > "+currentId +" and id <= "+currentMaxId+" and requestid="+requestid +" and nodeid="+tmpnodeid +" and agenttype <> 1 and usertype <> 1 and isremark = 2 and exists (select 1 from workflow_requestlog where workflow_requestlog.requestid = workflow_currentoperator.requestid and workflow_currentoperator.nodeid=workflow_requestlog.nodeid and workflow_requestlog.operator=workflow_currentoperator.userid )"; - //String viewCountsql = " select count(id) num from workflow_currentoperator where id > "+currentId +" and id <= "+currentMaxId+" and requestid="+requestid +" and nodeid="+tmpnodeid + " and agenttype <> 1 and usertype <> 1 and (viewtype = -1 or viewtype=-2) and ((isremark = '0' and (takisremark is null or takisremark=0)) or isremark in ('1','5','7','8','9') or (isremark = '2' and not exists (select 1 from workflow_requestlog where workflow_requestlog.requestid = workflow_currentoperator.requestid and workflow_currentoperator.nodeid=workflow_requestlog.nodeid and (workflow_requestlog.operator is null or workflow_requestlog.operator ='' )))) "; - //String noviewCountsql = " select count(id) num from workflow_currentoperator where id > "+currentId +" and id <= "+currentMaxId+" and requestid="+requestid +" and nodeid="+tmpnodeid + " and agenttype <> 1 and usertype <> 1 AND viewtype=0 AND (isremark IN ('0','1','4','5','7','8','9') or (isremark = '2' and not exists (select 1 from workflow_requestlog where workflow_requestlog.requestid = workflow_currentoperator.requestid and workflow_currentoperator.nodeid=workflow_requestlog.nodeid and (workflow_requestlog.operator is null or workflow_requestlog.operator ='' )))) "; - String submitCountsql = " SELECT Count(distinct wc.id) num FROM workflow_currentoperator wc " + joinStr + " workflow_requestlog wr ON wr.requestid = wc.requestid AND wc.nodeid = wr.nodeid AND wr.operator = wc.userid WHERE wc.id > " + currentId + " AND wc.id <= " + currentMaxId + " AND wc.requestid = " + requestid + " AND wc.nodeid = " + tmpnodeid + " AND wc.agenttype <> 1 AND wc.usertype <> 1 AND wc.isremark = 2 and wr.operator is NOT null "; - String viewCountsql = " SELECT Count(distinct wc.id) num FROM workflow_currentoperator wc " + joinStr + " workflow_requestlog wr ON wr.requestid = wc.requestid AND wc.nodeid = wr.nodeid AND wr.operator = wc.userid WHERE wc.id > " + currentId + " AND wc.id <= " + currentMaxId + " AND wc.requestid = " + requestid + " AND wc.nodeid = " + tmpnodeid + " AND wc.agenttype <> 1 AND wc.usertype <> 1 AND wc.viewtype IN (-1,-2) and ((wc.isremark = '2' AND wr.operator IS NULL) or wc.isremark in ('0','1','4','5','7','8','9')) "; - String noviewCountsql = " SELECT Count(distinct wc.id) num FROM workflow_currentoperator wc " + joinStr + " workflow_requestlog wr ON wr.requestid = wc.requestid AND wc.nodeid = wr.nodeid AND wr.operator = wc.userid WHERE wc.id > " + currentId + " AND wc.id <= " + currentMaxId + " AND wc.requestid = " + requestid + " AND wc.nodeid = " + tmpnodeid + " AND wc.agenttype <> 1 AND wc.usertype <> 1 AND wc.viewtype=0 AND (wc.isremark IN ('0','1','4','5','7','8','9','11') or (wc.isremark = '2' and wr.operator is null )) "; - rs1.executeSql(listcountsql); - while (rs1.next()) { - nextlistcount = rs1.getInt("num"); - } - rs1.executeSql(submitCountsql); - while (rs1.next()) { - nextsubmitCount = rs1.getInt("num"); - } - rs1.executeSql(viewCountsql); - while (rs1.next()) { - nextviewCount = rs1.getInt("num"); - } - rs1.executeSql(noviewCountsql); - while (rs1.next()) { - nextnoviewCount = rs1.getInt("num"); - } - } - - Map allstatusmap = new HashMap(); - Map submitstatusmap = new HashMap(); - Map nosubmitstatusmap = new HashMap(); - Map viewstatusmap = new HashMap(); - Map noviewstatusmap = new HashMap(); - //提交节点信息--滚动加载到当前currentoperator对应最大id - - //数字统计转到新接口count中 - ResourceComInfo resourceComInfo = new ResourceComInfo(); - CustomerInfoComInfo customerInfoComInfo = new CustomerInfoComInfo(); - Map all_nodemap = new HashMap(); - Map submit_nodemap = new HashMap(); - Map nosubmit_nodemap = new HashMap(); - Map view_nodemap = new HashMap(); - Map noview_nodemap = new HashMap(); - - rs.beforFirst(); - int currentnum = 0; - for (Iterator> it = statuslist.iterator(); it.hasNext(); index++) { - - Map nodekv = it.next(); - int fnodeid = Util.getIntValue(nodekv.get("nodeid")); - String namename = nodekv.get("nodename"); - int submitCount = 0; - int viewCount = 0; - int noviewCount = 0; - int listcount = 0; - if ("false".equals(isfirst) && currentnum == 0 && lastNodeId == fnodeid) { - index -= 1; - } - if (tmpnodeid == fnodeid && currentnum == (statuslist.size() - 1)) { - submitCount = nextsubmitCount; - viewCount = nextviewCount; - noviewCount = nextnoviewCount; - listcount = nextlistcount; - } - currentnum++; - Map all_nodemap_in = new HashMap(); - all_nodemap_in.put("nodeid", fnodeid); - all_nodemap_in.put("nodename", namename); - Map submit_nodemap_in = new HashMap(); - Map nosubmit_nodemap_in = new HashMap(); - Map view_nodemap_in = new HashMap(); - Map noview_nodemap_in = new HashMap(); - - List> nodeallstatuslist = new ArrayList>(); - List> nodesubmitstatuslist = new ArrayList>(); - List> nodenosubmitstatuslist = new ArrayList>(); - List> nodeviewstatuslist = new ArrayList>(); - List> nodenoviewstatuslist = new ArrayList>(); - - if ("submit".equals(desremark)) {//1:已提交 - //提交节点信息 - submit_nodemap_in.putAll(all_nodemap_in); - submitstatusmap.put("datas", submit_nodemap); - submit_nodemap.put("key" + index, submit_nodemap_in); - submit_nodemap_in.put("list", nodesubmitstatuslist); - } else if ("nosubmit".equals(desremark)) {//2:未提交 - nosubmit_nodemap_in.putAll(all_nodemap_in); - nosubmitstatusmap.put("datas", nosubmit_nodemap); - nosubmit_nodemap.put("key" + index, nosubmit_nodemap_in); - nosubmit_nodemap_in.put("list", nodenosubmitstatuslist); - } else if ("view".equals(desremark)) {//3:已查看 - view_nodemap_in.putAll(all_nodemap_in); - viewstatusmap.put("datas", view_nodemap); - view_nodemap.put("key" + index, view_nodemap_in); - view_nodemap_in.put("list", nodeviewstatuslist); - } else if ("noview".equals(desremark)) {//4:未查看 - noview_nodemap_in.putAll(all_nodemap_in); - noviewstatusmap.put("datas", noview_nodemap); - noview_nodemap.put("key" + index, noview_nodemap_in); - noview_nodemap_in.put("list", nodenoviewstatuslist); - } else { - //所有节点信息 - allstatusmap.put("datas", all_nodemap); - all_nodemap.put("key" + index, all_nodemap_in); - all_nodemap_in.put("list", nodeallstatuslist); - } - - boolean islight = false; - RobotNodeServiceBiz robotNodeServiceBiz = new RobotNodeServiceBiz(); - while (rs.next()) { - int tmpnodeid1 = rs.getInt("nodeid"); - - if (tmpnodeid1 != fnodeid) { - rs.previous(); - break; - } - - //String tmpnodename = rs.getString("nodename"); - int tmpcurrid = rs.getInt("id"); - String tmpuserid = rs.getString("userid"); - String tmpisremark = Util.null2String(rs.getString("isremark")); - if (tmpisremark.equals("")) { - tmpisremark = Util.null2String(rs.getString("lastisremark")); - } - int tmpusertype = rs.getInt("usertype"); - String tmpagentorbyagentid = rs.getString("agentorbyagentid"); - int tmpagenttype = rs.getInt("agenttype"); - String tmpreceivedate = rs.getString("receivedate"); - String tmpreceivetime = rs.getString("receivetime"); - String tmpoperatedate = rs.getString("operatedate"); - String tmpoperatetime = rs.getString("operatetime"); - String viewtype = rs.getString("viewtype"); - String nodetype = rs.getString("nodetype"); - int preisremark = rs.getInt("preisremark"); - String processuser = rs.getString("processuser"); - boolean flags = false; - String tmpIntervel = ""; - // 如果tmpisremark=2 判断时候在日志表里有该人(确定是否是由非会签得到的isremark=2) - - String operator = rs.getString("operator"); - if (operator != null && !"".equals(operator)) { - flags = true; - } - if ((tmpisremark.equals("2") || (tmpisremark.equals("4") && preisremark == 11)) && tmpoperatedate != null && !tmpoperatedate.equals("")) { - tmpIntervel = TimeUtil.timeInterval2(tmpreceivedate + " " + tmpreceivetime, tmpoperatedate + " " + tmpoperatetime, user.getLanguage()); - } - islight = !islight; - Map _statusmap = new HashMap(); - // 操作人 - String _statususername = ""; - String _operatorid = ""; - String _beagentid = ""; - String _beagentname = ""; - String _operatortype = "0"; - if (tmpusertype == 0) { - _operatorid = tmpuserid; - _statususername = ServiceUtil.convertChar(resourceComInfo.getResourcename(tmpuserid)); - if (tmpagenttype == 2) { //代理情况 - _beagentid = tmpagentorbyagentid; - _beagentname = ServiceUtil.convertChar(resourceComInfo.getResourcename(tmpagentorbyagentid)); - } - _statusmap.put("operatorImg", resourceComInfo.getMessagerUrls(tmpuserid)); - _statusmap.put("operatorImgDefName", _statususername); - } else if (RobotNodeBiz.operatortype.equals(tmpusertype + "")) { - _statususername = Util.formatMultiLang(robotNodeServiceBiz.getRobotNodeSet(tmpnodeid1).getOperatorName()); - _operatorid = tmpuserid; - _operatortype = "2"; - } else { - _operatorid = tmpuserid; - _operatortype = "1"; - _statususername = ServiceUtil.convertChar(customerInfoComInfo.getCustomerInfoname(tmpuserid)); - } - - // 查看状态 1:未查看, 2::以查看, 3:已提交, 4:暂停, 5:撤销, 6:启用 7:已查阅 8:退回 9:被撤回 - int _statusCode = 0; - - if (preisremark != 8 && (tmpisremark.equals("2") || (tmpisremark.equals("4") && preisremark == 11)) && (flags || tmpuserid.equals(processuser))) { - _statusCode = 3; - submitCount++; - if ("4".equals(nodetype) && preisremark == 0) { - _statusCode = 7; - } - } else if (tmpisremark.equals("0") || tmpisremark.equals("1") || tmpisremark.equals("5") || tmpisremark.equals("4") || tmpisremark.equals("8") || tmpisremark.equals("9") || tmpisremark.equals("7") || tmpisremark.equals("11") || (tmpisremark.equals("2") && !flags)) { - if (viewtype.equals("-2") || (viewtype.equals("-1") && !tmpoperatedate.equals(""))) { - _statusCode = 2; - viewCount++; - } else { - _statusCode = 1; - noviewCount++; - } - } else if ("s".equals(tmpisremark)) { - _statusCode = 4; - } else if ("r".equals(tmpisremark)) { - _statusCode = 6; - } else if ("c".equals(tmpisremark)) { - _statusCode = 5; - } else if (preisremark == 8 && viewtype.equals("-2") && tmpisremark.equals("2")) { - _statusCode = 2; - viewCount++; - } - RecordSet recordSet = new RecordSet(); - recordSet.executeQuery("select operatetype from workflow_currentoperator where id=?", tmpcurrid); - if (recordSet.next()) { - int operatetype = recordSet.getInt(1); - if (operatetype == 3) {//退回 - _statusCode = 8; - } else if (operatetype == 4) {//被撤回 - _statusCode = 9; - } - } - - - listcount++; - if ("view".equals(desremark)) {//3:已查看 - if (processuser.equals(tmpuserid) && ("2".equals(tmpisremark) || "4".equals(tmpisremark))) { - listcount--; - } - } - String _receivedate = ""; - String _operatedate = ""; - String _intervel = ""; - - if (!tmpisremark.equals("s") && !tmpisremark.equals("c") && !tmpisremark.equals("r")) { - _receivedate = Util.toScreen(tmpreceivedate, user.getLanguage()) + " " + Util.toScreen(tmpreceivetime, user.getLanguage()); - } - _operatedate = Util.toScreen(tmpoperatedate, user.getLanguage()) + " " + Util.toScreen(tmpoperatetime, user.getLanguage()); - - _intervel = Util.toScreen(tmpIntervel, user.getLanguage()); - - _statusmap.put("statuscode", String.valueOf(_statusCode)); - _statusmap.put("operator", _statususername); - _statusmap.put("receivedate", _receivedate); - _statusmap.put("operatedate", _operatedate); - _statusmap.put("intervel", _intervel); - _statusmap.put("operatorid", _operatorid); - _statusmap.put("operatortype", _operatortype); - _statusmap.put("beagentid", _beagentid); - _statusmap.put("beagentname", _beagentname); - _statusmap.put("nodetype", nodetype); - - //所有节点 - nodeallstatuslist.add(_statusmap); - //查看状态 1:未查看, 2::以查看, 3:已提交, 4:暂停, 5:撤销, 6:启用 7:已查阅 - if ((tmpisremark.equals("2") || (tmpisremark.equals("4") && preisremark == 11)) && (flags || tmpuserid.equals(processuser))) { - nodesubmitstatuslist.add(_statusmap); - } else if (tmpisremark.equals("0") || tmpisremark.equals("1") || tmpisremark.equals("5") || tmpisremark.equals("4") || tmpisremark.equals("8") || tmpisremark.equals("9") || tmpisremark.equals("7") || tmpisremark.equals("11") || (tmpisremark.equals("2") && !flags)) { - if (viewtype.equals("-2") || (viewtype.equals("-1") && !tmpoperatedate.equals(""))) { - nodeviewstatuslist.add(_statusmap); - } else if (viewtype.equals("0")) { - nodenoviewstatuslist.add(_statusmap); - } - } - - if ((!tmpisremark.equals("2") && !tmpisremark.equals("4")) || (tmpisremark.equals("4") && viewtype.equals("0"))) { - if (!tmpisremark.equals("s") && !tmpisremark.equals("s") && !tmpisremark.equals("c") && !tmpisremark.equals("r")) { - nodenosubmitstatuslist.add(_statusmap); - } - } - } - //--已提交、已查看、未查看 - all_nodemap_in.put("submitCount", submitCount);//--已提交 - all_nodemap_in.put("viewCount", viewCount);//--已查看 - all_nodemap_in.put("noviewCount", noviewCount);//--未查看 - if ("submit".equals(desremark)) {//1:已提交 - //提交节点信息 - submit_nodemap_in.put("listcount", listcount); - result.putAll(submitstatusmap); - } else if ("nosubmit".equals(desremark)) {//2:未提交 - nosubmit_nodemap_in.put("listcount", listcount); - result.putAll(nosubmitstatusmap); - } else if ("view".equals(desremark)) {//3:已查看 - view_nodemap_in.put("listcount", listcount); - result.putAll(viewstatusmap); - } else if ("noview".equals(desremark)) {//4:未查看 - noview_nodemap_in.put("listcount", listcount); - result.putAll(noviewstatusmap); - } else { - //所有节点信息 - all_nodemap_in.put("listcount", listcount); - result.putAll(allstatusmap); - } - lastNodeId = fnodeid; - } -// if(maxid == currentMaxId){ -// isfinish = 1; -// } - putpara.put("nodeindex", index + ""); - putpara.put("currentMaxId", currentMaxId + ""); - putpara.put("currentMinId", currentMinId + ""); - putpara.put("currentId", currentId + "_" + currentId2); - putpara.put("lastNodeId", lastNodeId + ""); - putpara.put("viewlogids", viewlogids + ""); - result.put("parameter", putpara); - result.put("otherTime", new Date().getTime() - date1); - } catch (Exception e) { - e.printStackTrace(); - } - return result; - } - - -%> - - diff --git a/interface/transfer/testError.jsp b/interface/transfer/testError.jsp deleted file mode 100644 index d863b26..0000000 --- a/interface/transfer/testError.jsp +++ /dev/null @@ -1,812 +0,0 @@ -<%@ page import="org.apache.poi.xwpf.usermodel.XWPFDocument" %> -<%@ page import="cn.afterturn.easypoi.word.WordExportUtil" %> -<%@ page import="java.nio.charset.StandardCharsets" %> -<%@ page import="java.io.*" %> -<%@ page import="weaver.hrm.User" %> -<%@ page import="com.engine.workflow.cmd.requestForm.StatusDataCmd" %> -<%@ page import="com.engine.core.interceptor.CommandContext" %> -<%@ page import="com.api.workflow.service.RequestAuthenticationService" %> -<%@ page import="java.util.*" %> -<%@ page import="weaver.conn.RecordSet" %> -<%@ page import="weaver.general.Util" %> -<%@ page import="com.alibaba.fastjson.JSON" %> -<%@ page import="weaver.workflow.monitor.Monitor" %> -<%@ page import="weaver.workflow.workflow.WorkflowConfigComInfo" %> -<%@ page import="weaver.hrm.resource.ResourceComInfo" %> -<%@ page import="weaver.crm.Maint.CustomerInfoComInfo" %> -<%@ page import="com.engine.workflow.biz.RobotNode.RobotNodeServiceBiz" %> -<%@ page import="weaver.general.TimeUtil" %> -<%@ page import="com.api.workflow.util.ServiceUtil" %> -<%@ page import="com.engine.workflow.biz.RobotNode.RobotNodeBiz" %> -<%@ page import="com.alibaba.fastjson.JSONObject" %> -<%@ page import="java.nio.charset.Charset" %> -<%@ page import="weaver.rtx.ChangeCharset" %> - - -<% - response.setCharacterEncoding("utf-8"); - HashMap params = new HashMap<>(); - params.put("requestid", "727734"); - params.put("desremark", "all"); - params.put("pageSize", "50"); - params.put("isfirst", "true"); - params.put("request", request); - Map data = execute(params, new User(23)); - Map datas = (Map) data.get("datas"); - List> entries = new ArrayList<>(datas.entrySet()); - entries.sort(new Comparator>() { - @Override - public int compare(Map.Entry o1, Map.Entry o2) { - Integer key1 = Util.getIntValue((Util.null2String(o1.getKey())).replace("key", "")); - Integer key2 = Util.getIntValue((Util.null2String(o2.getKey())).replace("key", "")); - return key1 - key2; - } - }); // 自然顺序 - ArrayList> results = new ArrayList<>(); - // out.print(JSONObject.toJSONString(entries)); - for (Map.Entry entry : entries) { - Map value = (Map)entry.getValue(); - List> list = (List)value.get("list"); - for (Map item : list) { - String operator = (String)item.get("operator"); - String operatorid = (String)item.get("operatorid"); - String operatortype = (String)item.get("operatortype"); - String operatedate = (String)item.get("operatedate"); - String nodename = (String)value.get("nodename"); - HashMap itemMap = new HashMap<>(); - itemMap.put("operator",operator); - itemMap.put("operatorid",operatorid); - itemMap.put("operatortype",operatortype); - itemMap.put("operatedate",operatedate); - itemMap.put("nodename",nodename); - results.add(itemMap); - } - - } - - String encoding = System.getProperty("file.encoding"); - out.print(encoding); - - - try { - - - Map dataMap = new HashMap<>(); - dataMap.put("users", results); // 将用户列表添加到数据映射中 - // dataMap.put("name", results); // 将用户列表添加到数据映射中 - - // 加载模板并填充数据 - String templatePath = "/opt/weaver/filesys/template.docx"; // 模板文件路径 - String templatePath2 = "/opt/weaver/filesys/xinxi2.docx"; // 模板文件路径 - File file = new File(templatePath); - File file2 = new File(templatePath2); - // out.print(file.exists()); - // out.print(file2.exists()); - System.out.println(dataMap); - XWPFDocument doc = WordExportUtil.exportWord07(templatePath, dataMap); - - // 导出Word文档 - String lastname = new User(6473).getLastname(); - String outputPath = "/opt/weaver/filesys/"+lastname+".docx"; // 输出文件路径 - - // byte[] gbks = outputPath.getBytes("gbk"); - System.out.print(outputPath); - String outputPath1 = new String( outputPath.getBytes("UTF-8"),"ISO-8859-1"); - String outputPath2 = new String( outputPath1.getBytes("ISO-8859-1"),"UTF-8"); - - // ChangeCharset changeCharset = new ChangeCharset(); - // String outputPath1 = changeCharset.toUTF_8(outputPath); - System.out.print(outputPath1); - System.out.print(outputPath2); - - outputPath = new String(outputPath.getBytes("ISO8859_1"), "UTF-8"); - File file11 = new File(outputPath1); - File file22 = new File(outputPath2); - // if(!file1.exists()){ - file11.createNewFile(); - file22.createNewFile(); - // } - - - FileOutputStream fos = new FileOutputStream(outputPath) ; - doc.write(fos); - fos.close(); - } catch (Exception e) { - System.out.println("errorerrorerror"); - - System.out.println(e.getMessage()); - out.print(e.getMessage()+"123"); - e.printStackTrace(); - } - - - - - - -%> - -<%! - private void test1(ArrayList> results) { - try { - Map dataMap = new HashMap<>(); - dataMap.put("users", results); // 将用户列表添加到数据映射中 - // 加载模板并填充数据 - String templatePath = "/opt/weaver/filesys/xinxi.docx"; // 模板文件路径 - String templatePath2 = "/opt/weaver/filesys/xinxi2.docx"; // 模板文件路径 - File file = new File(templatePath); - File file2 = new File(templatePath2); - // out.print(file.exists()); - // out.print(file2.exists()); - System.out.println(dataMap); - XWPFDocument doc = WordExportUtil.exportWord07(templatePath, dataMap); - - // 导出Word文档 - String lastname = new User(22).getLastname(); - String outputPath = "/opt/weaver/filesys/"+lastname+".docx"; // 输出文件路径 - - // byte[] gbks = outputPath.getBytes("gbk"); - String outputPath1 = new String( outputPath.getBytes("UTF-8")); - // outputPath = new String(outputPath.getBytes("ISO8859_1"), "UTF-8"); - File file1 = new File(outputPath1); - if(!file1.exists()){ - file1.createNewFile(); - } - - - // FileOutputStream fos = new FileOutputStream(outputPath) ; - // doc.write(fos); - // fos.close(); - } catch (Exception e) { - System.out.println("errorerrorerror"); - - System.out.println(e.getMessage()); - // out.print(e.getMessage()+"123"); - e.printStackTrace(); - } - } - - - public Map execute(Map params, User user) { - Map result = new HashMap(); - RequestAuthenticationService authService = new RequestAuthenticationService(); - authService.setUser(user); - - long date1 = new Date().getTime(); - try { - RecordSet rs = new RecordSet(); - RecordSet rs1 = new RecordSet(); - int pageSize = Util.getIntValue(Util.null2String(params.get("pageSize")), 30); - int desrequestid = Util.getIntValue(Util.null2String(params.get("desrequestid")), 0); - String isfirst = Util.null2String(params.get("isfirst")); - String isurger = Util.null2String(params.get("isurger")); - String desremark = Util.null2String(params.get("desremark")); - int desremarkIndex = desremark.indexOf("_"); - boolean isAdSearch = false;//是否有过滤条件 - if (desremarkIndex > -1) { - isAdSearch = true; - desremark = desremark.substring(0, desremarkIndex); - } - String parameter = Util.null2String(params.get("parameter")); - int selectedNode = Util.getIntValue(Util.null2String(params.get("selectedNode")), -1);//选中的节点 - String selectedOperator = Util.null2String(params.get("selectedOperator"));//选中的操作者 - int requestid = Util.getIntValue(Util.null2String(params.get("requestid")), 0); - int workflowid = -1; - rs.executeQuery("select workflowid from workflow_requestbase where requestid=" + requestid); - if (rs.next()) - workflowid = Util.getIntValue(rs.getString("workflowid")); - - // 将json字符串转换成jsonObject - int currentMaxId = 0; - int currentMinId = 0; - int currentId = 0; - int currentId2 = 0; - int lastNodeId = 0; - String viewlogids = ""; - int index = 0; - try { - if (!"true".equals(isfirst)) { - Map parameterMap = JSON.parseObject(parameter, Map.class);//Weibo类在下边定义 - currentMaxId = Util.getIntValue(parameterMap.get("currentMaxId"), 0); - currentMinId = Util.getIntValue(parameterMap.get("currentMinId"), 0); - String currentId12 = Util.null2String(parameterMap.get("currentId")); - if (currentId12.contains("_")) { - String[] currentId12Arr = currentId12.split("_"); - currentId = Util.getIntValue(currentId12Arr[0]); - currentId2 = Util.getIntValue(currentId12Arr[1]); - } else { - currentId = Util.getIntValue(currentId12); - } - viewlogids = Util.null2String(parameterMap.get("viewlogids")); - index = Util.getIntValue(parameterMap.get("nodeindex"), 0); - lastNodeId = Util.getIntValue(parameterMap.get("lastNodeId"), 0); - } - } catch (Exception e) { - e.printStackTrace(); - } - Map putpara = new HashMap(); - - Monitor monitor = new Monitor(); -// String joinStr = ("oracle".equalsIgnoreCase(rs.getDBType()) || "mysql".equalsIgnoreCase(rs.getDBType())) ? " left join " : " left hash join "; - String joinStr = " left join "; -// if (isurger.equals("true") || monitor.hasMonitor(requestid+"", user.getUID() + "")) { -// StringBuffer sqlsb = new StringBuffer(); -// sqlsb.append(" select a.id,a.nodeid, "); -// sqlsb.append(" b.nodename, "); -// sqlsb.append(" a.userid, "); -// sqlsb.append(" a.isremark, "); -// sqlsb.append(" a.lastisremark, "); -// sqlsb.append(" a.usertype, "); -// sqlsb.append(" a.agentorbyagentid, "); -// sqlsb.append(" a.agenttype, "); -// sqlsb.append(" a.receivedate, "); -// sqlsb.append(" a.receivetime, "); -// sqlsb.append(" a.operatedate, "); -// sqlsb.append(" a.operatetime, "); -// sqlsb.append(" a.viewtype, "); -// sqlsb.append(" a.nodetype "); -// sqlsb.append(" ,a.operator "); -// sqlsb.append(" from (SELECT distinct top ").append(pageSize); -// sqlsb.append(" o.id, " ); -// sqlsb.append(" o.requestid, " ); -// sqlsb.append(" o.userid, "); -// sqlsb.append(" o.workflowid, "); -// sqlsb.append(" o.workflowtype, "); -// sqlsb.append(" o.isremark, "); -// sqlsb.append(" o.lastisremark, "); -// sqlsb.append(" o.usertype, "); -// sqlsb.append(" o.nodeid, "); -// sqlsb.append(" o.agentorbyagentid, "); -// sqlsb.append(" o.agenttype, "); -// sqlsb.append(" o.receivedate, "); -// sqlsb.append(" o.receivetime, "); -// sqlsb.append(" o.viewtype, "); -// sqlsb.append(" o.iscomplete, "); -// sqlsb.append(" o.operatedate, "); -// sqlsb.append(" o.operatetime, "); -// sqlsb.append(" nodetype "); -// sqlsb.append(" ,wr.operator "); -// sqlsb.append(" FROM workflow_currentoperator o "); -// -// sqlsb.append(" left join workflow_requestlog wr"); -// sqlsb.append(" on wr.requestid=o.requestid"); -// sqlsb.append(" and wr.nodeid=o.nodeid"); -// sqlsb.append(" and wr.operator = o.userid"); -// sqlsb.append(" and wr.logtype <> '1'"); -// -// sqlsb.append(" , workflow_flownode "); -// -// sqlsb.append(" where o.nodeid = "); -// sqlsb.append(" workflow_flownode.nodeid "); -// if(desremark ==1){//1:已提交 -// sqlsb.append(" AND o.isremark='2' AND wr.operator IS NOT null "); -// }else if(desremark == 2){//2:未提交 -// sqlsb.append(" and ((o.isremark = '0' and (o.takisremark is null or o.takisremark=0)) or o.isremark in ('1','5','7','8','9') )"); -// }else if(desremark == 3){//3:已查看 -// sqlsb.append(" and (((o.isremark = '2' AND wr.operator IS NULL) or o.isremark in ('0','1','4','5','7','8','9')) AND o.viewtype IN (-1,-2)) "); -// }else if(desremark == 4){//4:未查看 -// sqlsb.append(" AND o.viewtype = 0 "); -// } -// sqlsb.append(" and o.id > ").append(currentId); -// sqlsb.append(" and o.requestid = " + requestid + ") a, "); -// sqlsb.append(" workflow_nodebase b "); -// sqlsb.append(" where a.nodeid = b.id "); -// sqlsb.append(" and a.requestid = " + requestid + " "); -// sqlsb.append(" and a.agenttype <> 1 "); -// sqlsb.append(" order by a.id "); -// //System.out.println("20170309 =====> sqlsb.toString() = "+sqlsb.toString()); -// rs.executeSql(sqlsb.toString()); -// -// } else { - // 处理相关流程的查看权限 -// if ("".equals(viewlogids)) { -// viewlogids = this.getViewLogids(); -// } - StringBuffer sqlsb = new StringBuffer(); - if ("sqlserver".equalsIgnoreCase(rs.getDBType())) { // sqlserver 排序提到这里 - sqlsb.append(" select top ").append(pageSize).append(" a.id,a.nodeid, "); - } else { - sqlsb.append(" select a.id,a.nodeid, "); - } - sqlsb.append("(CASE WHEN a.nodeid < -1 THEN (SELECT nodename FROM workflow_freenode t WHERE t.id = a.nodeid) ELSE (SELECT nodename FROM workflow_nodebase t1 WHERE t1.id = a.nodeid) END) AS nodename,"); - sqlsb.append(" a.userid, "); - sqlsb.append(" a.isremark, "); - sqlsb.append(" a.preisremark, "); - sqlsb.append(" a.lastisremark, "); - sqlsb.append(" a.usertype, "); - sqlsb.append(" a.agentorbyagentid, "); - sqlsb.append(" a.agenttype, "); - sqlsb.append(" a.receivedate, "); - sqlsb.append(" a.receivetime, "); - sqlsb.append(" a.operatedate, "); - sqlsb.append(" a.operatetime, "); - sqlsb.append(" a.processuser, "); - sqlsb.append(" a.viewtype, "); - sqlsb.append(" a.nodetype "); - sqlsb.append(" ,a.operator "); - sqlsb.append(" ,a.tab "); - //if("true".equals(isfirst)){ - /*if("oracle".equals(rs.getDBType()) || "mysql".equals(rs.getDBType())){ - sqlsb.append(" from (SELECT distinct "); - }else{ - sqlsb.append(" from (SELECT distinct top ").append(pageSize); // sqlserver排序提到外层查询 - }*/ - sqlsb.append(" from (SELECT distinct "); -// }else{ -// sqlsb.append(" from (SELECT distinct "); -// } - sqlsb.append(" o.id, "); - sqlsb.append(" o.requestid, "); - sqlsb.append(" o.userid, "); - sqlsb.append(" o.workflowid, "); - sqlsb.append(" o.workflowtype, "); - //workflow_otheroperator表中isremark为字符型,这里转下字符 - if (rs.getDBType().toLowerCase().equals("oracle") || rs.getDBType().toLowerCase().equals("postgresql")) { - sqlsb.append(" to_char(o.isremark) as isremark, "); - sqlsb.append(" to_char(o.preisremark) AS preisremark, "); - sqlsb.append(" to_char(o.lastisremark) AS lastisremark, "); - } else if (rs.getDBType().toLowerCase().equals("mysql")) { - sqlsb.append(" o.isremark, "); - sqlsb.append(" o.preisremark, "); - sqlsb.append(" o.lastisremark, "); - } else { - sqlsb.append(" cast(o.isremark as varchar) as isremark, "); - sqlsb.append(" cast(o.preisremark as varchar) as preisremark, "); - sqlsb.append(" cast(o.lastisremark as varchar) as lastisremark, "); - } - sqlsb.append(" o.usertype, "); - sqlsb.append(" o.nodeid, "); - sqlsb.append(" o.agentorbyagentid, "); - sqlsb.append(" o.agenttype, "); - sqlsb.append(" o.receivedate, "); - sqlsb.append(" o.receivetime, "); - sqlsb.append(" o.viewtype, "); - sqlsb.append(" o.iscomplete, "); - sqlsb.append(" o.operatedate, "); - sqlsb.append(" o.operatetime, "); - sqlsb.append(" o.processuser, "); - sqlsb.append("(case when o.nodeid < -1 then (select nodetype from workflow_freenode t where t.id = o.nodeid) else (select nodetype from workflow_flownode t1 where t1.nodeid = o.nodeid) end) as nodetype "); - sqlsb.append(" ,wr.operator "); - sqlsb.append(" ,1 as tab "); - sqlsb.append(" FROM workflow_currentoperator o "); - sqlsb.append(" " + joinStr + " workflow_requestlog wr"); - sqlsb.append(" on wr.requestid=o.requestid"); - sqlsb.append(" and wr.nodeid=o.nodeid"); - sqlsb.append(" and wr.operator = o.userid"); - sqlsb.append(" and wr.logtype <> '1'"); - sqlsb.append(" and o.operatedate = wr.operatedate"); - sqlsb.append(" and o.operatetime = wr.operatetime");//再通过时间关联一下,防止流程状态操作状态显示错误 - sqlsb.append(" where o.id > ").append(currentId); - if ("submit".equals(desremark)) {//1:已提交----isremark等于4,preisremark=11实际对应已提交数据 - sqlsb.append(" AND (o.isremark='2' or (o.isremark=4 and o.preisremark=11)) AND (wr.operator IS NOT null or o.userid = o.processuser)"); - } else if ("nosubmit".equals(desremark)) {//2:未提交 - sqlsb.append(" AND( (o.isremark != '2' AND o.isremark != '4') OR (o.isremark = '4' AND o.viewtype = 0 and o.preisremark != 11) ) "); - } else if ("view".equals(desremark)) {//3:已查看 - sqlsb.append(" and ((o.isremark = '2' AND wr.operator IS NULL) or o.isremark in ('0','1','5','7','8','9','11') or (o.isremark=4 and o.preisremark!=11)) AND o.viewtype IN (-1,-2) "); - } else if ("noview".equals(desremark)) {//4:未查看 - sqlsb.append(" AND o.viewtype=0 AND (o.isremark IN ('0','1','5','7','8','9','11') or (o.isremark = '2' AND wr.operator IS NULL) or (o.isremark=4 and o.preisremark!=11)) "); - } - sqlsb.append(" and o.requestid = " + requestid); - sqlsb.append(" union "); - sqlsb.append(" SELECT DISTINCT "); - sqlsb.append(" o.id, "); - sqlsb.append(" o.requestid, "); - sqlsb.append(" o.userid, "); - sqlsb.append(" o.workflowid, "); - sqlsb.append(" 0 as workflowtype, "); - sqlsb.append(" o.isremark, "); - sqlsb.append(" o.isremark as preisremark, "); - sqlsb.append(" o.isremark as lastisremark, "); - sqlsb.append(" o.usertype, "); - sqlsb.append(" o.nodeid, "); - sqlsb.append(" 0 as agentorbyagentid, "); - sqlsb.append(" '0' as agenttype, "); - sqlsb.append(" o.receivedate, "); - sqlsb.append(" o.receivetime, "); - sqlsb.append(" o.viewtype, "); - sqlsb.append(" 1 as iscomplete, "); - sqlsb.append(" o.operatedate, "); - sqlsb.append(" o.operatetime, "); - sqlsb.append(" wr.operator as processuser, "); - sqlsb.append("(case when o.nodeid < -1 then (select nodetype from workflow_freenode t where t.id = o.nodeid) else (select nodetype from workflow_flownode t1 where t1.nodeid = o.nodeid) end) as nodetype, "); - sqlsb.append(" wr.operator "); - sqlsb.append(" ,2 as tab "); - sqlsb.append(" FROM workflow_otheroperator o LEFT JOIN workflow_requestlog wr ON wr.requestid = o.requestid "); - sqlsb.append(" AND wr.nodeid = o.nodeid "); - sqlsb.append(" AND wr.operator = o.userid "); - sqlsb.append(" AND wr.logtype <> '1' "); - sqlsb.append(" WHERE o.requestid = " + requestid + " "); - sqlsb.append(" and o.id > ").append(currentId2); - sqlsb.append(" ) a "); - sqlsb.append(" where a.requestid = " + requestid + " "); - sqlsb.append(" and a.agenttype <> 1 "); - if (!"".equals(viewlogids)) { - sqlsb.append(" and a.nodeid in (" + viewlogids + ") "); - } - if (selectedNode != -1) { - sqlsb.append(" AND a.nodeid = " + selectedNode + " "); - } - if (!"".equals(selectedOperator)) { - sqlsb.append(" AND a.userid = " + selectedOperator + " "); - } - - WorkflowConfigComInfo configComInfo = new WorkflowConfigComInfo(); - boolean showdelFreeNodeInfo = "1".equals(configComInfo.getValue("showdelete_freenode_info")); - - sqlsb.append(" and (a.nodeid > -1 or (a.nodeid < -1 and exists (select id from workflow_freenode where id = a.nodeid and requestid = " + requestid + (showdelFreeNodeInfo ? "" : " and groupid > 0 ") + " ))) "); - - //搜索时返回状态 - if (isAdSearch && "true".equals(isfirst)) { - rs.executeQuery("select count(id) as count from (" + sqlsb.toString().replace("top " + pageSize, "") + ") t"); - result.put("countTime", new Date().getTime() - date1); - if (rs.next()) { - result.put("count", Util.null2String(rs.getString("count"))); - } - } - - sqlsb.append(" order by a.receivedate, a.receivetime,a.id , a.nodetype"); - - //System.out.println("20170309 =====> sqlsb.toString() = "+sqlsb.toString()); - if ("oracle".equals(rs.getDBType())) { //必须排序后再限制rownum - String sql_oracle = sqlsb.toString(); - sqlsb.setLength(0); - sqlsb.append("select * from (" + sql_oracle + ") where rownum < ").append(pageSize); - } else if ("mysql".equals(rs.getDBType())) { - sqlsb.append(" LIMIT " + pageSize); - } else if ("postgresql".equals(rs.getDBType())) { - sqlsb.append(" LIMIT " + pageSize); - } - if (requestid > 0) { - rs.executeSql(sqlsb.toString()); - } - result.put("dataTime", new Date().getTime() - date1); -// } - List> statuslist = new ArrayList>(); - int tmpnodeid = 0; - while (rs.next()) { - int tab = rs.getInt("tab"); - if (tab == 1) { - currentId = rs.getInt("id"); - } else { - currentId2 = rs.getInt("id"); - } - tmpnodeid = rs.getInt("nodeid"); - String tmpnodename = rs.getString("nodename"); - Map nodekv = null; - if (statuslist.size() == 0) { - currentMinId = currentId; - nodekv = new HashMap(); - statuslist.add(nodekv); - } else { - Map temmap = statuslist.get(statuslist.size() - 1); - int tnodeid = Util.getIntValue(temmap.get("nodeid"), 0); - if (tnodeid == tmpnodeid) { - nodekv = temmap; - } else { - currentMinId = currentId; - nodekv = new HashMap(); - statuslist.add(nodekv); - } - } - nodekv.put("nodeid", tmpnodeid + ""); - nodekv.put("nodename", tmpnodename + ""); - } - int nextlistcount = 0; - int nextsubmitCount = 0; - int nextviewCount = 0; - int nextnoviewCount = 0; - if ("all".equals(desremark) && !isAdSearch) { - currentMaxId = currentId; - String maxsql = " select a.id,a.nodeid from workflow_currentoperator a where a.id > " + currentId + " and a.requestid=" + requestid + " order by a.id ,a.receivedate, a.receivetime"; - rs1.executeSql(maxsql); - while (rs1.next()) { - int currentid = rs1.getInt("id"); - int currentnodeid = rs1.getInt("nodeid"); - if (currentnodeid == tmpnodeid) { - currentMaxId = currentid; - } else { - break; - } - } - String listcountsql = " select count(id) num from workflow_currentoperator where id > " + currentId + " and id <= " + currentMaxId + " and requestid=" + requestid + " and nodeid=" + tmpnodeid + " and agenttype <> 1 and usertype <> 1 "; - //String submitCountsql = " select count(id) num from workflow_currentoperator where id > "+currentId +" and id <= "+currentMaxId+" and requestid="+requestid +" and nodeid="+tmpnodeid +" and agenttype <> 1 and usertype <> 1 and isremark = 2 and exists (select 1 from workflow_requestlog where workflow_requestlog.requestid = workflow_currentoperator.requestid and workflow_currentoperator.nodeid=workflow_requestlog.nodeid and workflow_requestlog.operator=workflow_currentoperator.userid )"; - //String viewCountsql = " select count(id) num from workflow_currentoperator where id > "+currentId +" and id <= "+currentMaxId+" and requestid="+requestid +" and nodeid="+tmpnodeid + " and agenttype <> 1 and usertype <> 1 and (viewtype = -1 or viewtype=-2) and ((isremark = '0' and (takisremark is null or takisremark=0)) or isremark in ('1','5','7','8','9') or (isremark = '2' and not exists (select 1 from workflow_requestlog where workflow_requestlog.requestid = workflow_currentoperator.requestid and workflow_currentoperator.nodeid=workflow_requestlog.nodeid and (workflow_requestlog.operator is null or workflow_requestlog.operator ='' )))) "; - //String noviewCountsql = " select count(id) num from workflow_currentoperator where id > "+currentId +" and id <= "+currentMaxId+" and requestid="+requestid +" and nodeid="+tmpnodeid + " and agenttype <> 1 and usertype <> 1 AND viewtype=0 AND (isremark IN ('0','1','4','5','7','8','9') or (isremark = '2' and not exists (select 1 from workflow_requestlog where workflow_requestlog.requestid = workflow_currentoperator.requestid and workflow_currentoperator.nodeid=workflow_requestlog.nodeid and (workflow_requestlog.operator is null or workflow_requestlog.operator ='' )))) "; - String submitCountsql = " SELECT Count(distinct wc.id) num FROM workflow_currentoperator wc " + joinStr + " workflow_requestlog wr ON wr.requestid = wc.requestid AND wc.nodeid = wr.nodeid AND wr.operator = wc.userid WHERE wc.id > " + currentId + " AND wc.id <= " + currentMaxId + " AND wc.requestid = " + requestid + " AND wc.nodeid = " + tmpnodeid + " AND wc.agenttype <> 1 AND wc.usertype <> 1 AND wc.isremark = 2 and wr.operator is NOT null "; - String viewCountsql = " SELECT Count(distinct wc.id) num FROM workflow_currentoperator wc " + joinStr + " workflow_requestlog wr ON wr.requestid = wc.requestid AND wc.nodeid = wr.nodeid AND wr.operator = wc.userid WHERE wc.id > " + currentId + " AND wc.id <= " + currentMaxId + " AND wc.requestid = " + requestid + " AND wc.nodeid = " + tmpnodeid + " AND wc.agenttype <> 1 AND wc.usertype <> 1 AND wc.viewtype IN (-1,-2) and ((wc.isremark = '2' AND wr.operator IS NULL) or wc.isremark in ('0','1','4','5','7','8','9')) "; - String noviewCountsql = " SELECT Count(distinct wc.id) num FROM workflow_currentoperator wc " + joinStr + " workflow_requestlog wr ON wr.requestid = wc.requestid AND wc.nodeid = wr.nodeid AND wr.operator = wc.userid WHERE wc.id > " + currentId + " AND wc.id <= " + currentMaxId + " AND wc.requestid = " + requestid + " AND wc.nodeid = " + tmpnodeid + " AND wc.agenttype <> 1 AND wc.usertype <> 1 AND wc.viewtype=0 AND (wc.isremark IN ('0','1','4','5','7','8','9','11') or (wc.isremark = '2' and wr.operator is null )) "; - rs1.executeSql(listcountsql); - while (rs1.next()) { - nextlistcount = rs1.getInt("num"); - } - rs1.executeSql(submitCountsql); - while (rs1.next()) { - nextsubmitCount = rs1.getInt("num"); - } - rs1.executeSql(viewCountsql); - while (rs1.next()) { - nextviewCount = rs1.getInt("num"); - } - rs1.executeSql(noviewCountsql); - while (rs1.next()) { - nextnoviewCount = rs1.getInt("num"); - } - } - - Map allstatusmap = new HashMap(); - Map submitstatusmap = new HashMap(); - Map nosubmitstatusmap = new HashMap(); - Map viewstatusmap = new HashMap(); - Map noviewstatusmap = new HashMap(); - //提交节点信息--滚动加载到当前currentoperator对应最大id - - //数字统计转到新接口count中 - ResourceComInfo resourceComInfo = new ResourceComInfo(); - CustomerInfoComInfo customerInfoComInfo = new CustomerInfoComInfo(); - Map all_nodemap = new HashMap(); - Map submit_nodemap = new HashMap(); - Map nosubmit_nodemap = new HashMap(); - Map view_nodemap = new HashMap(); - Map noview_nodemap = new HashMap(); - - rs.beforFirst(); - int currentnum = 0; - for (Iterator> it = statuslist.iterator(); it.hasNext(); index++) { - - Map nodekv = it.next(); - int fnodeid = Util.getIntValue(nodekv.get("nodeid")); - String namename = nodekv.get("nodename"); - int submitCount = 0; - int viewCount = 0; - int noviewCount = 0; - int listcount = 0; - if ("false".equals(isfirst) && currentnum == 0 && lastNodeId == fnodeid) { - index -= 1; - } - if (tmpnodeid == fnodeid && currentnum == (statuslist.size() - 1)) { - submitCount = nextsubmitCount; - viewCount = nextviewCount; - noviewCount = nextnoviewCount; - listcount = nextlistcount; - } - currentnum++; - Map all_nodemap_in = new HashMap(); - all_nodemap_in.put("nodeid", fnodeid); - all_nodemap_in.put("nodename", namename); - Map submit_nodemap_in = new HashMap(); - Map nosubmit_nodemap_in = new HashMap(); - Map view_nodemap_in = new HashMap(); - Map noview_nodemap_in = new HashMap(); - - List> nodeallstatuslist = new ArrayList>(); - List> nodesubmitstatuslist = new ArrayList>(); - List> nodenosubmitstatuslist = new ArrayList>(); - List> nodeviewstatuslist = new ArrayList>(); - List> nodenoviewstatuslist = new ArrayList>(); - - if ("submit".equals(desremark)) {//1:已提交 - //提交节点信息 - submit_nodemap_in.putAll(all_nodemap_in); - submitstatusmap.put("datas", submit_nodemap); - submit_nodemap.put("key" + index, submit_nodemap_in); - submit_nodemap_in.put("list", nodesubmitstatuslist); - } else if ("nosubmit".equals(desremark)) {//2:未提交 - nosubmit_nodemap_in.putAll(all_nodemap_in); - nosubmitstatusmap.put("datas", nosubmit_nodemap); - nosubmit_nodemap.put("key" + index, nosubmit_nodemap_in); - nosubmit_nodemap_in.put("list", nodenosubmitstatuslist); - } else if ("view".equals(desremark)) {//3:已查看 - view_nodemap_in.putAll(all_nodemap_in); - viewstatusmap.put("datas", view_nodemap); - view_nodemap.put("key" + index, view_nodemap_in); - view_nodemap_in.put("list", nodeviewstatuslist); - } else if ("noview".equals(desremark)) {//4:未查看 - noview_nodemap_in.putAll(all_nodemap_in); - noviewstatusmap.put("datas", noview_nodemap); - noview_nodemap.put("key" + index, noview_nodemap_in); - noview_nodemap_in.put("list", nodenoviewstatuslist); - } else { - //所有节点信息 - allstatusmap.put("datas", all_nodemap); - all_nodemap.put("key" + index, all_nodemap_in); - all_nodemap_in.put("list", nodeallstatuslist); - } - - boolean islight = false; - RobotNodeServiceBiz robotNodeServiceBiz = new RobotNodeServiceBiz(); - while (rs.next()) { - int tmpnodeid1 = rs.getInt("nodeid"); - - if (tmpnodeid1 != fnodeid) { - rs.previous(); - break; - } - - //String tmpnodename = rs.getString("nodename"); - int tmpcurrid = rs.getInt("id"); - String tmpuserid = rs.getString("userid"); - String tmpisremark = Util.null2String(rs.getString("isremark")); - if (tmpisremark.equals("")) { - tmpisremark = Util.null2String(rs.getString("lastisremark")); - } - int tmpusertype = rs.getInt("usertype"); - String tmpagentorbyagentid = rs.getString("agentorbyagentid"); - int tmpagenttype = rs.getInt("agenttype"); - String tmpreceivedate = rs.getString("receivedate"); - String tmpreceivetime = rs.getString("receivetime"); - String tmpoperatedate = rs.getString("operatedate"); - String tmpoperatetime = rs.getString("operatetime"); - String viewtype = rs.getString("viewtype"); - String nodetype = rs.getString("nodetype"); - int preisremark = rs.getInt("preisremark"); - String processuser = rs.getString("processuser"); - boolean flags = false; - String tmpIntervel = ""; - // 如果tmpisremark=2 判断时候在日志表里有该人(确定是否是由非会签得到的isremark=2) - - String operator = rs.getString("operator"); - if (operator != null && !"".equals(operator)) { - flags = true; - } - if ((tmpisremark.equals("2") || (tmpisremark.equals("4") && preisremark == 11)) && tmpoperatedate != null && !tmpoperatedate.equals("")) { - tmpIntervel = TimeUtil.timeInterval2(tmpreceivedate + " " + tmpreceivetime, tmpoperatedate + " " + tmpoperatetime, user.getLanguage()); - } - islight = !islight; - Map _statusmap = new HashMap(); - // 操作人 - String _statususername = ""; - String _operatorid = ""; - String _beagentid = ""; - String _beagentname = ""; - String _operatortype = "0"; - if (tmpusertype == 0) { - _operatorid = tmpuserid; - _statususername = ServiceUtil.convertChar(resourceComInfo.getResourcename(tmpuserid)); - if (tmpagenttype == 2) { //代理情况 - _beagentid = tmpagentorbyagentid; - _beagentname = ServiceUtil.convertChar(resourceComInfo.getResourcename(tmpagentorbyagentid)); - } - _statusmap.put("operatorImg", resourceComInfo.getMessagerUrls(tmpuserid)); - _statusmap.put("operatorImgDefName", _statususername); - } else if (RobotNodeBiz.operatortype.equals(tmpusertype + "")) { - _statususername = Util.formatMultiLang(robotNodeServiceBiz.getRobotNodeSet(tmpnodeid1).getOperatorName()); - _operatorid = tmpuserid; - _operatortype = "2"; - } else { - _operatorid = tmpuserid; - _operatortype = "1"; - _statususername = ServiceUtil.convertChar(customerInfoComInfo.getCustomerInfoname(tmpuserid)); - } - - // 查看状态 1:未查看, 2::以查看, 3:已提交, 4:暂停, 5:撤销, 6:启用 7:已查阅 8:退回 9:被撤回 - int _statusCode = 0; - - if (preisremark != 8 && (tmpisremark.equals("2") || (tmpisremark.equals("4") && preisremark == 11)) && (flags || tmpuserid.equals(processuser))) { - _statusCode = 3; - submitCount++; - if ("4".equals(nodetype) && preisremark == 0) { - _statusCode = 7; - } - } else if (tmpisremark.equals("0") || tmpisremark.equals("1") || tmpisremark.equals("5") || tmpisremark.equals("4") || tmpisremark.equals("8") || tmpisremark.equals("9") || tmpisremark.equals("7") || tmpisremark.equals("11") || (tmpisremark.equals("2") && !flags)) { - if (viewtype.equals("-2") || (viewtype.equals("-1") && !tmpoperatedate.equals(""))) { - _statusCode = 2; - viewCount++; - } else { - _statusCode = 1; - noviewCount++; - } - } else if ("s".equals(tmpisremark)) { - _statusCode = 4; - } else if ("r".equals(tmpisremark)) { - _statusCode = 6; - } else if ("c".equals(tmpisremark)) { - _statusCode = 5; - } else if (preisremark == 8 && viewtype.equals("-2") && tmpisremark.equals("2")) { - _statusCode = 2; - viewCount++; - } - RecordSet recordSet = new RecordSet(); - recordSet.executeQuery("select operatetype from workflow_currentoperator where id=?", tmpcurrid); - if (recordSet.next()) { - int operatetype = recordSet.getInt(1); - if (operatetype == 3) {//退回 - _statusCode = 8; - } else if (operatetype == 4) {//被撤回 - _statusCode = 9; - } - } - - - listcount++; - if ("view".equals(desremark)) {//3:已查看 - if (processuser.equals(tmpuserid) && ("2".equals(tmpisremark) || "4".equals(tmpisremark))) { - listcount--; - } - } - String _receivedate = ""; - String _operatedate = ""; - String _intervel = ""; - - if (!tmpisremark.equals("s") && !tmpisremark.equals("c") && !tmpisremark.equals("r")) { - _receivedate = Util.toScreen(tmpreceivedate, user.getLanguage()) + " " + Util.toScreen(tmpreceivetime, user.getLanguage()); - } - _operatedate = Util.toScreen(tmpoperatedate, user.getLanguage()) + " " + Util.toScreen(tmpoperatetime, user.getLanguage()); - - _intervel = Util.toScreen(tmpIntervel, user.getLanguage()); - - _statusmap.put("statuscode", String.valueOf(_statusCode)); - _statusmap.put("operator", _statususername); - _statusmap.put("receivedate", _receivedate); - _statusmap.put("operatedate", _operatedate); - _statusmap.put("intervel", _intervel); - _statusmap.put("operatorid", _operatorid); - _statusmap.put("operatortype", _operatortype); - _statusmap.put("beagentid", _beagentid); - _statusmap.put("beagentname", _beagentname); - _statusmap.put("nodetype", nodetype); - - //所有节点 - nodeallstatuslist.add(_statusmap); - //查看状态 1:未查看, 2::以查看, 3:已提交, 4:暂停, 5:撤销, 6:启用 7:已查阅 - if ((tmpisremark.equals("2") || (tmpisremark.equals("4") && preisremark == 11)) && (flags || tmpuserid.equals(processuser))) { - nodesubmitstatuslist.add(_statusmap); - } else if (tmpisremark.equals("0") || tmpisremark.equals("1") || tmpisremark.equals("5") || tmpisremark.equals("4") || tmpisremark.equals("8") || tmpisremark.equals("9") || tmpisremark.equals("7") || tmpisremark.equals("11") || (tmpisremark.equals("2") && !flags)) { - if (viewtype.equals("-2") || (viewtype.equals("-1") && !tmpoperatedate.equals(""))) { - nodeviewstatuslist.add(_statusmap); - } else if (viewtype.equals("0")) { - nodenoviewstatuslist.add(_statusmap); - } - } - - if ((!tmpisremark.equals("2") && !tmpisremark.equals("4")) || (tmpisremark.equals("4") && viewtype.equals("0"))) { - if (!tmpisremark.equals("s") && !tmpisremark.equals("s") && !tmpisremark.equals("c") && !tmpisremark.equals("r")) { - nodenosubmitstatuslist.add(_statusmap); - } - } - } - //--已提交、已查看、未查看 - all_nodemap_in.put("submitCount", submitCount);//--已提交 - all_nodemap_in.put("viewCount", viewCount);//--已查看 - all_nodemap_in.put("noviewCount", noviewCount);//--未查看 - if ("submit".equals(desremark)) {//1:已提交 - //提交节点信息 - submit_nodemap_in.put("listcount", listcount); - result.putAll(submitstatusmap); - } else if ("nosubmit".equals(desremark)) {//2:未提交 - nosubmit_nodemap_in.put("listcount", listcount); - result.putAll(nosubmitstatusmap); - } else if ("view".equals(desremark)) {//3:已查看 - view_nodemap_in.put("listcount", listcount); - result.putAll(viewstatusmap); - } else if ("noview".equals(desremark)) {//4:未查看 - noview_nodemap_in.put("listcount", listcount); - result.putAll(noviewstatusmap); - } else { - //所有节点信息 - all_nodemap_in.put("listcount", listcount); - result.putAll(allstatusmap); - } - lastNodeId = fnodeid; - } -// if(maxid == currentMaxId){ -// isfinish = 1; -// } - putpara.put("nodeindex", index + ""); - putpara.put("currentMaxId", currentMaxId + ""); - putpara.put("currentMinId", currentMinId + ""); - putpara.put("currentId", currentId + "_" + currentId2); - putpara.put("lastNodeId", lastNodeId + ""); - putpara.put("viewlogids", viewlogids + ""); - result.put("parameter", putpara); - result.put("otherTime", new Date().getTime() - date1); - } catch (Exception e) { - e.printStackTrace(); - } - return result; - } - - - -%> - - diff --git a/interface/transfer/testError2.jsp b/interface/transfer/testError2.jsp deleted file mode 100644 index 6e1be93..0000000 --- a/interface/transfer/testError2.jsp +++ /dev/null @@ -1,99 +0,0 @@ - -<%@ page import="java.io.*" %> -<%@ page import="weaver.hrm.User" %> -<%@ page import="java.util.*" %> -<%@ page import="freemarker.template.Configuration" %> -<%@ page import="freemarker.template.TemplateExceptionHandler" %> -<%@ page import="freemarker.template.Template" %> -<%@ page import="java.nio.charset.StandardCharsets" %> - - -<% - String TemplatePath = "/opt/weaver/filesys/"; - //String TemplateName = "html模版.ftl"; - String TemplateName = "qwer.ftl"; - Map root = new HashMap<>(); - // root.put("title", "期末成绩表"); - - ArrayList list = new ArrayList<>(); - Map map = new HashMap<>(); - map.put("lastname",new User(22).getLastname() ); - map.put("subject", new User(22).getLastname() ); - map.put("achievement", "98"); - list.add(map); - Map map2 = new HashMap<>(); - map2.put("lastname", new User(22).getLastname() ); - map2.put("subject", new User(22).getLastname()); - map2.put("achievement", "97"); - list.add(map2); - list.add(map2); - list.add(map2); - list.add(map2); - list.add(map2); - - ArrayList lists = new ArrayList(); - root.put("achievementList", list); - lists.add(root); - lists.add(root); - lists.add(root); - - Map roots = new HashMap(); - System.out.println(lists.size()); - roots.put("testlist",lists); - //generate(TemplatePath, TemplateName, root, "shengcheng.html"); - generate(TemplatePath, TemplateName, roots, "shengcheng1.docx"); - -%> - -<%! - /** - * @param TemplatePath 模版存放目录 - * @param TemplateName 模版名 - * @param root 填充的数据 - * @param GenerateFilename 生成文件名 - * @throws Exception - */ - public static void generate(String TemplatePath, String TemplateName, Map root, String GenerateFilename) throws Exception { - Configuration cfg = new Configuration(); - //指定模板文件的来源目录 - cfg.setDirectoryForTemplateLoading(new File(TemplatePath)); - cfg.setDefaultEncoding("UTF-8"); - //设置错误的显示方式(日志) - //在生产系统中:TemplateExceptionHandler.RETHROW_HANDLER 默认值 - //在开发HTML模板期间:TemplateExceptionHandler.HTML_DEBUG_HANDLER - //在开发非HTML模板期间:TemplateExceptionHandler.DEBUG_HANDLER - cfg.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER); - cfg.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER); - - - //获取模板文件 - Template temp = cfg.getTemplate(TemplateName); - //合并模板和数据模型 - File file = new File(TemplatePath + "new-built"); - //如果文件夹不存在,则创建文件夹 - if (!file.exists()) { - //file.mkdirs();//多级目录 - file.mkdir();//只创建一级目录 - } - //Writer out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(TemplatePath + "new-built/" + GenerateFilename)));//输出文件 - // FileWriter out = new FileWriter(TemplatePath + "new-built/" + GenerateFilename); - //Writer out = new OutputStreamWriter(System.out);//输出控制台 - //StringWriter out = new StringWriter();//输出为字符串,可作为接口动态返回 - - - FileOutputStream fos = new FileOutputStream(TemplatePath + "new-built/" + GenerateFilename); - Writer out = new OutputStreamWriter(fos, StandardCharsets.UTF_8); - temp.process(root, out); - out.flush();//可不手动调用 - } - - public static String codeUtf8(String text) { - String ISOtext = null; - ISOtext = new String(text.getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1); - return new String(ISOtext.getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8); - - } - -%> - - diff --git a/interface/transfer/testError3.jsp b/interface/transfer/testError3.jsp deleted file mode 100644 index 70e1043..0000000 --- a/interface/transfer/testError3.jsp +++ /dev/null @@ -1,52 +0,0 @@ -<%@ page import="org.apache.poi.xwpf.usermodel.XWPFDocument" %> -<%@ page import="cn.afterturn.easypoi.word.WordExportUtil" %> -<%@ page import="java.nio.charset.StandardCharsets" %> -<%@ page import="java.io.*" %> -<%@ page import="weaver.hrm.User" %> -<%@ page import="com.engine.workflow.cmd.requestForm.StatusDataCmd" %> -<%@ page import="com.engine.core.interceptor.CommandContext" %> -<%@ page import="com.api.workflow.service.RequestAuthenticationService" %> -<%@ page import="java.util.*" %> -<%@ page import="weaver.conn.RecordSet" %> -<%@ page import="weaver.general.Util" %> -<%@ page import="com.alibaba.fastjson.JSON" %> -<%@ page import="weaver.workflow.monitor.Monitor" %> -<%@ page import="weaver.workflow.workflow.WorkflowConfigComInfo" %> -<%@ page import="weaver.hrm.resource.ResourceComInfo" %> -<%@ page import="weaver.crm.Maint.CustomerInfoComInfo" %> -<%@ page import="com.engine.workflow.biz.RobotNode.RobotNodeServiceBiz" %> -<%@ page import="weaver.general.TimeUtil" %> -<%@ page import="com.api.workflow.util.ServiceUtil" %> -<%@ page import="com.engine.workflow.biz.RobotNode.RobotNodeBiz" %> -<%@ page import="com.alibaba.fastjson.JSONObject" %> -<%@ page import="java.nio.charset.Charset" %> -<%@ page import="weaver.rtx.ChangeCharset" %> -<%@ page import="weaver.soa.workflow.request.RequestService" %> -<%@ page import="weaver.soa.workflow.request.RequestInfo" %> -<%@ page import="weaver.interfaces.workflow.action.WorkflowToDoc" %> -<%@ page import="weaver.workflow.request.RequestManager" %> -<%@ page import="com.engine.custom.archives.action.WorkflowToDocCus" %> -<%@ page import="okhttp3.*" %> -<%@ page import="weaver.docs.docs.DocRecycleManager" %> - - -<% - response.setCharacterEncoding("utf-8"); - String requestid = "607615"; - RequestService requestService = new RequestService(); - RequestInfo requestInfo = requestService.getRequest(Util.getIntValue(requestid), 100); - out.print(JSONObject.toJSONString(requestInfo)); -%> - -<%! - - public static void deleteDocByid(String docid){ - DocRecycleManager docRecycleManager=new DocRecycleManager(); - User user = new User(1); - docRecycleManager.moveDocToRecycle(user.getUID(), user.getLogintype(), Util.getIntValue(docid), "127.0.0.1"); - docRecycleManager.deleteDocFromRecycle(user.getUID(), user.getLogintype(), weaver.general.Util.getIntValue(docid), "127.0.0.1"); - } - -%> - - diff --git a/interface/transfer/testXML.jsp b/interface/transfer/testXML.jsp deleted file mode 100644 index 4a087c6..0000000 --- a/interface/transfer/testXML.jsp +++ /dev/null @@ -1,75 +0,0 @@ -<%@ page import="com.alibaba.fastjson.JSONObject" %> -<%@ page import="java.util.*" %> -<%@ page import="com.engine.common.util.ParamUtil" %> -<%@ page import="com.alibaba.fastjson.JSONArray" %> -<%@ page import="weaver.conn.RecordSet" %> -<%@ page import="java.sql.Array" %> -<%@ page import="com.wbi.util.Util" %> -<%@ page import="java.math.BigDecimal" %> -<%@ page import="tebie.applib.api.O" %> -<%@ page import="weaver.general.BaseBean" %> -<%@ page import="javax.xml.parsers.SAXParserFactory" %> -<%@ page import="javax.xml.parsers.SAXParser" %> -<%@ page import="java.io.InputStream" %> -<%@ page import="java.io.ByteArrayInputStream" %> -<%@ page import="com.engine.util.XMLUtils" %> -<%@ page import="org.xml.sax.helpers.DefaultHandler" %> -<%@ page import="org.xml.sax.Attributes" %> -<%@ page import="org.xml.sax.SAXException" %> -<%@ page language="java" contentType="text/html; charset=UTF-8" %> - - -<% - - -%> -<%! - public static Map parseXMLToMap(String xmlString) { - new BaseBean().writeLog("XMLUtils:xmlString==>"+xmlString); - Map resultMap = new HashMap<>(); - try { - SAXParserFactory factory = SAXParserFactory.newInstance(); - SAXParser saxParser = factory.newSAXParser(); - - InputStream xmlInput = new ByteArrayInputStream(xmlString.getBytes("UTF-8")); - saxParser.parse(xmlInput, new XMLUtils.SAXHandler(resultMap)); - } catch (Exception e) { - e.printStackTrace(); - } - return resultMap; - } - - - private static class SAXHandler extends DefaultHandler { - private Map resultMap; - private Stack elementStack = new Stack<>(); - private StringBuilder elementValue = new StringBuilder(); - - public SAXHandler(Map resultMap) { - this.resultMap = resultMap; - } - - @Override - public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { - elementStack.push(qName); - elementValue.setLength(0); // 清空字符缓存 - } - - @Override - public void endElement(String uri, String localName, String qName) throws SAXException { - String value = elementValue.toString().trim(); - if (!value.isEmpty()) { - // 如果当前元素有值且没有子元素,则将其添加到结果Map中 - if (elementStack.size() > 1) { - resultMap.put(elementStack.peek(), value); - } - } - elementStack.pop(); - } - - @Override - public void characters(char[] ch, int start, int length) throws SAXException { - elementValue.append(ch, start, length); - } - } -%> \ No newline at end of file diff --git a/interface/transfer/最终测试一下1106.html b/interface/transfer/最终测试一下1106.html deleted file mode 100644 index 2ef0ce8..0000000 --- a/interface/transfer/最终测试一下1106.html +++ /dev/null @@ -1,2580 +0,0 @@ - - - - - - - - - - - - - -

- - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - 天津银行总行 
收文阅办单
- -
-
- -
- - - 标题 - -
-
- -
- - - 最终测试一下1106 - -
-
- -
- - - 来文单位 - -
-
- -
- - - -市委组织部 - - - - - - - -
-
- -
- - - 收文号 - -
-
- -
- - - 2023-S139号 - -
-
- -
- - - 来文号 - -
-
- -
- - - - -
-
- -
- - - 反馈时限 - -
-
- -
- - - - -
-
- -
- - - 分发意见 - -
-
- -
- - - - - - - - - -
-
- 办公室/ - 测试-杨芳_10110033[ - 2023-11-06  - 14:16:33]: - 测试_10110013、个人金融部、信用卡部、测试_10110223、信息技术部  - -
23
-
-
- -
- - - 行外收文 - -
-
- -
- - - 正文 - -
-
- -
- - - - -
-
- -
- - - 正文 - -
-
- -
- - - - -
-
- -
- - - 附件 - -
-
- -
- - - -
- -
-
- -
- - - 备注 - -
-
- -
- - - - -
-
- -
- - - 行领导意见 - -
-
- -
- - - - - - - - - - - -
-
- 行领导/ - 测试_10110013[ - 2023-11-06  - 14:18:30]: - 行领导阅批  - -
22
- - - - - - - - - - -
-
- 行领导/ - 测试_10110223[ - 2023-11-06  - 14:18:01]: - 行领导阅知  - -
22
- - -
-
- -
- - - 主办部门办理意见 - -
-
- -
- - - - - - - - - - - -
-
- 个人金融部/ - 测试_10110141[ - 2023-11-06  - 15:13:31]: - 阅办——部门领导2  - -
30
-
- 信用卡部/ - 测试_10110152[ - 2023-11-06  - 14:21:08]: - 阅办——部门领导1  - -
31
- - - - - - - - - - - - - - -
-
- 个人金融部/ - 测试_10111252[ - 2023-11-07  - 11:15:40]: - 阅办——员工6  - -
30
-
- 个人金融部/ - 测试_10110145[ - 2023-11-07  - 10:50:31]: - 阅办——员工3  - -
30
-
- 信用卡部/ - 测试_10110160[ - 2023-11-06  - 15:04:50]: - 阅办——又回到员工2  - -
31
-
- 信用卡部/ - 测试_10110155[ - 2023-11-06  - 14:48:50]: - 阅办——又回到员工1  - -
31
- - -
-
- -
- - - 协办部门办理意见 - -
-
- -
- - - - - - - - - - - -
-
- 安全保卫部(人民武装部)/ - 测试_10111050[ - 2023-11-07  - 10:58:21]: - 部门协办——领导6  - -
50
-
- 综合管理团队/ - 测试_10110772[ - 2023-11-07  - 10:56:04]: - 部门协办——领导5  - -
3490
-
- 授信管理部/ - 测试_10110277[ - 2023-11-06  - 14:56:41]: - 部门协办——领导4
 
- -
36
-
- 资产保全部/ - 测试_10110308[ - 2023-11-06  - 14:54:13]: - 部门协办——领导3  - -
37
-
- 法律事务部/ - 测试_10110349[ - 2023-11-06  - 14:46:03]: - 部门协办——领导2  - -
38
-
- 运营管理部/ - 测试_10110396[ - 2023-11-06  - 14:43:47]: - 部门协办——领导1  - -
42
- - - - - - - - - - - - - - -
-
- 安全保卫部(人民武装部)/ - 测试_10111050[ - 2023-11-07  - 10:59:00]: - 部门协办——员工6  - -
50
-
- 综合管理团队/ - 测试_10110772[ - 2023-11-07  - 10:56:46]: - 部门协办——员工5  - -
3490
-
- 授信管理部/ - 测试_10110277[ - 2023-11-06  - 14:58:08]: - 部门协办——员工4  - -
36
-
- 资产保全部/ - 测试_10110308[ - 2023-11-06  - 14:54:56]: - 部门协办——员工3  - -
37
-
- 法律事务部/ - 测试_10110349[ - 2023-11-06  - 14:46:31]: - 部门协办-员工办理2  - -
38
-
- 运营管理部/ - 测试_10110396[ - 2023-11-06  - 14:44:25]: - 部门协办-员工办理1  - -
42
- - -
-
- -
- - - 阅件部门办理意见 - -
-
- -
- - - - - - - - - - - -
-
- 信息技术部/ - 测试_10110632[ - 2023-11-06  - 14:19:16]: - 阅知——部门领导  - -
48
- - - - - - - - - - - - - - -
-
- 信息技术部/ - 测试_10110632[ - 2023-11-06  - 14:19:47]: - 阅知——员工办理  - -
48
- - -
-
- -
- - - 矩阵 - -
-
- -
- - - - -
-
- -
- - - 阅办负责人 - -
-
- -
- - - 魏来 - -
-
- -
- - - 抄送人员 - -
-
- - -
- -
- - - 当前部门 - -
-
- -
- - - - -
-
- -
- - - 测试_10110223 - -
-
- -
- - - 是否屏蔽移动端 - -
-
- -
- - - - -
-
- -
- - - 办理期限 - -
-
- -
- - - 2023-12-11 - -
-
-
- -
- -
-
-
- -
-
-
-
- - - - - - - -
- -
-
-
-
-
-
-

接收人 : 测试_10110141

-

2023-11-07 11:29:53[综合文员 / 提交]

-
-
-
- - - - - - - -
-
- - -
-
-
- 自动流转至下一操作者 -
-
-
-
-

接收人 : 测试_10110141

-

2023-11-07 11:15:41[员工办理 / 提交]

-
-
-
- - - - - - - -
- -
-
-
-
-
-
-

接收人 : 测试_fenfa

-

2023-11-06 15:13:51[综合文员 / 提交]

-
-
-
- - - - - - - -
- -
-
- 阅办——部门领导2 -
-
-
-
-

接收人 : 测试_10110141

-

2023-11-06 15:13:31[部门领导批示 / 提交]

-
-
-
- - - - - - - -
- -
-
-
-
-
-
-

接收人 : 测试_10110141

-

2023-11-06 15:13:07[部门文员办理 / 提交]

-
-
-
- - - - - - - -
-
- - -
-
-
- 自动流转至下一操作者 -
-
-
-
-

接收人 : 测试_10110152

-

2023-11-06 15:04:50[员工办理 / 提交]

-
-
-
- - - - - - - -
- -
-
-
-
-
-
-

接收人 : 测试_fenfa

-

2023-11-06 14:31:06[综合文员 / 提交]

-
-
-
- - - - - - - -
- -
-
- 阅办——部门领导1 -
-
-
-
-

接收人 : 测试_10110152

-

2023-11-06 14:21:08[部门领导批示 / 提交]

-
-
-
- - - - - - - -
- -
-
-
-
-
-
-

接收人 : 测试_10110152

-

2023-11-06 14:20:46[部门文员办理 / 提交]

-
-
-
- - - - - - - -
- -
-
-
-
-
-
-

接收人 : 测试_10110632

-

2023-11-06 14:20:06[综合文员 / 提交]

-
-
-
- - - - - - - -
- -
-
- 阅知——员工办理 -
-
-
-
-

接收人 : 测试_10110632

-

2023-11-06 14:19:47[员工办理 / 提交]

-
-
-
- - - - - - - -
- -
-
-
-
-
-
-

接收人 : 测试_10110632

-

2023-11-06 14:19:32[综合文员 / 提交]

-
-
-
- - - - - - - -
- -
-
- 阅知——部门领导 -
-
-
-
-

接收人 : 测试_10110632

-

2023-11-06 14:19:16[部门领导批示 / 提交]

-
-
-
- - - - - - - -
- -
-
-
-
-
-
-

接收人 : 测试_10110632

-

2023-11-06 14:19:00[部门文员办理 / 提交]

-
-
-
- - - - - - - -
- -
-
- 行领导阅批 -
-
-
-
-

接收人 : 测试_10110013

-

2023-11-06 14:18:30[行领导 / 提交]

-
-
-
- - - - - - - -
- -
-
- 行领导阅知 -
-
-
-
-

接收人 : 测试_10110223

-

2023-11-06 14:18:01[行领导 / 提交]

-
-
-
- - - - - - - -
- -
-
-
-
-
-
-

接收人 : 测试_10110223

-

2023-11-06 14:16:35[自动发起 / 提交]

-
-
-
- - - - - - - -
- -
-
-
-
-
-
-

接收人 : 测试_10110632

-

2023-11-06 14:16:35[自动发起 / 提交]

-
-
-
- - - - - - - -
- -
-
-
-
-
-
-

接收人 : 测试_10110013

-

2023-11-06 14:16:34[自动发起 / 提交]

-
-
-
- - - - - - - -
- -
-
-
-
-
-
-

接收人 : 测试_10110152

-

2023-11-06 14:16:34[自动发起 / 提交]

-
-
-
- - - - - - - -
- -
-
-
-
-
-
-

接收人 : 测试_10110141

-

2023-11-06 14:16:33[自动发起 / 提交]

-
-
-
-
- - - - - - - \ No newline at end of file diff --git a/opt/weaver/ecology/interface/transfer/transfer.zip b/opt/weaver/ecology/interface/transfer/transfer.zip deleted file mode 100644 index 42bc3544a184021a818cf1a4ca34646f44f7338d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4422 zcmZ|TcQhQ_wg7NtbR!Z(H;5Y1%ODa)4WpN6AEPs(3_`RZdUS@tXc4_eOGFoal;}00 zj+P-x1W{k|-hJ=g@2-2#S?la|&e?14e}8N1LJ0x1czAfEcwuHpV_)T_8WK`GJXuCO zJeuFH&)x0ZwY^vX=~nra0`0Z%8I`TVz&CWA&xmTRwehY=(xP1} zvz96Hb#wF^oBo)#Pzzd$Xp2Mp;d1xY%;7?unJ9gmxTChbqeDB^xxn#lwP;-Op3hZC z1JUFQ?p@#)Hq;7T-8C=^lVeQ3!DOW1UGQ27*kQz)8CUQ}GA7YMO?>p8cL8?8x zvijn(+{K>h6cYWKuh1}`<941$Oqq*C4Xu=sf@2wmha55YvyB?OJz)b{=>1T>5WQ!^ z5Gsc92sOs%=8F6>Vp0(W=&~nBJ308w1S@~jCk)9oUbBjFT^q^g^#t`5Cj)755rCE~ z4r&NoEBgWE+6I87aMysiZj_vIbeF63$BZyqKA`DsDIw8H(xKcg*PSZ$u6N2%C9QSV zo(@{uXX3(ze3Vbyy0d{)ngI9y?v9z!3}dwAcef={rKJyPuj;4N_L^4^-047xyY@Na zQn&#~)5b#Y)G#~m);v}27NruVT)P;aySsw+ND!BLn;a=1y>|vsjMPLrUJR=A`$VCJ-c}7P2X6*l-}z zqY0ZDGInY^@IiZ{9Jvw_>J?w}!#=I!vv-d(3aw}gmDJ%dkGSB+OvG7KhbcHZU04Pb zywMm`#kU?k7PKN(^u)T-I&913QF{bg{<@vq{3b0r)%{26NYjx|i(s4}!@6baFg>rW zp5%FLQOdO;OWlpT9M;csRAAk$X&v6zq9V<=5HO_1RAx*GNWW9UzKh@q=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|+}u(ij?l5B;BLvV=_4Z0=3F?-`2vg^XwR K9iLJEx&0S4RVy+8 diff --git a/opt/weaver/ecology/interface/transfer/x2.zip b/opt/weaver/ecology/interface/transfer/x2.zip deleted file mode 100644 index b2ea963406f9c486258adf25751500fd85fea7b0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1357 zcmV-T1+w~3O9KQH0000809R0bS1aEX)w=`$00$TV00sa60C+MkYIAViSj&#nFcjS* z@ejrlB4r@F79c^(Yj{6qpamp^gxut|_24=g$C+V-kYIt>BP2G64FVw{J^&>68(x3G zO`J#5N!m{d+n1OAKQ6?_^c0v4}DMRCS3=%2Fi9kDeddvc*<>qretSp z`?l!6$$o{cF+0>;*e8`@8<%;ISXVLkL4sn!zJZv?aw6vy=1;Xb&w@d1 zncZW7UI{#DUu-X3UFxoYqbH!a({*g-bDK*IN-}{B<_y3dXzkl*DKJXjJq~ue-ilAL z08RmuW7dMneuxidO_Vqu`jfh|;bWJE`+DC%55-a9444W)H*a*#?maS^k?q?E{@Pk` z*(cm3O`>2mgg~Qbz04FF0xrO!+@+19#(3X8;)UAw5uz>brrlWzk6}QM8OA*cbE`!H zFH{b2H;7EojfC|n5G!TQwh~dvQ$moBWVUIXNH=*fmRWylm{ZwsADmFbwGh;XMFS9+ zS|XgTCOzd1N!Yu4`gD7Fv2&ZO4?uy5(s8;cUpki&0DJeR9X(>@4kX;i2{s7&0!oYm$*e z@4EUx;?i-t{S_e`lNRALvMdxsdKy=+1FJ!rn5i@!$(*KchjIVtb#-;jXHGYs{CspI zE!ooop_eaQIzx8Rg(#UjchTH_Q)*1R9(F8AadSHIAsPY6<5RVod^e;yYLe1D9FOJ# zQX}VabT;xL##?h_J)DTzA)Qr;de37!yMTqH1OFHTkjAhQW>%%99H#;%ahbqo! zWt`E53z)2NdCU`c)lpBz^SDnwE5uVHN|pw~kQ75v{|q5#qIGpSE6-NWST2TB*&kMG zed-`l{M4dqla>bR(4m8e4jmqGn!PLSb;UJY_An(WOS9Q*(S@{C`SQ$m)^4+<9L%hL z7Y($4A;^xx9kireP*^lAWK%S+tV#Q6RE6SNZF8M~JJmNY`OKm85dFYhKvY{o~~jEX4PXKfj25VB;54- zsG$T z#FiZta5YxY)=YCx&K9Q(JarwjxJjUuPKx!u&0N<)w^U2}Z>Ihjbz?yKDe2PxRKsV*Z6kTO)8D1;-ib&aKdhcj}zPBIce^EV7R! zA+7wb*4AFsNE{S+8s;;^+^g;|BuKD^!A?$m;V>j!8rzvzjNZCMcVX#=ReBdlm#B@` zs!Rk{j5EOeXHZ|Ce)|6AUExcRL{~9};$$6)Z_ht||L~=X;(8s5pN}4m&tmjm0k?}J zK_2p*tzS?}0Rle&6aWAK2mn`5eOD{r6xF)~000LV000I6Bme*a00000AOHXW00000 zcrq?(b8rd(AOHXW000317yxvw?<8m<+5rFn000000000000000002-+1qJ{B00031 P0RUJ4007?v00000!}MeB diff --git a/opt/weaver/ecology/interface/transfer/x6.jsp b/opt/weaver/ecology/interface/transfer/x6.jsp new file mode 100644 index 0000000..dccba35 --- /dev/null +++ b/opt/weaver/ecology/interface/transfer/x6.jsp @@ -0,0 +1,21 @@ + +<%@ page import="weaver.conn.RecordSetDataSource" %> +<%@ page import="java.time.LocalDateTime" %> +<%@ page import="java.time.format.DateTimeFormatter" %> +<%@ page import="com.engine.custom.corn.util.ReportUtil" %> +<%@ page import="weaver.conn.RecordSet" %> +<%@ page import="org.slf4j.Logger" %> +<%@ page import="org.slf4j.LoggerFactory" %> +<%@ page language="java" contentType="text/html; charset=UTF-8" %> + + +<% + + out.print("11111111"); + Logger log = LoggerFactory.getLogger("Archives"); + log.error("111111111111111"); + out.print("2222222222"); +%> +<%! + +%> \ No newline at end of file diff --git a/produce/23/transfer/SJWfToMode.jsp b/produce/23/transfer/SJWfToMode.jsp new file mode 100644 index 0000000..7a9bbfa --- /dev/null +++ b/produce/23/transfer/SJWfToMode.jsp @@ -0,0 +1,176 @@ + +<%@ page import="weaver.file.Prop" %> +<%@ page import="com.engine.custom.sl.entity.EsbRequestHeader" %> +<%@ page import="java.text.SimpleDateFormat" %> +<%@ page import="com.engine.custom.sl.entity.TravelToEsbBean" %> +<%@ page import="java.nio.charset.StandardCharsets" %> +<%@ page import="com.engine.util.SocketClientUtil" %> +<%@ page import="com.engine.util.XMLUtils" %> +<%@ page import="com.alibaba.fastjson.JSONObject" %> +<%@ page import="com.engine.common.util.ParamUtil" %> +<%@ page import="weaver.hrm.HrmUserVarify" %> +<%@ page import="weaver.hrm.User" %> +<%@ page import="weaver.conn.RecordSet" %> +<%@ page import="weaver.soa.workflow.request.RequestInfo" %> +<%@ page import="weaver.hrm.company.DepartmentComInfo" %> +<%@ page import="weaver.general.Util" %> +<%@ page import="weaver.interfaces.workflow.action.Action" %> +<%@ page import="java.util.*" %> +<%@ page language="java" contentType="text/html; charset=UTF-8" %> + + +<% + // out.print(Prop.getPropValue("qwe","host")); + User user = HrmUserVarify.getUser(request, response); + if (user == null){ + out.print("暂无权限"); + } + if (!(1 == (user.getUID()))){ + out.print("暂无权限"); + return; + } + Map param = ParamUtil.request2Map(request); + String sql = "select main.*, base.REQUESTNAME from formtable_main_11 main " + + "left join uf_tosjLog log on log.REQUEST = main.REQUESTID " + + "left join WORKFLOW_REQUESTBASE base on base.REQUESTID = main.REQUESTID " + + " where log.ID is null "; + RecordSet recordSet = new RecordSet(); + RecordSet rs = new RecordSet(); + recordSet.executeQuery(sql); + StringBuilder execute = new StringBuilder(); + int i = 0; + while (recordSet.next()){ + String result = this.execute(recordSet, rs); + execute.append(result).append("\n"); + i++; + } + out.print("共添加"+i+"条" +"\n"); + out.print(execute.toString()); +%> +<%! + public static String generateTimestamp() { + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss"); + Date currentDate = new Date(); + return dateFormat.format(currentDate); + } + public String execute(RecordSet recordSet, RecordSet rs) { + + try { + String insertsql = "INSERT INTO uf_tosjLog(REQUEST, CONTENT, ZT, ML, DDSJ, TSSJ, FJML, ZWID, FJID) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ? )"; + + DepartmentComInfo departmentComInfo = new DepartmentComInfo(); + //公文标题 + String requestname = recordSet.getString("REQUESTNAME"); + String requestId = recordSet.getString("REQUESTID"); + // String requestId = request.getRequestid(); + // // 4:获取表单名称 + // String tablename = request.getRequestManager().getBillTableName(); + + // 5:查找表单内容 + // RecordSet rs = new RecordSet(); + // rs.execute("select * from " + tablename + " where requestid = " + requestId); + // rs.next(); + //是否推送合规 0 - 否 1 - 是 + // int isTohg = Util.getIntValue(rs.getString("tohg"), 1); + // if (isTohg == 0){ + // return Action.SUCCESS; + // } + //id:表单主键 + String mainid = recordSet.getString("id"); + + //公文编号 + String fwwh = recordSet.getString("bh"); + //发文部门名称 + String ngbm = recordSet.getString("ngbm"); + //成文时间 + String cwrq = recordSet.getString("cwrq"); + String ngr = recordSet.getString("ngr"); + // String zw = rs.getString("zw"); //word格式 + //生成的pdf + String zw = recordSet.getString("dwd"); + String fj = recordSet.getString("fj"); + User user = new User(Integer.parseInt(ngr)); + //拼接数据 + String subcompanyid = departmentComInfo.getSubcompanyid1(ngbm); + String departmentNames = departmentComInfo.getAllParentDepartmentBlankNames(ngbm, subcompanyid, "-"); + departmentNames = "天津银行股份有限公司-"+departmentNames; + String context = ""; + String flag = "|"; + // context = requestname + flag + fwwh + flag +departmentNames + flag + cwrq +flag+ user.getLoginid()+flag+user.getLastname()+flag; + context = fwwh + flag + departmentNames + flag + cwrq + flag + user.getLastname(); + //获取文件命 + Map fjName = getIdIMIDName(fj); + Map zwName = getIdIMIDName(zw); + String fjStr = ""; + String zwStr = ""; + //附件 + ArrayList fileNameList = new ArrayList<>(); + Set> entries = fjName.entrySet(); + for (Map.Entry entry : entries) { + String filename = entry.getValue(); + if (fileNameList.contains(filename)){ + String tepName= filename.contains(".")? filename.substring(0, filename.indexOf(".")) : ""; + if(tepName!=null&&!"".equals(tepName)){ + String extNameTemp = filename.contains(".")? filename.substring(filename.lastIndexOf(".") + 1) : ""; + filename = tepName + "_"+entry.getKey()+"."+extNameTemp; + + } + }else { + fileNameList.add(filename); + } + fjStr = fjStr + "&&"+ filename; + } + if (fjStr.startsWith("&&")){ + fjStr = fjStr.substring(2); + } + fileNameList.clear(); + //正文 + Set> zwEntries = zwName.entrySet(); + for (Map.Entry entry : zwEntries) { + String filename = entry.getValue(); + if (fileNameList.contains(filename)){ + String tepName= filename.contains(".")? filename.substring(0, filename.indexOf(".")) : ""; + if(tepName!=null&&!"".equals(tepName)){ + String extNameTemp = filename.contains(".")? filename.substring(filename.lastIndexOf(".") + 1) : ""; + filename = tepName + "_"+entry.getKey()+"."+extNameTemp; + } + }else { + fileNameList.add(filename); + } + zwStr = zwStr + "&&" + filename; + } + if (zwStr.startsWith("&&")){ + zwStr = zwStr.substring(2); + } + context = zwStr+flag+fjStr+flag+context+flag+"sj"+requestId+flag; + Date date = new Date(); + String time = new SimpleDateFormat("yyyy-MM-dd hh:mm").format(date); + rs.executeUpdate(insertsql,requestId,context,0,null,time,null,null,zw,fj); + return insertsql + "?"+ requestId + "|"+context + "|"+0 + "|"+null + "|"+time + "|"+null + "|"+null + "|"+zw + "|"+fj; + } catch (Exception e) { + // writeLog(e.getMessage()+ "||||||异常流程id==="+request.getRequestid()); + e.printStackTrace(); + //不管是否推送成功,都返回成功,不影响流程流转 + return "error"; + } + // boolean error = false; + // if (error) { + // request.getRequestManager().setMessageid("90001"); + // request.getRequestManager().setMessagecontent("System Abnormal Termination Process Submission!"); + // } + // return Action.SUCCESS; + } + + public static Map getIdIMIDName(String ids ){ + Map idimageIDMap = new HashMap<>(); + String sql = "select docid,df.imagefilename filename from docimagefile df left join imagefile imf on df.imagefileid = imf.imagefileid where DOCID in ("+ids+")"; + RecordSet recordSet = new RecordSet(); + recordSet.execute(sql); + while (recordSet.next()){ + String docid = Util.null2String(recordSet.getString("docid")); + String filename = Util.null2String(recordSet.getString("filename")); + idimageIDMap.put(docid,filename); + } + return idimageIDMap; + }; +%> \ No newline at end of file diff --git a/produce/23/transfer/WfToSJ.jsp b/produce/23/transfer/WfToSJ.jsp new file mode 100644 index 0000000..37f1bac --- /dev/null +++ b/produce/23/transfer/WfToSJ.jsp @@ -0,0 +1,69 @@ + + +<%@ page import="java.text.SimpleDateFormat" %> + +<%@ page import="java.util.*" %> +<%@ page import="org.slf4j.Logger" %> +<%@ page import="org.slf4j.LoggerFactory" %> +<%@ page import="com.engine.custom.audit.service.PushAuditService" %> +<%@ page import="com.engine.custom.hg.entity.HGBean" %> +<%@ page import="weaver.conn.RecordSet" %> +<%@ page import="weaver.general.Util" %> +<%@ page import="com.alibaba.fastjson.JSONObject" %> +<%@ page language="java" contentType="text/html; charset=UTF-8" %> + + +<% + // String getrqBydatesql = "select * from uf_tosjLog where ddsj > ? and ddsj < ? "; + // out.print("获取推送审计系统数据start"); + // RecordSet recordSet = new RecordSet(); + // recordSet.executeQuery(getrqBydatesql , "2024-04-23 00:00" ,"2024-04-23 24:00"); + // // out.print("getrqBydatesql=="+getrqBydatesql + startTime + endTime); + // ArrayList hgBeans = new ArrayList<>(); + // while (recordSet.next()){ + // HGBean hgBean = new HGBean(); + // hgBean.setId(Util.getIntValue(recordSet.getString("id"))); + // hgBean.setRequestId(Util.getIntValue(recordSet.getString("request"))); + // hgBean.setContent(Util.null2String(recordSet.getString("content"))); + // hgBean.setZt(Util.getIntValue(recordSet.getString("zt"))); + // hgBean.setDdsj(Util.null2String(recordSet.getString("ddsj"))); + // hgBean.setTssj(Util.null2String(recordSet.getString("tssj"))); + // hgBean.setZwid(Util.null2String(recordSet.getString("zwid"))); + // hgBean.setFjid(Util.null2String(recordSet.getString("fjid"))); + // String ml = Util.null2String(recordSet.getString("ml")); + // hgBean.setMl(Arrays.asList(ml.split(","))); + // String fjml = Util.null2String(recordSet.getString("fjml")); + // hgBean.setMl(Arrays.asList(fjml.split(","))); + // hgBeans.add(hgBean); + // out.print("isEnd="+isEnd(hgBean.getRequestId()+"")); + // } + // out.print("数据条数="+hgBeans.size()); + // out.print(JSONObject.toJSONString(hgBeans)); + String sql = "select CURRENTNODETYPE,CURRENTNODEID from WORKFLOW_REQUESTBASE where requestid = ?"; + RecordSet recordSet = new RecordSet(); + recordSet.executeQuery(sql,"331361"); + String CURRENTNODETYPE = ""; + String CURRENTNODEID = ""; + out.print(recordSet.getCounts()); + if(recordSet.next()){ + CURRENTNODETYPE = recordSet.getString("CURRENTNODETYPE"); + CURRENTNODEID = recordSet.getString("CURRENTNODEID"); + } + out.print(CURRENTNODETYPE); + +%> +<%! + public static String isEnd(String requestid ){ + String sql = "select CURRENTNODETYPE,CURRENTNODEID from WORKFLOW_REQUESTBASE where requestid = ?"; + RecordSet recordSet = new RecordSet(); + recordSet.execute(sql,requestid); + String CURRENTNODETYPE = ""; + String CURRENTNODEID = ""; + if(recordSet.next()){ + CURRENTNODETYPE = recordSet.getString("CURRENTNODETYPE"); + CURRENTNODEID = recordSet.getString("CURRENTNODEID"); + } + return CURRENTNODETYPE; + }; + +%> \ No newline at end of file diff --git a/produce/23/transfer/mobile/ssoUrl.zip b/produce/23/transfer/mobile/ssoUrl.zip new file mode 100644 index 0000000000000000000000000000000000000000..a4c59a6806ab62a738b8c617854c3d1e10526c71 GIT binary patch literal 7547 zcmZ{JRZtuZ(Bv+grx@ zrfRynYu;d)V!*|BXh0027)06_gu_3&`fc6a2k_i#NUcko!1 zxfJ1fK`zX~M`%qB9RqN8I@GS7^6WNoalBvy3BC9>AoK>R%MtWAM9p4}#z z%^&$jWWo42Y-)DFeq?oY8nF~&Mt0=c-Ttk;y}P};{QRg}#X--b?O;;Ch?D6Mt<7s0 zHrZrYpPlNxa>t_SUEmPdZsaRl-sR!F4y*auIdgp$*ru&p9r)4Jp4>it-FLo9h`!n? zt2v!gbf??vX1emqe^e=HdB4E0qBqZm9j5@HLB3`v{ix%B@5oBG*Y~Et#lI*$p1$D& zya#HmJ*-9aa?4n?3Ov2H*M!CNfT#9k7|p2ig8z(K%aziR){ zTU}5v@VQ@w+`z3@Xx?6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=o$W$qNJ=5oWV70hoz z=tTJNUi9MuRRBFsA(0s~IWsYF`T`xDc`TOthcZveFs8*v8OA@}T#}pTpusSdL1SbjVQLW<(AMX&fo!B3dPWH@_vhDke$jR#BB=Q`mOCM)2rTUE ztRmek>WgHoqkO5>A?wC$yMyj#U+>{T*~v3(BU;J%aJ9X<-p6v2gQ-(|Q@5w@qRco@ zAfc!zusF~^E^x#+&_C)4X6&N#Swv5uZt7Hq;eITJdB^|mv{6EHpH7j4;E?g{i};fx zK>^iMGo9T1P8gb8oojbm^173kxdwh*H{nVa4GGDYl$6Z+?jK=~0V!Kbv4WI?1edA} z1{N_%RdBZ#*cn_`9ppQgD38yT)Vyo)Av2J0jBTx-%ifZo`m~R5xuYP3NGUY5QX`dk zuG_-B6O{qt)Y&!*SESMVf0X~TF-oU!LMqaF9IRWq#sVy+^~N# zgKb2QP>T{)5wiv6rq(HNjidD5nD#et6}wznM9-SRo}CDd%6szITso~{;n<&aT3J*b zcU^Entz1ys$jf@V!gQOwvtRszqY!sk z&ZeY|FXa!j`<0Chiys=iqk~nE04_HzP6SRncE};~RzoXb=pCi=eJWz@7i7IT@U7YE z%S!9&;jitJm8vDV_4Y7wCGdq=!RBUq#{GlOZauYTK>@OB4&!^Y*D_7%6MKnjp6K8_ zrMeOjP6F`%i$dxC3q${>sQ&l-e}hrf|Dyo`L;z-FKz(f_6!?FZ{x7I2AtL<`0shxU L{~-$b|FHiBbkuTV literal 0 HcmV?d00001 diff --git a/produce/23/transfer/workflowtest.jsp b/produce/23/transfer/workflowtest.jsp new file mode 100644 index 0000000..7c4fad5 --- /dev/null +++ b/produce/23/transfer/workflowtest.jsp @@ -0,0 +1,16 @@ +<%@ page import="weaver.conn.RecordSet" %> +<%@ page import="weaver.general.Util" %> +<%@ page import="java.util.*" %> +<%@ page import="com.alibaba.fastjson.JSONObject" %> +<%@ page import="weaver.workflow.workflow.WorkflowBillComInfo" %> +<%@ page language="java" contentType="text/html; charset=UTF-8" %> + + +<% + WorkflowBillComInfo wcInfo = new WorkflowBillComInfo(); + String createpage = wcInfo.getCreatepage("319334"); + out.print(createpage); +%> +<%! + +%> \ No newline at end of file diff --git a/weaver/filter/LoginEMFilter.java b/weaver/filter/LoginEMFilter.java index 32cc85f..dfbd912 100644 --- a/weaver/filter/LoginEMFilter.java +++ b/weaver/filter/LoginEMFilter.java @@ -30,7 +30,7 @@ public class LoginEMFilter implements Filter { StringBuffer url = request.getRequestURL(); new BaseBean().writeLog("请求地址====>getRequestURL" + url); //内网请求 - if(url.indexOf("14.1.209.146:8080") == -1){ + if(url.indexOf("14.1.") == -1){ // String currentDateTime = request.getHeader("currentDateTime"); // String MdToken = request.getHeader("MdToken"); String currentDateTime = getCookie(request,"currentDateTime"); @@ -109,8 +109,9 @@ public class LoginEMFilter implements Filter { Date currentDate = new Date(); long difference = currentDate.getTime() - parsedDate.getTime(); - - if (difference > 5 * 60 * 1000) { // 10分钟 = 10 * 60 * 1000 毫秒 + // System.out.println(difference); + // 10分钟 = 10 * 60 * 1000 毫秒 + if ( Math.abs(difference) > 5 * 60 * 1000) { return true; } else { return false; @@ -143,9 +144,13 @@ public class LoginEMFilter implements Filter { public static void main(String[] args) { - String originalString = "tq33q#LzDw$98HwEA@"; - String md5String = toMD5(originalString); - System.out.println("Original: " + originalString); - System.out.println("MD5 Hash: " + md5String); + // String originalString = "tq33q#LzDw$98HwEA@"; + // String md5String = toMD5(originalString); + // System.out.println("Original: " + originalString); + // System.out.println("MD5 Hash: " + md5String); + System.out.println(DateExample("20240613071112")); + ; } } + + diff --git a/weaver/interfaces/workflow/action/javacode/Action20231113045722.java b/weaver/interfaces/workflow/action/javacode/Action20231113045722.java index 64cbdc2..1999419 100644 --- a/weaver/interfaces/workflow/action/javacode/Action20231113045722.java +++ b/weaver/interfaces/workflow/action/javacode/Action20231113045722.java @@ -12,6 +12,7 @@ import weaver.soa.workflow.request.RequestInfo; import java.io.IOException; import java.util.HashSet; import java.util.Set; +import java.util.TreeSet; /** * Online custom action interface @@ -23,52 +24,83 @@ public class Action20231113045722 extends BaseBean implements Action { @Override public String execute(RequestInfo request) { + try { - String requestId = request.getRequestid(); + String requestId = request.getRequestid(); + String tablename = request.getRequestManager().getBillTableName(); + + + RecordSet rs = new RecordSet(); + rs.execute("select * from " + tablename + " where requestid = " + requestId); + rs.next(); + // if (1 == 1 ){ + // throw new Exception("11111"+requestId); + // } + String mainid = rs.getString("id"); + String fsr = rs.getString("fsr"); + //标题 + String title = rs.getString("fsnr"); + //内容 + String context = rs.getString("txxx"); + //PC端链接 纯文本就传空字符串 + String linkUrl = rs.getString("pclj"); + //移动端链接 纯文本就传空字符串 + String linkMobileUrl = rs.getString("applj"); + + + + //codeid codeid + int codeid = Util.getIntValue(rs.getString("codeid")); + if (codeid <= 0) { + request.getRequestManager().setMessageid("90001"); + request.getRequestManager().setMessagecontent("codeid异常"); + return Action.FAILURE_AND_CONTINUE; + } - String tablename = request.getRequestManager().getBillTableName(); + //消息来源(见文档第四点补充) + MessageType messageType = null; + try { + messageType = MessageType.newInstance(codeid); + }catch (Exception e){ + throw new Exception("MessageType.newInstance推送消息异常:"+codeid); + } - RecordSet rs = new RecordSet(); - rs.execute("select * from " + tablename + " where requestid = " + requestId); - rs.next(); - String mainid = rs.getString("id"); - String fsr = rs.getString("fsr"); - //标题 - String title = rs.getString("fsnr"); - //内容 - String context = rs.getString("txxx"); - //PC端链接 纯文本就传空字符串 - String linkUrl = rs.getString("pclj"); - //移动端链接 纯文本就传空字符串 - String linkMobileUrl = rs.getString("applj"); - - //codeid codeid - int codeid = Util.getIntValue(rs.getString("codeid")); - if (codeid <= 0) { - request.getRequestManager().setMessageid("90001"); - request.getRequestManager().setMessagecontent("codeid异常"); - return Action.FAILURE_AND_CONTINUE; - } + //接收人id + Set userIdList = new TreeSet<>(); + try { + userIdList = convertToHashSet(fsr); + }catch (Exception e){ + throw new Exception("convertToHashSet推送消息异常:"+fsr); + } - //消息来源(见文档第四点补充) - MessageType messageType = MessageType.newInstance(codeid); + // if (1 == 1 ) { + // throw new Exception("userIdList:" + userIdList); + // } + try { + MessageBean messageBean = Util_Message.createMessage(messageType, userIdList, title, context, linkUrl, linkMobileUrl); + messageBean.setCreater(1);//创建人id +//message.setBizState("0");需要修改消息状态时传入,表示消息最初状态为待处理 + // messageBean.setTargetId("121|22"); //消息来源code +“|”+业务id 需要修改消息状态时传入,这个字段是自定义的,和修改消息状态的时候传入相同的值,可做更新。 + boolean store = Util_Message.store(messageBean); + } catch (IOException e) { + e.printStackTrace(); + request.getRequestManager().setMessageid("90002"); + request.getRequestManager().setMessagecontent("异常1111111"+e.getMessage()+ e); + return Action.FAILURE_AND_CONTINUE; + // throw new Exception("推送消息异常"); - //接收人id - Set userIdList = convertToHashSet(fsr); + } - try { - MessageBean messageBean = Util_Message.createMessage(messageType, userIdList, title, context, linkUrl, linkMobileUrl); - messageBean.setCreater(1);//创建人id -//message.setBizState("0");需要修改消息状态时传入,表示消息最初状态为待处理 - // messageBean.setTargetId("121|22"); //消息来源code +“|”+业务id 需要修改消息状态时传入,这个字段是自定义的,和修改消息状态的时候传入相同的值,可做更新。 - Util_Message.store(messageBean); - } catch (IOException e) { - e.printStackTrace(); + }catch (Exception e){ + request.getRequestManager().setMessageid("90002"); + request.getRequestManager().setMessagecontent("异常"+e.getMessage()+ e); + return Action.FAILURE_AND_CONTINUE; } + return Action.SUCCESS; } diff --git a/weaver/interfaces/workflow/action/javacode/Action20231123035106.java b/weaver/interfaces/workflow/action/javacode/Action20231123035106.java index b62404d..beb5b34 100644 --- a/weaver/interfaces/workflow/action/javacode/Action20231123035106.java +++ b/weaver/interfaces/workflow/action/javacode/Action20231123035106.java @@ -1,419 +1,419 @@ - package weaver.interfaces.workflow.action.javacode; - - import cn.wps.yun.StringUtil; - import com.google.common.base.Charsets; - import com.google.common.io.ByteSource; - import com.icbc.api.internal.apache.http.impl.cookie.S; - import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; - import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream; - import org.apache.commons.lang3.StringUtils; - import weaver.conn.RecordSet; - import weaver.file.ImageFileManager; - import weaver.general.Util; - - import weaver.hrm.User; - import weaver.hrm.company.DepartmentComInfo; - import weaver.interfaces.workflow.action.Action; - import weaver.general.BaseBean; - import weaver.soa.workflow.request.RequestInfo; - - import java.io.*; - import java.nio.charset.Charset; - import java.nio.charset.StandardCharsets; - import java.nio.file.Files; - import java.nio.file.Path; - import java.nio.file.Paths; - import java.text.SimpleDateFormat; - import java.time.LocalDate; - import java.time.format.DateTimeFormatter; - import java.util.*; - import java.util.zip.ZipEntry; - import java.util.zip.ZipOutputStream; - - import static java.nio.charset.StandardCharsets.UTF_8; - - /** - * Online custom action interface - */ - public class Action20231123035106 implements Action{ - private static final BaseBean bb = new BaseBean(); - private static final String postSQl = ""; - private static final String receiptSQL = ""; - - private static final String queryDocIdSql = - "select * from docimagefile docfile " + - "left join docdetail doc on docfile.DOCID = doc.ID " + - "left join imagefile file on docfile.IMAGEFILEID = file.IMAGEFILEID " + - // "left join uf_tssjb tssjb on docfile.DOCID = tssjb.wdid " + - "where (doc.docsubject like '%食品%' or doc.docsubject like '%专项%' ) "; - - private static final String dataEqualSql = "and doc.DOCCREATEDATE = ? "; - private static final String dataRangeSql = "and doc.DOCCREATEDATE >= ? and doc.DOCCREATEDATE <= ? "; - public String url = ""; - public String queryType = ""; - public String queryDate = ""; - public String startDate = ""; - public String endDate = ""; - public String deptIds = ""; - // public String userNames = ""; - public String dirPath = "/opt/weaver/scjgw"; - public String postSeccategory = ""; - public String receiptSeccategory = ""; - - - - - @Override - public String execute(RequestInfo requestInfo) { - writeLog("执行定时任务开始","PushCorn"); - writeLog("url",url); - writeLog("queryType",queryType); - writeLog("queryDate",queryDate); - writeLog("startDate",startDate); - writeLog("endDate",endDate); - writeLog("deptIds",deptIds); - // writeLog("userNames",userNames); - writeLog("dirPath",dirPath); - writeLog("postSeccategory",postSeccategory); - writeLog("receiptSeccategory",receiptSeccategory); - try { - System.setOut(new PrintStream(System.out, true, "UTF-8")); - } catch (UnsupportedEncodingException e) { - e.printStackTrace(); - } - writeLog("new String(s.getBytes(UTF_8))",new String("通".getBytes(UTF_8))); - writeLog("new String(s.getBytes(StandardCharsets.UTF_8), StandardCharsets.UTF_8)", new String("通".getBytes(StandardCharsets.UTF_8), StandardCharsets.UTF_8)); - writeLog("new String(s.getBytes(StandardCharsets.UTF_8), StandardCharsets.UTF_8)", new String("通".getBytes(StandardCharsets.UTF_8), Charset.forName("GBK"))); - - - // 假设 s 是 UTF-8 编码的字符串 - String s1 = "通"; - - // 将 s 从 UTF-8 转换为字节数组 - - byte[] utf8Bytes = s1.getBytes(StandardCharsets.UTF_8); - - // 将字节数组从 UTF-8 转换为 GBK - String gbkString = new String(utf8Bytes, Charset.forName("GBK")); - - // 打印日志 - writeLog("new String(s.getBytes(StandardCharsets.UTF_8), Charset.forName(\"GBK\"))", gbkString); - - - - - - - - - - - writeLog("new String(s.getBytes(UTF_8))",new String("通报".getBytes(UTF_8))); - writeLog("new String(s.getBytes(UTF_8))",new String("关于2023年天津市食品安全抽检监测任务完成情况的通报(第三期).zip".getBytes(UTF_8))); - String x= "关于2023年天津市食品安全抽检监测任务完成情况的通报(第三期).zip"; - writeLog("utf8Str===>",convertGbkToUtf8(x)); - String querySql = queryDocIdSql; - //生成人员map - final HashMap useridNamemap = new HashMap<>(); - - RecordSet recordSet = new RecordSet(); - // if (!StringUtil.isEmpty(deptIds)) { - // querySql = querySql + "and doc.docdepartmentid in (" + deptIds + " )"; - // // String[] deptids = deptIds.split(","); - // // String[] usernames = deptIds.split(","); - // // for (int i = 0; i < userids.length; i++) { - // // useridNamemap.put(userids[i],usernames[i]); - // // } - // }else { - // return; - // } - // List childNodeIds = getChildNodeIds(postSeccategory); - // childNodeIds.add(postSeccategory); - // List childNodeIds1 = getChildNodeIds(receiptSeccategory); - // childNodeIds1.add(receiptSeccategory); - // childNodeIds.addAll(childNodeIds1); - - - //添加目录 - // querySql = querySql + "and ( seccategory in ( "+ String.join(",",childNodeIds)+" ) )" ; - - //查询指定天的 - // if ("0".equals(queryType)) { - // writeLog("查询指定天的文档"); - // querySql = querySql + dataEqualSql; - // recordSet.executeQuery(querySql, queryDate); - // } else if ("1".equals(queryType)) { - // writeLog("查询指定范围的文档",startDate,endDate); - // querySql = querySql + dataRangeSql; - // recordSet.executeQuery(querySql, startDate, endDate); - // } else if ("2".equals(queryType)) { - // writeLog("查询昨天的文档"); - // querySql = querySql + dataEqualSql; - // recordSet.executeQuery(querySql, getYesterdayDateStr()); - // } - recordSet.executeQuery(querySql); - writeLog("查询sql",querySql); - writeLog("查询sql",recordSet.getExceptionMsg()); - writeLog("查询数量", recordSet.getCounts()+""); - //开始推送数据 - //检查文件夹路径 - checkAndCreateDir(); - HashMap docid_docNameMap = new HashMap<>(); - HashMap> docid_imagefilleIdMap = new HashMap<>(); - HashMap> fileinfo = new HashMap<>(); - while (recordSet.next()){ - //文档id - String docid = weaver.general.Util.null2String(recordSet.getString("DOCID")); - //文档标题 - String docsubject = weaver.general.Util.null2String(recordSet.getString("docsubject")); - //附件id - String imagefileid = weaver.general.Util.null2String(recordSet.getString("IMAGEFILEID")); - //文档时间 - String DOCCREATEDATE = weaver.general.Util.null2String(recordSet.getString("DOCCREATEDATE")); - //目录 seccategory - String seccategory = weaver.general.Util.null2String(recordSet.getString("seccategory")); - String DOCCREATERID = weaver.general.Util.null2String(recordSet.getString("DOCCREATERID")); - HashMap map = new HashMap<>(); - map.put("DOCCREATEDATE",DOCCREATEDATE); - map.put("seccategory",postSeccategory.equals(seccategory) ? "2" : "1"); - map.put("DOCCREATERID",new User(Util.getIntValue(DOCCREATERID)).getLastname() ); - docid_docNameMap.put(docid,docsubject); - fileinfo.put(docid,map); - List imagefilleIdList = docid_imagefilleIdMap.get(docid); - if (imagefilleIdList == null){ - ArrayList filleIdList = new ArrayList<>(); - filleIdList.add(imagefileid); - docid_imagefilleIdMap.put(docid,filleIdList); - }else { - imagefilleIdList.add(imagefileid); - } - } - writeLog("需要推送的文档",docid_docNameMap.toString()); - // 开始封装文件 - String DateDirFile = ""; - if(docid_docNameMap.keySet().size() > 0 ){ - // 创建今天的文件夹 - DateDirFile = checkAndCreateDir(getTodayDateStr()); - }else { - return ""; - } - String finalDateDirFile = DateDirFile; - writeLog("今天的文件目录",DateDirFile); - writeLog("docid_imagefilleIdMap",docid_imagefilleIdMap.toString()); - docid_imagefilleIdMap.forEach((docid, filleIdList)->{ - String FileDir = docid_docNameMap.get(docid); - String FileDir2 = new String(FileDir.getBytes(UTF_8)); - writeLog("编码修改前 FileDir",FileDir); - writeLog("编码修改后 FileDir2",FileDir2); - String zipFileName = finalDateDirFile + File.separator + docid +".zip"; - //修改下编码 - String zipFileName2 = new String(zipFileName.getBytes(StandardCharsets.UTF_8)); - String zipFileName3 = null; - try { - // zipFileName.getBytes(UTF_8) - zipFileName3 = new String(zipFileName.getBytes("GBK"), UTF_8); - } catch (Exception e) { - e.printStackTrace(); - } - - - writeLog("编码修改前 zipFileName",zipFileName); - writeLog("编码修改后 zipFileName",zipFileName2); - writeLog("编码修改后 zipFileName3",zipFileName3); - File filezip = new File(new String(zipFileName.getBytes(UTF_8))); - - byte[] folderBytes = new byte[0]; // 假设原始编码是GBK - try { - folderBytes = zipFileName.getBytes("GBK"); - } catch (UnsupportedEncodingException e) { - e.printStackTrace(); - } - String encodedFolderName = new String(folderBytes, Charset.defaultCharset()); - writeLog("编码修改后 encodedFolderName",encodedFolderName); - ZipArchiveOutputStream zos =null; - writeLog("filezip",zipFileName); - try { - zos = new ZipArchiveOutputStream( new FileOutputStream(filezip)); - zos.setEncoding("UTF-8"); - for (String filleId : filleIdList) { - ImageFileManager ifm = new ImageFileManager(); - ifm.getImageFileInfoById(Integer.parseInt(filleId)); - InputStream imagefile = ifm.getInputStream(); - // String s1 = ifm.getImageFileName().split(".")[0]; - writeLog("压缩文件",ifm.getImageFileName()); - addInputStreamToZip(imagefile,zos,FileDir+File.separator+ifm.getImageFileName()); - } - } catch (FileNotFoundException e) { - writeLog("压缩文件异常",e.toString()); - e.printStackTrace(); - } catch (IOException e) { - writeLog("压缩文件异常",e.toString()); - e.printStackTrace(); - }catch (Exception e){ - writeLog("压缩文件异常",e.toString()); - e.printStackTrace(); - }finally { - try { - zos.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - - writeLog("压缩完文件名",filezip.getName()); - - String s = "通.zip"; - String convertedString =""; - try { - - byte[] bytes = StringUtils.getBytes(s, "UTF-8"); - - // 使用Guava转换编码 - ByteSource byteSource = ByteSource.wrap(s.getBytes(Charsets.UTF_8)); - byte[] gbkBytes = byteSource.asCharSource(Charsets.UTF_8).asByteSource(Charsets.UTF_8).read(); - // String gbkString = new String(gbkBytes, "GBK"); - } catch (UnsupportedEncodingException e) { - - } catch (IOException e) { - e.printStackTrace(); - } - - // filezip.renameTo(new File(convertedString)); - // HashMap map = fileinfo.get(docid); - - //开始推送数据 - // try { - // String s = ApiClient.callApi(url, docid, docid_docNameMap.get(docid), map.get("DOCCREATEDATE"), - // map.get("seccategory"), map.get("DOCCREATERID"), filezip); - // writeLog("返回数据",s); - // } catch (IOException e) { - // e.printStackTrace(); - // writeLog(e.getMessage()); - // writeLog(e.getMessage()); - // } - }); - return ""; - } - private static String getTodayDateStr() { - // 获取当前日期 - LocalDate today = LocalDate.now(); - // 定义日期格式 - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd"); - // 将昨天的日期格式化为字符串 - return today.format(formatter); - } - - private static String getYesterdayDateStr() { - // 获取当前日期 - LocalDate today = LocalDate.now(); - // 减去一天得到前一天的日期 - LocalDate yesterday = today.minusDays(1); - // 定义日期格式 - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); - // 将昨天的日期格式化为字符串 - return yesterday.format(formatter); - } - - private static void writeLog(String... log) { - StringBuilder logStr = new StringBuilder(); - for (String s : log) { - logStr.append("|").append(s); - } - bb.writeLog("PushCornTest.class"+"==>"+logStr); - } - - private void checkAndCreateDir(){ - // 创建File对象 - File directory = new File(dirPath); - - // 检查路径是否存在 - if (!directory.exists()) { - // 不存在,尝试创建多级目录 - boolean result = directory.mkdirs(); - if (result) { - writeLog("多级目录已创建成功:" + dirPath); - } else { - writeLog("目录创建失败,请检查路径是否正确,或者程序是否有相应的权限。"); - } - } else { - writeLog("目录已存在:" + dirPath); - } - } - - - private String checkAndCreateDir(String date){ - // 创建File对象 - File directory = new File(dirPath+File.separator+date); - - // 检查路径是否存在 - if (!directory.exists()) { - // 不存在,尝试创建多级目录 - boolean result = directory.mkdirs(); - if (result) { - writeLog("多级目录已创建成功:" + dirPath+File.separator+date); - } else { - writeLog(dirPath+File.separator+date,"目录创建失败,请检查路径是否正确,或者程序是否有相应的权限。"); - return "-1"; - } - } else { - writeLog("目录已存在:" + dirPath+File.separator+date); - } - return dirPath+File.separator+date; - } - - public void addInputStreamToZip(InputStream inputStream, ZipArchiveOutputStream zos, String entryName) throws IOException { - writeLog("编码修改后 entryName",entryName); - ZipArchiveEntry zipEntry = new ZipArchiveEntry(entryName); - zos.putArchiveEntry(zipEntry); - byte[] buffer = new byte[1024]; - int length; - while ((length = inputStream.read(buffer)) > 0) { - zos.write(buffer, 0, length); - } - inputStream.close(); - zos.closeArchiveEntry(); - } - - public static List getChildNodeIds(String parentId) { - String sql = "SELECT id FROM docseccategory WHERE parentid = ?"; - List childIds = new ArrayList<>(); - RecordSet rs = new RecordSet(); - rs.executeQuery(sql , parentId); - while (rs.next()) { - String id = rs.getString("id"); - childIds.add(id); - childIds.addAll(getChildNodeIds(id)); // 递归调用以获取所有后代节点 - } - return childIds; - } - - - public static String convertGbkToUtf8(String gbkStr) { - // 将GBK字符串转换为Unicode - String unicodeStr = new String(gbkStr.getBytes(Charset.forName("GBK")), Charset.forName("UTF-8")); - - // 从Unicode转换为UTF-8 - byte[] utf8Bytes = unicodeStr.getBytes(Charset.forName("UTF-8")); - return new String(utf8Bytes, Charset.forName("UTF-8")); - } - - - public static String toUnicodeString(String str) { - StringBuilder unicode = new StringBuilder(); - for (int i = 0; i < str.length(); i++) { - unicode.append(String.format("\\u%04X", (int) str.charAt(i))); - } - return unicode.toString(); - } - - public static String unicodeToUtf8(String unicodeStr) { - String stringFromUnicode = unicodeStr.replace("\\u", ""); - byte[] utf8Bytes = new byte[stringFromUnicode.length() / 2]; - for (int i = 0; i < stringFromUnicode.length(); i += 2) { - int value = Integer.parseInt(stringFromUnicode.substring(i, i + 2), 16); - utf8Bytes[i / 2] = (byte) value; - } - return new String(utf8Bytes, StandardCharsets.UTF_8); - } - - } + // package weaver.interfaces.workflow.action.javacode; + // + // import cn.wps.yun.StringUtil; + // import com.google.common.base.Charsets; + // import com.google.common.io.ByteSource; + // import com.icbc.api.internal.apache.http.impl.cookie.S; + // import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; + // import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream; + // import org.apache.commons.lang3.StringUtils; + // import weaver.conn.RecordSet; + // import weaver.file.ImageFileManager; + // import weaver.general.Util; + // + // import weaver.hrm.User; + // import weaver.hrm.company.DepartmentComInfo; + // import weaver.interfaces.workflow.action.Action; + // import weaver.general.BaseBean; + // import weaver.soa.workflow.request.RequestInfo; + // + // import java.io.*; + // import java.nio.charset.Charset; + // import java.nio.charset.StandardCharsets; + // import java.nio.file.Files; + // import java.nio.file.Path; + // import java.nio.file.Paths; + // import java.text.SimpleDateFormat; + // import java.time.LocalDate; + // import java.time.format.DateTimeFormatter; + // import java.util.*; + // import java.util.zip.ZipEntry; + // import java.util.zip.ZipOutputStream; + // + // import static java.nio.charset.StandardCharsets.UTF_8; + // + // /** + // * Online custom action interface + // */ + // public class Action20231123035106 implements Action{ + // private static final BaseBean bb = new BaseBean(); + // private static final String postSQl = ""; + // private static final String receiptSQL = ""; + // + // private static final String queryDocIdSql = + // "select * from docimagefile docfile " + + // "left join docdetail doc on docfile.DOCID = doc.ID " + + // "left join imagefile file on docfile.IMAGEFILEID = file.IMAGEFILEID " + + // // "left join uf_tssjb tssjb on docfile.DOCID = tssjb.wdid " + + // "where (doc.docsubject like '%食品%' or doc.docsubject like '%专项%' ) "; + // + // private static final String dataEqualSql = "and doc.DOCCREATEDATE = ? "; + // private static final String dataRangeSql = "and doc.DOCCREATEDATE >= ? and doc.DOCCREATEDATE <= ? "; + // public String url = ""; + // public String queryType = ""; + // public String queryDate = ""; + // public String startDate = ""; + // public String endDate = ""; + // public String deptIds = ""; + // // public String userNames = ""; + // public String dirPath = "/opt/weaver/scjgw"; + // public String postSeccategory = ""; + // public String receiptSeccategory = ""; + // + // + // + // + // @Override + // public String execute(RequestInfo requestInfo) { + // writeLog("执行定时任务开始","PushCorn"); + // writeLog("url",url); + // writeLog("queryType",queryType); + // writeLog("queryDate",queryDate); + // writeLog("startDate",startDate); + // writeLog("endDate",endDate); + // writeLog("deptIds",deptIds); + // // writeLog("userNames",userNames); + // writeLog("dirPath",dirPath); + // writeLog("postSeccategory",postSeccategory); + // writeLog("receiptSeccategory",receiptSeccategory); + // try { + // System.setOut(new PrintStream(System.out, true, "UTF-8")); + // } catch (UnsupportedEncodingException e) { + // e.printStackTrace(); + // } + // writeLog("new String(s.getBytes(UTF_8))",new String("通".getBytes(UTF_8))); + // writeLog("new String(s.getBytes(StandardCharsets.UTF_8), StandardCharsets.UTF_8)", new String("通".getBytes(UTF_8), UTF_8)); + // writeLog("new String(s.getBytes(StandardCharsets.UTF_8), StandardCharsets.UTF_8)", new String("通".getBytes(UTF_8), Charset.forName("GBK"))); + // + // + // // 假设 s 是 UTF-8 编码的字符串 + // String s1 = "通"; + // + // // 将 s 从 UTF-8 转换为字节数组 + // + // byte[] utf8Bytes = s1.getBytes(UTF_8); + // + // // 将字节数组从 UTF-8 转换为 GBK + // String gbkString = new String(utf8Bytes, Charset.forName("GBK")); + // + // // 打印日志 + // writeLog("new String(s.getBytes(StandardCharsets.UTF_8), Charset.forName(\"GBK\"))", gbkString); + // + // + // + // + // + // + // + // + // + // + // writeLog("new String(s.getBytes(UTF_8))",new String("通报".getBytes(UTF_8))); + // writeLog("new String(s.getBytes(UTF_8))",new String("关于2023年天津市食品安全抽检监测任务完成情况的通报(第三期).zip".getBytes(UTF_8))); + // String x= "关于2023年天津市食品安全抽检监测任务完成情况的通报(第三期).zip"; + // writeLog("utf8Str===>",convertGbkToUtf8(x)); + // String querySql = queryDocIdSql; + // //生成人员map + // final HashMap useridNamemap = new HashMap<>(); + // + // RecordSet recordSet = new RecordSet(); + // // if (!StringUtil.isEmpty(deptIds)) { + // // querySql = querySql + "and doc.docdepartmentid in (" + deptIds + " )"; + // // // String[] deptids = deptIds.split(","); + // // // String[] usernames = deptIds.split(","); + // // // for (int i = 0; i < userids.length; i++) { + // // // useridNamemap.put(userids[i],usernames[i]); + // // // } + // // }else { + // // return; + // // } + // // List childNodeIds = getChildNodeIds(postSeccategory); + // // childNodeIds.add(postSeccategory); + // // List childNodeIds1 = getChildNodeIds(receiptSeccategory); + // // childNodeIds1.add(receiptSeccategory); + // // childNodeIds.addAll(childNodeIds1); + // + // + // //添加目录 + // // querySql = querySql + "and ( seccategory in ( "+ String.join(",",childNodeIds)+" ) )" ; + // + // //查询指定天的 + // // if ("0".equals(queryType)) { + // // writeLog("查询指定天的文档"); + // // querySql = querySql + dataEqualSql; + // // recordSet.executeQuery(querySql, queryDate); + // // } else if ("1".equals(queryType)) { + // // writeLog("查询指定范围的文档",startDate,endDate); + // // querySql = querySql + dataRangeSql; + // // recordSet.executeQuery(querySql, startDate, endDate); + // // } else if ("2".equals(queryType)) { + // // writeLog("查询昨天的文档"); + // // querySql = querySql + dataEqualSql; + // // recordSet.executeQuery(querySql, getYesterdayDateStr()); + // // } + // recordSet.executeQuery(querySql); + // writeLog("查询sql",querySql); + // writeLog("查询sql",recordSet.getExceptionMsg()); + // writeLog("查询数量", recordSet.getCounts()+""); + // //开始推送数据 + // //检查文件夹路径 + // checkAndCreateDir(); + // HashMap docid_docNameMap = new HashMap<>(); + // HashMap> docid_imagefilleIdMap = new HashMap<>(); + // HashMap> fileinfo = new HashMap<>(); + // while (recordSet.next()){ + // //文档id + // String docid = Util.null2String(recordSet.getString("DOCID")); + // //文档标题 + // String docsubject = Util.null2String(recordSet.getString("docsubject")); + // //附件id + // String imagefileid = Util.null2String(recordSet.getString("IMAGEFILEID")); + // //文档时间 + // String DOCCREATEDATE = Util.null2String(recordSet.getString("DOCCREATEDATE")); + // //目录 seccategory + // String seccategory = Util.null2String(recordSet.getString("seccategory")); + // String DOCCREATERID = Util.null2String(recordSet.getString("DOCCREATERID")); + // HashMap map = new HashMap<>(); + // map.put("DOCCREATEDATE",DOCCREATEDATE); + // map.put("seccategory",postSeccategory.equals(seccategory) ? "2" : "1"); + // map.put("DOCCREATERID",new User(Util.getIntValue(DOCCREATERID)).getLastname() ); + // docid_docNameMap.put(docid,docsubject); + // fileinfo.put(docid,map); + // List imagefilleIdList = docid_imagefilleIdMap.get(docid); + // if (imagefilleIdList == null){ + // ArrayList filleIdList = new ArrayList<>(); + // filleIdList.add(imagefileid); + // docid_imagefilleIdMap.put(docid,filleIdList); + // }else { + // imagefilleIdList.add(imagefileid); + // } + // } + // writeLog("需要推送的文档",docid_docNameMap.toString()); + // // 开始封装文件 + // String DateDirFile = ""; + // if(docid_docNameMap.keySet().size() > 0 ){ + // // 创建今天的文件夹 + // DateDirFile = checkAndCreateDir(getTodayDateStr()); + // }else { + // return ""; + // } + // String finalDateDirFile = DateDirFile; + // writeLog("今天的文件目录",DateDirFile); + // writeLog("docid_imagefilleIdMap",docid_imagefilleIdMap.toString()); + // docid_imagefilleIdMap.forEach((docid, filleIdList)->{ + // String FileDir = docid_docNameMap.get(docid); + // String FileDir2 = new String(FileDir.getBytes(UTF_8)); + // writeLog("编码修改前 FileDir",FileDir); + // writeLog("编码修改后 FileDir2",FileDir2); + // String zipFileName = finalDateDirFile + File.separator + docid +".zip"; + // //修改下编码 + // String zipFileName2 = new String(zipFileName.getBytes(UTF_8)); + // String zipFileName3 = null; + // try { + // // zipFileName.getBytes(UTF_8) + // zipFileName3 = new String(zipFileName.getBytes("GBK"), UTF_8); + // } catch (Exception e) { + // e.printStackTrace(); + // } + // + // + // writeLog("编码修改前 zipFileName",zipFileName); + // writeLog("编码修改后 zipFileName",zipFileName2); + // writeLog("编码修改后 zipFileName3",zipFileName3); + // File filezip = new File(new String(zipFileName.getBytes(UTF_8))); + // + // byte[] folderBytes = new byte[0]; // 假设原始编码是GBK + // try { + // folderBytes = zipFileName.getBytes("GBK"); + // } catch (UnsupportedEncodingException e) { + // e.printStackTrace(); + // } + // String encodedFolderName = new String(folderBytes, Charset.defaultCharset()); + // writeLog("编码修改后 encodedFolderName",encodedFolderName); + // ZipArchiveOutputStream zos =null; + // writeLog("filezip",zipFileName); + // try { + // zos = new ZipArchiveOutputStream( new FileOutputStream(filezip)); + // zos.setEncoding("UTF-8"); + // for (String filleId : filleIdList) { + // ImageFileManager ifm = new ImageFileManager(); + // ifm.getImageFileInfoById(Integer.parseInt(filleId)); + // InputStream imagefile = ifm.getInputStream(); + // // String s1 = ifm.getImageFileName().split(".")[0]; + // writeLog("压缩文件",ifm.getImageFileName()); + // addInputStreamToZip(imagefile,zos,FileDir+File.separator+ifm.getImageFileName()); + // } + // } catch (FileNotFoundException e) { + // writeLog("压缩文件异常",e.toString()); + // e.printStackTrace(); + // } catch (IOException e) { + // writeLog("压缩文件异常",e.toString()); + // e.printStackTrace(); + // }catch (Exception e){ + // writeLog("压缩文件异常",e.toString()); + // e.printStackTrace(); + // }finally { + // try { + // zos.close(); + // } catch (IOException e) { + // e.printStackTrace(); + // } + // } + // + // writeLog("压缩完文件名",filezip.getName()); + // + // String s = "通.zip"; + // String convertedString =""; + // try { + // + // byte[] bytes = StringUtils.getBytes(s, "UTF-8"); + // + // // 使用Guava转换编码 + // ByteSource byteSource = ByteSource.wrap(s.getBytes(Charsets.UTF_8)); + // byte[] gbkBytes = byteSource.asCharSource(Charsets.UTF_8).asByteSource(Charsets.UTF_8).read(); + // // String gbkString = new String(gbkBytes, "GBK"); + // } catch (UnsupportedEncodingException e) { + // + // } catch (IOException e) { + // e.printStackTrace(); + // } + // + // // filezip.renameTo(new File(convertedString)); + // // HashMap map = fileinfo.get(docid); + // + // //开始推送数据 + // // try { + // // String s = ApiClient.callApi(url, docid, docid_docNameMap.get(docid), map.get("DOCCREATEDATE"), + // // map.get("seccategory"), map.get("DOCCREATERID"), filezip); + // // writeLog("返回数据",s); + // // } catch (IOException e) { + // // e.printStackTrace(); + // // writeLog(e.getMessage()); + // // writeLog(e.getMessage()); + // // } + // }); + // return ""; + // } + // private static String getTodayDateStr() { + // // 获取当前日期 + // LocalDate today = LocalDate.now(); + // // 定义日期格式 + // DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd"); + // // 将昨天的日期格式化为字符串 + // return today.format(formatter); + // } + // + // private static String getYesterdayDateStr() { + // // 获取当前日期 + // LocalDate today = LocalDate.now(); + // // 减去一天得到前一天的日期 + // LocalDate yesterday = today.minusDays(1); + // // 定义日期格式 + // DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + // // 将昨天的日期格式化为字符串 + // return yesterday.format(formatter); + // } + // + // private static void writeLog(String... log) { + // StringBuilder logStr = new StringBuilder(); + // for (String s : log) { + // logStr.append("|").append(s); + // } + // bb.writeLog("PushCornTest.class"+"==>"+logStr); + // } + // + // private void checkAndCreateDir(){ + // // 创建File对象 + // File directory = new File(dirPath); + // + // // 检查路径是否存在 + // if (!directory.exists()) { + // // 不存在,尝试创建多级目录 + // boolean result = directory.mkdirs(); + // if (result) { + // writeLog("多级目录已创建成功:" + dirPath); + // } else { + // writeLog("目录创建失败,请检查路径是否正确,或者程序是否有相应的权限。"); + // } + // } else { + // writeLog("目录已存在:" + dirPath); + // } + // } + // + // + // private String checkAndCreateDir(String date){ + // // 创建File对象 + // File directory = new File(dirPath+File.separator+date); + // + // // 检查路径是否存在 + // if (!directory.exists()) { + // // 不存在,尝试创建多级目录 + // boolean result = directory.mkdirs(); + // if (result) { + // writeLog("多级目录已创建成功:" + dirPath+File.separator+date); + // } else { + // writeLog(dirPath+File.separator+date,"目录创建失败,请检查路径是否正确,或者程序是否有相应的权限。"); + // return "-1"; + // } + // } else { + // writeLog("目录已存在:" + dirPath+File.separator+date); + // } + // return dirPath+File.separator+date; + // } + // + // public void addInputStreamToZip(InputStream inputStream, ZipArchiveOutputStream zos, String entryName) throws IOException { + // writeLog("编码修改后 entryName",entryName); + // ZipArchiveEntry zipEntry = new ZipArchiveEntry(entryName); + // zos.putArchiveEntry(zipEntry); + // byte[] buffer = new byte[1024]; + // int length; + // while ((length = inputStream.read(buffer)) > 0) { + // zos.write(buffer, 0, length); + // } + // inputStream.close(); + // zos.closeArchiveEntry(); + // } + // + // public static List getChildNodeIds(String parentId) { + // String sql = "SELECT id FROM docseccategory WHERE parentid = ?"; + // List childIds = new ArrayList<>(); + // RecordSet rs = new RecordSet(); + // rs.executeQuery(sql , parentId); + // while (rs.next()) { + // String id = rs.getString("id"); + // childIds.add(id); + // childIds.addAll(getChildNodeIds(id)); // 递归调用以获取所有后代节点 + // } + // return childIds; + // } + // + // + // public static String convertGbkToUtf8(String gbkStr) { + // // 将GBK字符串转换为Unicode + // String unicodeStr = new String(gbkStr.getBytes(Charset.forName("GBK")), Charset.forName("UTF-8")); + // + // // 从Unicode转换为UTF-8 + // byte[] utf8Bytes = unicodeStr.getBytes(Charset.forName("UTF-8")); + // return new String(utf8Bytes, Charset.forName("UTF-8")); + // } + // + // + // public static String toUnicodeString(String str) { + // StringBuilder unicode = new StringBuilder(); + // for (int i = 0; i < str.length(); i++) { + // unicode.append(String.format("\\u%04X", (int) str.charAt(i))); + // } + // return unicode.toString(); + // } + // + // public static String unicodeToUtf8(String unicodeStr) { + // String stringFromUnicode = unicodeStr.replace("\\u", ""); + // byte[] utf8Bytes = new byte[stringFromUnicode.length() / 2]; + // for (int i = 0; i < stringFromUnicode.length(); i += 2) { + // int value = Integer.parseInt(stringFromUnicode.substring(i, i + 2), 16); + // utf8Bytes[i / 2] = (byte) value; + // } + // return new String(utf8Bytes, StandardCharsets.UTF_8); + // } + // + // } diff --git a/weaver/interfaces/workflow/action/javacode/Action20240511020255.java b/weaver/interfaces/workflow/action/javacode/Action20240511020255.java new file mode 100644 index 0000000..6d6fb7c --- /dev/null +++ b/weaver/interfaces/workflow/action/javacode/Action20240511020255.java @@ -0,0 +1,28 @@ +package weaver.interfaces.workflow.action.javacode; + +import weaver.conn.RecordSet; +import weaver.interfaces.workflow.action.Action; +import weaver.general.BaseBean; +import weaver.soa.workflow.request.RequestInfo; +/** + * Online custom action interface + */ +public class Action20240511020255 extends BaseBean implements Action{ + /** + * After selecting aciton after the process path node, this method will be executed after the node is submitted. + */ + public String execute(RequestInfo request) { + + RecordSet recordSet = new RecordSet(); + recordSet.executeUpdate("DELETE FROM uf_pushArchivesLog " + + "WHERE id NOT IN ( " + + " SELECT MIN(id) " + + " FROM uf_pushArchivesLog where type = 0 or type = 1 " + + " GROUP BY REQUEST " + + ");"); + + + + return Action.SUCCESS; + } +} diff --git a/weaver/meeting/video/consumer/YealinkVideoClient.java b/weaver/meeting/video/consumer/YealinkVideoClient.java new file mode 100644 index 0000000..172d544 --- /dev/null +++ b/weaver/meeting/video/consumer/YealinkVideoClient.java @@ -0,0 +1,645 @@ +package weaver.meeting.video.consumer; + +import cn.hutool.core.date.DateUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.api.meeting.cusvideo.util.YealinkVideoUtil; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.time.DateFormatUtils; +import org.apache.commons.lang3.time.DateUtils; +import weaver.Constants; +import weaver.WorkPlan.WorkPlanHandler; +import weaver.WorkPlan.WorkPlanService; +import weaver.WorkPlan.WorkPlanShare; +import weaver.conn.RecordSet; +import weaver.domain.workplan.WorkPlan; +import weaver.general.BaseBean; +import weaver.general.Util; +import weaver.hrm.User; +import weaver.hrm.resource.ResourceComInfo; +import weaver.meeting.video.util.VideoMeetingUtil; +import weaver.systeminfo.SystemEnv; + +import java.net.URLEncoder; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @Description: + * @Author: lj + * @CreateTime: 2023-06-05 15:41 + * @Version: 1.0 + */ +public class YealinkVideoClient extends VideoMeetingClient { + private static BaseBean logger = new BaseBean(); + + @Override + public Map addMeeting(Map otherParam) { + Map apiData = new HashMap<>(); + try { + if ("".equals(Util.null2String(getDomainName_url()))) { + throw new RuntimeException("获取亿联会议地址URl未配置,请检查视频会议是否配置正常!"); + } + //获取参数 + logger.writeLog("^^^ YealinkVideoClient.addMeeting : otherParam = " + otherParam); + String userid = Util.null2String(otherParam.get("userid"));//创建人ID + String topic = Util.null2String(otherParam.get("topic"));//会议标题 + String start_time = Util.null2String(otherParam.get("starttime")) + ":00";//会议开始时间 + String end_time = Util.null2String(otherParam.get("end_time")) + ":00";//会议结束时间 + String hrmids = Util.null2String(otherParam.get("hrmids"));//会议参与人 + String password = Util.null2String(otherParam.get("password"));//会议密码 + String apiKey = Util.null2String(otherParam.get("api_key"));//对应亿联的client id + String apiSecret = Util.null2String(otherParam.get("api_secret"));//对应亿联的client secret + //这里需要替换创建人的ID + String host = StringUtils.removeEnd(getDomainName_url(), "/"); + //获取token + String token = YealinkVideoUtil.getToken(host, apiKey, apiSecret); + //开始执行请求 + String createUserId = YealinkVideoUtil.getYeaLinkUserId(host, token, userid); + String url = host + "/users/" + createUserId + "/meetings"; + //构建请求体 + JSONObject body = new JSONObject(); + //会议主题,长度小于128 + if (topic.length() > 128) { + topic = StringUtils.substring(topic, 0, 128); + } + body.put("subject", topic); + //会议开始日期,格式为yyyy-MM-dd + Date start = DateUtils.parseDate(start_time, "yyyy-MM-dd HH:mm:ss"); + if (start.compareTo(new Date()) < 0) { + start = new Date(); + } + String startDate = DateFormatUtils.format(start, "yyyy-MM-dd"); + body.put("startDate", startDate); + //会议开始时间,格式为HH:mm,小时部分使用24小时计算,分钟部分为5的倍数。会议开始时间必须大于当前时间。 + int minute = DateUtil.minute(start); + start = DateUtils.addMinutes(DateUtils.addMinutes(start, -minute % 5), 5); + String startTime = DateFormatUtils.format(start, "HH:mm"); + body.put("startTime", startTime); + //会议持续时间小时部分,取值范围为[0, 48)。 + int[] dateHoursAndMinute = getDateHoursAndMinute(start, DateUtils.parseDate(end_time, "yyyy-MM-dd HH:mm:ss")); + int durationHour = dateHoursAndMinute[0]; + body.put("durationHour", durationHour); + //会议持续时间分钟部分,当durationHour为0时,可选值为:30、45;其他情况下,可选值为:0、15、30、45。 + int durationMinute = dateHoursAndMinute[1]; + body.put("durationMinute", durationMinute); + //参会成员列表。参会成员数量默认支持100个,如需调整请联系亿联会议,默认创建者为组织者 + JSONArray participants = new JSONArray(); + //首先添加组织者 + JSONObject createUser = new JSONObject(); + createUser.put("id", createUserId); + createUser.put("role", 0); + participants.add(createUser); + for (String hrmid : StringUtils.split(hrmids, ",")) { + JSONObject participant = new JSONObject(); + participant.put("id", YealinkVideoUtil.getYeaLinkUserId(host, token, hrmid)); + participant.put("role", 2); + participants.add(participant); + } + body.put("participants", participants); + //是否使用随机会议号,true:使用随机会议号,false:使用会议室会议号 + body.put("enableRandomMeetingNumber", true); + //会议密码,格式为:6位数字 + body.put("meetingPassword", password); + body.put("enableWatermark", true); + body.put("watermarkTransparency", 2); + body.put("watermarkFontSize", 1); + //执行接口 + JSONObject resultJson = YealinkVideoUtil.doPost(url, token, null, body); + //返回结果 + apiData.put("maxid", videoData2OA(host, token, createUserId, resultJson, otherParam)); + apiData.put("api_status", true); + } catch (Exception e) { + logger.writeLog("^^^ YealinkVideoClient.addMeeting : error !!!", e); + apiData.put("api_status", false); + apiData.put("msg", "新增亿联会议失败:" + e.getMessage()); + } + return apiData; + } + + @Override + public Map editMeeting(Map otherParam) { + Map apiData = new HashMap<>(); + try { + if ("".equals(Util.null2String(getDomainName_url()))) { + throw new RuntimeException("获取亿联会议地址URl未配置,请检查视频会议是否配置正常!"); + } + //获取参数 + logger.writeLog("^^^ YealinkVideoClient.editMeeting : otherParam = " + otherParam); + String userid = Util.null2String(otherParam.get("userid"));//创建人ID + String topic = Util.null2String(otherParam.get("topic"));//会议标题 + String start_time = Util.null2String(otherParam.get("starttime")) + ":00";//会议开始时间 + String end_time = Util.null2String(otherParam.get("end_time")) + ":00";//会议结束时间 + String hrmids = Util.null2String(otherParam.get("hrmids"));//会议参与人 + String password = Util.null2String(otherParam.get("password"));//会议密码 + String apiKey = Util.null2String(otherParam.get("api_key"));//对应亿联的client id + String apiSecret = Util.null2String(otherParam.get("api_secret"));//对应亿联的client secret + //这里需要替换创建人的ID + String host = StringUtils.removeEnd(getDomainName_url(), "/"); + //获取token + String token = YealinkVideoUtil.getToken(host, apiKey, apiSecret); + //开始执行请求 + String createUserId = YealinkVideoUtil.getYeaLinkUserId(host, token, userid); + //会议ID + String meetingId = Util.null2String(otherParam.get("id")); + String url = host + "/users/" + createUserId + "/meetings/" + meetingId; + //先获取原始会议信息 + JSONObject meetingInfo = getMeetingInfoById(host, token, createUserId, meetingId); + //构建请求体 + JSONObject body = new JSONObject(); + //更新类型,可选值:0:更新单个会议,1:更新会议序列 + body.put("updateType", 0); + //会议顺序号,取值范围为[1, 100],更新单个会议时必输 + body.put("sequence", 1); + //时区ID。具体时区列表信息详见基础信息-查询时区列表接口 + body.put("zoneId", meetingInfo.getString("zoneId")); + //会议主题,长度小于128 + if (topic.length() > 128) { + topic = StringUtils.substring(topic, 0, 128); + } + body.put("subject", topic); + //会议开始日期,格式为yyyy-MM-dd + Date start = DateUtils.parseDate(start_time, "yyyy-MM-dd HH:mm:ss"); + if (start.compareTo(new Date()) < 0) { + start = new Date(); + } + String startDate = DateFormatUtils.format(start, "yyyy-MM-dd"); + body.put("startDate", startDate); + //会议开始时间,格式为HH:mm,小时部分使用24小时计算,分钟部分为5的倍数。会议开始时间必须大于当前时间。 + int minute = DateUtil.minute(start); + start = DateUtils.addMinutes(DateUtils.addMinutes(start, -minute % 5), 5); + String startTime = DateFormatUtils.format(start, "HH:mm"); + body.put("startTime", startTime); + //会议持续时间小时部分,取值范围为[0, 48)。 + int[] dateHoursAndMinute = getDateHoursAndMinute(start, DateUtils.parseDate(end_time, "yyyy-MM-dd HH:mm:ss")); + int durationHour = dateHoursAndMinute[0]; + body.put("durationHour", durationHour); + //会议持续时间分钟部分,当durationHour为0时,可选值为:30、45;其他情况下,可选值为:0、15、30、45。 + int durationMinute = dateHoursAndMinute[1]; + body.put("durationMinute", durationMinute); + //参会成员列表。参会成员数量默认支持100个,如需调整请联系亿联会议,默认创建者为组织者 + JSONArray participants = new JSONArray(); + //首先添加组织者 + JSONObject createUser = new JSONObject(); + createUser.put("id", createUserId); + createUser.put("role", 0); + participants.add(createUser); + for (String hrmid : StringUtils.split(hrmids, ",")) { + JSONObject participant = new JSONObject(); + participant.put("id", YealinkVideoUtil.getYeaLinkUserId(host, token, hrmid)); + participant.put("role", 2); + participants.add(participant); + } + body.put("participants", participants); + //是否使用随机会议号,true:使用随机会议号,false:使用会议室会议号 + body.put("enableRandomMeetingNumber", true); + //会议密码,格式为:6位数字 + body.put("meetingPassword", meetingInfo.getString("meetingPassword")); + //执行接口 + JSONObject resultJson = YealinkVideoUtil.doPut(url, token, null, body); + if (resultJson == null) { + resultJson = new JSONObject(); + resultJson.put("id", meetingId); + } + //返回结果 + apiData.put("maxid", videoData2OA(host, token, createUserId, resultJson, otherParam)); + apiData.put("api_status", true); + } catch (Exception e) { + logger.writeLog("^^^ YealinkVideoClient.editMeeting : error !!!", e); + apiData.put("api_status", false); + apiData.put("msg", "编辑亿联会议失败:" + e.getMessage()); + } + return apiData; + } + + @Override + public Map overMeeting(Map otherParam) { + otherParam.put("completed", true); + RecordSet rs = new RecordSet(); + String id = MapUtils.getString(otherParam, "id", ""); + String manufacturers = MapUtils.getString(otherParam, "manufacturers", ""); + rs.executeQuery("select id from meeting_videolist where videomtid=? and manufacturers=?", id, manufacturers); + if (rs.next()) { + String videoid = rs.getString(1); + otherParam.put("videoid", videoid); + } + return cancelMeeting(otherParam); + } + + @Override + public Map cancelMeeting(Map otherParam) { + Map apiData = new HashMap<>(); + try { + if ("".equals(Util.null2String(getDomainName_url()))) { + throw new RuntimeException("获取亿联会议地址URl未配置,请检查视频会议是否配置正常!"); + } + //获取参数 + logger.writeLog("^^^ YealinkVideoClient.cancelMeeting : otherParam = " + otherParam); + String userid = Util.null2String(otherParam.get("userid"));//创建人ID + //这两个需要重新获取 + otherParam = VideoMeetingUtil.dealParams(otherParam); + String apiKey = Util.null2String(otherParam.get("api_key"));//对应亿联的client id + String apiSecret = Util.null2String(otherParam.get("api_secret"));//对应亿联的client secret + //这里需要替换创建人的ID + String host = StringUtils.removeEnd(getDomainName_url(), "/"); + //获取token + String token = YealinkVideoUtil.getToken(host, apiKey, apiSecret); + //开始执行请求 + String createUserId = YealinkVideoUtil.getYeaLinkUserId(host, token, userid); + //会议ID + String meetingId = Util.null2String(otherParam.get("id")); + String url = host + "/users/" + createUserId + "/meetings/" + meetingId; + //构建请求体 + JSONObject body = new JSONObject(); + //删除类型,可选值:0:删除单个会议,1:删除会议序列 + body.put("deleteType", 0); + //会议顺序号,取值范围为[1, 100],删除单个会议时必输 + body.put("sequence", 1); + //执行接口 + JSONObject resultJson = YealinkVideoUtil.doDelete(url, token, null, body); + //处理对应的日程 + String videoid = MapUtils.getString(otherParam, "videoid", "-1"); + if (otherParam.containsKey("completed")) { + finishWorkPlan(videoid); + } else { + deleteWorkPlan(videoid); + } + //返回结果 + apiData.put("result", true); + } catch (Exception e) { + logger.writeLog("^^^ YealinkVideoClient.editMeeting : error !!!", e); + apiData.put("result", false); + apiData.put("msg", "删除亿联会议失败:" + e.getMessage()); + } + return apiData; + } + + @Override + public Map getUserInfo(Map otherParam) { + return null; + } + + /** + * 获取间隔小时数 + * + * @param start + * @param end + * @return + */ + private int[] getDateHoursAndMinute(Date start, Date end) { + int[] arr = new int[2]; + long milliseconds = end.getTime() - start.getTime(); + long seconds = milliseconds / 1000; + int hours = Math.round(seconds / 3600); + int minutes = Math.round((seconds % 3600) / 60); + if (minutes > 45) { + hours += 1; + minutes = 0; + } else if (minutes > 30) { + minutes = 45; + } else { + if (hours > 0) { + if (minutes > 15) { + minutes = 30; + } else if (minutes > 0) { + minutes = 15; + } + } else { + minutes = 30; + } + } + if (hours >= 48) { + hours = 47; + } + arr[0] = hours; + arr[1] = minutes; + return arr; + } + + /** + * 视频数据同步到OA + * + * @param resultJson + * @param map + * @return + */ + private String videoData2OA(String host, String token, String creater, JSONObject resultJson, Map map) { + String maxId = ""; + String videomthostid = Util.null2String(map.get("host_id")); + String videomtname = Util.null2String(map.get("topic")); +// String videomtbegindate = Util.null2String(map.get("start_time")); + String starttime = Util.null2String(map.get("starttime")); + String videomtenddate = Util.null2String(map.get("end_time")); + String videomtcreater = Util.null2String(map.get("userid")); +// String mtpassword = Util.null2String(map.get("password")); +// String mtcontrolpassword = Util.null2String(map.get("controlpassword")); +// String userid = Util.null2String(map.get("userid")); + String manufacturers = Util.null2String(map.get("manufacturers")); + String mouldkey = Util.null2String(map.get("mouldkey"));//模块主键 + String frommould = Util.null2String(map.get("frommould"));//所属模块 + String videoid = Util.null2String(map.get("videoid")); + String hrmids = Util.null2String(map.get("hrmids")); + RecordSet recordSet = new RecordSet(); + recordSet.executeQuery("SELECT * FROM meeting_videomould WHERE mouldvalue = ? or mouldname = ?", frommould, frommould); + if (recordSet.next()) { + //这里强制约定。这里传的标识,必须和表里保持一致,否则,作为垃圾数据处理。 + frommould = Util.null2String(recordSet.getString("mouldvalue")); + } else { + frommould = ""; + mouldkey = ""; + } + //获取接口返回的会议ID + String videomtstatus = "1";//0,未开始,1进行中,2结束,3取消(根据时间来判断) + String videomtid = Util.null2String(resultJson.getString("id"));//虚拟会议id + //这里需要根据会议ID再次查询会议详细信息 + JSONObject json = getMeetingInfoById(host, token, creater, videomtid); + String mtpwd = Util.null2String(json.getString("meetingPassword")); + String mtnum = Util.null2String(json.getString("meetingNumber")); + String url2 = getYealinkUrl(host, token, mtnum, videomtcreater, mtpwd); + String url1 = url2; + try { + ResourceComInfo resourceComInfo = new ResourceComInfo(); + url1 = StringUtils.replace(url1, "&name=", "&name=" + URLEncoder.encode(resourceComInfo.getLastname(videomtcreater), "utf-8")); + if (url1.contains("&autojoin=false")) { + url1 = StringUtils.replace(url1, "&autojoin=false", "&autojoin=true"); + } + } catch (Exception e) { + logger.writeLog("^^^ YealinkVideoClient.videoData2OA : encode error !!!", e); + } + //更新到视频会议表 + RecordSet rs = new RecordSet(); + String oaMtid = mtnum; + VideoMeetingUtil videoMeetingUtil = new VideoMeetingUtil(); + if (StringUtils.isBlank(videoid)) { + if (rs.getDBType().equalsIgnoreCase("oracle") && Util.null2String(rs.getOrgindbtype()).equals("oracle")) { + rs.executeUpdate("INSERT INTO meeting_videolist (videomtid ,videomthostid , videomtname ,videomtbegindate ," + + "videomtenddate ,videomtcreater ,videomtstatus ,manufacturers ,frommould ,mouldkey,mtpassword," + + "oaMtid,videomtstarturl,videomtjoinurl) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?)", + videomtid, videomthostid, videomtname, starttime, videomtenddate, videomtcreater, videomtstatus, + manufacturers, frommould, mouldkey, mtpwd, oaMtid, url1, url2); + } else { + rs.executeUpdate("INSERT INTO meeting_videolist (videomtid ,videomthostid , videomtname ,videomtbegindate ," + + "videomtenddate ,videomtcreater ,videomtstatus ,manufacturers ,frommould ,mouldkey,mtpassword," + + "oaMtid,hrmids,videomtstarturl,videomtjoinurl) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", + videomtid, videomthostid, videomtname, starttime, videomtenddate, videomtcreater, videomtstatus, + manufacturers, frommould, mouldkey, mtpwd, oaMtid, hrmids, url1, url2); + } + rs.executeQuery("SELECT max(id) FROM meeting_videolist where videomtcreater = ?", videomtcreater); + rs.next(); + String MaxID = rs.getString(1); + if (rs.getDBType().equalsIgnoreCase("oracle") && Util.null2String(rs.getOrgindbtype()).equals("oracle")) { + rs.executeUpdate("update meeting_videolist set hrmids = empty_clob() where id = ?", MaxID); + videoMeetingUtil.updateHrmmembers(MaxID, hrmids); + } + maxId = MaxID; + } else { + if (rs.getDBType().equalsIgnoreCase("oracle") && Util.null2String(rs.getOrgindbtype()).equals("oracle")) { + rs.executeUpdate("update meeting_videolist set videomtid = ?, videomtname = ?,videomtbegindate = ?," + + "videomtenddate = ?,mtpassword = ?,videomtstarturl = ?,videomtjoinurl = ?,hrmids = empty_clob() " + + "where id =?", videomtid, videomtname, starttime, videomtenddate, mtpwd, url1, url2, videoid); + videoMeetingUtil.updateHrmmembers(videoid, hrmids); + } else { + rs.executeUpdate("update meeting_videolist set videomtid = ?, videomtname = ?,videomtbegindate = ?," + + "videomtenddate = ?,mtpassword = ?,videomtstarturl = ?,videomtjoinurl = ?,hrmids=? " + + "where id =?", videomtid, videomtname, starttime, videomtenddate, mtpwd, url1, url2, hrmids, videoid); + } + maxId = videoid; + } + //同步日程 + handleWorkPlan(maxId, Util.getIntValue(videomtcreater), videomtname, hrmids, starttime, videomtenddate, oaMtid); + return maxId; + } + + /** + * 处理日程信息 + * + * @param videoMtId + * @param createrId + * @param title + * @param hrmids + * @param start + * @param end + * @param mtNum + */ + private void handleWorkPlan(String videoMtId, int createrId, String title, + String hrmids, String start, String end, + String mtNum) { + try { + WorkPlan workPlan = new WorkPlan(); + RecordSet rs = new RecordSet(); + //查询是否存在此日程 + rs.executeQuery("select id from workplan where videomtid=?", videoMtId); + int workPlanId = -1; + if (rs.next()) { + workPlanId = Util.getIntValue(rs.getString(1)); + } + if (workPlanId > 0) {//修改 + workPlan.setWorkPlanID(workPlanId); + //获取原日程信息 + getWorkPlanById(rs, workPlan); + } else {//新增 + workPlan.setCreateType(1); + //紧急程度 + workPlan.setUrgentLevel("1"); + //日程提醒方式 + workPlan.setRemindType(com.engine.workplan.util.WorkPlanUtil.getWorkPlanDefaultRemindTypeIds()); + //日程类型 + workPlan.setWorkPlanType(1); + //是否开始前提醒 + workPlan.setRemindBeforeStart("1"); + //是否结束前提醒 + workPlan.setRemindBeforeEnd("0"); + // + workPlan.setRemindTimesBeforeStart(10); + workPlan.setRemindTimesBeforeEnd(10); + // + workPlan.setStatus(Constants.WorkPlan_Status_Unfinished); + } + //创建人 + workPlan.setCreaterId(createrId); + //标题 + workPlan.setWorkPlanName(title); + //接收人 + workPlan.setResourceId(hrmids); //系统参与人 + if (StringUtils.isBlank(workPlan.getResourceId()) && createrId > 0) {//接收人为空,默认直接 + workPlan.setResourceId(createrId + ""); + } + //开始时间 + String beginDate = "", beginTime = ""; + if (StringUtils.isNotBlank(start)) { + String[] s = StringUtils.split(start, " "); + beginDate = s[0]; + if (s.length > 1) { + beginTime = s[1]; + if (beginTime.length() == 8) { + beginTime = StringUtils.substringBeforeLast(beginTime, ":"); + } + } + } + workPlan.setBeginDate(beginDate); //开始日期 + workPlan.setBeginTime(beginTime); //开始时间 + //结束时间 + String endDate = "", endTime = ""; + if (StringUtils.isNotBlank(end)) { + String[] s = StringUtils.split(end, " "); + endDate = s[0]; + if (s.length > 1) { + endTime = s[1]; + if (endTime.length() == 8) { + endTime = StringUtils.substringBeforeLast(endTime, ":"); + } + } + } + workPlan.setEndDate(endDate); //结束日期 + workPlan.setEndTime(endTime); //结束时间 + //内容 + User user = User.getUser(createrId, 0); + String description = SystemEnv.getHtmlLabelName(10000849, Util.getIntValue(user.getLanguage())) + ":" + workPlan.getWorkPlanName() + + " " + SystemEnv.getHtmlLabelName(81901, user.getLanguage()) + ":" + workPlan.getBeginDate() + " " + workPlan.getBeginTime() + + " " + SystemEnv.getHtmlLabelName(525536, user.getLanguage()) + ":[亿联] " + mtNum; + workPlan.setDescription(description); + //是否来自外部系统 + workPlan.setIsFromOthSystem(false); + if (!"".equals(workPlan.getBeginDate()) && null != workPlan.getBeginDate()) { + List beginDateTimeRemindList = Util.processTimeBySecond(workPlan.getBeginDate(), workPlan.getBeginTime(), workPlan.getRemindTimesBeforeStart() * -1 * 60); + workPlan.setRemindDateBeforeStart((String) beginDateTimeRemindList.get(0)); //开始前提醒日期 + workPlan.setRemindTimeBeforeStart((String) beginDateTimeRemindList.get(1)); //开始前提醒时间 + } + if (!"".equals(workPlan.getEndDate()) && null != workPlan.getEndDate()) { + List endDateTimeRemindList = Util.processTimeBySecond(workPlan.getEndDate(), workPlan.getEndTime(), workPlan.getRemindTimesBeforeEnd() * -1 * 60); + workPlan.setRemindDateBeforeEnd((String) endDateTimeRemindList.get(0)); //结束前提醒日期 + workPlan.setRemindTimeBeforeEnd((String) endDateTimeRemindList.get(1)); //结束前提醒时间 + } + //附件 + String workPlanType = workPlan.getWorkPlanType() + ""; + WorkPlanService workPlanService = new WorkPlanService(); + WorkPlanShare workPlanShare = new WorkPlanShare(); + if (workPlan.getWorkPlanID() > 0) { + //修改 + WorkPlan oldWorkPlan = new WorkPlan(); + oldWorkPlan.setWorkPlanID(workPlan.getWorkPlanID()); + workPlanService.updateWorkPlan(oldWorkPlan, workPlan); + try { + workPlanShare.setShareDetail(workPlan.getWorkPlanID() + ""); + } catch (Exception e) { + logger.writeLog("^^^ YealinkVideoClient.handleWorkPlan : setShareDetail error !!!", e); + } + } else { + //新增 + workPlanService.insertWorkPlan(workPlan); //插入日程 + try { + workPlanShare.setDefaultShareDetail(user, String.valueOf(workPlan.getWorkPlanID()), workPlanType);//只在新增的时候设置默认共享 + } catch (Exception e) { + logger.writeLog("^^^ YealinkVideoClient.handleWorkPlan : setDefaultShareDetail error !!!", e); + } + rs.executeUpdate("update workplan set videomtid=? where id=?", videoMtId, workPlan.getWorkPlanID()); + } + } catch (Exception e) { + logger.writeLog("^^^ YealinkVideoClient.handleWorkPlan : 用户[" + createrId + "]日程处理处理失败!", e); + } + } + + /** + * 删除对应的日程 + * + * @param videoMtId + */ + private void deleteWorkPlan(String videoMtId) { + RecordSet rs = new RecordSet(); + rs.executeQuery("select id from workplan where videomtid=?", videoMtId); + int workPlanId = -1; + if (rs.next()) { + workPlanId = Util.getIntValue(rs.getString(1)); + } + if (workPlanId > 0) { + new WorkPlanHandler().delete(workPlanId + ""); + } + } + + /** + * 完成日程 + * + * @param videoMtId + */ + private void finishWorkPlan(String videoMtId) { + RecordSet rs = new RecordSet(); + rs.executeQuery("select id from workplan where videomtid=?", videoMtId); + int workPlanId = -1; + if (rs.next()) { + workPlanId = Util.getIntValue(rs.getString(1)); + } + if (workPlanId > 0) { + new WorkPlanHandler().finishWorkPlan(workPlanId + ""); + } + } + + /** + * 获取原日程信息 + * + * @param rs + * @param workPlan + */ + private void getWorkPlanById(RecordSet rs, WorkPlan workPlan) { + rs.executeQuery("select * from workplan where id=?", workPlan.getWorkPlanID()); + rs.next(); + workPlan.setWorkPlanType(Util.getIntValue(rs.getString("type_n"))); + workPlan.setBeginDate(Util.null2String(rs.getString("begindate"))); + workPlan.setBeginTime(Util.null2String(rs.getString("begintime"))); + workPlan.setEndDate(Util.null2String(rs.getString("enddate"))); + workPlan.setEndTime(Util.null2String(rs.getString("endtime"))); + workPlan.setStatus(Util.null2String(rs.getString("status"))); + workPlan.setCreaterId(Util.getIntValue(rs.getString("createrid"))); + workPlan.setWorkPlanName(Util.null2String(rs.getString("name"))); + workPlan.setCreateType(Util.getIntValue(rs.getString("creatertype"))); + workPlan.setUrgentLevel(Util.null2String(rs.getString("urgentlevel"))); + workPlan.setRemindType(Util.null2String(rs.getString("remindtype"))); + workPlan.setRemindTimesBeforeStart(Util.getIntValue(rs.getString("remindtimesbeforestart"))); + workPlan.setRemindTimesBeforeEnd(Util.getIntValue(rs.getString("remindtimesbeforeend"))); + workPlan.setRemindBeforeStart(Util.null2String(rs.getString("remindbeforestart"))); + workPlan.setRemindBeforeEnd(Util.null2String(rs.getString("remindbeforeend"))); + workPlan.setRemindDateBeforeStart(Util.null2String(rs.getString("reminddatebeforestart"))); + workPlan.setRemindTimeBeforeStart(Util.null2String(rs.getString("remindtimebeforestart"))); + workPlan.setRemindDateBeforeEnd(Util.null2String(rs.getString("reminddatebeforeend"))); + workPlan.setRemindTimeBeforeEnd(Util.null2String(rs.getString("remindtimebeforeend"))); + workPlan.setResourceId(Util.null2String(rs.getString("resourceid"))); + workPlan.setUuid(Util.null2String(rs.getString("uuid"))); + } + + /** + * 获取入会链接 + * + * @param host + * @param token + * @param mtnum + * @param userId + * @param meetingPassword + * @return + */ +private String getYealinkUrl(String host, String token, String mtnum, String userId, String meetingPassword) { + String url = host + "/meeting-join-links/" + mtnum; + JSONObject body = new JSONObject(); + body.put("language", "zh"); + body.put("password", meetingPassword); + JSONObject resultJson = YealinkVideoUtil.doGet(url, token, null, body); + return resultJson.getString("joinLink"); + } + + /** + * 查询会议信息 + * + * @param host + * @param token + * @param userId + * @param mtId + * @return + */ + private JSONObject getMeetingInfoById(String host, String token, String userId, String mtId) { + String url = host + "/users/" + userId + "/meetings/" + mtId; + JSONObject body = new JSONObject(); + body.put("sequence", 1); + return YealinkVideoUtil.doGet(url, token, null, body); + } +} diff --git a/weaver/workflow/request/RequestDeleteUtils.java b/weaver/workflow/request/RequestDeleteUtils.java new file mode 100644 index 0000000..4632dbc --- /dev/null +++ b/weaver/workflow/request/RequestDeleteUtils.java @@ -0,0 +1,1175 @@ +package weaver.workflow.request; + +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.JSONArray; +import com.api.doc.search.service.OperateService; +import com.api.workflow.util.ServiceUtil; +import com.cloudstore.dev.api.util.Util_TableMap; +import com.engine.kq.biz.KQFlowActiontBiz; +import com.engine.workflow.biz.requestForm.RequestFlowRemindBiz; +import com.engine.workflow.biz.requestList.RequestAttentionBiz; +import com.engine.workflow.biz.workflowCore.WorkflowBaseBiz; +import com.engine.workflow.entity.core.NodeInfoEntity; +import net.freeutils.tnef.msg.Msg; +import weaver.common.StringUtil; +import weaver.conn.RecordSet; +import weaver.conn.RecordSetTrans; +import weaver.conn.constant.DBConstant; +import weaver.cpt.util.CptWfUtil; +import weaver.docs.docs.util.DocumentDeleteSecurityUtil; +import weaver.docs.docs.util.DocumentDeleteStatusMould; +import weaver.docs.docs.util.MouldStatus; +import weaver.fna.general.FnaCommon; +import weaver.general.BaseBean; +import weaver.general.DBColumnTypeUtils; +import weaver.general.Util; +import weaver.hrm.User; +import weaver.hrm.attendance.manager.HrmAttVacationManager; +import weaver.hrm.attendance.manager.HrmPaidLeaveManager; +import weaver.systeminfo.SysMaintenanceLog; +import weaver.workflow.monitor.Monitor; +import weaver.workflow.monitor.MonitorDTO; +import weaver.workflow.msg.MsgPushUtil; +import weaver.workflow.msg.PoppupRemindInfoUtil; +import weaver.workflow.msg.entity.MsgEntity; +import weaver.workflow.report.RequestDeleteLog; +import weaver.workflow.workflow.WfFunctionManageUtil; +import weaver.workflow.workflow.WorkflowConfigComInfo; + +import java.util.*; +/** + * 流程删除 + * @ClassName:RequestDeleteUtils + * @Description:TODO + * @author wuser0326 + * @date Nov 15, 2016 5:44:09 PM + * + */ +public class RequestDeleteUtils extends BaseBean { + + private Map deleteTableMap; + + private int requestid; + private RecordSetTrans rst; + private RequestDeleteLog log; + private JSONObject delDataInfo; + + private int isbill; + private int formid; + private int workflowid; + + private User user; + private DocumentDeleteSecurityUtil docDeleteUtil = new DocumentDeleteSecurityUtil(); + private String message; + private String messageContent; + + private void init() { + RecordSet rs = new RecordSet(); + delDataInfo = new JSONObject(); + boolean isoracle = rs.getDBType().equals("oracle"); + // 需要复制数据的相关表 + deleteTableMap = new HashMap(); + RequestDeleteInfo rdi = new RequestDeleteInfo(); + List clobColumns = new ArrayList(); + + // workflow_requestbase + String queryWhere = " where requestid = " + requestid; + if (isoracle) { + clobColumns.add("HRMIDS"); + rdi.setClobColumn(clobColumns); + } + rdi.setCopytablename("workflow_requestbase_dellog"); + rdi.setPrimarykey("requestid"); + rdi.setQueryWhere(queryWhere); + deleteTableMap.put("workflow_requestbase", rdi); + + // workflow_currentoperator + rdi = new RequestDeleteInfo(); + rdi.setCopytablename("workflow_curroperator_dellog"); + rdi.setQueryWhere(queryWhere); + deleteTableMap.put("workflow_currentoperator", rdi); + + // workflow_requestLog + rdi = new RequestDeleteInfo(); + if (isoracle) { + clobColumns = new ArrayList(); + clobColumns.add("REMARK"); + clobColumns.add("RECEIVEDPERSONS"); + clobColumns.add("RECEIVEDPERSONIDS"); + rdi.setClobColumn(clobColumns); + } + rdi.setCopytablename("workflow_requestLog_dellog"); + rdi.setPrimarykey("logid"); + rdi.setQueryWhere(queryWhere); + deleteTableMap.put("workflow_requestLog", rdi); + + // workflow_nownode + rdi = new RequestDeleteInfo(); + rdi.setCopytablename("workflow_nownode_dellog"); + rdi.setQueryWhere(queryWhere); + deleteTableMap.put("workflow_nownode", rdi); + + //删除数据的相关表 + queryWhere = " where exists (select 1 from workflow_requestLog where workflow_requestLog.requestid = " + requestid + " and workflow_requestLog.logid = workflow_logviewusers.logid)"; + rdi = new RequestDeleteInfo(); + rdi.setQueryWhere(queryWhere); + deleteTableMap.put("workflow_logviewusers", rdi); + + queryWhere = " where id = " + requestid; + rdi = new RequestDeleteInfo(); + rdi.setQueryWhere(queryWhere); + deleteTableMap.put("workflow_requestViewLog", rdi); + + queryWhere = " where requestid = " + requestid; + rdi = new RequestDeleteInfo(); + rdi.setQueryWhere(queryWhere); + deleteTableMap.put("Workflow_SharedScope", rdi); + + queryWhere = "where id in (select a.id from (select wgt.id from workflow_groupdetail wgt, workflow_nodegroup wng , workflow_nodebase wnb where wgt.groupid = wng.id and wng.nodeid = wnb.id and wnb.IsFreeNode = '1' and wnb.requestid = " + requestid + ") a)"; + rdi = new RequestDeleteInfo(); + rdi.setQueryWhere(queryWhere); + deleteTableMap.put("workflow_groupdetail", rdi); + + queryWhere = " where EXISTS(select 1 from workflow_nodebase b where workflow_nodegroup.nodeid=b.id and b.IsFreeNode='1' and b.requestid=" + requestid + ")"; + rdi = new RequestDeleteInfo(); + rdi.setQueryWhere(queryWhere); + deleteTableMap.put("workflow_nodegroup", rdi); + + queryWhere = " where EXISTS(select 1 from workflow_nodebase b where workflow_nodemode.nodeid=b.id and b.IsFreeNode='1' and b.requestid= " + requestid + ")"; + rdi = new RequestDeleteInfo(); + rdi.setQueryWhere(queryWhere); + deleteTableMap.put("workflow_nodemode", rdi); + + //queryWhere = " where EXISTS(select 1 from workflow_nodebase b where workflow_nodeform.nodeid=b.id and b.IsFreeNode='1' and b.requestid= " + requestid + ")"; + queryWhere = " join workflow_nodebase b on a.nodeid=b.id where b.IsFreeNode='1' and b.requestid= " + requestid ; + rdi = new RequestDeleteInfo(); + rdi.setQueryWhere(queryWhere); + deleteTableMap.put("workflow_nodeform", rdi); + + queryWhere = " where EXISTS(select 1 from workflow_nodebase b where workflow_flownode.nodeid=b.id and b.IsFreeNode='1' and b.requestid=" + requestid + ")"; + rdi = new RequestDeleteInfo(); + rdi.setQueryWhere(queryWhere); + deleteTableMap.put("workflow_flownode", rdi); + + queryWhere = " where EXISTS(select 1 from workflow_nodebase b where workflow_nodelink.nodeid=b.id and b.IsFreeNode='1' and b.requestid=" + requestid + ") or EXISTS(select 1 from workflow_nodebase b where workflow_nodelink.destnodeid=b.id and b.IsFreeNode='1' and b.requestid=" + requestid + + ") or wfrequestid=" + requestid; + rdi = new RequestDeleteInfo(); + rdi.setQueryWhere(queryWhere); + deleteTableMap.put("workflow_nodelink", rdi); + + queryWhere = " where IsFreeNode='1' and requestid=" + requestid; + rdi = new RequestDeleteInfo(); + rdi.setQueryWhere(queryWhere); + deleteTableMap.put("workflow_nodebase", rdi); + + //获取路径id + rs.executeQuery("select workflowid from workflow_requestbase where requestid = ? ", requestid); + if(rs.next()){ + workflowid = rs.getInt(1); + log.setWorkflowId(String.valueOf(workflowid)); + } + + //初始化表单信息 + rs.executeQuery("select isbill,formid from workflow_base where id = ? ", workflowid); + if(rs.next()){ + isbill = rs.getInt(1); + formid = rs.getInt(2); + } + } + + public RequestDeleteUtils() {} + + + public RequestDeleteUtils(int requestid, RecordSetTrans rst,RequestDeleteLog log) { + this.requestid = requestid; + this.rst = rst; + this.log = log; + } + + public RequestDeleteUtils(int requestid, RecordSetTrans rst,RequestDeleteLog log, User user) { + this.requestid = requestid; + this.rst = rst; + this.log = log; + this.user = user; + } + + public void executeDeleteRequest() throws Exception{ + RequestOperationMsgManager romm = new RequestOperationMsgManager(); + List deleteMsg = romm.requestDeletMsg(String.valueOf(requestid)); + + init(); + new RequestFlowRemindBiz().deleteFlowMsgByRequestid(requestid +""); + executeDeleteAddinOperate(); + updateCodeseqReserved(); + checkAndDeleteAcc(); + deleteBaseTableInfo(); + deleteFormData(); + deletePoppupRemindInfo(); + deleteSubWFRequestInfo(); + //删除表单数据 + log.save(rst); + String updatesql = "update workflow_requestdeletelog set deletetabledata = ?,isold='0' where request_id = ?"; + rst.executeUpdate(updatesql, delDataInfo.toString(),requestid); + this.deleteSuperviseByRequestId();//删除督办数据 + + new RequestAttentionBiz().cancelAttention(requestid,"delete",this.rst); + new MsgPushUtil().pushMsg(deleteMsg); + executeDeleteOdocLogs(requestid); + } + + public List executeDeleteRequestAndMsg() throws Exception{ + RequestOperationMsgManager romm = new RequestOperationMsgManager(); + List deleteMsg = romm.requestDeletMsg(String.valueOf(requestid)); + + init(); + new RequestFlowRemindBiz().deleteFlowMsgByRequestid(requestid +""); + executeDeleteAddinOperate(); + updateCodeseqReserved(); + checkAndDeleteAcc(); + deleteBaseTableInfo(); + deleteFormData(); + deletePoppupRemindInfo(); + deleteSubWFRequestInfo(); + //删除表单数据 + log.save(rst); + String updatesql = "update workflow_requestdeletelog set deletetabledata = ?,isold='0' where request_id = ?"; + rst.executeUpdate(updatesql, delDataInfo.toString(),requestid); + this.deleteSuperviseByRequestId();//删除督办数据 + + new RequestAttentionBiz().cancelAttention(requestid,"delete",this.rst); + executeDeleteOdocLogs(requestid); + + return deleteMsg; + } + + public void executeDeleteOdocLogs(int requestid) throws Exception{ + RecordSet rs = new RecordSet(); + rs.executeQuery("select 1 from odoc_requestdoc where requestid = ?",requestid); + if (rs.next()){ + rs.executeUpdate("delete from odoc_requestdoc where requestid = ?",requestid); + } + } + + + + //执行流程删除附加操作 + private void executeDeleteAddinOperate() throws Exception{ + RequestCheckAddinRules requestCheckAddinRules = new RequestCheckAddinRules(); + try { + requestCheckAddinRules.setTrack(false); + requestCheckAddinRules.setStart(false); + requestCheckAddinRules.setNodeid(-3); + requestCheckAddinRules.setRequestid(requestid); + requestCheckAddinRules.setWorkflowid(workflowid); + requestCheckAddinRules.setObjid(-3); + requestCheckAddinRules.setObjtype(1); + requestCheckAddinRules.setIsbill(isbill); + requestCheckAddinRules.setFormid(formid); + requestCheckAddinRules.setIspreadd("0"); + requestCheckAddinRules.setUser(this.user); + requestCheckAddinRules.setSpecialOperate(true); + requestCheckAddinRules.checkAddinRules(); + } catch (Exception e) { + this.message = requestCheckAddinRules.getRequestManager().getMessage(); + this.messageContent = requestCheckAddinRules.getRequestManager().getMessagecontent(); + e.printStackTrace(); + throw new Exception("workflow interface action error:"+e.getMessage()); + } + } + + /** + * 删除主流程中的子流程流转意见信息 + */ + public void deleteSubWFRequestInfo(){ + + List params = new ArrayList<>(); + RecordSet rs = new RecordSet(); + rs.executeQuery("select * from workflow_subwfrequest where subrequestid = ?", requestid); + while (rs.next()) { + List param = new ArrayList(); + param.add(rs.getInt(1)); + param.add(rs.getInt(2)); + param.add(rs.getInt(3)); + param.add(rs.getString(4)); + param.add(rs.getInt(5)); + param.add(rs.getInt(6)); + param.add(rs.getString(7)); + params.add(param); + } + rs.executeBatchSql("insert into Workflow_SubwfRequest_dellog values (?,?,?,?,?,?,?)", params); + rs.executeUpdate("delete from workflow_subwfrequest where subrequestid = ?", requestid); + } + /** + * 督办数据删除 + * @throws Exception + */ + private void deleteSuperviseByRequestId() throws Exception{ + rst.executeUpdate("delete from WORKFLOW_SUPERVISEOPERATOR where requestid = ?",requestid); + } + + /** + * 根据是否开启删除流程时同时删除附件,来删除附件 + */ + public void checkAndDeleteAcc() { + ArrayList checkids = new ArrayList(); + RecordSet checkrs = new RecordSet(); + checkrs.execute("select isneeddelacc from workflow_base where id in (select workflowid from workflow_requestbase where requestid ="+requestid+")"); + if(checkrs.next()){ + String isneeddelacc = checkrs.getString("isneeddelacc"); + if("1".equals(isneeddelacc)){ + this.delWfFormAcc(requestid, checkids); + this.delWfSignAcc(requestid, checkids); + } + } + + } + + /** + * 删除流程表单中所带的附件 + * @param requestid 流程ID + * @param checkids 不需要删除的文档ID + */ + private void delWfFormAcc(int requestid,ArrayList checkids){ + RecordSet rs=new RecordSet(); + RecordSet rs1=new RecordSet(); + RecordSet rsDelRq=new RecordSet(); + RecordSet rsDelDoc=new RecordSet(); + OperateService docExtUtil = new OperateService(); + + String sql = ""; + String delDocid = ""; + String delRqid = ""; + String uploadfieldname ; + String[] deleteDocIds; + rs.executeSql("select b.formid, b.isbill from workflow_requestbase a, workflow_base b where requestid = "+requestid+" and a.workflowid = b.id"); + if(rs.next()){ + int formid_tmp = Util.getIntValue(rs.getString("formid")); + int isbill_tmp = Util.getIntValue(rs.getString("isbill")); + if(isbill_tmp == 1){ + String tablename_tmp=""; + String detailtablename=""; + String detailkeyfield=""; + rs.execute("select tablename,detailtablename,detailkeyfield from workflow_bill where id="+formid_tmp); + if(rs.next()){ + tablename_tmp=Util.null2String(rs.getString(1)); + detailtablename=Util.null2String(rs.getString(2)).trim(); + detailkeyfield=Util.null2String(rs.getString(3)); + String tempdetail=""; + boolean temphasreqeustid=false; + if(!"".equals(tablename_tmp)){ + rsDelRq.executeSql("select fieldname,viewtype,detailtable from workflow_billfield where billid= "+formid_tmp+" and fieldhtmltype = '6'"); + while(rsDelRq.next()){ + uploadfieldname=Util.null2String(rsDelRq.getString(1)); + int tviewtype=Util.getIntValue(rsDelRq.getString(2),0); + String tdetailtable=Util.null2String(rsDelRq.getString(3)); + if(!uploadfieldname.trim().equals("")){ + if(tviewtype==0){ + sql="select "+uploadfieldname+" from "+tablename_tmp+" where requestid="+requestid; + }else{ + if(tdetailtable.trim().equals("")) tdetailtable=detailtablename; + boolean hasrequestid=false; + if(tempdetail.equals(tdetailtable)){ + hasrequestid=temphasreqeustid; + }else{ + if(rs.getDBType().toUpperCase().equals("ORACLE")){ + sql="select * from "+tdetailtable+" where rownum<2"; + }else{ + sql="select top 1 * from "+tdetailtable; + } + if(rs1.executeSql(sql)){ + String[] colnames=rs1.getColumnName(); + if(colnames!=null){ + for (int m=0;m'1')"); + while(rsDelRq.next()){ + uploadfieldname = rsDelRq.getString("fieldname"); + rsDelDoc.executeSql("select "+uploadfieldname+" from workflow_form where requestid = " + requestid); + if(rsDelDoc.next()){ + delDocid = rsDelDoc.getString(uploadfieldname); + if(delDocid!=null && !"".equals(delDocid)){ + deleteDocIds = Util.TokenizerString2(delDocid, ","); + for(int d=0; d delMsg = null; + try{ + if(deleteRequestIds == null || "".equals(deleteRequestIds)) return "fail"; + if(deleteRequestIds.endsWith(",")) deleteRequestIds = deleteRequestIds.substring(0,deleteRequestIds.length() - 1); + RecordSet temprs = new RecordSet(); + mrst.setAutoCommit(false); + Monitor monitor = new Monitor(); + String[] deleteRequestIdAarray = Util.TokenizerString2(deleteRequestIds, ","); + String tempDeleteRequestIds = ""; + SysMaintenanceLog SysMaintenanceLog = new SysMaintenanceLog(); + RecordSet rscpt = new RecordSet(); + boolean isRefCpt = false; + List deleteIngRequestList; + for (String deleteRequestId : deleteRequestIdAarray) { + synchronized (RequestDeleteUtils.class) { + Object obj = Util_TableMap.getObjVal("deleteIngRequestList"); + if (obj == null) { + obj = new LinkedList(); + Util_TableMap.setObjVal("deleteIngRequestList", obj); + } + deleteIngRequestList = (List) obj; + temprs.writeLog("lyy=====>deleteIngRequestList: " + deleteIngRequestList); + if (deleteIngRequestList.contains(deleteRequestId)) { + continue; + } else { + deleteIngRequestList.add(deleteRequestId); + temprs.writeLog("lyy=====>deleteIngRequestList1: " + deleteIngRequestList); + } + } + String workflowid_kq = ""; + temprs.execute("select creater,workflowid from workflow_requestbase where requestid = " + deleteRequestId); + if(temprs.next()){ + String creater = temprs.getString(1); + String workflowid = temprs.getString(2); + workflowid_kq = workflowid; + MonitorDTO dto = monitor.getMonitorInfo(String.valueOf(user.getUID()),creater,workflowid); + + //判断流程是否关联了资产模块 + rscpt.executeSql("select wfid from cpt_cptwfconf where wfid="+workflowid); + if(rscpt.next()){ + isRefCpt = true; + } + rscpt.executeSql("select formid from workflow_base where id="+workflowid); + if(rscpt.next()){ + int formid = rscpt.getInt(1); + if(formid==18||formid==19||formid==201||formid==220||formid==221||formid==222||formid==224){ + isRefCpt = true; + } + } + + boolean isdelete = dto.getIsdelete(); + if(isdelete){ + tempDeleteRequestIds += deleteRequestId+","; + }else{ + continue; + } + } + + try { + FnaCommon fnaCommon = new FnaCommon(); + fnaCommon.doWfForceOver(Util.getIntValue(deleteRequestId, 0), 0, true); + }catch(Exception easi) { + new BaseBean().writeLog(easi); + } + + //E9 新考勤,删除流程后删除流程数据 + try { + new KQFlowActiontBiz().delTest(Util.getIntValue(deleteRequestId, 0),workflowid_kq,"RequestDeleteUtils"); + }catch(Exception e) { + new BaseBean().writeLog(e); + } + + temprs.executeSql("select requestname,workflowid from workflow_requestbase where requestid="+deleteRequestId); + temprs.next(); + String temprequestname = temprs.getString("requestname"); + String tempworkflowid = temprs.getString("workflowid"); + + SysMaintenanceLog.resetParameter(); + SysMaintenanceLog.setRelatedId(Util.getIntValue(deleteRequestId)); + SysMaintenanceLog.setRelatedName(temprequestname); + SysMaintenanceLog.setOperateType("3"); + SysMaintenanceLog.setOperateDesc("delete workflow_currentoperator where requestid="+deleteRequestId+ + ";delete workflow_form where requestid="+deleteRequestId+ + ";delete workflow_formdetail where requestid="+deleteRequestId+ + ";delete workflow_requestLog where requestid="+deleteRequestId+ + ";delete workflow_requestViewLog where id="+deleteRequestId+ + ";delete workflow_requestbase where requestid="+deleteRequestId); + SysMaintenanceLog.setOperateItem("85"); + SysMaintenanceLog.setOperateUserid(user.getUID()); + SysMaintenanceLog.setClientAddress(clientIp); + SysMaintenanceLog.setOperatesmalltype(1); + SysMaintenanceLog.setSysLogInfo(); + + //1:请求 + + try{ + RequestDeleteLog log = initRequestDeleteLog(user, clientIp, deleteRequestId); + + this.requestid =Util.getIntValue(deleteRequestId); + this.rst = mrst; + this.log = log; + this.user = user; + delMsg = this.executeDeleteRequestAndMsg(); + }catch (Exception exception){ + exception.printStackTrace(); + writeLog(exception); + if(exception.getMessage().indexOf("workflow interface action error")>-1){ + return "actionfail"; + } + } finally { + deleteIngRequestList.remove(deleteRequestId); + } + } + + if(tempDeleteRequestIds.length() > 0){ + tempDeleteRequestIds = tempDeleteRequestIds.substring(0,tempDeleteRequestIds.length() - 1); + + String[] tempDeleteRequestIdArray = Util.TokenizerString2(tempDeleteRequestIds, ","); + + if(isRefCpt){ + temprs.executeSql("update cptcapital set frozennum=0 where isdata='2' and frozennum > 0"); + CptWfUtil cwu = new CptWfUtil(); + cwu.DoFrozenCpt_new(); + } + + //删除费用信息表中的相应数据-----begin +// for(int i=0;i delMsg = executeDeleteRequestAndMsg(); + trst.commit(); + + new MsgPushUtil().pushMsg(delMsg); + } catch (Exception e) { + writeLog(e); + trst.rollback(); + return false; + } + return true; + } + + /** + * 公文内部交换删除流程方法 + * @param user + * @param clientipOrFrom + * @param requestid + * @return + */ + public boolean requestDeleteForOdoc(User user,String clientipOrFrom,int requestid){ + RecordSetTrans trst = new RecordSetTrans(); + trst.setAutoCommit(false); + RequestDeleteLog log = initRequestDeleteLog(user, clientipOrFrom, String.valueOf(requestid)); + + this.log = log; + this.rst = trst; + this.requestid = requestid; + this.user = user; + + try { + List delMsg = executeDeleteRequestAndMsg(); + trst.commit(); + new MsgPushUtil().pushMsg(delMsg); + } catch (Exception e) { + writeLog(e); + trst.rollback(); + return false; + } + return true; + } + + + /** + * 创建log对象 + * @param user + * @param clientIp + * @param deleteRequestId + * @return + */ + public RequestDeleteLog initRequestDeleteLog(User user, String clientIp, String deleteRequestId) { + Calendar today = Calendar.getInstance(); + String formatdate = Util.add0(today.get(Calendar.YEAR), 4) + "-" + Util.add0(today.get(Calendar.MONTH)+1,2) + "-" + Util.add0(today.get(Calendar.DAY_OF_MONTH), 2); + String formattime = Util.add0(today.get(Calendar.HOUR_OF_DAY), 2) + ":" + Util.add0(today.get(Calendar.MINUTE), 2) + ":" +Util.add0(today.get(Calendar.SECOND), 2); + + RecordSet rs1 = new RecordSet(); + RequestDeleteLog log = new RequestDeleteLog(); + rs1.executeQuery("select requestname,workflowid from workflow_requestbase where requestid = ?", deleteRequestId); + if(rs1.next()){ + log.setRequestName(Util.fromScreen2(rs1.getString(1), user.getLanguage())); + log.setWorkflowId(rs1.getString(2)); + } + log.setRequestId(String.valueOf(deleteRequestId)); + log.setOperateUserId(String.valueOf(user.getUID())); + log.setOperateUserType("2".equals(user.getLogintype())?"1":"0"); + log.setOperateDate(formatdate); + log.setOperateTime(formattime); + log.setClientAddress(Util.null2String(clientIp)); + + return log; + } + + /** + * 复制流程基础表数据 + * @throws Exception + */ + private void deleteBaseTableInfo() throws Exception { + Iterator it = deleteTableMap.keySet().iterator(); + while (it.hasNext()) { + String tablename = it.next(); + RequestDeleteInfo rdi = deleteTableMap.get(tablename); + String copytablename = Util.null2String(rdi.getCopytablename()); + if("".equals(copytablename)){ + deleteTableData(tablename,rdi.getQueryWhere(),null); + }else{ + String columnStr=""; + if(rdi.getClobColumn()!=null){ + columnStr = getTableColumn(tablename, rdi.getClobColumn()); + }else{ + columnStr = getTableColumn(tablename, null); + } + //先查一下 + if("st".equalsIgnoreCase(rst.getOrgindbtype())||"postgresql".equalsIgnoreCase(rst.getDBType())){ + DBColumnTypeUtils.syncLogTableField(tablename, copytablename,rst); + } + String dellogsql = "insert into " + copytablename + "(" + columnStr + ") select " + columnStr + " from " + tablename + rdi.getQueryWhere(); + try{ + rst.executeSql(dellogsql); + }catch (Exception e) { + boolean flag = DBColumnTypeUtils.syncLogTableField(tablename, copytablename,rst); + if(flag){ + rst.executeSql(dellogsql); + }else{ + throw e; + } + } + //更新clob字段 + updateClobColumn(tablename,rdi); + rst.executeSql("delete from " + tablename + rdi.getQueryWhere()); + + } + + } + } + + /** + * 删除消息 + */ + private void deletePoppupRemindInfo(){ + PoppupRemindInfoUtil poppupRemindInfoUtil = new PoppupRemindInfoUtil(); + poppupRemindInfoUtil.deletePoppupRemindInfo(requestid,0); + poppupRemindInfoUtil.deletePoppupRemindInfo(requestid,1); + poppupRemindInfoUtil.deletePoppupRemindInfo(requestid,10); + } + + + /** + * 更新clob字段 + * @param tablename + * @param rdi + * @throws Exception + */ + private void updateClobColumn(String tablename,RequestDeleteInfo rdi) throws Exception{ + String clobcolumns = rdi.toClobColumString(); + RecordSet rs = new RecordSet(); + if(clobcolumns == null) return; + String querysqlString = "select " + clobcolumns + ","+rdi.getPrimarykey()+" from " + tablename + rdi.getQueryWhere(); + rs.executeSql(querysqlString); + while(rs.next()){ + for(String column:rdi.getClobColumn()){ + String updatesqlString = "update " + rdi.getCopytablename() + " set "+column+" = ? where " + rdi.getPrimarykey() + " = ? "; + rst.executeUpdate(updatesqlString, rs.getString(column),rs.getString(rdi.getPrimarykey())); + } + } + } + + /** + * 记录请求相关表数据,并记录数据 + * @param tablename + * @param querywhere + * @param columnStr + */ + private void deleteTableData(String tablename,String querywhere,String columnStr) { + JSONObject colunInfo; + RecordSet rs = new RecordSet(); + if("".equals(Util.null2String(columnStr))){ + columnStr = getTableColumn(tablename, null); + } + String[] columnArray = columnStr.split(","); + String querysql = ""; + if(tablename.equals("workflow_nodeform")){ + querysql = "select " + columnStr + " from " + tablename +" a "+ querywhere; + }else { + querysql = "select " + columnStr + " from " + tablename + " " + querywhere; + } + rs.executeSql(querysql); + rs.isReturnDecryptData(true); + JSONArray array = new JSONArray(); + while (rs.next()) { + colunInfo = new JSONObject(); + for (int i = 0; i < columnArray.length; i++) { + colunInfo.put(columnArray[i], rs.getString(columnArray[i])); + } + array.add(colunInfo); + } + String deleteSql = "delete from " + tablename + " " + querywhere; + if(DBConstant.DB_TYPE_MYSQL.equals(rs.getDBType())) { + switch (tablename){ + case "workflow_logviewusers": + deleteSql = "delete t1 from workflow_logviewusers t1,workflow_requestlog t2 where t1.logid=t2.logid and t2.requestid= " + requestid; + break; + case "workflow_nodeform": + deleteSql = "delete t1 from workflow_nodeform t1,workflow_nodebase t2 where t1.nodeid=t2.id and t2.isfreenode='1' and t2.requestid= " + requestid; + break; + default: + break; + + } + } + rs.executeUpdate(deleteSql); + delDataInfo.put(tablename, array); + } + + /** + * 删除请求表单数据(自定义、系统表单、老表单) + */ + private void deleteFormData(){ + RecordSet temprs = new RecordSet(); + if(isbill == 1){ + temprs.executeQuery("select tablename,detailkeyfield from workflow_bill where id = ?", formid); + String maintablename = ""; + String detailkeyfield=""; + String querywhere = "where requestid= " + requestid; + if(temprs.next()){ + maintablename = temprs.getString("tablename"); + detailkeyfield = temprs.getString("detailkeyfield"); + //deleteTableData(maintablename,"where requestid = " + requestid,null); + } + if("".equals(detailkeyfield)){//如果为空时默认赋值【特殊表单不一定是按照mainid进行关联】 + detailkeyfield="mainid"; + } + temprs.executeQuery("select tablename from workflow_billdetailtable where billid = ?",formid); + while(temprs.next()){ + String detailtablename = temprs.getString(1); + querywhere = "where exists (select 1 from "+maintablename+" b where b.id = "+detailtablename+"."+detailkeyfield+" and b.requestid = "+requestid+")"; + deleteTableData(detailtablename,querywhere,null); + } + //先删除明细而后删除主表QC250286,增加判断在maintablename不为空时执行。 + if (!"".equals(maintablename)) { + deleteTableData(maintablename,"where requestid = " + requestid,null); + } + querywhere = "where requestid= " + requestid; + String column = "REQUESTID,BILLFORMID,BILLID"; + deleteTableData("workflow_form",querywhere,column); + }else{ + deleteOldFormData(temprs); + } + } + /** + * 删除老表单数据 + * @param temprs + */ + private void deleteOldFormData(RecordSet temprs){ + //老表单主表 + String maintablefieldquerysql = "select b.fieldname from workflow_formfield a left join workflow_formdict b on a.fieldid = b.id where (a.isdetail<>'1' or a.isdetail is null) and a.formid = ?"; + temprs.executeQuery(maintablefieldquerysql, formid); + String column = ""; + while(temprs.next()){ + String columnname = Util.null2String(temprs.getString(1)); + if("".equals(columnname)){ + continue; + } + column += columnname+","; + } + if(column.length() > 0) { + column += "requestid,billformid,billid"; + } + String querywhere = "where requestid = " +requestid; + deleteTableData("workflow_form",querywhere,column); + + //老表单明细表 + String detailtablefieldquerysql ="select b.fieldname from workflow_formfield a left join workflow_formdictdetail b on a.fieldid = b.id and a.isdetail = '1' and a.formid = ?"; + temprs.executeQuery(detailtablefieldquerysql, formid); + column = ""; + while(temprs.next()){ + String columnname = Util.null2String(temprs.getString(1)); + if("".equals(columnname)){ + continue; + } + column += columnname+","; + } + if(column.length() > 0) { + column += "id,requestid,groupid"; + } + deleteTableData("workflow_formdetail",querywhere,column); + } + + + /** + * + * 删除流程的时候,将流程编号预留号表中的是否已使用/是否已删除置为0 + */ + + private void updateCodeseqReserved(){ + if(requestid <= 0){ + return; + } + + //1.用requestid 去workflow_codeseqrecord表中查出codeSeqId和codeSeqReservedId + RecordSet rs = new RecordSet(); + RecordSet rs1 = new RecordSet(); + String sql = "select codeSeqId,sequenceId,workflowcode from workflow_codeseqrecord where requestId = " + requestid; + rs.executeSql(sql); + RecordSet rsz=new RecordSet(); + while (rs.next()) { + String codeSeqId = rs.getString(1); + String sequenceId = rs.getString(2); + String RESERVEDCODE = rs.getString(3); + //更新workflow_codeseqreserved流程编号预留号表的hasUsed=0,hasDeleted=0 + rs1.executeSql("update workflow_codeseqreserved set hasUsed=0,hasDeleted=0 where codeSeqId=" + codeSeqId + " and reservedId=" + sequenceId); + rsz.executeQuery("select count(1) from workflow_codeseqreserved where codeSeqId=? and reservedId=? and RESERVEDCODE=? ",codeSeqId,sequenceId,RESERVEDCODE); + rsz.next(); + int count = rsz.getInt(1); + if(count==0){ + //没有预留号 所以需要 + String sql2 = "insert into workflow_codeSeqReserved(codeSeqId,reservedId,reservedCode,reservedDesc,hasUsed,hasDeleted) values(?,?,?,?,?,?)"; + new RecordSet().executeUpdate(sql2, codeSeqId,sequenceId,RESERVEDCODE,"","0","0"); + } + //删除记录表里的数据 + rsz.executeUpdate("delete workflow_codeseqrecord where requestid = ? " , requestid ); + } + + } + + /** + * 查询表字段 + * @param tablename + * @param clobcolumns + * @return + */ + public static String getTableColumn(String tablename, List clobcolumns) { + RecordSet rs = new RecordSet(); + String sqltemp = "select column_name from user_tab_columns where table_name = upper(?)"; + if ("sqlserver".equalsIgnoreCase(rs.getDBType())) { + sqltemp = "select name from syscolumns b where id = OBJECT_ID(?)"; + }else if(rs.getDBType().equals("mysql")){ + String currentDB = DBColumnTypeUtils.getMysqlCurrentDBName(); + sqltemp = "select DISTINCT column_name from Information_schema.columns where table_schema = database() and table_name = upper(?)"; + if(!"".equalsIgnoreCase(currentDB)) sqltemp += " and table_schema = '" + currentDB + "' "; + }else if(rs.getDBType().equals("postgresql")){ + sqltemp = "select DISTINCT column_name from Information_schema.columns where table_schema = 'public' and lower(table_name) = lower(?)"; + } + + rs.executeQuery(sqltemp, tablename); + StringBuffer column = new StringBuffer(); + while (rs.next()) { + String columnname =""; + if(tablename.equals("workflow_nodeform")){ + columnname = "a." + rs.getString(1).toUpperCase(); + }else { + columnname = rs.getString(1).toUpperCase(); + } + // clob字段特殊处理 + if (clobcolumns != null && clobcolumns.size() > 0 && clobcolumns.contains(columnname)) { + continue; + } + if(rs.getDBType().equals("mysql") && "CONDITION".equals(columnname)){ + columnname = "`CONDITION`"; + } + column.append(columnname).append(","); + } + String coumntemp = ""; + if (column.length() > 0) { + coumntemp = column.substring(0, column.length() - 1); + } + column = null; + return coumntemp; + } + + /** + * 校验流程删除权限 + * @param requestid + * @param user + * @param isMonitor + * @return + */ + public static boolean verifyDelRight(int requestid,User user,boolean isMonitor) { + int userType = "2".equals(user.getLogintype()) ? 1 : 0; + RecordSet rs = new RecordSet(); + if(isMonitor) { + rs.executeQuery("select creater,workflowId from workflow_requestbase where requestid = ?",requestid); + if(rs.next()) { + String workflowId = rs.getString("workflowId"); + String creater = rs.getString("creater"); + Monitor monitor = new Monitor(); + MonitorDTO monitorInfo = monitor.getMonitorInfo(String.valueOf(user.getUID()),creater,workflowId); + return monitorInfo.getIsdelete(); + } + } else { + String querySql = ServiceUtil.calculateCurrentNodeSql(String.valueOf(requestid),user.getUID(),userType); + rs.executeQuery(querySql); + if(rs.next()) { + int nodeid = rs.getInt("nodeid"); + int isremark = rs.getInt("isremark"); + int workflowid = rs.getInt("workflowid"); + NodeInfoEntity nodeInfoEntity = WorkflowBaseBiz.getNodeInfo(nodeid); + if(nodeInfoEntity == null) return false; + WfFunctionManageUtil wfFunctionManageUtil = new WfFunctionManageUtil(); + return (nodeInfoEntity.getNodetype() == 0 && isremark == 0 && wfFunctionManageUtil.IsShowDelButtonByReject(requestid, workflowid)); + } + } + return false; + } + + public void setRequestid(int requestid) { + this.requestid = requestid; + } + + public String getMessage() { + return this.message; + } + + public String getMessagecontent() { + return this.messageContent; + } + + public void setMessageContent(String messageContent) { + this.messageContent = messageContent; + } + + public void setMessage(String message) { + this.message = message; + } + + private class RequestDeleteInfo{ + private String queryWhere; + private String copytablename; + private String primarykey; + private List clobColumn; + + public String getQueryWhere() { + return queryWhere; + } + public void setQueryWhere(String queryWhere) { + this.queryWhere = queryWhere; + } + public String getCopytablename() { + return copytablename; + } + public void setCopytablename(String copytablename) { + this.copytablename = copytablename; + } + public String getPrimarykey() { + return primarykey; + } + public void setPrimarykey(String primarykey) { + this.primarykey = primarykey; + } + public List getClobColumn() { + return clobColumn; + } + public void setClobColumn(List clobColumn) { + this.clobColumn = clobColumn; + } + + public String toClobColumString(){ + if(clobColumn == null) return null; + String columnString = ""; + for(String column:clobColumn){ + columnString += column+","; + } + return ((columnString.length() > 0)?(columnString.substring(0, columnString.length() - 1)):null); + + } + } + + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } +} diff --git a/weavernorth/com/ReceivingPushArchivesService.jsp b/weavernorth/com/ReceivingPushArchivesService.jsp new file mode 100644 index 0000000..066df7a --- /dev/null +++ b/weavernorth/com/ReceivingPushArchivesService.jsp @@ -0,0 +1,712 @@ +<%@ page import="weaver.conn.RecordSet" %> +<%@ page import="weaver.general.BaseBean" %> +<%@ page import="com.alibaba.fastjson.JSONObject" %> +<%@ page import="com.alibaba.fastjson.JSONArray" %> +<%@ page import="weaver.general.Util" %> +<%@ page import="cn.hutool.core.util.ZipUtil" %> +<%@ page import="com.engine.custom.archives.util.ArchivesUtil" %> +<%@ page import="java.text.SimpleDateFormat" %> +<%@ page import="com.engine.custom.archives.entity.PushArchivesBean" %> +<%@ page import="com.engine.custom.hg.util.HgUtils" %> +<%@ page import="com.dcfs.fts.common.error.FtpException" %> +<%@ page import="weaver.soa.workflow.request.RequestService" %> +<%@ page import="weaver.soa.workflow.request.RequestInfo" %> +<%@ page import="weaver.file.ImageFileManager" %> +<%@ page import="java.io.*" %> +<%@ page import="java.util.*" %> +<%@ page import="java.time.format.DateTimeFormatter" %> +<%@ page import="java.time.LocalDate" %> +<%@ page import="weaver.hrm.User" %> +<%@ page import="weaver.hrm.company.DepartmentComInfo" %> +<%@ page import="weaver.general.StringUtil" %> +<%@ page import="org.apache.commons.lang.StringUtils" %> +<%@ page import="weaver.workflow.workflow.WorkflowComInfo" %> +<%@ page import="weaver.workflow.workflow.WorkflowBillComInfo" %> +<%@ page import="org.slf4j.Logger" %> +<%@ page import="org.slf4j.LoggerFactory" %> +<%@ page import="com.engine.custom.archives.service.ReceivingPushArchivesService" %> +<%@ page import="java.net.URLEncoder" %> +<%@ page import="java.nio.charset.StandardCharsets" %> +<%@ page import="okhttp3.*" %> +<%@ page import="com.engine.common.util.ParamUtil" %> +<%@ page language="java" contentType="text/html; charset=UTF-8" %> + +<% + + Map paramMap = ParamUtil.request2Map(request); + String requestid = Util.null2String(paramMap.get("requestid")); + Logger log = LoggerFactory.getLogger("Archives"); + log.info("PushArchivesCorn====Begin========"); + Date date = ArchivesUtil.getDate(); + String dateStr = new SimpleDateFormat("yyyyMMdd").format(date); + ArrayList pushArchivesBeans = new ArrayList<>(); + PushArchivesBean pushArchivesBean = new PushArchivesBean(); + pushArchivesBean.setRequest(Util.getIntValue(requestid)); + pushArchivesBeans.add(pushArchivesBean); + pushArchives(pushArchivesBeans,dateStr); +%> + + +<%! + + private static String filePath = "/opt/oadata/archivesFile";; + private static String Url = "http://14.1.213.5:18080/fcscloud/composite/upload" ; + private static String templatePath = "/opt/weaver/archivesFile/template/"; // 模板文件路径 + private static final String zwdir = "正文"; + private static final String fjdir = "附件"; + private static final String cbddir = "承办单"; + private static final String zlcdir = "承办单" + File.separator + "子流程"; + private static final String lzxxdir = "流转信息"; + private static final String fjFile = "附件"; + private static final String lcfjWord = "流程附件"; + private static final String qzyjfjWord = "签字意见附件"; + private static final String xbbmfjWord = "协办部门附件"; + private static final String wjcldWord = "文件处理单"; + private static final String wjlzxxWord = "文件流转信息"; + + public static Logger log = LoggerFactory.getLogger("Archives"); + + public void setProp(Map param) { + filePath = Util.null2String(param.get("filePath")); + Url = Util.null2String(param.get("Url")); + templatePath = Util.null2String(param.get("templatePath")); + } + + + public void pushArchives(List result, String dateStr) { + + try { + filePath = filePath + File.separator + dateStr ; + ZipUtil zipUtil = new ZipUtil(); + Date date = ArchivesUtil.getDate(); + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); + String format = dateFormat.format(date); + SimpleDateFormat yyyyMMddHHmmss = new SimpleDateFormat("yyyy-MM-dd HH:mm"); + // 获取当前时间的第一秒 + String firstSecond = yyyyMMddHHmmss.format(getFirstSecondOfDate(date)); + // 获取当前时间的最后一秒 + String lastSecond = yyyyMMddHHmmss.format(getLastSecondOfDate(date)); + + + RecordSet recordSet = new RecordSet(); + // List result = ArchivesUtil.getResultList(recordSet, firstSecond, lastSecond, 1); + log.error("推送收文的数量:{}", result.size()); + File file = ArchivesUtil.crFile(filePath + "/togd_" + new SimpleDateFormat("yyyyMMdd000000").format(date)); + log.error("textfile:{}", file.getAbsolutePath()); + for (PushArchivesBean pushArchivesBean : result) { + int requestid = pushArchivesBean.getRequest(); + try { + log.error("requestid:{}", requestid); + //1.生成文件及推送的txt + String context = extracted(requestid); + log.error("context:{}", context); + //1.生成文件及推送的txt + ArchivesUtil.writeToTxt(file.getPath(), file.getName(), context, true); + File txtzip = new File(filePath + File.separator + "togd_" + new SimpleDateFormat("yyyyMMdd000000").format(date) + ".zip"); + log.error("textZipFile:{}", txtzip.getAbsolutePath()); + OutputStream outputStream = new FileOutputStream(txtzip); + File writename = new File(file.getPath() + "/" + file.getName() + ".txt"); + com.engine.custom.hg.util.ZipUtil.filesToZip(writename, outputStream, writename.getName()); + log.error("writename:{}",writename.getName()); + String s = HgUtils.putFile(txtzip.getAbsolutePath(), txtzip.getName()); + // updateRecord(requestid, s); + updateRecord(requestid,"esbtxtml",s); + updateRecord(requestid,"zt","0"); + log.error("textZip:{}", s); + }catch (Exception e){ + e.printStackTrace(); + log.error("推送档案requestid:{}异常,异常原因为:{}",requestid,e.getMessage()); + } + } + } catch (Exception e) { + log.info("PushArchivesCorn====Exception========{}", e.getMessage()); + e.printStackTrace(); + } + + } + + private void updateRecord(int requestids, String s) { + String sql = "update uf_pushArchivesLog set esbtxtml = ? where request in ( " + requestids + " )"; + RecordSet recordSet = new RecordSet(); + recordSet.executeUpdate(sql, s); + } + + private String extracted(int requestid) throws FtpException, IOException { + String newRequestid = "togd"+requestid; + RequestService requestService = new RequestService(); + RequestInfo requestInfo = requestService.getRequest(Util.getIntValue(requestid), 100); + String workflowid = requestInfo.getWorkflowid(); + Map requesData = getRequestByid(requestid); + log.info("requesData:{}", requesData); + String fj = Util.null2String(requesData.get("fj")); + String zwkbj = Util.null2String(requesData.get("zwkbj")); + String lczw = Util.null2String(requesData.get("lczw")); + String gwly = Util.null2String(requesData.get("gwly")); + //增加签字意见中的附件到附件文件夹中 + Map signFiles = ArchivesUtil.getSignFiles(requestid,true); + List docids = new ArrayList<>(); + // docids.addAll(Arrays.asList(fj.split(","))); + // docids.addAll(Arrays.asList(zwkbj.split(","))); + Map fjMap = ArchivesUtil.getFileIdByDocId(fj); + + // Map zwkbjMap = ArchivesUtil.getFileIdByDocId(zwkbj); + // Map lczwMap = ArchivesUtil.getFileIdByDocId(lczw); + Map lczwMap = new HashMap<>(); + //判断公文来源 + if ("0".equals(gwly)){ + lczwMap = ArchivesUtil.getFileIdByDocId(lczw); + }else { + lczwMap = ArchivesUtil.getFileIdByDocId(zwkbj); + } + + + + + List zwFileName = new ArrayList<>(); + List fjFileName = new ArrayList<>(); + final int[] i = {1}; + //附件 + fjMap.forEach((docid, imageid) -> { + ImageFileManager imageFileManager = new ImageFileManager(); + imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + InputStream inputStream = imageFileManager.getInputStream(); + //中文路径/中文文件名 + String imageFileName = filePath + File.separator + newRequestid + File.separator + fjdir + File.separator + lcfjWord+ i[0] +"-" + imageFileManager.getImageFileName(); + fjFileName.add(lcfjWord+ i[0] +"-" + imageFileManager.getImageFileName()); + log.info("生成附件路径:{}", imageFileName); + imageFileName = ArchivesUtil.codeUtf8(imageFileName); + try { + File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + String jsonStr = ArchivesUtil.callApi(Url, file); + log.error("永中接口返回数据:{}", jsonStr); + JSONObject result = JSONObject.parseObject(jsonStr); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + fjdir + File.separator + lcfjWord+ i[0] + "-" + imageFileManager.getImageFileName() + ".pdf"); + } + } catch (IOException e) { + e.printStackTrace(); + }finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + i[0]++; + }); + i[0] = 1; + //签字意见附件 + signFiles.forEach((docid, imageid) -> { + ImageFileManager imageFileManager = new ImageFileManager(); + imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + InputStream inputStream = imageFileManager.getInputStream(); + //中文路径/中文文件名 + String imageFileName = filePath + File.separator + newRequestid + File.separator + fjdir + File.separator + qzyjfjWord + i[0] + "-" +imageFileManager.getImageFileName(); + fjFileName.add(qzyjfjWord + i[0] + "-" +imageFileManager.getImageFileName()); + log.info("生成签字意见附件路径:{}", imageFileName); + imageFileName = ArchivesUtil.codeUtf8(imageFileName); + try { + File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + String jsonStr = ArchivesUtil.callApi(Url, file); + log.error("永中接口返回数据:{}", jsonStr); + JSONObject result = JSONObject.parseObject(jsonStr); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + fjdir + File.separator + qzyjfjWord + i[0] + "-" + imageFileManager.getImageFileName() + ".pdf"); + } + i[0]++; + } catch (IOException e) { + e.printStackTrace(); + }finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + }); + + i[0] = 1; + Map coReqFile = getCoReqFile(requestid, workflowid); + //协办要求 + coReqFile.forEach((docid, imageid) -> { + ImageFileManager imageFileManager = new ImageFileManager(); + imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + InputStream inputStream = imageFileManager.getInputStream(); + zwFileName.add(xbbmfjWord+ i[0] +"-"+ imageFileManager.getImageFileName()); + //中文路径/中文文件名 + String imageFileName = filePath + File.separator + newRequestid + File.separator + fjdir + File.separator +xbbmfjWord+ i[0] +"-"+ imageFileManager.getImageFileName(); + log.info("生成协办部门路径:{}", imageFileName); + imageFileName = ArchivesUtil.codeUtf8(imageFileName); + try { + File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + String jsonStr = ArchivesUtil.callApi(Url, file); + log.error("永中接口返回:{}", jsonStr); + JSONObject result = JSONObject.parseObject(jsonStr); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + fjdir + File.separator+xbbmfjWord+ i[0] +"-" + imageFileManager.getImageFileName() + ".pdf"); + } + i[0]++; + } catch (IOException e) { + e.printStackTrace(); + }finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + }); + + // i[0] = 1; + // //正文 + // zwkbjMap.forEach((docid, imageid) -> { + // ImageFileManager imageFileManager = new ImageFileManager(); + // imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + // InputStream inputStream = imageFileManager.getInputStream(); + // zwFileName.add(imageFileManager.getImageFileName()); + // //中文路径/中文文件名 + // String imageFileName = filePath + File.separator + newRequestid + File.separator + zwdir + File.separator + imageFileManager.getImageFileName(); + // log.info("生成正文路径:{}", imageFileName); + // imageFileName = ArchivesUtil.codeUtf8(imageFileName); + // try { + // File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + // String jsonStr = ArchivesUtil.callApi(Url, file); + // log.error("永中接口返回:{}", jsonStr); + // JSONObject result = JSONObject.parseObject(jsonStr); + // String errorcode = result.getString("errorcode"); + // if ("0".equals(errorcode)) { + // JSONObject data = result.getJSONObject("data"); + // String destFileName = data.getString("destFileName"); + // String viewUrl = data.getString("viewUrl"); + // ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + zwdir + File.separator + imageFileManager.getImageFileName() + ".pdf"); + // } + // + // } catch (IOException e) { + // e.printStackTrace(); + // }finally { + // if(inputStream!=null) { + // try { + // inputStream.close(); + // } catch (IOException e) { + // e.printStackTrace(); + // } + // } + // } + // }); + + i[0] = 1; + //正文 + lczwMap.forEach((docid, imageid) -> { + ImageFileManager imageFileManager = new ImageFileManager(); + imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + InputStream inputStream = imageFileManager.getInputStream(); + zwFileName.add(imageFileManager.getImageFileName()); + //中文路径/中文文件名 + String imageFileName = filePath + File.separator + newRequestid + File.separator + zwdir + File.separator + imageFileManager.getImageFileName(); + log.info("生成正文路径:{}", imageFileName); + imageFileName = ArchivesUtil.codeUtf8(imageFileName); + try { + File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + String jsonStr = ArchivesUtil.callApi(Url, file); + log.error("永中接口返回:{}", jsonStr); + JSONObject result = JSONObject.parseObject(jsonStr); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + zwdir + File.separator + imageFileManager.getImageFileName() + ".pdf"); + } + + } catch (IOException e) { + e.printStackTrace(); + }finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + }); + //开始承办单 先获取主流程的承办单 + List requestDocid = ArchivesUtil.generaRequestFormPdf(requestid,1); + // 1.去掉生成子流程承办单 + // List subRequestDocid = generaSubRequestFormPdf(requestid); + Map reqDocMap = ArchivesUtil.getFileIdByDocId(String.join(",", requestDocid)); + // 2.去掉生成子流程承办单 + // Map subReqDocMap = getFileIdByDocId(String.join(",", subRequestDocid)); + log.error("reqDocMap:{}", JSONObject.toJSONString(reqDocMap)); + //log.error("subReqDocMap:{}", JSONObject.toJSONString(subReqDocMap)); + docids.addAll(requestDocid); + // 3.去掉生成子流程承办单 + // docids.addAll(subRequestDocid); + //承办单 + reqDocMap.forEach((docid, imageid) -> { + ImageFileManager imageFileManager = new ImageFileManager(); + imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + InputStream inputStream = imageFileManager.getInputStream(); + //中文路径/中文文件名 + // String imageFileName = filePath + File.separator + requestid + File.separator + cbddir + File.separator + fjFile + i[0] + "_" + imageFileManager.getImageFileName(); + String imageFileName = filePath + File.separator + newRequestid + File.separator + cbddir + File.separator + wjcldWord+".pdf"; + + log.info("主流程承办单路径:{}", imageFileName); + imageFileName = ArchivesUtil.codeUtf8(imageFileName); + try { + File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + String jsonStr = ArchivesUtil.callApi(Url, file); + log.error("永中接口返回:{}", jsonStr); + JSONObject result = JSONObject.parseObject(jsonStr); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + cbddir + File.separator + wjcldWord + ".pdf" + ".pdf"); + } + i[0]++; + } catch (IOException e) { + e.printStackTrace(); + }finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + }); +//正文 + + i[0] = 1; + // 4.去掉生成子流程承办单 + // subReqDocMap.forEach((docid, imageid) -> { + // ImageFileManager imageFileManager = new ImageFileManager(); + // imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + // InputStream inputStream = imageFileManager.getInputStream(); + // //中文路径/中文文件名 + // String imageFileName = filePath + File.separator + requestid + File.separator + zlcdir + File.separator + fjFile + i[0] + "_" + (imageFileManager.getImageFileName().contains("-")?imageFileManager.getImageFileName().split("\\-")[1]:imageFileManager.getImageFileName()); + // imageFileName = codeUtf8(imageFileName); + // log.info("子流程承办单路径:{}", imageFileName); + // try { + // File file = saveInputStreamToFile(inputStream, imageFileName); + // String jsonStr = callApi(Url, file); + // log.error("永中接口返回:{}", jsonStr); + // JSONObject result = JSONObject.parseObject(jsonStr); + // String errorcode = result.getString("errorcode"); + // if ("0".equals(errorcode)) { + // JSONObject data = result.getJSONObject("data"); + // String destFileName = data.getString("destFileName"); + // String viewUrl = data.getString("viewUrl"); + // downloadFile(viewUrl, filePath + File.separator + requestid + File.separator + zlcdir + File.separator + fjFile + i[0] + "_" + (imageFileManager.getImageFileName().contains("-")?imageFileManager.getImageFileName().split("\\-")[1]:imageFileManager.getImageFileName() )+ ".pdf"); + // } + // i[0]++; + // } catch (IOException e) { + // e.printStackTrace(); + // } + // }); + log.error(JSONObject.toJSONString(requestDocid)); + // log.error(JSONObject.toJSONString(subRequestDocid)); + for (String docid : docids) { + log.error("删除了" + docid); + ArchivesUtil.deleteDocByid(docid); + } + //-------------------------------------------------------------------- + + + String logFile = ArchivesUtil.getSignLog(requestid, cbddir+File.separator+lzxxdir, requestInfo.getCreatorid() + requestInfo.getDescription(),templatePath,filePath,true,workflowid); + String s = ArchivesUtil.callApi(Url, new File(logFile)); + log.error(s); + JSONObject result = JSONObject.parseObject(s); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, logFile + ".pdf"); + } + String zipName = filePath + File.separator + newRequestid + ".zip"; + ZipUtil.zip(filePath + File.separator + newRequestid, zipName); + log.error("zipName:{}", zipName); + String ftpFilePath = HgUtils.putFile(zipName, newRequestid + ".zip"); + updateRecord(requestid,"esbwjml",ftpFilePath); + log.error("ftpFilePath:{}", ftpFilePath); + // String ftpFilePathNew = HgUtils.putFile(zipName, "test" + File.separator + newRequestid + ".zip"); + // log.error("ftpFilePathNew:{}", ftpFilePathNew); + String context = getContext(requestid, requesData, newRequestid + ".zip", zwFileName, fjFileName); + // insertRecord(requestid, context, ftpFilePath); + log.error("context:{}", context); + updateRecord(requestid,"content",context); + return context; + } + + + + private void insertRecord(int requestid, String context, String ftpFilePath) { + String sql = "insert into uf_pushArchivesLog (request ,content,esbwjml) VALUES (?,?,?)"; + RecordSet recordSet = new RecordSet(); + recordSet.executeUpdate(sql, requestid, context, ftpFilePath); + } + + + // 获取指定日期的第一秒 + public static Date getFirstSecondOfDate(Date date) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + calendar.set(Calendar.HOUR_OF_DAY, 0); + calendar.set(Calendar.MINUTE, 0); + calendar.set(Calendar.SECOND, 0); + calendar.set(Calendar.MILLISECOND, 0); + return calendar.getTime(); + } + + // 获取指定日期的最后一秒 + public static Date getLastSecondOfDate(Date date) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + calendar.set(Calendar.HOUR_OF_DAY, 23); + calendar.set(Calendar.MINUTE, 59); + calendar.set(Calendar.SECOND, 59); + calendar.set(Calendar.MILLISECOND, 999); + return calendar.getTime(); + } + + + + /*** + * 封装数据 + * @param requestid + * @return + */ + public Map getRequestByid(int requestid) { + HashMap record = new HashMap<>(); + String sql = "select * from formtable_main_30 where requestid = ?"; + String reqsql = "select REQUESTNAME from WORKFLOW_REQUESTBASE where REQUESTID = ?"; + RecordSet rs = new RecordSet(); + rs.executeQuery(sql, requestid); + if (rs.next()) { + String fj = Util.null2String(rs.getString("fj")); + String zwkbj = Util.null2String(rs.getString("zwkbj")); // 正文可编辑字段 + record.put("fj", fj); + record.put("zwkbj", zwkbj); + record.put("zwyyglgwmk", Util.null2String(rs.getString("zwyyglgwmk"))); + record.put("lwh", Util.null2String(rs.getString("lwh"))); + record.put("mj", Util.null2String(rs.getString("mj"))); + record.put("lwrq", Util.null2String(rs.getString("lwrq"))); + record.put("swrq", Util.null2String(rs.getString("swrq"))); + record.put("blqx", Util.null2String(rs.getString("blqx"))); + record.put("sfdb", Util.null2String(rs.getString("sfdb"))); + record.put("wjlx", Util.null2String(rs.getString("wjlx"))); + record.put("fssj", Util.null2String(rs.getString("fssj"))); + record.put("gdh", Util.null2String(rs.getString("gdh"))); + record.put("swh", Util.null2String(rs.getString("swh"))); + record.put("ngbm", Util.null2String(rs.getString("ngbm"))); + record.put("ngr", Util.null2String(rs.getString("ngr"))); + record.put("ngrq", Util.null2String(rs.getString("ngrq"))); + record.put("swlx", Util.null2String(rs.getString("swlx"))); + record.put("jghwt", Util.null2String(rs.getString("jghwt"))); + record.put("lwdwmc", Util.null2String(rs.getString("lwdwmc"))); + record.put("bgqx", Util.null2String(rs.getString("bgqx"))); + record.put("ys", Util.null2String(rs.getString("ys"))); + record.put("wz", Util.null2String(rs.getString("wz"))); + record.put("lb", Util.null2String(rs.getString("lb"))); + record.put("bz", Util.null2String(rs.getString("bz"))); + record.put("yffbm", Util.null2String(rs.getString("yffbm"))); + record.put("ffbmb", Util.null2String(rs.getString("ffbmb"))); + record.put("yffbm", Util.null2String(rs.getString("yffbm"))); + record.put("lczw", Util.null2String(rs.getString("lczw"))); + record.put("gwly", Util.null2String(rs.getString("gwly"))); + record.put("lwdwsx", Util.null2String(rs.getString("lwdwsx"))); + } + rs.executeQuery(reqsql, requestid); + if (rs.next()) { + record.put("REQUESTNAME", Util.null2String(rs.getString("REQUESTNAME"))); + } + return record; + } + + + private String getContext(int requestid, Map requesData, String zipName, List zwFileName, List fjFileName) { + StringBuilder context = new StringBuilder(); + try { + + String swrq = Util.null2String(requesData.get("swrq")); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + LocalDate date = LocalDate.parse(swrq, formatter); + int year = date.getYear(); + context.append(year).append("|"); + String jghwt = Util.null2String(requesData.get("jghwt")); + context.append(jghwt).append("|"); + // String swh = Util.null2String(requesData.get("swh")); + String swh = Util.null2String(requesData.get("lwh")); + context.append(swh).append("|"); + String requestname = Util.null2String(requesData.get("REQUESTNAME")); + context.append(requestname).append("|"); + String lwdwmc = Util.null2String(requesData.get("lwdwsx")); //5 责任者 -> 来文单位 + context.append(lwdwmc).append("|"); + String bgqx = Util.null2String(requesData.get("bgqx")); //6 保管期限 -> 保管期限 + context.append(bgqx).append("|"); + String lwrq = Util.null2String(requesData.get("lwrq")); //7 日期 -> 原发文日期 + context.append(lwrq).append("|"); + String ys = Util.null2String(requesData.get("ys")); //8 页数 -> 页数 + context.append(ys).append("|"); + String wz = Util.null2String(requesData.get("wz")); //9 文种 -> 文种 + context.append(wz).append("|"); + String ngbm = Util.null2String(requesData.get("ngbm")); + String[] deptData = ArchivesUtil.getDeptNameAndCode(ngbm); + String[] subData = ArchivesUtil.getSubCom(ngbm); + context.append("D10001").append("|"); //10 行编号 -> 拟稿部门 + + context.append("总行机关").append("|"); //11 行名称 + context.append("").append("|"); // 12 保管期限编号 + context.append("").append("|"); // 13 保管期限及编号 + context.append("").append("|"); // 14 是否开放 + context.append("").append("|"); // 15 互见号 + String lb = Util.null2String(requesData.get("lb")); + context.append(lb).append("|"); //16 类别 -> 类别 + //TODO + String xgbm = Util.null2String(getAssociatedDepts(requesData)); + context.append(xgbm).append("|"); //17 相关部门 -> 流经部门 + // String lwh = Util.null2String(requesData.get("lwh"));// 18 收文号 -> 来文文号 + String lwh = Util.null2String(requesData.get("swh"));// 18 收文号 -> 来文文号 + context.append(lwh).append("|"); + String fs = ""; + context.append(fs).append("|"); // 19 份数 -> 份数 + String bz = Util.null2String(requesData.get("bz")); + context.append(bz).append("|"); // 20 备注 -> 备注 + String yywh = Util.null2String(requesData.get("yywh")); + context.append(yywh).append("|"); // 21 引用文号 -> 引用文号 + String wjlx = Util.null2String(requesData.get("wjlx")); + context.append(wjlx).append("|"); // 22 文件类型 -> 空 + String fwlx = Util.null2String(requesData.get("fwlx")); + context.append(fwlx).append("|"); // 23 文件类型 -> 空 + String f = Util.null2String(requesData.get("f")); + context.append(f).append("|"); // 24 发 -> 空 + String ngr = Util.null2String(requesData.get("ngr")); + context.append(new User(Util.getIntValue(ngr)).getLoginid()).append("|"); // 25 拟稿人 -> 拟稿人 + context.append(deptData[1]).append("|"); // 26 拟稿部门 -> 拟稿部门名称 + context.append("收文").append("|"); // 27 公文类型 -> "收文" + //TODO + context.append(ArchivesUtil.getAssociatedPersons(requestid,true)).append("|"); // 28 相关人员 -> 参与人员 + context.append("智慧OA").append("|"); // 29 数据来源 -> 数据来源 + context.append(year).append("|"); // 30 形成年度 -> 年份 + context.append(String.join("&&", zwFileName)).append("|"); // 31 正文名称 + context.append(String.join("&&", fjFileName)).append("|"); // 32 附件名称 + context.append("togd"+requestid).append("|"); // 33 主键 + context.append("").append("|"); // 34 关联主键 + context.append("").append("|"); // 35 被关联主键 + context.append(zipName);// 36 压缩包名称 + } catch (Exception e) { + e.printStackTrace(); + log.error("getContextError:{}", e.getMessage()); + } + + return context.toString(); + } + + private String getAssociatedDepts(Map requesData) { + HashSet records = new HashSet<>(); + records.addAll(Arrays.asList(Util.null2String(requesData.get("ngbm")).split(","))); + records.addAll(Arrays.asList(Util.null2String(requesData.get("ffbm")).split(","))); + records.addAll(Arrays.asList(Util.null2String(requesData.get("yffbm")).split(","))); + records.addAll(Arrays.asList(Util.null2String(requesData.get("ffbmb")).split(","))); + records.addAll(Arrays.asList(Util.null2String(requesData.get("zfbm")).split(","))); + ArrayList deptName = new ArrayList<>(); + DepartmentComInfo departmentComInfo = new DepartmentComInfo(); + for (String record : records) { + try { + if (StringUtil.isEmpty(record)){ + continue; + } + String departmentName = departmentComInfo.getDepartmentName(record); + deptName.add(departmentName); + } catch (Exception e) { + e.printStackTrace(); + } + } + + return String.join("&&", deptName); + } + + private Map getCoReqFile(int requestid , String workflowid){ + RecordSet rs = new RecordSet(); + rs.executeQuery("select * from uf_ArchivesSet where mainwfid = ?",workflowid); + boolean isCo = false; + String cowfid = ""; + String cofield = ""; + String cofieldid = ""; + if (rs.next()){ + cowfid = Util.null2String(rs.getString("cowfid")); + if (!StringUtils.isBlank(cowfid)){ + isCo = true; + cofield = Util.null2String(rs.getString("cofield")); + cofieldid = Util.null2String(rs.getString("cofieldid")); + } + } + log.info("isCo:{};cowfid:{};cofield:{};cofieldid:{}",isCo,cowfid,cofield,cofieldid); + + + if(isCo){ + ArrayList CoSubRequest = new ArrayList<>(); + Map subRequest = ArchivesUtil.getSubRequest(Util.null2String(requestid) , 6); + log.info("subRequest:{}",subRequest); + for (Map.Entry subRequestEntry : subRequest.entrySet()) { + String subWFid = subRequestEntry.getValue(); + if (cowfid.equals(subWFid)){ + CoSubRequest.add(subRequestEntry.getKey()); + } + } + log.info("CoSubRequest.size:{}",CoSubRequest.size()); + WorkflowComInfo wf = new WorkflowComInfo(); + WorkflowBillComInfo wcInfo = new WorkflowBillComInfo(); + String formId = wf.getFormId(cowfid); + String tablename = wcInfo.getTablename(formId); + String cosql = "select "+cofield+" from " + tablename + " where " + + " requestid in ( " + String.join(",",CoSubRequest) + " ) " + + " order by requestid asc "; + log.info("cosql:{}",cosql); + + rs.executeQuery(cosql); + log.info("rs.getExceptionMsg():{}",rs.getExceptionMsg()); + String fieldValue = ""; + String[] cofieldsplit = cofield.split(","); + String coFile = cofieldsplit[2]; //协办部门 + ArrayList docids = new ArrayList<>(); + while (rs.next()){ + String coFileValue = rs.getString(coFile); + docids.addAll(Arrays.asList(coFileValue.split(","))); + } + log.info("fieldValue:{}",fieldValue); + return ArchivesUtil.getFileIdByDocId(String.join(",",docids)); + } + return new HashMap<>(); + } + + private void updateRecord(int requestid, String field , String fieldvalue) { + String sql = "update uf_pushArchivesLog set "+field+" = ? where request = ?"; + RecordSet recordSet = new RecordSet(); + recordSet.executeUpdate(sql, fieldvalue, requestid); + } +%> + diff --git a/weavernorth/com/SendingPushArchivesService.jsp b/weavernorth/com/SendingPushArchivesService.jsp new file mode 100644 index 0000000..af797cd --- /dev/null +++ b/weavernorth/com/SendingPushArchivesService.jsp @@ -0,0 +1,618 @@ +<%@ page import="weaver.conn.RecordSet" %> +<%@ page import="weaver.general.BaseBean" %> +<%@ page import="weaver.general.Util" %> +<%@ page import="com.alibaba.fastjson.JSONObject" %> +<%@ page import="com.alibaba.fastjson.JSONArray" %> +<%@ page import="java.util.regex.Pattern" %> +<%@ page import="java.util.regex.Matcher" %> +<%@ page import="java.io.*" %> +<%@ page import="weaver.docs.webservices.DocInfo" %> +<%@ page import="weaver.docs.webservices.DocAttachment" %> +<%@ page import="org.apache.axis.encoding.Base64" %> +<%@ page import="weaver.docs.webservices.DocServiceImpl" %> +<%@ page import="weaver.hrm.User" %> +<%@ page import="java.text.SimpleDateFormat" %> +<%@ page import="java.util.*" %> +<%@ page import="org.apache.commons.lang.StringUtils" %> +<%@ page language="java" contentType="text/html; charset=UTF-8"%> +<%@ page import="org.apache.http.impl.client.CloseableHttpClient" %> +<%@ page import="org.apache.http.impl.client.HttpClients" %> +<%@ page import="org.apache.http.client.methods.HttpPost" %> +<%@ page import="com.alibaba.fastjson.JSON" %> +<%@ page import="org.apache.http.entity.StringEntity" %> +<%@ page import="org.apache.http.client.methods.CloseableHttpResponse" %> +<%@ page import="org.apache.http.HttpStatus" %> +<%@ page import="org.apache.http.HttpEntity" %> +<%@ page import="org.apache.http.util.EntityUtils" %> +<%@ page import="org.apache.http.client.ClientProtocolException" %> +<%@ page import="weaver.hrm.HrmUserVarify" %> +<%@ page import="java.net.URL" %> +<%@ page import="java.net.HttpURLConnection" %> +<%@ page import="org.apache.http.HttpException" %> +<%@ page import="org.apache.http.client.HttpClient" %> +<%@ page import="org.apache.commons.httpclient.methods.PostMethod" %> +<%@ page import="org.apache.commons.httpclient.params.HttpMethodParams" %> +<%@ page import="org.slf4j.Logger" %> +<%@ page import="org.slf4j.LoggerFactory" %> +<%@ page import="com.engine.custom.archives.util.ArchivesUtil" %> +<%@ page import="com.engine.custom.archives.entity.PushArchivesBean" %> +<%@ page import="com.engine.custom.hg.util.HgUtils" %> +<%@ page import="com.dcfs.fts.common.error.FtpException" %> +<%@ page import="weaver.file.ImageFileManager" %> +<%@ page import="weaver.soa.workflow.request.RequestService" %> +<%@ page import="weaver.soa.workflow.request.RequestInfo" %> +<%@ page import="cn.hutool.core.util.ZipUtil" %> +<%@ page import="weaver.hrm.company.DepartmentComInfo" %> +<%@ page import="java.time.format.DateTimeFormatter" %> +<%@ page import="java.time.LocalDate" %> +<%@ page import="weaver.general.StringUtil" %> +<%@ page import="java.net.URLEncoder" %> +<%@ page import="java.nio.charset.StandardCharsets" %> +<%@ page import="okhttp3.*" %> +<%@ page import="com.engine.common.util.ParamUtil" %> + +<% + Map paramMap = ParamUtil.request2Map(request); + String requestid = Util.null2String(paramMap.get("requestid")); + Logger log = LoggerFactory.getLogger("Archives"); + log.info("PushArchivesCorn====Begin========"); + Date date = ArchivesUtil.getDate(); + String dateStr = new SimpleDateFormat("yyyyMMdd").format(date); + ArrayList pushArchivesBeans = new ArrayList<>(); + PushArchivesBean pushArchivesBean = new PushArchivesBean(); + pushArchivesBean.setRequest(Util.getIntValue(requestid)); + pushArchivesBeans.add(pushArchivesBean); + pushArchives(pushArchivesBeans,dateStr); + +%> + +<%! + public static Logger log = LoggerFactory.getLogger("Archives"); + private static String filePath = "/opt/oadata/archivesFile";; + private static String Url = "http://14.1.213.5:18080/fcscloud/composite/upload" ; + private static String templatePath = "/opt/weaver/archivesFile/template/"; // 模板文件路径 + private static final String zwdir = "正文"; + private static final String fjdir = "附件"; + private static final String cbddir = "承办单"; + private static final String zlcdir = "承办单" + File.separator + "子流程"; + private static final String lzxxdir = "流转信息"; + private static final String fjFile = "附件"; + private static final String fjWord = "附件"; + private static final String zwWord = "正文"; + private static final String lhgWord = "留痕稿"; + private static final String lcfjWord = "流程附件"; + private static final String qzyjfjWord = "签字意见附件"; + private static final String wjcldWord = "文件处理单"; + private static final String wjlzxxWord = "文件流转信息"; + + public void setProp(Map param) { + filePath = Util.null2String(param.get("filePath")); + Url = Util.null2String(param.get("Url")); + templatePath = Util.null2String(param.get("templatePath")); + } + + public void pushArchives(List result, String dateStr) { + // log.info("PushArchivesCorn====Begin========{}", param); + filePath = filePath + File.separator + dateStr ; + Date date = ArchivesUtil.getDate(); + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); + String format = dateFormat.format(date); + SimpleDateFormat yyyyMMddHHmmss = new SimpleDateFormat("yyyy-MM-dd HH:mm"); + // 获取当前时间的第一秒 + String firstSecond = yyyyMMddHHmmss.format(ArchivesUtil.getFirstSecondOfDate(date)); + // 获取当前时间的最后一秒 + String lastSecond = yyyyMMddHHmmss.format(ArchivesUtil.getLastSecondOfDate(date)); + RecordSet recordSet = new RecordSet(); + // List result = ArchivesUtil.getResultList(recordSet, firstSecond, lastSecond, 0); + log.error("推送发文的数量:{}", result.size()); + File file = ArchivesUtil.crFile(filePath + "/togd_" + new SimpleDateFormat("yyyyMMdd000000").format(date)); + log.error("textfile:{}", file.getAbsolutePath()); + for (PushArchivesBean pushArchivesBean : result) { + // int id = pushArchivesBean.getId(); + int request = pushArchivesBean.getRequest(); + log.error("推送的requestId:{}", request); + try { + String context = generateFile(request); + if ("-1".equals(context)){ + continue; + } + ArchivesUtil.writeToTxt(file.getPath(), file.getName(), context, true); + File txtzip = new File(filePath + File.separator + "togd_" + new SimpleDateFormat("yyyyMMdd000000").format(date) + ".zip"); + log.error("textZipFile:{}", txtzip.getAbsolutePath()); + OutputStream outputStream = new FileOutputStream(txtzip); + File writename = new File(file.getPath() + "/" + file.getName() + ".txt"); + com.engine.custom.hg.util.ZipUtil.filesToZip(writename, outputStream, writename.getName()); + log.error("writename:{}", writename.getName()); + String s = HgUtils.putFile(txtzip.getAbsolutePath(), txtzip.getName()); + updateRecord(request,"esbtxtml",s); + updateRecord(request,"zt","0"); + log.error("textZip:{}", s); + } catch (FtpException e) { + e.printStackTrace(); + log.error("推送档案requestid:{}异常,异常原因为:{}",request,e.getMessage()); + } catch (IOException e) { + e.printStackTrace(); + log.error("推送档案requestid:{}异常,异常原因为:{}",request,e.getMessage()); + } catch (Exception e){ + e.printStackTrace(); + log.error("推送档案requestid:{}异常,异常原因为:{}",request,e.getMessage()); + } + } + + } + + + private String generateFile(int requestid) throws FtpException, IOException { + Map requesData = getRequestByid(requestid); + String newRequestid = "togd"+requestid; + log.info("requesData:{}", requesData); + String bh = requesData.get("bh"); + if (StringUtil.isEmpty(bh)){ + return "-1"; + } + String fj = Util.null2String(requesData.get("fj")); + String dwd = Util.null2String(requesData.get("dwd")); + String zw = Util.null2String(requesData.get("zw")); + String qgqhj = Util.null2String(requesData.get("qgqhj")); + String thhlh = Util.null2String(requesData.get("thhlh")); + + + //增加签字意见中的附件到附件文件夹中 + Map signFiles = ArchivesUtil.getSignFiles(requestid,false); + List docids = new ArrayList<>(); + // docids.addAll(Arrays.asList(fj.split(","))); + // docids.addAll(Arrays.asList(zwkbj.split(","))); + Map fjMap = ArchivesUtil.getFileIdByDocId(fj); + Map dwdMap = ArchivesUtil.getFileIdByDocId(dwd); + Map zwMap = ArchivesUtil.getFileIdByDocId(zw); + Map qgqhjMap = ArchivesUtil.getFileIdByDocId(qgqhj); + Map thhlhMap = ArchivesUtil.getFileIdByDocId(thhlh); + List zwFileName = new ArrayList<>(); + List fjFileName = new ArrayList<>(); + final int[] i = {1}; + //附件 + fjMap.forEach((docid, imageid) -> { + ImageFileManager imageFileManager = new ImageFileManager(); + imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + InputStream inputStream = imageFileManager.getInputStream(); + //中文路径/中文文件名 + String imageFileName = filePath + File.separator + newRequestid + File.separator + fjdir + File.separator + lcfjWord + "-" +imageFileManager.getImageFileName(); + fjFileName.add(lcfjWord + "-" +imageFileManager.getImageFileName()); + log.info("生成附件路径:{}", imageFileName); + imageFileName = ArchivesUtil.codeUtf8(imageFileName); + try { + File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + String jsonStr = ArchivesUtil.callApi(Url, file); + log.error("永中接口返回数据:{}", jsonStr); + JSONObject result = JSONObject.parseObject(jsonStr); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + fjdir + File.separator + lcfjWord + "-" + imageFileManager.getImageFileName() + ".pdf"); + } + } catch (IOException e) { + e.printStackTrace(); + }finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + }); + + //签字意见附件 + signFiles.forEach((docid, imageid) -> { + ImageFileManager imageFileManager = new ImageFileManager(); + imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + InputStream inputStream = imageFileManager.getInputStream(); + //中文路径/中文文件名 + String imageFileName = filePath + File.separator + newRequestid + File.separator + fjdir + File.separator + qzyjfjWord+ "-" +imageFileManager.getImageFileName(); + fjFileName.add(qzyjfjWord+ "-" +imageFileManager.getImageFileName()); + log.info("生成签字意见附件路径:{}", imageFileName); + imageFileName = ArchivesUtil.codeUtf8(imageFileName); + try { + File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + String jsonStr = ArchivesUtil.callApi(Url, file); + log.error("永中接口返回数据:{}", jsonStr); + JSONObject result = JSONObject.parseObject(jsonStr); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + fjdir + File.separator + qzyjfjWord+ "-" + imageFileManager.getImageFileName() + ".pdf"); + } + } catch (IOException e) { + e.printStackTrace(); + }finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + }); + + //多文档 + // dwdMap.forEach((docid, imageid) -> { + // ImageFileManager imageFileManager = new ImageFileManager(); + // imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + // InputStream inputStream = imageFileManager.getInputStream(); + // zwFileName.add(imageFileManager.getImageFileName()); + // //中文路径/中文文件名 + // String imageFileName = filePath + File.separator + requestid + File.separator + zwdir + File.separator + fjWord + i[0] + "_" + zwWord + "_" + imageFileManager.getImageFileName(); + // log.info("生成多文档路径:{}", imageFileName); + // imageFileName = ArchivesUtil.codeUtf8(imageFileName); + // try { + // File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + // String jsonStr = ArchivesUtil.callApi(Url, file); + // log.error("永中接口返回:{}", jsonStr); + // JSONObject result = JSONObject.parseObject(jsonStr); + // String errorcode = result.getString("errorcode"); + // if ("0".equals(errorcode)) { + // JSONObject data = result.getJSONObject("data"); + // String destFileName = data.getString("destFileName"); + // String viewUrl = data.getString("viewUrl"); + // ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + requestid + File.separator + zwdir + File.separator + fjWord + i[0] + "_" + zwWord + "_" + imageFileManager.getImageFileName() + ".pdf"); + // } + // } catch (IOException e) { + // e.printStackTrace(); + // } + // i[0]++; + // }); + //正文 + zwMap.forEach((docid, imageid) -> { + ImageFileManager imageFileManager = new ImageFileManager(); + imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + InputStream inputStream = imageFileManager.getInputStream(); + + String newFile = fjWord + i[0] + "_" + zwWord + "-" + imageFileManager.getImageFileName(); + //中文路径/中文文件名 + String imageFileName = filePath + File.separator + newRequestid + File.separator + zwdir + File.separator + newFile; + zwFileName.add(newFile); + log.info("生成正文路径:{}", imageFileName); + imageFileName = ArchivesUtil.codeUtf8(imageFileName); + try { + File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + String jsonStr = ArchivesUtil.callApi(Url, file); + log.error("永中接口返回:{}", jsonStr); + JSONObject result = JSONObject.parseObject(jsonStr); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + zwdir + File.separator + newFile + ".pdf"); + } + } catch (IOException e) { + e.printStackTrace(); + }finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + i[0]++; + }); + //清稿前痕迹 + qgqhjMap.forEach((docid, imageid) -> { + ImageFileManager imageFileManager = new ImageFileManager(); + imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + InputStream inputStream = imageFileManager.getInputStream(); + + String newFile = fjWord + i[0] + "_" + lhgWord + "-" + imageFileManager.getImageFileName(); + zwFileName.add(newFile); + //中文路径/中文文件名 + String imageFileName = filePath + File.separator + newRequestid + File.separator + zwdir + File.separator + newFile; + log.info("生成清稿前痕迹路径:{}", imageFileName); + imageFileName = ArchivesUtil.codeUtf8(imageFileName); + try { + File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + String jsonStr = ArchivesUtil.callApi(Url, file); + log.error("永中接口返回:{}", jsonStr); + JSONObject result = JSONObject.parseObject(jsonStr); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + zwdir + File.separator + newFile + ".pdf"); + } + } catch (IOException e) { + e.printStackTrace(); + }finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + i[0]++; + }); + //套红后留痕 + // thhlhMap.forEach((docid, imageid) -> { + // ImageFileManager imageFileManager = new ImageFileManager(); + // imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + // InputStream inputStream = imageFileManager.getInputStream(); + // zwFileName.add(imageFileManager.getImageFileName()); + // //中文路径/中文文件名 + // String imageFileName = filePath + File.separator + requestid + File.separator + zwdir + File.separator + fjWord + i[0] + "_" + lhgWord + "_" + imageFileManager.getImageFileName(); + // log.info("生成套红后留痕路径:{}", imageFileName); + // imageFileName = ArchivesUtil.codeUtf8(imageFileName); + // try { + // File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + // String jsonStr = ArchivesUtil.callApi(Url, file); + // log.error("永中接口返回:{}", jsonStr); + // JSONObject result = JSONObject.parseObject(jsonStr); + // String errorcode = result.getString("errorcode"); + // if ("0".equals(errorcode)) { + // JSONObject data = result.getJSONObject("data"); + // String destFileName = data.getString("destFileName"); + // String viewUrl = data.getString("viewUrl"); + // ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + requestid + File.separator + zwdir + File.separator + fjWord + i[0] + "_" + lhgWord + "_" + imageFileManager.getImageFileName() + ".pdf"); + // } + // } catch (IOException e) { + // e.printStackTrace(); + // } + // i[0]++; + // }); + + //开始承办单 先获取主流程的承办单 + List requestDocid = ArchivesUtil.generaRequestFormPdf(requestid, 0); + // 1.去掉生成子流程承办单 + // List subRequestDocid = generaSubRequestFormPdf(requestid); + Map reqDocMap = ArchivesUtil.getFileIdByDocId(String.join(",", requestDocid)); + // 2.去掉生成子流程承办单 + // Map subReqDocMap = getFileIdByDocId(String.join(",", subRequestDocid)); + log.error("reqDocMap:{}", JSONObject.toJSONString(reqDocMap)); + //log.error("subReqDocMap:{}", JSONObject.toJSONString(subReqDocMap)); + docids.addAll(requestDocid); + // 3.去掉生成子流程承办单 + // docids.addAll(subRequestDocid); + i[0] = 1; + //主流程承办单 + reqDocMap.forEach((docid, imageid) -> { + ImageFileManager imageFileManager = new ImageFileManager(); + imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + InputStream inputStream = imageFileManager.getInputStream(); + //中文路径/中文文件名 + // String imageFileName = filePath + File.separator + requestid + File.separator + cbddir + File.separator + fjFile + i[0] + "_" + imageFileManager.getImageFileName(); + // String imageFileName = filePath + File.separator + newRequestid + File.separator + cbddir + File.separator + fjFile + i[0] + "_" + wjcldWord+".pdf"; + String imageFileName = filePath + File.separator + newRequestid + File.separator + cbddir + File.separator + wjcldWord+".pdf"; + log.info("主流程承办单路径:{}", imageFileName); + imageFileName = ArchivesUtil.codeUtf8(imageFileName); + try { + File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + String jsonStr = ArchivesUtil.callApi(Url, file); + log.error("永中接口返回:{}", jsonStr); + JSONObject result = JSONObject.parseObject(jsonStr); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + cbddir + File.separator + wjcldWord + ".pdf" + ".pdf"); + } + i[0]++; + } catch (IOException e) { + e.printStackTrace(); + }finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + }); +//正文 + + + log.error(JSONObject.toJSONString(requestDocid)); + for (String docid : docids) { + log.error("删除了" + docid); + ArchivesUtil.deleteDocByid(docid); + } + //-------------------------------------------------------------------- + RequestService requestService = new RequestService(); + RequestInfo requestInfo = requestService.getRequest(Util.getIntValue(requestid), 100); + String workflowid = requestInfo.getWorkflowid(); + String logFile = ArchivesUtil.getSignLog(requestid, cbddir + File.separator + lzxxdir, requestInfo.getCreatorid() + requestInfo.getDescription(), templatePath, filePath,false,workflowid); + String s = ArchivesUtil.callApi(Url, new File(logFile)); + log.error(s); + JSONObject result = JSONObject.parseObject(s); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, logFile + ".pdf"); + } + String zipName = filePath + File.separator + newRequestid + ".zip"; + ZipUtil.zip(filePath + File.separator + newRequestid, zipName); + log.error("zipName:{}", zipName); + String ftpFilePath = HgUtils.putFile(zipName, newRequestid + ".zip"); + log.error("ftpFilePath:{}", ftpFilePath); + updateRecord(requestid,"esbwjml",ftpFilePath); + // String ftpFilePathNew = HgUtils.putFile(zipName, "test" + File.separator + requestid + ".zip"); + // log.error("ftpFilePathNew:{}", ftpFilePathNew); + String context = getContext(requestid, requesData, newRequestid + ".zip", zwFileName, fjFileName); + // insertRecord(requestid, context, ftpFilePath); + updateRecord(requestid,"content",context); + log.error("context:{}", context); + return context; + } + + + /*** + * 封装数据 + * @param requestid + * @return + */ + public Map getRequestByid(int requestid) { + HashMap record = new HashMap<>(); + String sql = "select * from formtable_main_11 where requestid = ?"; + String reqsql = "select REQUESTNAME from WORKFLOW_REQUESTBASE where REQUESTID = ?"; + RecordSet rs = new RecordSet(); + rs.executeQuery(sql, requestid); + if (rs.next()) { + record.put("fj", Util.null2String(rs.getString("fj"))); + record.put("dwd", Util.null2String(rs.getString("dwd"))); + record.put("zw", Util.null2String(rs.getString("zw"))); + record.put("ngrq", Util.null2String(rs.getString("ngrq"))); + record.put("jghwt", Util.null2String(rs.getString("jghwt"))); + record.put("bh", Util.null2String(rs.getString("bh"))); + record.put("ngbm", Util.null2String(rs.getString("ngbm"))); + record.put("bgqx", Util.null2String(rs.getString("bgqx"))); + record.put("cwrq", Util.null2String(rs.getString("cwrq"))); + record.put("ys", Util.null2String(rs.getString("ys"))); + record.put("wz", Util.null2String(rs.getString("wz"))); + record.put("ngbm", Util.null2String(rs.getString("ngbm"))); + record.put("lb", Util.null2String(rs.getString("lb"))); + record.put("bz", Util.null2String(rs.getString("bz"))); + record.put("yywh", Util.null2String(rs.getString("yywh"))); + record.put("wjlx", Util.null2String(rs.getString("wjlx"))); + record.put("fwlx", Util.null2String(rs.getString("fwlx"))); + record.put("f", Util.null2String(rs.getString("f"))); + record.put("ngr", Util.null2String(rs.getString("ngr"))); + record.put("qgqhj", Util.null2String(rs.getString("qgqhj"))); + record.put("thhlh", Util.null2String(rs.getString("thhlh"))); + + } + rs.executeQuery(reqsql, requestid); + if (rs.next()) { + record.put("REQUESTNAME", Util.null2String(rs.getString("REQUESTNAME"))); + } + return record; + } + + private String getContext(int requestid, Map requesData, String zipName, List zwFileName, List fjFileName) { + StringBuilder context = new StringBuilder(); + try { + DepartmentComInfo departmentComInfo = new DepartmentComInfo(); + String ngrq = Util.null2String(requesData.get("ngrq")); //拟稿日期 + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + LocalDate date = LocalDate.parse(ngrq, formatter); + int year = date.getYear(); + context.append(year).append("|"); //1.年度 -> 拟稿日期 + String jghwt = Util.null2String(requesData.get("jghwt"));//2.机构或问题 -> 机构或问题 + context.append(jghwt).append("|"); + String bh = Util.null2String(requesData.get("bh"));// 3.文号 -> 编号 + context.append(bh).append("|"); + String requestname = Util.null2String(requesData.get("REQUESTNAME")); // 4.文件题名 -> 流程名称 + context.append(requestname).append("|"); + String ngbmName = Util.null2String(departmentComInfo.getDepartmentname(requesData.get("ngbm"))); //5 责任者 -> 拟稿部门 + context.append(ngbmName).append("|"); + String bgqx = Util.null2String(requesData.get("bgqx")); //6 保管期限 -> 保管期限 + context.append(bgqx).append("|"); + String cwrq = Util.null2String(requesData.get("cwrq")); //7 日期 -> 成文日期 + context.append(cwrq).append("|"); + String ys = Util.null2String(requesData.get("ys")); //8 页数 -> 页数 + context.append(ys).append("|"); + String wz = Util.null2String(requesData.get("wz")); //9 文种 -> 文种 + context.append(wz).append("|"); + String ngbm = Util.null2String(requesData.get("ngbm")); + String[] deptData = ArchivesUtil.getDeptNameAndCode(ngbm); + String[] subData = ArchivesUtil.getSubCom(ngbm); + context.append("D10001").append("|"); //10 行编号 -> 拟稿部门 + + context.append("总行机关").append("|"); //11 行名称 + context.append("").append("|"); // 12 保管期限编号 + context.append("").append("|"); // 13 保管期限及编号 + context.append("").append("|"); // 14 是否开放 + context.append("").append("|"); // 15 互见号 + String lb = Util.null2String(requesData.get("lb")); + context.append(lb).append("|"); //16 类别 -> 类别 + //TODO + String xgbm = Util.null2String(getAssociatedDepts(requesData)); + context.append(xgbm).append("|"); //17 相关部门 -> 流经部门 + // String lwh = Util.null2String(requesData.get("lwh")); + context.append("").append("|");// 18 收文号 -> 空 + String fs = ""; + context.append(fs).append("|"); // 19 份数 -> 份数 + String bz = Util.null2String(requesData.get("bz")); + context.append("").append("|"); // 20 备注 -> 备注 + String yywh = Util.null2String(requesData.get("yywh")); + context.append("").append("|"); // 21 引用文号 -> 引用文号 + String wjlx = Util.null2String(requesData.get("wjlx")); + context.append("").append("|"); // 22 文件类型 -> 空 + String fwlx = Util.null2String(requesData.get("fwlx")); + context.append("总行发文").append("|"); // 23 发文类型 -> 空 + String f = Util.null2String(requesData.get("f")); + context.append(f).append("|"); // 24 发 -> 空 + String ngr = Util.null2String(requesData.get("ngr")); + context.append(new User(Util.getIntValue(ngr)).getLoginid()).append("|"); // 25 拟稿人 -> 拟稿人 + context.append(ngbmName).append("|"); // 26 拟稿部门 -> 拟稿部门名称 + context.append("发文").append("|"); // 27 公文类型 -> "收文" + //TODO + context.append(ArchivesUtil.getAssociatedPersons(requestid,false)).append("|"); // 28 相关人员 -> 参与人员 + context.append("智慧OA").append("|"); // 29 数据来源 -> 数据来源 + context.append(year).append("|"); // 30 形成年度 -> 年份 + context.append(String.join("&&", zwFileName)).append("|"); // 31 正文名称 + context.append(String.join("&&", fjFileName)).append("|"); // 32 附件名称 + context.append("togd"+requestid).append("|"); // 33 主键 + context.append("").append("|"); // 34 关联主键 + context.append("").append("|"); // 35 被关联主键 + context.append(zipName);// 36 压缩包名称 + } catch (Exception e) { + e.printStackTrace(); + log.error("getContextError:{}", e.getMessage()); + } + + return context.toString(); + } + + + + + private String getAssociatedDepts(Map requesData) { + HashSet records = new HashSet<>(); + records.addAll(Arrays.asList(Util.null2String(requesData.get("hqbm")).split(","))); // 会签部门 + records.addAll(Arrays.asList(Util.null2String(requesData.get("ngbm")).split(","))); // 拟稿部门 + records.addAll(Arrays.asList(Util.null2String(requesData.get("bmyb")).split(","))); // 部门阅办 + records.addAll(Arrays.asList(Util.null2String(requesData.get("cs")).split(","))); // 抄送 + records.addAll(Arrays.asList(Util.null2String(requesData.get("nbfs")).split(","))); // 本行发送 + records.addAll(Arrays.asList(Util.null2String(requesData.get("zs")).split(","))); // 主送 + records.addAll(Arrays.asList(Util.null2String(requesData.get("dqbm")).split(","))); // 当前部门 + records.addAll(Arrays.asList(Util.null2String(requesData.get("cb")).split(","))); // 抄报 + records.addAll(Arrays.asList(Util.null2String(requesData.get("bmhqzj")).split(","))); // 部门会签(追加) + records.addAll(Arrays.asList(Util.null2String(requesData.get("bmybzj")).split(","))); // 部门阅办(追加) + ArrayList deptName = new ArrayList<>(); + DepartmentComInfo departmentComInfo = new DepartmentComInfo(); + for (String record : records) { + try { + if (StringUtil.isEmpty(record)){ + continue; + } + String departmentName = departmentComInfo.getDepartmentName(record); + deptName.add(departmentName); + } catch (Exception e) { + e.printStackTrace(); + } + } + + return String.join("&&", deptName); + } + + private void updateRecord(int requestid, String field , String fieldvalue) { + String sql = "update uf_pushArchivesLog set "+field+" = ? where request = ?"; + RecordSet recordSet = new RecordSet(); + recordSet.executeUpdate(sql, fieldvalue, requestid); + } + + + +%> \ No newline at end of file diff --git a/weavernorth/com/SignReportPushArchivesService.jsp b/weavernorth/com/SignReportPushArchivesService.jsp new file mode 100644 index 0000000..7cb814f --- /dev/null +++ b/weavernorth/com/SignReportPushArchivesService.jsp @@ -0,0 +1,588 @@ +<%@ page import="weaver.conn.RecordSet" %> +<%@ page import="weaver.general.BaseBean" %> +<%@ page import="weaver.general.Util" %> +<%@ page import="com.alibaba.fastjson.JSONObject" %> +<%@ page import="com.alibaba.fastjson.JSONArray" %> +<%@ page import="java.util.regex.Pattern" %> +<%@ page import="java.util.regex.Matcher" %> +<%@ page import="java.io.*" %> +<%@ page import="weaver.docs.webservices.DocInfo" %> +<%@ page import="weaver.docs.webservices.DocAttachment" %> +<%@ page import="org.apache.axis.encoding.Base64" %> +<%@ page import="weaver.docs.webservices.DocServiceImpl" %> +<%@ page import="weaver.hrm.User" %> +<%@ page import="java.text.SimpleDateFormat" %> +<%@ page import="java.util.*" %> +<%@ page import="org.apache.commons.lang.StringUtils" %> +<%@ page language="java" contentType="text/html; charset=UTF-8"%> +<%@ page import="org.apache.http.impl.client.CloseableHttpClient" %> +<%@ page import="org.apache.http.impl.client.HttpClients" %> +<%@ page import="org.apache.http.client.methods.HttpPost" %> +<%@ page import="com.alibaba.fastjson.JSON" %> +<%@ page import="org.apache.http.entity.StringEntity" %> +<%@ page import="org.apache.http.client.methods.CloseableHttpResponse" %> +<%@ page import="org.apache.http.HttpStatus" %> +<%@ page import="org.apache.http.HttpEntity" %> +<%@ page import="org.apache.http.util.EntityUtils" %> +<%@ page import="org.apache.http.client.ClientProtocolException" %> +<%@ page import="weaver.hrm.HrmUserVarify" %> +<%@ page import="java.net.URL" %> +<%@ page import="java.net.HttpURLConnection" %> +<%@ page import="org.apache.http.HttpException" %> +<%@ page import="org.apache.http.client.HttpClient" %> +<%@ page import="org.apache.commons.httpclient.methods.PostMethod" %> +<%@ page import="org.apache.commons.httpclient.params.HttpMethodParams" %> +<%@ page import="org.slf4j.Logger" %> +<%@ page import="org.slf4j.LoggerFactory" %> +<%@ page import="com.engine.custom.archives.util.ArchivesUtil" %> +<%@ page import="com.engine.custom.archives.entity.PushArchivesBean" %> +<%@ page import="com.engine.custom.hg.util.HgUtils" %> +<%@ page import="com.dcfs.fts.common.error.FtpException" %> +<%@ page import="weaver.file.ImageFileManager" %> +<%@ page import="weaver.soa.workflow.request.RequestService" %> +<%@ page import="weaver.soa.workflow.request.RequestInfo" %> +<%@ page import="cn.hutool.core.util.ZipUtil" %> +<%@ page import="weaver.hrm.company.DepartmentComInfo" %> +<%@ page import="java.time.format.DateTimeFormatter" %> +<%@ page import="java.time.LocalDate" %> +<%@ page import="weaver.general.StringUtil" %> +<%@ page import="java.net.URLEncoder" %> +<%@ page import="java.nio.charset.StandardCharsets" %> +<%@ page import="okhttp3.*" %> +<%@ page import="com.engine.common.util.ParamUtil" %> + +<% + Map paramMap = ParamUtil.request2Map(request); + String requestid = Util.null2String(paramMap.get("requestid")); + Logger log = LoggerFactory.getLogger("Archives"); + log.info("PushArchivesCorn====Begin========"); + Date date = ArchivesUtil.getDate(); + String dateStr = new SimpleDateFormat("yyyyMMdd").format(date); + ArrayList pushArchivesBeans = new ArrayList<>(); + PushArchivesBean pushArchivesBean = new PushArchivesBean(); + pushArchivesBean.setRequest(Util.getIntValue(requestid)); + pushArchivesBeans.add(pushArchivesBean); + pushArchives(pushArchivesBeans,dateStr); + + +%> + +<%! + public static Logger log = LoggerFactory.getLogger("Archives"); + private static String filePath = "/opt/oadata/archivesFile"; + // private static String Url = "http://14.1.213.5:18080/fcscloud/composite/upload" ; + public String Url = "http://14.1.206.240:18080/fcscloud/composite/upload"; + private static String templatePath = "/opt/weaver/archivesFile/template/"; // 模板文件路径 + private static final String zwdir = "正文"; + private static final String fjdir = "附件"; + private static final String cbddir = "承办单"; + private static final String zlcdir = "承办单" + File.separator + "子流程"; + private static final String lzxxdir = "流转信息"; + private static final String fjFile = "附件"; + private static final String fjWord = "附件"; + private static final String zwWord = "正文"; + private static final String lhgWord = "留痕稿"; + private static final String lcfjWord = "流程附件"; + private static final String qzyjfjWord = "签字意见附件"; + private static final String wjcldWord = "文件处理单"; + private static final String wjlzxxWord = "文件流转信息"; + + public void setProp(Map param) { + filePath = Util.null2String(param.get("filePath")); + Url = Util.null2String(param.get("Url")); + templatePath = Util.null2String(param.get("templatePath")); + } + + public void pushArchives(List result, String dateStr) { + filePath = filePath + File.separator + dateStr ; + Date date = ArchivesUtil.getDate(); + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); + String format = dateFormat.format(date); + SimpleDateFormat yyyyMMddHHmmss = new SimpleDateFormat("yyyy-MM-dd HH:mm"); + // 获取当前时间的第一秒 + String firstSecond = yyyyMMddHHmmss.format(ArchivesUtil.getFirstSecondOfDate(date)); + // 获取当前时间的最后一秒 + String lastSecond = yyyyMMddHHmmss.format(ArchivesUtil.getLastSecondOfDate(date)); + RecordSet recordSet = new RecordSet(); + //签报 type = 2 + // List result = ArchivesUtil.getResultList(recordSet, firstSecond, lastSecond, 2); + log.error("推送发文的数量:{}", result.size()); + File file = ArchivesUtil.crFile(filePath + "/togd_" + new SimpleDateFormat("yyyyMMdd000000").format(date)); + log.error("textfile:{}", file.getAbsolutePath()); + for (PushArchivesBean pushArchivesBean : result) { + int id = pushArchivesBean.getId(); + int request = pushArchivesBean.getRequest(); + log.error("推送的requestId:{}", request); + try { + String context = generateFile(request); + if ("-1".equals(context)){ + continue; + } + ArchivesUtil.writeToTxt(file.getPath(), file.getName(), context, true); + File txtzip = new File(filePath + File.separator + "togd_" + new SimpleDateFormat("yyyyMMdd000000").format(date) + ".zip"); + log.error("textZipFile:{}", txtzip.getAbsolutePath()); + OutputStream outputStream = new FileOutputStream(txtzip); + File writename = new File(file.getPath() + "/" + file.getName() + ".txt"); + com.engine.custom.hg.util.ZipUtil.filesToZip(writename, outputStream, writename.getName()); + log.error("writename:{}", writename.getName()); + String s = HgUtils.putFile(txtzip.getAbsolutePath(), txtzip.getName()); + // updateRecord(request, s); + updateRecord(request,"esbtxtml",s); + updateRecord(request,"zt","0"); + log.error("textZip:{}", s); + } catch (FtpException e) { + log.error("推送档案requestid:{}异常,异常原因为:{}",request,e.getMessage()); + e.printStackTrace(); + } catch (IOException e) { + log.error("推送档案requestid:{}异常,异常原因为:{}",request,e.getMessage()); + e.printStackTrace(); + } catch (Exception e) { + log.error("推送档案requestid:{}异常,异常原因为:{}",request,e.getMessage()); + + e.printStackTrace(); + } + } + } + + + + private String generateFile(int requestid) throws FtpException, IOException { + Map requesData = getRequestByid(requestid); + String newRequestid = "togd"+requestid; + log.info("requesData:{}", requesData); + String bhnew = requesData.get("bhnew"); + log.info("流程id:{}:文号为空不推送", requestid); + if (StringUtil.isEmpty(bhnew)){ + return "-1"; + } + String fj = Util.null2String(requesData.get("fj")); + String dwd = Util.null2String(requesData.get("dwd")); + String zw = Util.null2String(requesData.get("zw")); + String qgqhj = Util.null2String(requesData.get("qgqhj")); + //可能有多个,获取id最大的一个 + qgqhj = Util.null2String(ArchivesUtil.findMaxValue(qgqhj)); + + //增加签字意见中的附件到附件文件夹中 + Map signFiles = ArchivesUtil.getSignFiles(requestid,true); + List docids = new ArrayList<>(); + // docids.addAll(Arrays.asList(fj.split(","))); + // docids.addAll(Arrays.asList(zwkbj.split(","))); + Map fjMap = ArchivesUtil.getFileIdByDocId(fj); + Map zwMap = ArchivesUtil.getFileIdByDocId(zw); + Map qgqhjMap = ArchivesUtil.getFileIdByDocId(qgqhj); + List zwFileName = new ArrayList<>(); + List fjFileName = new ArrayList<>(); + final int[] i = {1}; + //附件 + fjMap.forEach((docid, imageid) -> { + ImageFileManager imageFileManager = new ImageFileManager(); + imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + InputStream inputStream = imageFileManager.getInputStream(); + //中文路径/中文文件名 + String imageFileName = filePath + File.separator + newRequestid + File.separator + fjdir + File.separator + lcfjWord + "-" +imageFileManager.getImageFileName(); + fjFileName.add(imageFileManager.getImageFileName()); + log.info("生成附件路径:{}", imageFileName); + imageFileName = ArchivesUtil.codeUtf8(imageFileName); + try { + File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + String jsonStr = ArchivesUtil.callApi(Url, file); + log.error("永中接口返回数据:{}", jsonStr); + JSONObject result = JSONObject.parseObject(jsonStr); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + fjdir + File.separator + lcfjWord + "-" + imageFileManager.getImageFileName() + ".pdf"); + } + } catch (IOException e) { + e.printStackTrace(); + } finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + }); + + //签字意见附件 + signFiles.forEach((docid, imageid) -> { + ImageFileManager imageFileManager = new ImageFileManager(); + imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + InputStream inputStream = imageFileManager.getInputStream(); + //中文路径/中文文件名 + String imageFileName = filePath + File.separator + newRequestid + File.separator + fjdir + File.separator + qzyjfjWord+ "-" +imageFileManager.getImageFileName(); + fjFileName.add(imageFileManager.getImageFileName()); + log.info("生成签字意见附件路径:{}", imageFileName); + imageFileName = ArchivesUtil.codeUtf8(imageFileName); + try { + File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + String jsonStr = ArchivesUtil.callApi(Url, file); + log.error("永中接口返回数据:{}", jsonStr); + JSONObject result = JSONObject.parseObject(jsonStr); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + fjdir + File.separator + qzyjfjWord+ "-" + imageFileManager.getImageFileName() + ".pdf"); + } + } catch (IOException e) { + e.printStackTrace(); + } finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + }); + + + //正文 + zwMap.forEach((docid, imageid) -> { + ImageFileManager imageFileManager = new ImageFileManager(); + imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + InputStream inputStream = imageFileManager.getInputStream(); + + String newFile = fjWord + i[0] + "_" + zwWord + "-" + imageFileManager.getImageFileName(); + //中文路径/中文文件名 + String imageFileName = filePath + File.separator + newRequestid + File.separator + zwdir + File.separator + newFile; + zwFileName.add(newFile); + log.info("生成正文路径:{}", imageFileName); + imageFileName = ArchivesUtil.codeUtf8(imageFileName); + try { + File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + String jsonStr = ArchivesUtil.callApi(Url, file); + log.error("永中接口返回:{}", jsonStr); + JSONObject result = JSONObject.parseObject(jsonStr); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + zwdir + File.separator + newFile + ".pdf"); + } + } catch (IOException e) { + e.printStackTrace(); + } finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + i[0]++; + }); + //清稿前痕迹 + qgqhjMap.forEach((docid, imageid) -> { + ImageFileManager imageFileManager = new ImageFileManager(); + imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + InputStream inputStream = imageFileManager.getInputStream(); + + String newFile = fjWord + i[0] + "_" + lhgWord + "-" + imageFileManager.getImageFileName(); + zwFileName.add(newFile); + //中文路径/中文文件名 + String imageFileName = filePath + File.separator + newRequestid + File.separator + zwdir + File.separator + newFile; + log.info("生成清稿前痕迹路径:{}", imageFileName); + imageFileName = ArchivesUtil.codeUtf8(imageFileName); + try { + File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + String jsonStr = ArchivesUtil.callApi(Url, file); + log.error("永中接口返回:{}", jsonStr); + JSONObject result = JSONObject.parseObject(jsonStr); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + zwdir + File.separator + newFile + ".pdf"); + } + } catch (IOException e) { + e.printStackTrace(); + } finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + i[0]++; + }); + //套红后留痕 + // thhlhMap.forEach((docid, imageid) -> { + // ImageFileManager imageFileManager = new ImageFileManager(); + // imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + // InputStream inputStream = imageFileManager.getInputStream(); + // zwFileName.add(imageFileManager.getImageFileName()); + // //中文路径/中文文件名 + // String imageFileName = filePath + File.separator + requestid + File.separator + zwdir + File.separator + fjWord + i[0] + "_" + lhgWord + "_" + imageFileManager.getImageFileName(); + // log.info("生成套红后留痕路径:{}", imageFileName); + // imageFileName = ArchivesUtil.codeUtf8(imageFileName); + // try { + // File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + // String jsonStr = ArchivesUtil.callApi(Url, file); + // log.error("永中接口返回:{}", jsonStr); + // JSONObject result = JSONObject.parseObject(jsonStr); + // String errorcode = result.getString("errorcode"); + // if ("0".equals(errorcode)) { + // JSONObject data = result.getJSONObject("data"); + // String destFileName = data.getString("destFileName"); + // String viewUrl = data.getString("viewUrl"); + // ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + requestid + File.separator + zwdir + File.separator + fjWord + i[0] + "_" + lhgWord + "_" + imageFileManager.getImageFileName() + ".pdf"); + // } + // } catch (IOException e) { + // e.printStackTrace(); + // } + // i[0]++; + // }); + + //开始承办单 先获取主流程的承办单 + List requestDocid = ArchivesUtil.generaRequestFormPdf(requestid, 1); + // 1.去掉生成子流程承办单 + // List subRequestDocid = generaSubRequestFormPdf(requestid); + Map reqDocMap = ArchivesUtil.getFileIdByDocId(String.join(",", requestDocid)); + // 2.去掉生成子流程承办单 + // Map subReqDocMap = getFileIdByDocId(String.join(",", subRequestDocid)); + log.error("reqDocMap:{}", JSONObject.toJSONString(reqDocMap)); + //log.error("subReqDocMap:{}", JSONObject.toJSONString(subReqDocMap)); + docids.addAll(requestDocid); + // 3.去掉生成子流程承办单 + // docids.addAll(subRequestDocid); + i[0] = 1; + //主流程承办单 + reqDocMap.forEach((docid, imageid) -> { + ImageFileManager imageFileManager = new ImageFileManager(); + imageFileManager.getImageFileInfoById(Util.getIntValue(imageid)); + InputStream inputStream = imageFileManager.getInputStream(); + //中文路径/中文文件名 + // String imageFileName = filePath + File.separator + requestid + File.separator + cbddir + File.separator + fjFile + i[0] + "_" + imageFileManager.getImageFileName(); + // String imageFileName = filePath + File.separator + newRequestid + File.separator + cbddir + File.separator + fjFile + i[0] + "_" + wjcldWord+".pdf"; + String imageFileName = filePath + File.separator + newRequestid + File.separator + cbddir + File.separator + wjcldWord+".pdf"; + log.info("主流程承办单路径:{}", imageFileName); + imageFileName = ArchivesUtil.codeUtf8(imageFileName); + try { + File file = ArchivesUtil.saveInputStreamToFile(inputStream, imageFileName); + String jsonStr = ArchivesUtil.callApi(Url, file); + log.error("永中接口返回:{}", jsonStr); + JSONObject result = JSONObject.parseObject(jsonStr); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + // ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + cbddir + File.separator + fjFile + i[0] + "_" + wjcldWord + ".pdf" + ".pdf"); + ArchivesUtil.downloadFile(viewUrl, filePath + File.separator + newRequestid + File.separator + cbddir + File.separator + wjcldWord + ".pdf" + ".pdf"); + } + i[0]++; + } catch (IOException e) { + e.printStackTrace(); + }finally { + if(inputStream!=null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + }); +//正文 + + + log.error(JSONObject.toJSONString(requestDocid)); + for (String docid : docids) { + log.error("删除了" + docid); + ArchivesUtil.deleteDocByid(docid); + } + //-------------------------------------------------------------------- + RequestService requestService = new RequestService(); + RequestInfo requestInfo = requestService.getRequest(Util.getIntValue(requestid), 100); + String workflowid = requestInfo.getWorkflowid(); + String logFile = ArchivesUtil.getSignLog(requestid, cbddir + File.separator + lzxxdir, requestInfo.getCreatorid() + requestInfo.getDescription(), templatePath, filePath,true,workflowid); + String s = ArchivesUtil.callApi(Url, new File(logFile)); + log.error(s); + JSONObject result = JSONObject.parseObject(s); + String errorcode = result.getString("errorcode"); + if ("0".equals(errorcode)) { + JSONObject data = result.getJSONObject("data"); + String destFileName = data.getString("destFileName"); + String viewUrl = data.getString("viewUrl"); + ArchivesUtil.downloadFile(viewUrl, logFile + ".pdf"); + } + String zipName = filePath + File.separator + newRequestid + ".zip"; + ZipUtil.zip(filePath + File.separator + newRequestid, zipName); + log.error("zipName:{}", zipName); + String ftpFilePath = HgUtils.putFile(zipName, newRequestid + ".zip"); + log.error("ftpFilePath:{}", ftpFilePath); + updateRecord(requestid,"esbwjml",ftpFilePath); + // String ftpFilePathNew = HgUtils.putFile(zipName, "test" + File.separator + requestid + ".zip"); + // log.error("ftpFilePathNew:{}", ftpFilePathNew); + String context = getContext(requestid, requesData, newRequestid + ".zip", zwFileName, fjFileName); + // insertRecord(requestid, context, ftpFilePath); + updateRecord(requestid,"content",context); + log.error("context:{}", context); + return context; + } + + + /*** + * 封装数据 + * @param requestid + * @return + */ + public Map getRequestByid(int requestid) { + HashMap record = new HashMap<>(); + String sql = "select * from formtable_main_20 where requestid = ?"; + String reqsql = "select REQUESTNAME from WORKFLOW_REQUESTBASE where REQUESTID = ?"; + RecordSet rs = new RecordSet(); + rs.executeQuery(sql, requestid); + if (rs.next()) { + record.put("bh", Util.null2String(rs.getString("bh"))); + record.put("bhnew", Util.null2String(rs.getString("bhnew"))); + record.put("ngbm", Util.null2String(rs.getString("ngbm"))); + record.put("ngr", Util.null2String(rs.getString("ngr"))); + record.put("ngrq", Util.null2String(rs.getString("ngrq"))); + record.put("lxfs", Util.null2String(rs.getString("lxfs"))); + record.put("bt", Util.null2String(rs.getString("bt"))); + record.put("zw", Util.null2String(rs.getString("zw"))); + record.put("fj", Util.null2String(rs.getString("fj"))); + record.put("hqbm", Util.null2String(rs.getString("hqbm"))); + record.put("hqbmzhwy", Util.null2String(rs.getString("hqbmzhwy"))); + record.put("hqdqbm", Util.null2String(rs.getString("hqdqbm"))); + record.put("ffbm", Util.null2String(rs.getString("ffbm"))); + record.put("hqbmzjhqbmzj", Util.null2String(rs.getString("hqbmzj"))); + record.put("dwd", Util.null2String(rs.getString("dwd"))); + record.put("bmffzj", Util.null2String(rs.getString("bmffzj"))); + record.put("dqnf", Util.null2String(rs.getString("dqnf"))); + record.put("qgqhj", Util.null2String(rs.getString("qgqhj"))); + } + rs.executeQuery(reqsql, requestid); + if (rs.next()) { + record.put("REQUESTNAME", Util.null2String(rs.getString("REQUESTNAME"))); + } + return record; + } + + + private String getContext(int requestid, Map requesData, String zipName, List zwFileName, List fjFileName) { + StringBuilder context = new StringBuilder(); + try { + DepartmentComInfo departmentComInfo = new DepartmentComInfo(); + String ngrq = Util.null2String(requesData.get("ngrq")); //拟稿日期 + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + LocalDate date = LocalDate.parse(ngrq, formatter); + int year = date.getYear(); + context.append(year).append("|"); //1.年度 -> 拟稿日期 + String jghwt = Util.null2String(requesData.get("jghwt"));//2.机构或问题 -> 机构或问题 + context.append(jghwt).append("|"); + String bh = Util.null2String(requesData.get("bhnew"));// 3.文号 -> 编号 + context.append(bh).append("|"); + String requestname = Util.null2String(requesData.get("REQUESTNAME")); // 4.文件题名 -> 流程名称 + context.append(requestname).append("|"); + String ngbmName = Util.null2String(departmentComInfo.getDepartmentname(requesData.get("ngbm"))); //5 责任者 -> 拟稿部门 + context.append(ngbmName).append("|"); + String bgqx = Util.null2String(requesData.get("bgqx")); //6 保管期限 -> 保管期限 + context.append(bgqx).append("|"); + // String cwrq = Util.null2String(requesData.get("cwrq")); //7 日期 -> 成文日期 + context.append(ngrq).append("|"); + String ys = Util.null2String(requesData.get("ys")); //8 页数 -> 页数 + context.append(ys).append("|"); + String wz = Util.null2String(requesData.get("wz")); //9 文种 -> 文种 + context.append(wz).append("|"); + String ngbm = Util.null2String(requesData.get("ngbm")); + String[] deptData = ArchivesUtil.getDeptNameAndCode(ngbm); + String[] subData = ArchivesUtil.getSubCom(ngbm); + context.append("D10001").append("|"); //10 行编号 -> 拟稿部门 + + context.append("总行机关").append("|"); //11 行名称 + context.append("").append("|"); // 12 保管期限编号 + context.append("").append("|"); // 13 保管期限及编号 + context.append("").append("|"); // 14 是否开放 + context.append("").append("|"); // 15 互见号 + String lb = Util.null2String(requesData.get("lb")); + context.append(lb).append("|"); //16 类别 -> 类别 + //TODO + String xgbm = Util.null2String(getAssociatedDepts(requesData)); + context.append(xgbm).append("|"); //17 相关部门 -> 流经部门 + // String lwh = Util.null2String(requesData.get("lwh")); + context.append("").append("|");// 18 收文号 -> 空 + String fs = ""; + context.append(fs).append("|"); // 19 份数 -> 份数 + String bz = Util.null2String(requesData.get("bz")); + context.append("").append("|"); // 20 备注 -> 备注 + String yywh = Util.null2String(requesData.get("yywh")); + context.append("").append("|"); // 21 引用文号 -> 引用文号 + String wjlx = Util.null2String(requesData.get("wjlx")); + context.append("").append("|"); // 22 文件类型 -> 空 + String fwlx = Util.null2String(requesData.get("fwlx")); + context.append("总行发文").append("|"); // 23 发文类型 -> 空 + String f = Util.null2String(requesData.get("f")); + context.append(f).append("|"); // 24 发 -> 空 + String ngr = Util.null2String(requesData.get("ngr")); + context.append(new User(Util.getIntValue(ngr)).getLoginid()).append("|"); // 25 拟稿人 -> 拟稿人 + context.append(ngbmName).append("|"); // 26 拟稿部门 -> 拟稿部门名称 + context.append("签报").append("|"); // 27 公文类型 -> "收文" + //TODO + context.append(ArchivesUtil.getAssociatedPersons(requestid,false)).append("|"); // 28 相关人员 -> 参与人员 + context.append("智慧OA").append("|"); // 29 数据来源 -> 数据来源 + context.append(year).append("|"); // 30 形成年度 -> 年份 + context.append(String.join("&&", zwFileName)).append("|"); // 31 正文名称 + context.append(String.join("&&", fjFileName)).append("|"); // 32 附件名称 + context.append("togd"+requestid).append("|"); // 33 主键 + context.append("").append("|"); // 34 关联主键 + context.append("").append("|"); // 35 被关联主键 + context.append(zipName);// 36 压缩包名称 + } catch (Exception e) { + e.printStackTrace(); + log.error("getContextError:{}", e.getMessage()); + } + + return context.toString(); + } + private String getAssociatedDepts(Map requesData) { + HashSet records = new HashSet<>(); + records.addAll(Arrays.asList(Util.null2String(requesData.get("ngbm")).split(","))); // 会签部门 + records.addAll(Arrays.asList(Util.null2String(requesData.get("hqbm")).split(","))); // 拟稿部门 + records.addAll(Arrays.asList(Util.null2String(requesData.get("ffbm")).split(","))); // 部门阅办 + records.addAll(Arrays.asList(Util.null2String(requesData.get("hqbmzj")).split(","))); // 抄送 + records.addAll(Arrays.asList(Util.null2String(requesData.get("bmffzj")).split(","))); // 本行发送 + + ArrayList deptName = new ArrayList<>(); + DepartmentComInfo departmentComInfo = new DepartmentComInfo(); + for (String record : records) { + try { + if (StringUtil.isEmpty(record)){ + continue; + } + String departmentName = departmentComInfo.getDepartmentName(record); + deptName.add(departmentName); + } catch (Exception e) { + e.printStackTrace(); + } + } + + return String.join("&&", deptName); + } + + private void updateRecord(int requestid, String s) { + String sql = "update uf_pushArchivesLog set esbtxtml = ? where request = ?"; + RecordSet recordSet = new RecordSet(); + recordSet.executeUpdate(sql, s, requestid); + } + private void updateRecord(int requestid, String field , String fieldvalue) { + String sql = "update uf_pushArchivesLog set "+field+" = ? where request = ?"; + RecordSet recordSet = new RecordSet(); + recordSet.executeUpdate(sql, fieldvalue, requestid); + } + +%> \ No newline at end of file diff --git a/weavernorth/com/testDateKey.jsp b/weavernorth/com/testDateKey.jsp deleted file mode 100644 index 8d994c2..0000000 --- a/weavernorth/com/testDateKey.jsp +++ /dev/null @@ -1,25 +0,0 @@ -<%@ page import="weaver.conn.RecordSet" %> -<%@ page import="weaver.general.BaseBean" %> - -<%@ page import="com.alibaba.fastjson.JSONObject" %> -<%@ page import="com.alibaba.fastjson.JSONArray" %> -<%@ page import="com.engine.common.util.ParamUtil" %> -<%@ page import="java.util.Map" %> -<%@ page import="com.weaverboot.weaComponent.impl.weaTable.table.impl.DefaultWeaTable" %> -<%@ page import="com.weaverboot.tools.componentTools.table.WeaTableTools" %> -<%@ page language="java" contentType="text/html; charset=UTF-8" %> - - -<%! - -%> -<% - - - Map param = ParamUtil.request2Map(request); - String dataKey = (String) param.get("dataKey"); - DefaultWeaTable defaultWeaTable = WeaTableTools.checkTableStringConfig(dataKey, DefaultWeaTable.class); - - -%> - diff --git a/weavernorth/custom/avatar/zipAvatar.jsp b/weavernorth/custom/avatar/zipAvatar.jsp new file mode 100644 index 0000000..1424ae0 --- /dev/null +++ b/weavernorth/custom/avatar/zipAvatar.jsp @@ -0,0 +1,69 @@ +<%@ page import="java.io.*, java.util.zip.*, java.util.Map, java.util.HashMap" %> +<%@ page import="weaver.conn.RecordSet" %> +<%@ page import="weaver.general.StringUtil" %> +<%@ page import="com.weaver.general.BaseBean" %> + +<% + //rootpath 根路径 + String rootpath = "/opt/weaver/ecology"; + // 文件路径和名称映射 + Map files = new HashMap<>(); + RecordSet recordSet = new RecordSet(); + recordSet.executeQuery("select * from hrmresource where messagerurl is not null"); + while (recordSet.next()){ + String messagerurl = rootpath + recordSet.getString("messagerurl"); + String Format = messagerurl.substring(messagerurl.lastIndexOf(".")+1); + String lastname = recordSet.getString("lastname"); + String loginid = recordSet.getString("loginid"); + if (!StringUtil.isEmpty(messagerurl)){ + files.put(lastname+"_"+loginid+"."+Format,messagerurl); + } + } + + + new BaseBean().writeLog(files+":"+files); + // files.put("example1.zip", "/opt/oadata/archivesFile/20240530/togd_20240530000000.zip"); + // files.put("example2.zip", "/opt/oadata/archivesFile/20240530/togd660720.zip"); + + // 设置响应类型为ZIP文件 + response.setContentType("application/zip"); + response.setHeader("Content-Disposition", "attachment;filename=files.zip"); + + // 创建ZIP输出流 + try (ZipOutputStream zipOut = new ZipOutputStream(response.getOutputStream())) { + for (Map.Entry fileEntry : files.entrySet()) { + String fileName = fileEntry.getKey(); + String filePath = fileEntry.getValue(); + + File fileToZip = new File(filePath); + if (fileToZip.exists() && fileToZip.isFile()) { + try (FileInputStream fis = new FileInputStream(fileToZip)) { + ZipEntry zipEntry = new ZipEntry(fileName); + zipOut.putNextEntry(zipEntry); + + byte[] bytes = new byte[1024]; + int length; + while ((length = fis.read(bytes)) >= 0) { + zipOut.write(bytes, 0, length); + } + zipOut.closeEntry(); + } + } else { + System.err.println("File not found or not a file: " + filePath); + } + } + } catch (IOException e) { + e.printStackTrace(); + } +%> + + + + + Download ZIP + + +

Download ZIP File

+

If the download does not start automatically, click here.

+ + diff --git a/weavernorth/custom/businessTravel/getdeleType.jsp b/weavernorth/custom/businessTravel/getdeleType.jsp new file mode 100644 index 0000000..92ed50e --- /dev/null +++ b/weavernorth/custom/businessTravel/getdeleType.jsp @@ -0,0 +1,90 @@ +<%@ page import="weaver.conn.RecordSet" %> +<%@ page import="com.wbi.util.ParamUtil" %> +<%@ page import="java.util.Map" %> +<%@ page import="weaver.general.Util" %> +<%@ page import="java.util.HashMap" %> +<%@ page import="com.alibaba.fastjson.JSONObject" %> + +<%@ page language="java" contentType="text/html; charset=UTF-8" %> + +<% + Map paramMap = ParamUtil.request2Map(request); + int id = Util.getIntValue(Util.null2String(paramMap.get("id"))); + HashMap results = new HashMap<>(); + int requestId = -1; + int type = -1; + RecordSet rs = new RecordSet(); + String sql = "select lcbt , sqdlx ,spwhscpdfwj from uf_CCSPDTZ where id = ?"; + rs.executeQuery(sql, id); + if (rs.next()) { + requestId = rs.getInt("lcbt"); + type = rs.getInt("sqdlx"); + } else { + results.put("code", "0"); + results.put("msg", "审批单无数据"); + out.print(JSONObject.toJSONString(results)); + } + //请休审批单PDF附件(qxspdpdffj)中。 + String qxspdpdffj = ""; + //天津银行国内出差审批单附件PDF(tjyxgnccspdfjpdf)中 + String tjyxgnccspdfjpdf = ""; + if (6 == type || 7 == type) { + // 总行差旅行程变更审批单 || 分行差旅行程变更审批单 + rs.executeQuery("select mainid from uf_CCBGJLB_dt1 where ccbgjllc = ?",requestId); + rs.next(); + String mainid = rs.getString("mainid"); + rs.executeQuery("select ccqqlc from uf_CCBGJLB where id = ?",mainid); + rs.next(); + String ccqqlc = rs.getString("ccqqlc"); + rs.executeQuery("select sqdlx , spwhscpdfwj from uf_CCSPDTZ where lcbt = ?",ccqqlc); + rs.next(); + int sqdlx = rs.getInt("sqdlx"); + + if(0 == sqdlx){ + //请休假审批单-总行部门正职 + qxspdpdffj = Util.null2String(rs.getString("spwhscpdfwj")); + }else if( 2 == sqdlx){ + //请休假审批单-分行行长 + tjyxgnccspdfjpdf = Util.null2String(rs.getString("spwhscpdfwj")); + rs.executeQuery("select qxspdpdffj from formtable_main_442 where requestid = ?",ccqqlc); + rs.next(); + qxspdpdffj = Util.null2String(rs.getString("qxspdpdffj")); + } + }else if( 8 == type ){ + tjyxgnccspdfjpdf = Util.null2String(rs.getString("spwhscpdfwj")); + rs.executeQuery("select qxspdpdffj from formtable_main_442 where requestid = ?",requestId); + rs.next(); + qxspdpdffj = Util.null2String(rs.getString("qxspdpdffj")); + } + + out.print(tjyxgnccspdfjpdf); + out.print("
"); + out.print(qxspdpdffj); + +%> + + +<%! + private boolean isEmpty(String str) { + if ("".equals(str) || "(null)".equals(str) || str == null) { + return true; + } else { + return false; + } + } + + private int getwfid(int requestId, RecordSet rs) { + if (requestId <= 0) { + return -1; + } + String sql = "select WORKFLOWID from WORKFLOW_REQUESTBASE where REQUESTID = ?"; + rs.executeQuery(sql, requestId); + if (rs.next()) { + return rs.getInt(0); + } else { + return -1; + } + } + + +%> diff --git a/weavernorth/custom/dept/CommUtil.class b/weavernorth/custom/dept/CommUtil.class new file mode 100644 index 0000000000000000000000000000000000000000..58cc4c4a268d34561836fde832a6ab25de6dcda1 GIT binary patch literal 3285 zcmbtX`*Rc575-L|t!uFuvOFB#f&~1KjVwdJU`!f2As8FeU<|PdIIGo_yjUwas}&|AurmQ=9m7^BtvI94s9mM@A*HH;g85<^4;AvGN3rlRGPVa&$;KE@7(iR z>Fe+R_a%V+_BV?*(2Gcv;{Tfma3oAn-?l*W&n-hQ=dy$@Y$Fh_`MZ=DfE7H6y-Lzfuq?0ul;_OhKQY0u=fe`#3g9UBB)g^mC~oBRd#b@ z(j!z`(7(6S6%wvf@VG0<{M zZ#q3-7ao_E?U?H7Jno^(S%R(hamT7z&owQNv9~Le(k=5~%rmW-ljdv~SKSw6{ANv; zv2R_OlS9EB$K;Ho;lzq`R(RD|ezrKrtIWuGdYzx0%R3|^Gfo_TX1vGBRo9ZoY*i<# z7qh-sB~Hga?ANd%tdF}>rD1nP7NzASD>JTRCG&3CNmlbyh53qiHF;%Px-x0!`XAM> zwpIkEvX`i#<8{2D<4wG!p~2VI@izM6_=}EfVAPjb&Q335St+YB*&ljR?aexY__XWf zB;)TnvgGAto(+);og&{09E&M=4O5|Z-j>DOzChoqR;GM9XL@F+Sh32pvcL7X>kL*a zUfDUON$js^cA8*YPgi z)A2s8YXDQE;{$xiV(r#(1Ak-UGLLB3)^Yo*w{CxV?b{o#fAiWuI==bzBhmqJ`#=9> zR(pDSGTr=Ux~a;pxx?rt5y>#E5p`5!AEI1F$0$xMJf#BN;YXjiXvBbC+2jZ(DW@-Bm`x;L)JVIcZfr`BYW9tnIcsU2}d(lLXb**FMQf zS(0#tYGk*;bhwMW3CKgCto!UeDMJZXsXY- zK0+$ZC+iLk9iKt_H#ZR+;M(Xjn{kkPJrF=I4w2Gu7=2uo@+{?|eD3)ik%`X`J=tl* zVqc(PBAOaoK;ya21;o#F8e#!Ww~)9=$-ugS824)-@Bmu)j@*iMK2kEU79!Cuj-a1d z0^4yEk5XI1FP1}JRR>+KkKRJ74-$P7(KoLc{jufHSJy#ru8+Q*=sSp>B>K)3qYo^H zzNQZP+WP3biN1&Etwe8IA$k)A@pzc`H<>3@Ozj=F@W612%gE<2CRjr2PO43co6*j$ z1*|_D+Z0>ChFa=3vt)oSs_$hbrkVI|I?;oNSdpsO_6LUX1QV}5?KsArM!Ai6631Br zTd^8L+(oI=h!fn!(1hWi@7%^8aqbXZI85jI2zrEY{RBGte>un3Kp43pzlMQkqord3 z55A8^W7BYl3QyGUyJo)w26&-C_T3XcYS4epVMtE;vYJj2&hF6cRjR3$+VxWj+59o3 zf+pPPM|z0s30`)XmmT3{M}5eSz}lTG?7EYMHFvVm7-pdfzr<64A6k*Nl^-{amQiC% za6`k`$~nNRHW}MS|B36y_JH4H>>&B7kz7j789NurT|Bi@#zVL8@CVf0O>#12>OH#Y&0^XU9|*cITV1?jOQ3O z;0(6lEFQ)=bl_=D%?XacNetjTtL_4CeUT?qc$VKh|0tA^MHLpFM-DGR@>fruzi$eB zjZfnv*!UMN;Zu~BMEE9=f;zuRJXPn69Z~xk$0$C*ICoK~lp9#}9k#@Awt4ZhiqhwJ I62a3y02T+VK>z>% literal 0 HcmV?d00001 diff --git a/weavernorth/custom/dept/deptTest.jsp b/weavernorth/custom/dept/deptTest.jsp new file mode 100644 index 0000000..960c3f8 --- /dev/null +++ b/weavernorth/custom/dept/deptTest.jsp @@ -0,0 +1,22 @@ +<%@ page import="java.io.*, java.util.zip.*, java.util.Map, java.util.HashMap" %> +<%@ page import="weaver.conn.RecordSet" %> +<%@ page import="weaver.general.StringUtil" %> +<%@ page import="com.weaver.general.BaseBean" %> +<%@ page import="weaver.hrm.company.DepartmentComInfo" %> +<%@page contentType="text/html; charset=UTF-8" %> + +<% + DepartmentComInfo departmentComInfo = new DepartmentComInfo(); + response.setContentType("text/html; charset=UTF-8"); + response.setCharacterEncoding("UTF-8"); + out.print(departmentComInfo.getDepartmentName("3588")); + out.print("
"); + out.print(departmentComInfo.getDepartmentmark("3588")); + out.print("
"); + out.print(departmentComInfo.getDepartmentmark("3454")); + out.print("
"); + out.print(departmentComInfo.getDepartmentmark("3454")); + + +%> +