解决报告生成器历史已发布文件无法显示问题

This commit is contained in:
zhaol 2025-05-06 15:13:13 +08:00
parent e9b0147be8
commit 7d7f33c6b8
4 changed files with 18 additions and 47 deletions

View File

@ -1349,6 +1349,8 @@ public class PALRepositoryQueryAPIManager {
return list; return list;
} }
/**************************************************** 获取发布的流程 *****************************************************/ /**************************************************** 获取发布的流程 *****************************************************/
public List<PALRepositoryModel> getUsedPalRepositoryModelsByPidRole(String wsId, String pid, String ruuid) { public List<PALRepositoryModel> getUsedPalRepositoryModelsByPidRole(String wsId, String pid, String ruuid) {
@ -1474,16 +1476,16 @@ public class PALRepositoryQueryAPIManager {
*/ */
public List<PALRepositoryModel> getPublishedPalRepositoryModelsByPid(String wsId, String pid) { public List<PALRepositoryModel> getPublishedPalRepositoryModelsByPid(String wsId, String pid) {
List<PALRepositoryModel> list = getPalRepositoryModelsByPid(wsId, pid); List<PALRepositoryModel> list = getPalRepositoryModelsByPid(wsId, pid);
if (list != null) {
List<PALRepositoryModel> removeList = new ArrayList<PALRepositoryModel>(); List<PALRepositoryModel> removeList = new ArrayList<PALRepositoryModel>();
if (list != null) {
for (PALRepositoryModel model : list) { for (PALRepositoryModel model : list) {
if (!model.isPublish()) { if (!model.isPublish()) {
removeList.add(model); removeList.add(model);
} }
} }
list.removeAll(removeList);
} }
list.removeAll(removeList);
Collections.sort(list, new Comparator1());
return list; return list;
} }
@ -1502,12 +1504,9 @@ public class PALRepositoryQueryAPIManager {
if (list != null) { if (list != null) {
List<PALRepositoryModel> removeList = new ArrayList<PALRepositoryModel>(); List<PALRepositoryModel> removeList = new ArrayList<PALRepositoryModel>();
for (PALRepositoryModel model : list) { for (PALRepositoryModel model : list) {
boolean depflag=false; boolean depflag=false;
List<DesignerShapeRelationModel> relationModels = DesignerShapeRelationCache.getByFileId(model.getId(), "Issuing_department"); List<DesignerShapeRelationModel> relationModels = DesignerShapeRelationCache.getByFileId(model.getId(), "Issuing_department");
// 是否有发布部门的文件属性可能会有多个值 // 是否有发布部门的文件属性可能会有多个值
if (relationModels != null && relationModels.size() > 0) { if (relationModels != null && relationModels.size() > 0) {
for (DesignerShapeRelationModel relationModel : relationModels) { for (DesignerShapeRelationModel relationModel : relationModels) {
@ -1517,10 +1516,12 @@ public class PALRepositoryQueryAPIManager {
} }
} }
if(!methods.contains(model.getMethodId()) || !model.isPublish() || depflag==false){ if(!methods.contains(model.getMethodId()) || depflag==false){
if(!model.isPublish()){
removeList.add(model); removeList.add(model);
} }
} }
}
list.removeAll(removeList); list.removeAll(removeList);
} }
@ -2225,29 +2226,14 @@ public class PALRepositoryQueryAPIManager {
JSONArray result = new JSONArray(); JSONArray result = new JSONArray();
List<PALRepositoryModel> list = null; List<PALRepositoryModel> list = null;
boolean isUsed = false; boolean isUsed = true;
boolean isPublished = false; boolean isPublished = true;
if ("isUsed".equals(type) || "designer".equals(type)) { list = getPalRepositoryModelsByTeamIdByDeptId(wsId, context.getUID(), teamId, isUsed);
isUsed = true;
} else if ("isPublished".equals(type)) {
isPublished = true;
}
list = getPalRepositoryModelsByTeamIdByDeptId(wsId, context.getUID(), teamId, isUsed, isPublished);
if (list == null) { if (list == null) {
list = new ArrayList<PALRepositoryModel>(); list = new ArrayList<PALRepositoryModel>();
} }
List<PALRepositoryModel> removeList = new ArrayList<PALRepositoryModel>(); List<PALRepositoryModel> removeList = new ArrayList<PALRepositoryModel>();
StringBuilder removeIds = new StringBuilder(); StringBuilder removeIds = new StringBuilder();
// 若type为designer并且有数据则过滤掉已发布的
if ("designer".equals(type) && list != null && list.size() > 0) {
List<PALRepositoryModel> tempList = new ArrayList<PALRepositoryModel>();
for (PALRepositoryModel model : list) {
if (!model.isPublish()) {
tempList.add(model);
}
}
list = tempList;
}
String[] spilt=departId.split(","); String[] spilt=departId.split(",");
@ -2331,8 +2317,8 @@ public class PALRepositoryQueryAPIManager {
return result; return result;
} }
public List<PALRepositoryModel> getPalRepositoryModelsByTeamIdByDeptId(String wsId, String userId, String teamId, boolean isUsed, boolean isPublished) { public List<PALRepositoryModel> getPalRepositoryModelsByTeamIdByDeptId(String wsId, String userId, String teamId, boolean isUsed) {
List<PALRepositoryModel> list = CoeProcessLevelUtil.getPermRepositoryListByDeptId(wsId, teamId, userId, null, null, isUsed, isPublished); List<PALRepositoryModel> list = CoeProcessLevelUtil.getPermRepositoryListByDeptId(wsId, teamId, userId, null, null, isUsed);
return list; return list;
} }
@ -2854,8 +2840,6 @@ public class PALRepositoryQueryAPIManager {
methodIdList.add(ele); methodIdList.add(ele);
} }
// 架构过滤 // 架构过滤
if (orgIdList.size() > 0 || methodIdList.size() > 0) { if (orgIdList.size() > 0 || methodIdList.size() > 0) {
list = PALFrameworkFilterUtil2.filter(list, orgIdList, methodIdList); list = PALFrameworkFilterUtil2.filter(list, orgIdList, methodIdList);
@ -2891,20 +2875,7 @@ public class PALRepositoryQueryAPIManager {
object.put("iconFont", "&#59101;"); object.put("iconFont", "&#59101;");
} }
List<PALRepositoryModel> children = null; List<PALRepositoryModel> children = null;
if (isUsed) {
children = getUsedPalRepositoryModelsByPid(model.getWsId(), model.getId());
if ("designer".equals(param) && children != null && children.size() > 0) {// 过滤掉发布版本
List<PALRepositoryModel> tempChildren = new ArrayList<>();
for (PALRepositoryModel model2 : children) {
if (!model2.isPublish()) {
tempChildren.add(model2);
}
}
children = tempChildren;
}
} else if (isPublished) {
children = getPublishedPalRepositoryModelsByPid(model.getWsId(), model.getId()); children = getPublishedPalRepositoryModelsByPid(model.getWsId(), model.getId());
}
if (children == null || children.size() == 0) { if (children == null || children.size() == 0) {
object.put("isParent", false); object.put("isParent", false);
//String icon = object.getString("icon"); //String icon = object.getString("icon");

View File

@ -1617,14 +1617,14 @@ public class CoeProcessLevelUtil {
} }
public static List<PALRepositoryModel> getPermRepositoryListByDeptId(String wsId, String teamId, String userId, String category, String method, boolean isUse, boolean isPublish) { public static List<PALRepositoryModel> getPermRepositoryListByDeptId(String wsId, String teamId, String userId, String category, String method, boolean isUse) {
List<PALRepositoryModel> result = new ArrayList<>(); List<PALRepositoryModel> result = new ArrayList<>();
Set<String> versionIds = getPermRepositoryVersionIds(wsId, teamId, userId, category, method); Set<String> versionIds = getPermRepositoryVersionIds(wsId, teamId, userId, category, method);
for (String versionId : versionIds) { for (String versionId : versionIds) {
List<PALRepositoryModel> list = PALRepositoryCache.getByVersionId(versionId); List<PALRepositoryModel> list = PALRepositoryCache.getByVersionId(versionId);
if (list != null) { if (list != null) {
for (PALRepositoryModel model : list) { for (PALRepositoryModel model : list) {
if ((isUse && model.isUse()) || (isPublish && model.isPublish())) { if ((isUse && model.isUse())) {
result.add(model); result.add(model);
} }

View File

@ -92,7 +92,7 @@ function searchDataByDep() {
$.simpleAlert("正在查询", "loading", 3000, {model:true}); $.simpleAlert("正在查询", "loading", 3000, {model:true});
$("#tree").empty(); $("#tree").empty();
var params = { var params = {
versionType: versionType, versionType: "isPublished",
wsid: wsid, wsid: wsid,
teamId: teamId, teamId: teamId,
methodType: methodType, methodType: methodType,