From e1fd412254f0cc777c046538c443cd325ce6cff2 Mon Sep 17 00:00:00 2001 From: Mr-wang Date: Tue, 27 Jun 2023 13:48:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=88=A4=E6=96=AD=E5=BD=93?= =?UTF-8?q?=E5=89=8D=E7=99=BB=E5=BD=95=E6=98=AF=E5=90=A6=E4=B8=BA=E4=BA=8B?= =?UTF-8?q?=E4=B8=9A=E9=83=A8,=E6=98=AF=E5=B1=95=E7=A4=BA=E4=B8=80?= =?UTF-8?q?=E7=BA=A7=E9=83=A8=E9=97=A8,=E5=90=A6=E5=88=99=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E4=BA=8C=E7=BA=A7=E9=83=A8=E9=97=A8=E6=88=96=E8=80=85?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E6=89=80=E5=9C=A8=E9=83=A8=E9=97=A8,?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=AA=E4=BA=BA=E8=A7=86=E5=9B=BE=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E4=BB=A3=E7=A0=81=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DataViewController.java | 16 +- .../reportform/service/DataViewService.java | 528 +++++++++++++++++- 2 files changed, 527 insertions(+), 17 deletions(-) diff --git a/com.awspaas.user.apps.yili.reportform/src/com/awspaas/user/apps/yili/reportform/controller/DataViewController.java b/com.awspaas.user.apps.yili.reportform/src/com/awspaas/user/apps/yili/reportform/controller/DataViewController.java index 2771866c..8aeb18aa 100644 --- a/com.awspaas.user.apps.yili.reportform/src/com/awspaas/user/apps/yili/reportform/controller/DataViewController.java +++ b/com.awspaas.user.apps.yili.reportform/src/com/awspaas/user/apps/yili/reportform/controller/DataViewController.java @@ -42,9 +42,19 @@ public class DataViewController { public String personalView(UserContext uc, RequestParams params) { return new DataViewService(uc).personalView(uc, params); } - - - + @Mapping(value = "com.awspaas.user.apps.yili.reportform.service.IfSyB", + desc = "判断事业部") + public String personSyb(UserContext uc) { + return new DataViewService(uc).personalSyb(uc); + } + + @Mapping(value = "com.awspaas.user.apps.yili.reportform.service.DataViewService_personalView_right", + desc = "个人视图_本岗位有权限的流程图") + public String personalView_right(UserContext uc, RequestParams params) { + return new DataViewService(uc).personalView_right(uc, params); + } + + @Mapping(value = "com.awspaas.user.apps.yili.reportform.service.DataViewService_queryTermsDept", desc = "筛选条件:当前用户部门、部门") public String queryTermsDept(UserContext uc, RequestParams params) { diff --git a/com.awspaas.user.apps.yili.reportform/src/com/awspaas/user/apps/yili/reportform/service/DataViewService.java b/com.awspaas.user.apps.yili.reportform/src/com/awspaas/user/apps/yili/reportform/service/DataViewService.java index 298df7db..80a301d5 100644 --- a/com.awspaas.user.apps.yili.reportform/src/com/awspaas/user/apps/yili/reportform/service/DataViewService.java +++ b/com.awspaas.user.apps.yili.reportform/src/com/awspaas/user/apps/yili/reportform/service/DataViewService.java @@ -145,6 +145,29 @@ public class DataViewService extends ActionWeb { return ro.toString(); } + public String personalSyb(UserContext uc){ + ResponseObject ro = ResponseObject.newOkResponse(); + String pathNameOfCache = uc.getDepartmentModel().getPathNameOfCache(); + if (pathNameOfCache.contains("事业部")){ + String pathIdOfCache = uc.getDepartmentModel().getPathIdOfCache(); + String[] split = pathIdOfCache.split("/"); + ro.put("departId",split[0]); + ro.put("pathId",pathIdOfCache); + }else { + String pathIdOfCache = uc.getDepartmentModel().getPathIdOfCache(); + String[] split = pathIdOfCache.split("/"); + System.out.println("split>>>>>>"+split.toString()); + if (split.length>=2){ + ro.put("departId",split[1]); + ro.put("pathId",pathIdOfCache); + }else { + ro.put("departId",split[0]); + ro.put("pathId",pathIdOfCache); + } + } + return ro.toString(); + } + /** * @methodName: * @param: @@ -317,8 +340,8 @@ public class DataViewService extends ActionWeb { if (null != refileRowMap && !refileRowMap.isEmpty()) { if (refileRowMap.getString("PLMETHODID").equals("control.policy") && (refileRowMap.getString("POLICYTYPE").equals("regulation") - || null == refileRowMap.getString("POLICYTYPE") - || refileRowMap.getString("POLICYTYPE").equals(""))) { + || null == refileRowMap.getString("POLICYTYPE") + || refileRowMap.getString("POLICYTYPE").equals(""))) { // && refileRowMap.getString("POLICYTYPE").equals("regulation") UoPProcessMap = new HashMap(); fileType = "reRegulationFile"; @@ -388,8 +411,8 @@ public class DataViewService extends ActionWeb { if (null != refileRowMap && !refileRowMap.isEmpty()) { if (refileRowMap.getString("PLMETHODID").equals("control.policy") && (refileRowMap.getString("POLICYTYPE").equals("regulation") - || null == refileRowMap.getString("POLICYTYPE") - || refileRowMap.getString("POLICYTYPE").equals(""))) { + || null == refileRowMap.getString("POLICYTYPE") + || refileRowMap.getString("POLICYTYPE").equals(""))) { // && refileRowMap.getString("POLICYTYPE").equals("regulation") UoPProcessMap = new HashMap(); fileType = "reRegulationFile"; @@ -594,7 +617,7 @@ public class DataViewService extends ActionWeb { String POSITION_NAME = UserContext.fromUID(uid).getUserModel().getPositionName(); if (UtilString.isNotEmpty(POSITION_NAME)) { List nodeRowMaps = DBSql.getMaps( - "SELECT NODEID,NODENAME,NODETYPE,PLID,PLNAME,ACTIVITYNUMBER,ACTIVITYDESC,ROLE,ROLENAME,POST,POSTNAME FROM BO_EU_PAL_FILENODE5 WHERE POST LIKE '%" + "SELECT NODEID,NODENAME,NODETYPE,PLID,PLNAME,ACTIVITYNUMBER,ACTIVITYDESC,ROLE,ROLENAME,POST,POSTNAME FROM BO_EU_PAL_FILENODE6 WHERE POST LIKE '%" + POSITION_NAME + "%'"); for (RowMap nodeRowMap : nodeRowMaps) { String PLID = nodeRowMap.getString("PLID"); @@ -692,8 +715,8 @@ public class DataViewService extends ActionWeb { if (null != refileRowMap && !refileRowMap.isEmpty()) { if (refileRowMap.getString("PLMETHODID").equals("control.policy") && (refileRowMap.getString("POLICYTYPE").equals("regulation") - || null == refileRowMap.getString("POLICYTYPE") - || refileRowMap.getString("POLICYTYPE").equals(""))) { + || null == refileRowMap.getString("POLICYTYPE") + || refileRowMap.getString("POLICYTYPE").equals(""))) { // && refileRowMap.getString("POLICYTYPE").equals("regulation") UoPProcessMap = new HashMap(); fileType = "reRegulationFile"; @@ -763,8 +786,8 @@ public class DataViewService extends ActionWeb { if (null != refileRowMap && !refileRowMap.isEmpty()) { if (refileRowMap.getString("PLMETHODID").equals("control.policy") && (refileRowMap.getString("POLICYTYPE").equals("regulation") - || null == refileRowMap.getString("POLICYTYPE") - || refileRowMap.getString("POLICYTYPE").equals(""))) { + || null == refileRowMap.getString("POLICYTYPE") + || refileRowMap.getString("POLICYTYPE").equals(""))) { // && refileRowMap.getString("POLICYTYPE").equals("regulation") UoPProcessMap = new HashMap(); fileType = "reRegulationFile"; @@ -957,6 +980,483 @@ public class DataViewService extends ActionWeb { return ro.toString(); } + /** + * @methodName: + * @param: + * @return: + * @description:个人视图_本岗位有权限的流程 + * @auther: wangcy + * @date: 2023/6/36 14:12 + */ + public String personalView_right(UserContext uc, RequestParams params) { + ResponseObject ro = ResponseObject.newOkResponse(); + String positionKeys = null; + String positionVals = null; + Integer i = -1; + String uid = params.get("uid"); + String sid = _uc.getSessionId(); + // 定义用户/岗位流程list,用户/岗位流程map + ArrayList UoPProcessMaps = new ArrayList<>(); + HashMap UoPProcessMap = new HashMap<>(); + ArrayList nodeMaps = new ArrayList<>(); + ArrayList nodeAMaps = new ArrayList<>(); + ArrayList nodeBMaps = new ArrayList<>(); + HashMap nodeMap = new HashMap<>(); + Map nodeTempMap = new HashMap<>(); + ArrayList reRegulationMaps = new ArrayList<>(); + ArrayList reFormMaps = new ArrayList<>(); + ArrayList reIO_L4Maps = new ArrayList<>(); + ArrayList reYSMaps = new ArrayList<>(); + ArrayList tempMaps = new ArrayList<>(); + LinkedList linksMaps = new LinkedList<>(); + HashMap linksMap = new HashMap<>(); + String path = ""; + PALRepositoryModel model = null; + String taskId = ""; + String fileType = ""; + Integer totalNum = 0; + Integer aNum = 0; + Integer bNum = 0; + Object[] sqlParams = new Object[] {}; + // List fileRowMaps = DBSql.getMaps("SELECT + // FILEID,PLNAME,PLMETHODID,PLLEVEL,PLORDERINDEX,RELEVANTFILE,SUPPORTFILE,PROCESSKPI + // FROM BO_EU_PAL_FILE1 WHERE PLMETHODID='process.epc' AND FILESTATE='1' ORDER + // BY TO_NUMBER(PLLEVEL) ASC, TO_NUMBER(PLORDERINDEX) ASC"); + // List fileRowMaps1 = DBSql.getMaps("SELECT + // FILEID,PLNAME,PLMETHODID,PLLEVEL,PLORDERINDEX,RELEVANTFILE,SUPPORTFILE,PROCESSKPI + // FROM BO_EU_PAL_FILE1 WHERE PLMETHODID='process.epc' AND FILESTATE='1' ORDER + // BY PLLEVEL ASC, PLORDERINDEX ASC"); + // AND FILESTATE='1' ORDER BY TO_NUMBER(PLLEVEL) ASC, TO_NUMBER(PLORDERINDEX) + // ASC + + UoPProcessMaps = new ArrayList(); + nodeMaps = new ArrayList(); + linksMaps = new LinkedList(); + UoPProcessMap = new HashMap(); + String rootuuId = SDK.getRuleAPI().executeAtScript("@uuid()"); + UoPProcessMap.put("id", rootuuId); + UoPProcessMap.put("text", "岗位流程"); + UoPProcessMap.put("fileType", "UoPProcess"); + UoPProcessMaps.add(UoPProcessMap); + long start = System.currentTimeMillis(); + ArrayList positionNameList = new ArrayList<>(); + // if (nodeRowMap.getString("ROLE").equals(positionID) || + // nodeRowMap.getString("POST").equals(positionID)) { + String positionName = UserContext.fromUID(uid).getUserModel().getPositionName(); + String departName = UserContext.fromUID(uid).getDepartmentModel().getName(); + + List nodeRowMaps = DBSql.getMaps( + "SELECT NODEID,NODENAME,NODETYPE,PLID,PLNAME,ACTIVITYNUMBER,ACTIVITYDESC,ROLE,ROLENAME,POST,POSTNAME FROM BO_EU_PAL_FILENODE6 WHERE POST LIKE '%" + + positionName + "%' OR POST LIKE '%内蒙古伊利实业集团股份有限公司%' "); + List DepartnodeRowMaps = DBSql.getMaps( + "SELECT NODEID,NODENAME,NODETYPE,PLID,PLNAME,ACTIVITYNUMBER,ACTIVITYDESC,ROLE,ROLENAME,POST,POSTNAME FROM BO_EU_PAL_FILENODE6 WHERE POST LIKE '%" + + departName + "%' OR POST LIKE '%内蒙古伊利实业集团股份有限公司%' "); + System.out.println("=========nodeRowMaps========>"+nodeRowMaps); + System.out.println("=========DepartnodeRowMaps========>"+DepartnodeRowMaps); + for (RowMap nodeRowMap : nodeRowMaps) { + String plId = nodeRowMap.getString("PLID"); + RowMap fileRowMap = DBSql.getMap( + "SELECT FILESTATE,FILEID,PLNAME,PLMETHODID,PLLEVEL,PLORDERINDEX,RELEVANTFILE,SUPPORTFILE,PROCESSKPI FROM BO_EU_PAL_FILE1 WHERE FILEID = '" + + plId + "'"); + if (fileRowMap != null) { + if ("0".equals(fileRowMap.getString("FILESTATE"))) { + continue; + } + nodeMap = new HashMap(); + taskId = getLastPublishTaskIdByModelId(plId); + /* + * model = PALRepositoryCache.getCache().get(plId); if (null != model) { if + * (model.isPublish() || model.isStop()) {// 停用或已发布状态查询最新流程手册 } } + */ + path = "./w" + "?" + "cmd=com.actionsoft.apps.coe.pal.publisher_publish_file_open" + "&" + + "uuid=" + plId + "&" + "sid=" + sid + "&" + "taskId=" + + taskId; + nodeMap.put("NODENAME", nodeRowMap.getString("NODENAME")); + nodeMap.put("PLNAME", nodeRowMap.getString("PLNAME")); + nodeMap.put("NODETYPE", nodeRowMap.getString("NODETYPE")); + nodeMap.put("path", path); + nodeMap.put("ACTIVITYNUMBER", nodeRowMap.getString("ACTIVITYNUMBER")); + nodeMap.put("ACTIVITYDESC", nodeRowMap.getString("ACTIVITYDESC")); + nodeMap.put("ROLENAME", nodeRowMap.getString("ROLE")); + nodeMap.put("POSTNAME", nodeRowMap.getString("POST")); + nodeMaps.add(nodeMap); + + UoPProcessMap = new HashMap(); + fileType = "process"; + /* + * model = PALRepositoryCache.getCache().get(fileRowMap.getString("FILEID")); if + * (null != model) { if (model.isPublish() || model.isStop()) {// + * 停用或已发布状态查询最新流程手册 taskId = getLastPublishTaskIdByModelId(model.getId()); } } + */ + path = "./w" + "?" + "cmd=com.actionsoft.apps.coe.pal.publisher_publish_file_open" + "&" + + "uuid=" + fileRowMap.getString("FILEID") + "&" + "sid=" + sid + "&" + "taskId=" + + taskId; + UoPProcessMap.put("id", fileRowMap.getString("FILEID")); + UoPProcessMap.put("text", fileRowMap.getString("PLNAME")); + UoPProcessMap.put("path", path); + UoPProcessMap.put("RELEVANTFILE", fileRowMap.getString("RELEVANTFILE")); + UoPProcessMap.put("SUPPORTFILE", fileRowMap.getString("SUPPORTFILE")); + UoPProcessMap.put("PROCESSKPI", fileRowMap.getString("PROCESSKPI")); + UoPProcessMap.put("fileType", fileType); + UoPProcessMap.put("PARENTID", rootuuId); + UoPProcessMaps.add(UoPProcessMap); + } + + } + + for (RowMap nodeRowMap : DepartnodeRowMaps) { + String plId = nodeRowMap.getString("PLID"); + RowMap fileRowMap = DBSql.getMap( + "SELECT FILESTATE,FILEID,PLNAME,PLMETHODID,PLLEVEL,PLORDERINDEX,RELEVANTFILE,SUPPORTFILE,PROCESSKPI FROM BO_EU_PAL_FILE1 WHERE FILEID = '" + + plId + "'"); + if (fileRowMap != null) { + if ("0".equals(fileRowMap.getString("FILESTATE"))) { + continue; + } + nodeMap = new HashMap(); + taskId = getLastPublishTaskIdByModelId(plId); + /* + * model = PALRepositoryCache.getCache().get(plId); if (null != model) { if + * (model.isPublish() || model.isStop()) {// 停用或已发布状态查询最新流程手册 } } + */ + path = "./w" + "?" + "cmd=com.actionsoft.apps.coe.pal.publisher_publish_file_open" + "&" + + "uuid=" + plId + "&" + "sid=" + sid + "&" + "taskId=" + + taskId; + nodeMap.put("NODENAME", nodeRowMap.getString("NODENAME")); + nodeMap.put("PLNAME", nodeRowMap.getString("PLNAME")); + nodeMap.put("NODETYPE", nodeRowMap.getString("NODETYPE")); + nodeMap.put("path", path); + nodeMap.put("ACTIVITYNUMBER", nodeRowMap.getString("ACTIVITYNUMBER")); + nodeMap.put("ACTIVITYDESC", nodeRowMap.getString("ACTIVITYDESC")); + nodeMap.put("ROLENAME", nodeRowMap.getString("ROLE")); + nodeMap.put("POSTNAME", nodeRowMap.getString("POST")); + nodeMaps.add(nodeMap); + + UoPProcessMap = new HashMap(); + fileType = "process"; + /* + * model = PALRepositoryCache.getCache().get(fileRowMap.getString("FILEID")); if + * (null != model) { if (model.isPublish() || model.isStop()) {// + * 停用或已发布状态查询最新流程手册 taskId = getLastPublishTaskIdByModelId(model.getId()); } } + */ + path = "./w" + "?" + "cmd=com.actionsoft.apps.coe.pal.publisher_publish_file_open" + "&" + + "uuid=" + fileRowMap.getString("FILEID") + "&" + "sid=" + sid + "&" + "taskId=" + + taskId; + UoPProcessMap.put("id", fileRowMap.getString("FILEID")); + UoPProcessMap.put("text", fileRowMap.getString("PLNAME")); + UoPProcessMap.put("path", path); + UoPProcessMap.put("RELEVANTFILE", fileRowMap.getString("RELEVANTFILE")); + UoPProcessMap.put("SUPPORTFILE", fileRowMap.getString("SUPPORTFILE")); + UoPProcessMap.put("PROCESSKPI", fileRowMap.getString("PROCESSKPI")); + UoPProcessMap.put("fileType", fileType); + UoPProcessMap.put("PARENTID", rootuuId); + UoPProcessMaps.add(UoPProcessMap); + } + + } + + long end = System.currentTimeMillis(); + System.err.println("个人视图(有权限的流程)查询用时=========>" + (end - start) / 1000 + "秒"); + UoPProcessMaps = UoPProcessMaps.stream() + .collect(collectingAndThen( + toCollection(() -> new TreeSet<>(Comparator.comparing(o -> String.valueOf(o.get("id"))))), + ArrayList::new)); + tempMaps = new ArrayList(); + if (nodeMaps.size() == 0) { + ro.put("rootId", ""); + UoPProcessMaps = new ArrayList(); + ro.put("nodes", UoPProcessMaps); + linksMaps = new LinkedList(); + ro.put("links", linksMaps); + ro.info("您所查询的流程暂无可发起的流程"); + + } else { + for (Map uoPProcessMap : UoPProcessMaps) { + reRegulationMaps = new ArrayList<>(); + reFormMaps = new ArrayList<>(); + reIO_L4Maps = new ArrayList<>(); + reYSMaps = new ArrayList<>(); + String FILEID = String.valueOf(uoPProcessMap.get("id")); + fileType = String.valueOf(uoPProcessMap.get("fileType")); + if (fileType.equals("process")) { + String RELEVANTFILE = String.valueOf(uoPProcessMap.get("RELEVANTFILE")); + String SUPPORTFILE = String.valueOf(uoPProcessMap.get("SUPPORTFILE")); + String PROCESSKPI = String.valueOf(uoPProcessMap.get("PROCESSKPI")); + if (null != RELEVANTFILE && !RELEVANTFILE.equals("")) { + String[] reFileIDs = RELEVANTFILE.split(" "); + for (String reFileID : reFileIDs) { + sqlParams = new Object[] { reFileID }; + RowMap refileRowMap = DBSql.getMap( + "SELECT FILEID,PLNAME,PLMETHODID,PLLEVEL,PLORDERINDEX,POLICYTYPE FROM BO_EU_PAL_FILE1 WHERE FILEID=?", + sqlParams); + if (null != refileRowMap && !refileRowMap.isEmpty()) { + if (refileRowMap.getString("PLMETHODID").equals("control.policy") + && (refileRowMap.getString("POLICYTYPE").equals("regulation") + || null == refileRowMap.getString("POLICYTYPE") + || refileRowMap.getString("POLICYTYPE").equals(""))) { + // && refileRowMap.getString("POLICYTYPE").equals("regulation") + UoPProcessMap = new HashMap(); + fileType = "reRegulationFile"; + model = PALRepositoryCache.getCache().get(reFileID); + if (null != model) { + if (model.isPublish() || model.isStop()) {// 停用或已发布状态查询最新流程手册 + taskId = getLastPublishTaskIdByModelId(model.getId()); + } + } + path = "./w" + "?" + + "cmd=com.actionsoft.apps.coe.pal.publisher_publish_file_open" + "&" + + "uuid=" + reFileID + "&" + "sid=" + sid + "&" + "taskId=" + taskId; + UoPProcessMap.put("id", FILEID + refileRowMap.getString("FILEID")); + UoPProcessMap.put("text", refileRowMap.getString("PLNAME")); + UoPProcessMap.put("path", path); + UoPProcessMap.put("fileType", fileType); + UoPProcessMap.put("PARENTID", FILEID + "reRegulation"); + reRegulationMaps.add(UoPProcessMap); + } else if (refileRowMap.getString("PLMETHODID").equals("data.form")) { + UoPProcessMap = new HashMap(); + fileType = "reFormFile"; + model = PALRepositoryCache.getCache().get(reFileID); + if (model != null) { + if (model.isPublish() || model.isStop()) {// 停用或已发布状态查询最新流程手册 + taskId = getLastPublishTaskIdByModelId(model.getId()); + } + } + path = "./w" + "?" + + "cmd=com.actionsoft.apps.coe.pal.publisher_publish_file_open" + "&" + + "uuid=" + reFileID + "&" + "sid=" + sid + "&" + "taskId=" + taskId; + UoPProcessMap.put("id", FILEID + refileRowMap.getString("FILEID")); + UoPProcessMap.put("text", refileRowMap.getString("PLNAME")); + UoPProcessMap.put("path", path); + UoPProcessMap.put("fileType", fileType); + UoPProcessMap.put("PARENTID", FILEID + "reForm"); + reFormMaps.add(UoPProcessMap); + } else if (refileRowMap.getString("PLMETHODID").equals("control.policy") + && refileRowMap.getString("POLICYTYPE").equals("I/O_L4")) { + UoPProcessMap = new HashMap(); + fileType = "reI/O_L4File"; + model = PALRepositoryCache.getCache().get(reFileID); + if (null != model) { + if (model.isPublish() || model.isStop()) {// 停用或已发布状态查询最新流程手册 + taskId = getLastPublishTaskIdByModelId(model.getId()); + } + } + path = "./w" + "?" + + "cmd=com.actionsoft.apps.coe.pal.publisher_publish_file_open" + "&" + + "uuid=" + reFileID + "&" + "sid=" + sid + "&" + "taskId=" + taskId; + UoPProcessMap.put("id", FILEID + refileRowMap.getString("FILEID")); + UoPProcessMap.put("text", refileRowMap.getString("PLNAME")); + UoPProcessMap.put("path", path); + UoPProcessMap.put("fileType", fileType); + UoPProcessMap.put("PARENTID", FILEID + "reI/O_L4"); + reIO_L4Maps.add(UoPProcessMap); + } + } + } + } + if (null != SUPPORTFILE && !SUPPORTFILE.equals("")) { + String[] reFileIDs = SUPPORTFILE.split(" "); + for (String reFileID : reFileIDs) { + sqlParams = new Object[] { reFileID }; + RowMap refileRowMap = DBSql.getMap( + "SELECT FILEID,PLNAME,PLMETHODID,PLLEVEL,PLORDERINDEX,POLICYTYPE FROM BO_EU_PAL_FILE1 WHERE FILEID=?", + sqlParams); + if (null != refileRowMap && !refileRowMap.isEmpty()) { + if (refileRowMap.getString("PLMETHODID").equals("control.policy") + && (refileRowMap.getString("POLICYTYPE").equals("regulation") + || null == refileRowMap.getString("POLICYTYPE") + || refileRowMap.getString("POLICYTYPE").equals(""))) { + // && refileRowMap.getString("POLICYTYPE").equals("regulation") + UoPProcessMap = new HashMap(); + fileType = "reRegulationFile"; + model = PALRepositoryCache.getCache().get(reFileID); + if (null != model) { + if (model.isPublish() || model.isStop()) {// 停用或已发布状态查询最新流程手册 + taskId = getLastPublishTaskIdByModelId(model.getId()); + } + } + path = "./w" + "?" + + "cmd=com.actionsoft.apps.coe.pal.publisher_publish_file_open" + "&" + + "uuid=" + reFileID + "&" + "sid=" + sid + "&" + "taskId=" + taskId; + UoPProcessMap.put("id", FILEID + refileRowMap.getString("FILEID")); + UoPProcessMap.put("text", refileRowMap.getString("PLNAME")); + UoPProcessMap.put("path", path); + UoPProcessMap.put("fileType", fileType); + UoPProcessMap.put("PARENTID", FILEID + "reRegulation"); + reRegulationMaps.add(UoPProcessMap); + } else if (refileRowMap.getString("PLMETHODID").equals("data.form")) { + UoPProcessMap = new HashMap(); + fileType = "reFormFile"; + model = PALRepositoryCache.getCache().get(reFileID); + if (null != model) { + if (model.isPublish() || model.isStop()) {// 停用或已发布状态查询最新流程手册 + taskId = getLastPublishTaskIdByModelId(model.getId()); + } + } + path = "./w" + "?" + + "cmd=com.actionsoft.apps.coe.pal.publisher_publish_file_open" + "&" + + "uuid=" + reFileID + "&" + "sid=" + sid + "&" + "taskId=" + taskId; + UoPProcessMap.put("id", FILEID + refileRowMap.getString("FILEID")); + UoPProcessMap.put("text", refileRowMap.getString("PLNAME")); + UoPProcessMap.put("path", path); + UoPProcessMap.put("fileType", fileType); + UoPProcessMap.put("PARENTID", FILEID + "reForm"); + reFormMaps.add(UoPProcessMap); + } else if (refileRowMap.getString("PLMETHODID").equals("control.policy") + && refileRowMap.getString("POLICYTYPE").equals("I/O_L4")) { + UoPProcessMap = new HashMap(); + fileType = "reI/O_L4File"; + model = PALRepositoryCache.getCache().get(reFileID); + if (null != model) { + if (model.isPublish() || model.isStop()) {// 停用或已发布状态查询最新流程手册 + taskId = getLastPublishTaskIdByModelId(model.getId()); + } + } + path = "./w" + "?" + + "cmd=com.actionsoft.apps.coe.pal.publisher_publish_file_open" + "&" + + "uuid=" + reFileID + "&" + "sid=" + sid + "&" + "taskId=" + taskId; + UoPProcessMap.put("id", FILEID + refileRowMap.getString("FILEID")); + UoPProcessMap.put("text", refileRowMap.getString("PLNAME")); + UoPProcessMap.put("path", path); + UoPProcessMap.put("fileType", fileType); + UoPProcessMap.put("PARENTID", FILEID + "reI/O_L4"); + reIO_L4Maps.add(UoPProcessMap); + } + } + } + } + if (null != PROCESSKPI && !PROCESSKPI.equals("")) { + String[] PROCESSKPIIDS = PROCESSKPI.split(" "); + for (String PROCESSKPIID : PROCESSKPIIDS) { + sqlParams = new Object[] { PROCESSKPIID }; + RowMap refileRowMap = DBSql.getMap( + "SELECT FILEID,PLNAME,PLMETHODID,PLLEVEL,PLORDERINDEX,POLICYTYPE FROM BO_EU_PAL_FILE1 WHERE FILEID=?", + sqlParams); + if (null != refileRowMap && !refileRowMap.isEmpty()) { + UoPProcessMap = new HashMap(); + fileType = "processKPIFile"; + model = PALRepositoryCache.getCache().get(PROCESSKPIID); + if (null != model) { + if (model.isPublish() || model.isStop()) {// 停用或已发布状态查询最新流程手册 + taskId = getLastPublishTaskIdByModelId(model.getId()); + } + } + path = "./w" + "?" + "cmd=com.actionsoft.apps.coe.pal.publisher_publish_file_open" + + "&" + "uuid=" + PROCESSKPIID + "&" + "sid=" + sid + "&" + "taskId=" + + taskId; + UoPProcessMap.put("id", FILEID + refileRowMap.getString("FILEID")); + UoPProcessMap.put("text", refileRowMap.getString("PLNAME")); + UoPProcessMap.put("path", path); + UoPProcessMap.put("fileType", fileType); + UoPProcessMap.put("PARENTID", FILEID + "reProcessKPI"); + reYSMaps.add(UoPProcessMap); + } + } + } + if (null != reRegulationMaps && !reRegulationMaps.isEmpty()) { + UoPProcessMap = new HashMap(); + UoPProcessMap.put("id", FILEID + "reRegulation"); + UoPProcessMap.put("text", "相关制度"); + UoPProcessMap.put("fileType", "reRegulation"); + UoPProcessMap.put("PARENTID", FILEID); + reRegulationMaps.add(UoPProcessMap); + } + if (null != reFormMaps && !reFormMaps.isEmpty()) { + UoPProcessMap = new HashMap(); + UoPProcessMap.put("id", FILEID + "reForm"); + UoPProcessMap.put("text", "相关表单"); + UoPProcessMap.put("fileType", "reForm"); + UoPProcessMap.put("PARENTID", FILEID); + reFormMaps.add(UoPProcessMap); + } + if (null != reIO_L4Maps && !reIO_L4Maps.isEmpty()) { + UoPProcessMap = new HashMap(); + UoPProcessMap.put("id", FILEID + "reI/O_L4"); + UoPProcessMap.put("text", "相关操作指导"); + UoPProcessMap.put("fileType", "reI/O_L4"); + UoPProcessMap.put("PARENTID", FILEID); + reIO_L4Maps.add(UoPProcessMap); + } + if (null != reYSMaps && !reYSMaps.isEmpty()) { + UoPProcessMap = new HashMap(); + UoPProcessMap.put("id", FILEID + "reYS"); + UoPProcessMap.put("text", "相关要素"); + UoPProcessMap.put("fileType", "reYS"); + UoPProcessMap.put("PARENTID", FILEID); + reYSMaps.add(UoPProcessMap); + UoPProcessMap = new HashMap(); + UoPProcessMap.put("id", FILEID + "reProcessKPI"); + UoPProcessMap.put("text", "绩效"); + UoPProcessMap.put("fileType", "reProcessKPI"); + UoPProcessMap.put("PARENTID", FILEID + "reYS"); + reYSMaps.add(UoPProcessMap); + } + tempMaps.addAll(reRegulationMaps); + tempMaps.addAll(reFormMaps); + tempMaps.addAll(reIO_L4Maps); + tempMaps.addAll(reYSMaps); + } + } + UoPProcessMaps.addAll(tempMaps); + if (UoPProcessMaps.size() > 1) { + for (Map uoPProcessMap : UoPProcessMaps) { + if (String.valueOf(uoPProcessMap.get("fileType")).equals("UoPProcess")) { + ro.put("rootId", String.valueOf(uoPProcessMap.get("id"))); + } + } + ro.put("nodes", UoPProcessMaps); + for (Map uoPProcessMap : UoPProcessMaps) { + String id = String.valueOf(uoPProcessMap.get("id")); + for (Map pProcessMap : UoPProcessMaps) { + String PARENTID = String.valueOf(pProcessMap.get("PARENTID")); + if (id.equals(PARENTID)) { + String childID = String.valueOf(pProcessMap.get("id")); + linksMap = new LinkedHashMap(); + linksMap.put("from", id); + linksMap.put("to", childID); + linksMaps.add(linksMap); + } + } + } + ro.put("links", linksMaps); + } else { + ro.put("rootId", ""); + UoPProcessMaps = new ArrayList(); + ro.put("nodes", UoPProcessMaps); + linksMaps = new LinkedList(); + ro.put("links", linksMaps); + ro.info("您所查询的岗位暂无需执行的流程"); + + } + } + nodeAMaps = new ArrayList<>(); + nodeBMaps = new ArrayList<>(); + if (null != nodeMaps && !nodeMaps.isEmpty()) { + for (Map nodeReturnMap : nodeMaps) { + nodeTempMap = new HashMap(); + String NODETYPE = String.valueOf(nodeReturnMap.get("NODETYPE")); + if (NODETYPE.equals("method_approval_node") || NODETYPE.equals("method_service_node")) { + nodeTempMap = nodeReturnMap; + nodeAMaps.add(nodeTempMap); + } else if (NODETYPE.equals("method_approval_node3") || NODETYPE.equals("method_service_node4")) { + nodeTempMap = nodeReturnMap; + nodeBMaps.add(nodeTempMap); + } + } + } + totalNum = nodeMaps.size(); + aNum = nodeAMaps.size(); + bNum = nodeBMaps.size(); + ro.put("totalNodeNum", totalNum); + ro.put("totalNode", nodeMaps); + ro.put("typeANum", aNum); + ro.put("typeA", nodeAMaps); + ro.put("typeBNum", bNum); + ro.put("typeB", nodeBMaps); + + // 岗位流程/我的流程 + return ro.toString(); + } + /** * @methodName: * @param: @@ -1239,7 +1739,7 @@ public class DataViewService extends ActionWeb { // reFileRowMap); } fileRowMaps = fileHandleRowMaps; - System.err.println("=======fileRowMaps========="+fileRowMaps); + System.err.println("=======fileRowMaps========="+fileRowMaps); // 遍历选择的结果 List fileMaps = new ArrayList<>(); List frameRowMaps = new ArrayList<>(); @@ -1300,8 +1800,8 @@ public class DataViewService extends ActionWeb { processFileNum += 1; } else if (fileRowMap.getString("PLMETHODID").equals("control.policy") && (fileRowMap.getString("POLICYTYPE").equals("regulation") - || null == fileRowMap.getString("POLICYTYPE") - || fileRowMap.getString("POLICYTYPE").equals(""))) { + || null == fileRowMap.getString("POLICYTYPE") + || fileRowMap.getString("POLICYTYPE").equals(""))) { // && fileRowMap.getString("POLICYTYPE").equals("regulation") fileMap.put("fileType", "policyFile"); policyFileNum += 1; @@ -1415,7 +1915,7 @@ public class DataViewService extends ActionWeb { // 查询所有文件 public void getind(String dempId, String fileType, List fileRowMaps, ArrayList fileHandleRowMaps, - Map reFileMap, RowMap reFileRowMap) { + Map reFileMap, RowMap reFileRowMap) { fileHandleRowMaps = new ArrayList<>(); if (null != fileRowMaps && !fileRowMaps.isEmpty()) { for (RowMap fileRowMap : fileRowMaps) { @@ -1506,7 +2006,7 @@ public class DataViewService extends ActionWeb { } public void getArrt(String name, PALRepositoryModel model, String dempId, Integer PLLEVEL, RowMap reFileRowMap, - ArrayList fileHandleRowMaps) { + ArrayList fileHandleRowMaps) { // 支持相关文件 List support_filesList = DesignerShapeRelationCache.getListByAttrId(model.getId(), "", name);