From c4bb76fe6985b6ebec489b5bd1b70c2da134ecf7 Mon Sep 17 00:00:00 2001 From: zhaol <15900249928@163.com> Date: Tue, 3 Dec 2024 20:45:31 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A8=E5=8D=95=E5=9B=BE=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E9=99=84=E4=BB=B6=E6=98=BE=E7=A4=BA=E5=86=85=E5=AE=B9|?= =?UTF-8?q?=E6=8A=A5=E5=91=8A=E7=94=9F=E6=88=90=E5=99=A8=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../coe/pal/pal/output/OutPutReportWeb.java | 2 +- .../pal/pal/output/util/OutputWordUtil.java | 14 ---------- .../PALRepositoryQueryAPIManager.java | 28 ++++++++++++++++--- .../repository/util/CoeProcessLevelUtil.java | 2 +- 4 files changed, 26 insertions(+), 20 deletions(-) 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 f1aeee07..52d7bd70 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 @@ -444,7 +444,7 @@ public class OutPutReportWeb extends ActionWeb { if (teamId == null) { jsonArr = PALRepositoryQueryAPIManager.getInstance().getPalRepositoryTreeDataByDeptId(_uc, wsid, methodType, versionType,departId); } else { - jsonArr = PALRepositoryQueryAPIManager.getInstance().getPermPalRepositoryTreeDataByMethodsByDeptId(_uc, wsid, teamId, versionType, methodType,departId); + jsonArr = PALRepositoryQueryAPIManager.getInstance().getPermPalRepositoryTreeDataByMethodsByDeptId(_uc, wsid, teamId, versionType, methodType,departId,true); } return jsonArr.toString(); } diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/output/util/OutputWordUtil.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/output/util/OutputWordUtil.java index 037772b9..5dcfe8b2 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/output/util/OutputWordUtil.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/output/util/OutputWordUtil.java @@ -207,9 +207,6 @@ public class OutputWordUtil { } - - - // 输出文档路径及名称 File outFile = new File(docName); Writer out = null; @@ -232,12 +229,7 @@ public class OutputWordUtil { } - System.out.println("repositoryId==============="+repositoryId); - - /*****************************************************************************/ - System.out.println("outFile.getPath()================"+outFile.getPath()); Document doc = new Document(outFile.getPath()); - Section section = doc.getLastSection(); UpFileDao upFileDao = new UpFileDao(); UserContext userContext = DispatcherRequest.getUserContext(); @@ -245,8 +237,6 @@ public class OutputWordUtil { DCContext dcContextModel = null; List search = upFileDao.searchByRepositoryId(repositoryModel.getId(), "f"); - - //读取模型附件插入手册中文档对象 if (search != null && search.size() > 0) { @@ -268,9 +258,7 @@ public class OutputWordUtil { tr4.getCharacterFormat().setFontSize(12); paragraph4.applyStyle(BuiltinStyle.Body_Text); //应用标题1样式 - long b1 = System.currentTimeMillis(); - for (UpfileModel upfileModel : search) { DCPluginProfile dcProfile = DCProfileManager.getDCProfile(CoEConstant.APP_ID, CoeFileConstant.COE_UPFILE); if (dcProfile != null) { @@ -347,9 +335,7 @@ public class OutputWordUtil { paragraph5.appendText(dcContextModel.getFileName()+" "); paragraph5.appendOleObject(stream1, pic1, "txt"); } - } - } try { doc.saveToFile(outFile.getPath(), FileFormat.Docx_2013); 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 4b0a65ac..00d4aa5d 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,8 +1269,8 @@ public class PALRepositoryQueryAPIManager { return list; } - 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); + public List getPalRepositoryModelsByTeamIdByDeptId(String wsId, String userId, String teamId, boolean isUsed, boolean isPublished) { + List list = CoeProcessLevelUtil.getPermRepositoryListByDeptId(wsId, teamId, userId, null, null, isUsed, isPublished); return list; } @@ -2153,7 +2153,7 @@ public class PALRepositoryQueryAPIManager { } - public JSONArray getPermPalRepositoryTreeDataByMethodsByDeptId(UserContext context, String wsId, String teamId, String type, String methods,String departId) { + public JSONArray getPermPalRepositoryTreeDataByMethodsByDeptId(UserContext context, String wsId, String teamId, String type, String methods,String departId,boolean onlyPublish) { JSONArray result = new JSONArray(); List list = null; @@ -2164,7 +2164,7 @@ public class PALRepositoryQueryAPIManager { } else if ("isPublished".equals(type)) { isPublished = true; } - list = getPalRepositoryModelsByTeamIdByDeptId(wsId, context.getUID(), teamId, isUsed, isPublished,departId); + list = getPalRepositoryModelsByTeamIdByDeptId(wsId, context.getUID(), teamId, isUsed, isPublished); if (list == null) { list = new ArrayList(); } @@ -2180,6 +2180,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); 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 636b6a65..3de09948 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 @@ -1613,7 +1613,7 @@ public class CoeProcessLevelUtil { } - public static List getPermRepositoryListByDeptId(String wsId, String teamId, String userId, String category, String method, boolean isUse, boolean isPublish,String departId) { + public static List getPermRepositoryListByDeptId(String wsId, String teamId, String userId, String category, String method, boolean isUse, boolean isPublish) { List result = new ArrayList<>(); Set versionIds = getPermRepositoryVersionIds(wsId, teamId, userId, category, method);