diff --git a/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar b/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar index b7f9a7cd..37485848 100644 Binary files a/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar and b/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar differ diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/web/CoeProcessLevelWeb.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/web/CoeProcessLevelWeb.java index fe5d5ca9..584a38db 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/web/CoeProcessLevelWeb.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/web/CoeProcessLevelWeb.java @@ -7831,6 +7831,14 @@ public class CoeProcessLevelWeb extends ActionWeb { } // 根据组织架构过滤 if (orgIdList.size() > 0) { + Set tempOrgList = new HashSet<>(); + orgIdList.stream().forEach(parentOrgId -> { + List subDepartments = SDK.getORGAPI().getSubDepartments((String)parentOrgId); + tempOrgList.add((String)parentOrgId); + if (subDepartments.size() > 0) { + this.findSubDepartmentIds((String)parentOrgId,tempOrgList); + } + }); result = result.stream() .filter(item -> { boolean flag = false; @@ -7839,7 +7847,7 @@ public class CoeProcessLevelWeb extends ActionWeb { return true; } if ("process.framework".equals(itemObj.getString("plMethodId")) || "default".equals(itemObj.getString("plMethodId"))){ - flag = this.filterIsMatchPropertyModel(itemObj.getString("wsId"),itemObj.getString("currId"),orgIdList); + flag = this.filterIsMatchPropertyModel(itemObj.getString("wsId"),itemObj.getString("currId"),tempOrgList); }else { List relationModels = DesignerShapeRelationCache.getByFileId(itemObj.getString("currId"), "Issuing_department"); // 是否有发布部门的文件属性【可能会有多个值】 @@ -7847,7 +7855,7 @@ public class CoeProcessLevelWeb extends ActionWeb { for (DesignerShapeRelationModel relationModel : relationModels) { JSONObject relationObj = JSONObject.parseObject(relationModel.getRelationShapeText()); String deptId = relationObj.getString("id"); - flag = orgIdList.contains(deptId); + flag = tempOrgList.contains(deptId); if (flag) break; } } @@ -9304,7 +9312,15 @@ public String deleteReply(String replyid, String messageid) { }).collect(Collectors.toList()); } // 如果勾选了组织机构则根据文件属性中的发布部门去匹配 + Set tempOrgList = new HashSet<>(); if (orgIdList.size() > 0) { + orgIdList.stream().forEach(parentOrgId -> { + List subDepartments = SDK.getORGAPI().getSubDepartments((String)parentOrgId); + tempOrgList.add((String)parentOrgId); + if (subDepartments.size() > 0) { + this.findSubDepartmentIds((String)parentOrgId,tempOrgList); + } + }); recentList = recentList.stream() .filter(model -> { boolean flag = false; @@ -9312,7 +9328,7 @@ public String deleteReply(String replyid, String messageid) { return true; } if ("process.framework".equals(model.getMethodId()) || "default".equals(model.getMethodId())){ - flag = this.filterIsMatchPropertyModel(model.getWsId(),model.getId(),orgIdList); + flag = this.filterIsMatchPropertyModel(model.getWsId(),model.getId(),tempOrgList); }else { List relationModels = DesignerShapeRelationCache.getByFileId(model.getId(), "Issuing_department"); // 是否有发布部门的文件属性【可能会有多个值】 @@ -9320,7 +9336,7 @@ public String deleteReply(String replyid, String messageid) { for (DesignerShapeRelationModel relationModel : relationModels) { JSONObject relationObj = JSONObject.parseObject(relationModel.getRelationShapeText()); String deptId = relationObj.getString("id"); - flag = orgIdList.contains(deptId); + flag = tempOrgList.contains(deptId); if (flag) break; } } @@ -9447,7 +9463,7 @@ public String deleteReply(String replyid, String messageid) { } boolean flag = false; if ("process.framework".equals(model.getMethodId()) || "default".equals(model.getMethodId())){ - flag = this.filterIsMatchPropertyModel(model.getWsId(),model.getId(),orgIdList); + flag = this.filterIsMatchPropertyModel(model.getWsId(),model.getId(),tempOrgList); }else { List relationModels = DesignerShapeRelationCache.getByFileId(model.getId(), "Issuing_department"); // 是否有发布部门的文件属性【可能会有多个值】 @@ -9455,7 +9471,7 @@ public String deleteReply(String replyid, String messageid) { for (DesignerShapeRelationModel relationModel : relationModels) { JSONObject relationObj = JSONObject.parseObject(relationModel.getRelationShapeText()); String deptId = relationObj.getString("id"); - flag = orgIdList.contains(deptId); + flag = tempOrgList.contains(deptId); if (flag) break; } } @@ -9580,6 +9596,22 @@ public String deleteReply(String replyid, String messageid) { return flag; } + /** + * 递归查找当前父部门下的所有子部门 + * @param parentOrgId + * @param orgIds + */ + private void findSubDepartmentIds(String parentOrgId,Set orgIds){ + List subDepartments = SDK.getORGAPI().getSubDepartments(parentOrgId); + if (subDepartments.size() == 0) { + return; + } + for (DepartmentModel department : subDepartments) { + orgIds.add(department.getId()); + this.findSubDepartmentIds(department.getId(),orgIds); + } + } + /** * 判断当前架构或者文件夹下是否含有 * 匹配的文件属性【发布部门】 @@ -9588,7 +9620,7 @@ public String deleteReply(String replyid, String messageid) { * @param orgIdList * @return */ - private boolean filterIsMatchPropertyModel(String wsId,String pid,JSONArray orgIdList){ + private boolean filterIsMatchPropertyModel(String wsId,String pid,Set orgIdList){ boolean flag = false; Iterator iterator = PALRepositoryCache.getByPid(wsId, pid); while (iterator.hasNext()) { @@ -9911,6 +9943,14 @@ public String deleteReply(String replyid, String messageid) { } // 根据组织架构过滤 if (orgIdList.size() > 0) { + Set tempOrgList = new HashSet<>(); + orgIdList.stream().forEach(parentOrgId -> { + List subDepartments = SDK.getORGAPI().getSubDepartments((String)parentOrgId); + tempOrgList.add((String)parentOrgId); + if (subDepartments.size() > 0) { + this.findSubDepartmentIds((String)parentOrgId,tempOrgList); + } + }); tableData = tableData.stream() .filter(item -> { boolean flag = false; @@ -9919,7 +9959,7 @@ public String deleteReply(String replyid, String messageid) { return true; } if ("process.framework".equals(itemObj.getString("methodId")) || "default".equals(itemObj.getString("methodId"))){ - flag = this.filterIsMatchPropertyModel(itemObj.getString("wsId"),itemObj.getString("id"),orgIdList); + flag = this.filterIsMatchPropertyModel(itemObj.getString("wsId"),itemObj.getString("id"),tempOrgList); }else { List relationModels = DesignerShapeRelationCache.getByFileId(itemObj.getString("id"), "Issuing_department"); // 是否有发布部门的文件属性【可能会有多个值】 @@ -9927,7 +9967,7 @@ public String deleteReply(String replyid, String messageid) { for (DesignerShapeRelationModel relationModel : relationModels) { JSONObject relationObj = JSONObject.parseObject(relationModel.getRelationShapeText()); String deptId = relationObj.getString("id"); - flag = orgIdList.contains(deptId); + flag = tempOrgList.contains(deptId); if (flag) break; } }