diff --git a/com.awspaas.user.apps.yili.reportform/lib/com.awspaas.user.apps.yili.reportform.jar b/com.awspaas.user.apps.yili.reportform/lib/com.awspaas.user.apps.yili.reportform.jar index 6d5694df..50d7a5bb 100644 Binary files a/com.awspaas.user.apps.yili.reportform/lib/com.awspaas.user.apps.yili.reportform.jar and b/com.awspaas.user.apps.yili.reportform/lib/com.awspaas.user.apps.yili.reportform.jar differ 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 c2d91bce..aa962ad7 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 @@ -1,19 +1,5 @@ package com.awspaas.user.apps.yili.reportform.service; -import static com.awspaas.user.apps.yili.reportform.util.TaskUtil.getLastPublishTaskIdByModelId; -import static java.util.stream.Collectors.collectingAndThen; -import static java.util.stream.Collectors.toCollection; - -import java.util.ArrayList; -import java.util.Comparator; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.TreeSet; -import java.util.stream.Collectors; - 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.manage.CoeDesignerAPIManager; @@ -27,49 +13,59 @@ import com.actionsoft.bpms.commons.database.RowMap; import com.actionsoft.bpms.commons.mvc.view.ActionWeb; import com.actionsoft.bpms.commons.mvc.view.ResponseObject; import com.actionsoft.bpms.org.model.DepartmentModel; -import com.actionsoft.bpms.org.model.UserModel; import com.actionsoft.bpms.server.RequestParams; import com.actionsoft.bpms.server.UserContext; import com.actionsoft.bpms.util.DBSql; import com.actionsoft.bpms.util.UUIDGener; import com.actionsoft.bpms.util.UtilString; import com.actionsoft.sdk.local.SDK; +import com.actionsoft.sdk.local.api.BOQueryAPI; import com.alibaba.fastjson.JSONObject; import com.awspaas.user.apps.yili.reportform.util.GetNodesUtil; +import com.awspaas.user.apps.yili.reportform.util.TaskUtil; import com.awspaas.user.apps.yili.reportform.util.TreeUtil; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.TreeSet; +import java.util.function.Function; +import java.util.stream.Collectors; import net.sf.json.JSONArray; import org.springframework.util.StringUtils; -/** - * @author:Lizj - * @create: 2022-07-11 14:04 - * @Description: 个人/部门视图 - */ -@SuppressWarnings("all") -public class DataViewService extends ActionWeb { +import static java.util.stream.Collectors.collectingAndThen; +import static java.util.stream.Collectors.toCollection; + +public class DataViewService + extends ActionWeb +{ UserContext _uc; public DataViewService(UserContext uc) { super(uc); - _uc = uc; + this._uc = uc; } - /** - * @methodName: - * @param: - * @return: - * @description:个人视图筛选条件 - * @auther: Lizj - * @date: 2022/7/11 14:11 - */ + + + + + + + + public String queryTermsPerson(UserContext uc, RequestParams params) { ResponseObject ro = ResponseObject.newOkResponse(); - // 基本信息 - // 当前登录信息 + + ArrayList currentLoginMaps = new ArrayList<>(); LinkedHashMap currentLoginMap = new LinkedHashMap<>(); - /*currentLoginMap = new LinkedHashMap<>(); + currentLoginMap = new LinkedHashMap<>(); currentLoginMap.put("title", "账号"); currentLoginMap.put("text", uc.getUserModel().getUID()); currentLoginMaps.add(currentLoginMap); @@ -80,9 +76,9 @@ public class DataViewService extends ActionWeb { currentLoginMap = new LinkedHashMap<>(); currentLoginMap.put("title", "部门"); currentLoginMap.put("text", uc.getDepartmentModel().getName()); - currentLoginMaps.add(currentLoginMap);*/ + currentLoginMaps.add(currentLoginMap); currentLoginMap = new LinkedHashMap<>(); - currentLoginMap.put("title", "我的岗位"); + currentLoginMap.put("title", "岗位"); currentLoginMap.put("text", uc.getUserModel().getPositionName()); currentLoginMaps.add(currentLoginMap); ro.put("personInfos", currentLoginMaps); @@ -91,41 +87,44 @@ public class DataViewService extends ActionWeb { public String queryTermsPosition(UserContext uc, RequestParams params) { ResponseObject ro = ResponseObject.newOkResponse(); - // 岗位查询 - Object[] sqlParams = new Object[]{}; + + Object[] sqlParams = new Object[0]; String departmentById = uc.getDepartmentModel().getId(); - sqlParams = new Object[]{departmentById}; - List positionRowMapsOrg = DBSql.getMaps( - "SELECT ID, POSITION_NO, POSITION_NAME, DEPARTMENTID, ORDERINDEX FROM ORGUSER WHERE POSITION_NO IS NOT NULL AND DEPARTMENTID=?", - sqlParams); + sqlParams = new Object[] { departmentById }; + List positionRowMapsOrg = DBSql.getMaps("SELECT ID, POSITION_NO, POSITION_NAME, DEPARTMENTID, ORDERINDEX FROM ORGUSER WHERE POSITION_NO IS NOT NULL AND DEPARTMENTID=?", sqlParams); + + + List positionRowMaps = positionRowMapsOrg.stream() .collect(collectingAndThen( toCollection(() -> new TreeSet<>(Comparator.comparing(o -> o.getString("POSITION_NO")))), ArrayList::new)); - List deptMaps = DBSql.getMaps( - "SELECT ID,PARENTDEPARTMENTID,DEPARTMENTNAME,LAYER,ORDERINDEX FROM ORGDEPARTMENT" + " WHERE ID=?", - sqlParams); - // demo3 - // 3e74f14d-852f-4f6f-a809-08a56697f103 - // 本地 - // d7087d5b-ab29-4514-a7e7-79379f6842a2 - // 正式 - // 8911e732-b42a-4556-853f-ad32761bcbee + + + List deptMaps = DBSql.getMaps("SELECT ID,PARENTDEPARTMENTID,DEPARTMENTNAME,LAYER,ORDERINDEX FROM ORGDEPARTMENT WHERE ID=?", sqlParams); + + + + + + + + String nodeType = null; ArrayList deptNodes = new ArrayList<>(); if (null != deptMaps && !deptMaps.isEmpty()) { for (RowMap deptMap : deptMaps) { if (null != positionRowMaps && !positionRowMaps.isEmpty()) { for (RowMap positionRowMap : positionRowMaps) { - // String userID = positionRowMap.getString("ID"); + String ID = positionRowMap.getString("POSITION_NO"); String PARENTID = positionRowMap.getString("DEPARTMENTID"); String name = positionRowMap.getString("POSITION_NAME"); String ORDERINDEX = positionRowMap.getString("ORDERINDEX"); - String TLEVEL = String.valueOf(Integer.valueOf(deptMap.getString("LAYER")) + 1); + String TLEVEL = String.valueOf(Integer.valueOf(deptMap.getString("LAYER")).intValue() + 1); HashMap deptNode = new HashMap<>(); nodeType = "position"; - // deptNode.put("userID",userID); + deptNode.put("ID", ID); deptNode.put("PARENTID", PARENTID); deptNode.put("name", name); @@ -178,40 +177,40 @@ public class DataViewService extends ActionWeb { return ro.toString(); } - /** - * @methodName: - * @param: - * @return: - * @description:个人视图 - * @auther: Lizj - * @date: 2022/7/11 14:14 - */ + + + + + + + + public String personalView(UserContext uc, RequestParams params) { ResponseObject ro = ResponseObject.newOkResponse(); String positionKeys = null; String positionVals = null; ArrayList positionIDs = new ArrayList<>(); - Integer i = -1; + Integer i = Integer.valueOf(-1); while (true) { - i++; - positionKeys = "position" + "[" + i + "]"; + Integer integer1 = i, integer2 = i = Integer.valueOf(i.intValue() + 1); + positionKeys = "position[" + i + "]"; positionVals = params.get(positionKeys); if (null != positionVals && !positionVals.equals("")) { positionIDs.add(positionVals); - } else { - break; + continue; } + break; } String uid = params.get("uid"); - String sid = _uc.getSessionId(); - // 定义用户/岗位流程list,用户/岗位流程map + String sid = this._uc.getSessionId(); + 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<>(); + Map nodeTempMap = new HashMap<>(); ArrayList reRegulationMaps = new ArrayList<>(); ArrayList reFormMaps = new ArrayList<>(); ArrayList reIO_L4Maps = new ArrayList<>(); @@ -223,26 +222,26 @@ public class DataViewService extends ActionWeb { 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 + Integer totalNum = Integer.valueOf(0); + Integer aNum = Integer.valueOf(0); + Integer bNum = Integer.valueOf(0); + Object[] sqlParams = new Object[0]; + + + + + + + + + + if (null != positionIDs && !positionIDs.isEmpty()) { - UoPProcessMaps = new ArrayList(); - nodeMaps = new ArrayList(); - linksMaps = new LinkedList(); - UoPProcessMap = new HashMap(); + 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", "岗位流程"); @@ -251,88 +250,90 @@ public class DataViewService extends ActionWeb { 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 + "'"); + RowMap POSITIONMap = DBSql.getMap("SELECT POSITION_NAME FROM ORGUSER WHERE POSITION_NO= '" + positionID + "'", new Object[0]); 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); - 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 + "%' "); + 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 + "%' ", new Object[0]); + + 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 = 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); + RowMap fileRowMap = DBSql.getMap("SELECT FILESTATE,FILEID,PLNAME,PLMETHODID,PLLEVEL,PLORDERINDEX,RELEVANTFILE,SUPPORTFILE,PROCESSKPI FROM BO_EU_PAL_FILE1 WHERE FILEID = '" + plId + "'", new Object[0]); - 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 (fileRowMap == null || + "0".equals(fileRowMap.getString("FILESTATE"))) { + continue; } + nodeMap = new HashMap<>(); + taskId = TaskUtil.getLastPublishTaskIdByModelId(plId); + + + + 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"; + + + + + + + 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 + "秒"); + System.err.println("个人视图(岗位流程)查询用时=========>" + ((end - start) / 1000L) + "秒"); + UoPProcessMaps = UoPProcessMaps.stream() .collect(collectingAndThen( toCollection(() -> new TreeSet<>(Comparator.comparing(o -> String.valueOf(o.get("id"))))), ArrayList::new)); - tempMaps = new ArrayList(); + + tempMaps = new ArrayList<>(); if (nodeMaps.size() == 0) { ro.put("rootId", ""); - UoPProcessMaps = new ArrayList(); + UoPProcessMaps = new ArrayList<>(); ro.put("nodes", UoPProcessMaps); - linksMaps = new LinkedList(); + linksMaps = new LinkedList<>(); ro.put("links", linksMaps); ro.info("您所在的组织,暂无配置可发起的流程"); - } else { + for (Map uoPProcessMap : UoPProcessMaps) { reRegulationMaps = new ArrayList<>(); reFormMaps = new ArrayList<>(); @@ -347,27 +348,27 @@ public class DataViewService extends ActionWeb { 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); + 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(); + if (refileRowMap.getString("PLMETHODID").equals("control.policy") && (refileRowMap + .getString("POLICYTYPE").equals("regulation") || null == refileRowMap + .getString("POLICYTYPE") || refileRowMap + .getString("POLICYTYPE").equals(""))) { + + UoPProcessMap = new HashMap<>(); fileType = "reRegulationFile"; - model = PALRepositoryCache.getCache().get(reFileID); - if (null != model) { - if (model.isPublish() || model.isStop()) {// 停用或已发布状态查询最新流程手册 - taskId = getLastPublishTaskIdByModelId(model.getId()); - } + model = (PALRepositoryModel)PALRepositoryCache.getCache().get(reFileID); + if (null != model && ( + 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; + + 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); @@ -375,36 +376,36 @@ public class DataViewService extends ActionWeb { UoPProcessMap.put("PARENTID", FILEID + "reRegulation"); reRegulationMaps.add(UoPProcessMap); } else if (refileRowMap.getString("PLMETHODID").equals("data.form")) { - UoPProcessMap = new HashMap(); + UoPProcessMap = new HashMap<>(); fileType = "reFormFile"; - model = PALRepositoryCache.getCache().get(reFileID); - if (model != null) { - if (model.isPublish() || model.isStop()) {// 停用或已发布状态查询最新流程手册 - taskId = getLastPublishTaskIdByModelId(model.getId()); - } + model = (PALRepositoryModel)PALRepositoryCache.getCache().get(reFileID); + if (model != null && ( + 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; + + 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(); + } 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()); - } + model = (PALRepositoryModel)PALRepositoryCache.getCache().get(reFileID); + if (null != model && ( + 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; + + 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); @@ -418,27 +419,27 @@ public class DataViewService extends ActionWeb { 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); + 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(); + if (refileRowMap.getString("PLMETHODID").equals("control.policy") && (refileRowMap + .getString("POLICYTYPE").equals("regulation") || null == refileRowMap + .getString("POLICYTYPE") || refileRowMap + .getString("POLICYTYPE").equals(""))) { + + UoPProcessMap = new HashMap<>(); fileType = "reRegulationFile"; - model = PALRepositoryCache.getCache().get(reFileID); - if (null != model) { - if (model.isPublish() || model.isStop()) {// 停用或已发布状态查询最新流程手册 - taskId = getLastPublishTaskIdByModelId(model.getId()); - } + model = (PALRepositoryModel)PALRepositoryCache.getCache().get(reFileID); + if (null != model && ( + 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; + + 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); @@ -446,36 +447,36 @@ public class DataViewService extends ActionWeb { UoPProcessMap.put("PARENTID", FILEID + "reRegulation"); reRegulationMaps.add(UoPProcessMap); } else if (refileRowMap.getString("PLMETHODID").equals("data.form")) { - UoPProcessMap = new HashMap(); + UoPProcessMap = new HashMap<>(); fileType = "reFormFile"; - model = PALRepositoryCache.getCache().get(reFileID); - if (null != model) { - if (model.isPublish() || model.isStop()) {// 停用或已发布状态查询最新流程手册 - taskId = getLastPublishTaskIdByModelId(model.getId()); - } + model = (PALRepositoryModel)PALRepositoryCache.getCache().get(reFileID); + if (null != model && ( + 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; + + 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(); + } 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()); - } + model = (PALRepositoryModel)PALRepositoryCache.getCache().get(reFileID); + if (null != model && ( + 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; + + 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); @@ -489,22 +490,22 @@ public class DataViewService extends ActionWeb { 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); + 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(); + UoPProcessMap = new HashMap<>(); fileType = "processKPIFile"; - model = PALRepositoryCache.getCache().get(PROCESSKPIID); - if (null != model) { - if (model.isPublish() || model.isStop()) {// 停用或已发布状态查询最新流程手册 - taskId = getLastPublishTaskIdByModelId(model.getId()); - } + model = (PALRepositoryModel)PALRepositoryCache.getCache().get(PROCESSKPIID); + if (null != model && ( + 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; + + 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); @@ -515,7 +516,7 @@ public class DataViewService extends ActionWeb { } } if (null != reRegulationMaps && !reRegulationMaps.isEmpty()) { - UoPProcessMap = new HashMap(); + UoPProcessMap = new HashMap<>(); UoPProcessMap.put("id", FILEID + "reRegulation"); UoPProcessMap.put("text", "相关制度"); UoPProcessMap.put("fileType", "reRegulation"); @@ -523,7 +524,7 @@ public class DataViewService extends ActionWeb { reRegulationMaps.add(UoPProcessMap); } if (null != reFormMaps && !reFormMaps.isEmpty()) { - UoPProcessMap = new HashMap(); + UoPProcessMap = new HashMap<>(); UoPProcessMap.put("id", FILEID + "reForm"); UoPProcessMap.put("text", "相关表单"); UoPProcessMap.put("fileType", "reForm"); @@ -531,7 +532,7 @@ public class DataViewService extends ActionWeb { reFormMaps.add(UoPProcessMap); } if (null != reIO_L4Maps && !reIO_L4Maps.isEmpty()) { - UoPProcessMap = new HashMap(); + UoPProcessMap = new HashMap<>(); UoPProcessMap.put("id", FILEID + "reI/O_L4"); UoPProcessMap.put("text", "相关操作指导"); UoPProcessMap.put("fileType", "reI/O_L4"); @@ -539,13 +540,13 @@ public class DataViewService extends ActionWeb { reIO_L4Maps.add(UoPProcessMap); } if (null != reYSMaps && !reYSMaps.isEmpty()) { - UoPProcessMap = new HashMap(); + 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 = new HashMap<>(); UoPProcessMap.put("id", FILEID + "reProcessKPI"); UoPProcessMap.put("text", "绩效"); UoPProcessMap.put("fileType", "reProcessKPI"); @@ -572,7 +573,7 @@ public class DataViewService extends ActionWeb { String PARENTID = String.valueOf(pProcessMap.get("PARENTID")); if (id.equals(PARENTID)) { String childID = String.valueOf(pProcessMap.get("id")); - linksMap = new LinkedHashMap(); + linksMap = new LinkedHashMap<>(); linksMap.put("from", id); linksMap.put("to", childID); linksMaps.add(linksMap); @@ -582,46 +583,46 @@ public class DataViewService extends ActionWeb { ro.put("links", linksMaps); } else { ro.put("rootId", ""); - UoPProcessMaps = new ArrayList(); + UoPProcessMaps = new ArrayList<>(); ro.put("nodes", UoPProcessMaps); - linksMaps = new LinkedList(); + 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(); + 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")) { + nodeAMaps.add(nodeTempMap); continue; + } 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(); + totalNum = Integer.valueOf(nodeMaps.size()); + aNum = Integer.valueOf(nodeAMaps.size()); + bNum = Integer.valueOf(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 { - // 岗位流程/我的流程 - } else { int count = 0; - UoPProcessMaps = new ArrayList(); - nodeMaps = new ArrayList(); - linksMaps = new LinkedList(); - UoPProcessMap = new HashMap(); + 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", "我的流程"); @@ -634,81 +635,83 @@ public class DataViewService extends ActionWeb { 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 + "%' AND POST NOT LIKE '%" + uc.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 '%" + POSITION_NAME + "%' AND POST NOT LIKE '%" + uc + + .getDepartmentModel().getName() + "%' ", new Object[0]); 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 + "'"); + RowMap fileRowMap = DBSql.getMap("SELECT FILESTATE,FILEID,PLNAME,PLMETHODID,PLLEVEL,PLORDERINDEX,RELEVANTFILE,SUPPORTFILE,PROCESSKPI FROM BO_EU_PAL_FILE1 WHERE FILEID = '" + PLID + "'", new Object[0]); + + 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 = 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 = 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); - + if (fileRowMap == null || + "0".equals(fileRowMap.getString("FILESTATE"))) { + continue; } + + nodeMap = new HashMap<>(); + model = (PALRepositoryModel)PALRepositoryCache.getCache().get(nodeRowMap.getString("PLID")); + if (null != model && ( + 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 = (PALRepositoryModel)PALRepositoryCache.getCache().get(PLID); + if (null != model && ( + 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 { + } + else { + ro.info("当前用户未设置岗位"); } long end = System.currentTimeMillis(); - System.err.println("个人视图(我的流程)查询用时=========>" + (end - start) / 1000 + "秒"); + System.err.println("个人视图(我的流程)查询用时=========>" + ((end - start) / 1000L) + "秒"); + UoPProcessMaps = UoPProcessMaps.stream() .collect(collectingAndThen( toCollection(() -> new TreeSet<>(Comparator.comparing(o -> String.valueOf(o.get("id"))))), ArrayList::new)); - tempMaps = new ArrayList(); + + tempMaps = new ArrayList<>(); if (nodeMaps.size() == 0) { ro.put("rootId", ""); - UoPProcessMaps = new ArrayList(); + UoPProcessMaps = new ArrayList<>(); ro.put("nodes", UoPProcessMaps); - linksMaps = new LinkedList(); + linksMaps = new LinkedList<>(); ro.put("links", linksMaps); ro.info("您的岗位暂无需执行的流程"); } else { @@ -726,27 +729,27 @@ public class DataViewService extends ActionWeb { 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); + 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(); + if (refileRowMap.getString("PLMETHODID").equals("control.policy") && (refileRowMap + .getString("POLICYTYPE").equals("regulation") || null == refileRowMap + .getString("POLICYTYPE") || refileRowMap + .getString("POLICYTYPE").equals(""))) { + + UoPProcessMap = new HashMap<>(); fileType = "reRegulationFile"; - model = PALRepositoryCache.getCache().get(reFileID); - if (null != model) { - if (model.isPublish() || model.isStop()) {// 停用或已发布状态查询最新流程手册 - taskId = getLastPublishTaskIdByModelId(model.getId()); - } + model = (PALRepositoryModel)PALRepositoryCache.getCache().get(reFileID); + if (null != model && ( + 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; + + 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); @@ -754,36 +757,36 @@ public class DataViewService extends ActionWeb { UoPProcessMap.put("PARENTID", FILEID + "reRegulation"); reRegulationMaps.add(UoPProcessMap); } else if (refileRowMap.getString("PLMETHODID").equals("data.form")) { - UoPProcessMap = new HashMap(); + UoPProcessMap = new HashMap<>(); fileType = "reFormFile"; - model = PALRepositoryCache.getCache().get(reFileID); - if (null != model) { - if (model.isPublish() || model.isStop()) {// 停用或已发布状态查询最新流程手册 - taskId = getLastPublishTaskIdByModelId(model.getId()); - } + model = (PALRepositoryModel)PALRepositoryCache.getCache().get(reFileID); + if (null != model && ( + 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; + + 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(); + } 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()); - } + model = (PALRepositoryModel)PALRepositoryCache.getCache().get(reFileID); + if (null != model && ( + 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; + + 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); @@ -797,27 +800,27 @@ public class DataViewService extends ActionWeb { 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); + 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(); + if (refileRowMap.getString("PLMETHODID").equals("control.policy") && (refileRowMap + .getString("POLICYTYPE").equals("regulation") || null == refileRowMap + .getString("POLICYTYPE") || refileRowMap + .getString("POLICYTYPE").equals(""))) { + + UoPProcessMap = new HashMap<>(); fileType = "reRegulationFile"; - model = PALRepositoryCache.getCache().get(reFileID); - if (null != model) { - if (model.isPublish() || model.isStop()) {// 停用或已发布状态查询最新流程手册 - taskId = getLastPublishTaskIdByModelId(model.getId()); - } + model = (PALRepositoryModel)PALRepositoryCache.getCache().get(reFileID); + if (null != model && ( + 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; + + 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); @@ -825,36 +828,36 @@ public class DataViewService extends ActionWeb { UoPProcessMap.put("PARENTID", FILEID + "reRegulation"); reRegulationMaps.add(UoPProcessMap); } else if (refileRowMap.getString("PLMETHODID").equals("data.form")) { - UoPProcessMap = new HashMap(); + UoPProcessMap = new HashMap<>(); fileType = "reFormFile"; - model = PALRepositoryCache.getCache().get(reFileID); - if (null != model) { - if (model.isPublish() || model.isStop()) {// 停用或已发布状态查询最新流程手册 - taskId = getLastPublishTaskIdByModelId(model.getId()); - } + model = (PALRepositoryModel)PALRepositoryCache.getCache().get(reFileID); + if (null != model && ( + 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; + + 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(); + } 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()); - } + model = (PALRepositoryModel)PALRepositoryCache.getCache().get(reFileID); + if (null != model && ( + 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; + + 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); @@ -868,22 +871,22 @@ public class DataViewService extends ActionWeb { 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); + 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(); + UoPProcessMap = new HashMap<>(); fileType = "processKPIFile"; - model = PALRepositoryCache.getCache().get(PROCESSKPIID); - if (null != model) { - if (model.isPublish() || model.isStop()) {// 停用或已发布状态查询最新流程手册 - taskId = getLastPublishTaskIdByModelId(model.getId()); - } + model = (PALRepositoryModel)PALRepositoryCache.getCache().get(PROCESSKPIID); + if (null != model && ( + 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; + + 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); @@ -894,7 +897,7 @@ public class DataViewService extends ActionWeb { } } if (null != reRegulationMaps && !reRegulationMaps.isEmpty()) { - UoPProcessMap = new HashMap(); + UoPProcessMap = new HashMap<>(); UoPProcessMap.put("id", FILEID + "reRegulation"); UoPProcessMap.put("text", "相关制度"); UoPProcessMap.put("fileType", "reRegulation"); @@ -902,7 +905,7 @@ public class DataViewService extends ActionWeb { reRegulationMaps.add(UoPProcessMap); } if (null != reFormMaps && !reFormMaps.isEmpty()) { - UoPProcessMap = new HashMap(); + UoPProcessMap = new HashMap<>(); UoPProcessMap.put("id", FILEID + "reForm"); UoPProcessMap.put("text", "相关表单"); UoPProcessMap.put("fileType", "reForm"); @@ -910,7 +913,7 @@ public class DataViewService extends ActionWeb { reFormMaps.add(UoPProcessMap); } if (null != reIO_L4Maps && !reIO_L4Maps.isEmpty()) { - UoPProcessMap = new HashMap(); + UoPProcessMap = new HashMap<>(); UoPProcessMap.put("id", FILEID + "reI/O_L4"); UoPProcessMap.put("text", "相关操作指导"); UoPProcessMap.put("fileType", "reI/O_L4"); @@ -918,13 +921,13 @@ public class DataViewService extends ActionWeb { reIO_L4Maps.add(UoPProcessMap); } if (null != reYSMaps && !reYSMaps.isEmpty()) { - UoPProcessMap = new HashMap(); + 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 = new HashMap<>(); UoPProcessMap.put("id", FILEID + "reProcessKPI"); UoPProcessMap.put("text", "绩效"); UoPProcessMap.put("fileType", "reProcessKPI"); @@ -937,7 +940,7 @@ public class DataViewService extends ActionWeb { tempMaps.addAll(reYSMaps); } } - // 所有数据 + UoPProcessMaps.addAll(tempMaps); if (UoPProcessMaps.size() > 1) { for (Map uoPProcessMap : UoPProcessMaps) { @@ -952,7 +955,7 @@ public class DataViewService extends ActionWeb { String PARENTID = String.valueOf(pProcessMap.get("PARENTID")); if (id.equals(PARENTID)) { String childID = String.valueOf(pProcessMap.get("id")); - linksMap = new LinkedHashMap(); + linksMap = new LinkedHashMap<>(); linksMap.put("from", id); linksMap.put("to", childID); linksMaps.add(linksMap); @@ -962,9 +965,9 @@ public class DataViewService extends ActionWeb { ro.put("links", linksMaps); } else { ro.put("rootId", ""); - UoPProcessMaps = new ArrayList(); + UoPProcessMaps = new ArrayList<>(); ro.put("nodes", UoPProcessMaps); - linksMaps = new LinkedList(); + linksMaps = new LinkedList<>(); ro.put("links", linksMaps); ro.info("您的岗位暂无需执行的流程"); } @@ -972,56 +975,56 @@ public class DataViewService extends ActionWeb { nodeAMaps = new ArrayList<>(); nodeBMaps = new ArrayList<>(); if (null != nodeMaps && !nodeMaps.isEmpty()) { - for (Map nodeReturnMap : nodeMaps) { - nodeTempMap = new HashMap(); + 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")) { + nodeAMaps.add(nodeTempMap); continue; + } 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(); + totalNum = Integer.valueOf(nodeMaps.size()); + aNum = Integer.valueOf(nodeAMaps.size()); + bNum = Integer.valueOf(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: - * @return: - * @description:个人视图_本岗位有权限的流程 - * @auther: wangcy - * @date: 2023/6/36 14:12 - */ + + + + + + + + public String personalView_right(UserContext uc) { System.out.println("uc>>>>>>>>" + uc.getUID()); ResponseObject ro = ResponseObject.newOkResponse(); String positionKeys = null; String positionVals = null; - Integer i = -1; - String uid = _uc.getUID(); - String sid = _uc.getSessionId(); - // 定义用户/岗位流程list,用户/岗位流程map + Integer i = Integer.valueOf(-1); + String uid = this._uc.getUID(); + String sid = this._uc.getSessionId(); + 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<>(); + Map nodeTempMap = new HashMap<>(); ArrayList reRegulationMaps = new ArrayList<>(); ArrayList reFormMaps = new ArrayList<>(); ArrayList reIO_L4Maps = new ArrayList<>(); @@ -1033,25 +1036,25 @@ public class DataViewService extends ActionWeb { 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 + Integer totalNum = Integer.valueOf(0); + Integer aNum = Integer.valueOf(0); + Integer bNum = Integer.valueOf(0); + Object[] sqlParams = new Object[0]; - UoPProcessMaps = new ArrayList(); - nodeMaps = new ArrayList(); - linksMaps = new LinkedList(); - UoPProcessMap = new HashMap(); + + + + + + + + + + + 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", "岗位流程"); @@ -1059,8 +1062,8 @@ public class DataViewService extends ActionWeb { 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(); DepartmentModel departId = uc.getDepartmentModel(); @@ -1069,23 +1072,23 @@ public class DataViewService extends ActionWeb { if (UtilString.isNotEmpty(subDepartments)) { subDepartments.substring(0, subDepartments.length() - 1); String[] split = subDepartments.split(","); - for (String name : - split) { - depaertName += "'" + name + "'"; + + for (String name : split) { + depaertName = depaertName + "'" + name + "'"; } } else { depaertName = "'" + departId.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 '%内蒙古伊利实业集团股份有限公司%' OR POST IS NOT NULL OR ROLE LIKE '%内蒙古伊利实业集团股份有限公司%' OR ROLE IS NOT NULL"); - List DepartnodeRowMaps = DBSql.getMaps( - "SELECT NODEID,NODENAME,NODETYPE,PLID,PLNAME,ACTIVITYNUMBER,ACTIVITYDESC,ROLE,ROLENAME,POST,POSTNAME FROM BO_EU_PAL_FILENODE6 WHERE " + - " POST LIKE '%内蒙古伊利实业集团股份有限公司%' OR POST IS NOT NULL OR ROLE LIKE '%内蒙古伊利实业集团股份有限公司%' OR ROLE IS NOT NULL"); + List nodeRowMaps = DBSql.getMaps("SELECT NODEID,NODENAME,NODETYPE,PLID,PLNAME,ACTIVITYNUMBER,ACTIVITYDESC,ROLE,ROLENAME,POST,POSTNAME FROM BO_EU_PAL_FILENODE6 WHERE POST LIKE '%内蒙古伊利实业集团股份有限公司%' OR POST IS NOT NULL OR ROLE LIKE '%内蒙古伊利实业集团股份有限公司%' OR ROLE IS NOT NULL", new Object[0]); + + + List DepartnodeRowMaps = DBSql.getMaps("SELECT NODEID,NODENAME,NODETYPE,PLID,PLNAME,ACTIVITYNUMBER,ACTIVITYDESC,ROLE,ROLENAME,POST,POSTNAME FROM BO_EU_PAL_FILENODE6 WHERE POST LIKE '%内蒙古伊利实业集团股份有限公司%' OR POST IS NOT NULL OR ROLE LIKE '%内蒙古伊利实业集团股份有限公司%' OR ROLE IS NOT NULL", new Object[0]); + + List new_nodeRowMaps = new LinkedList<>(); List new_DepartnodeRowMaps = new LinkedList<>(); - for (RowMap rowMap : - nodeRowMaps) { + + for (RowMap rowMap : nodeRowMaps) { String post = rowMap.getString("POST"); String role = rowMap.getString("ROLE"); boolean role_flag = false; @@ -1093,8 +1096,8 @@ public class DataViewService extends ActionWeb { if (!StringUtils.isEmpty(role)) { if (role.contains(",")) { String[] split = role.split(","); - for (String rolw : - split) { + + for (String rolw : split) { if (depaertName.contains(rolw)) { new_nodeRowMaps.add(rowMap); role_flag = true; @@ -1104,39 +1107,39 @@ public class DataViewService extends ActionWeb { if (role_flag) { continue; } - } else { - if (depaertName.contains(role)) { - new_nodeRowMaps.add(rowMap); - continue; - } + } + else if (depaertName.contains(role)) { + new_nodeRowMaps.add(rowMap); + + continue; } } if (!StringUtils.isEmpty(post)) { if (post.contains(",")) { String[] split = post.split(","); - for (String rolw : - split) { + + for (String rolw : split) { if (depaertName.contains(rolw)) { new_nodeRowMaps.add(rowMap); post_flag = true; break; } } - if (post_flag) { - continue; - } - } else { - if (depaertName.contains(post)) { - new_nodeRowMaps.add(rowMap); - continue; - } + if (post_flag); + + continue; + } + if (depaertName.contains(post)) { + new_nodeRowMaps.add(rowMap); } } } + + System.out.println("new_nodeRowMaps>>>>>>>>>>>>>>>>>" + new_nodeRowMaps.size()); - for (RowMap rowMap : - DepartnodeRowMaps) { + + for (RowMap rowMap : DepartnodeRowMaps) { String post = rowMap.getString("POST"); String role = rowMap.getString("ROLE"); boolean role_flag = false; @@ -1144,8 +1147,8 @@ public class DataViewService extends ActionWeb { if (!StringUtils.isEmpty(role)) { if (role.contains(",")) { String[] split = role.split(","); - for (String rolw : - split) { + + for (String rolw : split) { if (depaertName.contains(rolw)) { new_DepartnodeRowMaps.add(rowMap); role_flag = true; @@ -1155,165 +1158,170 @@ public class DataViewService extends ActionWeb { if (role_flag) { continue; } - } else { - if (depaertName.contains(role)) { - new_DepartnodeRowMaps.add(rowMap); - continue; - } + } + else if (depaertName.contains(role)) { + new_DepartnodeRowMaps.add(rowMap); + + continue; } } if (!StringUtils.isEmpty(post)) { if (post.contains(",")) { String[] split = post.split(","); - for (String rolw : - split) { + + for (String rolw : split) { if (depaertName.contains(rolw)) { new_DepartnodeRowMaps.add(rowMap); post_flag = true; break; } } - if (post_flag) { - continue; - } - } else { - if (depaertName.contains(post)) { - new_DepartnodeRowMaps.add(rowMap); - continue; - } + if (post_flag); + + continue; + } + if (depaertName.contains(post)) { + new_DepartnodeRowMaps.add(rowMap); } } } + + nodeRowMaps = new LinkedList<>(); - for (RowMap rowMap : - new_nodeRowMaps) { + + for (RowMap rowMap : new_nodeRowMaps) { nodeRowMaps.add(rowMap); } DepartnodeRowMaps = new LinkedList<>(); - for (RowMap rowMap : - new_DepartnodeRowMaps) { + + for (RowMap rowMap : new_DepartnodeRowMaps) { DepartnodeRowMaps.add(rowMap); } + 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); + RowMap fileRowMap = DBSql.getMap("SELECT FILESTATE,FILEID,PLNAME,PLMETHODID,PLLEVEL,PLORDERINDEX,RELEVANTFILE,SUPPORTFILE,PROCESSKPI FROM BO_EU_PAL_FILE1 WHERE FILEID = '" + plId + "'", new Object[0]); - 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 (fileRowMap == null || + "0".equals(fileRowMap.getString("FILESTATE"))) { + continue; } + nodeMap = new HashMap<>(); + taskId = TaskUtil.getLastPublishTaskIdByModelId(plId); + + + + 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"; + + + + + + + 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); + RowMap fileRowMap = DBSql.getMap("SELECT FILESTATE,FILEID,PLNAME,PLMETHODID,PLLEVEL,PLORDERINDEX,RELEVANTFILE,SUPPORTFILE,PROCESSKPI FROM BO_EU_PAL_FILE1 WHERE FILEID = '" + plId + "'", new Object[0]); - 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 (fileRowMap == null || + "0".equals(fileRowMap.getString("FILESTATE"))) { + continue; } + nodeMap = new HashMap<>(); + taskId = TaskUtil.getLastPublishTaskIdByModelId(plId); + + + + 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"; + + + + + + + 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 + "秒"); + System.err.println("个人视图(有权限的流程)查询用时=========>" + ((end - start) / 1000L) + "秒"); + + UoPProcessMaps = UoPProcessMaps.stream() .collect(collectingAndThen( toCollection(() -> new TreeSet<>(Comparator.comparing(o -> String.valueOf(o.get("id"))))), ArrayList::new)); - tempMaps = new ArrayList(); + + tempMaps = new ArrayList<>(); if (nodeMaps.size() == 0) { ro.put("rootId", ""); - UoPProcessMaps = new ArrayList(); + UoPProcessMaps = new ArrayList<>(); ro.put("nodes", UoPProcessMaps); - linksMaps = new LinkedList(); + linksMaps = new LinkedList<>(); ro.put("links", linksMaps); ro.info("您所在的组织,暂无配置可发起的流程"); - } else { + for (Map uoPProcessMap : UoPProcessMaps) { reRegulationMaps = new ArrayList<>(); reFormMaps = new ArrayList<>(); @@ -1328,27 +1336,27 @@ public class DataViewService extends ActionWeb { 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); + 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(); + if (refileRowMap.getString("PLMETHODID").equals("control.policy") && (refileRowMap + .getString("POLICYTYPE").equals("regulation") || null == refileRowMap + .getString("POLICYTYPE") || refileRowMap + .getString("POLICYTYPE").equals(""))) { + + UoPProcessMap = new HashMap<>(); fileType = "reRegulationFile"; - model = PALRepositoryCache.getCache().get(reFileID); - if (null != model) { - if (model.isPublish() || model.isStop()) {// 停用或已发布状态查询最新流程手册 - taskId = getLastPublishTaskIdByModelId(model.getId()); - } + model = (PALRepositoryModel)PALRepositoryCache.getCache().get(reFileID); + if (null != model && ( + 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; + + 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); @@ -1356,36 +1364,36 @@ public class DataViewService extends ActionWeb { UoPProcessMap.put("PARENTID", FILEID + "reRegulation"); reRegulationMaps.add(UoPProcessMap); } else if (refileRowMap.getString("PLMETHODID").equals("data.form")) { - UoPProcessMap = new HashMap(); + UoPProcessMap = new HashMap<>(); fileType = "reFormFile"; - model = PALRepositoryCache.getCache().get(reFileID); - if (model != null) { - if (model.isPublish() || model.isStop()) {// 停用或已发布状态查询最新流程手册 - taskId = getLastPublishTaskIdByModelId(model.getId()); - } + model = (PALRepositoryModel)PALRepositoryCache.getCache().get(reFileID); + if (model != null && ( + 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; + + 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(); + } 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()); - } + model = (PALRepositoryModel)PALRepositoryCache.getCache().get(reFileID); + if (null != model && ( + 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; + + 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); @@ -1399,27 +1407,27 @@ public class DataViewService extends ActionWeb { 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); + 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(); + if (refileRowMap.getString("PLMETHODID").equals("control.policy") && (refileRowMap + .getString("POLICYTYPE").equals("regulation") || null == refileRowMap + .getString("POLICYTYPE") || refileRowMap + .getString("POLICYTYPE").equals(""))) { + + UoPProcessMap = new HashMap<>(); fileType = "reRegulationFile"; - model = PALRepositoryCache.getCache().get(reFileID); - if (null != model) { - if (model.isPublish() || model.isStop()) {// 停用或已发布状态查询最新流程手册 - taskId = getLastPublishTaskIdByModelId(model.getId()); - } + model = (PALRepositoryModel)PALRepositoryCache.getCache().get(reFileID); + if (null != model && ( + 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; + + 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); @@ -1427,36 +1435,36 @@ public class DataViewService extends ActionWeb { UoPProcessMap.put("PARENTID", FILEID + "reRegulation"); reRegulationMaps.add(UoPProcessMap); } else if (refileRowMap.getString("PLMETHODID").equals("data.form")) { - UoPProcessMap = new HashMap(); + UoPProcessMap = new HashMap<>(); fileType = "reFormFile"; - model = PALRepositoryCache.getCache().get(reFileID); - if (null != model) { - if (model.isPublish() || model.isStop()) {// 停用或已发布状态查询最新流程手册 - taskId = getLastPublishTaskIdByModelId(model.getId()); - } + model = (PALRepositoryModel)PALRepositoryCache.getCache().get(reFileID); + if (null != model && ( + 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; + + 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(); + } 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()); - } + model = (PALRepositoryModel)PALRepositoryCache.getCache().get(reFileID); + if (null != model && ( + 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; + + 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); @@ -1470,22 +1478,22 @@ public class DataViewService extends ActionWeb { 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); + 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(); + UoPProcessMap = new HashMap<>(); fileType = "processKPIFile"; - model = PALRepositoryCache.getCache().get(PROCESSKPIID); - if (null != model) { - if (model.isPublish() || model.isStop()) {// 停用或已发布状态查询最新流程手册 - taskId = getLastPublishTaskIdByModelId(model.getId()); - } + model = (PALRepositoryModel)PALRepositoryCache.getCache().get(PROCESSKPIID); + if (null != model && ( + 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; + + 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); @@ -1496,7 +1504,7 @@ public class DataViewService extends ActionWeb { } } if (null != reRegulationMaps && !reRegulationMaps.isEmpty()) { - UoPProcessMap = new HashMap(); + UoPProcessMap = new HashMap<>(); UoPProcessMap.put("id", FILEID + "reRegulation"); UoPProcessMap.put("text", "相关制度"); UoPProcessMap.put("fileType", "reRegulation"); @@ -1504,7 +1512,7 @@ public class DataViewService extends ActionWeb { reRegulationMaps.add(UoPProcessMap); } if (null != reFormMaps && !reFormMaps.isEmpty()) { - UoPProcessMap = new HashMap(); + UoPProcessMap = new HashMap<>(); UoPProcessMap.put("id", FILEID + "reForm"); UoPProcessMap.put("text", "相关表单"); UoPProcessMap.put("fileType", "reForm"); @@ -1512,7 +1520,7 @@ public class DataViewService extends ActionWeb { reFormMaps.add(UoPProcessMap); } if (null != reIO_L4Maps && !reIO_L4Maps.isEmpty()) { - UoPProcessMap = new HashMap(); + UoPProcessMap = new HashMap<>(); UoPProcessMap.put("id", FILEID + "reI/O_L4"); UoPProcessMap.put("text", "相关操作指导"); UoPProcessMap.put("fileType", "reI/O_L4"); @@ -1520,13 +1528,13 @@ public class DataViewService extends ActionWeb { reIO_L4Maps.add(UoPProcessMap); } if (null != reYSMaps && !reYSMaps.isEmpty()) { - UoPProcessMap = new HashMap(); + 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 = new HashMap<>(); UoPProcessMap.put("id", FILEID + "reProcessKPI"); UoPProcessMap.put("text", "绩效"); UoPProcessMap.put("fileType", "reProcessKPI"); @@ -1553,7 +1561,7 @@ public class DataViewService extends ActionWeb { String PARENTID = String.valueOf(pProcessMap.get("PARENTID")); if (id.equals(PARENTID)) { String childID = String.valueOf(pProcessMap.get("id")); - linksMap = new LinkedHashMap(); + linksMap = new LinkedHashMap<>(); linksMap.put("from", id); linksMap.put("to", childID); linksMaps.add(linksMap); @@ -1563,32 +1571,32 @@ public class DataViewService extends ActionWeb { ro.put("links", linksMaps); } else { ro.put("rootId", ""); - UoPProcessMaps = new ArrayList(); + UoPProcessMaps = new ArrayList<>(); ro.put("nodes", UoPProcessMaps); - linksMaps = new LinkedList(); + 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(); + 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")) { + nodeAMaps.add(nodeTempMap); continue; + } 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(); + totalNum = Integer.valueOf(nodeMaps.size()); + aNum = Integer.valueOf(nodeAMaps.size()); + bNum = Integer.valueOf(nodeBMaps.size()); ro.put("totalNodeNum", totalNum); ro.put("totalNode", nodeMaps); ro.put("typeANum", aNum); @@ -1596,22 +1604,22 @@ public class DataViewService extends ActionWeb { ro.put("typeBNum", bNum); ro.put("typeB", nodeBMaps); - // 岗位流程/我的流程 + return ro.toString(); } - /** - * @methodName: - * @param: - * @return: - * @description:部门视图筛选条件:部门 - * @auther: Lizj - * @date: 2022/7/11 14:14 - */ + + + + + + + + public String queryTermsDept(UserContext uc, RequestParams params) { ResponseObject ro = ResponseObject.newOkResponse(); - // 当前登录信息 + ArrayList currentLoginMaps = new ArrayList<>(); LinkedHashMap currentLoginMap = new LinkedHashMap<>(); currentLoginMap = new LinkedHashMap<>(); @@ -1628,16 +1636,16 @@ public class DataViewService extends ActionWeb { currentLoginMaps.add(currentLoginMap); ro.put("personInfos", currentLoginMaps); - // 部门查询 - List deptMaps = DBSql - .getMaps("SELECT ID,PARENTDEPARTMENTID,DEPARTMENTNAME,LAYER,ORDERINDEX FROM ORGDEPARTMENT" - + " WHERE COMPANYID='8911e732-b42a-4556-853f-ad32761bcbee' AND CLOSED='0' AND DEPARTMENTNAME NOT IN ('澳优','系统管理','项目开发人员部门','奶酪事业部','离退人员部门','集团领导')"); - // demo3 - // 3e74f14d-852f-4f6f-a809-08a56697f103 - // 本地 - // d7087d5b-ab29-4514-a7e7-79379f6842a2 - // 正式 - // 8911e732-b42a-4556-853f-ad32761bcbee + + + List deptMaps = DBSql.getMaps("SELECT ID,PARENTDEPARTMENTID,DEPARTMENTNAME,LAYER,ORDERINDEX FROM ORGDEPARTMENT WHERE COMPANYID='8911e732-b42a-4556-853f-ad32761bcbee' AND CLOSED='0' AND DEPARTMENTNAME NOT IN ('澳优','系统管理','项目开发人员部门','奶酪事业部','离退人员部门','集团领导')", new Object[0]); + + + + + + + String nodeType = null; ArrayList deptNodes = new ArrayList<>(); for (RowMap deptMap : deptMaps) { @@ -1653,52 +1661,54 @@ public class DataViewService extends ActionWeb { } List deptTreeNodes = TreeUtil.buildTree("0", deptNodes, "0", "dept", "3", null); ro.put("deptTree", deptTreeNodes); - // 文件类型查询 + HashMap fileType = new HashMap<>(); ArrayList fileTypes = new ArrayList<>(); - fileType = new HashMap(); + fileType = new HashMap<>(); fileType.put("termsKey", "totalFile"); fileType.put("termsVal", "全部"); fileTypes.add(fileType); - fileType = new HashMap(); + fileType = new HashMap<>(); fileType.put("termsKey", "processFile"); fileType.put("termsVal", "流程"); fileTypes.add(fileType); - fileType = new HashMap(); + fileType = new HashMap<>(); fileType.put("termsKey", "policyFile"); fileType.put("termsVal", "制度"); fileTypes.add(fileType); - fileType = new HashMap(); + fileType = new HashMap<>(); fileType.put("termsKey", "guideFile"); fileType.put("termsVal", "操作指导"); fileTypes.add(fileType); - fileType = new HashMap(); + fileType = new HashMap<>(); fileType.put("termsKey", "formFile"); fileType.put("termsVal", "表单/模板"); fileTypes.add(fileType); + fileType = new HashMap(); fileType.put("termsKey", "engineeringtandardFile"); fileType.put("termsVal", "工程技术标准"); fileTypes.add(fileType); + ro.put("fileTypes", fileTypes); return ro.toString(); } - /** - * @methodName: - * @param: - * @return: - * @description:部门视图 - * @auther: Lizj - * @date: 2022/7/11 14:14 - */ + + + + + + + + public String deptView(UserContext uc, RequestParams params) { ResponseObject ro = ResponseObject.newOkResponse(); try { List fileRowMaps = null; - String sid = _uc.getSessionId(); + String sid = this._uc.getSessionId(); String deptString = params.get("dept"); JSONArray json = new JSONArray(); if (UtilString.isNotEmpty(deptString)) { @@ -1712,22 +1722,22 @@ public class DataViewService extends ActionWeb { Map reFileMap = new HashMap<>(); RowMap reFileRowMap = new RowMap(reFileMap); long startTime = System.currentTimeMillis(); - List fileListMap = DBSql.getMaps(sql); + List fileListMap = DBSql.getMaps(sql, new Object[0]); String dempId = ""; String sqlParm = ""; if (null == deptString || "".equals(deptString)) { - String ucDeptID = _uc.getUserModel().getDepartmentId(); - String pathIdOfCache = _uc.getDepartmentModel().getPathIdOfCache(); + String ucDeptID = this._uc.getUserModel().getDepartmentId(); + String pathIdOfCache = this._uc.getDepartmentModel().getPathIdOfCache(); + - // 正式环境 伊利集团总部id 5c8e2d14-25a8-4baf-aa3a-344064007ef3 if (pathIdOfCache.contains("5c8e2d14-25a8-4baf-aa3a-344064007ef3")) { - ucDeptID = GetNodesUtil.getParentDept(ucDeptID, 2); - } else if (_uc.getDepartmentModel().getPathNameOfCache().contains("事业部")) { + ucDeptID = GetNodesUtil.getParentDept(ucDeptID, Integer.valueOf(2)); + } else if (this._uc.getDepartmentModel().getPathNameOfCache().contains("事业部")) { ucDeptID = pathIdOfCache.split("/")[0]; } System.out.println("部门ID>>>>>>>>>>>>+" + ucDeptID); - deptIDList = new ArrayList(); + deptIDList = new ArrayList<>(); deptIDList = GetNodesUtil.getChildDept(ucDeptID, deptIDList); if (deptIDList != null) { deptIDList2 = deptIDList; @@ -1741,105 +1751,106 @@ public class DataViewService extends ActionWeb { for (int i = 0; i < arr.length; i++) { if (arr.length == 1) { sbu.append("'").append(arr[i].trim()).append("'"); - } else { - if (i == arr.length - 1) { - sbu.append("'").append(arr[i].trim()).append("'"); - } else { - sbu.append("'").append(arr[i].trim()).append("'").append(","); - - } } - + else if (i == arr.length - 1) { + sbu.append("'").append(arr[i].trim()).append("'"); + } else { + sbu.append("'").append(arr[i].trim()).append("'").append(","); + } } + + + sqlParm = sbu.toString(); } else { sqlParm = "'" + deptString.replace("[", "").replace("]", "") + "'"; } + } - - } else { - if (UtilString.isNotEmpty(deptString) && json.size() < 450) { - if (deptString.contains("[")) { - StringBuffer sbu = new StringBuffer(); - net.sf.json.JSONArray jsonArry = net.sf.json.JSONArray.fromObject(deptString); - for (int i = 0; i < jsonArry.size(); i++) { - if (jsonArry.size() == 1) { - sbu.append("'").append(jsonArry.getString(i).trim()).append("'"); - } else { - if (i == jsonArry.size() - 1) { - sbu.append("'").append(jsonArry.getString(i).trim()).append("'"); - } else { - sbu.append("'").append(jsonArry.getString(i).trim()).append("'").append(","); - - } - } - - } - sqlParm = sbu.toString().trim(); - } else { - sqlParm = "'" + deptString.replace("[", "").replace("]", "") + "'"; - } - } - } + else if (UtilString.isNotEmpty(deptString) && json.size() < 450) { + if (deptString.contains("[")) { + StringBuffer sbu = new StringBuffer(); + JSONArray jsonArry = JSONArray.fromObject(deptString); + for (int i = 0; i < jsonArry.size(); i++) { + if (jsonArry.size() == 1) { + sbu.append("'").append(jsonArry.getString(i).trim()).append("'"); + } + else if (i == jsonArry.size() - 1) { + sbu.append("'").append(jsonArry.getString(i).trim()).append("'"); + } else { + sbu.append("'").append(jsonArry.getString(i).trim()).append("'").append(","); + } + } + + + + sqlParm = sbu.toString().trim(); + } else { + sqlParm = "'" + deptString.replace("[", "").replace("]", "") + "'"; + } + } + + try { String sqltt = "SELECT ID AS FILEID,PLNAME,PLPARENTID,PLMETHODID,PLLEVEL,PLVERSIONID,PLORDERINDEX,EXT3 as POLICYTYPE,EXT6 FROM APP_ACT_COE_PAL_REPOSITORY WHERE ISPUBLISH = 1 AND ISSTOP =0 AND EXT5 = '1' AND EXT6 IS NOT NULL AND PLMETHODID in ('process.epc','control.policy','process.flowchart','engineering.standard')"; SDK.getLogAPI().consoleInfo("sql>>>>>>>>>>>>>>" + sqltt); - List maps = DBSql.getMaps(sqltt); + List maps = DBSql.getMaps(sqltt, new Object[0]); + SDK.getLogAPI().consoleInfo("maps是多少个>>>>>>>>>>>>" + maps.size()); List last_maps = new LinkedList<>(); - for (RowMap map : - maps) { + + for (RowMap map : maps) { String ext6 = map.getString("EXT6"); if (ext6.contains(",")) { String[] split = ext6.split(","); - for (String departId : - split) { + + for (String departId : split) { if (deptString.contains(departId)) { - last_maps.add(map); - break; + last_maps.add(map); break; } } - } else { - if (deptString.contains(ext6)) { - last_maps.add(map); - continue; - } + continue; + } + if (deptString.contains(ext6)) { + last_maps.add(map); } } + + for (RowMap rowMap : last_maps) { String id = rowMap.getString("FILEID"); - PALRepositoryModel model = PALRepositoryCache.getCache().get(id); + PALRepositoryModel model = (PALRepositoryModel)PALRepositoryCache.getCache().get(id); if (model != null) { try { - Integer PLLEVEL = model.getLevel(); + Integer PLLEVEL = Integer.valueOf(model.getLevel()); String methodId = model.getMethodId(); - // 默认添加所在部门的所有文件 + fileHandleRowMaps.add(rowMap); if ("process.epc".equals(methodId) || "process.flowchart".equals(methodId)) { - // 支持文件 + getArrt("support_files", model, dempId, PLLEVEL, reFileRowMap, fileHandleRowMaps); - // 相关文件 - getArrt("R_relevant_flies", model, dempId, PLLEVEL, reFileRowMap, fileHandleRowMaps); - } else if ("control.policy".equals(methodId) || "engineering.standard".equals(methodId) ) { - // 支持文件 + + getArrt("R_relevant_flies", model, dempId, PLLEVEL, reFileRowMap, fileHandleRowMaps); continue; + } if ("control.policy".equals(methodId)) + { getArrt("support_files", model, dempId, PLLEVEL, reFileRowMap, fileHandleRowMaps); - // 相关文件 + getArrt("related_files", model, dempId, PLLEVEL, reFileRowMap, fileHandleRowMaps); } } catch (Exception e) { System.err.println("==有问题的模型===>" + model.getName()); - // TODO: handle exception } } } - } catch (Exception e) { - // TODO: handle exception + } + catch (Exception e) { + e.printStackTrace(); } @@ -1850,44 +1861,43 @@ public class DataViewService extends ActionWeb { fileHandleRowMaps = new ArrayList<>(); if (null != fileRowMaps && !fileRowMaps.isEmpty()) { for (RowMap fileRowMap : fileRowMaps) { - if (fileType.equals("processFile")) { - if (fileRowMap.getString("PLMETHODID").equals("process.epc") - || fileRowMap.getString("PLMETHODID").equals("process.flowchart")) { - fileHandleRowMaps.add(fileRowMap); - } + if (fileType.equals("processFile") && ( + fileRowMap.getString("PLMETHODID").equals("process.epc") || fileRowMap + .getString("PLMETHODID").equals("process.flowchart"))) { + fileHandleRowMaps.add(fileRowMap); } - if (fileType.equals("policyFile")) { - if (fileRowMap.getString("PLMETHODID").equals("control.policy")) { - fileHandleRowMaps.add(fileRowMap); - } + + if (fileType.equals("policyFile") && + fileRowMap.getString("PLMETHODID").equals("control.policy")) { + fileHandleRowMaps.add(fileRowMap); } - // && fileRowMap.getString("POLICYTYPE").equals("regulation") - if (fileType.equals("guideFile")) { - if (fileRowMap.getString("PLMETHODID").equals("control.policy")) { - fileHandleRowMaps.add(fileRowMap); - } + + + if (fileType.equals("guideFile") && + fileRowMap.getString("PLMETHODID").equals("control.policy")) { + fileHandleRowMaps.add(fileRowMap); } - if (fileType.equals("formFile")) { - if (fileRowMap.getString("PLMETHODID").equals("data.form")) { - fileHandleRowMaps.add(fileRowMap); - String PLPARENTID = fileRowMap.getString("PLPARENTID"); - PALRepositoryModel reFileModel = PALRepositoryCache.getCache().get(PLPARENTID); - if (null != reFileModel) { - String PLMETHODID = reFileModel.getMethodId(); - String PUBDEPT = fileRowMap.getString("PUBDEPT"); - Integer PLLEVEL = fileRowMap.getInt("PLLEVEL"); - if (!PLMETHODID.equals("process.framework")) { - reFileMap = new HashMap<>(); - reFileMap.put("FILEID", reFileModel.getId()); - reFileMap.put("PLNAME", reFileModel.getName()); - reFileMap.put("PLPARENTID", reFileModel.getParentId()); - reFileMap.put("PLMETHODID", PLMETHODID); - reFileMap.put("PUBDEPT", dempId); - reFileMap.put("PLLEVEL", (PLLEVEL - 1)); - reFileMap.put("PLORDERINDEX", reFileModel.getOrderIndex()); - reFileRowMap = new RowMap(reFileMap); - fileHandleRowMaps.add(reFileRowMap); - } + + if (fileType.equals("formFile") && + fileRowMap.getString("PLMETHODID").equals("data.form")) { + fileHandleRowMaps.add(fileRowMap); + String PLPARENTID = fileRowMap.getString("PLPARENTID"); + PALRepositoryModel reFileModel = (PALRepositoryModel)PALRepositoryCache.getCache().get(PLPARENTID); + if (null != reFileModel) { + String PLMETHODID = reFileModel.getMethodId(); + String PUBDEPT = fileRowMap.getString("PUBDEPT"); + Integer PLLEVEL = Integer.valueOf(fileRowMap.getInt("PLLEVEL")); + if (!PLMETHODID.equals("process.framework")) { + reFileMap = new HashMap<>(); + reFileMap.put("FILEID", reFileModel.getId()); + reFileMap.put("PLNAME", reFileModel.getName()); + reFileMap.put("PLPARENTID", reFileModel.getParentId()); + reFileMap.put("PLMETHODID", PLMETHODID); + reFileMap.put("PUBDEPT", dempId); + reFileMap.put("PLLEVEL", Integer.valueOf(PLLEVEL.intValue() - 1)); + reFileMap.put("PLORDERINDEX", Integer.valueOf(reFileModel.getOrderIndex())); + reFileRowMap = new RowMap(reFileMap); + fileHandleRowMaps.add(reFileRowMap); } } } @@ -1902,26 +1912,28 @@ public class DataViewService extends ActionWeb { if (fileType.equals("totalFile")) { fileHandleRowMaps.add(fileRowMap); } - } } - } else { - // System.err.println("====执行2====" + fileHandleRowMaps); - // getind(dempId, fileType, fileRowMaps, fileHandleRowMaps, reFileMap, - // reFileRowMap); } + + + + + fileRowMaps = fileHandleRowMaps; - // 遍历选择的结果 + System.err.println("=======fileRowMaps=========" + fileRowMaps); + List fileMaps = new ArrayList<>(); List frameRowMaps = new ArrayList<>(); HashMap fileMap = new HashMap<>(); HashMap frameMap = new HashMap<>(); String nodeType = null; LinkedHashMap filesCount = new LinkedHashMap<>(); - Integer processFileNum = 0; - Integer policyFileNum = 0; - Integer guideFileNum = 0; - Integer formFileNum = 0; + Integer processFileNum = Integer.valueOf(0); + Integer policyFileNum = Integer.valueOf(0); + Integer guideFileNum = Integer.valueOf(0); + Integer formFileNum = Integer.valueOf(0); + Integer engineeringtandardFileNum=0; String path = ""; @@ -1931,29 +1943,32 @@ public class DataViewService extends ActionWeb { List frameIDs = new ArrayList<>(); for (RowMap fileRowMap : fileRowMaps) { String PLPARENTID = fileRowMap.getString("PLPARENTID"); - PALRepositoryModel reFileModel = PALRepositoryCache.getCache().get(PLPARENTID); + PALRepositoryModel reFileModel = (PALRepositoryModel)PALRepositoryCache.getCache().get(PLPARENTID); if (null != reFileModel) { String PLMETHODID = reFileModel.getMethodId(); if (PLMETHODID.equals("process.framework")) { - frameIDs.add(PLPARENTID); - } else { - String rePPLPARENTID = reFileModel.getParentId(); - frameIDs.add(rePPLPARENTID); + frameIDs.add(PLPARENTID); continue; } + String rePPLPARENTID = reFileModel.getParentId(); + frameIDs.add(rePPLPARENTID); } } - frameIDs = frameIDs.stream().distinct().collect(Collectors.toList()); + + frameIDs = (List)frameIDs.stream().distinct().collect(Collectors.toList()); for (String frameID : frameIDs) { frameRowMaps = GetNodesUtil.getParentFrame(frameID, frameRowMaps); } + + frameRowMaps = frameRowMaps.stream() .collect(collectingAndThen( toCollection( () -> new TreeSet<>(Comparator.comparing(o -> o.getString("FRAMEID")))), ArrayList::new)); + for (RowMap frameRowMap : frameRowMaps) { - frameMap = new HashMap(); + frameMap = new HashMap<>(); nodeType = "frame"; frameMap.put("ID", frameRowMap.getString("FRAMEID")); frameMap.put("PARENTID", frameRowMap.getString("FRAMEPARENTID")); @@ -1964,41 +1979,41 @@ public class DataViewService extends ActionWeb { fileMaps.add(frameMap); } + for (RowMap fileRowMap : fileRowMaps) { - fileMap = new HashMap(); - if (fileRowMap.getString("PLMETHODID").equals("process.epc") - || fileRowMap.getString("PLMETHODID").equals("process.flowchart")) { + fileMap = new HashMap<>(); + if (fileRowMap.getString("PLMETHODID").equals("process.epc") || fileRowMap + .getString("PLMETHODID").equals("process.flowchart")) { fileMap.put("fileType", "processFile"); - processFileNum += 1; - } else if (fileRowMap.getString("PLMETHODID").equals("control.policy") - && (fileRowMap.getString("POLICYTYPE").equals("regulation") - || null == fileRowMap.getString("POLICYTYPE") - || fileRowMap.getString("POLICYTYPE").equals(""))) { - // && fileRowMap.getString("POLICYTYPE").equals("regulation") + processFileNum = Integer.valueOf(processFileNum.intValue() + 1); + } else if (fileRowMap.getString("PLMETHODID").equals("control.policy") && (fileRowMap + .getString("POLICYTYPE").equals("regulation") || null == fileRowMap + .getString("POLICYTYPE") || fileRowMap + .getString("POLICYTYPE").equals(""))) { + fileMap.put("fileType", "policyFile"); - policyFileNum += 1; - } else if (fileRowMap.getString("PLMETHODID").equals("control.policy") - && fileRowMap.getString("POLICYTYPE").equals("I/O_L4")) { + policyFileNum = Integer.valueOf(policyFileNum.intValue() + 1); + } else if (fileRowMap.getString("PLMETHODID").equals("control.policy") && fileRowMap + .getString("POLICYTYPE").equals("I/O_L4")) { fileMap.put("fileType", "guideFile"); - guideFileNum += 1; + guideFileNum = Integer.valueOf(guideFileNum.intValue() + 1); } else if (fileRowMap.getString("PLMETHODID").equals("data.form")) { fileMap.put("fileType", "formFile"); - formFileNum += 1; - } else if(fileRowMap.getString("PLMETHODID").equals("engineering.standard")){ + formFileNum = Integer.valueOf(formFileNum.intValue() + 1); + }else if(fileRowMap.getString("PLMETHODID").equals("engineering.standard")){ fileMap.put("fileType", "engineeringtandardFile"); engineeringtandardFileNum += 1; } - - model = PALRepositoryCache.getCache().get(fileRowMap.getString("FILEID")); + model = (PALRepositoryModel)PALRepositoryCache.getCache().get(fileRowMap.getString("FILEID")); if (null != model) { - taskId = getLastPublishTaskIdByModelId(model.getId()); + taskId = TaskUtil.getLastPublishTaskIdByModelId(model.getId()); } - /*if (null!=model){ - taskId = createFile(model.getId(),_uc); - }*/ - path = "./w" + "?" + "cmd=com.actionsoft.apps.coe.pal.publisher_publish_file_open" + "&" - + "uuid=" + fileRowMap.getString("FILEID") + "&" + "sid=" + sid + "&" + "taskId=" - + taskId; + + + + + path = "./w?cmd=com.actionsoft.apps.coe.pal.publisher_publish_file_open&uuid=" + fileRowMap.getString("FILEID") + "&" + "sid=" + sid + "&" + "taskId=" + taskId; + nodeType = "file"; fileMap.put("ID", fileRowMap.getString("FILEID")); fileMap.put("PARENTID", fileRowMap.getString("PLPARENTID")); @@ -2007,181 +2022,184 @@ public class DataViewService extends ActionWeb { fileMap.put("PUBDATETIME", fileRowMap.getString("PUBDATETIME")); fileMap.put("path", path); fileMap.put("ORDERINDEX", fileRowMap.getString("PLORDERINDEX")); - /*String sqlsss = "SELECT PLLEVEL FROM APP_ACT_COE_PAL_REPOSITORY_1124 WHERE ID = '" - + fileRowMap.getString("FILEID") + "'"; - String leve = DBSql.getString(sqlsss); - fileMap.put("TLEVEL", leve);*/ + + + + fileMap.put("nodeType", nodeType); fileMaps.add(fileMap); } if (json.size() > 450) { - Integer fileTotal = 0; - Integer processFile = 0; - Integer policyFile = 0; - Integer guideFile = 0; - Integer formFile = 0; + Integer fileTotal = Integer.valueOf(0); + Integer processFile = Integer.valueOf(0); + Integer policyFile = Integer.valueOf(0); + Integer guideFile = Integer.valueOf(0); + Integer formFile = Integer.valueOf(0); Integer engineeringtandardFile = 0; HashMap fileSortMap = new HashMap<>(); - // List fileRowMaps = DBSql.getMaps( "SELECT - // FILEID,PLMETHODID,POLICYTYPE FROM BO_EU_PAL_FILE1 WHERE FILESTATE='1'"); - List fileRowMapss = DBSql.getMaps( - "SELECT ID AS FILEID,EXT6 AS PUBDEPT,PLMETHODID,EXT5 AS FILESTATE,EXT3 AS POLICYTYPE FROM APP_ACT_COE_PAL_REPOSITORY WHERE ISPUBLISH = '1' AND EXT5 = '1' AND PLMETHODID in ('process.epc','process.flowchart','control.policy','data.form','engineering.standard')"); - // List fileRowMaps = DBSql.getMaps( "SELECT - // FILEID,PLMETHODID,POLICYTYPE FROM BO_EU_PAL_FILE1 WHERE FILESTATE='1'"); + + + List fileRowMapss = DBSql.getMaps("SELECT ID AS FILEID,EXT6 AS PUBDEPT,PLMETHODID,EXT5 AS FILESTATE,EXT3 AS POLICYTYPE FROM APP_ACT_COE_PAL_REPOSITORY WHERE ISPUBLISH = '1' AND EXT5 = '1' AND PLMETHODID in ('process.epc','process.flowchart','control.policy','data.form','engineering.standard')", new Object[0]); + + + if (null != fileRowMapss && !fileRowMapss.isEmpty()) { for (RowMap fileRowMap : fileRowMapss) { - if (fileRowMap.getString("PLMETHODID").equals("process.epc") - || fileRowMap.getString("PLMETHODID").equals("process.flowchart")) { - fileTotal += 1; - processFile += 1; - } else if (fileRowMap.getString("PLMETHODID").equals("control.policy")) { + if (fileRowMap.getString("PLMETHODID").equals("process.epc") || fileRowMap + .getString("PLMETHODID").equals("process.flowchart")) { + fileTotal = Integer.valueOf(fileTotal.intValue() + 1); + processFile = Integer.valueOf(processFile.intValue() + 1); continue; + } + if (fileRowMap.getString("PLMETHODID").equals("control.policy")) { if ("I/O_L4".equals(fileRowMap.getString("POLICYTYPE"))) { - guideFile += 1; + guideFile = Integer.valueOf(guideFile.intValue() + 1); } else { - policyFile += 1; - + policyFile = Integer.valueOf(policyFile.intValue() + 1); } - fileTotal += 1; - } else if (fileRowMap.getString("PLMETHODID").equals("data.form")) { - fileTotal += 1; - formFile += 1; - } else if(fileRowMap.getString("PLMETHODID").equals("engineering.standard")){ + + fileTotal = Integer.valueOf(fileTotal.intValue() + 1); continue; + } + if (fileRowMap.getString("PLMETHODID").equals("data.form")) { + fileTotal = Integer.valueOf(fileTotal.intValue() + 1); + formFile = Integer.valueOf(formFile.intValue() + 1); + } + + if(fileRowMap.getString("PLMETHODID").equals("engineering.standard")){ fileTotal += 1; engineeringtandardFile += 1; } } } - // System.err.println("=====fileMaps=====>" + fileMaps); + filesCount = new LinkedHashMap<>(); filesCount.put("processFileNum", processFile); filesCount.put("policyFileNum", policyFile); filesCount.put("guideFileNum", guideFile); filesCount.put("formFileNum", formFile); - filesCount.put("engineeringtandardFileNum", engineeringtandardFile); - + filesCount.put("engineeringtandardFileNum", engineeringtandardFileNum); ro.put("filesCount", filesCount); + } + else { - } else { - // System.err.println("=====fileMaps=====>" + fileMaps); filesCount = new LinkedHashMap<>(); filesCount.put("processFileNum", processFileNum); filesCount.put("policyFileNum", policyFileNum); filesCount.put("guideFileNum", guideFileNum); filesCount.put("formFileNum", formFileNum); filesCount.put("engineeringtandardFileNum", engineeringtandardFileNum); + ro.put("filesCount", filesCount); - } - List fileTreeNodes = TreeUtil.buildTree("0", fileMaps, "process", "frame", null, null); - ro.put("fileMaps", fileMaps); - return ro.toString(); - } else { - filesCount = new LinkedHashMap<>(); - filesCount.put("processFileNum", processFileNum); - filesCount.put("policyFileNum", policyFileNum); - filesCount.put("guideFileNum", guideFileNum); - filesCount.put("formFileNum", formFileNum); - filesCount.put("engineeringtandardFileNum", engineeringtandardFileNum); - ro.ok("暂无文件"); - ro.put("fileMaps", fileMaps); - ro.put("filesCount", filesCount); + List fileTreeNodes = TreeUtil.buildTree("0", fileMaps, "process", "frame", null, null); + ro.put("fileMaps", fileTreeNodes); return ro.toString(); } + filesCount = new LinkedHashMap<>(); + filesCount.put("processFileNum", processFileNum); + filesCount.put("policyFileNum", policyFileNum); + filesCount.put("guideFileNum", guideFileNum); + filesCount.put("formFileNum", formFileNum); + filesCount.put("engineeringtandardFileNum", engineeringtandardFileNum); + ro.ok("暂无文件"); + ro.put("fileMaps", fileMaps); + ro.put("filesCount", filesCount); + return ro.toString(); } - } catch (Exception e) { - e.printStackTrace(); - } finally { - // System.err.println("====执行完毕====>"); } - return ro.toString(); + catch (Exception e) { + e.printStackTrace(); + } finally {} + + System.out.println("ro=================" + ro.toString()); + return ro.toString(); } - // 查询所有文件 - public void getind(String dempId, String fileType, List fileRowMaps, ArrayList fileHandleRowMaps, - Map reFileMap, RowMap reFileRowMap) { + + + + public void getind(String dempId, String fileType, List fileRowMaps, ArrayList fileHandleRowMaps, Map reFileMap, RowMap reFileRowMap) { fileHandleRowMaps = new ArrayList<>(); if (null != fileRowMaps && !fileRowMaps.isEmpty()) { for (RowMap fileRowMap : fileRowMaps) { - if (fileType.equals("processFile")) { - if (fileRowMap.getString("PLMETHODID").equals("process.epc") - || fileRowMap.getString("PLMETHODID").equals("process.flowchart")) { - fileHandleRowMaps.add(fileRowMap); - } + if (fileType.equals("processFile") && ( + fileRowMap.getString("PLMETHODID").equals("process.epc") || fileRowMap + .getString("PLMETHODID").equals("process.flowchart"))) { + fileHandleRowMaps.add(fileRowMap); } - if (fileType.equals("policyFile")) { - if (fileRowMap.getString("PLMETHODID").equals("control.policy")) { - try { - BaseModel defineModel = CoeDesignerAPIManager.getInstance() - .getDefinition(fileRowMap.getString("FILEID"), 0); - if (defineModel != null) { - String define = defineModel.getDefinition(); - JSONObject definition = JSONObject.parseObject(define); - JSONObject elements = definition.getJSONObject("elements"); - for (String key : elements.keySet()) { - JSONObject shape1 = elements.getJSONObject(key); - if ("regulation".equals(shape1.getString("name"))) { - fileRowMap.put("POLICYTYPE", "regulation"); - fileHandleRowMaps.add(fileRowMap); - } + + if (fileType.equals("policyFile") && + fileRowMap.getString("PLMETHODID").equals("control.policy")) { + + try { + BaseModel defineModel = CoeDesignerAPIManager.getInstance().getDefinition(fileRowMap.getString("FILEID"), 0); + if (defineModel != null) { + String define = defineModel.getDefinition(); + JSONObject definition = JSONObject.parseObject(define); + JSONObject elements = definition.getJSONObject("elements"); + for (String key : elements.keySet()) { + JSONObject shape1 = elements.getJSONObject(key); + if ("regulation".equals(shape1.getString("name"))) { + fileRowMap.put("POLICYTYPE", "regulation"); + fileHandleRowMaps.add(fileRowMap); } } - } catch (Exception e) { - // TODO: handle exception } - - } + } catch (Exception e) {} } - // && fileRowMap.getString("POLICYTYPE").equals("regulation") - if (fileType.equals("guideFile")) { - if (fileRowMap.getString("PLMETHODID").equals("control.policy")) { - try { - BaseModel defineModel = CoeDesignerAPIManager.getInstance() - .getDefinition(fileRowMap.getString("FILEID"), 0); - if (defineModel != null) { - String define = defineModel.getDefinition(); - JSONObject definition = JSONObject.parseObject(define); - JSONObject elements = definition.getJSONObject("elements"); - for (String key : elements.keySet()) { - JSONObject shape1 = elements.getJSONObject(key); - if ("I/O_L4".equals(shape1.getString("name"))) { - fileRowMap.put("POLICYTYPE", "I/O_L4"); - fileHandleRowMaps.add(fileRowMap); - } + + + + + + if (fileType.equals("guideFile") && + fileRowMap.getString("PLMETHODID").equals("control.policy")) { + + try { + BaseModel defineModel = CoeDesignerAPIManager.getInstance().getDefinition(fileRowMap.getString("FILEID"), 0); + if (defineModel != null) { + String define = defineModel.getDefinition(); + JSONObject definition = JSONObject.parseObject(define); + JSONObject elements = definition.getJSONObject("elements"); + for (String key : elements.keySet()) { + JSONObject shape1 = elements.getJSONObject(key); + if ("I/O_L4".equals(shape1.getString("name"))) { + fileRowMap.put("POLICYTYPE", "I/O_L4"); + fileHandleRowMaps.add(fileRowMap); } } - } catch (Exception e) { - // TODO: handle exception } - - } + } catch (Exception e) {} } - if (fileType.equals("formFile")) { - if (fileRowMap.getString("PLMETHODID").equals("data.form")) { - fileHandleRowMaps.add(fileRowMap); - String PLPARENTID = fileRowMap.getString("PLPARENTID"); - PALRepositoryModel reFileModel = PALRepositoryCache.getCache().get(PLPARENTID); - if (null != reFileModel) { - String PLMETHODID = reFileModel.getMethodId(); - String PUBDEPT = fileRowMap.getString("PUBDEPT"); - Integer PLLEVEL = fileRowMap.getInt("PLLEVEL"); - if (!PLMETHODID.equals("process.framework")) { - reFileMap = new HashMap<>(); - reFileMap.put("FILEID", reFileModel.getId()); - reFileMap.put("PLNAME", reFileModel.getName()); - reFileMap.put("PLPARENTID", reFileModel.getParentId()); - reFileMap.put("PLMETHODID", PLMETHODID); - reFileMap.put("PUBDEPT", dempId); - reFileMap.put("PLLEVEL", (PLLEVEL - 1)); - reFileMap.put("PLORDERINDEX", reFileModel.getOrderIndex()); - reFileRowMap = new RowMap(reFileMap); - fileHandleRowMaps.add(reFileRowMap); - } + + + + + if (fileType.equals("formFile") && + fileRowMap.getString("PLMETHODID").equals("data.form")) { + fileHandleRowMaps.add(fileRowMap); + String PLPARENTID = fileRowMap.getString("PLPARENTID"); + PALRepositoryModel reFileModel = (PALRepositoryModel)PALRepositoryCache.getCache().get(PLPARENTID); + if (null != reFileModel) { + String PLMETHODID = reFileModel.getMethodId(); + String PUBDEPT = fileRowMap.getString("PUBDEPT"); + Integer PLLEVEL = Integer.valueOf(fileRowMap.getInt("PLLEVEL")); + if (!PLMETHODID.equals("process.framework")) { + reFileMap = new HashMap<>(); + reFileMap.put("FILEID", reFileModel.getId()); + reFileMap.put("PLNAME", reFileModel.getName()); + reFileMap.put("PLPARENTID", reFileModel.getParentId()); + reFileMap.put("PLMETHODID", PLMETHODID); + reFileMap.put("PUBDEPT", dempId); + reFileMap.put("PLLEVEL", Integer.valueOf(PLLEVEL.intValue() - 1)); + reFileMap.put("PLORDERINDEX", Integer.valueOf(reFileModel.getOrderIndex())); + reFileRowMap = new RowMap(reFileMap); + fileHandleRowMaps.add(reFileRowMap); } } } @@ -2211,22 +2229,22 @@ public class DataViewService extends ActionWeb { } } - - /* - * if (fileType.equals("totalFile")) { fileHandleRowMaps.add(fileRowMap); } - */ } } } - public void getArrt(String name, PALRepositoryModel model, String dempId, Integer PLLEVEL, RowMap reFileRowMap, - ArrayList fileHandleRowMaps) { - // 支持相关文件 - List support_filesList = DesignerShapeRelationCache.getListByAttrId(model.getId(), - "", name); + + + + + + + public void getArrt(String name, PALRepositoryModel model, String dempId, Integer PLLEVEL, RowMap reFileRowMap, ArrayList fileHandleRowMaps) { + List support_filesList = DesignerShapeRelationCache.getListByAttrId(model.getId(), "", name); + for (DesignerShapeRelationModel support : support_filesList) { - String supportFileId = support.getRelationFileId();// 支持或相关文件的ID - PALRepositoryModel reFileModel = PALRepositoryCache.getCache().get(supportFileId); + String supportFileId = support.getRelationFileId(); + PALRepositoryModel reFileModel = (PALRepositoryModel)PALRepositoryCache.getCache().get(supportFileId); if (reFileModel != null) { String PLMETHODID = reFileModel.getMethodId(); if (PLMETHODID.equals("data.form") && reFileModel.isPublish()) { @@ -2236,8 +2254,8 @@ public class DataViewService extends ActionWeb { reFileMap.put("PLPARENTID", model.getId()); reFileMap.put("PLMETHODID", PLMETHODID); reFileMap.put("PUBDEPT", dempId); - reFileMap.put("PLLEVEL", (PLLEVEL + 1)); - reFileMap.put("PLORDERINDEX", reFileModel.getOrderIndex()); + reFileMap.put("PLLEVEL", Integer.valueOf(PLLEVEL.intValue() + 1)); + reFileMap.put("PLORDERINDEX", Integer.valueOf(reFileModel.getOrderIndex())); reFileRowMap = new RowMap(reFileMap); fileHandleRowMaps.add(reFileRowMap); } @@ -2246,8 +2264,8 @@ public class DataViewService extends ActionWeb { } - public String getSubDepartments(ArrayList arr, - DepartmentModel departmentById) { + + public String getSubDepartments(ArrayList arr, DepartmentModel departmentById) { String departName = ""; if (!departmentById.isClosed()) { List subDepartments = SDK.getORGAPI().getSubDepartments(departmentById.getId()); @@ -2255,112 +2273,112 @@ public class DataViewService extends ActionWeb { if (!departmentModel.isClosed()) { String name = departmentModel.getName(); String id = departmentModel.getId(); - departName += name + ","; - // 递归获取子部门下的子部门 + departName = departName + name + ","; + if (SDK.getORGAPI().isExistSubDepartment(id)) { getSubDepartments(arr, SDK.getORGAPI().getDepartmentById(id)); } - } - } } + + return departName; } - /** - * 创建手册,如果是未发布的流程模型,会在N表中创建一个数据 - * @param plId 流程模型ID - * @param me 用户信息 - */ - public String createFile(String plId,UserContext me){ + + + + + + public String createFile(String plId, UserContext me) { String taskIds = ""; int count = 0; - // 生成手册 - PALRepositoryModel model = PALRepositoryCache.getCache().get(plId); + + PALRepositoryModel model = (PALRepositoryModel)PALRepositoryCache.getCache().get(plId); String taskId = createOutputReport(model, "7d3ca852-a0bd-42e6-80b1-3dcea6f55083", "admin", "", plId); - System.err.println("======手动生成手册id======"+taskId); - // 刷新预览加载的表 + System.err.println("======手动生成手册id======" + taskId); + String sqlr = "UPDATE BO_EU_PAL_OUTPUTREPORT SET TASKID = '" + taskId + "' WHERE PLID = '" + plId + "'"; DBSql.update(sqlr); String sql1 = "SELECT ID FROM BO_ACT_COE_PUBLISH_N WHERE PUBLISHFILEID = '" + plId + "'"; String string = DBSql.getString(sql1); - System.out.println(">>>>>>>>>>>>>>>"+string); + System.out.println(">>>>>>>>>>>>>>>" + string); String sql2 = "SELECT ID FROM BO_ACT_COE_PUBLISH_C WHERE CHANGEDFILEIDNEW = '" + plId + "'"; if (UtilString.isNotEmpty(DBSql.getString(sql1))) { - count = DBSql.update( - "UPDATE BO_ACT_COE_PUBLISH_N SET TASKID='" + taskId + "'WHERE PUBLISHFILEID ='" + plId + "'"); + count = DBSql.update("UPDATE BO_ACT_COE_PUBLISH_N SET TASKID='" + taskId + "'WHERE PUBLISHFILEID ='" + plId + "'"); } + if (UtilString.isNotEmpty(DBSql.getString(sql2))) { - count = DBSql.update( - "UPDATE BO_ACT_COE_PUBLISH_C SET TASKID='" + taskId + "'WHERE CHANGEDFILEIDNEW ='" + plId + "'"); + count = DBSql.update("UPDATE BO_ACT_COE_PUBLISH_C SET TASKID='" + taskId + "'WHERE CHANGEDFILEIDNEW ='" + plId + "'"); } + if (count != 0) { - DBSql.update("UPDATE APP_ACT_COE_PAL_PUBLISH_LIST SET TASKID='" + taskId + "'WHERE PALREPOSITORYID='" - + plId + "'"); + DBSql.update("UPDATE APP_ACT_COE_PAL_PUBLISH_LIST SET TASKID='" + taskId + "'WHERE PALREPOSITORYID='" + plId + "'"); } - if(UtilString.isEmpty(DBSql.getString(sql1)) && UtilString.isEmpty(DBSql.getString(sql2))){ + + if (UtilString.isEmpty(DBSql.getString(sql1)) && UtilString.isEmpty(DBSql.getString(sql2))) { System.out.println("发布流程无数据==================================================="); - ////String sql = "SELECT pl.TASKID FROM APP_ACT_COE_PAL_PUBLISH p, APP_ACT_COE_PAL_PUBLISH_LIST pl - // // WHERE pl.pid = p.id AND pl.palrepositoryid = ? ORDER BY publishdate DESC"; - //审批改为发布,如果发布表未存数据,则自动生成发布关联表数据,可使部门视图正常使用 - BO publishN=new BO(); - publishN.set("PUBLISTHTYPE","N"); - publishN.set("PUBLISHFILENAME",model.getName()); - publishN.set("PUBLISHFILEID",plId); + + + + BO publishN = new BO(); + publishN.set("PUBLISTHTYPE", "N"); + publishN.set("PUBLISHFILENAME", model.getName()); + publishN.set("PUBLISHFILEID", plId); ProcessInstance processInstance = SDK.getProcessAPI().createProcessInstance("obj_a228b4816a7b4f58a862b9612299948c", "admin", ""); - SDK.getBOAPI().create("BO_ACT_COE_PUBLISH_N",publishN,processInstance,me); + SDK.getBOAPI().create("BO_ACT_COE_PUBLISH_N", publishN, processInstance, me); + + + + - /*BO publish=new BO(); - publish.set("PROCESSINSTID",processInstance.getId()); - publish.set("PUBLISH","1"); - SDK.getBOAPI().createDataBO("APP_ACT_COE_PAL_PUBLISH",publish,me);*/ String sql = "insert into APP_ACT_COE_PAL_PUBLISH (ID,PROCESSINSTID,PUBLISHN) values ('%s', '%s', '%s')"; String id = UUIDGener.getUUID(); - int update = DBSql.update(String.format(sql, id, processInstance.getId(), '1')); + int update = DBSql.update(String.format(sql, new Object[] { id, processInstance.getId(), Character.valueOf('1') })); + + + + RowMap map = DBSql.getMap("select * from APP_ACT_COE_PAL_PUBLISH where PROCESSINSTID = '" + processInstance.getId() + "'", new Object[0]); + + - //BO app_act_coe_pal_publish = SDK.getBOAPI().query("APP_ACT_COE_PAL_PUBLISH").addQuery("BINDID=", processInstance.getId()).detail(); - RowMap map = DBSql.getMap("select * from APP_ACT_COE_PAL_PUBLISH where PROCESSINSTID = '" + processInstance.getId() + "'"); - /*BO publishList=new BO(); - publishList.set("PID",app_act_coe_pal_publish.getString("ID")); - publishList.set("PALREPOSITORYID",plId); - SDK.getBOAPI().createDataBO("APP_ACT_COE_PAL_PUBLISH_LIST",publishList,me);*/ String app_act_coe_pal_publishsql = "insert into APP_ACT_COE_PAL_PUBLISH_LIST (ID,PID,PALREPOSITORYID) values ('%s', '%s', '%s')"; String app_act_coe_pal_publishid = UUIDGener.getUUID(); - int app_act_coe_pal_publishupdate = DBSql.update(String.format(app_act_coe_pal_publishsql, app_act_coe_pal_publishid,map.getString("ID"), plId)); + int app_act_coe_pal_publishupdate = DBSql.update(String.format(app_act_coe_pal_publishsql, new Object[] { app_act_coe_pal_publishid, map.getString("ID"), plId })); String repetition_TaskId = createOutputReport(model, "7d3ca852-a0bd-42e6-80b1-3dcea6f55083", "admin", "", plId); - System.err.println("======手动生成手册id======"+repetition_TaskId); + System.err.println("======手动生成手册id======" + repetition_TaskId); taskIds = repetition_TaskId; - // 刷新预览加载的表 + String repetition_sqlr = "UPDATE BO_EU_PAL_OUTPUTREPORT SET TASKID = '" + repetition_TaskId + "' WHERE PLID = '" + plId + "'"; String n_sql = "UPDATE BO_ACT_COE_PUBLISH_N SET TASKID = '" + repetition_TaskId + "' WHERE PUBLISHFILEID = '" + plId + "'"; DBSql.update(sqlr); DBSql.update(n_sql); String repetition_sql1 = "SELECT ID FROM BO_ACT_COE_PUBLISH_N WHERE PUBLISHFILEID = '" + plId + "'"; - BO bo_act_coe_publish_n = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH_N", true).addQuery("PUBLISHFILEID = ", plId).detail(); - System.out.println("bo_act_coe_publish_nL>>>>>>>>>>>>>>>>>>"+bo_act_coe_publish_n); + BO bo_act_coe_publish_n = (BO)((BOQueryAPI)SDK.getBOAPI().query("BO_ACT_COE_PUBLISH_N", true).addQuery("PUBLISHFILEID = ", plId)).detail(); + System.out.println("bo_act_coe_publish_nL>>>>>>>>>>>>>>>>>>" + bo_act_coe_publish_n); String repetition_sql2 = "SELECT ID FROM BO_ACT_COE_PUBLISH_C WHERE CHANGEDFILEIDNEW = '" + plId + "'"; if (UtilString.isNotEmpty(DBSql.getString(repetition_sql1))) { - count = DBSql.update( - "UPDATE BO_ACT_COE_PUBLISH_N SET TASKID='" + repetition_TaskId + "'WHERE PUBLISHFILEID ='" + plId + "'"); + count = DBSql.update("UPDATE BO_ACT_COE_PUBLISH_N SET TASKID='" + repetition_TaskId + "'WHERE PUBLISHFILEID ='" + plId + "'"); } + if (UtilString.isNotEmpty(DBSql.getString(repetition_sql2))) { - count = DBSql.update( - "UPDATE BO_ACT_COE_PUBLISH_C SET TASKID='" + repetition_TaskId + "'WHERE CHANGEDFILEIDNEW ='" + plId + "'"); + count = DBSql.update("UPDATE BO_ACT_COE_PUBLISH_C SET TASKID='" + repetition_TaskId + "'WHERE CHANGEDFILEIDNEW ='" + plId + "'"); } + if (count != 0) { - DBSql.update("UPDATE APP_ACT_COE_PAL_PUBLISH_LIST SET TASKID='" + repetition_TaskId + "'WHERE PALREPOSITORYID='" - + plId + "'"); + DBSql.update("UPDATE APP_ACT_COE_PAL_PUBLISH_LIST SET TASKID='" + repetition_TaskId + "'WHERE PALREPOSITORYID='" + plId + "'"); } } + System.err.println("重新生成手册成功=====》" + count); return taskIds; } @@ -2390,6 +2408,4 @@ public class DataViewService extends ActionWeb { } return taskId; } - - }