From bd3dbafcc6fd98f2b56bf06c54b0278710e65d4b Mon Sep 17 00:00:00 2001 From: Mr-wang Date: Sat, 29 Jul 2023 23:04:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B2=97=E4=BD=8D=E8=AF=B4=E6=98=8E=E4=B9=A6-?= =?UTF-8?q?=E9=9D=9E=E5=8F=91=E5=B8=83=E7=8A=B6=E6=80=81=E7=9A=84=E4=B8=8D?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pal/output/or/report1/Report1Gener.java | 1210 +++++++++++------ .../pal/output/or/report2/Report2Gener.java | 24 +- .../pal/output/or/util/OrReportComment.java | 20 +- 3 files changed, 823 insertions(+), 431 deletions(-) diff --git a/com.actionsoft.apps.coe.pal.output.or/src/com/actionsoft/apps/coe/pal/output/or/report1/Report1Gener.java b/com.actionsoft.apps.coe.pal.output.or/src/com/actionsoft/apps/coe/pal/output/or/report1/Report1Gener.java index 727fe80d..d3bd7739 100644 --- a/com.actionsoft.apps.coe.pal.output.or/src/com/actionsoft/apps/coe/pal/output/or/report1/Report1Gener.java +++ b/com.actionsoft.apps.coe.pal.output.or/src/com/actionsoft/apps/coe/pal/output/or/report1/Report1Gener.java @@ -18,6 +18,8 @@ import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.model.Design import com.actionsoft.apps.coe.pal.pal.repository.designer.util.CoeDesignerUtil; import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryModel; import com.actionsoft.bpms.commons.database.RowMap; +import com.actionsoft.bpms.org.model.DepartmentModel; +import com.actionsoft.bpms.server.RequestParams; import com.actionsoft.bpms.server.UserContext; import com.actionsoft.bpms.util.DBSql; import com.alibaba.fastjson.JSONArray; @@ -31,7 +33,9 @@ import com.actionsoft.bpms.util.UtilString; import com.actionsoft.sdk.local.SDK; import com.actionsoft.sdk.local.api.internal.PlatformAPIImpl; import com.awspaas.user.apps.yili.reportform.util.RepositoryAttribute; +import com.awspaas.user.apps.yili.reportform.util.TaskUtil; import org.springframework.util.StringUtils; +import org.xlsx4j.sml.Row; import static com.actionsoft.apps.coe.pal.pal.repository.util.CoeProcessLevelUtil.getLastPublishTaskIdByModelId; import static java.util.stream.Collectors.collectingAndThen; @@ -249,13 +253,14 @@ public class Report1Gener { List nodeRowMaps = DBSql.getMaps( "SELECT NODEID,NODENAME,ITSYSVAL,NODETYPE,PLID,PLNAME,ACTIVITYNUMBER,ACTIVITYDESC,ROLE,ROLENAME,POST,POSTNAME FROM BO_EU_PAL_FILENODE6 WHERE POST LIKE '%" - + UserContext.fromUID(userId).getUserModel().getPositionName()+ "%' OR POST LIKE '%内蒙古伊利实业集团股份有限公司%'"); + + UserContext.fromUID(userId).getUserModel().getPositionName()+ "%'"); for (RowMap rowMap: nodeRowMaps) { Map queryRepositoryAttributeById = new RepositoryAttribute().queryRepositoryAttributeById(rowMap.getString("PLID")); PALRepositoryModel palRepositoryModel = PALRepositoryCache.getCache().get(rowMap.getString("PLID")); - if (palRepositoryModel.isPublish()) { + RowMap plid = DBSql.getMap("select * from app_act_coe_pal_repository where ID = '" + rowMap.getString("PLID") + "'"); + if (palRepositoryModel.isPublish()&&plid.getString("ISSTOP").equals("0")) { JSONObject _tr = new JSONObject(); _tr.put(OutputWordUtil.SERIAL_NUMBER, index); // 序号 _tr.put(OutputWordUtil.REPOSITORY_NAME, rowMap.getString("PLNAME")); // 流程名称 @@ -314,8 +319,6 @@ public class Report1Gener { } } - - if (_table.size() == 0) { JSONObject _tr = new JSONObject(); //_table = getEmptyTable("process.bpmn2"); @@ -324,6 +327,7 @@ public class Report1Gener { _tr.put(OutputWordUtil.REPOSITORY_NAME, ""); // 流程名称 _tr.put(OutputWordUtil.SERIAL_NUMBER, ""); _tr.put(OutputWordUtil.SHAPE_DESC, ""); // 工作详细描述 + _tr.put(OutputWordUtil.SHAPE_ITSYSTEM, ""); // 系统名称 _tr.put("shape_role", ""); // 工作详细描述 _tr.put(OutputWordUtil.SHAPE_KPI, ""); _tr.put(OutputWordUtil.SHAPE_INSTITUTION, ""); @@ -359,18 +363,23 @@ public class Report1Gener { } - /** - * 这个是获取岗位中的活动数 - * @param uc - * @return - */ - public JSONObject personalView_right(UserContext uc) { - System.out.println("uc>>>>>>>>"+uc.getUID()); - JSONObject ro = new JSONObject(new LinkedHashMap<>()); + public ResponseObject personalView(UserContext uc, RequestParams params) { + ResponseObject ro = ResponseObject.newOkResponse(); String positionKeys = null; String positionVals = null; + ArrayList positionIDs = new ArrayList<>(); Integer i = -1; - String uid = uc.getUID(); + while (true) { + i++; + positionKeys = "position" + "[" + i + "]"; + positionVals = params.get(positionKeys); + if (null != positionVals && !positionVals.equals("")) { + positionIDs.add(positionVals); + } else { + break; + } + } + String uid = params.get("uid"); String sid = uc.getSessionId(); // 定义用户/岗位流程list,用户/岗位流程map ArrayList UoPProcessMaps = new ArrayList<>(); @@ -406,433 +415,765 @@ public class Report1Gener { // 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,ITSYSVAL 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,ITSYSVAL 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("PLID", plId); - 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")); - nodeMap.put("ITSYSVAL", nodeRowMap.getString("ITSYSVAL")); - 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("PLID", plId); - 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")); - nodeMap.put("ITSYSVAL", nodeRowMap.getString("ITSYSVAL")); - 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", ""); + if (null != positionIDs && !positionIDs.isEmpty()) { UoPProcessMaps = new ArrayList(); - ro.put("nodes", UoPProcessMaps); + nodeMaps = new ArrayList(); linksMaps = new LinkedList(); - ro.put("links", linksMaps); + 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<>(); + for (String positionID : positionIDs) { + RowMap POSITIONMap = DBSql.getMap("SELECT POSITION_NAME FROM ORGUSER WHERE POSITION_NO= '"+positionID+"'"); + if (null != POSITIONMap && !POSITIONMap.isEmpty()) { + String positionName = POSITIONMap.getString("POSITION_NAME"); + // if (nodeRowMap.getString("ROLE").equals(positionID) || + // nodeRowMap.getString("POST").equals(positionID)) { + DepartmentModel departId = uc.getDepartmentModel(); + String subDepartments = getSubDepartments(new ArrayList<>(), departId); - } 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); - } + 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 + "%' "); + System.out.println("=========nodeRowMaps========>"+nodeRowMaps); + 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 = TaskUtil.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); } + } - 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 { + + 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 = TaskUtil.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 = TaskUtil.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 = TaskUtil.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 = TaskUtil.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 = TaskUtil.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 = TaskUtil.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 = TaskUtil.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); + 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); - // 岗位流程/我的流程 + // 岗位流程/我的流程 + } else { + int count = 0; + 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(); + String POSITION_NAME = UserContext.fromUID(uid).getUserModel().getPositionName(); + if (UtilString.isNotEmpty(POSITION_NAME)) { + DepartmentModel departId = uc.getDepartmentModel(); + String subDepartments = getSubDepartments(new ArrayList<>(), departId); + + + + + List nodeRowMaps = DBSql.getMaps( + "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"); + RowMap fileRowMap = DBSql.getMap( + "SELECT FILESTATE,FILEID,PLNAME,PLMETHODID,PLLEVEL,PLORDERINDEX,RELEVANTFILE,SUPPORTFILE,PROCESSKPI FROM BO_EU_PAL_FILE1 WHERE FILEID = '" + + PLID + "'"); + count++; + if (fileRowMap != null) { + if ("0".equals(fileRowMap.getString("FILESTATE"))) { + continue; + } + // if (nodeRowMap.getString("ROLE").equals(positionID) || + // nodeRowMap.getString("POST").equals(positionID)) { + nodeMap = new HashMap(); + model = PALRepositoryCache.getCache().get(nodeRowMap.getString("PLID")); + if (null != model) { + if (model.isPublish() || model.isStop()) {// 停用或已发布状态查询最新流程手册 + taskId = TaskUtil.getLastPublishTaskIdByModelId(model.getId()); + } + } + path = "./w" + "?" + "cmd=com.actionsoft.apps.coe.pal.publisher_publish_file_open" + "&" + + "uuid=" + nodeRowMap.getString("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(PLID); + if (null != model) { + if (model.isPublish() || model.isStop()) {// 停用或已发布状态查询最新流程手册 + taskId = TaskUtil.getLastPublishTaskIdByModelId(model.getId()); + } + } + path = "./w" + "?" + "cmd=com.actionsoft.apps.coe.pal.publisher_publish_file_open" + "&" + + "uuid=" + PLID + "&" + "sid=" + sid + "&" + "taskId=" + taskId; + UoPProcessMap.put("id", PLID); + 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); + + } + + } + + } else { + ro.info("当前用户未设置岗位"); + } + 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 = TaskUtil.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 = TaskUtil.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 = TaskUtil.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 = TaskUtil.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 = TaskUtil.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 = TaskUtil.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 = TaskUtil.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.putAll(nodeReturnMap); + nodeAMaps.add(nodeTempMap); + } else if (NODETYPE.equals("method_approval_node3") || NODETYPE.equals("method_service_node4")) { + nodeTempMap.putAll(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; } @@ -974,4 +1315,27 @@ public class Report1Gener { } /**********************关联AWS组织的excel处理***************************/ + + public String getSubDepartments( ArrayList arr, + DepartmentModel departmentById) { + String departName = ""; + if (!departmentById.isClosed()) { + List subDepartments = SDK.getORGAPI().getSubDepartments(departmentById.getId()); + for (DepartmentModel departmentModel : subDepartments) { + if (!departmentModel.isClosed()) { + String name = departmentModel.getName(); + String id = departmentModel.getId(); + departName+=name+","; + // 递归获取子部门下的子部门 + if (SDK.getORGAPI().isExistSubDepartment(id)) { + getSubDepartments( arr, SDK.getORGAPI().getDepartmentById(id)); + } + + } + + } + } + return departName; + } + } diff --git a/com.actionsoft.apps.coe.pal.output.or/src/com/actionsoft/apps/coe/pal/output/or/report2/Report2Gener.java b/com.actionsoft.apps.coe.pal.output.or/src/com/actionsoft/apps/coe/pal/output/or/report2/Report2Gener.java index ad841014..650492df 100644 --- a/com.actionsoft.apps.coe.pal.output.or/src/com/actionsoft/apps/coe/pal/output/or/report2/Report2Gener.java +++ b/com.actionsoft.apps.coe.pal.output.or/src/com/actionsoft/apps/coe/pal/output/or/report2/Report2Gener.java @@ -205,12 +205,13 @@ public class Report2Gener { List lists = new LinkedList<>(); List nodeRowMaps = DBSql.getMaps( "SELECT NODEID,NODENAME,ITSYSVAL,NODETYPE,PLID,PLNAME,ACTIVITYNUMBER,ACTIVITYDESC,ROLE,ROLENAME,POST,POSTNAME FROM BO_EU_PAL_FILENODE6 WHERE POST LIKE '%" - + UserContext.fromUID(userId).getUserModel().getPositionName()+ "%' OR POST LIKE '%内蒙古伊利实业集团股份有限公司%'"); + + UserContext.fromUID(userId).getUserModel().getPositionName()+ "%'"); for (RowMap rowMap: nodeRowMaps) { String plid = rowMap.getString("PLID"); PALRepositoryModel palRepositoryModel = PALRepositoryCache.getCache().get(plid); - if (!lists.contains(plid)&&!palRepositoryModel.isStop()){ + RowMap plid_s= DBSql.getMap("select * from app_act_coe_pal_repository where ID = '" + rowMap.getString("PLID") + "'"); + if (!lists.contains(plid)&&palRepositoryModel.isPublish()&&plid_s.getString("ISSTOP").equals("0")){ lists.add(plid); } } @@ -219,6 +220,22 @@ public class Report2Gener { orReportComment.getCommentContent(dataMap, shapesMap, shapeId,userId); //获取一些公共的数据(手册首页的手册岗位名称、部门、公司、时间、岗位职责等) System.out.println("size>>>>>>>>"+lists.size()); JSONArray positionTable = new JSONArray(); //列表数据 + if (lists.size()==0){ + + JSONArray repositoryTable = new JSONArray(); //相关流程 + JSONArray repositoryShapeTable = new JSONArray(); //流程步骤 + JSONArray institutionTable = new JSONArray(); //相关制度 + JSONArray formTable = new JSONArray(); //相关表单 + JSONArray itsystemTable = new JSONArray(); //相关IT系统 + JSONArray KPITable = new JSONArray(); //相关绩效考核 + + + + //这个代码是为了解决 岗位参与执行的流程存储 + JSONObject _tr = new JSONObject(new LinkedHashMap<>()); + _tr.put("nums", 1); + + } for (int q =0;q< lists.size();q++){ @@ -251,7 +268,7 @@ public class Report2Gener { List nodeRowMaps_shape = DBSql.getMaps( "SELECT * FROM (SELECT NODEID,NODENAME,ITSYSVAL,NODETYPE,PLID,PLNAME,ACTIVITYNUMBER,ACTIVITYDESC,ROLE,ROLENAME,POST,POSTNAME FROM BO_EU_PAL_FILENODE6 WHERE POST LIKE '%" - + UserContext.fromUID(userId).getUserModel().getPositionName() + "%' OR POST LIKE '%内蒙古伊利实业集团股份有限公司%') WHERE PLID = '" + lists.get(q) + "'"); + + UserContext.fromUID(userId).getUserModel().getPositionName() + "%') WHERE PLID = '" + lists.get(q) + "'"); int m = 1; for (RowMap rowMap : nodeRowMaps_shape) { @@ -576,7 +593,6 @@ public class Report2Gener { if (relationFileId.equals("")) { continue; } - List relationModelList = dao.getModelListByRelationShapeId(relationFileId, "00000000-0000-0000-0000-000000000000"); // 关联信息 if (relationModelList != null && relationModelList.size() > 0) { PALRepositoryModel relationModel = (PALRepositoryModel) CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(relationFileId); diff --git a/com.actionsoft.apps.coe.pal.output.or/src/com/actionsoft/apps/coe/pal/output/or/util/OrReportComment.java b/com.actionsoft.apps.coe.pal.output.or/src/com/actionsoft/apps/coe/pal/output/or/util/OrReportComment.java index 21c6c87c..541b3a4f 100644 --- a/com.actionsoft.apps.coe.pal.output.or/src/com/actionsoft/apps/coe/pal/output/or/util/OrReportComment.java +++ b/com.actionsoft.apps.coe.pal.output.or/src/com/actionsoft/apps/coe/pal/output/or/util/OrReportComment.java @@ -11,7 +11,9 @@ import java.util.Set; import com.actionsoft.apps.coe.pal.pal.output.util.OutputWordUtil; import com.actionsoft.apps.coe.pal.pal.repository.PALRepositoryQueryAPIManager; +import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryCache; import com.actionsoft.apps.coe.pal.pal.repository.designer.util.ShapeUtil; +import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryModel; import com.actionsoft.bpms.commons.database.RowMap; import com.actionsoft.bpms.server.UserContext; import com.actionsoft.bpms.util.DBSql; @@ -63,19 +65,29 @@ public class OrReportComment { String positionName = userContext.getUserModel().getPositionName(); 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 '%内蒙古伊利实业集团股份有限公司%'"); + + positionName+ "%' "); List nodeRowMap_process = 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 '%内蒙古伊利实业集团股份有限公司%'"); + + positionName+ "%'"); List list = new ArrayList<>(); for (RowMap rowMap: nodeRowMap_process) { String plid = rowMap.getString("PLID"); - if (!list.contains(plid)){ + PALRepositoryModel palRepositoryModel = PALRepositoryCache.getCache().get(rowMap.getString("PLID")); + if (!list.contains(plid)&&palRepositoryModel.isPublish()&&!palRepositoryModel.isStop()){ list.add(plid); } } - dataMap.put("activity_nums", nodeRowMaps.size());// 参数的活动数 + List list1 = new ArrayList<>(); + for (RowMap rowMap: + nodeRowMaps) { + String plid = rowMap.getString("PLID"); + PALRepositoryModel palRepositoryModel = PALRepositoryCache.getCache().get(rowMap.getString("PLID")); + if (palRepositoryModel.isPublish()){ + list1.add(rowMap); + } + } + dataMap.put("activity_nums", list1.size());// 参数的活动数 dataMap.put("process_nums", list.size());// 参与的流程数 dataMap.put(OutputWordUtil.COMPANY, "公司"); //所属公司 //创建日期