From 86bbe39bae9799b394e3bda091233c5c9015e64c Mon Sep 17 00:00:00 2001 From: shilei <798989044@qq.com> Date: Mon, 1 Sep 2025 21:16:20 +0800 Subject: [PATCH] =?UTF-8?q?JSSBMJ=E4=BB=A3=E7=A0=81=E5=A4=87=E4=BB=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../interface/custom/convertVideoByDocid.jsp | 92 ++ JSSBMJ/interface/custom/getVideoByDocid.jsp | 78 ++ JSSBMJ/interface/custom/getVideoByDocid2.jsp | 46 + JSSBMJ/interface/custom/getWorkflowCreate.jsp | 40 + .../custom/getWorkflowCreatePermission.jsp | 67 + .../interface/custom/openApplicationDoc.jsp | 55 + .../interface/custom/queryApplicationDoc.jsp | 46 + .../custom/queryCertificateReport.jsp | 151 +++ JSSBMJ/interface/custom/queryCityData.jsp | 40 + JSSBMJ/interface/custom/queryCityDate.jsp | 40 + JSSBMJ/interface/custom/queryCompanyData.jsp | 90 ++ JSSBMJ/interface/custom/queryFeaturesData.jsp | 50 + JSSBMJ/interface/custom/queryFeaturesDate.jsp | 50 + .../custom/queryInformationSystemReport.jsp | 272 ++++ .../custom/queryInformationSystemReport2.jsp | 277 ++++ .../queryInformationSystemTypeReport.jsp | 253 ++++ JSSBMJ/interface/custom/queryLeftRightUrl.jsp | 35 + .../queryMilitaryInstallationReport.jsp | 166 +++ .../custom/queryMilitaryInstallationeport.jsp | 158 +++ .../custom/queryRequestUserComplete.jsp | 45 + .../interface/custom/queryReviewProgress.jsp | 188 +++ .../custom/querySecretCerrierReport.jsp | 253 ++++ .../custom/querySecretCerrierTypeReport.jsp | 247 ++++ .../interface/custom/queryShareHolderData.jsp | 59 + .../custom/queryShareHolderData2.jsp | 230 ++++ .../custom/queryShareHolderData2bak.jsp | 152 +++ .../custom/queryShareHolderSummary.jsp | 386 ++++++ .../custom/queryShareHolderSummary3.jsp | 409 ++++++ .../custom/queryUnitStatisticsReport.jsp | 152 +++ .../interface/custom/queryWeaponryReport.jsp | 157 +++ .../custom/queryWorkflowCountData.jsp | 68 + .../bmj/web/MaterialDownloadActionApi.java | 9 + .../secret/web/AuthorityChangeController.java | 12 + .../web/AutoGenerateNumberController.java | 12 + .../QualificationApplicationController.java | 8 + .../com/engine/bmj/cmd/MaterialCreateCmd.java | 227 ++++ .../bmj/service/MaterialCreateService.java | 11 + .../impl/MaterialCreateServiceImpl.java | 16 + .../com/engine/bmj/utils/DocCreateUtil.java | 269 ++++ .../engine/bmj/utils/WordTemplateUtil.java | 612 +++++++++ .../engine/bmj/web/MaterialCreateAction.java | 47 + .../entity/autonumber/AcceptanceNumber.java | 24 + .../entity/unpack/ApplicationResource.java | 24 + .../secret/entity/unpack/CheckFields.java | 15 + .../secret/entity/unpack/DataConfig.java | 29 + .../entity/unpack/DataConfigDetail.java | 31 + .../secret/entity/unpack/FileConfig.java | 23 + .../secret/entity/unpack/ResourceInfo.java | 26 + .../secret/entity/unpack/UnpackParam.java | 24 + .../secret/enums/ApplicationCategory.java | 32 + .../engine/secret/enums/CategoryValue.java | 15 + .../secret/enums/IntegrateCategory.java | 44 + .../engine/secret/enums/PrintCategory.java | 41 + .../exception/CustomizeRunTimeException.java | 22 + .../instance/AutoGenerateNumberInstance.java | 234 ++++ .../service/AuthorityChangeService.java | 19 + .../service/AutoGenerateNumberService.java | 18 + .../QualificationApplicationService.java | 27 + .../secret/service/UnpackZipService.java | 43 + .../impl/AuthorityChangeServiceImpl.java | 67 + .../impl/AutoGenerateNumberServiceImpl.java | 42 + .../impl/OfflineZipUnpackServiceImpl.java | 1135 +++++++++++++++++ .../QualificationApplicationServiceImpl.java | 242 ++++ .../com/engine/secret/util/ConfigUtil.java | 24 + .../com/engine/secret/util/ExceptionUtil.java | 20 + .../engine/secret/util/FieldConvertUtil.java | 166 +++ .../src/com/engine/secret/util/FlowUtil.java | 81 ++ .../src/com/engine/secret/util/ModeUtil.java | 477 +++++++ .../engine/secret/util/ResponseResult.java | 192 +++ .../secret/web/AuthorityChangeController.java | 39 + .../web/AutoGenerateNumberController.java | 38 + .../QualificationApplicationController.java | 49 + .../action/ApprovalReviewEndAction.java | 75 ++ .../action/MeetingConveningEndAction.java | 119 ++ .../ythpt/workflow/LegalReviewAction.java | 76 ++ .../ythpt/workflow/WorkflowMonitorAction.java | 241 ++++ 自用E10系统二开/E10-secondev-portal | 1 + 77 files changed, 9350 insertions(+) create mode 100644 JSSBMJ/interface/custom/convertVideoByDocid.jsp create mode 100644 JSSBMJ/interface/custom/getVideoByDocid.jsp create mode 100644 JSSBMJ/interface/custom/getVideoByDocid2.jsp create mode 100644 JSSBMJ/interface/custom/getWorkflowCreate.jsp create mode 100644 JSSBMJ/interface/custom/getWorkflowCreatePermission.jsp create mode 100644 JSSBMJ/interface/custom/openApplicationDoc.jsp create mode 100644 JSSBMJ/interface/custom/queryApplicationDoc.jsp create mode 100644 JSSBMJ/interface/custom/queryCertificateReport.jsp create mode 100644 JSSBMJ/interface/custom/queryCityData.jsp create mode 100644 JSSBMJ/interface/custom/queryCityDate.jsp create mode 100644 JSSBMJ/interface/custom/queryCompanyData.jsp create mode 100644 JSSBMJ/interface/custom/queryFeaturesData.jsp create mode 100644 JSSBMJ/interface/custom/queryFeaturesDate.jsp create mode 100644 JSSBMJ/interface/custom/queryInformationSystemReport.jsp create mode 100644 JSSBMJ/interface/custom/queryInformationSystemReport2.jsp create mode 100644 JSSBMJ/interface/custom/queryInformationSystemTypeReport.jsp create mode 100644 JSSBMJ/interface/custom/queryLeftRightUrl.jsp create mode 100644 JSSBMJ/interface/custom/queryMilitaryInstallationReport.jsp create mode 100644 JSSBMJ/interface/custom/queryMilitaryInstallationeport.jsp create mode 100644 JSSBMJ/interface/custom/queryRequestUserComplete.jsp create mode 100644 JSSBMJ/interface/custom/queryReviewProgress.jsp create mode 100644 JSSBMJ/interface/custom/querySecretCerrierReport.jsp create mode 100644 JSSBMJ/interface/custom/querySecretCerrierTypeReport.jsp create mode 100644 JSSBMJ/interface/custom/queryShareHolderData.jsp create mode 100644 JSSBMJ/interface/custom/queryShareHolderData2.jsp create mode 100644 JSSBMJ/interface/custom/queryShareHolderData2bak.jsp create mode 100644 JSSBMJ/interface/custom/queryShareHolderSummary.jsp create mode 100644 JSSBMJ/interface/custom/queryShareHolderSummary3.jsp create mode 100644 JSSBMJ/interface/custom/queryUnitStatisticsReport.jsp create mode 100644 JSSBMJ/interface/custom/queryWeaponryReport.jsp create mode 100644 JSSBMJ/interface/custom/queryWorkflowCountData.jsp create mode 100644 JSSBMJ/src/com/api/bmj/web/MaterialDownloadActionApi.java create mode 100644 JSSBMJ/src/com/api/secret/web/AuthorityChangeController.java create mode 100644 JSSBMJ/src/com/api/secret/web/AutoGenerateNumberController.java create mode 100644 JSSBMJ/src/com/api/secret/web/QualificationApplicationController.java create mode 100644 JSSBMJ/src/com/engine/bmj/cmd/MaterialCreateCmd.java create mode 100755 JSSBMJ/src/com/engine/bmj/service/MaterialCreateService.java create mode 100755 JSSBMJ/src/com/engine/bmj/service/impl/MaterialCreateServiceImpl.java create mode 100644 JSSBMJ/src/com/engine/bmj/utils/DocCreateUtil.java create mode 100644 JSSBMJ/src/com/engine/bmj/utils/WordTemplateUtil.java create mode 100644 JSSBMJ/src/com/engine/bmj/web/MaterialCreateAction.java create mode 100644 JSSBMJ/src/com/engine/secret/entity/autonumber/AcceptanceNumber.java create mode 100644 JSSBMJ/src/com/engine/secret/entity/unpack/ApplicationResource.java create mode 100644 JSSBMJ/src/com/engine/secret/entity/unpack/CheckFields.java create mode 100644 JSSBMJ/src/com/engine/secret/entity/unpack/DataConfig.java create mode 100644 JSSBMJ/src/com/engine/secret/entity/unpack/DataConfigDetail.java create mode 100644 JSSBMJ/src/com/engine/secret/entity/unpack/FileConfig.java create mode 100644 JSSBMJ/src/com/engine/secret/entity/unpack/ResourceInfo.java create mode 100644 JSSBMJ/src/com/engine/secret/entity/unpack/UnpackParam.java create mode 100644 JSSBMJ/src/com/engine/secret/enums/ApplicationCategory.java create mode 100644 JSSBMJ/src/com/engine/secret/enums/CategoryValue.java create mode 100644 JSSBMJ/src/com/engine/secret/enums/IntegrateCategory.java create mode 100644 JSSBMJ/src/com/engine/secret/enums/PrintCategory.java create mode 100644 JSSBMJ/src/com/engine/secret/exception/CustomizeRunTimeException.java create mode 100644 JSSBMJ/src/com/engine/secret/instance/AutoGenerateNumberInstance.java create mode 100644 JSSBMJ/src/com/engine/secret/service/AuthorityChangeService.java create mode 100644 JSSBMJ/src/com/engine/secret/service/AutoGenerateNumberService.java create mode 100644 JSSBMJ/src/com/engine/secret/service/QualificationApplicationService.java create mode 100644 JSSBMJ/src/com/engine/secret/service/UnpackZipService.java create mode 100644 JSSBMJ/src/com/engine/secret/service/impl/AuthorityChangeServiceImpl.java create mode 100644 JSSBMJ/src/com/engine/secret/service/impl/AutoGenerateNumberServiceImpl.java create mode 100644 JSSBMJ/src/com/engine/secret/service/impl/OfflineZipUnpackServiceImpl.java create mode 100644 JSSBMJ/src/com/engine/secret/service/impl/QualificationApplicationServiceImpl.java create mode 100644 JSSBMJ/src/com/engine/secret/util/ConfigUtil.java create mode 100644 JSSBMJ/src/com/engine/secret/util/ExceptionUtil.java create mode 100644 JSSBMJ/src/com/engine/secret/util/FieldConvertUtil.java create mode 100644 JSSBMJ/src/com/engine/secret/util/FlowUtil.java create mode 100644 JSSBMJ/src/com/engine/secret/util/ModeUtil.java create mode 100644 JSSBMJ/src/com/engine/secret/util/ResponseResult.java create mode 100644 JSSBMJ/src/com/engine/secret/web/AuthorityChangeController.java create mode 100644 JSSBMJ/src/com/engine/secret/web/AutoGenerateNumberController.java create mode 100644 JSSBMJ/src/com/engine/secret/web/QualificationApplicationController.java create mode 100644 JSSBMJ/src/weaver/interfaces/secret/action/ApprovalReviewEndAction.java create mode 100644 JSSBMJ/src/weaver/interfaces/secret/action/MeetingConveningEndAction.java create mode 100644 JSSBMJ/src/weaver/interfaces/ythpt/workflow/LegalReviewAction.java create mode 100644 JSSBMJ/src/weaver/interfaces/ythpt/workflow/WorkflowMonitorAction.java create mode 160000 自用E10系统二开/E10-secondev-portal diff --git a/JSSBMJ/interface/custom/convertVideoByDocid.jsp b/JSSBMJ/interface/custom/convertVideoByDocid.jsp new file mode 100644 index 0000000..42c2fc4 --- /dev/null +++ b/JSSBMJ/interface/custom/convertVideoByDocid.jsp @@ -0,0 +1,92 @@ +<%@ page import="weaver.general.Util" %> +<%@ page import="weaver.conn.RecordSet" %> +<%@ page import="org.apache.commons.lang3.StringUtils" %> +<%@ page import="weaver.hrm.HrmUserVarify" %> +<%@ page import="weaver.hrm.User" %> +<%@ page import="com.alibaba.fastjson.JSONObject" %> +<%@ page import="java.io.File" %> +<%@ page import="java.io.FileOutputStream" %> +<%@ page import="java.io.InputStream" %> +<%@ page import="weaver.file.ImageFileManager" %> +<%@ page contentType="text/html;charset=UTF-8" %> +<% + + String basePath = File.separator+"opt"+File.separator+"weaver"+File.separator+"ecology"+File.separator+"filesystem" ; + User user = HrmUserVarify.getUser(request, response); + if(user==null) { + response.sendRedirect("/login/Login.jsp"); + return; + } + + String docid = request.getParameter("docid"); + RecordSet rs = new RecordSet(); + + String doccreatedate = ""; + String imagefileid = ""; + String imagefilename = ""; + if(StringUtils.isNotBlank(docid)){ + + String sql = " select doccreatedate from docdetail where id = "+docid ; + rs.executeQuery(sql); + if(rs.next()){ + doccreatedate = Util.null2String(rs.getString("doccreatedate")); + } + + sql = " select imagefileid from docimagefile where docid = "+docid; + rs.executeQuery(sql); + if(rs.next()){ + imagefileid = Util.null2String(rs.getString("imagefileid")); + } + + + String iszip = ""; + String filerealpath = ""; + + if(StringUtils.isNotBlank(imagefileid)){ + sql = "select imagefilename,iszip,filerealpath from imagefile where imagefileid="+imagefileid ; + rs.executeQuery(sql); + if(rs.next()){ + imagefilename = Util.null2String(rs.getString("imagefilename")); + } + } + + String filepath = basePath+File.separator+"convertvideo"+File.separator+doccreatedate+File.separator+imagefileid; + File path = new File(filepath) ; + if(!path.exists()){ + path.mkdirs(); + } + + if(StringUtils.isNotBlank(imagefilename)){ + File videoPath = new File(filepath+File.separator+imagefilename) ; + + if(!videoPath.exists()){ + + InputStream inputStream = ImageFileManager.getInputStreamById(Integer.parseInt(imagefileid)); + FileOutputStream fileOutputStream = new FileOutputStream(videoPath); + int size = 0; + int byteLength = 8196; + byte[] buffer = new byte[byteLength]; + while ((size = inputStream.read(buffer,0,byteLength)) !=-1){ + fileOutputStream.write(buffer,0,size); + } + + fileOutputStream.close(); + inputStream.close(); + } + } + } + + String filepath = basePath+File.separator+"convertvideo"+File.separator+doccreatedate+File.separator+imagefileid; + File videoPath = new File(filepath+File.separator+imagefilename) ; + String code = ""; + if(videoPath.exists()){ + code = "200"; + }else{ + code = "500"; + } + JSONObject jsonObject = new JSONObject(); + jsonObject.put("code",code); + +%> + +<%=jsonObject.toJSONString() %> diff --git a/JSSBMJ/interface/custom/getVideoByDocid.jsp b/JSSBMJ/interface/custom/getVideoByDocid.jsp new file mode 100644 index 0000000..def8d50 --- /dev/null +++ b/JSSBMJ/interface/custom/getVideoByDocid.jsp @@ -0,0 +1,78 @@ +<%@ page import="weaver.general.Util" %> +<%@ page import="weaver.conn.RecordSet" %> +<%@ page import="org.apache.commons.lang3.StringUtils" %> +<%@ page import="com.api.doc.detail.util.DocDownloadCheckUtil" %> +<%@ page import="weaver.hrm.HrmUserVarify" %> +<%@ page import="weaver.hrm.User" %> +<%@ page import="com.alibaba.fastjson.JSONObject" %> +<%@ page import="java.io.File" %> +<%@ page import="java.nio.charset.StandardCharsets" %> +<%@ page contentType="text/html;charset=UTF-8" %> +<% + + String basePath = File.separator+"opt"+File.separator+"weaver"+File.separator+"ecology" ; + User user = HrmUserVarify.getUser(request, response); + if(user==null) { + response.sendRedirect("/login/Login.jsp"); + return; + } + + String docid = request.getParameter("docid"); + RecordSet rs = new RecordSet(); + + String videoUrl = ""; + if(StringUtils.isNotBlank(docid)){ + String doccreatedate = ""; + String sql = " select doccreatedate from docdetail where id = "+docid ; + rs.executeQuery(sql); + if(rs.next()){ + doccreatedate = Util.null2String(rs.getString("doccreatedate")); + } + String imagefileid = ""; + sql = " select imagefileid from docimagefile where docid = "+docid; + rs.executeQuery(sql); + if(rs.next()){ + imagefileid = Util.null2String(rs.getString("imagefileid")); + } + String imagefilename = ""; + if(StringUtils.isNotBlank(imagefileid)){ + sql = "select imagefilename from imagefile where imagefileid="+imagefileid ; + rs.executeQuery(sql); + if(rs.next()){ + imagefilename = Util.null2String(rs.getString("imagefilename")); + } + } + String filepath = File.separator+"filesystem"+File.separator+"convertvideo"+File.separator+doccreatedate+File.separator+imagefileid; + File path = new File(basePath+filepath) ; + if(!path.exists()){ + path.mkdirs(); + } + + if(StringUtils.isNotBlank(imagefilename)){ + String videoPathUrl = filepath + File.separator+imagefilename ; // new String(imagefilename.getBytes(StandardCharsets.ISO_8859_1)); + File videoPath = new File( basePath + videoPathUrl) ; + + if(videoPath.exists()){ + videoUrl = videoPathUrl; + }else{ + + + String imagestr = ""; + if(StringUtils.isNotBlank(imagefileid)){ + imagestr = DocDownloadCheckUtil.checkPermission(imagefileid, user); + videoUrl = "/weaver/weaver.file.FileDownload?fileid="+imagestr; + } + } + } + } + + +// String url = "/weaver/weaver.file.FileDownload?fileid="+imagstr; +// out.print(url); + + JSONObject jsonObject = new JSONObject(); + jsonObject.put("videoUrl",videoUrl); + +%> + +<%=jsonObject.toJSONString() %> diff --git a/JSSBMJ/interface/custom/getVideoByDocid2.jsp b/JSSBMJ/interface/custom/getVideoByDocid2.jsp new file mode 100644 index 0000000..120f715 --- /dev/null +++ b/JSSBMJ/interface/custom/getVideoByDocid2.jsp @@ -0,0 +1,46 @@ +<%@ page import="weaver.general.Util" %> +<%@ page import="weaver.conn.RecordSet" %> +<%@ page import="org.apache.commons.lang3.StringUtils" %> +<%@ page import="com.api.doc.detail.util.DocDownloadCheckUtil" %> +<%@ page import="weaver.hrm.HrmUserVarify" %> +<%@ page import="weaver.hrm.User" %> +<%@ page import="com.alibaba.fastjson.JSONObject" %> +<%@ page import="java.io.File" %> +<%@ page contentType="text/html;charset=UTF-8" %> +<% + + User user = HrmUserVarify.getUser(request, response); + if(user==null) { + response.sendRedirect("/login/Login.jsp"); + return; + } + + String docid = request.getParameter("docid"); + RecordSet rs = new RecordSet(); + + String videoUrl = ""; + if(StringUtils.isNotBlank(docid)){ + + String imagefileid = ""; + String sql = " select imagefileid from docimagefile where docid = "+docid; + rs.executeQuery(sql); + if(rs.next()) { + imagefileid = Util.null2String(rs.getString("imagefileid")); + } + String imagestr = ""; + if(StringUtils.isNotBlank(imagefileid)){ + imagestr = DocDownloadCheckUtil.checkPermission(imagefileid, user); + videoUrl = "/weaver/weaver.file.FileDownload?fileid="+imagestr; + } + } + + +// String url = "/weaver/weaver.file.FileDownload?fileid="+imagstr; +// out.print(url); + + JSONObject jsonObject = new JSONObject(); + jsonObject.put("videoUrl",videoUrl); + +%> + +<%=jsonObject.toJSONString() %> diff --git a/JSSBMJ/interface/custom/getWorkflowCreate.jsp b/JSSBMJ/interface/custom/getWorkflowCreate.jsp new file mode 100644 index 0000000..554c9f1 --- /dev/null +++ b/JSSBMJ/interface/custom/getWorkflowCreate.jsp @@ -0,0 +1,40 @@ +<%@ page import="weaver.general.Util" %> +<%@ page import="weaver.conn.RecordSet" %> +<%@ page import="org.apache.commons.lang3.StringUtils" %> +<%@ page import="weaver.hrm.HrmUserVarify" %> +<%@ page import="weaver.hrm.User" %> +<%@ page import="com.alibaba.fastjson.JSONObject" %> +<%@ page import="java.io.File" %> +<%@ page import="java.io.FileOutputStream" %> +<%@ page import="java.io.InputStream" %> +<%@ page import="weaver.file.ImageFileManager" %> +<%@ page import="com.engine.workflow.service.NewRequestService" %> +<%@ page import="com.engine.workflow.util.CommonUtil" %> +<%@ page import="com.engine.common.util.ServiceUtil" %> +<%@ page import="com.engine.workflow.service.impl.NewRequestServiceImpl" %> +<%@ page import="java.util.Map" %> +<%@ page import="java.util.HashMap" %> +<%@ page import="com.engine.common.util.ParamUtil" %> +<%@ page import="com.alibaba.fastjson.JSON" %> +<%@ page contentType="text/html;charset=UTF-8" %> +<% + + + Map apidatas = getService(request,response).getWfInfo(ParamUtil.request2Map(request)); + out.print("apidatas:"+ JSON.toJSON(apidatas)+"
"); + + JSONObject jsonObject = new JSONObject(); + + +%> + +<%=jsonObject.toJSONString() %> + + +<%! + private NewRequestService getService(HttpServletRequest request, HttpServletResponse response){ + User user = CommonUtil.getUserByRequest(request,response); + return (NewRequestService) ServiceUtil.getService(NewRequestServiceImpl.class,user); + } + +%> diff --git a/JSSBMJ/interface/custom/getWorkflowCreatePermission.jsp b/JSSBMJ/interface/custom/getWorkflowCreatePermission.jsp new file mode 100644 index 0000000..83fcd51 --- /dev/null +++ b/JSSBMJ/interface/custom/getWorkflowCreatePermission.jsp @@ -0,0 +1,67 @@ +<%@ page import="weaver.hrm.User" %> +<%@ page import="com.alibaba.fastjson.JSONObject" %> +<%@ page import="com.engine.workflow.service.NewRequestService" %> +<%@ page import="com.engine.workflow.util.CommonUtil" %> +<%@ page import="com.engine.common.util.ServiceUtil" %> +<%@ page import="com.engine.workflow.service.impl.NewRequestServiceImpl" %> +<%@ page import="java.util.Map" %> +<%@ page import="com.engine.common.util.ParamUtil" %> +<%@ page import="com.alibaba.fastjson.JSONArray" %> +<%@ page import="org.apache.commons.lang3.StringUtils" %> +<%@ page import="java.util.ArrayList" %> +<%@ page import="java.util.List" %> +<%@ page import="java.util.Arrays" %> +<%@ page contentType="text/html;charset=UTF-8" %> +<% + + String workflowid = request.getParameter("workflowid"); + List workflowList = new ArrayList(); + if(StringUtils.isNotBlank(workflowid)){ + workflowList = Arrays.asList(workflowid.split(",")); + } + + + JSONArray jsonArray = new JSONArray(); + if(workflowList.size()>0){ + + Map apidatas = getService(request,response).getWfInfo(ParamUtil.request2Map(request)); + JSONObject datasObject = JSONObject.parseObject(JSONObject.toJSONString(apidatas)); + + if(datasObject.containsKey("datas")){ + JSONArray datasArray = datasObject.getJSONArray("datas"); + + for(int i=0;i + +<%=jsonObject.toJSONString() %> + +<%! + private NewRequestService getService(HttpServletRequest request, HttpServletResponse response){ + User user = CommonUtil.getUserByRequest(request,response); + return (NewRequestService) ServiceUtil.getService(NewRequestServiceImpl.class,user); + } + +%> diff --git a/JSSBMJ/interface/custom/openApplicationDoc.jsp b/JSSBMJ/interface/custom/openApplicationDoc.jsp new file mode 100644 index 0000000..188e2c2 --- /dev/null +++ b/JSSBMJ/interface/custom/openApplicationDoc.jsp @@ -0,0 +1,55 @@ +<%@ page import="weaver.conn.RecordSet" %> +<%@ page import="org.apache.commons.lang3.StringUtils" %> +<%@ page import="weaver.general.Util" %> +<%@ page language="java" contentType="text/html; charset=UTF-8" %> +<% + + String billid = request.getParameter("billid"); + RecordSet rs = new RecordSet(); + String bmzzsqs = ""; + if(StringUtils.isNotBlank(billid)){ + + String zlcid = ""; + String sql =" select zlcid from formtable_main_236 where id = "+billid ; + rs.executeQuery(sql); + if (rs.next()){ + zlcid = rs.getString("zlcid"); + } + + + if(StringUtils.isNotBlank(zlcid)){ + String mainTable = ""; + sql = " select abs(k.formid) as formid from workflow_requestbase t inner join workflow_base k on k.id = t.workflowid " + + " where t.requestid = "+zlcid; + rs.executeQuery(sql); + if(rs.next()){ + mainTable = "formtable_main_"+ Util.null2String(rs.getString("formid")); + } + + if (StringUtils.isNotBlank(mainTable)) { + sql = "select bmzzsqs from "+mainTable+" where requestid = "+zlcid; + rs.executeQuery(sql); + if(rs.next()){ + bmzzsqs = Util.null2String(rs.getString("bmzzsqs")); + } + } + } + } + + String docUrl = "/spa/document/index2file.jsp?id="+bmzzsqs+"#/main/document/fileView"; + +%> + + + + + + + diff --git a/JSSBMJ/interface/custom/queryApplicationDoc.jsp b/JSSBMJ/interface/custom/queryApplicationDoc.jsp new file mode 100644 index 0000000..490067a --- /dev/null +++ b/JSSBMJ/interface/custom/queryApplicationDoc.jsp @@ -0,0 +1,46 @@ +<%@ page import="weaver.conn.RecordSet" %> +<%@ page import="com.alibaba.fastjson.JSONObject" %> +<%@ page import="org.apache.commons.lang3.StringUtils" %> +<%@ page import="weaver.general.Util" %> +<%@ page language="java" contentType="text/html; charset=UTF-8" %> +<% + + String billid = request.getParameter("billid"); + RecordSet rs = new RecordSet(); + String bmzzsqs = ""; + if(StringUtils.isNotBlank(billid)){ + + String zlcid = ""; + String sql =" select zlcid from formtable_main_236 where id = "+billid ; + rs.executeQuery(sql); + if (rs.next()){ + zlcid = rs.getString("zlcid"); + } + + if(StringUtils.isNotBlank(zlcid)){ + String mainTable = ""; + sql = " select abs(k.formid) as formid from workflow_requestbase t inner join workflow_base k on k.id = t.workflowid " + + " where t.requestid = "+zlcid; + rs.executeQuery(sql); + if(rs.next()){ + mainTable = "formtable_main_"+ Util.null2String(rs.getString("formid")); + } + + if (StringUtils.isNotBlank(mainTable)) { + sql = "select bmzzsqs from "+mainTable+" where requestid = "+zlcid; + rs.executeQuery(sql); + if(rs.next()){ + bmzzsqs = Util.null2String(rs.getString("bmzzsqs")); + } + } + } + } + + JSONObject dataJson = new JSONObject(); + dataJson.put("bmzzsqs",bmzzsqs); + +%> + +<%=dataJson.toJSONString() %> + + diff --git a/JSSBMJ/interface/custom/queryCertificateReport.jsp b/JSSBMJ/interface/custom/queryCertificateReport.jsp new file mode 100644 index 0000000..a477f45 --- /dev/null +++ b/JSSBMJ/interface/custom/queryCertificateReport.jsp @@ -0,0 +1,151 @@ +<%@ page import="java.util.Map" %> +<%@ page import="weaver.conn.RecordSet" %> +<%@ page import="java.util.HashMap" %> +<%@ page import="java.util.List" %> +<%@ page import="java.util.ArrayList" %> +<%@ page import="com.alibaba.fastjson.JSONObject" %> +<%@ page import="weaver.general.Util" %> +<%@ page import="org.apache.commons.lang3.StringUtils" %> +<%@ page import="weaver.hrm.HrmUserVarify" %> +<%@ page import="weaver.hrm.User" %> +<%@ page language="java" contentType="text/html; charset=UTF-8" %> +<% + + User user = HrmUserVarify.getUser(request, response); + if(user==null) { + response.sendRedirect("/login/Login.jsp"); + return; + } + + String startDate = request.getParameter("startDate"); + String endDate = request.getParameter("endDate"); + + RecordSet rs = new RecordSet(); + List> cityList = new ArrayList>(); + String sql =" select selectvalue,selectname \n" + + " from workflow_selectitem \n" + + " where fieldid in(\n" + + " select id from workflow_billfield \n" + + " where billid in( select id from workflow_bill where tablename='uf_dwjbxx' ) and fieldname='szcs' \n" + + " and detailtable is null\n" + + " ) "; + rs.executeQuery(sql); + while (rs.next()){ + String selectvalue = rs.getString("selectvalue"); + String selectname = rs.getString("selectname"); + Map cityMap = new HashMap(); + cityMap.put("key","City"+selectvalue); + cityMap.put("title",selectname); + cityList.add(cityMap); + } + + + int yjjg_total = 0; + int ejjg_total = 0; + int jcjj_total = 0; + int jcyj_total = 0; + int yzjj_total = 0; + int yzyj_total = 0 ; + int jsssyj_total = 0; + int jsssej_total = 0; + + for(int i=0;i cityMap = cityList.get(i); + int yjjg = 0; + int ejjg = 0; + int jcjj = 0; + int jcyj = 0; + int yzjj = 0; + int yzyj = 0 ; + int jsssyj = 0; + int jsssej = 0; + + String cityKey = Util.null2String(cityMap.get("key")).replace("City",""); + + String where = ""; + if(StringUtils.isNotBlank(startDate)){ + where += " and k.fzrq >= '"+startDate+"' "; + } + + if(StringUtils.isNotBlank(endDate)){ + where += " and k.fzrq <= '"+endDate+"' "; + } + + sql = " select k.id,k.zzdj,k.zzlx\n" + + " from uf_dwjbxx t\n" + + " inner join uf_bmzzzsxx k on k.dwmc = t.id\n" + + " where k.zszt=0\n" + + " and t.szcs=" + cityKey + where ; + + rs.executeQuery(sql); + while (rs.next()){ + String zzdj = Util.null2String(rs.getString("zzdj")); + String zzlx = Util.null2String(rs.getString("zzlx")); + if("0".equals(zzlx)){ // 涉密信息系统集成 + if("1".equals(zzdj)){ + jcjj++; + }else if("2".equals(zzdj)){ + jcyj++; + } + }else if("1".equals(zzlx)){ //国家秘密载体印制 + if("1".equals(zzdj)){ + yzjj++; + }else if("2".equals(zzdj)){ + yzyj++; + } + }else if("2".equals(zzlx)){ //武器装备科研生产单位 + if("3".equals(zzdj)){ + yjjg++; + }else if("4".equals(zzdj)){ + ejjg++; + } + }else if("3".equals(zzlx)){ //涉密军事设施建设 + if("3".equals(zzdj)){ + jsssyj++; + }else if("4".equals(zzdj)){ + jsssej++; + } + } + } + + + + cityMap.put("yjjg",yjjg); + cityMap.put("ejjg",ejjg); + cityMap.put("jcjj",jcjj); + cityMap.put("jcyj",jcyj); + cityMap.put("yzjj",yzjj); + cityMap.put("yzyj",yzyj); + cityMap.put("jsssyj",jsssyj); + cityMap.put("jsssej",jsssej); + + yjjg_total += yjjg ; + ejjg_total += ejjg ; + jcjj_total += jcjj ; + jcyj_total += jcyj ; + yzjj_total += yzjj ; + yzyj_total += yzyj ; + jsssyj_total += jsssyj ; + jsssej_total += jsssej ; + } + + Map totalMap = new HashMap(); + totalMap.put("key","total"); + totalMap.put("title","合计"); + totalMap.put("yjjg",yjjg_total); + totalMap.put("ejjg",ejjg_total); + totalMap.put("jcjj",jcjj_total); + totalMap.put("jcyj",jcyj_total); + totalMap.put("yzjj",yzjj_total); + totalMap.put("yzyj",yzyj_total); + totalMap.put("jsssyj",jsssyj_total); + totalMap.put("jsssej",jsssej_total); + cityList.add(totalMap); + + JSONObject dataJson = new JSONObject(); + dataJson.put("data",cityList); + +%> + +<%=dataJson.toJSONString() %> + diff --git a/JSSBMJ/interface/custom/queryCityData.jsp b/JSSBMJ/interface/custom/queryCityData.jsp new file mode 100644 index 0000000..d8cbde0 --- /dev/null +++ b/JSSBMJ/interface/custom/queryCityData.jsp @@ -0,0 +1,40 @@ +<%@ page import="java.util.Map" %> +<%@ page import="weaver.conn.RecordSet" %> +<%@ page import="java.util.HashMap" %> +<%@ page import="java.util.List" %> +<%@ page import="java.util.ArrayList" %> +<%@ page import="com.alibaba.fastjson.JSONObject" %> +<%@ page language="java" contentType="text/html; charset=UTF-8" %> +<% + + List> list = new ArrayList>(); + RecordSet rs = new RecordSet(); + String sql =" select t.sm,t.yb,t.jd,t.wd,count(k.id) as cou\n" + + " from uf_sjsj t\n" + + " left join uf_zzdwdzxx k on k.szs = t.id\n" + + " group by t.sm,t.yb,t.jd,t.wd "; + + rs.executeQuery(sql); + while (rs.next()){ + String adcode = rs.getString("yb"); + String name = rs.getString("sm"); + String jd = rs.getString("jd"); + String wd = rs.getString("wd"); + String center = "["+jd+","+wd+"]"; + String cou = rs.getString("cou"); + + Map map = new HashMap(); + map.put("adcode",adcode); + map.put("name",name); + map.put("center",center); + map.put("num",cou); + list.add(map); + } + + JSONObject dataJson = new JSONObject(); + dataJson.put("data",list); + +%> + +<%=dataJson.toJSONString() %> + diff --git a/JSSBMJ/interface/custom/queryCityDate.jsp b/JSSBMJ/interface/custom/queryCityDate.jsp new file mode 100644 index 0000000..d8cbde0 --- /dev/null +++ b/JSSBMJ/interface/custom/queryCityDate.jsp @@ -0,0 +1,40 @@ +<%@ page import="java.util.Map" %> +<%@ page import="weaver.conn.RecordSet" %> +<%@ page import="java.util.HashMap" %> +<%@ page import="java.util.List" %> +<%@ page import="java.util.ArrayList" %> +<%@ page import="com.alibaba.fastjson.JSONObject" %> +<%@ page language="java" contentType="text/html; charset=UTF-8" %> +<% + + List> list = new ArrayList>(); + RecordSet rs = new RecordSet(); + String sql =" select t.sm,t.yb,t.jd,t.wd,count(k.id) as cou\n" + + " from uf_sjsj t\n" + + " left join uf_zzdwdzxx k on k.szs = t.id\n" + + " group by t.sm,t.yb,t.jd,t.wd "; + + rs.executeQuery(sql); + while (rs.next()){ + String adcode = rs.getString("yb"); + String name = rs.getString("sm"); + String jd = rs.getString("jd"); + String wd = rs.getString("wd"); + String center = "["+jd+","+wd+"]"; + String cou = rs.getString("cou"); + + Map map = new HashMap(); + map.put("adcode",adcode); + map.put("name",name); + map.put("center",center); + map.put("num",cou); + list.add(map); + } + + JSONObject dataJson = new JSONObject(); + dataJson.put("data",list); + +%> + +<%=dataJson.toJSONString() %> + diff --git a/JSSBMJ/interface/custom/queryCompanyData.jsp b/JSSBMJ/interface/custom/queryCompanyData.jsp new file mode 100644 index 0000000..a6fba06 --- /dev/null +++ b/JSSBMJ/interface/custom/queryCompanyData.jsp @@ -0,0 +1,90 @@ +<%@ page import="java.util.Map" %> +<%@ page import="weaver.conn.RecordSet" %> +<%@ page import="java.util.HashMap" %> +<%@ page import="java.util.List" %> +<%@ page import="java.util.ArrayList" %> +<%@ page import="com.alibaba.fastjson.JSONObject" %> +<%@ page import="org.apache.commons.lang3.StringUtils" %> +<%@ page import="weaver.general.Util" %> +<%@ page language="java" contentType="text/html; charset=UTF-8" %> +<% + + String parentCode = request.getParameter("adcode"); + List> dataList= new ArrayList>(); + RecordSet rs = new RecordSet(); + if(StringUtils.isNotBlank(parentCode)){ + + + + String sql =" select t.jd,t.wd,count(1) as cou\n" + + " from uf_zzdwdzxx t\n" + + " inner join uf_qjsj k on k.id = t.szq\n" + + " where k.yb='"+parentCode+"'\n" + + " group by t.jd,t.wd "; + + rs.executeQuery(sql); + while (rs.next()){ + + String jd = rs.getString("jd"); + String wd = rs.getString("wd"); + String cou = rs.getString("cou"); + Map dataMap = new HashMap(); + dataMap.put("jd",jd); + dataMap.put("wd",wd); + dataMap.put("num",cou); + dataList.add(dataMap); + } + + for(int i=0;i dataMap = dataList.get(i); + + String jd = Util.null2String(dataMap.get("jd")); + String wd = Util.null2String(dataMap.get("wd")); + + Double[] center = new Double[2]; + + if(StringUtils.isNotBlank(jd) && StringUtils.isNotBlank(wd)){ + center[0] = Double.parseDouble(jd); + center[1] = Double.parseDouble(wd); + } + + String adcodes = ""; + String names = ""; + String zcdzs = ""; + String jydzs = ""; + + sql = " select id,dwmc,zcdz,jydz\n" + + "from uf_zzdwdzxx\n" + + " where jd='"+jd+"'\n" + + " and wd='"+wd+"'"; + + rs.executeQuery(sql); + while (rs.next()){ + String adcode = rs.getString("id"); + String name = rs.getString("dwmc"); + String zcdz = rs.getString("zcdz"); + String jydz = rs.getString("jydz"); + + adcodes += StringUtils.isBlank(adcodes) ? adcode :" ,"+adcode; + names += StringUtils.isBlank(names) ? name :" \n"+name; + + zcdzs += StringUtils.isBlank(zcdzs) ? names+":"+zcdz :" \n"+names+":"+zcdz; + jydzs += StringUtils.isBlank(jydzs) ? names+":"+jydz :" \n"+names+":"+jydz; + + } + + dataMap.put("adcode",adcodes); + dataMap.put("name",zcdzs); + dataMap.put("center",center); + dataMap.put("zcdz",zcdzs); + dataMap.put("jydz",jydzs); + } + } + + JSONObject dataJson = new JSONObject(); + dataJson.put("data",dataList); + +%> + +<%=dataJson.toJSONString() %> + diff --git a/JSSBMJ/interface/custom/queryFeaturesData.jsp b/JSSBMJ/interface/custom/queryFeaturesData.jsp new file mode 100644 index 0000000..0c6a28a --- /dev/null +++ b/JSSBMJ/interface/custom/queryFeaturesData.jsp @@ -0,0 +1,50 @@ +<%@ page import="java.util.Map" %> +<%@ page import="weaver.conn.RecordSet" %> +<%@ page import="java.util.HashMap" %> +<%@ page import="java.util.List" %> +<%@ page import="java.util.ArrayList" %> +<%@ page import="com.alibaba.fastjson.JSONObject" %> +<%@ page import="org.apache.commons.lang3.StringUtils" %> +<%@ page language="java" contentType="text/html; charset=UTF-8" %> +<% + + String parentCode = request.getParameter("adcode"); + List> list = new ArrayList>(); + RecordSet rs = new RecordSet(); + if(StringUtils.isNotBlank(parentCode)){ + + + String sql =" select t.qm,t.yb,t.jd,t.wd,count(k.id) as cou\n" + + " from uf_qjsj t\n" + + " left join uf_zzdwdzxx k on k.szq = t.id\n" + + " inner join uf_sjsj p on p.id = t.sss\n" + + " where p.yb = '"+parentCode+"'\n" + + " group by t.qm,t.yb,t.jd,t.wd "; + + rs.executeQuery(sql); + while (rs.next()){ + String adcode = rs.getString("yb"); + String name = rs.getString("qm"); + String jd = rs.getString("jd"); + String wd = rs.getString("wd"); + String center = "["+jd+","+wd+"]"; + String cou = rs.getString("cou"); + + Map map = new HashMap(); + map.put("adcode",adcode); + map.put("name",name); + map.put("center",center); + map.put("num",cou); + list.add(map); + } + + } + + + JSONObject dataJson = new JSONObject(); + dataJson.put("data",list); + +%> + +<%=dataJson.toJSONString() %> + diff --git a/JSSBMJ/interface/custom/queryFeaturesDate.jsp b/JSSBMJ/interface/custom/queryFeaturesDate.jsp new file mode 100644 index 0000000..0c6a28a --- /dev/null +++ b/JSSBMJ/interface/custom/queryFeaturesDate.jsp @@ -0,0 +1,50 @@ +<%@ page import="java.util.Map" %> +<%@ page import="weaver.conn.RecordSet" %> +<%@ page import="java.util.HashMap" %> +<%@ page import="java.util.List" %> +<%@ page import="java.util.ArrayList" %> +<%@ page import="com.alibaba.fastjson.JSONObject" %> +<%@ page import="org.apache.commons.lang3.StringUtils" %> +<%@ page language="java" contentType="text/html; charset=UTF-8" %> +<% + + String parentCode = request.getParameter("adcode"); + List> list = new ArrayList>(); + RecordSet rs = new RecordSet(); + if(StringUtils.isNotBlank(parentCode)){ + + + String sql =" select t.qm,t.yb,t.jd,t.wd,count(k.id) as cou\n" + + " from uf_qjsj t\n" + + " left join uf_zzdwdzxx k on k.szq = t.id\n" + + " inner join uf_sjsj p on p.id = t.sss\n" + + " where p.yb = '"+parentCode+"'\n" + + " group by t.qm,t.yb,t.jd,t.wd "; + + rs.executeQuery(sql); + while (rs.next()){ + String adcode = rs.getString("yb"); + String name = rs.getString("qm"); + String jd = rs.getString("jd"); + String wd = rs.getString("wd"); + String center = "["+jd+","+wd+"]"; + String cou = rs.getString("cou"); + + Map map = new HashMap(); + map.put("adcode",adcode); + map.put("name",name); + map.put("center",center); + map.put("num",cou); + list.add(map); + } + + } + + + JSONObject dataJson = new JSONObject(); + dataJson.put("data",list); + +%> + +<%=dataJson.toJSONString() %> + diff --git a/JSSBMJ/interface/custom/queryInformationSystemReport.jsp b/JSSBMJ/interface/custom/queryInformationSystemReport.jsp new file mode 100644 index 0000000..b72042b --- /dev/null +++ b/JSSBMJ/interface/custom/queryInformationSystemReport.jsp @@ -0,0 +1,272 @@ +<%@ page import="weaver.conn.RecordSet" %> +<%@ page import="com.alibaba.fastjson.JSONObject" %> +<%@ page import="weaver.general.Util" %> +<%@ page import="org.apache.commons.lang3.StringUtils" %> +<%@ page import="weaver.hrm.HrmUserVarify" %> +<%@ page import="weaver.hrm.User" %> +<%@ page import="java.util.*" %> +<%@ page language="java" contentType="text/html; charset=UTF-8" %> +<% + + Map signMap = new HashMap(); + signMap.put("总体集成","ztjc"); + signMap.put("系统咨询","xtzx"); + signMap.put("软件开发","rjkf"); + signMap.put("安防监控","afjk"); + signMap.put("运行维护","yxwh"); + signMap.put("数据恢复","sjhf"); + signMap.put("工程监理","gcjl"); + + + Map countMap = new HashMap(); + countMap.put("ztjc",0); + countMap.put("xtzx",0); + countMap.put("rjkf",0); + countMap.put("afjk",0); + countMap.put("yxwh",0); + countMap.put("sjhf",0); + countMap.put("gcjl",0); + + + User user = HrmUserVarify.getUser(request, response); + if(user==null) { + response.sendRedirect("/login/Login.jsp"); + return; + } + + + String startDate = request.getParameter("startDate"); + String endDate = request.getParameter("endDate"); + + String zzlx = "0"; + RecordSet rs = new RecordSet(); + List> cityList = new ArrayList>(); + String sql =" select selectvalue,selectname \n" + + " from workflow_selectitem \n" + + " where fieldid in(\n" + + " select id from workflow_billfield \n" + + " where billid in( select id from workflow_bill where tablename='uf_dwjbxx' ) and fieldname='szcs' \n" + + " and detailtable is null\n" + + " ) "; + rs.executeQuery(sql); + while (rs.next()){ + String selectvalue = rs.getString("selectvalue"); + String selectname = rs.getString("selectname"); + Map cityMap = new HashMap(); + cityMap.put("key","City"+selectvalue); + cityMap.put("title",selectname); + cityList.add(cityMap); + } + + String selectnames = ""; + Iterator> iterator = signMap.entrySet().iterator(); + while (iterator.hasNext()){ + Map.Entry entry = iterator.next(); + String key = entry.getKey(); + selectnames += StringUtils.isBlank(selectnames) ? "'" + key + "'" : ",'" + key + "'"; + } + + + List> typeList = new ArrayList>(); + sql = " select selectvalue,selectname \n" + + " from workflow_selectitem\n" + + " where fieldid in(\n" + + " select id from workflow_billfield \n" + + " where billid in( select id from workflow_bill where tablename='uf_bmzzzsxx' ) and fieldname='ywzl' \n" + + " and detailtable is null\n" + + " ) \n" + + " AND selectname in("+selectnames+")" ; + + rs.executeQuery(sql); + while (rs.next()){ + String selectvalue = Util.null2String(rs.getString("selectvalue")); + String selectname = Util.null2String(rs.getString("selectname")); + + Map typeMap = new HashMap(); + typeMap.put("selectname",selectname); + typeMap.put("selectvalue",selectvalue); + String selectType = signMap.get(selectname); + typeMap.put("selecttype",selectType); + typeList.add(typeMap); + } + + int yjjg_total = 0; + int ejjg_total = 0 ; +// int ztjc_tootal = 0; +// int xtzx_tootal = 0; +// int rjkf_tootal = 0; +// int afjk_tootal = 0; +// int yxwh_tootal = 0; +// int sjhf_tootal = 0; +// int gcjl_tootal = 0; + + + for(int i=0;i cityMap = cityList.get(i); + String yjjg = "0"; + String ejjg = "0"; + String cityKey = Util.null2String(cityMap.get("key")).replace("City",""); + + String where = ""; + if(StringUtils.isNotBlank(startDate)){ + where += " and k.fzrq >= '"+startDate+"' "; + } + + if(StringUtils.isNotBlank(endDate)){ + where += " and k.fzrq <= '"+endDate+"' "; + } + + sql = " select zzdj,count(1) as cou\n" + + " from uf_dwjbxx t\n" + + " inner join uf_bmzzzsxx k on k.dwmc = t.id\n" + + " where k.zszt=0\n" + + " and k.zzlx = " + zzlx + + " and t.szcs=" + cityKey + where + + " group by zzdj "; + + rs.executeQuery(sql); + while (rs.next()){ + String zzdj = Util.null2String(rs.getString("zzdj")); + String cou = Util.null2String(rs.getString("cou")); + if("1".equals(zzdj)){ + yjjg = cou; + }else if("2".equals(zzdj)){ + ejjg = cou; + } + } + + if(StringUtils.isNotBlank(yjjg)){ + yjjg_total += Util.getIntValue(yjjg,0); + } + + if(StringUtils.isNotBlank(ejjg)){ + ejjg_total += Util.getIntValue(ejjg,0); + } + + cityMap.put("yjjg",yjjg); + cityMap.put("ejjg",ejjg); + + for(int k=0;k typeMap = typeList.get(k); + String selectvalue = typeMap.get("selectvalue"); + String selecttype = typeMap.get("selecttype"); + int count = 0; + if(StringUtils.isNotBlank(selectvalue)){ + sql = " select k.id \n" + + " from uf_dwjbxx t\n" + + " inner join uf_bmzzzsxx k on k.dwmc = t.id\n" + + " where k.zszt=0 \n" + + " and instr(','||ywzl||',',',"+selectvalue+",')>0 \n" + + " and k.zzlx = " + zzlx + + " and t.szcs="+cityKey + where ; + rs.executeQuery(sql); + while (rs.next()){ + count++; + } + int total = countMap.get(selecttype); + total += count; + countMap.put(selecttype,total); + } + + cityMap.put(selecttype,count); + } + } + + for(int i=0;i cityMap = cityList.get(i); + String cityKey = Util.null2String(cityMap.get("key")).replace("City",""); + + List> districtList = new ArrayList>(); + + if(StringUtils.isNotBlank(cityKey)){ + int cityKey_ = Util.getIntValue(cityKey)+1; + sql = "select id,qm,yb from uf_qjsj where sss="+cityKey_; + rs.executeQuery(sql); + while (rs.next()){ + String id = Util.null2String(rs.getString("id")); + String qm = Util.null2String(rs.getString("qm")); + + Map districtMap = new HashMap(); + districtMap.put("key","District"+id); + districtMap.put("title",qm); + districtList.add(districtMap); + } + } + + for(int k=0;k districtMap = districtList.get(k); + String districtKey = Util.null2String(districtMap.get("key")).replace("District",""); + + + String where = ""; + if(StringUtils.isNotBlank(startDate)){ + where += " and k.fzrq >= '"+startDate+"' "; + } + + if(StringUtils.isNotBlank(endDate)){ + where += " and k.fzrq <= '"+endDate+"' "; + } + + sql = "select zzdj,count(1) as cou\n" + + "from uf_dwjbxx t\n" + + "inner join uf_bmzzzsxx k on k.dwmc = t.id\n" + + "where k.zszt=0\n" + + "and k.zzlx = " + zzlx + + "and t.szqx= " + districtKey + where + + "group by zzdj "; + + rs.executeQuery(sql); + while (rs.next()){ + String zzdj = Util.null2String(rs.getString("zzdj")); + String cou = Util.null2String(rs.getString("cou")); + if("1".equals(zzdj)){ + districtMap.put("yjjg",cou); + }else if("2".equals(zzdj)){ + districtMap.put("ejjg",cou); + } + } + + + for(int n=0;n typeMap = typeList.get(n); + String selectvalue = typeMap.get("selectvalue"); + String selecttype = typeMap.get("selecttype"); + + int count = 0; + + if(StringUtils.isNotBlank(selectvalue)){ + sql = " select k.id \n" + + " from uf_dwjbxx t\n" + + " inner join uf_bmzzzsxx k on k.dwmc = t.id\n" + + " where k.zszt=0 \n" + + " and instr(','||ywzl||',',',"+selectvalue+",')>0 \n" + + " and k.zzlx = " + zzlx + + " and t.szqx= " + districtKey + where ; + + rs.executeQuery(sql); + while (rs.next()){ + count++; + } + } + districtMap.put(selecttype,count); + } + } + cityMap.put("subList",districtList); + } + + Map totalMap = new HashMap(); + totalMap.put("key","total"); + totalMap.put("title","合计"); + totalMap.put("yjjg",yjjg_total); + totalMap.put("ejjg",ejjg_total); + totalMap.putAll(countMap); + + cityList.add(totalMap); + + JSONObject dataJson = new JSONObject(); + dataJson.put("data",cityList); + +%> + +<%=dataJson.toJSONString() %> + diff --git a/JSSBMJ/interface/custom/queryInformationSystemReport2.jsp b/JSSBMJ/interface/custom/queryInformationSystemReport2.jsp new file mode 100644 index 0000000..66f17bc --- /dev/null +++ b/JSSBMJ/interface/custom/queryInformationSystemReport2.jsp @@ -0,0 +1,277 @@ +<%@ page import="weaver.conn.RecordSet" %> +<%@ page import="com.alibaba.fastjson.JSONObject" %> +<%@ page import="weaver.general.Util" %> +<%@ page import="org.apache.commons.lang3.StringUtils" %> +<%@ page import="weaver.hrm.HrmUserVarify" %> +<%@ page import="weaver.hrm.User" %> +<%@ page import="java.util.*" %> +<%@ page language="java" contentType="text/html; charset=UTF-8" %> +<% + + Map signMap = new HashMap(); + signMap.put("总体集成","ztjc"); + signMap.put("系统咨询","xtzx"); + signMap.put("软件开发","rjkf"); + signMap.put("安防监控","afjk"); + signMap.put("运行维护","yxwh"); + signMap.put("数据恢复","sjhf"); + signMap.put("工程监理","gcjl"); + + + Map countMap = new HashMap(); + countMap.put("ztjc",0); + countMap.put("xtzx",0); + countMap.put("rjkf",0); + countMap.put("afjk",0); + countMap.put("yxwh",0); + countMap.put("sjhf",0); + countMap.put("gcjl",0); + + + User user = HrmUserVarify.getUser(request, response); + if(user==null) { + response.sendRedirect("/login/Login.jsp"); + return; + } + + + String startDate = request.getParameter("startDate"); + String endDate = request.getParameter("endDate"); + + String zzlx = "0"; + RecordSet rs = new RecordSet(); + List> cityList = new ArrayList>(); + String sql =" select selectvalue,selectname \n" + + " from workflow_selectitem \n" + + " where fieldid in(\n" + + " select id from workflow_billfield \n" + + " where billid in( select id from workflow_bill where tablename='uf_dwjbxx' ) and fieldname='szcs' \n" + + " and detailtable is null\n" + + " ) "; + rs.executeQuery(sql); + while (rs.next()){ + String selectvalue = rs.getString("selectvalue"); + String selectname = rs.getString("selectname"); + Map cityMap = new HashMap(); + cityMap.put("key","City"+selectvalue); + cityMap.put("title",selectname); + cityList.add(cityMap); + } + + String selectnames = ""; + Iterator> iterator = signMap.entrySet().iterator(); + while (iterator.hasNext()){ + Map.Entry entry = iterator.next(); + String key = entry.getKey(); + selectnames += StringUtils.isBlank(selectnames) ? "'" + key + "'" : ",'" + key + "'"; + } + + + List> typeList = new ArrayList>(); + sql = " select selectvalue,selectname \n" + + " from workflow_selectitem\n" + + " where fieldid in(\n" + + " select id from workflow_billfield \n" + + " where billid in( select id from workflow_bill where tablename='uf_bmzzzsxx' ) and fieldname='ywzl' \n" + + " and detailtable is null\n" + + " ) \n" + + " AND selectname in("+selectnames+")" ; + + out.print("sql:"+sql+"
"); + rs.executeQuery(sql); + while (rs.next()){ + String selectvalue = Util.null2String(rs.getString("selectvalue")); + String selectname = Util.null2String(rs.getString("selectname")); + + Map typeMap = new HashMap(); + typeMap.put("selectname",selectname); + typeMap.put("selectvalue",selectvalue); + String selectType = signMap.get(selectname); + typeMap.put("selecttype",selectType); + typeList.add(typeMap); + } + + out.print("typeList:"+typeList.size()+"
"); + + int yjjg_total = 0; + int ejjg_total = 0 ; +// int ztjc_tootal = 0; +// int xtzx_tootal = 0; +// int rjkf_tootal = 0; +// int afjk_tootal = 0; +// int yxwh_tootal = 0; +// int sjhf_tootal = 0; +// int gcjl_tootal = 0; + + + for(int i=0;i cityMap = cityList.get(i); + String yjjg = "0"; + String ejjg = "0"; + String cityKey = Util.null2String(cityMap.get("key")).replace("City",""); + + String where = ""; + if(StringUtils.isNotBlank(startDate)){ + where += " and k.fzrq >= '"+startDate+"' "; + } + + if(StringUtils.isNotBlank(endDate)){ + where += " and k.fzrq <= '"+endDate+"' "; + } + + sql = " select zzdj,count(1) as cou\n" + + " from uf_dwjbxx t\n" + + " inner join uf_bmzzzsxx k on k.dwmc = t.id\n" + + " where k.zszt=0\n" + + " and k.zzlx = " + zzlx + + " and t.szcs=" + cityKey + where + + " group by zzdj "; + + rs.executeQuery(sql); + while (rs.next()){ + String zzdj = Util.null2String(rs.getString("zzdj")); + String cou = Util.null2String(rs.getString("cou")); + if("1".equals(zzdj)){ + yjjg = cou; + }else if("2".equals(zzdj)){ + ejjg = cou; + } + } + + if(StringUtils.isNotBlank(yjjg)){ + yjjg_total += Util.getIntValue(yjjg,0); + } + + if(StringUtils.isNotBlank(ejjg)){ + ejjg_total += Util.getIntValue(ejjg,0); + } + + cityMap.put("yjjg",yjjg); + cityMap.put("ejjg",ejjg); + + for(int k=0;k typeMap = typeList.get(k); + String selectvalue = typeMap.get("selectvalue"); + String selecttype = typeMap.get("selecttype"); + int count = 0; + if(StringUtils.isNotBlank(selectvalue)){ + sql = " select k.id \n" + + " from uf_dwjbxx t\n" + + " inner join uf_bmzzzsxx k on k.dwmc = t.id\n" + + " where k.zszt=0 \n" + + " and instr(','||ywzl||',',',"+selectvalue+",')>0 \n" + + " and k.zzlx = " + zzlx + + " and t.szcs="+cityKey + where ; + rs.executeQuery(sql); + while (rs.next()){ + count++; + } + int total = countMap.get(selecttype); + total += count; + countMap.put(selecttype,total); + } + + cityMap.put(selecttype,count); + } + } + + for(int i=0;i cityMap = cityList.get(i); + String cityKey = Util.null2String(cityMap.get("key")).replace("City",""); + + List> districtList = new ArrayList>(); + + if(StringUtils.isNotBlank(cityKey)){ + int cityKey_ = Util.getIntValue(cityKey)+1; + sql = "select id,qm,yb from uf_qjsj where sss="+cityKey_; + rs.executeQuery(sql); + while (rs.next()){ + String id = Util.null2String(rs.getString("id")); + String qm = Util.null2String(rs.getString("qm")); + + Map districtMap = new HashMap(); + districtMap.put("key","District"+id); + districtMap.put("title",qm); + districtList.add(districtMap); + } + } + + for(int k=0;k districtMap = districtList.get(k); + String districtKey = Util.null2String(districtMap.get("key")).replace("District",""); + + + String where = ""; + if(StringUtils.isNotBlank(startDate)){ + where += " and k.fzrq >= '"+startDate+"' "; + } + + if(StringUtils.isNotBlank(endDate)){ + where += " and k.fzrq <= '"+endDate+"' "; + } + + sql = "select zzdj,count(1) as cou\n" + + "from uf_dwjbxx t\n" + + "inner join uf_bmzzzsxx k on k.dwmc = t.id\n" + + "where k.zszt=0\n" + + "and k.zzlx = " + zzlx + + "and t.szqx= " + districtKey + where + + "group by zzdj "; + + rs.executeQuery(sql); + while (rs.next()){ + String zzdj = Util.null2String(rs.getString("zzdj")); + String cou = Util.null2String(rs.getString("cou")); + if("1".equals(zzdj)){ + districtMap.put("yjjg",cou); + }else if("2".equals(zzdj)){ + districtMap.put("ejjg",cou); + } + } + + + for(int n=0;n typeMap = typeList.get(n); + String selectvalue = typeMap.get("selectvalue"); + String selecttype = typeMap.get("selecttype"); + out.print("selectvalue:"+selectvalue+" selecttype:"+selecttype+"
"); + + int count = 0; + + if(StringUtils.isNotBlank(selectvalue)){ + sql = " select k.id \n" + + " from uf_dwjbxx t\n" + + " inner join uf_bmzzzsxx k on k.dwmc = t.id\n" + + " where k.zszt=0 \n" + + " and instr(','||ywzl||',',',"+selectvalue+",')>0 \n" + + " and k.zzlx = " + zzlx + + " and t.szqx= " + districtKey + where ; + out.print("sql:"+sql+"
"); + rs.executeQuery(sql); + while (rs.next()){ + count++; + } + } + out.print("count:"+count+"
"); + districtMap.put(selecttype,count); + } + } + cityMap.put("subList",districtList); + } + + Map totalMap = new HashMap(); + totalMap.put("key","total"); + totalMap.put("title","合计"); + totalMap.put("yjjg",yjjg_total); + totalMap.put("ejjg",ejjg_total); + totalMap.putAll(countMap); + + cityList.add(totalMap); + + JSONObject dataJson = new JSONObject(); + dataJson.put("data",cityList); + +%> + +<%=dataJson.toJSONString() %> + diff --git a/JSSBMJ/interface/custom/queryInformationSystemTypeReport.jsp b/JSSBMJ/interface/custom/queryInformationSystemTypeReport.jsp new file mode 100644 index 0000000..12dd0d4 --- /dev/null +++ b/JSSBMJ/interface/custom/queryInformationSystemTypeReport.jsp @@ -0,0 +1,253 @@ +<%@ page import="weaver.conn.RecordSet" %> +<%@ page import="com.alibaba.fastjson.JSONObject" %> +<%@ page import="weaver.general.Util" %> +<%@ page import="org.apache.commons.lang3.StringUtils" %> +<%@ page import="weaver.hrm.HrmUserVarify" %> +<%@ page import="weaver.hrm.User" %> +<%@ page import="java.util.*" %> +<%@ page language="java" contentType="text/html; charset=UTF-8" %> +<% + + User user = HrmUserVarify.getUser(request, response); + if(user==null) { + response.sendRedirect("/login/Login.jsp"); + return; + } + + Map signMap = new HashMap(); + signMap.put("总体集成","ztjc"); + signMap.put("系统咨询","xtzx"); + signMap.put("软件开发","rjkf"); + signMap.put("安防监控","afjk"); + signMap.put("运行维护","yxwh"); + signMap.put("数据恢复","sjhf"); + signMap.put("工程监理","gcjl"); + + + Map countMap = new HashMap(); + countMap.put("jj_ztjc",0); + countMap.put("jj_xtzx",0); + countMap.put("jj_rjkf",0); + countMap.put("jj_afjk",0); + countMap.put("jj_yxwh",0); + countMap.put("jj_sjhf",0); + countMap.put("jj_gcjl",0); + + countMap.put("yj_ztjc",0); + countMap.put("yj_xtzx",0); + countMap.put("yj_rjkf",0); + countMap.put("yj_afjk",0); + countMap.put("yj_yxwh",0); + countMap.put("yj_sjhf",0); + countMap.put("yj_gcjl",0); + + String startDate = request.getParameter("startDate"); + String endDate = request.getParameter("endDate"); + + String zzlx = "0"; + RecordSet rs = new RecordSet(); + List> cityList = new ArrayList>(); + String sql =" select selectvalue,selectname \n" + + " from workflow_selectitem \n" + + " where fieldid in(\n" + + " select id from workflow_billfield \n" + + " where billid in( select id from workflow_bill where tablename='uf_dwjbxx' ) and fieldname='szcs' \n" + + " and detailtable is null\n" + + " ) "; + rs.executeQuery(sql); + while (rs.next()){ + String selectvalue = rs.getString("selectvalue"); + String selectname = rs.getString("selectname"); + Map cityMap = new HashMap(); + cityMap.put("key","City"+selectvalue); + cityMap.put("title",selectname); + cityList.add(cityMap); + } + + + String selectnames = ""; + Iterator> iterator = signMap.entrySet().iterator(); + while (iterator.hasNext()){ + Map.Entry entry = iterator.next(); + String key = entry.getKey(); + selectnames += StringUtils.isBlank(selectnames) ? "'" + key + "'" : ",'" + key + "'"; + } + + List> typeList = new ArrayList>(); + sql = " select selectvalue,selectname \n" + + " from workflow_selectitem\n" + + " where fieldid in(\n" + + " select id from workflow_billfield \n" + + " where billid in( select id from workflow_bill where tablename='uf_bmzzzsxx' ) and fieldname='ywzl' \n" + + " and detailtable is null\n" + + " ) \n" + + " AND selectname in("+selectnames+")" ; + + rs.executeQuery(sql); + while (rs.next()){ + String selectvalue = Util.null2String(rs.getString("selectvalue")); + String selectname = Util.null2String(rs.getString("selectname")); + + Map typeMap = new HashMap(); + typeMap.put("selectname",selectname); + typeMap.put("selectvalue",selectvalue); + String selectType = signMap.get(selectname); + typeMap.put("selecttype",selectType); + typeList.add(typeMap); + } + + List> djList = new ArrayList>(); + sql = " select selectvalue,selectname \n" + + " from workflow_selectitem\n" + + " where fieldid in(\n" + + " select id from workflow_billfield \n" + + " where billid in( select id from workflow_bill where tablename='uf_bmzzzsxx' ) \n" + + " and fieldname='zzdj' \n" + + " and detailtable is null\n" + + " ) \n" + + " and selectname in('甲级','乙级') "; + rs.executeQuery(sql); + while (rs.next()){ + String selectvalue = Util.null2String(rs.getString("selectvalue")); + String selectname = Util.null2String(rs.getString("selectname")); + + Map djMap = new HashMap(); + djMap.put("selectvalue",selectvalue); + djMap.put("selectname",selectname); + String type = ""; + if("甲级".equals(selectname)){ + type = "jj"; + }else if("乙级".equals(selectname)){ + type = "yj"; + } + + djMap.put("rowtype",type); + djList.add(djMap); + } + + String where = ""; + if(StringUtils.isNotBlank(startDate)){ + where += " and k.fzrq >= '"+startDate+"' "; + } + + if(StringUtils.isNotBlank(endDate)){ + where += " and k.fzrq <= '"+endDate+"' "; + } + + + for(int i=0;i cityMap = cityList.get(i); + + String cityKey = Util.null2String(cityMap.get("key")).replace("City",""); + + for(int p=0;p djMap = djList.get(p); + String rowtype = djMap.get("rowtype"); + String djvalue = djMap.get("selectvalue"); + + for(int k=0;k typeMap = typeList.get(k); + String selectvalue = typeMap.get("selectvalue"); + String selecttype = typeMap.get("selecttype"); + int count = 0; + if(StringUtils.isNotBlank(selectvalue)){ + + sql = " select k.id \n" + + " from uf_dwjbxx t\n" + + " inner join uf_bmzzzsxx k on k.dwmc = t.id\n" + + " where k.zszt=0" + + " and k.zzdj = " + djvalue + + " and instr(','||k.ywzl||',',',"+selectvalue+",')>0 \n" + + " and k.zzlx = " + zzlx + + " and t.szcs="+cityKey + where ; + + rs.executeQuery(sql); + while (rs.next()){ + count++; + } + int total = countMap.get(rowtype+"_"+selecttype); + total += count; + countMap.put(selecttype,total); + } + cityMap.put(rowtype+"_"+selecttype,count); + } + } + } + + for(int i=0;i cityMap = cityList.get(i); + String cityKey = Util.null2String(cityMap.get("key")).replace("City",""); + + List> districtList = new ArrayList>(); + + if(StringUtils.isNotBlank(cityKey)){ + int cityKey_ = Util.getIntValue(cityKey)+1; + sql = "select id,qm,yb from uf_qjsj where sss="+cityKey_; + rs.executeQuery(sql); + while (rs.next()){ + String id = Util.null2String(rs.getString("id")); + String qm = Util.null2String(rs.getString("qm")); + + Map districtMap = new HashMap(); + districtMap.put("key","District"+id); + districtMap.put("title",qm); + districtList.add(districtMap); + } + } + + + for(int k=0;k districtMap = districtList.get(k); + String districtKey = Util.null2String(districtMap.get("key")).replace("District",""); + + for(int p=0;p djMap = djList.get(p); + String rowtype = djMap.get("rowtype"); + String djvalue = djMap.get("selectvalue"); + + + for(int n=0;n typeMap = typeList.get(n); + String selectvalue = typeMap.get("selectvalue"); + String selecttype = typeMap.get("selecttype"); + + int count = 0; + + if(StringUtils.isNotBlank(selectvalue)){ + sql = " select k.id \n" + + " from uf_dwjbxx t\n" + + " inner join uf_bmzzzsxx k on k.dwmc = t.id\n" + + " where k.zszt=0 \n" + + " and k.zzdj = " + djvalue + + " and instr(','||k.ywzl||',',',"+selectvalue+",')>0 \n" + + " and k.zzlx = " + zzlx + + " and t.szqx= " + districtKey + where ; + + rs.executeQuery(sql); + while (rs.next()){ + count++; + } + } + districtMap.put(rowtype+"_"+selecttype,count); + } + } + } + + cityMap.put("subList",districtList); + } + + Map totalMap = new HashMap(); + totalMap.put("key","total"); + totalMap.put("title","合计"); + + cityList.add(totalMap); + + JSONObject dataJson = new JSONObject(); + dataJson.put("data",cityList); + +%> + +<%=dataJson.toJSONString() %> + diff --git a/JSSBMJ/interface/custom/queryLeftRightUrl.jsp b/JSSBMJ/interface/custom/queryLeftRightUrl.jsp new file mode 100644 index 0000000..71950f8 --- /dev/null +++ b/JSSBMJ/interface/custom/queryLeftRightUrl.jsp @@ -0,0 +1,35 @@ +<%@ page import="weaver.conn.RecordSet" %> +<%@ page import="com.alibaba.fastjson.JSONObject" %> +<%@ page import="weaver.general.Util" %> +<%@ page import="org.apache.commons.lang3.StringUtils" %> +<%@ page language="java" contentType="text/html; charset=UTF-8" %> +<% + + JSONObject dataJson = new JSONObject(); + RecordSet rs = new RecordSet(); + String sjid = request.getParameter("sjid"); + + String zblj = ""; + String yblj = ""; + String ycmrzs = ""; + String sql = " select zblj,yblj,ycmrzs from uf_zybjpz where id="+sjid; + rs.executeQuery(sql); + if (rs.next()){ + zblj = Util.null2String(rs.getString("zblj")); + yblj = Util.null2String(rs.getString("yblj")); + ycmrzs = Util.null2String(rs.getString("ycmrzs")); + + } + if(StringUtils.isBlank(ycmrzs)){ + ycmrzs = "0"; + } + + dataJson.put("zblj",zblj); + dataJson.put("yblj",yblj); + dataJson.put("ycmrzs",ycmrzs); + + // /interface/custom/queryLeftRightUrl.jsp?sjid=1 +%> + +<%=dataJson.toJSONString() %> + diff --git a/JSSBMJ/interface/custom/queryMilitaryInstallationReport.jsp b/JSSBMJ/interface/custom/queryMilitaryInstallationReport.jsp new file mode 100644 index 0000000..7acad81 --- /dev/null +++ b/JSSBMJ/interface/custom/queryMilitaryInstallationReport.jsp @@ -0,0 +1,166 @@ +<%@ page import="java.util.Map" %> +<%@ page import="weaver.conn.RecordSet" %> +<%@ page import="java.util.HashMap" %> +<%@ page import="java.util.List" %> +<%@ page import="java.util.ArrayList" %> +<%@ page import="com.alibaba.fastjson.JSONObject" %> +<%@ page import="weaver.general.Util" %> +<%@ page import="org.apache.commons.lang3.StringUtils" %> +<%@ page import="weaver.hrm.HrmUserVarify" %> +<%@ page import="weaver.hrm.User" %> +<%@ page language="java" contentType="text/html; charset=UTF-8" %> +<% + + User user = HrmUserVarify.getUser(request, response); + if(user==null) { + response.sendRedirect("/login/Login.jsp"); + return; + } + + String startDate = request.getParameter("startDate"); + String endDate = request.getParameter("endDate"); + + String zzlx = "3"; + RecordSet rs = new RecordSet(); + List> cityList = new ArrayList>(); + String sql =" select selectvalue,selectname \n" + + " from workflow_selectitem \n" + + " where fieldid in(\n" + + " select id from workflow_billfield \n" + + " where billid in( select id from workflow_bill where tablename='uf_dwjbxx' ) and fieldname='szcs' \n" + + " and detailtable is null\n" + + " ) "; + rs.executeQuery(sql); + while (rs.next()){ + String selectvalue = rs.getString("selectvalue"); + String selectname = rs.getString("selectname"); + Map cityMap = new HashMap(); + cityMap.put("key","City"+selectvalue); + cityMap.put("title",selectname); + cityList.add(cityMap); + } + + int yjjg_total = 0; + int ejjg_total = 0 ; + for(int i=0;i cityMap = cityList.get(i); + String yjjg = "0"; + String ejjg = "0"; + + String where = ""; + if(StringUtils.isNotBlank(startDate)){ + where += " and k.fzrq >= '"+startDate+"' "; + } + + if(StringUtils.isNotBlank(endDate)){ + where += " and k.fzrq <= '"+endDate+"' "; + } + + String cityKey = Util.null2String(cityMap.get("key")).replace("City",""); + sql = " select zzdj,count(1) as cou\n" + + " from uf_dwjbxx t\n" + + " inner join uf_bmzzzsxx k on k.dwmc = t.id\n" + + " where k.zszt=0\n" + + " and k.zzlx = " + zzlx + + " and t.szcs=" + cityKey + where + + " group by zzdj "; + + rs.executeQuery(sql); + while (rs.next()){ + String zzdj = Util.null2String(rs.getString("zzdj")); + String cou = Util.null2String(rs.getString("cou")); + if("3".equals(zzdj)){ + yjjg = cou; + }else if("4".equals(zzdj)){ + ejjg = cou; + } + } + + if(StringUtils.isNotBlank(yjjg)){ + yjjg_total += Util.getIntValue(yjjg,0); + } + + if(StringUtils.isNotBlank(ejjg)){ + ejjg_total += Util.getIntValue(ejjg,0); + } + + cityMap.put("yjjg",yjjg); + cityMap.put("ejjg",ejjg); + } + + for(int i=0;i cityMap = cityList.get(i); + String cityKey = Util.null2String(cityMap.get("key")).replace("City",""); + + List> districtList = new ArrayList>(); + + if(StringUtils.isNotBlank(cityKey)){ + int cityKey_ = Util.getIntValue(cityKey)+1; + sql = "select id,qm,yb from uf_qjsj where sss="+cityKey_; + rs.executeQuery(sql); + while (rs.next()){ + String id = Util.null2String(rs.getString("id")); + String qm = Util.null2String(rs.getString("qm")); + + Map districtMap = new HashMap(); + districtMap.put("key","District"+id); + districtMap.put("title",qm); + districtList.add(districtMap); + } + } + + for(int k=0;k districtMap = districtList.get(k); + String districtKey = Util.null2String(districtMap.get("key")).replace("District",""); + + String where = ""; + if(StringUtils.isNotBlank(startDate)){ + where += " and k.fzrq >= '"+startDate+"' "; + } + + if(StringUtils.isNotBlank(endDate)){ + where += " and k.fzrq <= '"+endDate+"' "; + } + + String dist_yjjg = "0"; + String dist_ejjg = "0"; + sql = "select zzdj,count(1) as cou\n" + + "from uf_dwjbxx t\n" + + "inner join uf_bmzzzsxx k on k.dwmc = t.id\n" + + "where k.zszt=0\n" + + "and k.zzlx = " + zzlx + + "and t.szqx= " + districtKey + where + + "group by zzdj "; + + rs.executeQuery(sql); + while (rs.next()){ + String zzdj = Util.null2String(rs.getString("zzdj")); + String cou = Util.null2String(rs.getString("cou")); + if("3".equals(zzdj)){ + dist_yjjg = cou; + }else if("4".equals(zzdj)){ + dist_ejjg = cou; + } + } + + districtMap.put("yjjg",dist_yjjg); + districtMap.put("ejjg",dist_ejjg); + } + cityMap.put("subList",districtList); + } + + Map totalMap = new HashMap(); + totalMap.put("key","total"); + totalMap.put("title","合计"); + totalMap.put("yjjg",yjjg_total); + totalMap.put("ejjg",ejjg_total); + + cityList.add(totalMap); + + JSONObject dataJson = new JSONObject(); + dataJson.put("data",cityList); + +%> + +<%=dataJson.toJSONString() %> + diff --git a/JSSBMJ/interface/custom/queryMilitaryInstallationeport.jsp b/JSSBMJ/interface/custom/queryMilitaryInstallationeport.jsp new file mode 100644 index 0000000..774582e --- /dev/null +++ b/JSSBMJ/interface/custom/queryMilitaryInstallationeport.jsp @@ -0,0 +1,158 @@ +<%@ page import="java.util.Map" %> +<%@ page import="weaver.conn.RecordSet" %> +<%@ page import="java.util.HashMap" %> +<%@ page import="java.util.List" %> +<%@ page import="java.util.ArrayList" %> +<%@ page import="com.alibaba.fastjson.JSONObject" %> +<%@ page import="weaver.general.Util" %> +<%@ page import="org.apache.commons.lang3.StringUtils" %> +<%@ page language="java" contentType="text/html; charset=UTF-8" %> +<% + + String startDate = request.getParameter("startDate"); + String endDate = request.getParameter("endDate"); + + String zzlx = "3"; + RecordSet rs = new RecordSet(); + List> cityList = new ArrayList>(); + String sql =" select selectvalue,selectname \n" + + " from workflow_selectitem \n" + + " where fieldid in(\n" + + " select id from workflow_billfield \n" + + " where billid in( select id from workflow_bill where tablename='uf_dwjbxx' ) and fieldname='szcs' \n" + + " and detailtable is null\n" + + " ) "; + rs.executeQuery(sql); + while (rs.next()){ + String selectvalue = rs.getString("selectvalue"); + String selectname = rs.getString("selectname"); + Map cityMap = new HashMap(); + cityMap.put("key","City"+selectvalue); + cityMap.put("title",selectname); + cityList.add(cityMap); + } + + int yjjg_total = 0; + int ejjg_total = 0 ; + for(int i=0;i cityMap = cityList.get(i); + String yjjg = "0"; + String ejjg = "0"; + + String where = ""; + if(StringUtils.isNotBlank(startDate)){ + where += " and k.fzrq >= '"+startDate+"' "; + } + + if(StringUtils.isNotBlank(endDate)){ + where += " and k.fzrq <= '"+endDate+"' "; + } + + String cityKey = Util.null2String(cityMap.get("key")).replace("City",""); + sql = " select zzdj,count(1) as cou\n" + + " from uf_dwjbxx t\n" + + " inner join uf_bmzzzsxx k on k.dwmc = t.id\n" + + " where k.zszt=0\n" + + " and k.zzlx = " + zzlx + + " and t.szcs=" + cityKey + where + + " group by zzdj "; + + rs.executeQuery(sql); + while (rs.next()){ + String zzdj = Util.null2String(rs.getString("zzdj")); + String cou = Util.null2String(rs.getString("cou")); + if("3".equals(zzdj)){ + yjjg = cou; + }else if("4".equals(zzdj)){ + ejjg = cou; + } + } + + if(StringUtils.isNotBlank(yjjg)){ + yjjg_total += Util.getIntValue(yjjg,0); + } + + if(StringUtils.isNotBlank(ejjg)){ + ejjg_total += Util.getIntValue(ejjg,0); + } + + cityMap.put("yjjg",yjjg); + cityMap.put("ejjg",ejjg); + } + + for(int i=0;i cityMap = cityList.get(i); + String cityKey = Util.null2String(cityMap.get("key")).replace("City",""); + + List> districtList = new ArrayList>(); + + if(StringUtils.isNotBlank(cityKey)){ + int cityKey_ = Util.getIntValue(cityKey)+1; + sql = "select id,qm,yb from uf_qjsj where sss="+cityKey_; + rs.executeQuery(sql); + while (rs.next()){ + String id = Util.null2String(rs.getString("id")); + String qm = Util.null2String(rs.getString("qm")); + + Map districtMap = new HashMap(); + districtMap.put("key","District"+id); + districtMap.put("title",qm); + districtList.add(districtMap); + } + } + + for(int k=0;k districtMap = districtList.get(k); + String districtKey = Util.null2String(districtMap.get("key")).replace("District",""); + + String where = ""; + if(StringUtils.isNotBlank(startDate)){ + where += " and k.fzrq >= '"+startDate+"' "; + } + + if(StringUtils.isNotBlank(endDate)){ + where += " and k.fzrq <= '"+endDate+"' "; + } + + String dist_yjjg = "0"; + String dist_ejjg = "0"; + sql = "select zzdj,count(1) as cou\n" + + "from uf_dwjbxx t\n" + + "inner join uf_bmzzzsxx k on k.dwmc = t.id\n" + + "where k.zszt=0\n" + + "and k.zzlx = " + zzlx + + "and t.szqx= " + districtKey + where + + "group by zzdj "; + + rs.executeQuery(sql); + while (rs.next()){ + String zzdj = Util.null2String(rs.getString("zzdj")); + String cou = Util.null2String(rs.getString("cou")); + if("3".equals(zzdj)){ + dist_yjjg = cou; + }else if("4".equals(zzdj)){ + dist_ejjg = cou; + } + } + + districtMap.put("yjjg",dist_yjjg); + districtMap.put("ejjg",dist_ejjg); + } + cityMap.put("subList",districtList); + } + + Map totalMap = new HashMap(); + totalMap.put("key","total"); + totalMap.put("title","合计"); + totalMap.put("yjjg",yjjg_total); + totalMap.put("ejjg",ejjg_total); + + cityList.add(totalMap); + + JSONObject dataJson = new JSONObject(); + dataJson.put("data",cityList); + +%> + +<%=dataJson.toJSONString() %> + diff --git a/JSSBMJ/interface/custom/queryRequestUserComplete.jsp b/JSSBMJ/interface/custom/queryRequestUserComplete.jsp new file mode 100644 index 0000000..929db79 --- /dev/null +++ b/JSSBMJ/interface/custom/queryRequestUserComplete.jsp @@ -0,0 +1,45 @@ +<%@ page import="weaver.conn.RecordSet" %> +<%@ page import="com.alibaba.fastjson.JSONObject" %> +<%@ page import="weaver.hrm.HrmUserVarify" %> +<%@ page import="weaver.hrm.User" %> +<%@ page import="weaver.general.Util" %> +<%@ page language="java" contentType="text/html; charset=UTF-8" %> +<% + + JSONObject dataJson = new JSONObject(); + RecordSet rs = new RecordSet(); + User user = HrmUserVarify.getUser(request, response); + int userid = user.getUID(); + String requestid = request.getParameter("requestid"); + int count = 0; + int isprocess = 0; + String sql = " select isremark from workflow_currentoperator where requestid="+requestid+" and userid = "+userid ; + rs.executeQuery(sql); + while (rs.next()){ + String isremark = Util.null2String(rs.getString("isremark")); + if(!"2".equals(isremark) && !"4".equals(isremark)){ + isprocess++; + } + count++ ; + } + + if(count == 0){ + dataJson.put("msg",""); + }else{ + if(isprocess >0){ + dataJson.put("msg","待处理"); + }else{ + dataJson.put("msg","已处理"); + } + + } + +%> + +<%=dataJson.toJSONString() %> + +<%! + + +%> + diff --git a/JSSBMJ/interface/custom/queryReviewProgress.jsp b/JSSBMJ/interface/custom/queryReviewProgress.jsp new file mode 100644 index 0000000..db246c7 --- /dev/null +++ b/JSSBMJ/interface/custom/queryReviewProgress.jsp @@ -0,0 +1,188 @@ +<%@ page import="weaver.conn.RecordSet" %> +<%@ page import="com.alibaba.fastjson.JSONObject" %> +<%@ page import="org.apache.commons.lang3.StringUtils" %> +<%@ page import="java.util.HashMap" %> +<%@ page import="java.util.Map" %> +<%@ page import="java.util.ArrayList" %> +<%@ page import="java.util.List" %> +<%@ page language="java" contentType="text/html; charset=UTF-8" %> +<% + + String dwid = request.getParameter("dwid"); + List> list = new ArrayList>(); + Map sqslMap = getSqslMap(dwid); + if(sqslMap !=null && sqslMap.size()>0){ + list.add(sqslMap); + String yxDate = sqslMap.get("enddate"); + + Map smscMap = getSmscMap(dwid,yxDate); + list.add(smscMap); + + + Map xcscMap = getXcscMap(dwid,yxDate); + list.add(xcscMap); + + + Map spjdMap = getSpjdMap(dwid,yxDate); + list.add(spjdMap); + + Map fzrqMap = getFzrqMap(dwid,yxDate); + list.add(fzrqMap); + + + } + + JSONObject dataJson = new JSONObject(); + dataJson.put("dataList",list); + dataJson.put("api_status",true); + dataJson.put("message","success"); + + +%> + +<%=dataJson.toJSONString() %> + +<%! + + public Map getSqslMap(String dwid){ + RecordSet rs = new RecordSet(); + Map sqslMap = new HashMap(); + sqslMap.put("detail_desc","受理日期"); + sqslMap.put("title","申请受理"); + sqslMap.put("finish","0"); + + String slrq = ""; + String status = "4"; + String sql =" select slrq\n" + + " from uf_sqsl\n" + + " where id in(\n" + + " select max(id) from uf_sqsl where dwmc = '"+dwid+"'"+ + " ) " ; + rs.executeQuery(sql); + if (rs.next()){ + slrq = rs.getString("slrq"); + status = "2"; + } + + sqslMap.put("enddate",slrq); + sqslMap.put("detail_date",slrq); + sqslMap.put("status",status); + return sqslMap; + } + + public Map getSmscMap(String dwid,String yxDate){ + RecordSet rs = new RecordSet(); + Map sqslMap = new HashMap(); + sqslMap.put("finish","0"); + sqslMap.put("title","书面审查"); + sqslMap.put("status","2"); + + sqslMap.put("detail_desc","书面审查日期"); + + String smscrq = ""; + String status = "4"; + if(StringUtils.isNotBlank(yxDate)){ + String sql =" select smscrq from uf_smsc where dwmc = '"+dwid+"' and smscrq >='"+yxDate+"'" ; + rs.executeQuery(sql); + if (rs.next()){ + smscrq = rs.getString("smscrq"); + status = "2"; + } + + } + + + + sqslMap.put("enddate",smscrq); + sqslMap.put("detail_date",smscrq); + sqslMap.put("status",status); + return sqslMap; + } + + + public Map getXcscMap(String dwid,String yxDate){ + RecordSet rs = new RecordSet(); + Map sqslMap = new HashMap(); + + sqslMap.put("title","现场审查"); + sqslMap.put("status","2"); + sqslMap.put("finish","0"); + sqslMap.put("detail_desc","现场审查日期"); + + String xcscrq = ""; + String status = "4"; + if(StringUtils.isNotBlank(yxDate)){ + String sql =" select xcscrq from uf_xcscjl where dwmc = '"+dwid+"' and xcscrq >='"+yxDate+"'" ; + rs.executeQuery(sql); + if (rs.next()) { + xcscrq = rs.getString("xcscrq"); + status = "2"; + } + } + sqslMap.put("enddate",xcscrq); + sqslMap.put("detail_date",xcscrq); + sqslMap.put("status",status); + return sqslMap; + } + + + public Map getSpjdMap(String dwid,String yxDate){ + RecordSet rs = new RecordSet(); + Map sqslMap = new HashMap(); + + sqslMap.put("finish","0"); + sqslMap.put("title","审批决定"); + sqslMap.put("status","2"); + + sqslMap.put("detail_desc","行政许可日期"); + + String xzxkrq = ""; + String status = "4"; + if(StringUtils.isNotBlank(yxDate)){ + String sql =" select xzxkrq from uf_spjdjl where dwmc = '"+dwid+"' and xzxkrq >='"+yxDate+"' " ; + rs.executeQuery(sql); + if (rs.next()){ + xzxkrq = rs.getString("xzxkrq"); + status = "2"; + } + } + + + sqslMap.put("enddate",xzxkrq); + sqslMap.put("detail_date",xzxkrq); + sqslMap.put("status",status); + + return sqslMap; + } + + + public Map getFzrqMap(String dwid,String yxDate){ + RecordSet rs = new RecordSet(); + Map sqslMap = new HashMap(); + sqslMap.put("finish","0"); + sqslMap.put("detail_desc","发证日期"); + sqslMap.put("title","制证发证"); + + + String fzrq = ""; + String status = "4"; + if(StringUtils.isNotBlank(yxDate)) { + String sql = " select fzrq from uf_zzfzjl where dwmc = '" + dwid + "' and fzrq >= '" + yxDate + "' "; + rs.executeQuery(sql); + if (rs.next()) { + fzrq = rs.getString("fzrq"); + status = "2"; + } + } + + sqslMap.put("enddate",fzrq); + sqslMap.put("detail_date",fzrq); + sqslMap.put("status",status); + + return sqslMap; + } + + +%> + + diff --git a/JSSBMJ/interface/custom/querySecretCerrierReport.jsp b/JSSBMJ/interface/custom/querySecretCerrierReport.jsp new file mode 100644 index 0000000..b6739b2 --- /dev/null +++ b/JSSBMJ/interface/custom/querySecretCerrierReport.jsp @@ -0,0 +1,253 @@ +<%@ page import="weaver.conn.RecordSet" %> +<%@ page import="com.alibaba.fastjson.JSONObject" %> +<%@ page import="weaver.general.Util" %> +<%@ page import="org.apache.commons.lang3.StringUtils" %> +<%@ page import="weaver.hrm.HrmUserVarify" %> +<%@ page import="weaver.hrm.User" %> +<%@ page import="java.util.*" %> +<%@ page language="java" contentType="text/html; charset=UTF-8" %> +<% + + User user = HrmUserVarify.getUser(request, response); + if(user==null) { + response.sendRedirect("/login/Login.jsp"); + return; + } + + Map signMap = new HashMap(); + signMap.put("涉密文件资料","smwjzl"); + signMap.put("国家统一考试试卷","gjtykssj"); + signMap.put("涉密防伪票据证书","smfwpjzs"); + signMap.put("涉密光电磁介质","smgdcjz"); + signMap.put("涉密档案数字化加工","smdaszhjg"); + + Map countMap = new HashMap(); + countMap.put("smwjzl",0); + countMap.put("gjtykssj",0); + countMap.put("smfwpjzs",0); + countMap.put("smgdcjz",0); + countMap.put("smdaszhjg",0); + + + String startDate = request.getParameter("startDate"); + String endDate = request.getParameter("endDate"); + + String zzlx = "1"; + RecordSet rs = new RecordSet(); + List> cityList = new ArrayList>(); + String sql =" select selectvalue,selectname \n" + + " from workflow_selectitem \n" + + " where fieldid in(\n" + + " select id from workflow_billfield \n" + + " where billid in( select id from workflow_bill where tablename='uf_dwjbxx' ) and fieldname='szcs' \n" + + " and detailtable is null\n" + + " ) "; + rs.executeQuery(sql); + while (rs.next()){ + String selectvalue = rs.getString("selectvalue"); + String selectname = rs.getString("selectname"); + Map cityMap = new HashMap(); + cityMap.put("key","City"+selectvalue); + cityMap.put("title",selectname); + cityList.add(cityMap); + } + + + String selectnames = ""; + Iterator> iterator = signMap.entrySet().iterator(); + while (iterator.hasNext()){ + Map.Entry entry = iterator.next(); + String key = entry.getKey(); + selectnames += StringUtils.isBlank(selectnames) ? "'" + key + "'" : ",'" + key + "'"; + } + + List> typeList = new ArrayList>(); + sql = " select selectvalue,selectname \n" + + " from workflow_selectitem\n" + + " where fieldid in(\n" + + " select id from workflow_billfield \n" + + " where billid in( select id from workflow_bill where tablename='uf_bmzzzsxx' ) and fieldname='ywzl' \n" + + " and detailtable is null\n" + + " ) \n" + + " AND selectname in("+selectnames+")" ; + + rs.executeQuery(sql); + while (rs.next()){ + String selectvalue = Util.null2String(rs.getString("selectvalue")); + String selectname = Util.null2String(rs.getString("selectname")); + + Map typeMap = new HashMap(); + typeMap.put("selectname",selectname); + typeMap.put("selectvalue",selectvalue); + String selectType = signMap.get(selectname); + typeMap.put("selecttype",selectType); + typeList.add(typeMap); + } + + + String where = ""; + if(StringUtils.isNotBlank(startDate)){ + where += " and k.fzrq >= '"+startDate+"' "; + } + + if(StringUtils.isNotBlank(endDate)){ + where += " and k.fzrq <= '"+endDate+"' "; + } + + + int yjjg_total = 0; + int ejjg_total = 0 ; + for(int i=0;i cityMap = cityList.get(i); + String yjjg = "0"; + String ejjg = "0"; + String cityKey = Util.null2String(cityMap.get("key")).replace("City",""); + + + sql = "select zzdj,count(1) as cou\n" + + "from uf_dwjbxx t\n" + + "inner join uf_bmzzzsxx k on k.dwmc = t.id\n" + + "where k.zszt=0\n" + + "and k.zzlx = " + zzlx + + "and t.szcs=" + cityKey + where + + "group by zzdj "; + + rs.executeQuery(sql); + while (rs.next()){ + String zzdj = Util.null2String(rs.getString("zzdj")); + String cou = Util.null2String(rs.getString("cou")); + if("1".equals(zzdj)){ + yjjg = cou; + }else if("2".equals(zzdj)){ + ejjg = cou; + } + } + + if(StringUtils.isNotBlank(yjjg)){ + yjjg_total += Util.getIntValue(yjjg,0); + } + + if(StringUtils.isNotBlank(ejjg)){ + ejjg_total += Util.getIntValue(ejjg,0); + } + + cityMap.put("yjjg",yjjg); + cityMap.put("ejjg",ejjg); + + for(int k=0;k typeMap = typeList.get(k); + String selectvalue = typeMap.get("selectvalue"); + String selecttype = typeMap.get("selecttype"); + int count = 0; + if(StringUtils.isNotBlank(selectvalue)){ + sql = " select k.id \n" + + " from uf_dwjbxx t\n" + + " inner join uf_bmzzzsxx k on k.dwmc = t.id\n" + + " where k.zszt=0 \n" + + " and instr(','||ywzl||',',',"+selectvalue+",')>0 \n" + + " and k.zzlx = " + zzlx + + " and t.szcs="+cityKey + where ; + rs.executeQuery(sql); + while (rs.next()){ + count++; + } + int total = countMap.get(selecttype); + total += count; + countMap.put(selecttype,total); + } + cityMap.put(selecttype,count); + } + } + + for(int i=0;i cityMap = cityList.get(i); + String cityKey = Util.null2String(cityMap.get("key")).replace("City",""); + + List> districtList = new ArrayList>(); + + if(StringUtils.isNotBlank(cityKey)){ + int cityKey_ = Util.getIntValue(cityKey)+1; + sql = "select id,qm,yb from uf_qjsj where sss="+cityKey_; + rs.executeQuery(sql); + while (rs.next()){ + String id = Util.null2String(rs.getString("id")); + String qm = Util.null2String(rs.getString("qm")); + + Map districtMap = new HashMap(); + districtMap.put("key","District"+id); + districtMap.put("title",qm); + districtList.add(districtMap); + } + } + + for(int k=0;k districtMap = districtList.get(k); + String districtKey = Util.null2String(districtMap.get("key")).replace("District",""); + + String dist_yjjg = "0"; + String dist_ejjg = "0"; + sql = "select zzdj,count(1) as cou\n" + + "from uf_dwjbxx t\n" + + "inner join uf_bmzzzsxx k on k.dwmc = t.id\n" + + "where k.zszt=0\n" + + "and k.zzlx = " + zzlx + + "and t.szqx= " + districtKey + where + + "group by zzdj "; + + rs.executeQuery(sql); + while (rs.next()){ + String zzdj = Util.null2String(rs.getString("zzdj")); + String cou = Util.null2String(rs.getString("cou")); + if("1".equals(zzdj)){ + dist_yjjg = cou; + }else if("2".equals(zzdj)){ + dist_ejjg = cou; + } + } + + districtMap.put("yjjg",dist_yjjg); + districtMap.put("ejjg",dist_ejjg); + + for(int n=0;n typeMap = typeList.get(n); + String selectvalue = typeMap.get("selectvalue"); + String selecttype = typeMap.get("selecttype"); + + int count = 0; + + if(StringUtils.isNotBlank(selectvalue)){ + sql = " select k.id \n" + + " from uf_dwjbxx t\n" + + " inner join uf_bmzzzsxx k on k.dwmc = t.id\n" + + " where k.zszt=0 \n" + + " and instr(','||ywzl||',',',"+selectvalue+",')>0 \n" + + " and k.zzlx = " + zzlx + + " and t.szqx= " + districtKey + where ; + + rs.executeQuery(sql); + while (rs.next()){ + count++; + } + } + districtMap.put(selecttype,count); + } + + } + cityMap.put("subList",districtList); + } + + Map totalMap = new HashMap(); + totalMap.put("key","total"); + totalMap.put("title","合计"); + totalMap.put("yjjg",yjjg_total); + totalMap.put("ejjg",ejjg_total); + + cityList.add(totalMap); + + JSONObject dataJson = new JSONObject(); + dataJson.put("data",cityList); + +%> + +<%=dataJson.toJSONString() %> + diff --git a/JSSBMJ/interface/custom/querySecretCerrierTypeReport.jsp b/JSSBMJ/interface/custom/querySecretCerrierTypeReport.jsp new file mode 100644 index 0000000..134bf7e --- /dev/null +++ b/JSSBMJ/interface/custom/querySecretCerrierTypeReport.jsp @@ -0,0 +1,247 @@ +<%@ page import="weaver.conn.RecordSet" %> +<%@ page import="com.alibaba.fastjson.JSONObject" %> +<%@ page import="weaver.general.Util" %> +<%@ page import="org.apache.commons.lang3.StringUtils" %> +<%@ page import="weaver.hrm.HrmUserVarify" %> +<%@ page import="weaver.hrm.User" %> +<%@ page import="java.util.*" %> +<%@ page language="java" contentType="text/html; charset=UTF-8" %> +<% + + User user = HrmUserVarify.getUser(request, response); + if(user==null) { + response.sendRedirect("/login/Login.jsp"); + return; + } + + Map signMap = new HashMap(); + signMap.put("涉密文件资料","smwjzl"); + signMap.put("国家统一考试试卷","gjtykssj"); + signMap.put("涉密防伪票据证书","smfwpjzs"); + signMap.put("涉密光电磁介质","smgdcjz"); + signMap.put("涉密档案数字化加工","smdaszhjg"); + + Map countMap = new HashMap(); + countMap.put("jj_smwjzl",0); + countMap.put("jj_gjtykssj",0); + countMap.put("jj_smfwpjzs",0); + countMap.put("jj_smgdcjz",0); + countMap.put("jj_smdaszhjg",0); + + countMap.put("yj_smwjzl",0); + countMap.put("yj_gjtykssj",0); + countMap.put("yj_smfwpjzs",0); + countMap.put("yj_smgdcjz",0); + countMap.put("yj_smdaszhjg",0); + + + String startDate = request.getParameter("startDate"); + String endDate = request.getParameter("endDate"); + + String zzlx = "1"; + RecordSet rs = new RecordSet(); + List> cityList = new ArrayList>(); + String sql =" select selectvalue,selectname \n" + + " from workflow_selectitem \n" + + " where fieldid in(\n" + + " select id from workflow_billfield \n" + + " where billid in( select id from workflow_bill where tablename='uf_dwjbxx' ) and fieldname='szcs' \n" + + " and detailtable is null\n" + + " ) "; + rs.executeQuery(sql); + while (rs.next()){ + String selectvalue = rs.getString("selectvalue"); + String selectname = rs.getString("selectname"); + Map cityMap = new HashMap(); + cityMap.put("key","City"+selectvalue); + cityMap.put("title",selectname); + cityList.add(cityMap); + } + + + String selectnames = ""; + Iterator> iterator = signMap.entrySet().iterator(); + while (iterator.hasNext()){ + Map.Entry entry = iterator.next(); + String key = entry.getKey(); + selectnames += StringUtils.isBlank(selectnames) ? "'" + key + "'" : ",'" + key + "'"; + } + + List> typeList = new ArrayList>(); + sql = " select selectvalue,selectname \n" + + " from workflow_selectitem\n" + + " where fieldid in(\n" + + " select id from workflow_billfield \n" + + " where billid in( select id from workflow_bill where tablename='uf_bmzzzsxx' ) and fieldname='ywzl' \n" + + " and detailtable is null\n" + + " ) \n" + + " AND selectname in("+selectnames+")" ; + + rs.executeQuery(sql); + while (rs.next()){ + String selectvalue = Util.null2String(rs.getString("selectvalue")); + String selectname = Util.null2String(rs.getString("selectname")); + + Map typeMap = new HashMap(); + typeMap.put("selectname",selectname); + typeMap.put("selectvalue",selectvalue); + String selectType = signMap.get(selectname); + typeMap.put("selecttype",selectType); + typeList.add(typeMap); + } + + List> djList = new ArrayList>(); + sql = " select selectvalue,selectname \n" + + " from workflow_selectitem\n" + + " where fieldid in(\n" + + " select id from workflow_billfield \n" + + " where billid in( select id from workflow_bill where tablename='uf_bmzzzsxx' ) \n" + + " and fieldname='zzdj' \n" + + " and detailtable is null\n" + + " ) \n" + + " and selectname in('甲级','乙级') "; + rs.executeQuery(sql); + while (rs.next()){ + String selectvalue = Util.null2String(rs.getString("selectvalue")); + String selectname = Util.null2String(rs.getString("selectname")); + + Map djMap = new HashMap(); + djMap.put("selectvalue",selectvalue); + djMap.put("selectname",selectname); + String type = ""; + if("甲级".equals(selectname)){ + type = "jj"; + }else if("乙级".equals(selectname)){ + type = "yj"; + } + + djMap.put("rowtype",type); + djList.add(djMap); + } + + String where = ""; + if(StringUtils.isNotBlank(startDate)){ + where += " and k.fzrq >= '"+startDate+"' "; + } + + if(StringUtils.isNotBlank(endDate)){ + where += " and k.fzrq <= '"+endDate+"' "; + } + + + for(int i=0;i cityMap = cityList.get(i); + + String cityKey = Util.null2String(cityMap.get("key")).replace("City",""); + + for(int p=0;p djMap = djList.get(p); + String rowtype = djMap.get("rowtype"); + String djvalue = djMap.get("selectvalue"); + + for(int k=0;k typeMap = typeList.get(k); + String selectvalue = typeMap.get("selectvalue"); + String selecttype = typeMap.get("selecttype"); + int count = 0; + if(StringUtils.isNotBlank(selectvalue)){ + + sql = " select k.id \n" + + " from uf_dwjbxx t\n" + + " inner join uf_bmzzzsxx k on k.dwmc = t.id\n" + + " where k.zszt=0" + + " and k.zzdj = " + djvalue + + " and instr(','||k.ywzl||',',',"+selectvalue+",')>0 \n" + + " and k.zzlx = " + zzlx + + " and t.szcs="+cityKey + where ; + + rs.executeQuery(sql); + while (rs.next()){ + count++; + } + int total = countMap.get(rowtype+"_"+selecttype); + total += count; + countMap.put(selecttype,total); + } + cityMap.put(rowtype+"_"+selecttype,count); + } + } + } + + for(int i=0;i cityMap = cityList.get(i); + String cityKey = Util.null2String(cityMap.get("key")).replace("City",""); + + List> districtList = new ArrayList>(); + + if(StringUtils.isNotBlank(cityKey)){ + int cityKey_ = Util.getIntValue(cityKey)+1; + sql = "select id,qm,yb from uf_qjsj where sss="+cityKey_; + rs.executeQuery(sql); + while (rs.next()){ + String id = Util.null2String(rs.getString("id")); + String qm = Util.null2String(rs.getString("qm")); + + Map districtMap = new HashMap(); + districtMap.put("key","District"+id); + districtMap.put("title",qm); + districtList.add(districtMap); + } + } + + + for(int k=0;k districtMap = districtList.get(k); + String districtKey = Util.null2String(districtMap.get("key")).replace("District",""); + + for(int p=0;p djMap = djList.get(p); + String rowtype = djMap.get("rowtype"); + String djvalue = djMap.get("selectvalue"); + + + for(int n=0;n typeMap = typeList.get(n); + String selectvalue = typeMap.get("selectvalue"); + String selecttype = typeMap.get("selecttype"); + + int count = 0; + + if(StringUtils.isNotBlank(selectvalue)){ + sql = " select k.id \n" + + " from uf_dwjbxx t\n" + + " inner join uf_bmzzzsxx k on k.dwmc = t.id\n" + + " where k.zszt=0 \n" + + " and k.zzdj = " + djvalue + + " and instr(','||k.ywzl||',',',"+selectvalue+",')>0 \n" + + " and k.zzlx = " + zzlx + + " and t.szqx= " + districtKey + where ; + + rs.executeQuery(sql); + while (rs.next()){ + count++; + } + } + districtMap.put(rowtype+"_"+selecttype,count); + } + } + } + + cityMap.put("subList",districtList); + } + + Map totalMap = new HashMap(); + totalMap.put("key","total"); + totalMap.put("title","合计"); + + cityList.add(totalMap); + + JSONObject dataJson = new JSONObject(); + dataJson.put("data",cityList); + +%> + +<%=dataJson.toJSONString() %> + diff --git a/JSSBMJ/interface/custom/queryShareHolderData.jsp b/JSSBMJ/interface/custom/queryShareHolderData.jsp new file mode 100644 index 0000000..4a94a70 --- /dev/null +++ b/JSSBMJ/interface/custom/queryShareHolderData.jsp @@ -0,0 +1,59 @@ +<%@ page import="java.util.Map" %> +<%@ page import="weaver.conn.RecordSet" %> +<%@ page import="java.util.HashMap" %> +<%@ page import="java.util.List" %> +<%@ page import="java.util.ArrayList" %> +<%@ page import="com.alibaba.fastjson.JSONObject" %> +<%@ page import="org.apache.commons.lang3.StringUtils" %> +<%@ page language="java" contentType="text/html; charset=UTF-8" %> +<% + + String sqdw = request.getParameter("sqdw"); + List> list = new ArrayList>(); + RecordSet rs = new RecordSet(); + if(StringUtils.isNotBlank(sqdw)){ + + + String sql =" select id,'' as parentid,gdmc as name,'' as cgbl,'' as gdlx from \n" + + " uf_gd\n" + + " where id = '" + sqdw + "'"+ + " union \n" + + " select p.id,sqdw as parentid,p.gdmc as name,t.cgbl,k.selectname as gdlx\n" + + " from uf_gdxx t\n" + + " inner join uf_gd p on p.id = t.cggd\n" + + " left join (\n" + + " select selectvalue,selectname \n" + + " from workflow_selectitem \n" + + " where fieldid in(\n" + + " select id from workflow_billfield \n" + + " where billid in( select id from workflow_bill where tablename='uf_gd' ) and fieldname='gdlx' \n" + + " and detailtable is null\n" + + " ) \n" + + " ) k on k.selectvalue = p.gdlx\n" + + " where sqdw = '"+sqdw+"'" ; + + rs.executeQuery(sql); + while (rs.next()){ + String parentid = rs.getString("parentid"); + String id = rs.getString("id"); + String name = rs.getString("name"); + String cgbl = rs.getString("cgbl"); + String gdlx = rs.getString("gdlx"); + + Map map = new HashMap(); + map.put("id",id); + map.put("parentid",parentid); + map.put("name",name); + map.put("cgbl",cgbl); + map.put("gdlx",gdlx); + list.add(map); + } + } + + JSONObject dataJson = new JSONObject(); + dataJson.put("data",list); + +%> + +<%=dataJson.toJSONString() %> + diff --git a/JSSBMJ/interface/custom/queryShareHolderData2.jsp b/JSSBMJ/interface/custom/queryShareHolderData2.jsp new file mode 100644 index 0000000..8906773 --- /dev/null +++ b/JSSBMJ/interface/custom/queryShareHolderData2.jsp @@ -0,0 +1,230 @@ +<%@ page import="java.util.Map" %> +<%@ page import="weaver.conn.RecordSet" %> +<%@ page import="java.util.HashMap" %> +<%@ page import="java.util.List" %> +<%@ page import="java.util.ArrayList" %> +<%@ page import="com.alibaba.fastjson.JSONObject" %> +<%@ page import="org.apache.commons.lang3.StringUtils" %> +<%@ page import="weaver.general.Util" %> +<%@ page language="java" contentType="text/html; charset=UTF-8" %> +<% + + String dwxx = request.getParameter("sqdw"); + String gd = request.getParameter("gd"); + List> datalist = new ArrayList>(); + List> parentList =new ArrayList>(); + RecordSet rs = new RecordSet(); + if(StringUtils.isNotBlank(dwxx)){ + + String sqdw = ""; + String sql = " select id from uf_gd where dwxx='"+dwxx+"' "; + rs.executeQuery(sql); + if(rs.next()){ + sqdw = Util.null2String(rs.getString("id")); + } + + if(StringUtils.isNotBlank(sqdw)){ + + sql =" select t.id,t.sqdw as parentid,p.gdmc as name,t.cgbl,k.selectname as gdlx\n" + + " from uf_gdxx t\n" + + " inner join uf_gd p on p.id = t.cggdx\n" + + " left join (\n" + + " select selectvalue,selectname \n" + + " from workflow_selectitem \n" + + " where fieldid in(\n" + + " select id from workflow_billfield \n" + + " where billid in( select id from workflow_bill where tablename='uf_gd' ) and fieldname='gdlx' \n" + + " and detailtable is null\n" + + " ) \n" + + " ) k on k.selectvalue = p.gdlx\n" + + " where t.sqdw ='"+sqdw+"'" ; + + rs.executeQuery(sql); + while (rs.next()){ + String id = rs.getString("id"); + String name = rs.getString("name"); + String cgbl = rs.getString("cgbl"); + String gdlx = rs.getString("gdlx"); + + Map map = new HashMap(); + map.put("id",id); + map.put("parentid","T"+sqdw); + map.put("name",name); + map.put("cgbl",cgbl+"%"); + map.put("gdlx",gdlx); + datalist.add(map); + parentList.add(map); + + } + + if(datalist.size()>0){ + queryShareHolder(datalist,parentList); + } + + sql =" select id,'' as parentid,gdmc as name,'' as cgbl,'' as gdlx from \n" + + " uf_gd\n" + + " where id = '" + sqdw + "'"; + rs.executeQuery(sql); + while (rs.next()){ + String id = rs.getString("id"); + String name = rs.getString("name"); + String cgbl = rs.getString("cgbl"); + String gdlx = rs.getString("gdlx"); + + Map map = new HashMap(); + map.put("id","T"+id); + map.put("parentid",""); + map.put("name",name); + map.put("cgbl",cgbl+"%"); + map.put("gdlx",gdlx); + datalist.add(map); + } + } + + }else if(StringUtils.isNotBlank(gd)){ + + String sqdw = ""; + String sql = " select id from uf_gd where id='"+gd+"' "; + rs.executeQuery(sql); + if(rs.next()){ + sqdw = Util.null2String(rs.getString("id")); + } + + if(StringUtils.isNotBlank(sqdw)){ + + sql =" select t.id,t.sqdw as parentid,p.gdmc as name,t.cgbl,k.selectname as gdlx\n" + + " from uf_gdxx t\n" + + " inner join uf_gd p on p.id = t.cggdx\n" + + " left join (\n" + + " select selectvalue,selectname \n" + + " from workflow_selectitem \n" + + " where fieldid in(\n" + + " select id from workflow_billfield \n" + + " where billid in( select id from workflow_bill where tablename='uf_gd' ) and fieldname='gdlx' \n" + + " and detailtable is null\n" + + " ) \n" + + " ) k on k.selectvalue = p.gdlx\n" + + " where t.sqdw ='"+sqdw+"'" ; + + rs.executeQuery(sql); + while (rs.next()){ + String id = rs.getString("id"); + String name = rs.getString("name"); + String cgbl = rs.getString("cgbl"); + String gdlx = rs.getString("gdlx"); + + Map map = new HashMap(); + map.put("id",id); + map.put("parentid","T"+sqdw); + map.put("name",name); + map.put("cgbl",cgbl+"%"); + map.put("gdlx",gdlx); + datalist.add(map); + parentList.add(map); + + } + + if(datalist.size()>0){ + queryShareHolder(datalist,parentList); + } + + sql =" select id,'' as parentid,gdmc as name,'' as cgbl,'' as gdlx from \n" + + " uf_gd\n" + + " where id = '" + sqdw + "'"; + rs.executeQuery(sql); + while (rs.next()){ + String id = rs.getString("id"); + String name = rs.getString("name"); + String cgbl = rs.getString("cgbl"); + String gdlx = rs.getString("gdlx"); + + Map map = new HashMap(); + map.put("id","T"+id); + map.put("parentid",""); + map.put("name",name); + map.put("cgbl",cgbl+"%"); + map.put("gdlx",gdlx); + datalist.add(map); + } + } + + } + + +// for(int i=0;i> holderList = queryShareHolderByParent(dataId); +// if(holderList.size()>0){ +// list.addAll(holderList); +// } +// } + + JSONObject dataJson = new JSONObject(); + dataJson.put("data",datalist); + dataJson.put("jncgbl","83.5%"); + dataJson.put("jwcgbl","22.5%"); + +%> + +<%=dataJson.toJSONString() %> + + +<%! + public List> queryShareHolderByParent(String parentId){ + List> list = new ArrayList>(); + RecordSet rs = new RecordSet(); + if(StringUtils.isNotBlank(parentId)){ + + String sql =" select t.id,t.sqdw as parentid,p.gdmc as name,t.cgbl,k.selectname as gdlx\n" + + " from uf_gdxx t\n" + + " inner join uf_gd p on p.id = t.cggdx\n" + + " left join (\n" + + " select selectvalue,selectname \n" + + " from workflow_selectitem \n" + + " where fieldid in(\n" + + " select id from workflow_billfield \n" + + " where billid in( select id from workflow_bill where tablename='uf_gd' ) and fieldname='gdlx' \n" + + " and detailtable is null\n" + + " ) \n" + + " ) k on k.selectvalue = p.gdlx\n" + + " where t.sqdw in ( select cggdx from uf_gdxx where id = '"+parentId+"' ) " ; + + rs.executeQuery(sql); + while (rs.next()){ + String id = rs.getString("id"); + String name = rs.getString("name"); + String cgbl = rs.getString("cgbl"); + String gdlx = rs.getString("gdlx"); + + Map map = new HashMap(); + map.put("id",id); + map.put("parentid",parentId); + map.put("name",name); + map.put("cgbl",cgbl+"%"); + map.put("gdlx",gdlx); + list.add(map); + } + } + return list; + } + + + public List> queryShareHolder(List> datalist,List> parentList){ + + for(int i=0;i parentMap = parentList.get(i); + String parentId = parentMap.get("id"); + if(StringUtils.isNotBlank(parentId)){ + List> holderList = queryShareHolderByParent(parentId); + if(holderList.size()>0){ + datalist.addAll(holderList); + queryShareHolder(datalist,holderList); + } + } + } + return datalist; + } + +%> + diff --git a/JSSBMJ/interface/custom/queryShareHolderData2bak.jsp b/JSSBMJ/interface/custom/queryShareHolderData2bak.jsp new file mode 100644 index 0000000..b636fd8 --- /dev/null +++ b/JSSBMJ/interface/custom/queryShareHolderData2bak.jsp @@ -0,0 +1,152 @@ +<%@ page import="java.util.Map" %> +<%@ page import="weaver.conn.RecordSet" %> +<%@ page import="java.util.HashMap" %> +<%@ page import="java.util.List" %> +<%@ page import="java.util.ArrayList" %> +<%@ page import="com.alibaba.fastjson.JSONObject" %> +<%@ page import="org.apache.commons.lang3.StringUtils" %> +<%@ page language="java" contentType="text/html; charset=UTF-8" %> +<% + + String sqdw = request.getParameter("sqdw"); + List> datalist = new ArrayList>(); + List> parentList =new ArrayList>(); + RecordSet rs = new RecordSet(); + if(StringUtils.isNotBlank(sqdw)){ + + + String sql =" select t.id,t.sqdw as parentid,p.gdmc as name,t.cgbl,k.selectname as gdlx\n" + + " from uf_gdxx t\n" + + " inner join uf_gd p on p.id = t.cggdx\n" + + " left join (\n" + + " select selectvalue,selectname \n" + + " from workflow_selectitem \n" + + " where fieldid in(\n" + + " select id from workflow_billfield \n" + + " where billid in( select id from workflow_bill where tablename='uf_gd' ) and fieldname='gdlx' \n" + + " and detailtable is null\n" + + " ) \n" + + " ) k on k.selectvalue = p.gdlx\n" + + " where t.sqdw = '"+sqdw+"'" ; + + rs.executeQuery(sql); + while (rs.next()){ + String id = rs.getString("id"); + String name = rs.getString("name"); + String cgbl = rs.getString("cgbl"); + String gdlx = rs.getString("gdlx"); + + Map map = new HashMap(); + map.put("id",id); + map.put("parentid","T"+sqdw); + map.put("name",name); + map.put("cgbl",cgbl); + map.put("gdlx",gdlx); + datalist.add(map); + parentList.add(map); + + } + + if(datalist.size()>0){ + queryShareHolder(datalist,parentList); + } + + sql =" select id,'' as parentid,gdmc as name,'' as cgbl,'' as gdlx from \n" + + " uf_gd\n" + + " where id = '" + sqdw + "'"; + rs.executeQuery(sql); + while (rs.next()){ + String id = rs.getString("id"); + String name = rs.getString("name"); + String cgbl = rs.getString("cgbl"); + String gdlx = rs.getString("gdlx"); + + Map map = new HashMap(); + map.put("id","T"+id); + map.put("parentid",""); + map.put("name",name); + map.put("cgbl",cgbl); + map.put("gdlx",gdlx); + datalist.add(map); + + } + } + + + + +// for(int i=0;i> holderList = queryShareHolderByParent(dataId); +// if(holderList.size()>0){ +// list.addAll(holderList); +// } +// } + + JSONObject dataJson = new JSONObject(); + dataJson.put("data",datalist); + +%> + +<%=dataJson.toJSONString() %> + + +<%! + public List> queryShareHolderByParent(String parentId){ + List> list = new ArrayList>(); + RecordSet rs = new RecordSet(); + if(StringUtils.isNotBlank(parentId)){ + + String sql =" select t.id,t.sqdw as parentid,p.gdmc as name,t.cgbl,k.selectname as gdlx\n" + + " from uf_gdxx t\n" + + " inner join uf_gd p on p.id = t.cggdx\n" + + " left join (\n" + + " select selectvalue,selectname \n" + + " from workflow_selectitem \n" + + " where fieldid in(\n" + + " select id from workflow_billfield \n" + + " where billid in( select id from workflow_bill where tablename='uf_gd' ) and fieldname='gdlx' \n" + + " and detailtable is null\n" + + " ) \n" + + " ) k on k.selectvalue = p.gdlx\n" + + " where t.sqdw in ( select cggdx from uf_gdxx where id = '"+parentId+"' ) " ; + + rs.executeQuery(sql); + while (rs.next()){ + String id = rs.getString("id"); + String name = rs.getString("name"); + String cgbl = rs.getString("cgbl"); + String gdlx = rs.getString("gdlx"); + + Map map = new HashMap(); + map.put("id",id); + map.put("parentid",parentId); + map.put("name",name); + map.put("cgbl",cgbl); + map.put("gdlx",gdlx); + list.add(map); + } + } + return list; + } + + + public List> queryShareHolder(List> datalist,List> parentList){ + + for(int i=0;i parentMap = parentList.get(i); + String parentId = parentMap.get("id"); + if(StringUtils.isNotBlank(parentId)){ + List> holderList = queryShareHolderByParent(parentId); + if(holderList.size()>0){ + datalist.addAll(holderList); + queryShareHolder(datalist,holderList); + } + } + } + return datalist; + } + +%> + diff --git a/JSSBMJ/interface/custom/queryShareHolderSummary.jsp b/JSSBMJ/interface/custom/queryShareHolderSummary.jsp new file mode 100644 index 0000000..261e570 --- /dev/null +++ b/JSSBMJ/interface/custom/queryShareHolderSummary.jsp @@ -0,0 +1,386 @@ +<%@ page import="java.util.Map" %> +<%@ page import="weaver.conn.RecordSet" %> +<%@ page import="java.util.HashMap" %> +<%@ page import="java.util.List" %> +<%@ page import="java.util.ArrayList" %> +<%@ page import="com.alibaba.fastjson.JSONObject" %> +<%@ page import="org.apache.commons.lang3.StringUtils" %> +<%@ page import="weaver.general.Util" %> +<%@ page import="weaver.interfaces.domain.TreeNode" %> +<%@ page import="java.math.BigDecimal" %> +<%@ page import="weaver.general.BaseBean" %> +<%@ page language="java" contentType="text/html; charset=UTF-8" %> +<% + + String dwxx = request.getParameter("sqdw"); + String gd = request.getParameter("gd"); + + Map dataMap = new HashMap(); + RecordSet rs = new RecordSet(); + if(StringUtils.isNotBlank(dwxx)){ + + + String sqdw = ""; + String sql = " select id from uf_gd where dwxx='"+dwxx+"' "; + rs.executeQuery(sql); + if(rs.next()){ + sqdw = Util.null2String(rs.getString("id")); + } + + TreeNode root = new TreeNode("T"+sqdw); + getChildrenDataByRoot(root,sqdw); + + dataMap = recurTree(root); + dataMap.put("id","T"+sqdw); + dataMap.put("parentid",""); + + + + }else if(StringUtils.isNotBlank(gd)){ + TreeNode root = new TreeNode(); + + String sql =" select id from uf_gd where id = '" + gd + "'"; + + rs.executeQuery(sql); + if (rs.next()){ + String id = rs.getString("id"); + root = new TreeNode("T"+id); + getChildrenDataByRoot(root,gd); + } + dataMap = recurTree(root); + dataMap.put("id","T"+gd); + dataMap.put("parentid",""); + + } + + JSONObject dataJson = new JSONObject(); + List> list = new ArrayList>(); + list.add(dataMap); + dataJson.put("data",list); + +%> + +<%=dataJson.toJSONString() %> + + +<%! + + + public void getChildrenDataByRoot(TreeNode root,String sqdw){ + RecordSet rs = new RecordSet(); + BaseBean bb = new BaseBean(); + List treeNodeList = new ArrayList(); + bb.writeLog("getChildrenDataByRoot"); + + List treeList = new ArrayList(); + String sql =" select t.id,t.sqdw as parentid,p.gdmc as name,t.cgbl,k.selectname as gdlx\n" + + " from uf_gdxx t\n" + + " inner join uf_gd p on p.id = t.cggdx\n" + + " left join (\n" + + " select selectvalue,selectname \n" + + " from workflow_selectitem \n" + + " where fieldid in(\n" + + " select id from workflow_billfield \n" + + " where billid in( select id from workflow_bill where tablename='uf_gd' ) and fieldname='gdlx' \n" + + " and detailtable is null\n" + + " ) \n" + + " ) k on k.selectvalue = p.gdlx\n" + + " where t.sqdw ='"+sqdw+"'" ; + bb.writeLog("sql:"+sql); + rs.executeQuery(sql); + while (rs.next()){ + String id = rs.getString("id"); + treeList.add(id); + } + + for(int i=0;i childNodeList = queryShareHolderByParent2(id); + if(childNodeList.size() > 0){ + treeNode.setChildren(childNodeList); + } + treeNodeList.add(treeNode); + } + } + root.setChildren(treeNodeList); + } + + + public List queryShareHolderByParent2(String parentId){ + List treeNodesList = new ArrayList(); + RecordSet rs = new RecordSet(); + if(StringUtils.isNotBlank(parentId)){ + + String sql =" select t.id,t.sqdw as parentid,p.gdmc as name,t.cgbl,k.selectname as gdlx\n" + + " from uf_gdxx t\n" + + " inner join uf_gd p on p.id = t.cggdx\n" + + " left join (\n" + + " select selectvalue,selectname \n" + + " from workflow_selectitem \n" + + " where fieldid in(\n" + + " select id from workflow_billfield \n" + + " where billid in( select id from workflow_bill where tablename='uf_gd' ) and fieldname='gdlx' \n" + + " and detailtable is null\n" + + " ) \n" + + " ) k on k.selectvalue = p.gdlx\n" + + " where t.sqdw in ( select cggdx from uf_gdxx where id = '"+parentId+"' ) " ; + rs.executeQuery(sql); + while (rs.next()){ + String id = rs.getString("id"); + if(StringUtils.isNotBlank(id)){ + TreeNode treeNode = new TreeNode(); + treeNode.setValue(id); + List childList = queryShareHolderByParent2(id); + if(childList.size()>0){ + treeNode.setChildren(childList); + } + treeNodesList.add(treeNode); + } + } + } + return treeNodesList; + } + + public Map recurTree(TreeNode root){ + + RecordSet rs = new RecordSet(); + BaseBean bb = new BaseBean(); + bb.writeLog("recurTree"); + + Map dataMap = new HashMap(); + List> result = new ArrayList<>(); + List path = new ArrayList<>(); + + path.add(root.getValue()); + findPath(result,root,path); + + String return_jn_msg = ""; + String return_jw_msg = ""; + double jn_value = 0.0; + double jw_value = 0.0; + + for(int i=0;i treeList = result.get(i); + double jwcgbl = 0.0; + double jncgbl = 0.0; + String jn_msg = ""; + String jw_msg = ""; + + if(treeList.size() == 2){ + String gdid = treeList.get(1); + if(StringUtils.isNotBlank(gdid) && !gdid.startsWith("T")){ + String lx =""; + String cgbl = ""; + String gdmc = ""; + String sql =" select t.cgbl,k.lx,k.gdmc \n" + + " from uf_gdxx t\n" + + " inner join uf_gd k on k.id = t.cggdx\n" + + " where t.id= "+gdid ; + + bb.writeLog("sql:"+sql); + + rs.executeQuery(sql); + if(rs.next()){ + lx = Util.null2String(rs.getString("lx")); + cgbl = Util.null2String(rs.getString("cgbl")); + gdmc = Util.null2String(rs.getString("gdmc")); + } + + if(StringUtils.isNotBlank(cgbl)){ + if("1".equals(lx)){ + double dou_cgbl = Double.parseDouble(cgbl); + dou_cgbl = new BigDecimal(dou_cgbl).setScale(4,BigDecimal.ROUND_HALF_UP).doubleValue(); + + jwcgbl = dou_cgbl; + + jw_msg = gdmc+"["+jwcgbl+"%]"; + + jw_value += jwcgbl; + }else{ + double dou_cgbl = Double.parseDouble(cgbl); + dou_cgbl = new BigDecimal(dou_cgbl).setScale(4,BigDecimal.ROUND_HALF_UP).doubleValue(); + jncgbl = dou_cgbl; + + jn_msg = gdmc+"["+jncgbl+"%]"; + + jn_value += jncgbl; + } + } + } + }else{ + String gdmcx = ""; + for(int k=treeList.size()-1;k>=0;k--){ + + if(k==treeList.size()-1){ + + String gdid = treeList.get(k); + if(StringUtils.isNotBlank(gdid) && !gdid.startsWith("T")){ + String lx =""; + String cgbl = ""; + String sql =" select t.cgbl,k.lx,k.gdmc \n" + + " from uf_gdxx t\n" + + " inner join uf_gd k on k.id = t.cggdx\n" + + " where t.id= "+gdid ; + bb.writeLog("sql:"+sql); + rs.executeQuery(sql); + if(rs.next()){ + lx = Util.null2String(rs.getString("lx")); + cgbl = Util.null2String(rs.getString("cgbl")); + gdmcx = Util.null2String(rs.getString("gdmc")); + } + + if(StringUtils.isNotBlank(cgbl)){ + if("1".equals(lx)){ + double dou_cgbl = Double.parseDouble(cgbl); + dou_cgbl = new BigDecimal(dou_cgbl).setScale(4,BigDecimal.ROUND_HALF_UP).doubleValue(); + jwcgbl = dou_cgbl; + }else{ + double dou_cgbl = Double.parseDouble(cgbl); + dou_cgbl = new BigDecimal(dou_cgbl).setScale(4,BigDecimal.ROUND_HALF_UP).doubleValue(); + jncgbl = dou_cgbl; + } + } + } + }else if( k == 1){ + + String gdid = treeList.get(k); + if(StringUtils.isNotBlank(gdid) && !gdid.startsWith("T")) { + String lx =""; + String cgbl = ""; + String sql =" select t.cgbl,k.lx,k.gdmc \n" + + " from uf_gdxx t\n" + + " inner join uf_gd k on k.id = t.cggdx\n" + + " where t.id= "+gdid ; + bb.writeLog("sql:"+sql); + rs.executeQuery(sql); + if(rs.next()){ + lx = Util.null2String(rs.getString("lx")); + cgbl = Util.null2String(rs.getString("cgbl")); + } + + if (StringUtils.isNotBlank(cgbl)) { + if("1".equals(lx)){ + double dou_cgbl = Double.parseDouble(cgbl); + dou_cgbl = new BigDecimal(dou_cgbl).setScale(4,BigDecimal.ROUND_HALF_UP).doubleValue(); + jwcgbl = dou_cgbl; + jn_msg += gdmcx+"["+jwcgbl+"%]"; + + jw_value += jwcgbl ; + + }else{ + double dou_cgbl = Double.parseDouble(cgbl); + if(jncgbl > 0){ + jncgbl = (jncgbl * dou_cgbl)/100.00; + jncgbl = new BigDecimal(jncgbl).setScale(4,BigDecimal.ROUND_HALF_UP).doubleValue(); + jn_msg = gdmcx+"["+jncgbl+"%]"; + + jn_value += jncgbl ; + + } + + if(jwcgbl > 0){ + jwcgbl = (jwcgbl * dou_cgbl)/100.00; + jwcgbl = new BigDecimal(jwcgbl).setScale(4,BigDecimal.ROUND_HALF_UP).doubleValue(); + jw_msg = gdmcx+"["+jwcgbl+"%]"; + + jw_value += jwcgbl ; + } + } + } + } + }else if(k !=0 ){ + String gdid = treeList.get(k); + if(StringUtils.isNotBlank(gdid) && !gdid.startsWith("T")) { + String lx =""; + String cgbl = ""; + String sql =" select t.cgbl,k.lx,k.gdmc \n" + + " from uf_gdxx t\n" + + " inner join uf_gd k on k.id = t.cggdx\n" + + " where t.id= "+gdid ; + rs.executeQuery(sql); + if(rs.next()){ + lx = Util.null2String(rs.getString("lx")); + cgbl = Util.null2String(rs.getString("cgbl")); + } + + if (StringUtils.isNotBlank(cgbl)) { + if("1".equals(lx)){ + double dou_cgbl = Double.parseDouble(cgbl); + dou_cgbl = new BigDecimal(dou_cgbl).setScale(4,BigDecimal.ROUND_HALF_UP).doubleValue(); + jwcgbl = dou_cgbl; + jn_msg += gdmcx+"["+jwcgbl+"%]"; + + jw_value += jwcgbl ; + + }else{ + double dou_cgbl = Double.parseDouble(cgbl); + if(jncgbl > 0){ + jncgbl = (jncgbl * dou_cgbl)/100.00; + jncgbl = new BigDecimal(jncgbl).setScale(4,BigDecimal.ROUND_HALF_UP).doubleValue(); + jn_msg = gdmcx+"["+jncgbl+"%]"; + + jn_value += jncgbl ; + } + + if(jwcgbl > 0){ + jwcgbl = (jwcgbl * dou_cgbl)/100.00; + jwcgbl = new BigDecimal(jwcgbl).setScale(4,BigDecimal.ROUND_HALF_UP).doubleValue(); + jw_msg = gdmcx+"["+jwcgbl+"%]"; + + jw_value += jwcgbl ; + } + } + } + } + } + } + } + + bb.writeLog("jwcgbl:"+jwcgbl); + bb.writeLog("jncgbl:"+jncgbl); + bb.writeLog("jn_msg:"+jn_msg); + bb.writeLog("jw_msg:"+jw_msg); + + if(StringUtils.isNotBlank(jn_msg)){ + return_jn_msg += StringUtils.isBlank(return_jn_msg) ? jn_msg : ","+jn_msg ; + } + + if(StringUtils.isNotBlank(jw_msg)){ + return_jw_msg += StringUtils.isBlank(return_jw_msg) ? jw_msg : ","+jw_msg ; + } + } + + dataMap.put("jn_msg",return_jn_msg); + dataMap.put("jw_msg",return_jw_msg); + dataMap.put("jn_value",jn_value); + dataMap.put("jw_value",jw_value); + +// System.out.println("return_jn_msg:"+return_jn_msg); +// System.out.println("return_jw_msg:"+return_jw_msg); +// System.out.println("jn_value:"+jn_value); +// System.out.println("jw_value:"+jw_value); + + return dataMap; + } + + public void findPath(List> result,TreeNode node,List path){ + if(node.getChildren() == null || node.getChildren().size() <=0){ + result.add(path); + return; + } + + for(int i=0;i cPath = new ArrayList<>(); + cPath.addAll(path); + cPath.add(child.getValue()); + findPath(result,child,cPath); + } + } + +%> + diff --git a/JSSBMJ/interface/custom/queryShareHolderSummary3.jsp b/JSSBMJ/interface/custom/queryShareHolderSummary3.jsp new file mode 100644 index 0000000..a249375 --- /dev/null +++ b/JSSBMJ/interface/custom/queryShareHolderSummary3.jsp @@ -0,0 +1,409 @@ +<%@ page import="weaver.conn.RecordSet" %> +<%@ page import="com.alibaba.fastjson.JSONObject" %> +<%@ page import="org.apache.commons.lang3.StringUtils" %> +<%@ page import="weaver.general.Util" %> +<%@ page import="weaver.interfaces.domain.TreeNode" %> +<%@ page import="java.math.BigDecimal" %> +<%@ page import="java.util.*" %> +<%@ page language="java" contentType="text/html; charset=UTF-8" %> +<% + + String dwxx = request.getParameter("sqdw"); + String gd = request.getParameter("gd"); + + List> list = new ArrayList>(); + + RecordSet rs = new RecordSet(); + + List nodeList = new ArrayList(); + + if(StringUtils.isNotBlank(dwxx)){ + String sqdw = ""; + String sql = " select id from uf_gd where dwxx='"+dwxx+"' "; + rs.executeQuery(sql); + if(rs.next()){ + sqdw = Util.null2String(rs.getString("id")); + } + if(StringUtils.isNotBlank(sqdw)){ + TreeNode root = new TreeNode("T"+sqdw); + getChildrenByRoot(root,sqdw,nodeList); + Map dataMap = recurTree(root); + dataMap.put("id","T"+sqdw); + list.add(dataMap); + } + + if(nodeList.size()>0){ + for(int i=0;i nodeMap = getRootDataByNode(cggdx); + nodeMap.put("id",gdxxId); + list.add(nodeMap); + } + } + } + } + } + }else if(StringUtils.isNotBlank(gd)){ + String sql =" select id from uf_gd where id = '" + gd + "'"; + String gdid = ""; + rs.executeQuery(sql); + if (rs.next()) { + gdid = rs.getString("id"); + } + + if(StringUtils.isNotBlank(gdid)){ + TreeNode root = new TreeNode("T"+gdid); + getChildrenByRoot(root,gd,nodeList); + Map dataMap = recurTree(root); + dataMap.put("id","T"+gd); + list.add(dataMap); + } + + if(nodeList.size()>0){ + for(int i=0;i nodeMap = getRootDataByNode(cggdx); + nodeMap.put("id",gdxxId); + list.add(nodeMap); + } + } + } + } + } + } + + JSONObject dataJson = new JSONObject(); + dataJson.put("data",list); + +%> + +<%=dataJson.toJSONString() %> + + +<%! + + +// public void getRootData(String sqdw){ +// RecordSet rs = new RecordSet(); +// String gdid = ""; +// String sql =" select id from uf_gd where id = '" + sqdw + "'"; +// rs.executeQuery(sql); +// if (rs.next()) { +// gdid = rs.getString("id"); +// } +// if(StringUtils.isNotBlank(gdid)){ +// TreeNode root = new TreeNode("T"+gdid); +// List nodeList = new ArrayList(); +// getChildrenByRoot(root,gdid,nodeList); +// System.out.println("nodeList:"+nodeList.toString()); +// recurTree(root); +// if(nodeList.size()>0){ +// for(int i=0;i nodeMap = getRootDataByNode(cggdx); +// } +// } +// } +// } +// +// } +// } + + + public Map getRootDataByNode(String sqdw){ + RecordSet rs = new RecordSet(); + Map nodeMap = new HashMap(); + String gdid = ""; + String sql =" select id from uf_gd where id = '" + sqdw + "'"; + rs.executeQuery(sql); + if (rs.next()) { + gdid = rs.getString("id"); + } + if(StringUtils.isNotBlank(gdid)){ + TreeNode root = new TreeNode("T"+gdid); + List nodeList = new ArrayList(); + getChildrenByRoot(root,gdid,nodeList); + System.out.println("nodeList:"+nodeList.toString()); + nodeMap = recurTree(root); + } + + return nodeMap; + } + + + + public void getChildrenByRoot(TreeNode root,String sqdw,List nodeList){ + RecordSet rs = new RecordSet(); + List treeNodeList = new ArrayList(); + + List treeList = new ArrayList(); + String sql =" select t.id\n" + + " from uf_gdxx t\n" + + " inner join uf_gd p on p.id = t.cggdx\n" + + " where t.sqdw ='"+sqdw+"'" ; + System.out.println("getChildrenByRoot:sql:"+sql); + rs.executeQuery(sql); + while (rs.next()){ + String gdxxid = rs.getString("id"); + treeList.add(gdxxid); + } + + for(int i=0;i childNodeList = queryChildrenByGdxxId(gdxxid,nodeList); + if(childNodeList.size() > 0){ + treeNode.setChildren(childNodeList); + nodeList.add(gdxxid); + } + treeNodeList.add(treeNode); + } + } + root.setChildren(treeNodeList); + } + + + public List queryChildrenByGdxxId(String parentGdxxId,List nodeList){ + List treeNodesList = new ArrayList(); + RecordSet rs = new RecordSet(); + if(StringUtils.isNotBlank(parentGdxxId)){ + + String sql =" select t.id\n" + + " from uf_gdxx t\n" + + " inner join uf_gd p on p.id = t.cggdx\n" + + " where t.sqdw in ( select cggdx from uf_gdxx where id = '"+parentGdxxId+"' ) " ; + + System.out.println("sql:"+sql); + rs.executeQuery(sql); + while (rs.next()){ + String gdxxId = rs.getString("id"); + if(StringUtils.isNotBlank(gdxxId)){ + TreeNode treeNode = new TreeNode(); + treeNode.setValue(gdxxId); + List childList = queryChildrenByGdxxId(gdxxId,nodeList); + if(childList.size()>0){ + treeNode.setChildren(childList); + nodeList.add(gdxxId); + } + treeNodesList.add(treeNode); + } + } + } + return treeNodesList; + } + + public Map recurTree(TreeNode root){ + RecordSet rs = new RecordSet(); + Map dataMap = new HashMap(); + + List> result = new ArrayList<>(); + List path = new ArrayList<>(); + path.add(root.getValue()); + findTreePath(result,root,path); + + System.out.println("result:"+result); + + String return_jn_msg = ""; + String return_jw_msg = ""; + double jn_value = 0.0; + double jw_value = 0.0; + + for(int i=0;i treeList = result.get(i); + System.out.println("treeList:"+treeList.size()); + double jwcgbl = 0.0; + double jncgbl = 0.0; + + String jn_msg = ""; + String jw_msg = ""; + + if(treeList.size() == 2){ + String gdid = treeList.get(1); + + if(StringUtils.isNotBlank(gdid)){ + String lx =""; + String cgbl = ""; + String gdmc = ""; + String sql =" select t.cgbl,k.lx,k.gdmc \n" + + " from uf_gdxx t\n" + + " inner join uf_gd k on k.id = t.cggdx\n" + + " where t.id= "+gdid ; + rs.executeQuery(sql); + if(rs.next()){ + lx = Util.null2String(rs.getString("lx")); + cgbl = Util.null2String(rs.getString("cgbl")); + gdmc = Util.null2String(rs.getString("gdmc")); + } + + System.out.println("cgbl:"+cgbl); + System.out.println("gdmc:"+gdmc); + + if(StringUtils.isNotBlank(cgbl)){ + if("1".equals(lx)){ + double dou_cgbl = Double.parseDouble(cgbl); + dou_cgbl = new BigDecimal(dou_cgbl).setScale(4,BigDecimal.ROUND_HALF_UP).doubleValue(); + + jwcgbl = dou_cgbl; + + jw_msg = gdmc+"["+jwcgbl+"%]"; + + jw_value += jwcgbl; + }else{ + double dou_cgbl = Double.parseDouble(cgbl); + dou_cgbl = new BigDecimal(dou_cgbl).setScale(4,BigDecimal.ROUND_HALF_UP).doubleValue(); + jncgbl = dou_cgbl; + + jn_msg = gdmc+"["+jncgbl+"%]"; + + jn_value += jncgbl; + } + } + } + + }else{ + + String gdmcx = ""; + Collections.reverse(treeList); + for(int k=0;k 0){ + jncgbl = (jncgbl * dou_cgbl)/100.00; + jncgbl = new BigDecimal(jncgbl).setScale(4,BigDecimal.ROUND_HALF_UP).doubleValue(); + jn_msg = gdmcx+"["+jncgbl+"%]"; + + jn_value += jncgbl ; + + } + + if(jwcgbl > 0){ + jwcgbl = (jwcgbl * dou_cgbl)/100.00; + jwcgbl = new BigDecimal(jwcgbl).setScale(4,BigDecimal.ROUND_HALF_UP).doubleValue(); + jw_msg = gdmcx+"["+jwcgbl+"%]"; + + jw_value += jwcgbl ; + } + } + } + } + } + } + } + + if(StringUtils.isNotBlank(jn_msg)){ + return_jn_msg += StringUtils.isBlank(return_jn_msg) ? jn_msg : ","+jn_msg ; + } + + if(StringUtils.isNotBlank(jw_msg)){ + return_jw_msg += StringUtils.isBlank(return_jw_msg) ? jw_msg : ","+jw_msg ; + } + + } + + jn_value = new BigDecimal(jn_value).setScale(4,BigDecimal.ROUND_HALF_UP).doubleValue(); + jw_value = new BigDecimal(jw_value).setScale(4,BigDecimal.ROUND_HALF_UP).doubleValue(); + dataMap.put("jn_msg",return_jn_msg); + dataMap.put("jw_msg",return_jw_msg); + dataMap.put("jn_value",jn_value); + dataMap.put("jw_value",jw_value); + + return dataMap; + } + + private void findTreePath(List> result,TreeNode node,List path){ + if(node.getChildren() == null || node.getChildren().size() <=0){ + result.add(path); + return; + } + + for(int i=0;i cPath = new ArrayList<>(); + cPath.addAll(path); + cPath.add(child.getValue()); + findTreePath(result,child,cPath); + } + } + +%> + diff --git a/JSSBMJ/interface/custom/queryUnitStatisticsReport.jsp b/JSSBMJ/interface/custom/queryUnitStatisticsReport.jsp new file mode 100644 index 0000000..3e04230 --- /dev/null +++ b/JSSBMJ/interface/custom/queryUnitStatisticsReport.jsp @@ -0,0 +1,152 @@ +<%@ page import="java.util.Map" %> +<%@ page import="weaver.conn.RecordSet" %> +<%@ page import="java.util.HashMap" %> +<%@ page import="java.util.List" %> +<%@ page import="java.util.ArrayList" %> +<%@ page import="com.alibaba.fastjson.JSONObject" %> +<%@ page import="weaver.general.Util" %> +<%@ page import="org.apache.commons.lang3.StringUtils" %> +<%@ page import="weaver.hrm.User" %> +<%@ page import="weaver.hrm.HrmUserVarify" %> +<%@ page language="java" contentType="text/html; charset=UTF-8" %> +<% + + User user = HrmUserVarify.getUser(request, response); + if(user==null) { + response.sendRedirect("/login/Login.jsp"); + return; + } + + String startDate = request.getParameter("startDate"); + String endDate = request.getParameter("endDate"); + + RecordSet rs = new RecordSet(); + List> cityList = new ArrayList>(); + String sql =" select selectvalue,selectname \n" + + " from workflow_selectitem \n" + + " where fieldid in(\n" + + " select id from workflow_billfield \n" + + " where billid in( select id from workflow_bill where tablename='uf_dwjbxx' ) and fieldname='szcs' \n" + + " and detailtable is null\n" + + " ) "; + rs.executeQuery(sql); + while (rs.next()){ + String selectvalue = rs.getString("selectvalue"); + String selectname = rs.getString("selectname"); + Map cityMap = new HashMap(); + cityMap.put("key","City"+selectvalue); + cityMap.put("title",selectname); + cityList.add(cityMap); + } + + int yjjg_total = 0; + int ejjg_total = 0; + int jcjj_total = 0; + int jcyj_total = 0; + int yzjj_total = 0; + int yzyj_total = 0 ; + int jsssyj_total = 0; + int jsssej_total = 0; + + for(int i=0;i cityMap = cityList.get(i); + + int yjjg = 0; + int ejjg = 0; + int jcjj = 0; + int jcyj = 0; + int yzjj = 0; + int yzyj = 0 ; + int jsssyj = 0; + int jsssej = 0; + + + String cityKey = Util.null2String(cityMap.get("key")).replace("City",""); + + String where = ""; + if(StringUtils.isNotBlank(startDate)){ + where += " and k.fzrq >= '"+startDate+"' "; + } + + if(StringUtils.isNotBlank(endDate)){ + where += " and k.fzrq <= '"+endDate+"' "; + } + + sql = " select k.zzdj,k.zzlx,count(1)\n" + + " from uf_dwjbxx t\n" + + " inner join uf_bmzzzsxx k on k.dwmc = t.id\n" + + " where k.zszt=0\n" + + " and t.szcs=" + cityKey + where + + " group by k.zzdj,k.zzlx "; + + rs.executeQuery(sql); + while (rs.next()){ + String zzdj = Util.null2String(rs.getString("zzdj")); + String zzlx = Util.null2String(rs.getString("zzlx")); + if("0".equals(zzlx)){ // 涉密信息系统集成 + if("1".equals(zzdj)){ + jcjj++; + }else if("2".equals(zzdj)){ + jcyj++; + } + }else if("1".equals(zzlx)){ //国家秘密载体印制 + if("1".equals(zzdj)){ + yzjj++; + }else if("2".equals(zzdj)){ + yzyj++; + } + }else if("2".equals(zzlx)){ //武器装备科研生产单位 + if("3".equals(zzdj)){ + yjjg++; + }else if("4".equals(zzdj)){ + ejjg++; + } + }else if("3".equals(zzlx)){ //涉密军事设施建设 + if("3".equals(zzdj)){ + jsssyj++; + }else if("4".equals(zzdj)){ + jsssej++; + } + } + } + + cityMap.put("yjjg",yjjg); + cityMap.put("ejjg",ejjg); + cityMap.put("jcjj",jcjj); + cityMap.put("jcyj",jcyj); + cityMap.put("yzjj",yzjj); + cityMap.put("yzyj",yzyj); + cityMap.put("jsssyj",jsssyj); + cityMap.put("jsssej",jsssej); + + yjjg_total += yjjg ; + ejjg_total += ejjg ; + jcjj_total += jcjj ; + jcyj_total += jcyj ; + yzjj_total += yzjj ; + yzyj_total += yzyj ; + jsssyj_total += jsssyj ; + jsssej_total += jsssej ; + } + + + Map totalMap = new HashMap(); + totalMap.put("key","total"); + totalMap.put("title","合计"); + totalMap.put("yjjg",yjjg_total); + totalMap.put("ejjg",ejjg_total); + totalMap.put("jcjj",jcjj_total); + totalMap.put("jcyj",jcyj_total); + totalMap.put("yzjj",yzjj_total); + totalMap.put("yzyj",yzyj_total); + totalMap.put("jsssyj",jsssyj_total); + totalMap.put("jsssej",jsssej_total); + cityList.add(totalMap); + + JSONObject dataJson = new JSONObject(); + dataJson.put("data",cityList); + +%> + +<%=dataJson.toJSONString() %> + diff --git a/JSSBMJ/interface/custom/queryWeaponryReport.jsp b/JSSBMJ/interface/custom/queryWeaponryReport.jsp new file mode 100644 index 0000000..8415db9 --- /dev/null +++ b/JSSBMJ/interface/custom/queryWeaponryReport.jsp @@ -0,0 +1,157 @@ +<%@ page import="java.util.Map" %> +<%@ page import="weaver.conn.RecordSet" %> +<%@ page import="java.util.HashMap" %> +<%@ page import="java.util.List" %> +<%@ page import="java.util.ArrayList" %> +<%@ page import="com.alibaba.fastjson.JSONObject" %> +<%@ page import="weaver.general.Util" %> +<%@ page import="org.apache.commons.lang3.StringUtils" %> +<%@ page language="java" contentType="text/html; charset=UTF-8" %> +<% + + String startDate = request.getParameter("startDate"); + String endDate = request.getParameter("endDate"); + + String zzlx = "2"; + RecordSet rs = new RecordSet(); + List> cityList = new ArrayList>(); + String sql =" select selectvalue,selectname \n" + + " from workflow_selectitem \n" + + " where fieldid in(\n" + + " select id from workflow_billfield \n" + + " where billid in( select id from workflow_bill where tablename='uf_dwjbxx' ) and fieldname='szcs' \n" + + " and detailtable is null\n" + + " ) "; + rs.executeQuery(sql); + while (rs.next()){ + String selectvalue = rs.getString("selectvalue"); + String selectname = rs.getString("selectname"); + Map cityMap = new HashMap(); + cityMap.put("key","City"+selectvalue); + cityMap.put("title",selectname); + cityList.add(cityMap); + } + + int yjjg_total = 0; + int ejjg_total = 0 ; + for(int i=0;i cityMap = cityList.get(i); + String yjjg = "0"; + String ejjg = "0"; + String cityKey = Util.null2String(cityMap.get("key")).replace("City",""); + String where = ""; + if(StringUtils.isNotBlank(startDate)){ + where += " and k.fzrq >= '"+startDate+"' "; + } + + if(StringUtils.isNotBlank(endDate)){ + where += " and k.fzrq <= '"+endDate+"' "; + } + + sql = "select zzdj,count(1) as cou\n" + + "from uf_dwjbxx t\n" + + "inner join uf_bmzzzsxx k on k.dwmc = t.id\n" + + "where k.zszt=0\n" + + "and k.zzlx = " + zzlx + + "and t.szcs=" + cityKey + where + + "group by zzdj "; + + rs.executeQuery(sql); + while (rs.next()){ + String zzdj = Util.null2String(rs.getString("zzdj")); + String cou = Util.null2String(rs.getString("cou")); + if("3".equals(zzdj)){ + yjjg = cou; + }else if("4".equals(zzdj)){ + ejjg = cou; + } + } + + if(StringUtils.isNotBlank(yjjg)){ + yjjg_total += Util.getIntValue(yjjg,0); + } + + if(StringUtils.isNotBlank(ejjg)){ + ejjg_total += Util.getIntValue(ejjg,0); + } + + cityMap.put("yjjg",yjjg); + cityMap.put("ejjg",ejjg); + } + + for(int i=0;i cityMap = cityList.get(i); + String cityKey = Util.null2String(cityMap.get("key")).replace("City",""); + + List> districtList = new ArrayList>(); + + if(StringUtils.isNotBlank(cityKey)){ + int cityKey_ = Util.getIntValue(cityKey)+1; + sql = "select id,qm,yb from uf_qjsj where sss="+cityKey_; + rs.executeQuery(sql); + while (rs.next()){ + String id = Util.null2String(rs.getString("id")); + String qm = Util.null2String(rs.getString("qm")); + + Map districtMap = new HashMap(); + districtMap.put("key","District"+id); + districtMap.put("title",qm); + districtList.add(districtMap); + } + } + + for(int k=0;k districtMap = districtList.get(k); + String districtKey = Util.null2String(districtMap.get("key")).replace("District",""); + + String dist_yjjg = "0"; + String dist_ejjg = "0"; + String where = ""; + if(StringUtils.isNotBlank(startDate)){ + where += " and k.fzrq >= '"+startDate+"' "; + } + + if(StringUtils.isNotBlank(endDate)){ + where += " and k.fzrq <= '"+endDate+"' "; + } + + sql = "select zzdj,count(1) as cou\n" + + "from uf_dwjbxx t\n" + + "inner join uf_bmzzzsxx k on k.dwmc = t.id\n" + + "where k.zszt=0\n" + + "and k.zzlx = " + zzlx + + "and t.szqx= " + districtKey + where + + "group by zzdj "; + + rs.executeQuery(sql); + while (rs.next()){ + String zzdj = Util.null2String(rs.getString("zzdj")); + String cou = Util.null2String(rs.getString("cou")); + if("3".equals(zzdj)){ + dist_yjjg = cou; + }else if("4".equals(zzdj)){ + dist_ejjg = cou; + } + } + + districtMap.put("yjjg",dist_yjjg); + districtMap.put("ejjg",dist_ejjg); + } + cityMap.put("subList",districtList); + } + + Map totalMap = new HashMap(); + totalMap.put("key","total"); + totalMap.put("title","合计"); + totalMap.put("yjjg",yjjg_total); + totalMap.put("ejjg",ejjg_total); + + cityList.add(totalMap); + + JSONObject dataJson = new JSONObject(); + dataJson.put("data",cityList); + +%> + +<%=dataJson.toJSONString() %> + diff --git a/JSSBMJ/interface/custom/queryWorkflowCountData.jsp b/JSSBMJ/interface/custom/queryWorkflowCountData.jsp new file mode 100644 index 0000000..28b829b --- /dev/null +++ b/JSSBMJ/interface/custom/queryWorkflowCountData.jsp @@ -0,0 +1,68 @@ +<%@ page import="java.util.Map" %> +<%@ page import="weaver.conn.RecordSet" %> +<%@ page import="java.util.HashMap" %> +<%@ page import="java.util.List" %> +<%@ page import="java.util.ArrayList" %> +<%@ page import="com.alibaba.fastjson.JSONObject" %> +<%@ page import="weaver.hrm.HrmUserVarify" %> +<%@ page import="weaver.hrm.User" %> +<%@ page import="weaver.mobile.webservices.workflow.WorkflowServiceImpl" %> +<%@ page import="java.math.BigDecimal" %> +<%@ page import="java.math.RoundingMode" %> +<%@ page language="java" contentType="text/html; charset=UTF-8" %> +<% + + + User user = HrmUserVarify.getUser(request, response); + + + WorkflowServiceImpl workflowServiceImpl = new WorkflowServiceImpl(); + int createCount = 0; + try{ + createCount = workflowServiceImpl.getMyWorkflowRequestCount(user.getUID(),null,true); + }catch (Exception e){ + + } + int handleCount = 0 ; + try{ + handleCount = workflowServiceImpl.getHendledWorkflowRequestCount(user.getUID(),true,null,true); + }catch (Exception e){ + + } + int todoCount= 0; + try{ + todoCount= workflowServiceImpl.getToDoWorkflowRequestCount(user.getUID(),true,null); + }catch (Exception e){ + + } + + Map dataMap = new HashMap(); + dataMap.put("hasDone",createCount); + dataMap.put("qsgwlds",handleCount); + dataMap.put("totalOverTime",todoCount); + + dataMap.put("overTimePercent",0); + dataMap.put("totalWilloverTime",0); + + JSONObject dataJson = new JSONObject(); + double wcl = 0.0; + if(todoCount+handleCount > 0){ + wcl = handleCount/((todoCount+handleCount)*1.0)*100; + } + BigDecimal bigDecimal = new BigDecimal(wcl); + bigDecimal = bigDecimal.setScale(2, RoundingMode.HALF_UP); + + dataMap.put("bjl",bigDecimal.doubleValue()+"%"); + + dataJson.put("data",dataMap); + dataJson.put("code","200"); + +%> + +<%=dataJson.toJSONString() %> + +<%! + + +%> + diff --git a/JSSBMJ/src/com/api/bmj/web/MaterialDownloadActionApi.java b/JSSBMJ/src/com/api/bmj/web/MaterialDownloadActionApi.java new file mode 100644 index 0000000..569a0dd --- /dev/null +++ b/JSSBMJ/src/com/api/bmj/web/MaterialDownloadActionApi.java @@ -0,0 +1,9 @@ +package com.api.bmj.web; + +import com.engine.bmj.web.MaterialCreateAction; + +import javax.ws.rs.Path; + +@Path("/bmj/material") +public class MaterialDownloadActionApi extends MaterialCreateAction { +} \ No newline at end of file diff --git a/JSSBMJ/src/com/api/secret/web/AuthorityChangeController.java b/JSSBMJ/src/com/api/secret/web/AuthorityChangeController.java new file mode 100644 index 0000000..cdf324e --- /dev/null +++ b/JSSBMJ/src/com/api/secret/web/AuthorityChangeController.java @@ -0,0 +1,12 @@ +package com.api.secret.web; + +import javax.ws.rs.Path; + +/** + * @author:dxfeng + * @createTime: 2025/04/09 + * @version: 1.0 + */ +@Path("/secret/authority/change") +public class AuthorityChangeController extends com.engine.secret.web.AuthorityChangeController{ +} diff --git a/JSSBMJ/src/com/api/secret/web/AutoGenerateNumberController.java b/JSSBMJ/src/com/api/secret/web/AutoGenerateNumberController.java new file mode 100644 index 0000000..c0e6862 --- /dev/null +++ b/JSSBMJ/src/com/api/secret/web/AutoGenerateNumberController.java @@ -0,0 +1,12 @@ +package com.api.secret.web; + +import javax.ws.rs.Path; + +/** + * @author:dxfeng + * @createTime: 2025/04/16 + * @version: 1.0 + */ +@Path("/secret/auto/number") +public class AutoGenerateNumberController extends com.engine.secret.web.AutoGenerateNumberController{ +} diff --git a/JSSBMJ/src/com/api/secret/web/QualificationApplicationController.java b/JSSBMJ/src/com/api/secret/web/QualificationApplicationController.java new file mode 100644 index 0000000..79ff4e7 --- /dev/null +++ b/JSSBMJ/src/com/api/secret/web/QualificationApplicationController.java @@ -0,0 +1,8 @@ +package com.api.secret.web; + +import javax.ws.rs.Path; + + +@Path("/secret/demand") +public class QualificationApplicationController extends com.engine.secret.web.QualificationApplicationController { +} diff --git a/JSSBMJ/src/com/engine/bmj/cmd/MaterialCreateCmd.java b/JSSBMJ/src/com/engine/bmj/cmd/MaterialCreateCmd.java new file mode 100644 index 0000000..0979060 --- /dev/null +++ b/JSSBMJ/src/com/engine/bmj/cmd/MaterialCreateCmd.java @@ -0,0 +1,227 @@ +package com.engine.bmj.cmd; + +import com.engine.bmj.utils.DocCreateUtil; +import com.engine.bmj.utils.WordTemplateUtil; +import com.engine.common.biz.AbstractCommonCommand; +import com.engine.common.entity.BizLogContext; +import com.engine.core.interceptor.CommandContext; +import com.engine.secret.util.ConfigUtil; +import org.apache.commons.lang3.StringUtils; +import weaver.conn.RecordSet; +import weaver.file.ImageFileManager; +import weaver.general.BaseBean; +import weaver.general.Util; +import weaver.hrm.User; +import java.io.*; +import java.util.*; + +public class MaterialCreateCmd extends AbstractCommonCommand> { + @Override + public BizLogContext getLogContext() { + return null; + } + + public MaterialCreateCmd(Map params, User user) { + this.params = params; + this.user = user; + } + @Override + public Map execute(CommandContext commandContext) { + + int newDocid = -1; + Map apidatas = new HashMap(); + DocCreateUtil docCreateUtil = new DocCreateUtil(); + BaseBean bb = new BaseBean(); + String docid = Util.null2String(params.get("docid")); + bb.writeLog("MaterialCreateCmd-client:"+docid); + + RecordSet rs = new RecordSet(); + if(StringUtils.isNotEmpty(docid)){ + + String imagefileid = ""; + String imageFileName = ""; + String fileRealPath = ""; + String sql = " select t1.imagefileid,t1.imageFileName,t1.fileRealPath,t2.imagefilename as realname from ImageFile t1 inner join DocImageFile t2 on t1.imagefileid = t2.imagefileid where t1.docid = " + docid; + bb.writeLog("sql:"+sql); + rs.execute(sql); + if (rs.next()) + { + imageFileName = Util.null2String(rs.getString("realname")); + if (imageFileName.equals("")) { + imageFileName = Util.null2String(rs.getString("imageFileName")); + } + imagefileid = Util.null2String(rs.getString("imagefileid")); + fileRealPath = Util.null2String(rs.getString("fileRealPath")); + } + + if(StringUtils.isNotBlank(imagefileid) && StringUtils.isNotBlank(imageFileName) && StringUtils.isNotBlank(fileRealPath)){ + Map dataMap = new HashMap(); + String saveMaterialPath = ""; + if(StringUtils.isNotBlank(fileRealPath)){ + saveMaterialPath = fileRealPath.substring(0,fileRealPath.indexOf("filesystem"))+File.separator+"material"+File.separator+System.currentTimeMillis(); + } + + boolean result = false; + File parentFile = new File(saveMaterialPath); + if (!parentFile.exists()) { + result = parentFile.mkdirs(); + }else{ + result = true; + } + + if(result){ + InputStream inputstream = ImageFileManager.getInputStreamById(Util.getIntValue(imagefileid)); + + WordTemplateUtil wordTemplateUtil = null; + try { + wordTemplateUtil = new WordTemplateUtil(inputstream); + } catch (IOException e) { + throw new RuntimeException(e); + } + wordTemplateUtil.replaceDocument(dataMap); + + String outpath = saveMaterialPath + File.separator + new File(imageFileName); + File outputFile = new File(outpath); + + FileOutputStream fileOutputStream = null; + try { + fileOutputStream = new FileOutputStream(outputFile); + wordTemplateUtil.getDocument().write(fileOutputStream); + + if(outputFile.exists()){ + + String docsubject = imageFileName; + String attachfilename = imageFileName; + String filepath = outputFile.getPath(); + long attachlength = outputFile.length(); + int creater = user.getUID(); + int seccategory = Util.getIntValue(ConfigUtil.getConfig("material.seccategory")) ; + String tempcomids = ""; + newDocid = docCreateUtil.createMaterialDoc(docsubject,attachfilename,filepath,attachlength,creater,seccategory,tempcomids); + } + + fileOutputStream.close(); + inputstream.close(); + } catch (FileNotFoundException e) { + bb.writeLog("e:"+e); + throw new RuntimeException(e); + + }catch (IOException e) { + bb.writeLog("e:"+e); + throw new RuntimeException(e); + }finally { + if(fileOutputStream != null){ + try { + fileOutputStream.close(); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + if(inputstream != null){ + try { + inputstream.close(); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + } + } + } + } + + apidatas.put("docid",newDocid); + return apidatas; + } + + /*** + * + * @return + * @throws Exception + */ + public Map getDocLabelData(String requestid,String shry) throws Exception + { + RecordSet rs = new RecordSet(); + + Map wordDataMap = new HashMap<>(); + + Map parametersMap = new HashMap<>(); + parametersMap.put("shry",shry); + + String formTable = ""; + String sql = " select abs(k.formid) as formid from workflow_requestbase t inner join workflow_base k on k.id = t.workflowid " + + " where t.requestid = "+requestid; + rs.executeQuery(sql); + if(rs.next()){ + formTable = "formtable_main_"+Util.null2String(rs.getString("formid")); + } + + String mainid = ""; + if(StringUtils.isNotBlank(formTable)){ + sql = " select mainid from "+formTable+" where requestid = "+requestid; + rs.executeQuery(sql); + if (rs.next()){ + mainid = Util.null2String(rs.getString("mainid")); + } + } + + List> table1List = new ArrayList>(); + List> table2List = new ArrayList>(); + List> table3List = new ArrayList>(); + + if(StringUtils.isNotBlank(mainid)){ + + sql = " select * from "+formTable+"_dt1 where mainid = "+mainid; + rs.executeQuery(sql); + while(rs.next()){ + String glscx = Util.null2String(rs.getString("glscx")); + String scx = Util.null2String(rs.getString("scx")); + String scjg = Util.null2String(rs.getString("scjg")); + String pdjg = Util.null2String(rs.getString("pdjg")); + Map map = new HashMap(); + map.put("glscx",glscx); + map.put("scx",scx); + map.put("scjg",scjg); + map.put("pdjg",pdjg); + table1List.add(map); + } + + sql = " select * from "+formTable+"_dt2 where mainid = "+mainid; + rs.executeQuery(sql); + while(rs.next()){ + String glscx = Util.null2String(rs.getString("glscx")); + String scx = Util.null2String(rs.getString("scx")); + String scjg = Util.null2String(rs.getString("scjg")); + String pdjg = Util.null2String(rs.getString("pdjg")); + Map map = new HashMap(); + map.put("glscx",glscx); + map.put("scx",scx); + map.put("scjg",scjg); + map.put("pdjg",pdjg); + table2List.add(map); + } + + sql = " select * from "+formTable+"_dt3 where mainid = "+mainid; + rs.executeQuery(sql); + while(rs.next()){ + String glscx = Util.null2String(rs.getString("glscx")); + String scx = Util.null2String(rs.getString("scx")); + String scjg = Util.null2String(rs.getString("scjg")); + String pdjg = Util.null2String(rs.getString("pdjg")); + String pdbz = Util.null2String(rs.getString("pdbz")); + Map map = new HashMap(); + map.put("glscx",glscx); + map.put("scx",scx); + map.put("scjg",scjg); + map.put("pdjg",pdjg); + table3List.add(map); + } + } + + wordDataMap.put("parametersMap", parametersMap); + wordDataMap.put("table1", table1List); + wordDataMap.put("table2", table2List); + wordDataMap.put("table3", table3List); + + return wordDataMap; + } +} diff --git a/JSSBMJ/src/com/engine/bmj/service/MaterialCreateService.java b/JSSBMJ/src/com/engine/bmj/service/MaterialCreateService.java new file mode 100755 index 0000000..79594ec --- /dev/null +++ b/JSSBMJ/src/com/engine/bmj/service/MaterialCreateService.java @@ -0,0 +1,11 @@ +package com.engine.bmj.service; + +import weaver.hrm.User; + +import java.util.Map; + +public interface MaterialCreateService { + + Map createDocByMaterial(Map paramMap,User user); + +} diff --git a/JSSBMJ/src/com/engine/bmj/service/impl/MaterialCreateServiceImpl.java b/JSSBMJ/src/com/engine/bmj/service/impl/MaterialCreateServiceImpl.java new file mode 100755 index 0000000..5fd5a20 --- /dev/null +++ b/JSSBMJ/src/com/engine/bmj/service/impl/MaterialCreateServiceImpl.java @@ -0,0 +1,16 @@ +package com.engine.bmj.service.impl; + +import com.engine.bmj.service.MaterialCreateService; +import com.engine.core.impl.Service; +import com.engine.bmj.cmd.MaterialCreateCmd; +import weaver.hrm.User; + +import java.util.Map; + +public class MaterialCreateServiceImpl extends Service implements MaterialCreateService { + @Override + public Map createDocByMaterial(Map apidatas, User user) { + return commandExecutor.execute(new MaterialCreateCmd(apidatas,user)); + } + +} diff --git a/JSSBMJ/src/com/engine/bmj/utils/DocCreateUtil.java b/JSSBMJ/src/com/engine/bmj/utils/DocCreateUtil.java new file mode 100644 index 0000000..63d64b0 --- /dev/null +++ b/JSSBMJ/src/com/engine/bmj/utils/DocCreateUtil.java @@ -0,0 +1,269 @@ +package com.engine.bmj.utils; + +import weaver.conn.RecordSet; +import weaver.docs.category.SecCategoryComInfo; +import weaver.docs.docs.*; +import weaver.general.BaseBean; +import weaver.general.TimeUtil; +import weaver.hrm.resource.ResourceComInfo; + + +public class DocCreateUtil { + + public int createMaterialDoc(String docsubject,String attachfilename,String filepath,long attachlength,int creater,int seccategory,String tempcomids){ + + BaseBean bb = new BaseBean(); + int docid = -1; + try{ + String doccontent = ""; + docid = createDoc(docsubject,doccontent,creater,seccategory,tempcomids); + if(docid > 0) { + createImageFile(docid+"",attachfilename,filepath,attachlength,true); + } + }catch (Exception e){ + bb.writeLog("e:"+e); + } + + return docid; + } + + /** + * 创建文档 + * @param title 文档标题 + * @param content 文档内容 + * @param creater 创建人 + * @param seccategory 子目录 + * @param tempcomids + * @return + * @throws Exception + */ + public int createDoc(String title,String content,int creater,int seccategory,String tempcomids){ + RecordSet rs = new RecordSet(); + BaseBean bb = new BaseBean(); + try{ + + String createdate = TimeUtil.getCurrentDateString(); + String createtime = TimeUtil.getOnlyCurrentTimeString(); + String modifieddate = createdate; + String modifiedtime = createtime; + String pubishdate = createdate; + String publishtime = createtime; + + int docLanguage = 7 ; + ResourceComInfo r = new ResourceComInfo(); + int departmentid = Integer.parseInt(r.getDepartmentID(creater+"")); + + SecCategoryComInfo secCategoryComInfo = new SecCategoryComInfo(); + + DocComInfo docComInfo=new DocComInfo(); + DocManager docManager=new DocManager(); + DocViewer docViewer=new DocViewer(); + + RecordSet recordSet = new RecordSet(); + int newDocId = docManager.getNextDocId(recordSet); + + docManager.setId(newDocId); + docManager.setDocsubject(title); + docManager.setSeccategory(seccategory); + docManager.setLanguageid(docLanguage); + docManager.setDocstatus("1"); + + docManager.setDoccreaterid(creater); + docManager.setDocdepartmentid(departmentid); + docManager.setDocCreaterType("1"); //内部用户 + docManager.setUsertype("1"); + docManager.setOwnerid(creater); + docManager.setOwnerType("1"); + docManager.setDoclastmoduserid(creater); + docManager.setDocLastModUserType("1"); + docManager.setDoccreatedate(createdate); + docManager.setDoccreatetime(createtime); + docManager.setDoclastmoddate(modifieddate); + docManager.setDoclastmodtime(modifiedtime); + docManager.setDocPubDate(pubishdate); + docManager.setDocPubTime(publishtime); + docManager.setDoclangurage(docLanguage); + docManager.setKeyword(title); + docManager.setIsapprover("0"); + docManager.setDocreplyable("1"); + docManager.setAccessorycount(0); + docManager.setSecretLevel(3); + docManager.setOrderable(secCategoryComInfo.getSecOrderable(seccategory)+""); + docManager.setUserid(1); + docManager.setIsreply("0"); + + DocCoder docCoder = new DocCoder(); + docManager.setDocCode(docCoder.getDocCoder(""+seccategory)); + docManager.setDocEditionId(docManager.getNextEditionId(recordSet)); + docManager.setDocEdition(1); + + docManager.setDoccontent(content); + docManager.setDocType(1); + + docManager.setDocextendname("html"); + docManager.setDocValidUserType("0"); + docManager.AddDocInfo(); + + docComInfo.addDocInfoCache("" + newDocId); + + docViewer.setDocShareByDoc("" + newDocId); + docManager.AddShareInfo(); + + rs.execute("select subcompanyid1 from HrmResource where id="+creater); + rs.next(); + String subcompanyid1 = com.weaver.general.Util.null2String(rs.getString("subcompanyid1")); + + rs.execute("update docshare set userid="+creater+" where docid="+newDocId+" and sharetype in (80,84)"); + + String sharesql=" insert into ShareinnerDoc (sourceid,type,content,seclevel,sharelevel,srcfrom,opuser,sharesource,downloadlevel,SECLEVELMAX)" + + " values('"+newDocId+"',1,1,0,1,80,"+creater+",0,1,255)"; + rs.execute(sharesql); + + if(!"".equals(subcompanyid1)){ + sharesql="insert into ShareinnerDoc (sourceid,type,content,seclevel,sharelevel,srcfrom,opuser,sharesource,downloadlevel,SECLEVELMAX)" + + " values('"+newDocId+"',2,"+subcompanyid1+",0,1,2,"+subcompanyid1+",0,1,255)"; + rs.execute(sharesql); + } + + if(!"".equals(tempcomids)) + { + String[] tempcomidArray = tempcomids.split(","); + for(int i=0;i= file.length()) { + return ""; + } else { + return file.substring(idx + 1); + } + } + } + } + + + +} diff --git a/JSSBMJ/src/com/engine/bmj/utils/WordTemplateUtil.java b/JSSBMJ/src/com/engine/bmj/utils/WordTemplateUtil.java new file mode 100644 index 0000000..dec9ab6 --- /dev/null +++ b/JSSBMJ/src/com/engine/bmj/utils/WordTemplateUtil.java @@ -0,0 +1,612 @@ +package com.engine.bmj.utils; + +import org.apache.poi.xwpf.usermodel.*; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + + +public class WordTemplateUtil { + + private XWPFDocument document; + + public XWPFDocument getDocument() { + return document; + } + + public void setDocument(XWPFDocument document) { + this.document = document; + } + + /** + * 初始化模板内容 + * + * @author Juveniless + * @date 2017年11月27日 下午3:59:22 + * @param inputStream + * 模板的读取流(docx文件) + * @throws IOException + * + */ + public WordTemplateUtil(InputStream inputStream) throws IOException { + document = new XWPFDocument(inputStream); + } + + /** + * 将处理后的内容写入到输出流中 + * + * @param outputStream + * @throws IOException + */ + public void write(OutputStream outputStream) throws IOException { + document.write(outputStream); + } + + + + + + /** + * 根据dataMap对word文件中的标签进行替换;

+ * !!!!***需要注意dataMap的数据格式***!!!!

+ * 对于需要替换的普通标签数据标签(不需要循环)-----必须在dataMap中存储一个key为parametersMap的map, + * 来存储这些不需要循环生成的数据,比如:表头信息,日期,制表人等。

+ * 对于需要循环生成的表格数据------key自定义,value为 --ArrayList<Map<String, String>> + * @author Juveniless + * @date 2017年11月27日 下午3:29:27 + * @param dataMap + * + */ + public void replaceDocument(Map dataMap) { + + if (!dataMap.containsKey("parametersMap")) { + System.out.println("数据源错误--数据源(parametersMap)缺失"); + return; + } + @SuppressWarnings("unchecked") + Map parametersMap = (Map) dataMap + .get("parametersMap"); + + List bodyElements = document.getBodyElements();// 所有对象(段落+表格) + int templateBodySize = bodyElements.size();// 标记模板文件(段落+表格)总个数 + + int curT = 0;// 当前操作表格对象的索引 + int curP = 0;// 当前操作段落对象的索引 + for (int a = 0; a < templateBodySize; a++) { + IBodyElement body = bodyElements.get(a); + if (BodyElementType.TABLE.equals(body.getElementType())) {// 处理表格 + XWPFTable table = body.getBody().getTableArray(curT); + + List tables = body.getBody().getTables(); + table = tables.get(curT); + if (table != null) { + + // 处理表格 +// List tableCells = table.getRows().get(0).getTableCells(); // 获取到模板表格第一行,用来判断表格类型 + List tableRowsList = table.getRows(); + List tableCells = tableRowsList.get(0).getTableCells(); + + String tableText = table.getText();// 表格中的所有文本 + + if (tableText.indexOf("##{foreach") > -1) { + // 查找到##{foreach标签,该表格需要处理循环 + if (tableCells.size() != 2 + || tableCells.get(0).getText().indexOf("##{foreach") < 0 + || tableCells.get(0).getText().trim().length() == 0) { + System.out.println("文档中第" + + (curT + 1) + + "个表格模板错误,模板表格第一行需要设置2个单元格," + + "第一个单元格存储表格类型(##{foreachTable}## 或者 ##{foreachTableRow}##),第二个单元格定义数据源。"); + return; + } + + String tableType = tableCells.get(0).getText(); + String dataSource = tableCells.get(1).getText(); + System.out.println("读取到数据源:"+dataSource); + if (!dataMap.containsKey(dataSource)) { + System.out.println("文档中第" + (curT + 1) + "个表格模板数据源缺失"); + return; + } + + @SuppressWarnings("unchecked") + List> tableDataList = (List>) dataMap + .get(dataSource); + if ("##{foreachTable}##".equals(tableType)) { + // System.out.println("循环生成表格"); + addTableInDocFooter(table, tableDataList, parametersMap, 1); + + } else if ("##{foreachTableRow}##".equals(tableType)) { + // System.out.println("循环生成表格内部的行"); + addTableInDocFooter(table, tableDataList, parametersMap, 2); + } + + } else if (tableText.indexOf("{") > -1) { + // 没有查找到##{foreach标签,查找到了普通替换数据的{}标签,该表格只需要简单替换 + addTableInDocFooter(table, null, parametersMap, 3); + } else { + // 没有查找到任何标签,该表格是一个静态表格,仅需要复制一个即可。 + addTableInDocFooter(table, null, null, 0); + } + curT++; + + } + } else if (BodyElementType.PARAGRAPH.equals(body.getElementType())) {// 处理段落 + // System.out.println("获取到段落"); + XWPFParagraph ph = body.getBody().getParagraphArray(curP); + if (ph != null) { + // htmlText = htmlText+readParagraphX(ph); + addParagraphInDocFooter(ph, null, parametersMap, 0); + + curP++; + } + } + + } + // 处理完毕模板,删除文本中的模板内容 + for (int a = 0; a < templateBodySize; a++) { + document.removeBodyElement(0); + } + + } + + + /** + * 根据 模板表格 和 数据list 在word文档末尾生成表格 + * @author Juveniless + * @date 2017年12月6日 上午10:12:05 + * @param templateTable 模板表格 + * @param list 循环数据集 + * @param parametersMap 不循环数据集 + * @param flag (0为静态表格,1为表格整体循环,2为表格内部行循环,3为表格不循环仅简单替换标签即可) + * + */ + public void addTableInDocFooter(XWPFTable templateTable, List> list, + Map parametersMap, int flag) { + + if (flag == 1) {// 表格整体循环 + for (Map map : list) { + List templateTableRows = templateTable.getRows();// 获取模板表格所有行 + XWPFTable newCreateTable = document.createTable();// 创建新表格,默认一行一列 + for (int i = 1; i < templateTableRows.size(); i++) { + XWPFTableRow newCreateRow = newCreateTable.createRow(); + CopyTableRow(newCreateRow, templateTableRows.get(i));// 复制模板行文本和样式到新行 + } + newCreateTable.removeRow(0);// 移除多出来的第一行 + document.createParagraph();// 添加回车换行 + replaceTable(newCreateTable, map);//替换标签 + } + + } else if (flag == 2) {// 表格表格内部行循环 + XWPFTable newCreateTable = document.createTable();// 创建新表格,默认一行一列 + List TempTableRows = templateTable.getRows();// 获取模板表格所有行 + int tagRowsIndex = 0;// 标签行indexs + for (int i = 0, size = TempTableRows.size(); i < size; i++) { + String rowText = TempTableRows.get(i).getCell(0).getText();// 获取到表格行的第一个单元格 + if (rowText.indexOf("##{foreachRows}##") > -1) { + tagRowsIndex = i; + break; + } + } + + /* 复制模板行和标签行之前的行 */ + for (int i = 1; i < tagRowsIndex; i++) { + XWPFTableRow newCreateRow = newCreateTable.createRow(); + CopyTableRow(newCreateRow, TempTableRows.get(i));// 复制行 + replaceTableRow(newCreateRow, parametersMap);// 处理不循环标签的替换 + } + + /* 循环生成模板行 */ + XWPFTableRow tempRow = TempTableRows.get(tagRowsIndex + 1);// 获取到模板行 + for (int i = 0; i < list.size(); i++) { + XWPFTableRow newCreateRow = newCreateTable.createRow(); + CopyTableRow(newCreateRow, tempRow);// 复制模板行 + replaceTableRow(newCreateRow, list.get(i));// 处理标签替换 + } + + /* 复制模板行和标签行之后的行 */ + for (int i = tagRowsIndex + 2; i < TempTableRows.size(); i++) { + XWPFTableRow newCreateRow = newCreateTable.createRow(); + CopyTableRow(newCreateRow, TempTableRows.get(i));// 复制行 + replaceTableRow(newCreateRow, parametersMap);// 处理不循环标签的替换 + } + newCreateTable.removeRow(0);// 移除多出来的第一行 + document.createParagraph();// 添加回车换行 + + } else if (flag == 3) { + //表格不循环仅简单替换标签 + List templateTableRows = templateTable.getRows();// 获取模板表格所有行 + XWPFTable newCreateTable = document.createTable();// 创建新表格,默认一行一列 + for (int i = 0; i < templateTableRows.size(); i++) { + XWPFTableRow newCreateRow = newCreateTable.createRow(); + CopyTableRow(newCreateRow, templateTableRows.get(i));// 复制模板行文本和样式到新行 + } + newCreateTable.removeRow(0);// 移除多出来的第一行 + document.createParagraph();// 添加回车换行 + replaceTable(newCreateTable, parametersMap); + + } else if (flag == 0) { + List templateTableRows = templateTable.getRows();// 获取模板表格所有行 + XWPFTable newCreateTable = document.createTable();// 创建新表格,默认一行一列 + for (int i = 0; i < templateTableRows.size(); i++) { + XWPFTableRow newCreateRow = newCreateTable.createRow(); + CopyTableRow(newCreateRow, templateTableRows.get(i));// 复制模板行文本和样式到新行 + } + newCreateTable.removeRow(0);// 移除多出来的第一行 + document.createParagraph();// 添加回车换行 + } + + } + + /** + * 根据 模板段落 和 数据 在文档末尾生成段落 + * + * @author Juveniless + * @date 2017年11月27日 上午11:49:42 + * @param templateParagraph + * 模板段落 + * @param list + * 循环数据集 + * @param parametersMap + * 不循环数据集 + * @param flag + * (0为不循环替换,1为循环替换) + * + */ + public void addParagraphInDocFooter(XWPFParagraph templateParagraph, + List> list, Map parametersMap, int flag) { + + if (flag == 0) { + XWPFParagraph createParagraph = document.createParagraph(); + // 设置段落样式 + createParagraph.getCTP().setPPr(templateParagraph.getCTP().getPPr()); + // 移除原始内容 + for (int pos = 0; pos < createParagraph.getRuns().size(); pos++) { + createParagraph.removeRun(pos); + } + // 添加Run标签 + List runsList = templateParagraph.getRuns(); + for (XWPFRun s : runsList) { + XWPFRun targetrun = createParagraph.createRun(); + CopyRun(targetrun, s); + } + + replaceParagraph(createParagraph, parametersMap); + + } else if (flag == 1) { + // 暂无实现 + } + + } + + + + + /** + * 根据map替换段落元素内的{**}标签 + * @author Juveniless + * @date 2017年12月4日 下午3:09:00 + * @param xWPFParagraph + * @param parametersMap + * + */ + public void replaceParagraph(XWPFParagraph xWPFParagraph, Map parametersMap) { + List runs = xWPFParagraph.getRuns(); + String xWPFParagraphText = xWPFParagraph.getText(); + String regEx = "\\{.+?\\}"; + Pattern pattern = Pattern.compile(regEx); + Matcher matcher = pattern.matcher(xWPFParagraphText);//正则匹配字符串{****} + + if (matcher.find()) { + // 查找到有标签才执行替换 + int beginRunIndex = xWPFParagraph.searchText("{", new PositionInParagraph()).getBeginRun();// 标签开始run位置 + int endRunIndex = xWPFParagraph.searchText("}", new PositionInParagraph()).getEndRun();// 结束标签 + StringBuffer key = new StringBuffer(); + + if (beginRunIndex == endRunIndex) { + // {**}在一个run标签内 + XWPFRun beginRun = runs.get(beginRunIndex); + String beginRunText = beginRun.text(); + + int beginIndex = beginRunText.indexOf("{"); + int endIndex = beginRunText.indexOf("}"); + int length = beginRunText.length(); + + if (beginIndex == 0 && endIndex == length - 1) { + // 该run标签只有{**} + XWPFRun insertNewRun = xWPFParagraph.insertNewRun(beginRunIndex); + insertNewRun.getCTR().setRPr(beginRun.getCTR().getRPr()); + // 设置文本 + key.append(beginRunText.substring(1, endIndex)); + insertNewRun.setText(getValueBykey(key.toString(),parametersMap)); + xWPFParagraph.removeRun(beginRunIndex + 1); + } else { + // 该run标签为**{**}** 或者 **{**} 或者{**}**,替换key后,还需要加上原始key前后的文本 + XWPFRun insertNewRun = xWPFParagraph.insertNewRun(beginRunIndex); + insertNewRun.getCTR().setRPr(beginRun.getCTR().getRPr()); + // 设置文本 + key.append(beginRunText.substring(beginRunText.indexOf("{")+1, beginRunText.indexOf("}"))); + String textString=beginRunText.substring(0, beginIndex) + getValueBykey(key.toString(),parametersMap) + + beginRunText.substring(endIndex + 1); + insertNewRun.setText(textString); + xWPFParagraph.removeRun(beginRunIndex + 1); + } + + }else { + // {**}被分成多个run + + //先处理起始run标签,取得第一个{key}值 + XWPFRun beginRun = runs.get(beginRunIndex); + String beginRunText = beginRun.text(); + int beginIndex = beginRunText.indexOf("{"); + if (beginRunText.length()>1 ) { + key.append(beginRunText.substring(beginIndex+1)); + } + ArrayList removeRunList = new ArrayList<>();//需要移除的run + //处理中间的run + for (int i = beginRunIndex + 1; i < endRunIndex; i++) { + XWPFRun run = runs.get(i); + String runText = run.text(); + key.append(runText); + removeRunList.add(i); + } + + // 获取endRun中的key值 + XWPFRun endRun = runs.get(endRunIndex); + String endRunText = endRun.text(); + int endIndex = endRunText.indexOf("}"); + //run中**}或者**}** + if (endRunText.length()>1 && endIndex!=0) { + key.append(endRunText.substring(0,endIndex)); + } + + + + //******************************************************************* + //取得key值后替换标签 + + //先处理开始标签 + if (beginRunText.length()==2 ) { + // run标签内文本{ + XWPFRun insertNewRun = xWPFParagraph.insertNewRun(beginRunIndex); + insertNewRun.getCTR().setRPr(beginRun.getCTR().getRPr()); + // 设置文本 + insertNewRun.setText(getValueBykey(key.toString(),parametersMap)); + xWPFParagraph.removeRun(beginRunIndex + 1);//移除原始的run + }else { + // 该run标签为**{**或者 {** ,替换key后,还需要加上原始key前的文本 + XWPFRun insertNewRun = xWPFParagraph.insertNewRun(beginRunIndex); + insertNewRun.getCTR().setRPr(beginRun.getCTR().getRPr()); + // 设置文本 + String textString=beginRunText.substring(0,beginRunText.indexOf("{"))+getValueBykey(key.toString(),parametersMap); + insertNewRun.setText(textString); + xWPFParagraph.removeRun(beginRunIndex + 1);//移除原始的run + } + + //处理结束标签 + if (endRunText.length()==1 ) { + // run标签内文本只有} + XWPFRun insertNewRun = xWPFParagraph.insertNewRun(endRunIndex); + insertNewRun.getCTR().setRPr(endRun.getCTR().getRPr()); + // 设置文本 + insertNewRun.setText(""); + xWPFParagraph.removeRun(endRunIndex + 1);//移除原始的run + + }else { + // 该run标签为**}**或者 }** 或者**},替换key后,还需要加上原始key后的文本 + XWPFRun insertNewRun = xWPFParagraph.insertNewRun(endRunIndex); + insertNewRun.getCTR().setRPr(endRun.getCTR().getRPr()); + // 设置文本 + String textString=endRunText.substring(endRunText.indexOf("}")+1); + insertNewRun.setText(textString); + xWPFParagraph.removeRun(endRunIndex + 1);//移除原始的run + } + + //处理中间的run标签 + for (int i = 0; i < removeRunList.size(); i++) { + XWPFRun xWPFRun = runs.get(removeRunList.get(i));//原始run + XWPFRun insertNewRun = xWPFParagraph.insertNewRun(removeRunList.get(i)); + insertNewRun.getCTR().setRPr(xWPFRun.getCTR().getRPr()); + insertNewRun.setText(""); + xWPFParagraph.removeRun(removeRunList.get(i) + 1);//移除原始的run + } + + }// 处理${**}被分成多个run + + replaceParagraph( xWPFParagraph, parametersMap); + + }//if 有标签 + + } + + + + + + + + + /** + * 复制表格行XWPFTableRow格式 + * + * @param target + * 待修改格式的XWPFTableRow + * @param source + * 模板XWPFTableRow + */ + private void CopyTableRow(XWPFTableRow target, XWPFTableRow source) { + + int tempRowCellsize = source.getTableCells().size();// 模板行的列数 + for (int i = 0; i < tempRowCellsize - 1; i++) { + target.addNewTableCell();// 为新添加的行添加与模板表格对应行行相同个数的单元格 + } + // 复制样式 + target.getCtRow().setTrPr(source.getCtRow().getTrPr()); + // 复制单元格 + for (int i = 0; i < target.getTableCells().size(); i++) { + copyTableCell(target.getCell(i), source.getCell(i)); + } + } + + + + + + /** + * 复制单元格XWPFTableCell格式 + * + * @author Juveniless + * @date 2017年11月27日 下午3:41:02 + * @param newTableCell + * 新创建的的单元格 + * @param templateTableCell + * 模板单元格 + * + */ + private void copyTableCell(XWPFTableCell newTableCell, XWPFTableCell templateTableCell) { + // 列属性 + newTableCell.getCTTc().setTcPr(templateTableCell.getCTTc().getTcPr()); + // 删除目标 targetCell 所有文本段落 + for (int pos = 0; pos < newTableCell.getParagraphs().size(); pos++) { + newTableCell.removeParagraph(pos); + } + // 添加新文本段落 + + List paragraphsList = templateTableCell.getParagraphs(); + for (XWPFParagraph sp : paragraphsList) { + XWPFParagraph targetP = newTableCell.addParagraph(); + copyParagraph(targetP, sp); + } + } + + /** + * 复制文本段落XWPFParagraph格式 + * + * @author Juveniless + * @date 2017年11月27日 下午3:43:08 + * @param newParagraph + * 新创建的的段落 + * @param templateParagraph + * 模板段落 + * + */ + private void copyParagraph(XWPFParagraph newParagraph, XWPFParagraph templateParagraph) { + // 设置段落样式 + newParagraph.getCTP().setPPr(templateParagraph.getCTP().getPPr()); + // 添加Run标签 + for (int pos = 0; pos < newParagraph.getRuns().size(); pos++) { + newParagraph.removeRun(pos); + + } + + List runs = templateParagraph.getRuns(); + for (XWPFRun s : runs) { + XWPFRun targetrun = newParagraph.createRun(); + CopyRun(targetrun, s); + } + + } + + /** + * 复制文本节点run + * @author Juveniless + * @date 2017年11月27日 下午3:47:17 + * @param newRun + * 新创建的的文本节点 + * @param templateRun + * 模板文本节点 + * + */ + private void CopyRun(XWPFRun newRun, XWPFRun templateRun) { + newRun.getCTR().setRPr(templateRun.getCTR().getRPr()); + // 设置文本 + newRun.setText(templateRun.text()); + + + } + + + + + /** + * 根据参数parametersMap对表格的一行进行标签的替换 + * + * @author Juveniless + * @date 2017年11月23日 下午2:09:24 + * @param tableRow + * 表格行 + * @param parametersMap + * 参数map + * + */ + public void replaceTableRow(XWPFTableRow tableRow, Map parametersMap) { + + List tableCells = tableRow.getTableCells(); + for (XWPFTableCell xWPFTableCell : tableCells) { + List paragraphs = xWPFTableCell.getParagraphs(); + for (XWPFParagraph xwpfParagraph : paragraphs) { + + replaceParagraph(xwpfParagraph, parametersMap); + } + } + + } + + + + + + /** + * 根据map替换表格中的{key}标签 + * @author Juveniless + * @date 2017年12月4日 下午2:47:36 + * @param xwpfTable + * @param parametersMap + * + */ + public void replaceTable(XWPFTable xwpfTable,Map parametersMap){ + List rows = xwpfTable.getRows(); + for (XWPFTableRow xWPFTableRow : rows ) { + List tableCells = xWPFTableRow.getTableCells(); + for (XWPFTableCell xWPFTableCell : tableCells ) { + List paragraphs2 = xWPFTableCell.getParagraphs(); + for (XWPFParagraph xWPFParagraph : paragraphs2) { + replaceParagraph(xWPFParagraph, parametersMap); + } + } + } + + } + + + + private String getValueBykey(String key, Map map) { + String returnValue=""; + if (key != null) { + try { + returnValue=map.get(key)!=null ? map.get(key).toString() : ""; + } catch (Exception e) { + // TODO: handle exception + System.out.println("key:"+key+"***"+e); + returnValue=""; + } + + } + return returnValue; + } + + + + + + + + +} + + diff --git a/JSSBMJ/src/com/engine/bmj/web/MaterialCreateAction.java b/JSSBMJ/src/com/engine/bmj/web/MaterialCreateAction.java new file mode 100644 index 0000000..35bee6a --- /dev/null +++ b/JSSBMJ/src/com/engine/bmj/web/MaterialCreateAction.java @@ -0,0 +1,47 @@ +package com.engine.bmj.web; + +import com.alibaba.fastjson.JSONObject; +import com.engine.bmj.service.MaterialCreateService; +import com.engine.bmj.service.impl.MaterialCreateServiceImpl; +import com.engine.common.util.ParamUtil; +import com.engine.common.util.ServiceUtil; +import weaver.hrm.HrmUserVarify; +import weaver.hrm.User; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; +import java.util.HashMap; +import java.util.Map; + + + +public class MaterialCreateAction { + + public MaterialCreateService getService(){ + return (MaterialCreateService) ServiceUtil.getService(MaterialCreateServiceImpl.class); + + } + + @GET + @Path("/createDocByMaterial") + @Produces(MediaType.TEXT_PLAIN) + public String createDocByMaterial(@Context HttpServletRequest request, @Context HttpServletResponse response){ + + Map apidatas = new HashMap(); + try{ + Map dataMap = ParamUtil.request2Map(request); + User user = HrmUserVarify.getUser(request, response); + apidatas.putAll(getService().createDocByMaterial(dataMap,user)); + }catch (Exception e){ + apidatas.put("api_status",false); + apidatas.put("api_errormsg","exception:"+e.getMessage()); + } + return JSONObject.toJSONString(apidatas); + + } +} diff --git a/JSSBMJ/src/com/engine/secret/entity/autonumber/AcceptanceNumber.java b/JSSBMJ/src/com/engine/secret/entity/autonumber/AcceptanceNumber.java new file mode 100644 index 0000000..c41f429 --- /dev/null +++ b/JSSBMJ/src/com/engine/secret/entity/autonumber/AcceptanceNumber.java @@ -0,0 +1,24 @@ +package com.engine.secret.entity.autonumber; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @author:dxfeng + * @createTime: 2025/04/16 + * @version: 1.0 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class AcceptanceNumber { + private Integer id; + private Integer year; + private Integer month; + private Integer monthlySerial; + private Integer globalSerial; + private Integer secretType; +} diff --git a/JSSBMJ/src/com/engine/secret/entity/unpack/ApplicationResource.java b/JSSBMJ/src/com/engine/secret/entity/unpack/ApplicationResource.java new file mode 100644 index 0000000..d778014 --- /dev/null +++ b/JSSBMJ/src/com/engine/secret/entity/unpack/ApplicationResource.java @@ -0,0 +1,24 @@ +package com.engine.secret.entity.unpack; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @author:dxfeng + * @createTime: 2025/03/26 + * @version: 1.0 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class ApplicationResource { + private String id; + private String aid; + private String fid; + private String rid; + private String createdTime; + private String isDelete; +} diff --git a/JSSBMJ/src/com/engine/secret/entity/unpack/CheckFields.java b/JSSBMJ/src/com/engine/secret/entity/unpack/CheckFields.java new file mode 100644 index 0000000..7f39f2d --- /dev/null +++ b/JSSBMJ/src/com/engine/secret/entity/unpack/CheckFields.java @@ -0,0 +1,15 @@ +package com.engine.secret.entity.unpack; + +import lombok.Data; + +/** + * @author:dxfeng + * @createTime: 2025/04/30 + * @version: 1.0 + */ +@Data +public class CheckFields { + private String name; + private String fields; + private String formFields; +} diff --git a/JSSBMJ/src/com/engine/secret/entity/unpack/DataConfig.java b/JSSBMJ/src/com/engine/secret/entity/unpack/DataConfig.java new file mode 100644 index 0000000..a2ebc58 --- /dev/null +++ b/JSSBMJ/src/com/engine/secret/entity/unpack/DataConfig.java @@ -0,0 +1,29 @@ +package com.engine.secret.entity.unpack; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * @author:dxfeng + * @createTime: 2025/03/26 + * @version: 1.0 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class DataConfig { + private String id; + private String mainTableName; + private String relatedField; + private String detailTableName; + private String rootPath; + List childDataConfig; + List detailList; + List fileList; + +} diff --git a/JSSBMJ/src/com/engine/secret/entity/unpack/DataConfigDetail.java b/JSSBMJ/src/com/engine/secret/entity/unpack/DataConfigDetail.java new file mode 100644 index 0000000..aa0ddba --- /dev/null +++ b/JSSBMJ/src/com/engine/secret/entity/unpack/DataConfigDetail.java @@ -0,0 +1,31 @@ +package com.engine.secret.entity.unpack; + +import com.engine.secret.util.ModeUtil; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.apache.commons.lang.StringUtils; + +/** + * @author:dxfeng + * @createTime: 2025/03/26 + * @version: 1.0 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class DataConfigDetail { + private String fieldName; + private String path; + private String condition; + private String convertSql; + + public String getConvertSql() { + if (StringUtils.isBlank(convertSql)) { + return ""; + } + return ModeUtil.ToDBC(convertSql); + } +} diff --git a/JSSBMJ/src/com/engine/secret/entity/unpack/FileConfig.java b/JSSBMJ/src/com/engine/secret/entity/unpack/FileConfig.java new file mode 100644 index 0000000..2d935dc --- /dev/null +++ b/JSSBMJ/src/com/engine/secret/entity/unpack/FileConfig.java @@ -0,0 +1,23 @@ +package com.engine.secret.entity.unpack; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @author:dxfeng + * @createTime: 2025/03/26 + * @version: 1.0 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class FileConfig { + private String fieldName; + private String fileId; + private String isFilled; + private String fixedValue; + private String attachments; +} diff --git a/JSSBMJ/src/com/engine/secret/entity/unpack/ResourceInfo.java b/JSSBMJ/src/com/engine/secret/entity/unpack/ResourceInfo.java new file mode 100644 index 0000000..7c45f0b --- /dev/null +++ b/JSSBMJ/src/com/engine/secret/entity/unpack/ResourceInfo.java @@ -0,0 +1,26 @@ +package com.engine.secret.entity.unpack; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @author:dxfeng + * @createTime: 2025/03/26 + * @version: 1.0 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class ResourceInfo { + private String id; + private String fileName; + private String filePath; + private String fileSuffix; + private String virtualPath; + private String createdTime; + private String updatedTime; + private String isDelete; +} diff --git a/JSSBMJ/src/com/engine/secret/entity/unpack/UnpackParam.java b/JSSBMJ/src/com/engine/secret/entity/unpack/UnpackParam.java new file mode 100644 index 0000000..99c167e --- /dev/null +++ b/JSSBMJ/src/com/engine/secret/entity/unpack/UnpackParam.java @@ -0,0 +1,24 @@ +package com.engine.secret.entity.unpack; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * @author:dxfeng + * @createTime: 2025/04/30 + * @version: 1.0 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class UnpackParam { + private String docId; + private String requestId; + private boolean isCorrection; + private List checkFields; +} diff --git a/JSSBMJ/src/com/engine/secret/enums/ApplicationCategory.java b/JSSBMJ/src/com/engine/secret/enums/ApplicationCategory.java new file mode 100644 index 0000000..61238d9 --- /dev/null +++ b/JSSBMJ/src/com/engine/secret/enums/ApplicationCategory.java @@ -0,0 +1,32 @@ +package com.engine.secret.enums; + +/** + * 申请类别 + * + * @author:dxfeng + * @createTime: 2025/04/07 + * @version: 1.0 + */ +public enum ApplicationCategory { + // 涉密信息系统集成资质、国家秘密载体印制资质、武器装备科研生产单位保密资质、涉密军事设施建设保密资质 + CLASSIFIED_INFO_SYSTEM_INTEGRATION_QUALIFICATION("涉密信息系统集成资质", 0), + NATIONAL_SECRET_CARRIER_PRINTING_QUALIFICATION("国家秘密载体印制资质", 1), + WEAPON_EQUIPMENT_RESEARCH_SECURITY_QUALIFICATION("武器装备科研生产单位保密资质", 2), + CLASSIFIED_MILITARY_FACILITY_CONSTRUCTION_QUALIFICATION("涉密军事设施建设保密资质", 3); + + ApplicationCategory(String name, Integer value) { + this.name = name; + this.value = value; + } + + private String name; + private Integer value; + + public String getName() { + return name; + } + + public Integer getValue() { + return value; + } +} diff --git a/JSSBMJ/src/com/engine/secret/enums/CategoryValue.java b/JSSBMJ/src/com/engine/secret/enums/CategoryValue.java new file mode 100644 index 0000000..3ebb174 --- /dev/null +++ b/JSSBMJ/src/com/engine/secret/enums/CategoryValue.java @@ -0,0 +1,15 @@ +package com.engine.secret.enums; + +/** + * @author:dxfeng + * @createTime: 2025/04/07 + * @version: 1.0 + */ +public interface CategoryValue { + /** + * 获取值 + * + * @return + */ + int getSelectValue(); +} diff --git a/JSSBMJ/src/com/engine/secret/enums/IntegrateCategory.java b/JSSBMJ/src/com/engine/secret/enums/IntegrateCategory.java new file mode 100644 index 0000000..b5dcd96 --- /dev/null +++ b/JSSBMJ/src/com/engine/secret/enums/IntegrateCategory.java @@ -0,0 +1,44 @@ +package com.engine.secret.enums; + +/** + * 集成资质 + * + * @author:dxfeng + * @createTime: 2025/04/07 + * @version: 1.0 + */ +public enum IntegrateCategory implements CategoryValue { + // 总体集成、系统咨询、软件开发、安防监控、屏蔽室建设、运行维护、数据恢复、工程监理 + SYSTEM_INTEGRATION("总体集成", 0), + SYSTEM_CONSULTING("系统咨询", 1), + SOFTWARE_DEVELOPMENT("软件开发", 2), + SECURITY_SURVEILLANCE("安防监控", 3), + SHIELDED_ROOM_CONSTRUCTION("屏蔽室建设", 4), + OPERATION_MAINTENANCE("运行维护", 5), + DATA_RECOVERY("数据恢复", 6), + PROJECT_SUPERVISION("工程监理", 7); + + IntegrateCategory(String name, Integer value) { + this.name = name; + this.value = value; + } + + private String name; + private Integer value; + + public static IntegrateCategory getValue(String name) { + for (IntegrateCategory item : IntegrateCategory.values()) { + if (item.name.equalsIgnoreCase(name)) { + return item; + } + } + //throw new RuntimeException("不支持的操作类型"); + return null; + } + + + @Override + public int getSelectValue() { + return value; + } +} diff --git a/JSSBMJ/src/com/engine/secret/enums/PrintCategory.java b/JSSBMJ/src/com/engine/secret/enums/PrintCategory.java new file mode 100644 index 0000000..5e7afc8 --- /dev/null +++ b/JSSBMJ/src/com/engine/secret/enums/PrintCategory.java @@ -0,0 +1,41 @@ +package com.engine.secret.enums; + +/** + * 印制资质 + * + * @author:dxfeng + * @createTime: 2025/04/07 + * @version: 1.0 + */ +public enum PrintCategory implements CategoryValue { + // 涉密文件资料、国家统一考试试卷、涉密防伪票据证书、涉密光电磁介质、涉密档案数字化加工 + CLASSIFIED_DOCUMENTS("涉密文件资料", 0), + NATIONAL_EXAM_PAPERS("国家统一考试试卷", 1), + CLASSIFIED_VOUCHERS("涉密防伪票据证书", 2), + SECURE_ELECTRONIC_STORAGE("涉密光电磁介质", 3), + CLASSIFIED_DIGITIZATION("涉密档案数字化加工", 4); + + PrintCategory(String name, Integer value) { + this.name = name; + this.value = value; + } + + private String name; + private Integer value; + + public static PrintCategory getValue(String name) { + for (PrintCategory item : PrintCategory.values()) { + if (item.name.equalsIgnoreCase(name)) { + return item; + } + } + //throw new RuntimeException("不支持的操作类型"); + return null; + } + + + @Override + public int getSelectValue() { + return value; + } +} diff --git a/JSSBMJ/src/com/engine/secret/exception/CustomizeRunTimeException.java b/JSSBMJ/src/com/engine/secret/exception/CustomizeRunTimeException.java new file mode 100644 index 0000000..76b71b3 --- /dev/null +++ b/JSSBMJ/src/com/engine/secret/exception/CustomizeRunTimeException.java @@ -0,0 +1,22 @@ +package com.engine.secret.exception; + +/** + * @Author weaver_cl + * @Description: + * @Date 2023/2/21 + * @Version V1.0 + **/ +public class CustomizeRunTimeException extends RuntimeException{ + + public CustomizeRunTimeException(String message) { + super(message); + } + + public CustomizeRunTimeException(Throwable cause) { + super(cause); + } + + public CustomizeRunTimeException(String message, Throwable cause) { + super(message, cause); + } +} diff --git a/JSSBMJ/src/com/engine/secret/instance/AutoGenerateNumberInstance.java b/JSSBMJ/src/com/engine/secret/instance/AutoGenerateNumberInstance.java new file mode 100644 index 0000000..ae0b031 --- /dev/null +++ b/JSSBMJ/src/com/engine/secret/instance/AutoGenerateNumberInstance.java @@ -0,0 +1,234 @@ +package com.engine.secret.instance; + +import cn.hutool.core.convert.Convert; +import com.engine.secret.entity.autonumber.AcceptanceNumber; +import com.engine.secret.exception.CustomizeRunTimeException; +import com.engine.secret.util.ModeUtil; +import weaver.common.DateUtil; +import weaver.conn.RecordSetTrans; +import weaver.formmode.IgnoreCaseHashMap; +import weaver.general.Util; +import weaver.hrm.User; + +import java.time.LocalDate; +import java.util.Map; +import java.util.UUID; + +/** + * @author:dxfeng + * @createTime: 2025/04/16 + * @version: 1.0 + */ +public class AutoGenerateNumberInstance { + private static final String TABLE_NAME = "uf_sldh"; + private static final String RECORD_TABLE_NAME = "uf_sldh_dt1"; + + private static final AutoGenerateNumberInstance INSTANCE = new AutoGenerateNumberInstance(); + + private AutoGenerateNumberInstance() { + // 私有化构造方法 + } + + public static AutoGenerateNumberInstance getInstance() { + return INSTANCE; + } + + /** + * 集成、印制受理编号 + * + * @param param + * @return + */ + public synchronized String getAcceptanceNumber(User user, Map param) { + RecordSetTrans rs = new RecordSetTrans(); + rs.setAutoCommit(false); + try { + Integer secretType = Convert.toInt(param.get("secretType")); + String requestId = Util.null2String(param.get("requestId")); + + LocalDate now = LocalDate.now(); + int year = now.getYear(); + int currentMonth = now.getMonthValue(); + + + AcceptanceNumber yearNumber; + rs.executeQuery("select * from uf_sldh where secret_type= ? and year = ? and month = 0 FOR UPDATE", secretType, year); + if (rs.next()) { + yearNumber = getSelectNum(rs); + } else { + yearNumber = buildNewNum(year, 0, secretType); + } + yearNumber.setGlobalSerial(yearNumber.getGlobalSerial() + 1); + // 更新年度流水号 + saveNum(rs, yearNumber); + + AcceptanceNumber monthNumber; + rs.executeQuery("select * from uf_sldh where secret_type= ? and year = ? and month = ? FOR UPDATE", secretType, year, currentMonth); + if (rs.next()) { + monthNumber = getSelectNum(rs); + } else { + monthNumber = buildNewNum(year, currentMonth, secretType); + } + monthNumber.setMonthlySerial(monthNumber.getMonthlySerial() + 1); + // 更新月度、流水号 + saveNum(rs, monthNumber); + + // 生成编号 + String formattedYear = String.format("%04d", year); + String formattedMonth = String.format("%02d", monthNumber.getMonth()); + String formattedMonthlySerial = String.format("%02d", monthNumber.getMonthlySerial()); + String formattedGlobalSerial = String.format("%03d", yearNumber.getGlobalSerial()); + + String num = formattedYear + formattedMonth + formattedMonthlySerial + formattedGlobalSerial; + rs.writeLog("requestId===" + requestId + ",secretType===" + secretType + ",num===" + num); + insertGenerateRecord(rs, requestId, num, user.getUID()); + // 插入编号生成记录 + rs.commit(); + return num; + } catch (Exception e) { + rs.rollback(); + rs.writeLog(e); + throw new CustomizeRunTimeException(e.getMessage()); + } + } + + /** + * 军工受理单号 + * + * @param param + * @return + */ + public synchronized String getWarIndustryAcceptanceNumber(User user, Map param) { + RecordSetTrans rs = new RecordSetTrans(); + rs.setAutoCommit(false); + try { + Integer secretType = Convert.toInt(param.get("secretType")); + String requestId = Util.null2String(param.get("requestId")); + + LocalDate now = LocalDate.now(); + int year = now.getYear(); + + + AcceptanceNumber yearNumber; + rs.executeQuery("select * from uf_sldh where secret_type= ? and year = ? and month = 0 FOR UPDATE", secretType, year); + if (rs.next()) { + yearNumber = getSelectNum(rs); + } else { + yearNumber = buildNewNum(year, 0, secretType); + } + yearNumber.setGlobalSerial(yearNumber.getGlobalSerial() + 1); + // 更新年度流水号 + saveNum(rs, yearNumber); + + // 生成编号 + String formattedYear = String.format("%04d", year); + String formattedGlobalSerial = String.format("%03d", yearNumber.getGlobalSerial()); + + String num = "JS" + formattedYear + formattedGlobalSerial; + rs.writeLog("requestId===" + requestId + ",secretType===" + secretType + ",num===" + num); + insertGenerateRecord(rs, requestId, num, user.getUID()); + rs.commit(); + return num; + } catch (Exception e) { + rs.rollback(); + rs.writeLog(e); + throw new CustomizeRunTimeException(e.getMessage()); + } + } + + /** + * 构建查询对象 + * + * @param rs + * @return + */ + private AcceptanceNumber getSelectNum(RecordSetTrans rs) { + return AcceptanceNumber.builder() + .id(rs.getInt("id")) + .year(rs.getInt("year")) + .month(rs.getInt("month")) + .monthlySerial(rs.getInt("monthly_serial")) + .globalSerial(rs.getInt("global_serial")) + .secretType(rs.getInt("secret_type")) + .build(); + } + + /** + * 构建新对象 + * + * @param year + * @param currentMonth + * @param secretType + * @return + */ + private AcceptanceNumber buildNewNum(Integer year, Integer currentMonth, Integer secretType) { + return AcceptanceNumber.builder() + .year(year) + .month(currentMonth) + .monthlySerial(0) + .globalSerial(0) + .secretType(secretType) + .build(); + } + + /** + * 保存编号数据 + * + * @param rs + * @param number + * @throws Exception + */ + private void saveNum(RecordSetTrans rs, AcceptanceNumber number) throws Exception { + if (null == number.getId()) { + Map insertMap = buildSaveMap(number); + String uuid = UUID.randomUUID().toString(); + insertMap.put("modeuuid", uuid); + int formModeId = ModeUtil.getModeIdByTableName(TABLE_NAME); + insertMap.put("formmodeid", formModeId); + ModeUtil.buildModeInsertFields(insertMap, 1); + ModeUtil.insertData(rs, insertMap, TABLE_NAME); + ModeUtil.refreshRight(uuid, TABLE_NAME, formModeId, 1); + } else { + Map updateMap = buildSaveMap(number); + ModeUtil.buildModeUpdateFields(updateMap, 1); + ModeUtil.updateDataById(rs, updateMap, TABLE_NAME); + } + + } + + /** + * 构建数据库映射关系 + * + * @param number + * @return + */ + private IgnoreCaseHashMap buildSaveMap(AcceptanceNumber number) { + IgnoreCaseHashMap dataMap = new IgnoreCaseHashMap<>(); + if (null != number.getId()) { + dataMap.put("id", number.getId()); + } + dataMap.put("year", number.getYear()); + dataMap.put("month", number.getMonth()); + dataMap.put("monthly_serial", number.getMonthlySerial()); + dataMap.put("global_serial", number.getGlobalSerial()); + dataMap.put("secret_type", number.getSecretType()); + return dataMap; + } + + /** + * 插入编号生成记录 + * + * @param requestId + * @param num + * @param userId + */ + private void insertGenerateRecord(RecordSetTrans rs, String requestId, String num, int userId) throws Exception { + IgnoreCaseHashMap dataMap = new IgnoreCaseHashMap<>(); + dataMap.put("request_id", requestId); + dataMap.put("num", num); + dataMap.put("operate_user", userId); + dataMap.put("operate_time", DateUtil.getFullDate()); + ModeUtil.insertData(rs, dataMap, RECORD_TABLE_NAME); + + } +} diff --git a/JSSBMJ/src/com/engine/secret/service/AuthorityChangeService.java b/JSSBMJ/src/com/engine/secret/service/AuthorityChangeService.java new file mode 100644 index 0000000..4c5ebb9 --- /dev/null +++ b/JSSBMJ/src/com/engine/secret/service/AuthorityChangeService.java @@ -0,0 +1,19 @@ +package com.engine.secret.service; + +import java.util.Map; + +/** + * @author:dxfeng + * @createTime: 2025/04/09 + * @version: 1.0 + */ +public interface AuthorityChangeService { + + /** + * 将审批事权移交至省级 + * + * @param param + * @return + */ + Map delegateToProvincialAuthority(Map param); +} diff --git a/JSSBMJ/src/com/engine/secret/service/AutoGenerateNumberService.java b/JSSBMJ/src/com/engine/secret/service/AutoGenerateNumberService.java new file mode 100644 index 0000000..21c6310 --- /dev/null +++ b/JSSBMJ/src/com/engine/secret/service/AutoGenerateNumberService.java @@ -0,0 +1,18 @@ +package com.engine.secret.service; + +import java.util.Map; + +/** + * @author:dxfeng + * @createTime: 2025/04/16 + * @version: 1.0 + */ +public interface AutoGenerateNumberService { + /** + * 获取受理单号 + * + * @param param + * @return + */ + String getAcceptanceNumber(Map param) ; +} diff --git a/JSSBMJ/src/com/engine/secret/service/QualificationApplicationService.java b/JSSBMJ/src/com/engine/secret/service/QualificationApplicationService.java new file mode 100644 index 0000000..26284db --- /dev/null +++ b/JSSBMJ/src/com/engine/secret/service/QualificationApplicationService.java @@ -0,0 +1,27 @@ +package com.engine.secret.service; + +import java.util.Map; + +/** + * @author:dxfeng + * @createTime: 2024/08/29 + * @version: 1.0 + */ +public interface QualificationApplicationService { + + /** + * 解析文件 + * + * @param param + * @return + */ + Map parsingFiles(Map param); + + /** + * 删除已经解析的数据 + * + * @param params + * @return + */ + Map deleteParsedData(Map params); +} diff --git a/JSSBMJ/src/com/engine/secret/service/UnpackZipService.java b/JSSBMJ/src/com/engine/secret/service/UnpackZipService.java new file mode 100644 index 0000000..cb6596e --- /dev/null +++ b/JSSBMJ/src/com/engine/secret/service/UnpackZipService.java @@ -0,0 +1,43 @@ +package com.engine.secret.service; + +import com.engine.secret.entity.unpack.UnpackParam; +import com.fasterxml.jackson.databind.JsonNode; +import net.lingala.zip4j.ZipFile; +import net.lingala.zip4j.model.FileHeader; + +import java.util.Map; + +/** + * @author:dxfeng + * @createTime: 2025/03/26 + * @version: 1.0 + */ +public interface UnpackZipService { + + /** + * 材料收件 + * + * @param unpackParam + * @param rootNode + * @param imageFileMap + * @return + * @throws Exception + */ + Map registerAcceptance(ZipFile zipFile, UnpackParam unpackParam, JsonNode rootNode, Map imageFileMap) throws Exception; + + /** + * 材料补正 + * + * @return + */ + Map reviewResubmittedMaterials(ZipFile zipFile, String requestId, JsonNode rootNode, Map imageFileMap); + + /** + * 删除文件解析数据 + * + * @param param + * @return + */ + Map deleteParsedData(Map param); + +} diff --git a/JSSBMJ/src/com/engine/secret/service/impl/AuthorityChangeServiceImpl.java b/JSSBMJ/src/com/engine/secret/service/impl/AuthorityChangeServiceImpl.java new file mode 100644 index 0000000..528c66c --- /dev/null +++ b/JSSBMJ/src/com/engine/secret/service/impl/AuthorityChangeServiceImpl.java @@ -0,0 +1,67 @@ +package com.engine.secret.service.impl; + +import com.engine.core.impl.Service; +import com.engine.secret.exception.CustomizeRunTimeException; +import com.engine.secret.service.AuthorityChangeService; +import com.engine.secret.util.FlowUtil; +import com.engine.secret.util.ModeUtil; +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang.StringUtils; +import weaver.common.DateUtil; +import weaver.conn.RecordSet; +import weaver.general.Util; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author:dxfeng + * @createTime: 2025/04/09 + * @version: 1.0 + */ +public class AuthorityChangeServiceImpl extends Service implements AuthorityChangeService { + @Override + public Map delegateToProvincialAuthority(Map param) { + RecordSet rs = new RecordSet(); + String ids = Util.null2String(param.get("ids")); + if (StringUtils.isBlank(ids)) { + throw new CustomizeRunTimeException("请至少选择一条数据"); + } + String customId = Util.null2String(param.get("customId")); + if (StringUtils.isBlank(customId)) { + throw new CustomizeRunTimeException("未获取到查询列表ID"); + } + String modeTableName = ModeUtil.getTableNameByCustomId(customId); + rs.writeLog("ids==" + ids); + rs.writeLog("customId==" + customId); + rs.writeLog("modeTableName==" + modeTableName); + String options = user.getLastname() + "-自动提交流程-"; + + // 查询对应的流程,并更新 + String[] split = ids.split(","); + for (String s : split) { + rs.writeLog("id==" + s); + // 更新事权类别为省级事权 + rs.executeUpdate("update " + modeTableName + " set bmzzzgsqlb = ?,tjdqjd = ? where id =? ", 0, 1, s); + // 查询对应的requestId + rs.executeQuery("select requestId from " + modeTableName + " where id = ?", s); + if (rs.next()) { + String requestId = rs.getString("requestId"); + rs.writeLog("requestId==" + requestId); + List currentUserIds = FlowUtil.getCurrentUserIds(requestId); + if (CollectionUtils.isEmpty(currentUserIds)) { + throw new CustomizeRunTimeException("requestId[" + requestId + "],流程提交失败,未获取到当前节点处理人"); + } + + String submitResult = FlowUtil.submitWorkflowRequest(requestId, currentUserIds.get(0), options + DateUtil.getFullDate()); + if (!"success".equals(submitResult)) { + throw new CustomizeRunTimeException("requestId[" + requestId + "],流程提交失败"); + } + } + } + + + return new HashMap<>(); + } +} diff --git a/JSSBMJ/src/com/engine/secret/service/impl/AutoGenerateNumberServiceImpl.java b/JSSBMJ/src/com/engine/secret/service/impl/AutoGenerateNumberServiceImpl.java new file mode 100644 index 0000000..98c19e1 --- /dev/null +++ b/JSSBMJ/src/com/engine/secret/service/impl/AutoGenerateNumberServiceImpl.java @@ -0,0 +1,42 @@ +package com.engine.secret.service.impl; + +import cn.hutool.core.convert.Convert; +import com.engine.core.impl.Service; +import com.engine.secret.exception.CustomizeRunTimeException; +import com.engine.secret.instance.AutoGenerateNumberInstance; +import com.engine.secret.service.AutoGenerateNumberService; +import weaver.conn.RecordSet; + +import java.util.Map; + +/** + * @author:dxfeng + * @createTime: 2025/04/16 + * @version: 1.0 + */ +public class AutoGenerateNumberServiceImpl extends Service implements AutoGenerateNumberService { + + @Override + public String getAcceptanceNumber(Map param) { + Integer secretType = Convert.toInt(param.get("secretType")); + Integer requestId = Convert.toInt(param.get("requestId")); + if (null == secretType) { + throw new CustomizeRunTimeException("未获取到[保密资质(资格)类型],请检查表单数据"); + } + // 查询当前请求是否已经生成单号,如已生成过,直接取原来单号,不重新生成 + RecordSet rs = new RecordSet(); + rs.executeQuery("select num from uf_sldh_dt1 where request_id = ? ", requestId); + if (rs.next()) { + return rs.getString("num"); + } + + AutoGenerateNumberInstance instance = AutoGenerateNumberInstance.getInstance(); + if (0 == secretType || 1 == secretType) { + // 集成、印制 + return instance.getAcceptanceNumber(user, param); + } else { + // 军工 + return instance.getWarIndustryAcceptanceNumber(user, param); + } + } +} diff --git a/JSSBMJ/src/com/engine/secret/service/impl/OfflineZipUnpackServiceImpl.java b/JSSBMJ/src/com/engine/secret/service/impl/OfflineZipUnpackServiceImpl.java new file mode 100644 index 0000000..4ec83d0 --- /dev/null +++ b/JSSBMJ/src/com/engine/secret/service/impl/OfflineZipUnpackServiceImpl.java @@ -0,0 +1,1135 @@ +package com.engine.secret.service.impl; + +import cn.hutool.core.convert.Convert; +import com.alibaba.fastjson.JSON; +import com.engine.core.impl.Service; +import com.engine.secret.entity.unpack.*; +import com.engine.secret.exception.CustomizeRunTimeException; +import com.engine.secret.service.UnpackZipService; +import com.engine.secret.util.ConfigUtil; +import com.engine.secret.util.FieldConvertUtil; +import com.engine.secret.util.FlowUtil; +import com.engine.secret.util.ModeUtil; +import com.fasterxml.jackson.databind.JsonNode; +import com.wbi.util.Util; +import com.weaver.formmodel.data.model.Formfield; +import net.lingala.zip4j.ZipFile; +import net.lingala.zip4j.model.FileHeader; +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang.StringUtils; +import weaver.conn.RecordSet; +import weaver.formmode.IgnoreCaseHashMap; +import weaver.general.BaseBean; +import weaver.systeminfo.SystemEnv; + +import java.io.InputStream; +import java.util.*; +import java.util.concurrent.ConcurrentHashMap; +import java.util.stream.Collectors; + +/** + * 离线数据包解析实现类 + * + * @author:dxfeng + * @createTime: 2025/03/26 + * @version: 1.0 + */ +public class OfflineZipUnpackServiceImpl extends Service implements UnpackZipService { + + /** + * 解析类型,当前解析类,固定值为0 + */ + private static final String SOURCE_TYPE = "0"; + + /** + * 文件上传目录 + */ + private int uploadCatalogue; + + private Map> applicationResourceMap; + private Map> resourceInfoMap; + private Map fileHeaderMap; + private String relatedFlowId; + private final Map returnMap = new HashMap<>(); + private ZipFile zipFile; + + private final Map> insertTableMap = new ConcurrentHashMap<>(); + + private final BaseBean baseBean = new BaseBean(); + + @Override + public Map registerAcceptance(ZipFile zipFile, UnpackParam unpackParam, JsonNode rootNode, Map imageFileMap) { + try { + initializeResources(zipFile, unpackParam.getRequestId(), imageFileMap); + insertDataAndFiles(rootNode, unpackParam); + } catch (Exception e) { + baseBean.writeLog(e); + throw new CustomizeRunTimeException(e.getMessage()); + } + returnMap.put("data", insertTableMap); + return returnMap; + } + + @Override + public Map reviewResubmittedMaterials(ZipFile zipFile, String requestId, JsonNode rootNode, Map imageFileMap) { + try { + initializeResources(zipFile, requestId, imageFileMap); + updateCorrectedMaterials(rootNode); + } catch (Exception e) { + baseBean.writeLog(e); + throw new CustomizeRunTimeException(e); + } + return returnMap; + } + + @Override + public Map deleteParsedData(Map param) { + String requestId = Util.null2String(param.get("requestId")); + String isCorrection = Util.null2String(param.get("isCorrection")); + + // 读取配置表 + RecordSet rs = new RecordSet(); + List dataConfig = getDataConfig("0"); + + if ("true".equals(isCorrection)) { + // 补正 + } else { + // 非补正 + for (DataConfig config : dataConfig) { + String mainTableName = config.getMainTableName(); + String relatedField = config.getRelatedField(); + List childDataConfig = config.getChildDataConfig(); + + String sql = "select id from " + mainTableName + " where " + relatedField + " =?"; + rs.executeQuery(sql, requestId); + if (rs.next()) { + int billId = rs.getInt("id"); + if (billId < 0) { + continue; + } + // 删除明细表数据 + for (DataConfig childConfig : childDataConfig) { + String detailTableName = childConfig.getDetailTableName(); + rs.executeUpdate("delete from " + detailTableName + " where mainid = ?", billId); + } + // 删除主表数据 + rs.executeUpdate("delete from " + mainTableName + " where id = ?", billId); + } + } + + } + return null; + } + + /** + * 初始化全局变量数据 + * + * @param zipFile + * @param requestId + * @param imageFileMap + */ + private void initializeResources(ZipFile zipFile, String requestId, Map imageFileMap) { + this.fileHeaderMap = imageFileMap; + this.relatedFlowId = requestId; + this.zipFile = zipFile; + } + + + /** + * 更新补正文件 + * + * @param rootNode + * @throws Exception + */ + private void updateCorrectedMaterials(JsonNode rootNode) throws Exception { + initializeUploadCatalogue(); + List dataConfigList = getDataConfig(SOURCE_TYPE); + baseBean.writeLog("dataConfigList==" + JSON.toJSONString(dataConfigList)); + + initializeResourceMaps(rootNode); + + if (CollectionUtils.isNotEmpty(dataConfigList)) { + processDataConfigForUpdate(dataConfigList); + } + } + + /** + * 初始化文件上传目录 + */ + private void initializeUploadCatalogue() { + String uploadCatalogueStr = ConfigUtil.getConfig("UPLOAD_CATALOGUE"); + if (StringUtils.isBlank(uploadCatalogueStr)) { + throw new CustomizeRunTimeException("未获取到解析文件目录设置,检查配置[uf_config]"); + } + uploadCatalogue = Convert.toInt(uploadCatalogueStr, -1); + baseBean.writeLog("uploadCatalogue==" + uploadCatalogue); + } + + /** + * 解析JSON文件,构建applicationResourceMap、resourceInfoMap + * + * @param rootNode + */ + private void initializeResourceMaps(JsonNode rootNode) { + List applicationResourceList = getApplicationResourceList(rootNode); + applicationResourceMap = applicationResourceList.stream() + .collect(Collectors.groupingBy(ApplicationResource::getFid)); + baseBean.writeLog("applicationResourceMap==" + JSON.toJSONString(applicationResourceMap)); + + List resourceInfoList = getResourceInfoList(rootNode); + resourceInfoMap = resourceInfoList.stream() + .collect(Collectors.groupingBy(ResourceInfo::getVirtualPath, + Collectors.toMap(ResourceInfo::getId, item -> item))); + baseBean.writeLog("resourceInfoMap==" + JSON.toJSONString(resourceInfoMap)); + } + + /** + * 更新主表补正文件数据 + * + * @param dataConfigList + * @throws Exception + */ + private void processDataConfigForUpdate(List dataConfigList) throws Exception { + RecordSet rs = new RecordSet(); + for (DataConfig dataConfig : dataConfigList) { + String mainTableName = dataConfig.getMainTableName(); + String relatedField = dataConfig.getRelatedField(); + String rootPath = dataConfig.getRootPath(); + baseBean.writeLog("rootPath==" + rootPath); + + List childDataConfigList = dataConfig.getChildDataConfig(); + List fieldDetailList = dataConfig.getDetailList(); + List fileList = dataConfig.getFileList(); + + if (CollectionUtils.isNotEmpty(fieldDetailList)) { + String sql = "select id from " + mainTableName + " where " + relatedField + " =?"; + rs.executeQuery(sql, relatedFlowId); + if (rs.next()) { + int billId = rs.getInt("id"); + if (billId < 0) { + continue; + } + + updateFileList(billId, fileList, mainTableName, false); + + if (CollectionUtils.isNotEmpty(childDataConfigList)) { + processChildDataConfigForUpdate(billId, childDataConfigList); + } + } + } + } + } + + /** + * 更新明细表补正文件数据 + * + * @param billId + * @param childDataConfigList + * @throws Exception + */ + private void processChildDataConfigForUpdate(int billId, List childDataConfigList) throws + Exception { + for (DataConfig childDataConfig : childDataConfigList) { + String detailTableName = childDataConfig.getDetailTableName(); + List childFileList = childDataConfig.getFileList(); + + if (CollectionUtils.isNotEmpty(childFileList)) { + baseBean.writeLog("开始解析文件,写入明细数据"); + updateFileList(billId, childFileList, detailTableName, true); + } + } + } + + /** + * 文件列表更新 + * + * @param mainId + * @param fileConfigList + * @param tableName + * @param isDetail + * @throws Exception + */ + private void updateFileList(int mainId, List fileConfigList, String tableName, boolean isDetail) throws Exception { + Map dataMap = new HashMap(); + String fileTypeField = ""; + String fileTypeValue = ""; + + for (FileConfig fileConfig : fileConfigList) { + String fieldName = fileConfig.getFieldName(); + String fileId = fileConfig.getFileId(); + String fixedValue = fileConfig.getFixedValue(); + String attachments = fileConfig.getAttachments(); + + if (StringUtils.isNotBlank(fixedValue)) { + continue; + } + + if (StringUtils.isNotBlank(attachments)) { + fileTypeField = fieldName; + fileTypeValue = attachments; + continue; + } + + if (!"2".equals(fileConfig.getIsFilled())) { + continue; + } + + List applicationResources = applicationResourceMap.get(fileId); + if (CollectionUtils.isEmpty(applicationResources)) { + baseBean.writeLog("根据fid未获取到数据,fileId==" + fileId); + continue; + } + + Map fileResourceMap = resourceInfoMap.get(fileConfig.getIsFilled()); + if (fileResourceMap == null || fileResourceMap.isEmpty()) { + baseBean.writeLog("根据文件类型未获取到数据,isFilled==" + fileConfig.getIsFilled()); + continue; + } + + List docIds = processFileResources(applicationResources, fileResourceMap); + if (!docIds.isEmpty()) { + dataMap.put(fieldName, StringUtils.join(docIds, ",")); + } + } + + if (dataMap.isEmpty() || StringUtils.isBlank(fileTypeField) || StringUtils.isBlank(fileTypeValue)) { + baseBean.writeLog("dataMap.size==" + dataMap.size()); + baseBean.writeLog("fileTypeField==" + fileTypeField); + baseBean.writeLog("fileTypeValue==" + fileTypeValue); + return; + } + + baseBean.writeLog("文件更新集合,dataMap==" + JSON.toJSONString(dataMap)); + updateData(mainId, dataMap, tableName, isDetail, fileTypeField, fileTypeValue); + } + + /** + * 上传对应的文件,返回docId集合 + * + * @param applicationResources + * @param fileResourceMap + * @return + * @throws Exception + */ + private List processFileResources(List applicationResources, + Map fileResourceMap) throws Exception { + List docIds = new ArrayList<>(); + + for (ApplicationResource resource : applicationResources) { + ResourceInfo resourceInfo = fileResourceMap.get(resource.getRid()); + if (resourceInfo == null) { + baseBean.writeLog("根据文件rid未获取到数据,rid==" + resource.getRid()); + continue; + } + + int imageFileId = generateImageFileId(zipFile, fileHeaderMap.get(resourceInfo.getFileName()), + resourceInfo.getFileName()); + int docId = ModeUtil.createDocId(uploadCatalogue, imageFileId, user); + docIds.add(docId); + } + + return docIds; + } + + + /** + * 更新补正文件数据 + * + * @param mainId + * @param dataMap + * @param tableName + * @param isDetail + * @param fileTypeField + * @param fileTypeValue + */ + private void updateData(int mainId, Map dataMap, String tableName, + boolean isDetail, String fileTypeField, String fileTypeValue) { + if (isDetail) { + //dataMap.put("mainid", mainId); + String whereSql = " where mainid = " + mainId + " and " + fileTypeField + "=" + fileTypeValue; + baseBean.writeLog("whereSql===" + whereSql); + ModeUtil.updateData(dataMap, tableName, whereSql); + } else { + dataMap.put("id", mainId); + ModeUtil.updateDataById(dataMap, tableName); + } + } + + /** + * 插入数据和文件 + * + * @param rootNode + * @throws Exception + */ + private void insertDataAndFiles(JsonNode rootNode, UnpackParam unpackParam) throws Exception { + initializeUploadCatalogue(); + List dataConfigList = getDataConfig(SOURCE_TYPE); + baseBean.writeLog("dataConfigList==" + JSON.toJSONString(dataConfigList)); + + checkDatas(dataConfigList, rootNode, unpackParam); + initializeResourceMaps(rootNode); + + if (CollectionUtils.isNotEmpty(dataConfigList)) { + processDataConfigForInsert(rootNode, dataConfigList); + } + } + + /** + * 校验数据是否一致 + * + * @param dataConfigList + * @param rootNode + * @param unpackParam + * @throws Exception + */ + private void checkDatas(List dataConfigList, JsonNode rootNode, UnpackParam unpackParam) throws Exception { + // 字段校验 + List checkFields = unpackParam.getCheckFields(); + String requestId = unpackParam.getRequestId(); + Map dataConfigMap = dataConfigList.stream().collect(Collectors.toMap(DataConfig::getMainTableName, item -> item, (k1, k2) -> k1)); + for (CheckFields checkField : checkFields) { + DataConfig dataConfig = dataConfigMap.get(checkField.getName()); + + + String fields = checkField.getFields(); + String formFields = checkField.getFormFields(); + if (StringUtils.isNotBlank(fields) && StringUtils.isNotBlank(formFields)) { + String[] fieldArray = fields.split(","); + String[] formFieldsArray = formFields.split(","); + if (fieldArray.length != formFieldsArray.length) { + throw new CustomizeRunTimeException("表单校验参数格式错误"); + } + List formFieldList = ModeUtil.getFieldList(dataConfig.getMainTableName()); + Map mainTableFieldMap = formFieldList.stream() + .filter(item -> item.getViewtype() == 0) + .collect(Collectors.toMap(Formfield::getFieldname, + item -> item, (k1, k2) -> k1)); + + String tableNameByRequestId = FlowUtil.getTableNameByRequestId(requestId); + RecordSet rs = new RecordSet(); + rs.executeQuery("select * from " + tableNameByRequestId + " where requestId = ?", requestId); + + IgnoreCaseHashMap flowDataMap = ModeUtil.getSingleRecordMap(rs); + + // 根据根结点,获取配置 + String rootPath = dataConfig.getRootPath(); + JsonNode checkNode; + if (StringUtils.isBlank(rootPath)) { + checkNode = rootNode; + } else { + checkNode = rootNode.get(rootPath); + } + if (null == checkNode) { + throw new CustomizeRunTimeException("未获取到根结点数据[" + rootPath + "]"); + } + + List detailList = dataConfig.getDetailList(); + Map configDetailMap = detailList.stream().collect(Collectors.toMap(DataConfigDetail::getFieldName, item -> item, (k1, k2) -> k1)); + for (int i = 0; i < fieldArray.length; i++) { + String field = fieldArray[i]; + String formField = formFieldsArray[i]; + boolean check = processFieldForCheck(checkNode, configDetailMap.get(field), mainTableFieldMap, Util.null2String(flowDataMap.get(formField))); + if (!check) { + Formfield formfield = mainTableFieldMap.get(field); + throw new CustomizeRunTimeException("[" + SystemEnv.getHtmlLabelName(formfield.getFieldlabel(), user.getLanguage()) + "]字段校验不通过,表单填写内容与解析包对应内容不一致"); + } + } + } + } + } + + /** + * 解析配置表 + * + * @param rootNode + * @param dataConfigList + * @throws Exception + */ + private void processDataConfigForInsert(JsonNode rootNode, List dataConfigList) throws Exception { + for (DataConfig dataConfig : dataConfigList) { + String mainTableName = dataConfig.getMainTableName(); + String relatedField = dataConfig.getRelatedField(); + String rootPath = dataConfig.getRootPath(); + baseBean.writeLog("rootPath==" + rootPath); + + List fieldDetailList = dataConfig.getDetailList(); + List childDataConfigList = dataConfig.getChildDataConfig(); + List fileList = dataConfig.getFileList(); + + List formFieldList = ModeUtil.getFieldList(mainTableName); + Map mainTableFieldMap = formFieldList.stream() + .filter(item -> item.getViewtype() == 0) + .collect(Collectors.toMap(Formfield::getFieldname, + item -> item, (k1, k2) -> k1)); + + if (CollectionUtils.isNotEmpty(fieldDetailList)) { + processRootPath(rootNode, mainTableName, relatedField, fieldDetailList, + mainTableFieldMap, childDataConfigList, formFieldList, fileList, rootPath); + } + } + } + + /** + * 根据根路径配置,判断处理方式 + * + * @param rootNode + * @param mainTableName + * @param relatedField + * @param fieldDetailList + * @param mainTableFieldMap + * @param childDataConfigList + * @param formFieldList + * @param fileList + * @param rootPath + * @throws Exception + */ + private void processRootPath(JsonNode rootNode, String mainTableName, String relatedField, + List fieldDetailList, Map mainTableFieldMap, + List childDataConfigList, List formFieldList, + List fileList, String rootPath) throws Exception { + if (StringUtils.isNotBlank(rootPath)) { + if (rootPath.contains("[*]")) { + processArrayRootPath(rootNode, mainTableName, relatedField, fieldDetailList, + mainTableFieldMap, childDataConfigList, formFieldList, + fileList, rootPath); + } else { + processSingleRootPath(rootNode, mainTableName, relatedField, fieldDetailList, + mainTableFieldMap, childDataConfigList, formFieldList, + fileList, rootPath); + } + } else { + processRootNode(rootNode, mainTableName, relatedField, fieldDetailList, + mainTableFieldMap, childDataConfigList, formFieldList, fileList); + } + } + + /** + * 处理数组数据 + * + * @param rootNode + * @param mainTableName + * @param relatedField + * @param fieldDetailList + * @param mainTableFieldMap + * @param childDataConfigList + * @param formFieldList + * @param fileList + * @param rootPath + * @throws Exception + */ + private void processArrayRootPath(JsonNode rootNode, String mainTableName, String relatedField, + List fieldDetailList, Map mainTableFieldMap, + List childDataConfigList, List formFieldList, + List fileList, String rootPath) throws Exception { + String path = rootPath.replace("[*]", ""); + JsonNode jsonNode = rootNode.at(path); + + if (jsonNode == null) { + throw new CustomizeRunTimeException("数据解析失败,未找到对应字段:[" + path + "]"); + } + if (!jsonNode.isArray()) { + throw new CustomizeRunTimeException("数据解析失败,未找到对应字段集合:[" + path + "]"); + } + Set tableIdList = getTableIdList(mainTableName); + for (JsonNode node : jsonNode) { + int billId = insertMainTable(node, mainTableName, relatedField, fieldDetailList, mainTableFieldMap); + if (billId < 0) { + continue; + } + tableIdList.add(billId); + dealDetailData(rootNode, billId, childDataConfigList, formFieldList); + dealFileList(billId, fileList, mainTableName, false); + } + } + + /** + * 处理单节点数据 + * + * @param rootNode + * @param mainTableName + * @param relatedField + * @param fieldDetailList + * @param mainTableFieldMap + * @param childDataConfigList + * @param formFieldList + * @param fileList + * @param rootPath + * @throws Exception + */ + private void processSingleRootPath(JsonNode rootNode, String mainTableName, String relatedField, + List fieldDetailList, Map mainTableFieldMap, + List childDataConfigList, List formFieldList, + List fileList, String rootPath) throws Exception { + JsonNode jsonNode = rootNode.at(rootPath); + int billId = insertMainTable(jsonNode, mainTableName, relatedField, fieldDetailList, mainTableFieldMap); + if (billId < 0) { + return; + } + getTableIdList(mainTableName).add(billId); + dealDetailData(rootNode, billId, childDataConfigList, formFieldList); + dealFileList(billId, fileList, mainTableName, false); + } + + /** + * 处理完整节点数据 + * + * @param rootNode + * @param mainTableName + * @param relatedField + * @param fieldDetailList + * @param mainTableFieldMap + * @param childDataConfigList + * @param formFieldList + * @param fileList + * @throws Exception + */ + private void processRootNode(JsonNode rootNode, String mainTableName, String relatedField, + List fieldDetailList, Map mainTableFieldMap, + List childDataConfigList, List formFieldList, + List fileList) throws Exception { + + int billId = insertMainTable(rootNode, mainTableName, relatedField, fieldDetailList, mainTableFieldMap); + if (billId < 0) { + return; + } + getTableIdList(mainTableName).add(billId); + dealDetailData(rootNode, billId, childDataConfigList, formFieldList); + dealFileList(billId, fileList, mainTableName, false); + } + + /** + * 处理明细表数据 + * + * @param rootNode + * @param mainId + * @param childDataConfigList + * @param formFieldList + * @throws Exception + */ + private void dealDetailData(JsonNode rootNode, int mainId, List childDataConfigList, + List formFieldList) throws Exception { + if (CollectionUtils.isEmpty(childDataConfigList)) { + return; + } + + for (DataConfig childDataConfig : childDataConfigList) { + String detailTableName = childDataConfig.getDetailTableName(); + Map detailTableFieldMap = formFieldList.stream() + .filter(item -> detailTableName.equals(item.getDetailtable())) + .collect(Collectors.toMap(Formfield::getFieldname, + item -> item, (k1, k2) -> k1)); + + List fieldList = childDataConfig.getDetailList(); + List fileList = childDataConfig.getFileList(); + + if (CollectionUtils.isNotEmpty(fileList)) { + baseBean.writeLog("开始解析文件,写入明细数据"); + dealFileList(mainId, fileList, detailTableName, true); + } else { + processDetailRootPath(rootNode, detailTableName, mainId, fieldList, detailTableFieldMap, + childDataConfig.getRootPath()); + } + } + } + + /** + * 根据明细表根路径配置,判断处理方式 + * + * @param rootNode + * @param detailTableName + * @param mainId + * @param fieldList + * @param detailTableFieldMap + * @param rootPath + * @throws Exception + */ + private void processDetailRootPath(JsonNode rootNode, String detailTableName, int mainId, + List fieldList, Map detailTableFieldMap, + String rootPath) throws Exception { + if (StringUtils.isNotBlank(rootPath)) { + if (rootPath.contains("[*]")) { + processDetailArrayRootPath(rootNode, detailTableName, mainId, fieldList, + detailTableFieldMap, rootPath); + } else { + processDetailSingleRootPath(rootNode, detailTableName, mainId, fieldList, + detailTableFieldMap, rootPath); + } + } else { + insertDetailTable(rootNode, detailTableName, mainId, fieldList, detailTableFieldMap); + } + } + + /** + * 处理明细表数据数据 + * + * @param rootNode + * @param detailTableName + * @param mainId + * @param fieldList + * @param detailTableFieldMap + * @param rootPath + * @throws Exception + */ + private void processDetailArrayRootPath(JsonNode rootNode, String detailTableName, int mainId, + List fieldList, Map detailTableFieldMap, + String rootPath) throws Exception { + String path = rootPath.replace("[*]", ""); + JsonNode jsonNode = rootNode.at(path); + + if (jsonNode == null) { + throw new CustomizeRunTimeException("数据解析失败,未找到对应字段:[" + path + "]"); + } + if (!jsonNode.isArray()) { + throw new CustomizeRunTimeException("数据解析失败,未找到对应字段集合:[" + path + "]"); + } + + for (JsonNode node : jsonNode) { + insertDetailTable(node, detailTableName, mainId, fieldList, detailTableFieldMap); + } + } + + /** + * 处理明细表单节点数据 + * + * @param rootNode + * @param detailTableName + * @param mainId + * @param fieldList + * @param detailTableFieldMap + * @param rootPath + * @throws Exception + */ + private void processDetailSingleRootPath(JsonNode rootNode, String detailTableName, int mainId, + List fieldList, Map detailTableFieldMap, + String rootPath) throws Exception { + JsonNode jsonNode = rootNode.at(rootPath); + insertDetailTable(jsonNode, detailTableName, mainId, fieldList, detailTableFieldMap); + } + + /** + * 插入主表数据 + * + * @param jsonNode + * @param mainTableName + * @param relatedField + * @param fieldList + * @param mainTableFieldMap + * @return + * @throws Exception + */ + private int insertMainTable(JsonNode jsonNode, String mainTableName, String relatedField, + List fieldList, Map mainTableFieldMap) throws Exception { + Map insertMap = new HashMap(); + + for (DataConfigDetail fieldDetail : fieldList) { + processFieldForInsert(jsonNode, insertMap, fieldDetail, mainTableFieldMap); + } + + if (insertMap.isEmpty()) { + return -1; + } + + if (StringUtils.isNotBlank(relatedField)) { + insertMap.put(relatedField, relatedFlowId); + } + + String uuid = UUID.randomUUID().toString(); + insertMap.put("modeuuid", uuid); + int formModeId = ModeUtil.getModeIdByTableName(mainTableName); + insertMap.put("formmodeid", formModeId); + + ModeUtil.buildModeInsertFields(insertMap, user.getUID()); + baseBean.writeLog("insertMainTable: " + JSON.toJSONString(insertMap)); + + ModeUtil.insertData(insertMap, mainTableName); + return ModeUtil.refreshRight(uuid, mainTableName, formModeId, user.getUID()); + } + + /** + * 构建待插入数据的字段集合 + * + * @param jsonNode + * @param insertMap + * @param fieldDetail + * @param fieldMap + * @throws Exception + */ + private boolean processFieldForInsert(JsonNode jsonNode, Map insertMap, + DataConfigDetail fieldDetail, Map fieldMap) throws Exception { + String fieldName = fieldDetail.getFieldName(); + JsonNode atNode = jsonNode.at(fieldDetail.getPath()); + + if (atNode != null) { + String value = atNode.asText(); + if (StringUtils.isNotBlank(fieldDetail.getCondition()) && !value.equals(fieldDetail.getCondition())) { + return true; + } + + Formfield formfield = fieldMap.get(fieldName.toLowerCase()); + if (formfield == null) { + return false; + } + + Object reallyValue = getFieldValue(fieldDetail, value, formfield); + insertMap.put(fieldName, reallyValue); + } + return false; + } + + /** + * 构建待校验数据的字段集合 + * + * @param jsonNode + * @param fieldDetail + * @param fieldMap + * @return + * @throws Exception + */ + private boolean processFieldForCheck(JsonNode jsonNode, DataConfigDetail fieldDetail, Map fieldMap,String flowData) throws Exception { + String fieldName = fieldDetail.getFieldName(); + JsonNode atNode = jsonNode.at(fieldDetail.getPath()); + + if (atNode != null) { + String value = atNode.asText(); + if (StringUtils.isNotBlank(fieldDetail.getCondition()) && !value.equals(fieldDetail.getCondition())) { + return false; + } + + Formfield formfield = fieldMap.get(fieldName.toLowerCase()); + if (formfield == null) { + return false; + } + + return flowData.equals(Util.null2String(getFieldValue(fieldDetail, value, formfield))); + } + return false; + } + + /** + * 字段值转换,转换为数据库中对应的实际值 + * + * @param fieldDetail + * @param value + * @param formfield + * @return + * @throws Exception + */ + private Object getFieldValue(DataConfigDetail fieldDetail, String value, Formfield formfield) throws Exception { + if (StringUtils.isNotBlank(fieldDetail.getConvertSql())) { + return FieldConvertUtil.executeConvertSql(fieldDetail.getConvertSql(), value); + } + return FieldConvertUtil.getReallyValue(formfield, value); + } + + /** + * 插入明细表数据 + * + * @param jsonNode + * @param detailTableName + * @param mainId + * @param fieldList + * @param detailTableFieldMap + * @throws Exception + */ + private void insertDetailTable(JsonNode jsonNode, String detailTableName, int mainId, + List fieldList, Map detailTableFieldMap) throws Exception { + Map insertMap = new HashMap(); + + for (DataConfigDetail fieldDetail : fieldList) { + boolean isReturn = processFieldForInsert(jsonNode, insertMap, fieldDetail, detailTableFieldMap); + if (isReturn) { + return; + } + } + + if (insertMap.isEmpty()) { + return; + } + + insertMap.put("mainId", mainId); + baseBean.writeLog("insertDetailTable: " + JSON.toJSONString(insertMap)); + ModeUtil.insertData(insertMap, detailTableName); + } + + /** + * 处理文件列表 + * + * @param mainId + * @param fileConfigList + * @param tableName + * @param isDetail + * @throws Exception + */ + private void dealFileList(int mainId, List fileConfigList, String tableName, boolean isDetail) throws + Exception { + Map dataMap = new HashMap(); + Map defaultDataMap = new HashMap(); + + for (FileConfig fileConfig : fileConfigList) { + processFileConfig(fileConfig, dataMap, defaultDataMap); + } + + if (dataMap.isEmpty()) { + baseBean.writeLog("dataMap集合为空"); + return; + } + + dataMap.putAll(defaultDataMap); + baseBean.writeLog("文件插入集合,dataMap==" + JSON.toJSONString(dataMap)); + + if (isDetail) { + dataMap.put("mainid", mainId); + ModeUtil.insertData(dataMap, tableName); + } else { + dataMap.put("id", mainId); + ModeUtil.updateDataById(dataMap, tableName); + } + } + + /** + * 根据文件配置,构建数据集合 + * + * @param fileConfig + * @param dataMap + * @param defaultDataMap + * @throws Exception + */ + private void processFileConfig(FileConfig fileConfig, Map dataMap, + Map defaultDataMap) throws Exception { + String fieldName = fileConfig.getFieldName(); + String isFilled = fileConfig.getIsFilled(); + + if ("2".equals(isFilled)) { + return; + } + + String fileId = fileConfig.getFileId(); + String fixedValue = fileConfig.getFixedValue(); + String attachments = fileConfig.getAttachments(); + + if (StringUtils.isNotBlank(fixedValue)) { + defaultDataMap.put(fieldName, fixedValue); + return; + } + + if (StringUtils.isNotBlank(attachments)) { + defaultDataMap.put(fieldName, attachments); + return; + } + + List applicationResources = applicationResourceMap.get(fileId); + if (CollectionUtils.isEmpty(applicationResources)) { + baseBean.writeLog("根据fid未获取到数据,fileId==" + fileId); + return; + } + + Map fileResourceMap = resourceInfoMap.get(isFilled); + if (fileResourceMap == null || fileResourceMap.isEmpty()) { + baseBean.writeLog("根据文件类型未获取到数据,isFilled==" + isFilled); + return; + } + + List docIds = processFileResources(applicationResources, fileResourceMap); + if (!docIds.isEmpty()) { + dataMap.put(fieldName, StringUtils.join(docIds, ",")); + } + } + + /** + * 获取配置主项 + * + * @param type + * @return + */ + private List getDataConfig(String type) { + List dataConfigList = new ArrayList<>(); + RecordSet rs = new RecordSet(); + rs.executeQuery("select * from " + QualificationApplicationServiceImpl.CONFIG_TABLE_NAME + " where main_table is not null and source_type = ?", type); + + while (rs.next()) { + DataConfig dataConfig = buildDataConfig(rs); + dataConfig.setDetailList(getDetailList(dataConfig.getId())); + dataConfig.setFileList(getFileList(dataConfig.getId())); + + String detailTableName = dataConfig.getDetailTableName(); + if (StringUtils.isNotBlank(detailTableName)) { + dataConfig.setChildDataConfig(getChildDataConfig(detailTableName, type)); + } + + dataConfigList.add(dataConfig); + } + return dataConfigList; + } + + /** + * 构建DataConfig对象 + * + * @param rs + * @return + * @throws RuntimeException + */ + private DataConfig buildDataConfig(RecordSet rs) throws RuntimeException { + DataConfig dataConfig = new DataConfig(); + dataConfig.setId(rs.getString("id")); + dataConfig.setMainTableName(rs.getString("main_table")); + dataConfig.setRelatedField(rs.getString("related_field")); + dataConfig.setDetailTableName(rs.getString("detail_tables")); + dataConfig.setRootPath(rs.getString("root_path")); + return dataConfig; + } + + /** + * 构建明细表配置项集合 + * + * @param detailTableName + * @param type + * @return + */ + private List getChildDataConfig(String detailTableName, String type) { + String[] detailNameArray = detailTableName.split(","); + List dataConfigList = new ArrayList<>(); + + for (String dtName : detailNameArray) { + RecordSet rs = new RecordSet(); + rs.executeQuery("select * from " + QualificationApplicationServiceImpl.CONFIG_TABLE_NAME + " where main_table is null and detail_tables = ? and source_type = ?", dtName, type); + + while (rs.next()) { + DataConfig dataConfig = new DataConfig(); + dataConfig.setId(rs.getString("id")); + dataConfig.setDetailTableName(rs.getString("detail_tables")); + dataConfig.setRootPath(rs.getString("root_path")); + dataConfig.setDetailList(getDetailList(dataConfig.getId())); + dataConfig.setFileList(getFileList(dataConfig.getId())); + dataConfigList.add(dataConfig); + } + } + return dataConfigList; + } + + /** + * 获取字段配置对照关系集合 + * + * @param mainId + * @return + */ + private List getDetailList(String mainId) { + List detailList = new ArrayList<>(); + RecordSet rs = new RecordSet(); + rs.executeQuery("select * from " + QualificationApplicationServiceImpl.CONFIG_DETAIL_TABLE_NAME + " where mainId = ?", mainId); + + while (rs.next()) { + detailList.add(DataConfigDetail.builder() + .fieldName(rs.getString("field_name")) + .path(rs.getString("config_path")) + .condition(rs.getString("conditions")) + .convertSql(rs.getString("convert_sql")) + .build()); + } + return detailList; + } + + /** + * 获取文件配置对照关系集合 + * + * @param mainId + * @return + */ + private List getFileList(String mainId) { + List fileList = new ArrayList<>(); + RecordSet rs = new RecordSet(); + rs.executeQuery("select * from " + QualificationApplicationServiceImpl.FILE_DETAIL_TABLE_NAME + " where mainId = ?", mainId); + + while (rs.next()) { + fileList.add(FileConfig.builder() + .fieldName(rs.getString("field_name")) + .fileId(rs.getString("file_id")) + .isFilled(rs.getString("file_type")) + .fixedValue(rs.getString("fixed_value")) + .attachments(rs.getString("attachments")) + .build()); + } + return fileList; + } + + /** + * 解析配置文件爱你,构建ApplicationResource集合 + * + * @param rootNode + * @return + */ + private List getApplicationResourceList(JsonNode rootNode) { + List applicationResourceList = new ArrayList<>(); + JsonNode applicationResourceListNode = rootNode.at("/applicationResourceList"); + + if (applicationResourceListNode != null && applicationResourceListNode.isArray()) { + for (JsonNode jsonNode : applicationResourceListNode) { + applicationResourceList.add(ApplicationResource.builder() + .id(jsonNode.at("/id").asText()) + .aid(jsonNode.at("/aid").asText()) + .fid(jsonNode.at("/fid").asText()) + .rid(jsonNode.at("/rid").asText()) + .createdTime(jsonNode.at("/createdTime").asText()) + .isDelete(jsonNode.at("/isDelete").asText()) + .build()); + } + } + return applicationResourceList; + } + + + /** + * 解析配置文件爱你,构建ResourceInfo集合 + * + * @param rootNode + * @return + */ + private List getResourceInfoList(JsonNode rootNode) { + List resourceInfoList = new ArrayList<>(); + JsonNode resourceInfoListNode = rootNode.at("/resourceInfoList"); + + if (resourceInfoListNode != null && resourceInfoListNode.isArray()) { + for (JsonNode jsonNode : resourceInfoListNode) { + resourceInfoList.add(ResourceInfo.builder() + .id(jsonNode.at("/id").asText()) + .fileName(jsonNode.at("/fileName").asText()) + .filePath(jsonNode.at("/filePath").asText()) + .fileSuffix(jsonNode.at("/fileSuffix").asText()) + .virtualPath(jsonNode.at("/virtualPath").asText()) + .createdTime(jsonNode.at("/createdTime").asText()) + .updatedTime(jsonNode.at("/updatedTime").asText()) + .isDelete(jsonNode.at("/isDelete").asText()) + .build()); + } + } + return resourceInfoList; + } + + + /** + * 上传文件,生成imageFileId + * + * @param zipFile + * @param header + * @param fileName + * @return + */ + private int generateImageFileId(ZipFile zipFile, FileHeader header, String fileName) { + try (InputStream is = zipFile.getInputStream(header)) { + return ModeUtil.generateImageFileId(is, fileName); + } catch (Exception e) { + throw new CustomizeRunTimeException(e); + } + } + + + /** + * 获取主表的ID集合 + * + * @param mainTableName + * @return + */ + private Set getTableIdList(String mainTableName) { + return insertTableMap.computeIfAbsent(mainTableName, k -> ConcurrentHashMap.newKeySet()); + + } +} \ No newline at end of file diff --git a/JSSBMJ/src/com/engine/secret/service/impl/QualificationApplicationServiceImpl.java b/JSSBMJ/src/com/engine/secret/service/impl/QualificationApplicationServiceImpl.java new file mode 100644 index 0000000..44f9c40 --- /dev/null +++ b/JSSBMJ/src/com/engine/secret/service/impl/QualificationApplicationServiceImpl.java @@ -0,0 +1,242 @@ +package com.engine.secret.service.impl; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.TypeReference; +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.secret.entity.unpack.CheckFields; +import com.engine.secret.entity.unpack.UnpackParam; +import com.engine.secret.exception.CustomizeRunTimeException; +import com.engine.secret.service.QualificationApplicationService; +import com.engine.secret.service.UnpackZipService; +import com.engine.secret.util.ConfigUtil; +import com.engine.secret.util.ModeUtil; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.wbi.util.Util; +import net.lingala.zip4j.ZipFile; +import net.lingala.zip4j.model.FileHeader; +import org.apache.commons.lang.StringUtils; +import weaver.docs.docs.DocImageManager; +import weaver.file.ImageFileManager; +import weaver.general.BaseBean; +import weaver.general.GCONST; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.StandardCopyOption; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author:dxfeng + * @createTime: 2024/08/29 + * @version: 1.0 + */ +public class QualificationApplicationServiceImpl extends Service implements QualificationApplicationService { + + + public static final String CONFIG_TABLE_NAME = "uf_config_package"; + public static final String CONFIG_DETAIL_TABLE_NAME = "uf_config_package_dt1"; + public static final String FILE_DETAIL_TABLE_NAME = "uf_config_package_dt2"; + + BaseBean baseBean = new BaseBean(); + + Map fileHeaderMap; + + + @Override + public Map parsingFiles(Map param) { + try { + Map returnMap; + + String docId = Util.null2String(param.get("docId")); + String requestId = Util.null2String(param.get("requestId")); + String isCorrection = Util.null2String(param.get("isCorrection")); + String checkFields = Util.null2String(param.get("checkFields")); + if (StringUtils.isBlank(docId)) { + throw new CustomizeRunTimeException("文件获取失败,请确认文件是否上传"); + } + baseBean.writeLog("docId==" + docId); + + if (StringUtils.isBlank(requestId)) { + throw new CustomizeRunTimeException("流程关联失败,未获取到流程ID,请保存后重试"); + } + + baseBean.writeLog("requestId==" + requestId); + List checkFieldsList = new ArrayList<>(); + if (StringUtils.isNotBlank(checkFields)) { + checkFieldsList = JSON.parseObject(checkFields, new TypeReference>() {}); + } + + UnpackParam unpackParam = UnpackParam.builder() + .docId(docId) + .requestId(requestId) + .isCorrection(Boolean.parseBoolean(isCorrection)) + .checkFields(checkFieldsList) + .build(); + + + // docId 转为换imageFileId + DocImageManager imgManger = new DocImageManager(); + imgManger.setDocid(Integer.parseInt(docId)); + imgManger.selectDocImageInfo(); + imgManger.next(); + String imageFileId = imgManger.getImagefileid(); + baseBean.writeLog("imageFileId==" + imageFileId); + if (StringUtils.isBlank(imageFileId) || "-1".equals(imageFileId)) { + throw new CustomizeRunTimeException("文件获取失败,请确认文件是否上传,imageFileId=[" + imageFileId + "]"); + } + + + // 初始化配置 + String unzipPwd = ConfigUtil.getConfig("UNZIP_PWD"); + baseBean.writeLog("unzipPwd==" + unzipPwd); + + + // 根据文件id获取文件流 + ImageFileManager manager = new ImageFileManager(); + manager.getImageFileInfoById(Integer.parseInt(imageFileId)); + manager.getImageFileName(); + InputStream inputStream = manager.getInputStream(); + + Path fixedDir = Paths.get(GCONST.getRootPath() + "filesystem" + File.separatorChar + "downloadBatchTemp"); + Files.createDirectories(fixedDir); + Path tempZipFile = Files.createTempFile(fixedDir, "offline_temp_", ".zip"); + baseBean.writeLog("tempZipFile==" + tempZipFile.toString()); + Files.copy(inputStream, tempZipFile, StandardCopyOption.REPLACE_EXISTING); + + //解压文件,处理压缩包 + baseBean.writeLog("开始解压文件,处理压缩包"); + returnMap = unzipWithPassword(tempZipFile, Paths.get("output"), unzipPwd, unpackParam); + baseBean.writeLog("压缩包处理完成"); + return returnMap; + } catch (Exception e) { + baseBean.writeLog(e); + throw new CustomizeRunTimeException(e.getMessage(), e); + } + } + + @Override + public Map deleteParsedData(Map param) { + + UnpackZipService unpackZipService = ServiceUtil.getService(OfflineZipUnpackServiceImpl.class, user); + return unpackZipService.deleteParsedData(param); + } + + /** + * 解压ZIP文件 + * + * @param zipFilePath + * @param outputDir + * @param password + */ + private Map unzipWithPassword(Path zipFilePath, Path outputDir, String password, UnpackParam unpackParam) { + try { + ZipFile zipFile = new ZipFile(zipFilePath.toFile()); + if (zipFile.isEncrypted()) { + zipFile.setPassword(password.toCharArray()); + } + // 遍历并解压所有文件 + zipFile.extractAll(outputDir.toString()); + baseBean.writeLog("已解压所有文件"); + + // 遍历 ZIP 内文件(可选) + List fileHeaders = zipFile.getFileHeaders(); + + //imageFileMap = new HashMap<>(); + fileHeaderMap = new HashMap<>(); + for (FileHeader header : fileHeaders) { + if (header.isDirectory()) { + continue; + } + String fullPath = header.getFileName(); + int lastSlashIndex = fullPath.lastIndexOf('/'); + String fileName = (lastSlashIndex != -1) + ? fullPath.substring(lastSlashIndex + 1) + : fullPath; + fileHeaderMap.put(fileName, header); + } + + + baseBean.writeLog("fileHeaders.size==" + fileHeaders.size()); + baseBean.writeLog("fileHeaderMap.size==" + fileHeaderMap.size()); + baseBean.writeLog("fileHeaderMap==" + JSON.toJSONString(fileHeaderMap)); + + + // 获取数据文件,用于后续数据解析 + String jsonFileName = "(database)data.json"; + if (unpackParam.isCorrection()) { + jsonFileName = "(extra)data.json"; + } + FileHeader fileHeader = fileHeaderMap.get(jsonFileName); + int dataJsonImageId = generateImageFileId(zipFile, fileHeader, jsonFileName); + + if (dataJsonImageId > 0) { + // 离线端方式 + JsonNode rootNode = parseJsonContent(dataJsonImageId); + OfflineZipUnpackServiceImpl offlineZipUnpackService = ServiceUtil.getService(OfflineZipUnpackServiceImpl.class, user); + if (unpackParam.isCorrection()) { + return offlineZipUnpackService.reviewResubmittedMaterials(zipFile, unpackParam.getRequestId(), rootNode, fileHeaderMap); + } + return offlineZipUnpackService.registerAcceptance(zipFile, unpackParam, rootNode, fileHeaderMap); + } + + // TODO 兼容其他方式 + + return new HashMap<>(); + + } catch (Exception e) { + if (e.getMessage().contains("Wrong password")) { + throw new CustomizeRunTimeException("数据包解压失败,密码错误"); + } else { + baseBean.writeLog(e); + throw new CustomizeRunTimeException(e.getMessage(), e); + } + } finally { + try { + Files.deleteIfExists(zipFilePath); + } catch (IOException e) { + baseBean.writeLog(e); + } + } + } + + + /** + * 获取JSON文件内容 + * + * @param imageFieldId + * @return + * @throws IOException + */ + private static JsonNode parseJsonContent(Integer imageFieldId) throws IOException { + ImageFileManager manager = new ImageFileManager(); + manager.getImageFileInfoById(imageFieldId); + InputStream inputStream = manager.getInputStream(); + ObjectMapper mapper = new ObjectMapper(); + return mapper.readTree(inputStream); + } + + /** + * 上传文件 返回imageFileId + * + * @param zipFile + * @param header + * @return + */ + private int generateImageFileId(ZipFile zipFile, FileHeader header, String fileName) { + try (InputStream is = zipFile.getInputStream(header)) { + return ModeUtil.generateImageFileId(is, fileName); + } catch (Exception e) { + throw new CustomizeRunTimeException(e); + } + } + +} diff --git a/JSSBMJ/src/com/engine/secret/util/ConfigUtil.java b/JSSBMJ/src/com/engine/secret/util/ConfigUtil.java new file mode 100644 index 0000000..30f830d --- /dev/null +++ b/JSSBMJ/src/com/engine/secret/util/ConfigUtil.java @@ -0,0 +1,24 @@ +package com.engine.secret.util; + +import org.apache.commons.lang.StringUtils; +import weaver.conn.RecordSet; + +/** + * @author:dxfeng + * @createTime: 2025/03/31 + * @version: 1.0 + */ +public class ConfigUtil { + public static String getConfig(String name) { + if (StringUtils.isBlank(name)) { + return ""; + } + RecordSet rs = new RecordSet(); + rs.executeQuery("select value from uf_config where name = ?",name.trim()); + if(rs.next()){ + return rs.getString("value").trim(); + } + return ""; + } + +} diff --git a/JSSBMJ/src/com/engine/secret/util/ExceptionUtil.java b/JSSBMJ/src/com/engine/secret/util/ExceptionUtil.java new file mode 100644 index 0000000..acf11da --- /dev/null +++ b/JSSBMJ/src/com/engine/secret/util/ExceptionUtil.java @@ -0,0 +1,20 @@ +package com.engine.secret.util; + +/** + * @Author weaver_cl + * @Description: + * @Date 2023/2/21 + * @Version V1.0 + **/ +public class ExceptionUtil { + public static String getRealMessage(Throwable e) { + while (e != null) { + Throwable cause = e.getCause(); + if (cause == null) { + return e.getMessage(); + } + e = cause; + } + return ""; + } +} diff --git a/JSSBMJ/src/com/engine/secret/util/FieldConvertUtil.java b/JSSBMJ/src/com/engine/secret/util/FieldConvertUtil.java new file mode 100644 index 0000000..c051ee4 --- /dev/null +++ b/JSSBMJ/src/com/engine/secret/util/FieldConvertUtil.java @@ -0,0 +1,166 @@ +package com.engine.secret.util; + +import com.weaver.formmodel.data.model.Formfield; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.validator.GenericValidator; +import weaver.conn.RecordSet; +import weaver.general.Util; +import weaver.hrm.definedfield.HrmFieldManager; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +/** + * @author:dxfeng + * @createTime: 2025/04/02 + * @version: 1.0 + */ +public class FieldConvertUtil { + + /** + * 转换存入数据库的值 + * + * @param formfield + * @param value + * @return + * @throws Exception + */ + public static Object getReallyValue(Formfield formfield, String value) throws Exception { + if (StringUtils.isBlank(value)) { + return null; + } + RecordSet rs = new RecordSet(); + Object object = null; + String type = Util.null2String(formfield.getType()); + switch (formfield.getFieldhtmltype()) { + case "1": + // INPUT + if ("2".equals(type)) { + object = new BigDecimal(value).intValue(); + } else if ("3".equals(type)) { + object = new BigDecimal(value).floatValue(); + } else if ("1".equals(type)) { + object = value; + } else { + try { + object = new BigDecimal(value).toPlainString(); + } catch (NumberFormatException ignore) { + object = value; + } + } + break; + case "3": + // BROWSER + org.json.JSONObject jsonObject = new org.json.JSONObject(); + jsonObject.put("fieldhtmltype", formfield.getFieldhtmltype()); + jsonObject.put("type", type); + jsonObject.put("fieldvalue", value); + if ("161".equals(type) || "162".equals(type)) { + jsonObject.put("dmlurl", formfield.getFielddbtype()); + } else { + jsonObject.put("dmlurl", type); + } + + jsonObject.put("fieldid", 0); + object = HrmFieldManager.getReallyFieldvalue(jsonObject); + // 如果是日期,校验日期的合法性 + if ("2".equals(type)) { + boolean isDate = GenericValidator.isDate(Util.null2String(object), "yyyy-MM-dd", true); + if (!isDate) { + rs.writeLog("日期格式校验失败,object==" + Util.null2String(object)); + object = ""; + } + } + break; + case "5": + // 区分单选、复选、下拉框 + switch (type) { + case "1": + case "3": + // 下拉框、单选框 + object = ModeUtil.getSelectValue(formfield, value); + if (StringUtils.isBlank(Util.null2String(object))) { + if (isNumberOrCommaSeparatedNumbers(value)) { + object = value; + } + } + break; + case "2": + if (StringUtils.isNotBlank(value)) { + List selectValues = new ArrayList<>(); + // 兼容分隔符 + String separator = ","; + if (value.contains("、")) { + separator = "、"; + } + String[] split = value.split(separator); + for (String s : split) { + selectValues.add(ModeUtil.getSelectValue(formfield, s)); + } + object = StringUtils.join(selectValues, ","); + if (StringUtils.isBlank(Util.null2String(object))) { + if (isNumberOrCommaSeparatedNumbers(value)) { + object = value; + } + } + } + break; + default: + break; + } + + break; + case "4": + // CHECKBOX + case "6": + // FILEUPLOAD + break; + case "7": + // TEXT + case "2": + // TEXTAREA + default: + object = value; + break; + } + return object; + } + + + /** + * 执行转换SQL + * + * @param convertSql + * @param value + * @return + */ + public static String executeConvertSql(String convertSql, String value) { + RecordSet rs = new RecordSet(); + value = Util.null2String(value); + long count = convertSql.chars().filter(c -> c == '?').count(); + List paramsList = new ArrayList<>(); + for (int i = 0; i < count; i++) { + paramsList.add(value); + } + rs.executeQuery(convertSql, paramsList); + if (rs.next()) { + return rs.getString(1); + } + return ""; + } + + + /** + * 校验字符串是否为纯数字或逗号分隔的数字 + * + * @param str + * @return + */ + public static boolean isNumberOrCommaSeparatedNumbers(String str) { + // 正则表达式匹配纯数字或逗号分隔的数字 + // 允许前后有空格,数字之间用逗号分隔 + String regex = "^\\s*\\d+(\\s*,\\s*\\d+)*\\s*$"; + return str.matches(regex); + } +} diff --git a/JSSBMJ/src/com/engine/secret/util/FlowUtil.java b/JSSBMJ/src/com/engine/secret/util/FlowUtil.java new file mode 100644 index 0000000..aac67bb --- /dev/null +++ b/JSSBMJ/src/com/engine/secret/util/FlowUtil.java @@ -0,0 +1,81 @@ +package com.engine.secret.util; + +import com.alibaba.fastjson.JSON; +import weaver.conn.RecordSet; +import weaver.general.BaseBean; +import weaver.general.Util; +import weaver.workflow.webservices.WorkflowRequestInfo; +import weaver.workflow.webservices.WorkflowServiceImpl; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author:dxfeng + * @createTime: 2025/04/09 + * @version: 1.0 + */ +public class FlowUtil { + + /** + * 根据流程请求ID,获取对应流程的表名 + * + * @param requestId + * @return + */ + public static String getTableNameByRequestId(String requestId) { + RecordSet rs = new RecordSet(); + rs.executeQuery("select a.tablename from workflow_bill a join workflow_base b on a.id = b.formid where b.id = ( select workflowid from workflow_requestbase where requestid = ?)", requestId); + if (rs.next()) { + return rs.getString("tablename"); + } + return ""; + } + + + /** + * 获取流程的当前处理人 + * + * @param requestId + * @return + */ + public static List getCurrentUserIds(String requestId) { + RecordSet rs = new RecordSet(); + String sql = "select * from workflow_currentoperator where isremark = '0' and usertype = 0 and requestid=? order by id asc"; + List currentUserIds = new ArrayList(); + rs.executeQuery(sql, requestId); + while (rs.next()) { + currentUserIds.add(Util.getIntValue(Util.null2String(rs.getString("userid")))); + } + return currentUserIds; + } + + + /** + * 提交流程到下一节点 + * + * @param requestId + * @param creator + * @param opinions + * @return + */ + public static String submitWorkflowRequest(String requestId, int creator, String opinions) { + BaseBean bean = new BaseBean(); + WorkflowServiceImpl workflowService = new WorkflowServiceImpl(); + WorkflowRequestInfo wri = workflowService.getWorkflowRequest(Util.getIntValue(requestId, 0), creator, 0); + bean.writeLog("wri==" + JSON.toJSONString(wri)); + return workflowService.submitWorkflowRequest(wri, Util.getIntValue(requestId, 0), creator, "submit", opinions); + } + + /** + * 提交流程到下一节点(机器人节点) + * + * @param requestId + * @param opinions + * @return + */ + public static String submitWorkflowRequest(String requestId, String opinions) { + WorkflowServiceImpl workflowService = new WorkflowServiceImpl(); + return workflowService.submitWorkflowRequest(null, Util.getIntValue(requestId, 0), 0, "submit", opinions); + } +} diff --git a/JSSBMJ/src/com/engine/secret/util/ModeUtil.java b/JSSBMJ/src/com/engine/secret/util/ModeUtil.java new file mode 100644 index 0000000..366e81c --- /dev/null +++ b/JSSBMJ/src/com/engine/secret/util/ModeUtil.java @@ -0,0 +1,477 @@ +package com.engine.secret.util; + +import com.engine.secret.exception.CustomizeRunTimeException; +import com.weaver.formmodel.data.manager.FormInfoManager; +import com.weaver.formmodel.data.model.Formfield; +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.util.IOUtils; +import weaver.common.DateUtil; +import weaver.conn.RecordSet; +import weaver.conn.RecordSetTrans; +import weaver.docs.docs.*; +import weaver.file.ImageFileManager; +import weaver.formmode.IgnoreCaseHashMap; +import weaver.formmode.setup.ModeRightInfo; +import weaver.general.TimeUtil; +import weaver.general.Util; +import weaver.hrm.User; + +import java.io.IOException; +import java.io.InputStream; +import java.util.*; + +/** + * @author:dxfeng + * @createTime: 2025/03/26 + * @version: 1.0 + */ +public class ModeUtil { + + /** + * 生成附件ID + * + * @param inputStream + * @param filename + * @return + */ + public static int generateImageFileId(InputStream inputStream, String filename) { + int imageFileId; + try { + byte[] bytes = IOUtils.toByteArray(inputStream); + ImageFileManager ifm = new ImageFileManager(); + ifm.setData(bytes); + ifm.setImagFileName(filename); + imageFileId = ifm.saveImageFile(); + } catch (IOException e) { + throw new RuntimeException(e); + } + return imageFileId; + } + + /** + * 附件imageFieldId生成docId + * + * @param secCategory + * @param imageFieldId + * @param user + * @return + * @throws Exception + */ + public static int createDocId(int secCategory, int imageFieldId, User user) throws Exception { + ImageFileManager manager = new ImageFileManager(); + manager.getImageFileInfoById(imageFieldId); + String filenameqc = manager.getImageFileName(); + String filenamebc = filenameqc.substring(0, filenameqc.lastIndexOf(".")); + RecordSet rs = new RecordSet(); + DocManager dm = new DocManager(); + DocImageManager imgManger = new DocImageManager(); + + imgManger.setDocfiletype("2"); + + int docId = dm.getNextDocId(rs); + imgManger.setDocid(docId); + imgManger.setImagefileid(imageFieldId); + imgManger.setImagefilename(filenameqc); + imgManger.setIsextfile("1"); + imgManger.AddDocImageInfo(); + + String date = TimeUtil.getCurrentDateString(); + String time = TimeUtil.getOnlyCurrentTimeString(); + dm.setId(docId); + dm.setMaincategory(0); + dm.setSubcategory(0); + dm.setSeccategory(secCategory); + dm.setLanguageid(user.getLanguage()); + + dm.setDocstatus("1"); + dm.setDocsubject(filenamebc); + dm.setDoccreaterid(user.getUID()); + dm.setDocCreaterType(user.getLogintype()); + dm.setUsertype(user.getLogintype()); + dm.setOwnerid(user.getUID()); + dm.setOwnerType(user.getLogintype()); + dm.setDoclastmoduserid(user.getUID()); + dm.setDocLastModUserType(user.getLogintype()); + dm.setDoccreatedate(date); + dm.setDoclastmoddate(date); + dm.setDoccreatetime(time); + dm.setDoclastmodtime(time); + dm.setDoclangurage(user.getLanguage()); + dm.setKeyword(filenameqc); + dm.setIsapprover("0"); + dm.setIsreply(""); + dm.setDocdepartmentid(user.getUserDepartment()); + dm.setDocreplyable("1"); + dm.setAccessorycount(1); + dm.setParentids("" + docId); + dm.setUserid(user.getUID()); + DocCoder docCoder = new DocCoder(); + dm.setDocCode(docCoder.getDocCoder("" + secCategory)); + dm.setDocEditionId(dm.getNextEditionId(rs)); + dm.setDocEdition(1); + dm.AddDocInfo(); + dm.AddShareInfo(); + DocViewer DocViewer = new DocViewer(); + DocViewer.setDocShareByDoc("" + docId); + DocComInfo dc = new DocComInfo(); + dc.addDocInfoCache("" + docId); + return docId; + } + + /** + * 获取单个记录映射 + * + * @param rs RecordSet + * @return + */ + public static IgnoreCaseHashMap getSingleRecordMap(RecordSet rs) { + IgnoreCaseHashMap dataMap = new IgnoreCaseHashMap<>(); + if (rs.next()) { + String[] columnNames = rs.getColumnName(); + for (String columnName : columnNames) { + dataMap.put(columnName, parseBlankToNull(rs.getString(columnName))); + } + } + return dataMap; + } + + public static List> getRecordMapList(RecordSet rs) { + List> list = new ArrayList<>(); + while (rs.next()) { + String[] columnNames = rs.getColumnName(); + Map dataMap = new HashMap(); + for (String columnName : columnNames) { + dataMap.put(columnName.toLowerCase(), parseBlankToNull(rs.getString(columnName))); + } + list.add(dataMap); + } + return list; + } + + /** + * 插入数据 + * + * @param dataMap 数据集合 + * @param tableName 表名 + */ + public static void insertData(Map dataMap, String tableName) { + List fieldList = new ArrayList<>(); + List dataList = new ArrayList<>(); + List paramList = new ArrayList<>(); + + dataMap.forEach((key, value) -> { + if (null != value) { + String valueStr = String.valueOf(value); + if (StringUtils.isNotBlank(valueStr)) { + fieldList.add(key); + dataList.add(valueStr); + paramList.add("?"); + } + } + }); + String insertSql = " insert into " + tableName + "(" + StringUtils.join(fieldList, ",") + ") values (" + StringUtils.join(paramList, ",") + ")"; + RecordSet rs = new RecordSet(); + rs.executeUpdate(insertSql, dataList); + if (StringUtils.isNotBlank(rs.getExceptionMsg())) { + throw new CustomizeRunTimeException(rs.getExceptionMsg()); + } + } + + public static void insertData(RecordSetTrans rs,Map dataMap, String tableName) throws Exception { + List fieldList = new ArrayList<>(); + List dataList = new ArrayList<>(); + List paramList = new ArrayList<>(); + + dataMap.forEach((key, value) -> { + if (null != value) { + String valueStr = String.valueOf(value); + if (StringUtils.isNotBlank(valueStr)) { + fieldList.add(key); + dataList.add(valueStr); + paramList.add("?"); + } + } + }); + String insertSql = " insert into " + tableName + "(" + StringUtils.join(fieldList, ",") + ") values (" + StringUtils.join(paramList, ",") + ")"; + rs.executeUpdate(insertSql, dataList); + } + + /** + * 根据ID更新数据 + * + * @param dataMap + * @param tableName + */ + public static void updateDataById(Map dataMap, String tableName) { + List fieldList = new ArrayList<>(); + List dataList = new ArrayList<>(); + String id = Util.null2String(dataMap.get("id")); + dataMap.remove("id"); + + dataMap.forEach((key, value) -> { + fieldList.add(key + " = ? "); + dataList.add(value); + }); + dataList.add(id); + String updateSql = "update " + tableName + " set " + StringUtils.join(fieldList, ",") + " where id = ? "; + RecordSet rs = new RecordSet(); + rs.executeUpdate(updateSql, dataList); + if (StringUtils.isNotBlank(rs.getExceptionMsg())) { + throw new CustomizeRunTimeException(rs.getExceptionMsg()); + } + } + + /** + * 根据ID更新数据 + * + * @param dataMap + * @param tableName + */ + public static void updateDataById(RecordSetTrans rs,Map dataMap, String tableName) throws Exception { + List fieldList = new ArrayList<>(); + List dataList = new ArrayList<>(); + String id = Util.null2String(dataMap.get("id")); + dataMap.remove("id"); + + dataMap.forEach((key, value) -> { + fieldList.add(key + " = ? "); + dataList.add(value); + }); + dataList.add(id); + String updateSql = "update " + tableName + " set " + StringUtils.join(fieldList, ",") + " where id = ? "; + rs.executeUpdate(updateSql, dataList); + } + + /** + * 更新数据 + * + * @param dataMap + * @param tableName + * @param whereSql + */ + public static void updateData(Map dataMap, String tableName, String whereSql) { + List fieldList = new ArrayList<>(); + List dataList = new ArrayList<>(); + dataMap.forEach((key, value) -> { + fieldList.add(key + " = ? "); + dataList.add(value); + }); + String updateSql = "update " + tableName + " set " + StringUtils.join(fieldList, ",") + whereSql; + RecordSet rs = new RecordSet(); + rs.executeUpdate(updateSql, dataList); + if (StringUtils.isNotBlank(rs.getExceptionMsg())) { + throw new CustomizeRunTimeException(rs.getExceptionMsg()); + } + } + + /** + * 删除数据 + * + * @param deleteSql + */ + public static void deleteData(String deleteSql) { + RecordSet rs = new RecordSet(); + rs.executeUpdate(deleteSql); + if (StringUtils.isNotBlank(rs.getExceptionMsg())) { + throw new CustomizeRunTimeException(rs.getExceptionMsg()); + } + } + + + /** + * 构建建模表基本数据 + * + * @param mainDataMap 参数集合 + */ + public static void buildModeInsertFields(Map mainDataMap, int userId) { + String dateTime = DateUtil.getFullDate(); + String[] dateSplit = dateTime.split(" "); + mainDataMap.put("modedatacreater", userId); + mainDataMap.put("modedatacreatedate", dateSplit[0]); + mainDataMap.put("modedatacreatetime", dateSplit[1]); + mainDataMap.put("modedatacreatertype", "0"); + } + + /** + * 构建建模表基本数据 + * + * @param mainDataMap 参数集合 + */ + public static void buildModeUpdateFields(Map mainDataMap, int userId) { + String dateTime = DateUtil.getFullDate(); + mainDataMap.put("modedatamodifier", userId); + mainDataMap.put("modedatamodifydatetime", dateTime); + } + + /** + * 建模表数据权限重构 + * + * @param uuid + * @param modeTable + * @param formModeId + */ + public static int refreshRight(String uuid, String modeTable, int formModeId, int creator) { + RecordSet rs = new RecordSet(); + rs.executeQuery("select id from " + modeTable + " where modeuuid='" + uuid + "'"); + if (rs.next()) { + //建模数据的id + int bid = Util.getIntValue(rs.getString("id")); + ModeRightInfo modeRightInfo = new ModeRightInfo(); + modeRightInfo.setNewRight(true); + //新建的时候添加共享 + modeRightInfo.editModeDataShare(creator, formModeId, bid); + return bid; + } + return -1; + } + + + /** + * 转换空字符串为null + * + * @param str 字符串 + * @return 转换后的字符串 + */ + public static Object parseBlankToNull(String str) { + return StringUtils.isBlank(str) ? null : str; + } + + /** + * 转换空字符串为null + * + * @param obj 对象 + * @return 转换后的字符串 + */ + public static String parseBlankToNull(Object obj) { + return Objects.isNull(obj) ? null : StringUtils.isBlank(obj.toString()) ? null : obj.toString(); + } + + /** + * 根据建模表名,获取建模ID + * + * @param modeTable + * @return + */ + public static int getModeIdByTableName(String modeTable) { + int formModeId = -1; + RecordSet rs = new RecordSet(); + rs.executeQuery("select id from modeinfo where formid =( select id from workflow_bill where tablename = ? ) and isdelete = 0 order by id", modeTable); + if (rs.next()) { + formModeId = rs.getInt("id"); + } + return formModeId; + } + + public static List getFieldList(String tableName) { + int formId = getFormIdByTableName(tableName); + return FormInfoManager.getInstance().getAllField(formId); + } + + public static List getFieldList(int formId) { + return FormInfoManager.getInstance().getAllField(formId); + } + + /** + * 根据表名,获取表单ID + * + * @param modeTable + * @return + */ + public static int getFormIdByTableName(String modeTable) { + int formId = -1; + RecordSet rs = new RecordSet(); + rs.executeQuery("select id from workflow_bill where tablename = ? ", modeTable); + if (rs.next()) { + formId = rs.getInt("id"); + } + return formId; + } + + /** + * 获取表单下拉框展示文本 + * + * @param formId 表单ID + * @param fieldName 字段明湖曾 + * @param value 下拉框值 + * @return + */ + public static String getSelectName(String formId, String fieldName, String value) { + String cancelReason = ""; + RecordSet rs = new RecordSet(); + rs.executeQuery("select selectname from workflow_selectitem where fieldid =( select id from workflow_billfield where billid = ? and fieldname = ? ) and selectvalue = ?", formId, fieldName, value); + if (rs.next()) { + cancelReason = rs.getString("selectname"); + } + return cancelReason; + } + + /** + * 获取表单下拉框值 + * + * @param formId 表单ID + * @param fieldName 字段明湖曾 + * @param selectName 下拉框展示内容 + * @return + */ + public static String getSelectValue(String formId, String fieldName, String selectName) { + String selectValue = ""; + RecordSet rs = new RecordSet(); + rs.executeQuery("select selectvalue from workflow_selectitem where fieldid =( select id from workflow_billfield where billid = ? and fieldname = ? ) and selectname = ?", formId, fieldName, selectName); + if (rs.next()) { + selectValue = rs.getString("selectvalue"); + } + return selectValue; + } + + public static String getSelectValue(Formfield formfield, String selectName) { + String selectValue = ""; + RecordSet rs = new RecordSet(); + String detailTable = Util.null2String(formfield.getDetailtable()); + if (StringUtils.isNotBlank(detailTable)) { + rs.executeQuery("select selectvalue from workflow_selectitem where fieldid =( select id from workflow_billfield where billid = ? and fieldname = ? and detailtable = ? ) and selectname = ?", formfield.getBillid(), formfield.getFieldname(), Util.null2String(detailTable), selectName); + } else { + rs.executeQuery("select selectvalue from workflow_selectitem where fieldid =( select id from workflow_billfield where billid = ? and fieldname = ? AND (detailtable IS NULL OR detailtable = '') ) and selectname = ?", formfield.getBillid(), formfield.getFieldname(), selectName); + } + if (rs.next()) { + selectValue = rs.getString("selectvalue"); + } + return selectValue; + } + + + /** + * 全角转半角 + * + * @param input + * @return + */ + public static String ToDBC(String input) { + if (input == null) { + input = ""; + } + char[] c = input.toCharArray(); + for (int i = 0; i < c.length; i++) { + if (c[i] == 12288) { + //全角空格为12288,半角空格为32 + c[i] = (char) 32; + continue; + } + if (c[i] > 65280 && c[i] < 65375) { + //其他字符半角(33-126)与全角(65281-65374)的对应关系是:均相差65248 + c[i] = (char) (c[i] - 65248); + } + } + return new String(c); + } + + public static String getTableNameByCustomId(String customId) { + RecordSet rs = new RecordSet(); + rs.executeQuery("select tablename from workflow_bill where id = (select formid from mode_customsearch where id = ?)", customId); + if (rs.next()) { + return rs.getString("tablename"); + } + return ""; + } + + +} diff --git a/JSSBMJ/src/com/engine/secret/util/ResponseResult.java b/JSSBMJ/src/com/engine/secret/util/ResponseResult.java new file mode 100644 index 0000000..3baf8d5 --- /dev/null +++ b/JSSBMJ/src/com/engine/secret/util/ResponseResult.java @@ -0,0 +1,192 @@ +package com.engine.secret.util; + + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.serializer.SerializerFeature; +import com.engine.core.exception.ECException; +import com.engine.secret.exception.CustomizeRunTimeException; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import lombok.extern.slf4j.Slf4j; +import weaver.general.BaseBean; +import weaver.hrm.User; + +import java.util.HashMap; +import java.util.Map; +import java.util.function.Consumer; +import java.util.function.Function; +import java.util.function.Supplier; + +/** + * 请求执行器 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Slf4j +public class ResponseResult { + + private static final long serialVersionUID = 1L; + + private final User user; + + private final BaseBean baseBean = new BaseBean(); + + private final Boolean isLog = "true".equals(baseBean.getPropValue("hrmSalary", "log")); + + public ResponseResult(User user) { + this.user = user; + } + + /** + * 统一返回方法(自定义返回格式) + */ + public String customRun(Function f, T t) { + try { + if (isLog) { + log.info("run api , param {}", t); + } + return getJsonString(f.apply(t)); + } catch (com.engine.secret.exception.CustomizeRunTimeException e) { + log.error("api run fail", e); + return Error(e.getMessage()); + } catch (ECException e) { + log.error("api run fail", e); + Throwable cause = e.getCause(); + return Error(cause.getMessage()); + } catch (Exception e) { + log.error("api run fail", e); + return Error("系统异常!"); + } + } + + /** + * 统一返回方法 + */ + public String run(Function f, T t) { + try { + if (isLog) { + log.info("run api , param {}", t); + } + return Ok(f.apply(t)); + } catch (com.engine.secret.exception.CustomizeRunTimeException e) { + log.error("api run fail", e); + return Error(e.getMessage()); + } catch (ECException e) { + log.error("api run fail", e); + Throwable cause = e.getCause(); + return Error(cause.getMessage()); + } catch (Exception e) { + log.error("api run fail", e); + return Error("系统异常!"); + } + } + + /** + * 统一返回方法(有参无返回) + */ + public String run(Consumer f, T t) { + try { + if (isLog) { + log.info("run api , param {}", t); + } + f.accept(t); + return Ok(); + } catch (com.engine.secret.exception.CustomizeRunTimeException e) { + log.error("api run fail", e); + return Error(e.getMessage()); + } catch (ECException e) { + log.error("api run fail", e); + return Error(ExceptionUtil.getRealMessage(e)); + } catch (Exception e) { + log.error("api run fail", e); + return Error("系统异常!", e); + } + } + + + /** + * 统一返回方法(无参有返回) + */ + public String run(Supplier f) { + try { + if (isLog) { + log.info("run api"); + } + return Ok(f.get()); + } catch (CustomizeRunTimeException e) { + log.error("api run fail", e); + return Error(e.getMessage()); + } catch (ECException e) { + log.error("api run fail", e); + Throwable cause = e.getCause(); + return Error(cause.getMessage()); + } catch (Exception e) { + log.error("api run fail", e); + return Error("系统异常!", e); + } + } + + + private static String getJsonString(Object apidatas) { + ObjectMapper mapper = new ObjectMapper(); + try { + return mapper.writeValueAsString(apidatas); + } catch (JsonProcessingException e) { + e.printStackTrace(); + } + return ""; + } + + + /** + * 成功返回 + */ + private String Ok() { + Map apidatas = new HashMap<>(); + apidatas.put("api_status", true); + return JSONObject.toJSONString(apidatas, SerializerFeature.DisableCircularReferenceDetect); + } + + + /** + * 成功返回 + */ + private String Ok(R r) { + Map apidatas = new HashMap<>(); + apidatas.put("api_status", true); + apidatas.put("data", r); + String success = JSON.toJSONString(apidatas); + if (isLog) { + log.info("run salary api success return {}", success); + } + return success; + } + + + /** + * 失败返回 + */ + private static String Error(String message) { + Map apidatas = new HashMap<>(); + apidatas.put("api_status", false); + apidatas.put("errormsg", message); + return JSONObject.toJSONString(apidatas, SerializerFeature.DisableCircularReferenceDetect); + } + + + /** + * 系统异常失败返回 + */ + private static String Error(String message, Exception e) { + Map apidatas = new HashMap<>(); + apidatas.put("api_status", false); + apidatas.put("errormsg", message); + apidatas.put("error", e.getMessage()); + return JSONObject.toJSONString(apidatas, SerializerFeature.DisableCircularReferenceDetect); + } + +} diff --git a/JSSBMJ/src/com/engine/secret/web/AuthorityChangeController.java b/JSSBMJ/src/com/engine/secret/web/AuthorityChangeController.java new file mode 100644 index 0000000..4b68aa1 --- /dev/null +++ b/JSSBMJ/src/com/engine/secret/web/AuthorityChangeController.java @@ -0,0 +1,39 @@ +package com.engine.secret.web; + +import com.engine.common.util.ParamUtil; +import com.engine.common.util.ServiceUtil; +import com.engine.secret.service.AuthorityChangeService; +import com.engine.secret.service.impl.AuthorityChangeServiceImpl; +import com.engine.secret.util.ResponseResult; +import weaver.hrm.HrmUserVarify; +import weaver.hrm.User; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; +import java.util.Map; + +/** + * @author:dxfeng + * @createTime: 2025/04/09 + * @version: 1.0 + */ +public class AuthorityChangeController { + public AuthorityChangeService getService(User user) { + return ServiceUtil.getService(AuthorityChangeServiceImpl.class, user); + } + + @POST + @Path("/delegateToProvincialAuthority") + @Produces(MediaType.APPLICATION_JSON) + public String delegateToProvincialAuthority(@Context HttpServletRequest request, @Context HttpServletResponse response) { + User user = HrmUserVarify.getUser(request, response); + Map params = ParamUtil.request2Map(request); + return new ResponseResult, Map>(user).run(getService(user)::delegateToProvincialAuthority, params); + + } +} diff --git a/JSSBMJ/src/com/engine/secret/web/AutoGenerateNumberController.java b/JSSBMJ/src/com/engine/secret/web/AutoGenerateNumberController.java new file mode 100644 index 0000000..66d5c36 --- /dev/null +++ b/JSSBMJ/src/com/engine/secret/web/AutoGenerateNumberController.java @@ -0,0 +1,38 @@ +package com.engine.secret.web; + +import com.engine.common.util.ParamUtil; +import com.engine.common.util.ServiceUtil; +import com.engine.secret.service.AutoGenerateNumberService; +import com.engine.secret.service.impl.AutoGenerateNumberServiceImpl; +import com.engine.secret.util.ResponseResult; +import weaver.hrm.HrmUserVarify; +import weaver.hrm.User; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; +import java.util.Map; + +/** + * @author:dxfeng + * @createTime: 2025/04/16 + * @version: 1.0 + */ +public class AutoGenerateNumberController { + public AutoGenerateNumberService getService(User user) { + return ServiceUtil.getService(AutoGenerateNumberServiceImpl.class, user); + } + + @GET + @Path("/getAcceptanceNumber") + @Produces(MediaType.APPLICATION_JSON) + public String getAcceptanceNumber(@Context HttpServletRequest request, @Context HttpServletResponse response) { + User user = HrmUserVarify.getUser(request, response); + Map param = ParamUtil.request2Map(request); + return new ResponseResult, String>(user).run(getService(user)::getAcceptanceNumber, param); + } +} diff --git a/JSSBMJ/src/com/engine/secret/web/QualificationApplicationController.java b/JSSBMJ/src/com/engine/secret/web/QualificationApplicationController.java new file mode 100644 index 0000000..89d12c5 --- /dev/null +++ b/JSSBMJ/src/com/engine/secret/web/QualificationApplicationController.java @@ -0,0 +1,49 @@ +package com.engine.secret.web; + +import com.engine.common.util.ParamUtil; +import com.engine.common.util.ServiceUtil; +import com.engine.secret.service.QualificationApplicationService; +import com.engine.secret.service.impl.QualificationApplicationServiceImpl; +import com.engine.secret.util.ResponseResult; +import weaver.hrm.HrmUserVarify; +import weaver.hrm.User; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; +import java.util.Map; + +/** + * @author:dxfeng + * @createTime: 2024/08/29 + * @version: 1.0 + */ +public class QualificationApplicationController { + public QualificationApplicationService getService(User user) { + return ServiceUtil.getService(QualificationApplicationServiceImpl.class, user); + } + + @POST + @Path("/parsingFiles") + @Produces(MediaType.APPLICATION_JSON) + public String parsingFiles(@Context HttpServletRequest request, @Context HttpServletResponse response) { + User user = HrmUserVarify.getUser(request, response); + Map params = ParamUtil.request2Map(request); + return new ResponseResult, Map>(user).run(getService(user)::parsingFiles, params); + + } + + @POST + @Path("/deleteParsedData") + @Produces(MediaType.APPLICATION_JSON) + public String deleteParsedData(@Context HttpServletRequest request, @Context HttpServletResponse response) { + User user = HrmUserVarify.getUser(request, response); + Map params = ParamUtil.request2Map(request); + return new ResponseResult, Map>(user).run(getService(user)::deleteParsedData, params); + + } +} diff --git a/JSSBMJ/src/weaver/interfaces/secret/action/ApprovalReviewEndAction.java b/JSSBMJ/src/weaver/interfaces/secret/action/ApprovalReviewEndAction.java new file mode 100644 index 0000000..90be985 --- /dev/null +++ b/JSSBMJ/src/weaver/interfaces/secret/action/ApprovalReviewEndAction.java @@ -0,0 +1,75 @@ +package weaver.interfaces.secret.action; + +import com.engine.secret.util.FlowUtil; +import org.apache.commons.lang.StringUtils; +import weaver.common.DateUtil; +import weaver.conn.RecordSet; +import weaver.interfaces.workflow.action.Action; +import weaver.soa.workflow.request.MainTableInfo; +import weaver.soa.workflow.request.Property; +import weaver.soa.workflow.request.RequestInfo; + +import java.util.HashMap; +import java.util.Map; + +/** + * 审批复核 归档Action + * + * @author:dxfeng + * @createTime: 2025/04/09 + * @version: 1.0 + */ +public class ApprovalReviewEndAction implements Action { + RecordSet rs = new RecordSet(); + + @Override + public String execute(RequestInfo requestInfo) { + try { + MainTableInfo mainTableInfo = requestInfo.getMainTableInfo(); + Property[] properties = mainTableInfo.getProperty(); + Map mainDataMap = new HashMap<>(); + for (Property property : properties) { + mainDataMap.put(property.getName(), property.getValue()); + } + // 获取主流程ID + String mainRequestId = mainDataMap.get("zlcid"); + if (StringUtils.isBlank(mainRequestId)) { + requestInfo.getRequestManager().setMessagecontent("未获取到主流程请求ID"); + return FAILURE_AND_CONTINUE; + } + + // 获取审批复核结论 + String conclusion = mainDataMap.get("spfhjl"); + + // 更新主流程表单的审批复核结论 + String tableNameByRequestId = FlowUtil.getTableNameByRequestId(mainRequestId); + if (StringUtils.isBlank(tableNameByRequestId)) { + requestInfo.getRequestManager().setMessagecontent("主流程表单名称获取异常,请确认"); + return FAILURE_AND_CONTINUE; + } + String sql = "update " + tableNameByRequestId + " set spfhjl = ? where requestid = ?"; + + rs.writeLog("mainRequestId==" + mainRequestId); + rs.writeLog("conclusion==" + conclusion); + rs.writeLog("tableNameByRequestId==" + tableNameByRequestId); + rs.writeLog("sql==" + sql); + + rs.executeUpdate(sql, conclusion, mainRequestId); + + // 更新完成后,自动提交流程到下一节点 + rs.writeLog("mainRequestId==" + mainRequestId); + String options = requestInfo.getCreatorid() + "-自动提交流程-" + DateUtil.getFullDate(); + String submitResult = FlowUtil.submitWorkflowRequest(mainRequestId, options); + if (!"success".equals(submitResult)) { + requestInfo.getRequestManager().setMessagecontent("requestId[" + mainRequestId + "],流程提交失败"); + return FAILURE_AND_CONTINUE; + } + + return SUCCESS; + } catch (Exception e) { + rs.writeLog(e); + requestInfo.getRequestManager().setMessagecontent(e.getMessage()); + return FAILURE_AND_CONTINUE; + } + } +} diff --git a/JSSBMJ/src/weaver/interfaces/secret/action/MeetingConveningEndAction.java b/JSSBMJ/src/weaver/interfaces/secret/action/MeetingConveningEndAction.java new file mode 100644 index 0000000..a6ee35d --- /dev/null +++ b/JSSBMJ/src/weaver/interfaces/secret/action/MeetingConveningEndAction.java @@ -0,0 +1,119 @@ +package weaver.interfaces.secret.action; + +import com.engine.secret.util.ConfigUtil; +import com.engine.secret.util.FlowUtil; +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang.StringUtils; +import weaver.common.DateUtil; +import weaver.conn.RecordSet; +import weaver.interfaces.workflow.action.Action; +import weaver.soa.workflow.request.*; + +import java.util.*; + +/** + * @author:dxfeng + * @createTime: 2025/04/14 + * @version: 1.0 + */ +public class MeetingConveningEndAction implements Action { + RecordSet rs = new RecordSet(); + private static final String MAIN_FLOW_TABLE = ConfigUtil.getConfig("xqxksqlc_table"); + + @Override + public String execute(RequestInfo requestInfo) { + try { + MainTableInfo mainTableInfo = requestInfo.getMainTableInfo(); + Property[] properties = mainTableInfo.getProperty(); + Map mainDataMap = new HashMap<>(); + List> detailMapList = new ArrayList<>(); + for (Property property : properties) { + mainDataMap.put(property.getName(), property.getValue()); + } + + DetailTableInfo detailTableInfo = requestInfo.getDetailTableInfo(); + DetailTable detailTable = detailTableInfo.getDetailTable(0); + String detailTableName = detailTable.getTableDBName(); + String updateDetailSql = "update " + detailTableName + " set zlctjzt = ? where id = ?"; + Row[] rows = detailTable.getRow(); + for (Row row : rows) { + Map detailDataMap = new HashMap<>(mainDataMap); + Cell[] cells = row.getCell(); + String detailId = row.getId(); + for (Cell cell : cells) { + detailDataMap.put(cell.getName(), cell.getValue()); + } + detailDataMap.put("detailId", detailId); + detailMapList.add(detailDataMap); + } + + Set errorMsg = new HashSet<>(); + if (CollectionUtils.isNotEmpty(detailMapList)) { + for (Map detail : detailMapList) { + dealMainFlow(requestInfo, detail, updateDetailSql, errorMsg); + } + } + + // 根据错误信息,返回提示 + if (CollectionUtils.isNotEmpty(errorMsg)) { + requestInfo.getRequestManager().setMessagecontent(StringUtils.join(errorMsg, "
")); + return FAILURE_AND_CONTINUE; + } + + + return SUCCESS; + } catch (Exception e) { + rs.writeLog(e); + requestInfo.getRequestManager().setMessagecontent(e.getMessage()); + return FAILURE_AND_CONTINUE; + } + } + + /** + * 提交主流程 + * + * @param requestInfo + * @param detail + * @param updateDetailSql + * @param errorMsg + */ + private void dealMainFlow(RequestInfo requestInfo, Map detail, String updateDetailSql, Set errorMsg) { + String mainId = detail.get("xzxksqdh"); + + + String conclusion = detail.get("spfhjl"); + String detailId = detail.get("detailId"); + String submitStatus = detail.get("zlctjzt"); + if ("1".equals(submitStatus)) { + // 已经提交成功的流程,不重复处理 + return; + } + + String mainRequestId = ""; + rs.executeQuery("select requestid from " + MAIN_FLOW_TABLE + " where id = ?", mainId); + if (rs.next()) { + mainRequestId = rs.getString("requestid"); + } + if (StringUtils.isBlank(mainRequestId)) { + errorMsg.add("主流程ID[" + mainId + "],主流程requestId获取异常,请确认"); + rs.executeUpdate(updateDetailSql, "2", detailId); + return; + } + + rs.writeLog("mainRequestId==" + mainRequestId); + rs.writeLog("conclusion==" + conclusion); + + rs.executeUpdate("update " + MAIN_FLOW_TABLE + " set spfhjl = ? where requestid = ?", conclusion, mainRequestId); + + // 更新完成后,自动提交流程到下一节点 + rs.writeLog("mainRequestId==" + mainRequestId); + String options = requestInfo.getCreatorid() + "-自动提交流程-" + DateUtil.getFullDate(); + String submitResult = FlowUtil.submitWorkflowRequest(mainRequestId, options); + if (!"success".equals(submitResult)) { + errorMsg.add("requestId[" + mainRequestId + "],流程提交失败"); + rs.executeUpdate(updateDetailSql, "2", detailId); + } else { + rs.executeUpdate(updateDetailSql, "1", detailId); + } + } +} diff --git a/JSSBMJ/src/weaver/interfaces/ythpt/workflow/LegalReviewAction.java b/JSSBMJ/src/weaver/interfaces/ythpt/workflow/LegalReviewAction.java new file mode 100644 index 0000000..0e700e6 --- /dev/null +++ b/JSSBMJ/src/weaver/interfaces/ythpt/workflow/LegalReviewAction.java @@ -0,0 +1,76 @@ +package weaver.interfaces.ythpt.workflow; + +import org.apache.commons.lang3.StringUtils; +import weaver.conn.RecordSet; +import weaver.general.BaseBean; +import weaver.general.Util; +import weaver.hrm.User; +import weaver.interfaces.workflow.action.Action; +import weaver.soa.workflow.request.RequestInfo; + +/** + * 审批复核 归档Action + * + * @author:dxfeng + * @createTime: 2025/04/09 + * @version: 1.0 + */ +public class LegalReviewAction implements Action { + + @Override + public String execute(RequestInfo requestInfo) { + BaseBean bb = new BaseBean(); + RecordSet rs = new RecordSet(); + try { + int requestId = Util.getIntValue(requestInfo.getRequestid()); + String formTableName = requestInfo.getRequestManager().getBillTableName(); + User user = requestInfo.getRequestManager().getUser(); + String userId = String.valueOf(user.getUID()); + + String bdbh = ""; + String ay = ""; + int zlcid = 0; + String dsr = ""; + String zfry = ""; + String bsrq = ""; + String jbqk = ""; + String nzcdjdyj = ""; + String shyj = ""; + String shr = ""; + String shrq = ""; + String mainId = ""; + String sql = "select * from " + formTableName + " where requestid=" + requestId; + rs.executeQuery(sql); + if (rs.next()) { + zlcid = Util.getIntValue(Util.null2String(rs.getString("zlcid"))); + bdbh = Util.null2String(rs.getString("bdbh")); + ay = Util.null2String(rs.getString("ay")); + dsr = Util.null2String(rs.getString("dsr")); + zfry = Util.null2String(rs.getString("zfry")); + bsrq = Util.null2String(rs.getString("bsrq")); + jbqk = Util.null2String(rs.getString("jbqk")); + nzcdjdyj = Util.null2String(rs.getString("nzcdjdyj")); + shyj = Util.null2String(rs.getString("shyj")); + shr = Util.null2String(rs.getString("shr")); + shrq = Util.null2String(rs.getString("shrq")); + mainId = Util.null2String(rs.getString("mainId")); + } + + if(StringUtils.isNotBlank(mainId)){ + sql = " select * from "+formTableName+"_dt1 where mainid = "+mainId+" order by id"; + rs.executeQuery(sql); + while (rs.next()){ + String glscx = Util.null2String(rs.getString("glscx")); + } + } + + } catch (Exception e) { + bb.writeLog(e); + requestInfo.getRequestManager().setMessageid("1111"); + requestInfo.getRequestManager().setMessagecontent(e.getMessage()); + return FAILURE_AND_CONTINUE; + } + return SUCCESS; + } + +} diff --git a/JSSBMJ/src/weaver/interfaces/ythpt/workflow/WorkflowMonitorAction.java b/JSSBMJ/src/weaver/interfaces/ythpt/workflow/WorkflowMonitorAction.java new file mode 100644 index 0000000..a36a526 --- /dev/null +++ b/JSSBMJ/src/weaver/interfaces/ythpt/workflow/WorkflowMonitorAction.java @@ -0,0 +1,241 @@ +package weaver.interfaces.ythpt.workflow; + +import com.engine.common.util.ServiceUtil; +import com.engine.secret.util.ConfigUtil; +import com.engine.workflow.biz.freeNode.FreeNodeBiz; +import com.engine.workflow.constant.PAResponseCode; +import com.engine.workflow.entity.publicApi.PAResponseEntity; +import com.engine.workflow.entity.publicApi.ReqOperateRequestEntity; +import com.engine.workflow.publicApi.WorkflowRequestOperatePA; +import com.engine.workflow.publicApi.impl.WorkflowRequestOperatePAImpl; +import org.apache.commons.lang3.StringUtils; +import weaver.conn.RecordSet; +import weaver.general.BaseBean; +import weaver.general.Util; +import weaver.hrm.User; +import weaver.interfaces.workflow.action.Action; +import weaver.soa.workflow.request.RequestInfo; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 审批复核 归档Action + * + * @author:dxfeng + * @createTime: 2025/04/09 + * @version: 1.0 + */ +public class WorkflowMonitorAction implements Action { + private WorkflowRequestOperatePA getRequestOperatePA() { + return (WorkflowRequestOperatePAImpl) ServiceUtil.getService(WorkflowRequestOperatePAImpl.class); + } + + @Override + public String execute(RequestInfo requestInfo) { + BaseBean bb = new BaseBean(); + RecordSet rs = new RecordSet(); + try { + String ip = requestInfo.getRequestManager().getIp(); + int requestId = Util.getIntValue(requestInfo.getRequestid()); + String formTableName = requestInfo.getRequestManager().getBillTableName(); + User user = requestInfo.getRequestManager().getUser(); + String userId = String.valueOf(user.getUID()); + + + String spfhjl = ""; + String thgc = ""; + int zlcid = 0; + String sql = "select spfhjl,zlcid,thgc from " + formTableName + " where requestid=" + requestId; + rs.executeQuery(sql); + if (rs.next()) { + spfhjl = Util.null2String(rs.getString("spfhjl")); + zlcid = Util.getIntValue(Util.null2String(rs.getString("zlcid"))); + thgc = Util.null2String(rs.getString("thgc")); + } + + if("2".equals(spfhjl)){ + WorkflowRequestOperatePA operatePA = getRequestOperatePA(); + String nodeId = ""; + if("0".equals(thgc)){ + nodeId = ConfigUtil.getConfig("smsc_nodeid"); + }else if("1".equals(thgc)){ + nodeId = ConfigUtil.getConfig("xcsc_nodeid"); + } + + if(StringUtils.isNotBlank(nodeId)){ + bb.writeLog("~~~~doIntervenor接口报文~~~~userId:"+user.getUID()); + if(zlcid > 0){ + ReqOperateRequestEntity reqOperateRequestEntity = intervenor2Entity(zlcid,ip,userId,nodeId); + PAResponseEntity paResponseEntity = operatePA.doIntervenor(user,reqOperateRequestEntity); + PAResponseCode paResponseCode = paResponseEntity.getCode(); + bb.writeLog("PAResponseCode:"+paResponseCode); + if(paResponseCode.getStatusCode() == 1){ + + List list = new ArrayList(); + String xcscFormtable = ConfigUtil.getConfig("xcsc_formtable"); + sql = " select t.requestid " + + " from "+xcscFormtable+" t " + + " inner join workflow_requestbase k on k.requestid = t.requestid " + + " where t.zlcid = "+zlcid +" and k.currentoperatortype in(0,1,2) "; + + bb.writeLog("sql:"+sql); + rs.executeQuery(sql); + while(rs.next()){ + String requestid = Util.null2String(rs.getString("requestid")); + list.add(requestid); + } + bb.writeLog("list:"+list.size()); + int errcount = 0; + for(String lcid : list){ + bb.writeLog("lcid:"+lcid); + + PAResponseEntity forceoverEntity = doForceOver(user,Integer.parseInt(lcid),ip); + PAResponseCode pa_ResponseCode = forceoverEntity.getCode(); + bb.writeLog("code:"+pa_ResponseCode.getStatusCode()); + if(pa_ResponseCode.getStatusCode() != 1){ + errcount++; + } + } + if(errcount > 0){ + requestInfo.getRequestManager().setMessageid("1111"); + requestInfo.getRequestManager().setMessagecontent("现场检查流程强制归档失败"); + return FAILURE_AND_CONTINUE; + } + + }else{ + requestInfo.getRequestManager().setMessageid("1111"); + requestInfo.getRequestManager().setMessagecontent("干预行政许可主流程失败"); + return FAILURE_AND_CONTINUE; + } + } + } + } + + } catch (Exception e) { + bb.writeLog(e); + requestInfo.getRequestManager().setMessageid("1111"); + requestInfo.getRequestManager().setMessagecontent(e.getMessage()); + return FAILURE_AND_CONTINUE; + } + + return SUCCESS; + } + + + public ReqOperateRequestEntity intervenor2Entity(int requestId,String ip,String userId,String nodeId) { + ReqOperateRequestEntity operateRequestEntity = new ReqOperateRequestEntity(); + BaseBean bb = new BaseBean(); + RecordSet rs = new RecordSet(); + try { + if(requestId > 0){ + + // 干预是否执行节点前附加操作 + boolean enableIntervenor = true; + // 会签类型 0 :非会签 1:会签 2:依次逐个处理 + String SignType = "0"; + String remark = ""; + //干预节点接收人,多个人以","号隔开 + String Intervenorid = userId; + // 目标节点ID + int submitNodeId = Util.getIntValue(nodeId) ; + + int workflowId = 0; + String requestName = ""; + +// int userId = 0; +// int forwardFlag = 0; +// String forwardResourceIds = ""; +// int isremind = 0; + + String sql = " select workflowid,requestname from workflow_requestbase where requestid = "+requestId ; + rs.executeQuery(sql); + if(rs.next()){ + requestName = Util.null2String(rs.getString("requestname")); + workflowId = Util.getIntValue(rs.getString("workflowid")); + } + + operateRequestEntity.setWorkflowId(workflowId); + operateRequestEntity.setRequestId(requestId); + operateRequestEntity.setRequestName(requestName); +// operateRequestEntity.setUserId(userId); + operateRequestEntity.setRemark(remark); +// operateRequestEntity.setRequestLevel(requestLevel); +// operateRequestEntity.setForwardFlag(forwardFlag); +// operateRequestEntity.setForwardResourceIds(forwardResourceIds); + operateRequestEntity.setClientIp(ip); +// operateRequestEntity.setIsremind(isremind); + //干预参数 + if (submitNodeId > 0 || FreeNodeBiz.isFreeNode(submitNodeId)) { + operateRequestEntity.setSubmitNodeId(submitNodeId); + operateRequestEntity.setEnableIntervenor(enableIntervenor); + operateRequestEntity.setSignType(Util.getIntValue(Util.null2String(SignType), 0)); + operateRequestEntity.setIntervenorid(Util.null2String(Intervenorid)); + } + bb.writeLog("workflowId:"+workflowId+" requestId:"+requestId+" requestName:"+requestName+"remark:"+remark+ " submitNodeId:"+submitNodeId); + } + } catch (Exception e) { + e.printStackTrace(); + bb.writeLog(e); + } + return operateRequestEntity; + } + + + public PAResponseEntity doForceOver(User user, int requestId,String ip) { + BaseBean bb = new BaseBean(); + WorkflowRequestOperatePA operatePA = getRequestOperatePA(); + bb.writeLog("~~~~doForceOver接口报文~~~~userId:"+user.getUID()); + PAResponseEntity paResponseEntity = operatePA.doForceOver(user, forceOver2Entity(requestId,ip)); + return paResponseEntity; + } + + + public ReqOperateRequestEntity forceOver2Entity(int requestId,String ip) { + ReqOperateRequestEntity operateRequestEntity = new ReqOperateRequestEntity(); + BaseBean bb = new BaseBean(); + RecordSet rs = new RecordSet(); + try { + if(requestId > 0){ + + String remark = ""; + int workflowId = 0; + String requestName = ""; + String sql = " select workflowid,requestname from workflow_requestbase where requestid = "+requestId ; + rs.executeQuery(sql); + if(rs.next()){ + requestName = Util.null2String(rs.getString("requestname")); + workflowId = Util.getIntValue(rs.getString("workflowid")); + } + + Map otherParams = new HashMap(); + otherParams.put("ismonitor","1"); + operateRequestEntity.setOtherParams(otherParams); + + operateRequestEntity.setWorkflowId(workflowId); + operateRequestEntity.setRequestId(requestId); + operateRequestEntity.setRequestName(requestName); +// operateRequestEntity.setUserId(userId); + operateRequestEntity.setRemark(remark); +// operateRequestEntity.setRequestLevel(requestLevel); +// operateRequestEntity.setForwardFlag(forwardFlag); +// operateRequestEntity.setForwardResourceIds(forwardResourceIds); + operateRequestEntity.setClientIp(ip); +// operateRequestEntity.setIsremind(isremind); + + bb.writeLog("workflowId:"+workflowId+" requestId:"+requestId+" requestName:"+requestName+"remark:"+remark); + + } + + } catch (Exception e) { + e.printStackTrace(); + bb.writeLog(e); + } + return operateRequestEntity; + } + + + +} diff --git a/自用E10系统二开/E10-secondev-portal b/自用E10系统二开/E10-secondev-portal new file mode 160000 index 0000000..436ecad --- /dev/null +++ b/自用E10系统二开/E10-secondev-portal @@ -0,0 +1 @@ +Subproject commit 436ecad2da6181d809f917672a3fd4e406bf68aa