diff --git a/com.actionsoft.apps.coe.pal.publisher/lib/com.actionsoft.apps.coe.pal.publisher.jar b/com.actionsoft.apps.coe.pal.publisher/lib/com.actionsoft.apps.coe.pal.publisher.jar index b5a9634e..d842269e 100644 Binary files a/com.actionsoft.apps.coe.pal.publisher/lib/com.actionsoft.apps.coe.pal.publisher.jar and b/com.actionsoft.apps.coe.pal.publisher/lib/com.actionsoft.apps.coe.pal.publisher.jar differ diff --git a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/web/ProcessPublishClientWeb.java b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/web/ProcessPublishClientWeb.java index 65f69bbd..a3d2e7b1 100644 --- a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/web/ProcessPublishClientWeb.java +++ b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/web/ProcessPublishClientWeb.java @@ -599,7 +599,7 @@ public class ProcessPublishClientWeb extends AbstPortalSkins implements PortalSk wsTree.add(wsJson); i++; - JSONArray jsonArray = PALRepositoryQueryAPIManager.getInstance().getPalRepositoryTreeData(_uc, wsId, "org", "isUsed"); + JSONArray jsonArray = PALRepositoryQueryAPIManager.getInstance().getPalRepositoryTreeData(_uc, wsId, "org", "isUsed", false); for (int j = 0; j < jsonArray.size(); j++) { JSONObject object = jsonArray.getJSONObject(j); if (object.getString("id").equals("org")) { 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 8978a3c4..e27cc794 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/output/OutPutReportWeb.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/output/OutPutReportWeb.java index 0f58dae8..f1aeee07 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/output/OutPutReportWeb.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/output/OutPutReportWeb.java @@ -429,11 +429,10 @@ public class OutPutReportWeb extends ActionWeb { public String PALFileJsonDataRootTreeData(String methodType, String wsid, String versionType, String teamId) { JSONArray jsonArr = null; //if (teamId == null || "".equals(teamId)) { - versionType = "isPublished"; if (teamId == null) { - jsonArr = PALRepositoryQueryAPIManager.getInstance().getPalRepositoryTreeData(_uc, wsid, methodType, versionType); + jsonArr = PALRepositoryQueryAPIManager.getInstance().getPalRepositoryTreeData(_uc, wsid, methodType, versionType, true); } else { - jsonArr = PALRepositoryQueryAPIManager.getInstance().getPermPalRepositoryTreeDataByMethods(_uc, wsid, teamId, versionType, methodType); + jsonArr = PALRepositoryQueryAPIManager.getInstance().getPermPalRepositoryTreeDataByMethods(_uc, wsid, teamId, versionType, methodType, true); } return jsonArr.toString(); } @@ -638,9 +637,9 @@ public class OutPutReportWeb extends ActionWeb { public String PALFileRelationJsonDataRoot(String methodType, String wsid, String versionType, String teamId) { JSONArray jsonArr = null; if (teamId == null || "".equals(teamId)) { - jsonArr = PALRepositoryQueryAPIManager.getInstance().getPalRepositoryTreeData(_uc, wsid, methodType, versionType); + jsonArr = PALRepositoryQueryAPIManager.getInstance().getPalRepositoryTreeData(_uc, wsid, methodType, versionType, false); } else { - jsonArr = PALRepositoryQueryAPIManager.getInstance().getPermPalRepositoryTreeDataByMethods(_uc, wsid, teamId, versionType, methodType); + jsonArr = PALRepositoryQueryAPIManager.getInstance().getPermPalRepositoryTreeDataByMethods(_uc, wsid, teamId, versionType, methodType, false); } // jsonArr = PALRepositoryQueryAPIManager.getInstance().getLimitPALTree(new JSONArray(), methodType, wsid, versionType); Map map = new HashMap(); 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 2e7c232d..4b0a65ac 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 @@ -20,6 +20,7 @@ import java.util.stream.Collectors; import com.actionsoft.bpms.server.conf.portal.AWSPortalConf; import com.actionsoft.bpms.util.*; +import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections4.IteratorUtils; import org.apache.commons.lang.StringUtils; @@ -1522,7 +1523,7 @@ public class PALRepositoryQueryAPIManager { * @param type isUsed/isPublished/designer 使用中/已发布/使用中但是未发布 * @return */ - public JSONArray getPalRepositoryTreeData(UserContext context, String wsId, String methods, String type) { + public JSONArray getPalRepositoryTreeData(UserContext context, String wsId, String methods, String type, boolean onlyPublish) { JSONArray result = new JSONArray(); String[] methodArray; @@ -1595,6 +1596,25 @@ public class PALRepositoryQueryAPIManager { modelList = tempList; } + if (onlyPublish){ + List modelList2 = new ArrayList(); + for (PALRepositoryModel repositoryModel : modelList) { + if ("process.framework".equals(repositoryModel.getMethodId()) || "default".equals(repositoryModel.getMethodId())){ + // 判断文件夹及所有子级下是否存在已发布模型 + List children = new ArrayList<>(); + getAllPublishedPalRepositoryModelsByPid(wsId, repositoryModel.getId(), children); + if (children.size() > 0){ + modelList2.add(repositoryModel); + continue; + } + } + if (repositoryModel.isPublish()){ + modelList2.add(repositoryModel); + } + } + modelList = modelList2; + } + List newList = setNewPid(modelList); Collections.sort(newList, new Comparator1()); @@ -2039,7 +2059,7 @@ public class PALRepositoryQueryAPIManager { * @param type * @return */ - public JSONArray getPermPalRepositoryTreeDataByMethods(UserContext context, String wsId, String teamId, String type, String methods) { + public JSONArray getPermPalRepositoryTreeDataByMethods(UserContext context, String wsId, String teamId, String type, String methods, boolean onlyPublish) { JSONArray result = new JSONArray(); List list = null; @@ -2066,6 +2086,26 @@ public class PALRepositoryQueryAPIManager { } list = tempList; } + + if (onlyPublish){ + List modelList2 = new ArrayList(); + for (PALRepositoryModel repositoryModel : list) { + if ("process.framework".equals(repositoryModel.getMethodId()) || "default".equals(repositoryModel.getMethodId())){ + // 判断文件夹及所有子级下是否存在已发布模型 + List children = new ArrayList<>(); + getAllPublishedPalRepositoryModelsByPid(wsId, repositoryModel.getId(), children); + if (children.size() > 0){ + modelList2.add(repositoryModel); + continue; + } + } + if (repositoryModel.isPublish()){ + modelList2.add(repositoryModel); + } + } + list = modelList2; + } + Collections.sort(list, new Comparator1()); // 按级别排序 List newList = setNewPid(list);