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 1baad086..f6b0edc0 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/PALRepositoryQueryAPIManager.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/PALRepositoryQueryAPIManager.java index b947a25f..2e7c232d 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/PALRepositoryQueryAPIManager.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/PALRepositoryQueryAPIManager.java @@ -1269,7 +1269,7 @@ public class PALRepositoryQueryAPIManager { } public List getPalRepositoryModelsByTeamIdByDeptId(String wsId, String userId, String teamId, boolean isUsed, boolean isPublished,String departId) { - List list = CoeProcessLevelUtil.getPermRepositoryListByDeptId(wsId, teamId, userId, null, null, isUsed, isPublished,departId); + List list = CoeProcessLevelUtil.getPermRepositoryListByDeptId(wsId, teamId, userId, null, null, isUsed, isPublished,departId); return list; } @@ -2181,7 +2181,7 @@ public class PALRepositoryQueryAPIManager { removeIds.append(model.getId()).append(","); } } - result.addAll(list2DepartJson(context, newList, isUsed, isPublished, removeIds.toString(), type, true,departId)); + result.addAll(list2DepartJson(context, newList, isUsed, isPublished, removeIds.toString(), type, true,departId,methods)); return result; } @@ -2645,37 +2645,19 @@ public class PALRepositoryQueryAPIManager { } - private JSONArray list2DepartJson(UserContext context, List list, boolean isUsed, boolean isPublished, String removeIds, String param, boolean statusSuffix,String departId) { + private JSONArray list2DepartJson(UserContext context, List list, boolean isUsed, boolean isPublished, String removeIds, String param, boolean statusSuffix,String departId,String methods) { JSONArray jsonArray = new JSONArray(); - /*DepartmentModel departmentById = SDK.getORGAPI().getDepartmentById(departId); - - - ArrayList dep=new ArrayList(); - - dep.add(departId); - - ArrayList subDepartmentsList = getChildDept(departId, new ArrayList<>()); - - - long startTime = System.currentTimeMillis();*/ - - - for(PALRepositoryModel o:list){ - System.out.println("过滤前======="+o.getName()); - } // 先过滤掉空的架构与空的文件夹 list = list.stream().filter(model -> { - boolean flag = true; - if (model.getMethodId().equals("process.framework")) { - flag = this.filterEmptyMoldel(model.getWsId(), model.getVersionId()); - } + boolean flag = true; + + if ("process.framework".equals(model.getMethodId()) || "default".equals(model.getMethodId())) { + flag = this.filterEmptyMoldel(model.getWsId(), model.getVersionId()); + } return flag; }).collect(Collectors.toList()); - for(PALRepositoryModel o:list){ - System.out.println("过滤后======="+o.getName()); - } String[] spilt=departId.split(","); JSONArray orgIdList=new JSONArray(); @@ -2684,7 +2666,6 @@ public class PALRepositoryQueryAPIManager { orgIdList.add(ele); } - Set tempOrgList = new HashSet<>(); if (orgIdList.size() > 0) { orgIdList.stream().forEach(parentOrgId -> { @@ -2699,23 +2680,12 @@ public class PALRepositoryQueryAPIManager { if ("org".equals(model.getMethodCategory()) || "itsystem.normal".equals(model.getMethodId())) { return true; } + if ("process.framework".equals(model.getMethodId()) || "default".equals(model.getMethodId())) { flag = this.filterIsMatchPropertyModel(model.getWsId(), model.getVersionId(), tempOrgList); } else { + List relationModels = DesignerShapeRelationCache.getByFileId(model.getId(), "Issuing_department"); - List rlatRowMap = DBSql.getMaps("SELECT RELATIONSHAPETEXT FROM APP_ACT_COE_PAL_SHAPE_RLAT where FILEID = '" + model.getId() + "' and ATTRID='Issuing_department'"); - - for (RowMap oneRowMap : rlatRowMap) { - String relationshapetext = oneRowMap.getString("RELATIONSHAPETEXT"); - JSONObject js = JSONObject.parseObject(relationshapetext); - String deptId = js.getString("id"); - flag = tempOrgList.contains(deptId); - if (flag) - break; - - } - - /*List relationModels = DesignerShapeRelationCache.getByFileId(model.getId(), "Issuing_department"); // 是否有发布部门的文件属性【可能会有多个值】 if (relationModels != null && relationModels.size() > 0) { for (DesignerShapeRelationModel relationModel : relationModels) { @@ -2725,48 +2695,37 @@ public class PALRepositoryQueryAPIManager { if (flag) break; } - }*/ + } + } return flag; }).collect(Collectors.toList()); } + String[] method=methods.split(","); + JSONArray methodIdList=new JSONArray(); - /*list = list.stream().filter(model -> { - boolean flag = true; - if (model.getMethodId().equals("process.framework")) { - flag = this.filterEmptyMoldel(model.getWsId(), model.getId()); - } - return flag; - }).collect(Collectors.toList());*/ + for(String ele:method){ + methodIdList.add(ele); + } - - - /*list = list.stream().filter(model -> { - if ("org".equals(model.getMethodCategory()) || "itsystem.normal".equals(model.getMethodId())) { - return true; - } - boolean flag = false; - if ("process.framework".equals(model.getMethodId()) || "default".equals(model.getMethodId())) { - flag = this.filterIsMatchPropertyModel(model.getWsId(), model.getVersionId(), subDepartmentsList); - } else { - List relationModels = DesignerShapeRelationCache.getByFileId(model.getId(), "Issuing_department"); - // 是否有发布部门的文件属性【可能会有多个值】 - if (relationModels != null && relationModels.size() > 0) { - for (DesignerShapeRelationModel relationModel : relationModels) { - JSONObject relationObj = JSONObject.parseObject(relationModel.getRelationShapeText()); - String deptId = relationObj.getString("id"); - flag = subDepartmentsList.contains(deptId); - if (flag) - break; - } + if (methodIdList.size() > 0) { + list = list.stream().filter(model -> { + boolean flag = false; + if ("org".equals(model.getMethodCategory()) || "itsystem.normal".equals(model.getMethodId())) { + return true; } - } - return flag; - }).collect(Collectors.toList());*/ - - + // 代表【架构】伊利专属需求 + if ("process.framework".equals(model.getMethodId()) || "default".equals(model.getMethodId())) { + // 递归判断当前架构下是否有符合的文件类型 + flag = this.filterChildLevelModelByPid(model.getWsId(), model.getVersionId(), methodIdList); + } else { + flag = methodIdList.contains(model.getMethodId()); + } + return flag; + }).collect(Collectors.toList()); + } for (PALRepositoryModel model : list) { @@ -2774,12 +2733,7 @@ public class PALRepositoryQueryAPIManager { JSONObject object = new JSONObject(); object.put("id", model.getId().trim()); object.put("pid", model.getNewParentId().trim()); - if (removeIds != null && removeIds.contains(model.getId().trim())) { - object.put("nocheck", true); - continue; - } else { - object.put("nocheck", false); - } + object.put("plNo", CoeProcessLevelUtil.getProcessLevelNoByUUId(model.getId(), model.getWsId()).trim()); object.put("name", I18nRes.findValue(CoEConstant.APP_ID, context.getLanguage(), model.getName()).trim() + (statusSuffix && !"default".equals(model.getMethodId()) && !"process.framework".equals(model.getMethodId()) ? "(" + getStatusLabel(model) + ")" : "")); object.put("wsId", model.getWsId()); @@ -2859,31 +2813,8 @@ public class PALRepositoryQueryAPIManager { String plDutyPerson = model.getDutyUser(); object.put("dutyPersonId", model.getDutyUser() == null ? "" : model.getDutyUser()); object.put("dutyPersionName", UtilString.isEmpty(plDutyPerson) ? "" : SDK.getORGAPI().getUserAliasNames(plDutyPerson)); - jsonArray.add(object); - /*if(model.getMethodId().equals("process.framework")) { - - }else{ - - List rlatRowMap = DBSql.getMaps("SELECT RELATIONSHAPETEXT FROM APP_ACT_COE_PAL_SHAPE_RLAT where FILEID = '" + model.getId() + "' and ATTRID='Issuing_department'"); - if (rlatRowMap.size() > 0) { - // 发布部门 - String dempId = ""; - for (RowMap oneRowMap : rlatRowMap) { - String relationshapetext = oneRowMap.getString("RELATIONSHAPETEXT"); - JSONObject js = JSONObject.parseObject(relationshapetext); - String getDepartId=js.getString("id"); - boolean contains = subDepartmentsList.contains(getDepartId); - if(contains){ - jsonArray.add(object); - } - } - } - - - - }*/ } return jsonArray; @@ -2909,6 +2840,33 @@ public class PALRepositoryQueryAPIManager { } + /** + * 判断当前架构或者文件夹下是否含有 + * 选中的建模小类的文件 + * + * @param wsId + * @param pid + * @param methodIdList + * @return + */ + private boolean filterChildLevelModelByPid(String wsId, String pid, JSONArray methodIdList) { + boolean flag = false; + Iterator iterator = PALRepositoryCache.getByPid(wsId, pid); + while (iterator.hasNext()) { + PALRepositoryModel currentModel = iterator.next(); + if ("process.framework".equals(currentModel.getMethodId()) || "default".equals(currentModel.getMethodId())) { + flag = this.filterChildLevelModelByPid(wsId, currentModel.getVersionId(), methodIdList); + } else { + flag = methodIdList.contains(currentModel.getMethodId()); + } + if (flag) + break; + } + return flag; + } + + + /** * 判断当前架构或者文件夹下是否含有 * 匹配的文件属性【发布部门】 diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/util/CoeProcessLevelUtil.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/util/CoeProcessLevelUtil.java index 6497afc4..636b6a65 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/util/CoeProcessLevelUtil.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/util/CoeProcessLevelUtil.java @@ -1622,7 +1622,8 @@ public class CoeProcessLevelUtil { if (list != null) { for (PALRepositoryModel model : list) { if ((isUse && model.isUse()) || (isPublish && model.isPublish())) { - result.add(model); + result.add(model); + } } }