bug编号00000043,角色图搜索,或者打开目录导致系统繁忙(角色图按照创建时间维度进行树组建)
This commit is contained in:
parent
1ce963fcf9
commit
129725cbd4
Binary file not shown.
@ -0,0 +1,937 @@
|
||||
package com.actionsoft.apps.coe.pal.pal.repository.util;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.sql.Timestamp;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
|
||||
import com.actionsoft.apps.coe.pal.constant.CoEConstant;
|
||||
import com.actionsoft.apps.coe.pal.cooperation.CoeCooperationAPIManager;
|
||||
import com.actionsoft.apps.coe.pal.cooperation.constant.CoeCooperationConst;
|
||||
import com.actionsoft.apps.coe.pal.pal.method.PALMethodManager;
|
||||
import com.actionsoft.apps.coe.pal.pal.method.cache.PALMethodCache;
|
||||
import com.actionsoft.apps.coe.pal.pal.method.model.PALMethodModel;
|
||||
import com.actionsoft.apps.coe.pal.pal.modelconvert.constant.ModelConvertConst;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.PALRepositoryQueryAPIManager;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryCache;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.dao.CoeProcessLevelDaoFacotory;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.dao.PALRepository;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryModel;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.web.CoeProcessLevelWeb;
|
||||
import com.actionsoft.apps.coe.pal.pal.ws.web.VersionUtil;
|
||||
import com.actionsoft.apps.coe.pal.util.HighSecurityUtil;
|
||||
import com.actionsoft.bpms.bpmn.engine.cache.ProcessDefCache;
|
||||
import com.actionsoft.bpms.bpmn.engine.model.def.ProcessDefinition;
|
||||
import com.actionsoft.bpms.bpmn.modeler.io.BPMNIO;
|
||||
import com.actionsoft.bpms.commons.htmlframework.HtmlPageTemplate;
|
||||
import com.actionsoft.bpms.commons.mvc.view.ResponseObject;
|
||||
import com.actionsoft.bpms.server.UserContext;
|
||||
import com.actionsoft.bpms.util.Base64;
|
||||
import com.actionsoft.bpms.util.UtilDate;
|
||||
import com.actionsoft.bpms.util.UtilFile;
|
||||
import com.actionsoft.bpms.util.UtilString;
|
||||
import com.actionsoft.i18n.I18nRes;
|
||||
import com.actionsoft.sdk.local.SDK;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
/**
|
||||
* 组织-角色模型相关工具方法
|
||||
*/
|
||||
public class OrgRoleModelUtil {
|
||||
|
||||
/**
|
||||
* PAL主页左侧树,查询组织-角色模型及之下的模型子节点
|
||||
* @param wsId
|
||||
* @param teamId
|
||||
* @param pid
|
||||
* @param createUsers
|
||||
* @param orgIds
|
||||
* @param methodIds
|
||||
* @return
|
||||
*/
|
||||
public static JSONArray getUsedPalRepositoryTreeDataByPid(UserContext uc, String wsId, String teamId, String pid, JSONArray createUserList, JSONArray orgIdList, JSONArray methodIdList) {
|
||||
Set<String> permVerIds = new HashSet<>();
|
||||
if (UtilString.isNotEmpty(teamId)) {// 提前查出来,避免后续多次查询
|
||||
permVerIds = CoeProcessLevelUtil.getPermRepositoryVersionIds(wsId, teamId, uc.getUID(), null, null);
|
||||
}
|
||||
if (UtilString.isNotEmpty(pid)) {
|
||||
if (pid.startsWith("date-year-")) {// 年份开头
|
||||
int year = Integer.parseInt(pid.substring(10, 14));
|
||||
String realPid = pid.substring(15);
|
||||
// System.out.println("pid=" + pid + ",year=" + year + ",realPid=" + realPid);
|
||||
PALRepositoryModel model = PALRepositoryCache.getCache().get(realPid);
|
||||
if (model != null) {
|
||||
List<String> months = getMonthList(uc, wsId, teamId, pid, createUserList, orgIdList, methodIdList, permVerIds, realPid, year);
|
||||
return list2Json(months, wsId, pid, realPid, model.getLevel() + 1, "month");
|
||||
}
|
||||
} else if (pid.startsWith("date-month-")) {// 月份开头
|
||||
int year = Integer.parseInt(pid.substring(11, 15));
|
||||
int month = Integer.parseInt(pid.substring(16, 18));
|
||||
String realPid = pid.substring(19);
|
||||
// System.out.println("pid=" + pid + ",year=" + year + ",month=" + month + ",realPid=" + realPid);
|
||||
PALRepositoryModel model = PALRepositoryCache.getCache().get(realPid);
|
||||
if (model != null) {
|
||||
List<PALRepositoryModel> tmpList = getModelListByMonth(uc, wsId, teamId, pid, createUserList, orgIdList, methodIdList, permVerIds, realPid, year, month);
|
||||
return list2Json(uc, tmpList, wsId, pid, model.getLevel() + 2);
|
||||
}
|
||||
} else if (pid.length() >= 36) {// 模型开头
|
||||
PALRepositoryModel model = PALRepositoryCache.getCache().get(pid);
|
||||
if (model != null) {
|
||||
List<String> years = getYearList(uc, wsId, teamId, pid, createUserList, orgIdList, methodIdList, permVerIds);
|
||||
return list2Json(years, wsId, pid, pid, model.getLevel(), "year");
|
||||
}
|
||||
}
|
||||
}
|
||||
return new JSONArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据月份获取模型列表
|
||||
* @param uc
|
||||
* @param wsId
|
||||
* @param teamId
|
||||
* @param pid
|
||||
* @param createUserList
|
||||
* @param orgIdList
|
||||
* @param methodIdList
|
||||
* @param permVerIds
|
||||
* @param realPid
|
||||
* @param year
|
||||
* @param month
|
||||
* @return
|
||||
*/
|
||||
private static List<PALRepositoryModel> getModelListByMonth(UserContext uc, String wsId, String teamId, String pid, JSONArray createUserList, JSONArray orgIdList, JSONArray methodIdList, Set<String> permVerIds, String realPid, int year, int month) {
|
||||
List<PALRepositoryModel> tmpList = getPermUseModels(uc, wsId, teamId, realPid, permVerIds);
|
||||
tmpList = PALFrameworkFilterUtil.filter(tmpList, createUserList, orgIdList, methodIdList);// 根据条件筛选过滤
|
||||
if (CollectionUtils.isNotEmpty(tmpList)) {
|
||||
Map<String, Timestamp> maxVersionMap = getPermMaxVersionMap(uc, wsId, teamId, realPid);// 获取以versionId以及最新创建时间为key和value的map
|
||||
// 按年份和月份筛选
|
||||
Map<String, Timestamp> tmpMap = maxVersionMap.entrySet().stream()
|
||||
.filter(entry -> {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(entry.getValue());
|
||||
return cal.get(Calendar.YEAR) == year && cal.get(Calendar.MONTH) + 1 == month;
|
||||
})
|
||||
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
|
||||
// 数据集中筛选掉不符合日期的
|
||||
tmpList = tmpList.stream()
|
||||
.filter(m -> tmpMap.containsKey(m.getVersionId()))
|
||||
.collect(Collectors.toList());
|
||||
// 数据集按照日期排序
|
||||
tmpList = tmpList.stream()
|
||||
.sorted(Comparator.comparing(m -> tmpMap.get(m.getVersionId())))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
return tmpList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据年份获取月份列表
|
||||
* @param uc
|
||||
* @param wsId
|
||||
* @param teamId
|
||||
* @param pid
|
||||
* @param createUserList
|
||||
* @param orgIdList
|
||||
* @param methodIdList
|
||||
* @param permVerIds
|
||||
* @param realPid
|
||||
* @param year
|
||||
* @return
|
||||
*/
|
||||
private static List<String> getMonthList(UserContext uc, String wsId, String teamId, String pid, JSONArray createUserList, JSONArray orgIdList, JSONArray methodIdList, Set<String> permVerIds, String realPid, int year) {
|
||||
List<String> months = new ArrayList<>();
|
||||
List<PALRepositoryModel> tmpList = getPermUseModels(uc, wsId, teamId, realPid, permVerIds);
|
||||
tmpList = PALFrameworkFilterUtil.filter(tmpList, createUserList, orgIdList, methodIdList);// 根据条件筛选过滤
|
||||
if (CollectionUtils.isNotEmpty(tmpList)) {
|
||||
Map<String, Timestamp> maxVersionMap = getPermMaxVersionMap(uc, wsId, teamId, realPid);// 获取以versionId以及最新创建时间为key和value的map
|
||||
// 按年份筛选
|
||||
Map<String, Timestamp> tmpMap = maxVersionMap.entrySet().stream()
|
||||
.filter(entry -> {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(entry.getValue());
|
||||
return cal.get(Calendar.YEAR) == year;
|
||||
})
|
||||
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
|
||||
// 数据集中筛选掉不符合日期的
|
||||
tmpList = tmpList.stream()
|
||||
.filter(m -> tmpMap.containsKey(m.getVersionId()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
Set<String> monthSet = getMonthsOptimized(tmpList, m -> tmpMap.get(m.getVersionId()));// 获取年份集合
|
||||
months = new ArrayList<>(monthSet);
|
||||
Collections.sort(months);
|
||||
}
|
||||
return months;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取年份列表
|
||||
* @param uc
|
||||
* @param wsId
|
||||
* @param teamId
|
||||
* @param pid
|
||||
* @param createUserList
|
||||
* @param orgIdList
|
||||
* @param methodIdList
|
||||
* @param permVerIds
|
||||
* @return
|
||||
*/
|
||||
private static List<String> getYearList(UserContext uc, String wsId, String teamId, String pid, JSONArray createUserList, JSONArray orgIdList, JSONArray methodIdList, Set<String> permVerIds) {
|
||||
List<String> years = new ArrayList<>();
|
||||
List<PALRepositoryModel> tmpList = getPermUseModels(uc, wsId, teamId, pid, permVerIds);
|
||||
tmpList = PALFrameworkFilterUtil.filter(tmpList, createUserList, orgIdList, methodIdList);// 根据条件筛选过滤
|
||||
if (CollectionUtils.isNotEmpty(tmpList)) {
|
||||
Map<String, Timestamp> maxVersionMap = getPermMaxVersionMap(uc, wsId, teamId, pid);// 获取以versionId以及最新创建时间为key和value的map
|
||||
Set<Integer> yearSet = getYearsOptimized(tmpList, m -> maxVersionMap.get(m.getVersionId()));// 获取年份集合
|
||||
years = yearSet.stream().map(String::valueOf).collect(Collectors.toList());
|
||||
Collections.sort(years);
|
||||
}
|
||||
return years;
|
||||
}
|
||||
|
||||
private static JSONArray list2Json(UserContext uc, List<PALRepositoryModel> list, String wsId, String pid, int level) {
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
for (PALRepositoryModel model : list) {
|
||||
JSONObject object = new JSONObject();
|
||||
object.put("id", model.getVersionId().trim());
|
||||
object.put("currId", model.getId());
|
||||
object.put("pid", pid);
|
||||
object.put("plNo", CoeProcessLevelUtil.getProcessLevelNoByUUId(model.getId(), model.getWsId()).trim());
|
||||
object.put("name", I18nRes.findValue(CoEConstant.APP_ID, uc.getLanguage(), model.getName()).trim());
|
||||
object.put("wsId", model.getWsId());
|
||||
object.put("isSystemFile", model.isSystemFile());
|
||||
object.put("plMethodId", model.getMethodId().trim());
|
||||
JSONObject icon = new JSONObject();
|
||||
object.put("folder", true);// 类型,文件夹
|
||||
if ("default".equals(model.getMethodId())) {// 默认文件夹
|
||||
JSONObject methodIcon = PALMethodManager.getInstance().getPALMethodIconById(model.getMethodId());
|
||||
if (methodIcon != null) {
|
||||
icon.put("icon", methodIcon.getString("code"));
|
||||
icon.put("color", methodIcon.getString("color"));
|
||||
}
|
||||
} else {// 非默认文件夹
|
||||
PALMethodModel methodModel = PALMethodCache.getPALMethodModelById(model.getMethodId());
|
||||
if (methodModel != null) {// 存在该建模方法
|
||||
if (methodModel.isFolder()) {// 文件夹类型扩展的建模方法
|
||||
|
||||
JSONObject methodIcon = PALMethodManager.getInstance().getPALMethodIconById(model.getMethodId());
|
||||
icon.put("icon", methodIcon.getString("code"));
|
||||
icon.put("color", methodIcon.getString("color"));
|
||||
} else {// 文件类型模型文件
|
||||
//判断如果是组织图,更换组织图图标
|
||||
if (methodModel.getId().equals("org.role") || methodModel.getId().equals("org.normal")) {
|
||||
icon.put("icon", "");
|
||||
icon.put("color", "#ef7b40");
|
||||
} else {
|
||||
icon.put("icon", "");
|
||||
icon.put("color", "#8E8E8E");
|
||||
}
|
||||
object.put("folder", false);// 非文件夹
|
||||
}
|
||||
}
|
||||
}
|
||||
if (icon.isEmpty()) {// 默认
|
||||
//判断如果是组织图,更换组织图图标
|
||||
if (model.getMethodId().equals("org.role") || model.getMethodId().equals("org.normal")) {
|
||||
icon.put("icon", "");
|
||||
icon.put("color", "#ef7b40");
|
||||
} else {
|
||||
icon.put("icon", "");
|
||||
icon.put("color", "#FFB718");
|
||||
}
|
||||
|
||||
}
|
||||
object.put("icon", icon);
|
||||
object.put("leaf", true);// 叶子节点
|
||||
object.put("childCount", 0);
|
||||
object.put("plLevel", model.getLevel());
|
||||
object.put("plOrdexIndex", model.getOrderIndex());
|
||||
object.put("plDiagramUrl", model.getDiagramUrl());
|
||||
object.put("isDrops", model.isSystemFile());
|
||||
object.put("isPublish", model.isPublish());
|
||||
object.put("isStop", model.isStop());
|
||||
object.put("isApproval", model.isApproval());
|
||||
object.put("ext1", model.getExt1());
|
||||
object.put("ext2", model.getExt2());
|
||||
object.put("ext3", model.getExt3());
|
||||
object.put("ext4", model.getExt4());
|
||||
object.put("isUse", model.isUse());
|
||||
object.put("plCategory", model.getMethodCategory());
|
||||
object.put("versionId", model.getVersionId());
|
||||
object.put("orderIndex", model.getOrderIndex());
|
||||
object.put("isBottomLevel", model.isBottomLevel());
|
||||
object.put("createUser", model.getCreateUser());
|
||||
object.put("modifyUser", model.getModifyUser());
|
||||
jsonArray.add(object);
|
||||
}
|
||||
return jsonArray;
|
||||
}
|
||||
|
||||
private static JSONArray list2Json(List<String> list, String wsId, String pid, String realPid, int plLevel, String type) {
|
||||
JSONArray result = new JSONArray();
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
String value = list.get(i);
|
||||
JSONObject object = new JSONObject();
|
||||
String id = "year".equals(type) ? createYearId(value, realPid) : createMonthId(value, realPid);
|
||||
object.put("id", id);
|
||||
object.put("currId", id);
|
||||
object.put("pid", pid);
|
||||
object.put("plNo", i + 1);
|
||||
object.put("name", value);
|
||||
object.put("wsId", wsId);
|
||||
object.put("isSystemFile", true);
|
||||
object.put("plMethodId", "default");
|
||||
object.put("isVirtual", true);// 虚拟节点
|
||||
JSONObject icon = new JSONObject();
|
||||
object.put("folder", true);// 类型,文件夹
|
||||
JSONObject methodIcon = PALMethodManager.getInstance().getPALMethodIconById("default");
|
||||
if (methodIcon != null) {
|
||||
icon.put("icon", methodIcon.getString("code"));
|
||||
icon.put("color", methodIcon.getString("color"));
|
||||
}
|
||||
object.put("icon", icon);
|
||||
object.put("leaf", false);// 非叶子节点
|
||||
object.put("childCount", 1);// 任意给个值
|
||||
List<PALRepositoryModel> children = null;
|
||||
|
||||
object.put("plLevel", plLevel);
|
||||
object.put("plOrdexIndex", i+1);
|
||||
object.put("plDiagramUrl", "");
|
||||
object.put("isDrops", false);
|
||||
object.put("isPublish", false);
|
||||
object.put("isStop", false);
|
||||
object.put("isApproval", false);
|
||||
object.put("isUse", true);
|
||||
object.put("ext1", "");
|
||||
object.put("ext2", "");
|
||||
object.put("ext3", "");
|
||||
object.put("ext4", "");
|
||||
object.put("plCategory", "org");
|
||||
object.put("versionId", id);
|
||||
object.put("orderIndex", i+1);
|
||||
object.put("isBottomLevel", false);
|
||||
object.put("createUser", "");
|
||||
object.put("modifyUser", "");
|
||||
result.add(object);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取年份集合
|
||||
* @param items
|
||||
* @param dateExtractor
|
||||
* @return
|
||||
* @param <T>
|
||||
*/
|
||||
public static <T> Set<Integer> getYearsOptimized(List<T> items, Function<T, Timestamp> extractor) {
|
||||
// 根据数据量自动选择处理方式
|
||||
final int PARALLEL_THRESHOLD = 5000;
|
||||
|
||||
if (items.size() > PARALLEL_THRESHOLD) {
|
||||
return items.parallelStream()
|
||||
.map(extractor)
|
||||
.filter(Objects::nonNull)
|
||||
.map(Timestamp::toLocalDateTime)
|
||||
.map(LocalDateTime::getYear)
|
||||
.collect(Collectors.toCollection(
|
||||
() -> new HashSet<>(items.size() / 2))); // 预分配大小
|
||||
} else {
|
||||
Set<Integer> years = new HashSet<>(items.size()); // 预分配
|
||||
for (T item : items) {
|
||||
Timestamp ts = extractor.apply(item);
|
||||
if (ts != null) {
|
||||
years.add(ts.toLocalDateTime().getYear());
|
||||
}
|
||||
}
|
||||
return years;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取月份集合
|
||||
* @param items
|
||||
* @param extractor
|
||||
* @return
|
||||
* @param <T>
|
||||
*/
|
||||
public static <T> Set<String> getMonthsOptimized(List<T> items, Function<T, Timestamp> extractor) {
|
||||
final int PARALLEL_THRESHOLD = 5000;
|
||||
|
||||
if (items.size() > PARALLEL_THRESHOLD) {
|
||||
return items.parallelStream()
|
||||
.map(extractor)
|
||||
.filter(Objects::nonNull)
|
||||
.map(Timestamp::toLocalDateTime)
|
||||
.map(dt -> String.format("%d-%02d", dt.getYear(), dt.getMonthValue()))
|
||||
.collect(Collectors.toCollection(
|
||||
() -> new HashSet<>(items.size() / 2)));
|
||||
} else {
|
||||
Set<String> months = new HashSet<>(items.size());
|
||||
for (T item : items) {
|
||||
Timestamp ts = extractor.apply(item);
|
||||
if (ts != null) {
|
||||
LocalDateTime dt = ts.toLocalDateTime();
|
||||
months.add(String.format("%d-%02d", dt.getYear(), dt.getMonthValue()));
|
||||
}
|
||||
}
|
||||
return months;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static List<PALRepositoryModel> getPermUseModels(UserContext uc, String wsId, String teamId, String pid, Set<String> permVerIds) {
|
||||
String categoryId = "org";
|
||||
List<PALRepositoryModel> list = new ArrayList<>();
|
||||
Set<String> ids = new HashSet<>();
|
||||
PALRepositoryCache.getAllChildrenModelsByPid(wsId, pid, list, ids);
|
||||
// 获取每个模型最新版本的列表
|
||||
if (UtilString.isEmpty(teamId)) {
|
||||
return list.stream().filter(m -> categoryId.equals(m.getMethodCategory()) && m.isUse()).collect(Collectors.toList());
|
||||
} else {
|
||||
List<PALRepositoryModel> result = new ArrayList<>();
|
||||
if (CollectionUtils.isNotEmpty(permVerIds)) {
|
||||
return list.stream().filter(m -> categoryId.equals(m.getMethodCategory()) && m.isUse() && permVerIds.contains(m.getVersionId())).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
/**
|
||||
* 获取“组织”下指定模型的子集
|
||||
* @param uc
|
||||
* @param wsId
|
||||
* @param teamId
|
||||
* @param pid
|
||||
* @return
|
||||
*/
|
||||
private static Map<String, Timestamp> getPermMaxVersionMap(UserContext uc, String wsId, String teamId, String pid) {
|
||||
String categoryId = "org";
|
||||
List<PALRepositoryModel> list = new ArrayList<>();
|
||||
Set<String> ids = new HashSet<>();
|
||||
PALRepositoryCache.getAllChildrenModelsByPid(wsId, pid, list, ids);
|
||||
// 获取每个模型最新版本的列表
|
||||
if (UtilString.isEmpty(teamId)) {
|
||||
return list.stream()
|
||||
.filter(m -> categoryId.equals(m.getMethodCategory()))
|
||||
.collect(Collectors.toMap(
|
||||
PALRepositoryModel::getVersionId,
|
||||
PALRepositoryModel::getCreateDate, // 直接取创建时间
|
||||
(existing, replacement) -> existing.after(replacement) ? existing : replacement
|
||||
|
||||
));
|
||||
} else {
|
||||
List<PALRepositoryModel> result = new ArrayList<>();
|
||||
// 获取权限versionIds
|
||||
Set<String> permVerIds = CoeProcessLevelUtil.getPermRepositoryVersionIds(wsId, teamId, uc.getUID(), null, null);
|
||||
if (CollectionUtils.isNotEmpty(permVerIds)) {
|
||||
return list.stream()
|
||||
.filter(m -> categoryId.equals(m.getMethodCategory()) && permVerIds.contains(m.getVersionId()))
|
||||
.collect(Collectors.toMap(
|
||||
PALRepositoryModel::getVersionId,
|
||||
PALRepositoryModel::getCreateDate,
|
||||
(existing, replacement) -> existing.after(replacement) ? existing : replacement
|
||||
|
||||
));
|
||||
}
|
||||
}
|
||||
return new HashMap<>();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 判断模型是否为组织-角色模型之下的角色模型
|
||||
* @param repositoryId
|
||||
* @return
|
||||
*/
|
||||
public static boolean isOrgRoleModel(String repositoryId) {
|
||||
if (UtilString.isNotEmpty(repositoryId)) {
|
||||
PALRepositoryModel model = PALRepositoryCache.getCache().get(repositoryId);
|
||||
if (model != null) {
|
||||
// 角色模型文件夹
|
||||
if ("org".equals(model.getMethodCategory()) && ("default".equals(model.getMethodId()) && "角色模型".equals(model.getName()))) {
|
||||
return true;
|
||||
}
|
||||
// 具体的角色图
|
||||
String pid = model.getParentId();
|
||||
PALRepositoryModel parentModel = PALRepositoryCache.getCache().get(pid);
|
||||
if (parentModel != null) {
|
||||
if ("org".equals(model.getMethodCategory()) && ("default".equals(parentModel.getMethodId()) && "角色模型".equals(parentModel.getName()))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (repositoryId.startsWith("date-")) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取组织-角色模型虚拟路径
|
||||
* @param repositoryId
|
||||
* @return
|
||||
*/
|
||||
public static JSONArray getOrgRoleModelVirtualPath(String id) {
|
||||
if (id.startsWith("date-year-")) {// 年份开头
|
||||
int year = Integer.parseInt(id.substring(10, 14));
|
||||
String realPid = id.substring(15);
|
||||
// System.out.println("pid=" + pid + ",year=" + year + ",realPid=" + realPid);
|
||||
JSONArray path = CoeProcessLevelUtil.getRepositoryPath(realPid);
|
||||
JSONObject yearObj = new JSONObject();
|
||||
yearObj.put("id", id);
|
||||
yearObj.put("name", year);
|
||||
yearObj.put("versionId", id);
|
||||
path.add(yearObj);
|
||||
return path;
|
||||
} else if (id.startsWith("date-month-")) {// 月份开头
|
||||
int year = Integer.parseInt(id.substring(11, 15));
|
||||
String month = id.substring(16, 18);
|
||||
String realPid = id.substring(19);
|
||||
JSONArray path = CoeProcessLevelUtil.getRepositoryPath(realPid);
|
||||
JSONObject yearObj = new JSONObject();
|
||||
String yearId = createYearId(year + "", realPid);
|
||||
yearObj.put("id", yearId);
|
||||
yearObj.put("name", year);
|
||||
yearObj.put("versionId", yearId);
|
||||
path.add(yearObj);
|
||||
JSONObject monthObj = new JSONObject();
|
||||
monthObj.put("id", id);
|
||||
monthObj.put("name", year + "-" + month);
|
||||
monthObj.put("versionId", id);
|
||||
path.add(monthObj);
|
||||
return path;
|
||||
} else if (isOrgRoleModel2(id)) {// 角色模型,是一个具体的角色模型,但是前面日期相关路径
|
||||
PALRepositoryModel model = PALRepositoryCache.getCache().get(id);
|
||||
List<PALRepositoryModel> list = PALRepositoryCache.getByVersionId(model.getVersionId());
|
||||
Map<String, Timestamp> map = list.stream()
|
||||
.collect(Collectors.toMap(
|
||||
PALRepositoryModel::getVersionId,
|
||||
PALRepositoryModel::getCreateDate, // 直接取创建时间
|
||||
(existing, replacement) -> existing.after(replacement) ? existing : replacement
|
||||
|
||||
));
|
||||
Timestamp ts = map.get(model.getVersionId());
|
||||
LocalDateTime localDateTime = ts.toLocalDateTime();
|
||||
String year = localDateTime.getYear() + "";// 年份
|
||||
int month = localDateTime.getMonthValue();
|
||||
|
||||
// 格式化为两位数月份
|
||||
String formattedMonth = String.format("%02d", month);// 月份
|
||||
JSONArray path = CoeProcessLevelUtil.getRepositoryPath(id);
|
||||
|
||||
JSONObject yearObj = new JSONObject();
|
||||
String yearId = createYearId(year, model.getParentId());
|
||||
yearObj.put("id", yearId);
|
||||
yearObj.put("name", year);
|
||||
yearObj.put("versionId", yearId);
|
||||
path.add(path.size() - 1, yearObj);
|
||||
JSONObject monthObj = new JSONObject();
|
||||
String monthId = createMonthId(year, formattedMonth, model.getParentId());
|
||||
monthObj.put("id", monthId);
|
||||
monthObj.put("name", year + "-" + formattedMonth);
|
||||
monthObj.put("versionId", monthId);
|
||||
path.add(path.size() -1, monthObj);
|
||||
return path;
|
||||
} else {
|
||||
return CoeProcessLevelUtil.getRepositoryPath(id);
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isOrgRoleModel2(String id) {
|
||||
PALRepositoryModel model = PALRepositoryCache.getCache().get(id);
|
||||
if (model != null) {
|
||||
String pid = model.getParentId();
|
||||
PALRepositoryModel parentModel = PALRepositoryCache.getCache().get(pid);
|
||||
if (parentModel != null) {
|
||||
if ("org".equals(model.getMethodCategory()) && ("default".equals(parentModel.getMethodId()) && "角色模型".equals(parentModel.getName()))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static String getPalRoleLevelRepositoryChildData(UserContext uc, String wsId, String teamId, String id, String createUsers, String orgIds, String methodIds) {
|
||||
JSONArray createUserList = UtilString.isNotEmpty(createUsers) ? JSONArray.parseArray(createUsers) : new JSONArray();
|
||||
JSONArray orgIdList = UtilString.isNotEmpty(orgIds) ? JSONArray.parseArray(orgIds) : new JSONArray();
|
||||
JSONArray methodIdList = UtilString.isNotEmpty(methodIds) ? JSONArray.parseArray(methodIds) : new JSONArray();
|
||||
ResponseObject ro = ResponseObject.newOkResponse();
|
||||
// 获取文件路径信息
|
||||
JSONArray repositoryPathData = getOrgRoleModelVirtualPath(id);
|
||||
ro.put("repositoryPathData", repositoryPathData);
|
||||
if (id.startsWith("date-year-") || id.startsWith("date-month-")) {
|
||||
// 获取当前文件信息
|
||||
JSONObject object = new JSONObject();
|
||||
object.put("index", 0);
|
||||
object.put("id", id);
|
||||
// object.put("pid", realPid);
|
||||
object.put("versionId", id);
|
||||
// object.put("name", year);
|
||||
object.put("methodId", "default");
|
||||
object.put("methodName", I18nRes.findValue(CoEConstant.APP_ID, "default"));
|
||||
object.put("folder", true);// 所有的模型建模方法都默认为文件夹类型
|
||||
object.put("isPublish", false);
|
||||
object.put("desc", "");
|
||||
object.put("isFavorite", false);
|
||||
object.put("updateUser", "");
|
||||
object.put("updateDate", "");
|
||||
JSONObject iconObj = PALMethodManager.getInstance().getPALMethodIconById("default");
|
||||
JSONObject icon = new JSONObject();
|
||||
icon.put("code", iconObj.getString("code"));
|
||||
icon.put("color", iconObj.getString("color"));
|
||||
object.put("icon", icon);
|
||||
//文件操作权限
|
||||
object.put("isOlderVersion", false);// 新旧版本权限
|
||||
object.put("havingWritePerm", false);// 新增、修改权限
|
||||
object.put("havingRemovePerm", false);// 删除权限
|
||||
object.put("havingVersionManagePerm", false);// 版本管理权限
|
||||
object.put("isVirtual", true);// 是否虚拟节点
|
||||
if (id.startsWith("date-year-")) {// 年份开头
|
||||
int year = Integer.parseInt(id.substring(10, 14));
|
||||
String realPid = id.substring(15);
|
||||
// System.out.println("pid=" + pid + ",year=" + year + ",realPid=" + realPid);
|
||||
object.put("pid", realPid);
|
||||
object.put("name", year);
|
||||
} else if (id.startsWith("date-month-")) {// 月份开头
|
||||
int year = Integer.parseInt(id.substring(11, 15));
|
||||
int month = Integer.parseInt(id.substring(16, 18));
|
||||
String realPid = id.substring(19);
|
||||
// System.out.println("pid=" + pid + ",year=" + year + ",realPid=" + realPid);
|
||||
object.put("pid", realPid);
|
||||
object.put("name", year + "-" + month);
|
||||
}
|
||||
ro.put("mainRepository", object);
|
||||
} else {
|
||||
PALRepositoryModel model = PALRepositoryCache.getCache().get(id);
|
||||
if (id.length() >= 36 && model == null) {
|
||||
return ResponseObject.newErrResponse("模型文件查询失败").toString();
|
||||
}
|
||||
int index = 0;
|
||||
// 获取当前文件路径
|
||||
if (UtilString.isNotEmpty(teamId)) {
|
||||
JSONArray tempArr = new JSONArray();
|
||||
// List<String> permVerIds = CoeCooperationAPIManager.getInstance().queryCooperationRoleDataPermByTeamUser(teamId, _uc.getUID());
|
||||
Set<String> permVerIds = CoeCooperationAPIManager.getInstance().getUserDataPermission(teamId, uc.getUID(), false);
|
||||
for (int i = 0; i < repositoryPathData.size(); i++) {
|
||||
JSONObject currObj = repositoryPathData.getJSONObject(i);
|
||||
String pathId = currObj.getString("id");
|
||||
if (pathId.length() < 36 || permVerIds.contains(currObj.getString("versionId"))) {
|
||||
tempArr.add(currObj);
|
||||
}
|
||||
}
|
||||
repositoryPathData = tempArr;
|
||||
}
|
||||
|
||||
ro.put("repositoryPathData", repositoryPathData);
|
||||
// 权限获取
|
||||
CoeCooperationAPIManager.getInstance().queryCooperationMemberActionPerm(teamId, uc.getUID(), ro);
|
||||
// 获取文件模型的图标icon
|
||||
JSONObject methodIcons = new JSONObject();
|
||||
JSONArray tableData = new JSONArray();
|
||||
if (id.length() >= 36) {
|
||||
JSONObject object = new JSONObject();
|
||||
object.put("index", index++);
|
||||
object.put("id", model.getId());
|
||||
object.put("pid", model.getParentId());
|
||||
object.put("versionId", model.getVersionId());
|
||||
object.put("name", model.getName());
|
||||
object.put("methodId", model.getMethodId());
|
||||
object.put("methodName", I18nRes.findValue(CoEConstant.APP_ID, model.getMethodId()));
|
||||
PALMethodModel methodModel = PALMethodCache.getPALMethodModelById(model.getMethodId());
|
||||
object.put("folder", true);// 所有的模型建模方法都默认为文件夹类型
|
||||
if (methodModel != null) {
|
||||
object.put("folder", methodModel.isFolder());
|
||||
}
|
||||
|
||||
object.put("isPublish", model.isPublish());
|
||||
object.put("desc", model.getDesc());
|
||||
object.put("isFavorite", CoeProcessLevelUtil.isCommonRepository(uc, wsId, model.getVersionId()));
|
||||
object.put("updateUser", SDK.getORGAPI().getUser(model.getModifyUser()) == null ? model.getModifyUser() : SDK.getORGAPI().getUser(model.getModifyUser()).getUserName());
|
||||
object.put("updateDate", UtilDate.datetimeFormat(model.getModifyDate()));
|
||||
if (!methodIcons.containsKey(model.getMethodId())) {
|
||||
JSONObject iconObj = PALMethodManager.getInstance().getPALMethodIconById(model.getMethodId());
|
||||
methodIcons.put(model.getMethodId(), iconObj);
|
||||
}
|
||||
JSONObject icon = new JSONObject();
|
||||
JSONObject iconObj = methodIcons.getJSONObject(model.getMethodId());
|
||||
icon.put("code", iconObj.getString("code"));
|
||||
icon.put("color", iconObj.getString("color"));
|
||||
object.put("icon", icon);
|
||||
//新版权限获取文件操作权限
|
||||
ResponseObject res = ResponseObject.newOkResponse();
|
||||
CoeCooperationAPIManager.getInstance().queryCooperationFileActionPerm(teamId, uc.getUID(), model.getVersionId(), res);
|
||||
Map data = (Map) res.getData();
|
||||
if (data != null && !data.isEmpty()) {
|
||||
object.put("isOlderVersion", false);// 新旧版本权限
|
||||
object.put("havingWritePerm", data.get("havingWritePerm"));// 新增、修改权限
|
||||
object.put("havingRemovePerm", data.get("havingRemovePerm"));// 删除权限
|
||||
object.put("havingVersionManagePerm", data.get("havingVersionManagePerm"));// 版本管理权限
|
||||
}
|
||||
ro.put("mainRepository", object);
|
||||
// tableData.add(object);
|
||||
}
|
||||
}
|
||||
|
||||
// 获取子文件列表
|
||||
int index = 0;
|
||||
// 权限获取
|
||||
Set<String> permVerIds = new HashSet<>();
|
||||
if (UtilString.isNotEmpty(teamId)) {// 提前查出来,避免后续多次查询
|
||||
permVerIds = CoeProcessLevelUtil.getPermRepositoryVersionIds(wsId, teamId, uc.getUID(), null, null);
|
||||
}
|
||||
// 获取文件模型的图标icon
|
||||
JSONObject methodIcons = new JSONObject();
|
||||
JSONArray tableData = new JSONArray();
|
||||
if (id.startsWith("date-year-")) {// 年份开头,获取月份列表
|
||||
int year = Integer.parseInt(id.substring(10, 14));
|
||||
String realPid = id.substring(15);
|
||||
// System.out.println("pid=" + pid + ",year=" + year + ",realPid=" + realPid);
|
||||
List<String> monthList = getMonthList(uc, wsId, teamId, id, createUserList, orgIdList, methodIdList, permVerIds, realPid, year);
|
||||
for (String month : monthList) {
|
||||
JSONObject subObj = new JSONObject();
|
||||
subObj.put("index", index++);
|
||||
String monthId = createMonthId(month, realPid);
|
||||
subObj.put("id", monthId);
|
||||
subObj.put("pid", id);
|
||||
subObj.put("wsId", wsId);
|
||||
subObj.put("versionId", monthId);
|
||||
subObj.put("name", month);
|
||||
subObj.put("category", "org");
|
||||
subObj.put("methodId", "default");
|
||||
subObj.put("methodName", I18nRes.findValue(CoEConstant.APP_ID, "default"));
|
||||
subObj.put("folder", true);// 所有的模型建模方法都默认为文件夹类型
|
||||
|
||||
subObj.put("childSize", 1);// 子节点个数
|
||||
subObj.put("desc", "");
|
||||
subObj.put("isFavorite", false);
|
||||
subObj.put("updateUser", "");
|
||||
subObj.put("updateDate", "");
|
||||
JSONObject subIconObj = PALMethodManager.getInstance().getPALMethodIconById("default");
|
||||
JSONObject subIcon = new JSONObject();
|
||||
subIcon.put("code", subIconObj.getString("code"));
|
||||
subIcon.put("color", subIconObj.getString("color"));
|
||||
subObj.put("icon", subIcon);
|
||||
subObj.put("isVirtual", true);// 是否虚拟节点
|
||||
// 子文件列表展示版本信息与状态信息 此处版本信息的逻辑是参考的版本管理
|
||||
JSONObject versionStatus = new JSONObject();
|
||||
versionStatus.put("id", monthId);
|
||||
versionStatus.put("isUse", true);
|
||||
versionStatus.put("isPublish", false);
|
||||
versionStatus.put("isStop", false);
|
||||
versionStatus.put("isApproval", false);
|
||||
versionStatus.put("versionNo", "");
|
||||
versionStatus.put("name", month);
|
||||
subObj.put("versionStatus", versionStatus);
|
||||
subObj.put("createUser", "");
|
||||
subObj.put("modifyUser", "");
|
||||
//新版权限获取文件操作权限
|
||||
subObj.put("isOlderVersion", false);// 新旧版本权限
|
||||
subObj.put("havingWritePerm", false);// 新增、修改权限
|
||||
subObj.put("havingRemovePerm", false);// 删除权限
|
||||
subObj.put("havingVersionManagePerm", false);// 版本管理权限
|
||||
tableData.add(subObj);
|
||||
}
|
||||
} else if (id.startsWith("date-month-")) {// 根据月份获取模型列表
|
||||
int year = Integer.parseInt(id.substring(11, 15));
|
||||
int month = Integer.parseInt(id.substring(16, 18));
|
||||
String realPid = id.substring(19);
|
||||
// System.out.println("pid=" + pid + ",year=" + year + ",realPid=" + realPid);
|
||||
List<PALRepositoryModel> subList = getModelListByMonth(uc, wsId, teamId, id, createUserList, orgIdList, methodIdList, permVerIds, realPid, year, month);
|
||||
for (PALRepositoryModel subModel : subList) {
|
||||
JSONObject subObj = new JSONObject();
|
||||
subObj.put("index", index++);
|
||||
subObj.put("id", subModel.getId());
|
||||
subObj.put("pid", subModel.getParentId());
|
||||
subObj.put("wsId", subModel.getWsId());
|
||||
subObj.put("versionId", subModel.getVersionId());
|
||||
subObj.put("name", subModel.getName());
|
||||
subObj.put("category", subModel.getMethodCategory());
|
||||
subObj.put("methodId", subModel.getMethodId());
|
||||
subObj.put("methodName", I18nRes.findValue(CoEConstant.APP_ID, subModel.getMethodId()));
|
||||
PALMethodModel methodModel = PALMethodCache.getPALMethodModelById(subModel.getMethodId());
|
||||
subObj.put("folder", true);// 所有的模型建模方法都默认为文件夹类型
|
||||
if (methodModel != null) {
|
||||
subObj.put("folder", methodModel.isFolder());
|
||||
}
|
||||
subObj.put("childSize", 0);// 子节点个数
|
||||
subObj.put("desc", subModel.getDesc());
|
||||
subObj.put("isFavorite", CoeProcessLevelUtil.isCommonRepository(uc, wsId, subModel.getVersionId()));
|
||||
subObj.put("updateUser", SDK.getORGAPI().getUser(subModel.getModifyUser()) == null ? subModel.getModifyUser() : SDK.getORGAPI().getUser(subModel.getModifyUser()).getUserName());
|
||||
subObj.put("updateDate", UtilDate.datetimeFormat(subModel.getModifyDate()));
|
||||
if (!methodIcons.containsKey(subModel.getMethodId())) {
|
||||
JSONObject subIconObj = PALMethodManager.getInstance().getPALMethodIconById(subModel.getMethodId());
|
||||
methodIcons.put(subModel.getMethodId(), subIconObj);
|
||||
}
|
||||
JSONObject subIcon = new JSONObject();
|
||||
JSONObject subIconObj = methodIcons.getJSONObject(subModel.getMethodId());
|
||||
subIcon.put("code", subIconObj.getString("code"));
|
||||
subIcon.put("color", subIconObj.getString("color"));
|
||||
subObj.put("icon", subIcon);
|
||||
|
||||
// 子文件列表展示版本信息与状态信息 此处版本信息的逻辑是参考的版本管理
|
||||
JSONObject versionStatus = new JSONObject();
|
||||
boolean isCorrelateBpms = PALRepositoryQueryAPIManager.getInstance().isCorrelateBpms(subModel.getId(), true);
|
||||
if (isCorrelateBpms) {// 与bpm平台关联流程
|
||||
String processDefId = PALRepositoryQueryAPIManager.getInstance().queryBpmsProcessDefIdByPalId(subModel.getId(), true);
|
||||
String appId = ProcessDefCache.getInstance().get(processDefId).getAppId();
|
||||
List<ProcessDefinition> versionList = ProcessDefCache.getInstance().getListOfProcessVersion(appId, processDefId);
|
||||
for (ProcessDefinition processDefinition : versionList) {
|
||||
String plId = PALRepositoryQueryAPIManager.getInstance().queryPlIdByPlAwsId(processDefinition.getId());
|
||||
if (UtilString.isEmpty(plId)) {
|
||||
continue;
|
||||
}
|
||||
PALRepositoryModel m = PALRepositoryCache.getCache().get(plId);
|
||||
if (!m.isUse())
|
||||
continue;
|
||||
versionStatus.put("versionNo", VersionUtil.getVersionStrV(processDefinition.getVersionNo()));
|
||||
versionStatus.put("name", processDefinition.getName());
|
||||
versionStatus.put("isUse", m.isUse());
|
||||
versionStatus.put("isPublish", m.isPublish());
|
||||
versionStatus.put("isStop", m.isStop());
|
||||
versionStatus.put("isApproval", m.isApproval());
|
||||
versionStatus.put("id", m.getId());
|
||||
}
|
||||
} else { // pal自身文件
|
||||
PALRepositoryModel m = PALRepositoryCache.getCache().get(subModel.getId());
|
||||
List<PALRepositoryModel> versions = PALRepositoryCache.getByVersionId(m.getVersionId());
|
||||
for (PALRepositoryModel mo : versions) {
|
||||
if (mo != null && mo.isUse()) {
|
||||
versionStatus.put("id", mo.getId());
|
||||
versionStatus.put("isUse", mo.isUse());
|
||||
versionStatus.put("isPublish", mo.isPublish());
|
||||
versionStatus.put("isStop", mo.isStop());
|
||||
versionStatus.put("isApproval", mo.isApproval());
|
||||
versionStatus.put("versionNo", VersionUtil.getVersionStrV(mo.getVersion()));
|
||||
versionStatus.put("name", mo.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
subObj.put("versionStatus", versionStatus);
|
||||
subObj.put("createUser", subModel.getCreateUser());
|
||||
subObj.put("modifyUser", subModel.getModifyUser());
|
||||
//新版权限获取文件操作权限
|
||||
ResponseObject res = ResponseObject.newOkResponse();
|
||||
CoeCooperationAPIManager.getInstance().queryCooperationFileActionPerm(teamId, uc.getUID(), subModel.getVersionId(), res);
|
||||
Map data = (Map) res.getData();
|
||||
if (data != null && !data.isEmpty()) {
|
||||
subObj.put("isOlderVersion", false);// 新旧版本权限
|
||||
subObj.put("havingWritePerm", data.get("havingWritePerm"));// 新增、修改权限
|
||||
subObj.put("havingRemovePerm", data.get("havingRemovePerm"));// 删除权限
|
||||
subObj.put("havingVersionManagePerm", data.get("havingVersionManagePerm"));// 版本管理权限
|
||||
}
|
||||
tableData.add(subObj);
|
||||
}
|
||||
} else {
|
||||
// 获取年份列表
|
||||
List<String> yearList = getYearList(uc, wsId, teamId, id, createUserList, orgIdList, methodIdList, permVerIds);
|
||||
for (String year : yearList) {
|
||||
JSONObject subObj = new JSONObject();
|
||||
subObj.put("index", index++);
|
||||
String yearId = createYearId(year, id);
|
||||
subObj.put("id", yearId);
|
||||
subObj.put("pid", id);
|
||||
subObj.put("wsId", wsId);
|
||||
subObj.put("versionId", yearId);
|
||||
subObj.put("name", year);
|
||||
subObj.put("category", "org");
|
||||
subObj.put("methodId", "default");
|
||||
subObj.put("methodName", I18nRes.findValue(CoEConstant.APP_ID, "default"));
|
||||
subObj.put("folder", true);// 所有的模型建模方法都默认为文件夹类型
|
||||
|
||||
subObj.put("childSize", 1);// 子节点个数
|
||||
subObj.put("desc", "");
|
||||
subObj.put("isFavorite", false);
|
||||
subObj.put("updateUser", "");
|
||||
subObj.put("updateDate", "");
|
||||
JSONObject subIconObj = PALMethodManager.getInstance().getPALMethodIconById("default");
|
||||
JSONObject subIcon = new JSONObject();
|
||||
subIcon.put("code", subIconObj.getString("code"));
|
||||
subIcon.put("color", subIconObj.getString("color"));
|
||||
subObj.put("icon", subIcon);
|
||||
subObj.put("isVirtual", true);// 是否虚拟节点
|
||||
// 子文件列表展示版本信息与状态信息 此处版本信息的逻辑是参考的版本管理
|
||||
JSONObject versionStatus = new JSONObject();
|
||||
versionStatus.put("id", yearId);
|
||||
versionStatus.put("isUse", true);
|
||||
versionStatus.put("isPublish", false);
|
||||
versionStatus.put("isStop", false);
|
||||
versionStatus.put("isApproval", false);
|
||||
versionStatus.put("versionNo", "");
|
||||
versionStatus.put("name", year);
|
||||
subObj.put("versionStatus", versionStatus);
|
||||
subObj.put("createUser", "");
|
||||
subObj.put("modifyUser", "");
|
||||
//新版权限获取文件操作权限
|
||||
subObj.put("isOlderVersion", false);// 新旧版本权限
|
||||
subObj.put("havingWritePerm", false);// 新增、修改权限
|
||||
subObj.put("havingRemovePerm", false);// 删除权限
|
||||
subObj.put("havingVersionManagePerm", false);// 版本管理权限
|
||||
tableData.add(subObj);
|
||||
}
|
||||
}
|
||||
// 串联分析应用是否安装
|
||||
ro.put("processLinkInstall", false);
|
||||
// 流程手册应用是否安装
|
||||
ro.put("outputPrInstall", false);
|
||||
// 预览应用是否安装
|
||||
ro.put("onlineDocInstall", false);
|
||||
|
||||
ro.put("isClickTreeRoot", false);
|
||||
ro.put("category", "org");
|
||||
// 模型转换应用是否安装
|
||||
ro.put("modelConvertInstall", false);
|
||||
// 端到端应用是否安装
|
||||
ro.put("subProcessAppVisible", false);
|
||||
// 流程批处理是否显示
|
||||
boolean batchAppVisible = false;
|
||||
String batchDlg = "";
|
||||
ro.put("batchAppVisible", batchAppVisible);
|
||||
ro.put("batchDlg", batchDlg);
|
||||
ro.put("tableData", tableData);
|
||||
return ro.toString();
|
||||
}
|
||||
|
||||
private static String createYearId(String year, String realPid) {
|
||||
return "date-year-" + year + "-" + realPid;
|
||||
}
|
||||
|
||||
private static String createMonthId(String year, String month, String realPid) {
|
||||
return "date-month-" + year + "-" + month + "-" + realPid;
|
||||
}
|
||||
|
||||
private static String createMonthId(String month, String realPid) {
|
||||
return "date-month-" + month + "-" + realPid;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取模型详情
|
||||
* @param uc
|
||||
* @param wsId
|
||||
* @param teamId
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public static String getPalProcessLevelRepositoryDetailData(UserContext uc, String wsId, String teamId, String id) {
|
||||
ResponseObject ro = ResponseObject.newOkResponse();
|
||||
ro.put("isVirtual", true);
|
||||
return ro.toString();
|
||||
}
|
||||
}
|
||||
@ -30,6 +30,7 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.util.OrgRoleModelUtil;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.util.PALFrameworkFilterUtil;
|
||||
import com.actionsoft.bpms.bo.engine.BO;
|
||||
import com.actionsoft.bpms.commons.formfile.model.delegate.FormFile;
|
||||
@ -5029,7 +5030,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
for (PALRepositoryModel model : list) {
|
||||
List<String> names = new ArrayList<>();
|
||||
List<String> path = new ArrayList<>();
|
||||
JSONArray repositoryPathData = CoeProcessLevelUtil.getRepositoryPath(model.getId());
|
||||
JSONArray repositoryPathData = OrgRoleModelUtil.getOrgRoleModelVirtualPath(model.getId());
|
||||
// 前面大类不显示,根据小组进行级别处理
|
||||
for (int i = 0; i < repositoryPathData.size(); i++) {
|
||||
JSONObject currObj = repositoryPathData.getJSONObject(i);
|
||||
@ -5039,6 +5040,9 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
path.add(currModel.getVersionId());
|
||||
} else if (currObj.getString("id").length() < 36) {
|
||||
path.add(currObj.getString("id"));
|
||||
} else if (OrgRoleModelUtil.isOrgRoleModel(currObj.getString("id"))) {
|
||||
names.add(currObj.getString("name"));
|
||||
path.add(currObj.getString("id"));
|
||||
}
|
||||
}
|
||||
JSONObject object = new JSONObject();
|
||||
@ -5267,7 +5271,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
resultObj.put("name", model.getName());
|
||||
resultObj.put("methodId", model.getMethodId());
|
||||
resultObj.put("versionId", model.getVersionId());
|
||||
JSONArray repositoryPathData = CoeProcessLevelUtil.getRepositoryPath(model.getId());
|
||||
JSONArray repositoryPathData = OrgRoleModelUtil.getOrgRoleModelVirtualPath(model.getId());
|
||||
List<String> pathList = new ArrayList<>();
|
||||
for (int i = 0; i < repositoryPathData.size(); i++) {
|
||||
pathList.add(repositoryPathData.getJSONObject(i).getString("versionId"));
|
||||
@ -8317,6 +8321,10 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
JSONArray createUserList = UtilString.isNotEmpty(createUsers) ? JSONArray.parseArray(createUsers) : new JSONArray();
|
||||
JSONArray orgIdList = UtilString.isNotEmpty(orgIds) ? JSONArray.parseArray(orgIds) : new JSONArray();
|
||||
JSONArray methodIdList = UtilString.isNotEmpty(methodIds) ? JSONArray.parseArray(methodIds) : new JSONArray();
|
||||
if (OrgRoleModelUtil.isOrgRoleModel(pid)) {// 组织-角色模型单独查询
|
||||
ro.setData(OrgRoleModelUtil.getUsedPalRepositoryTreeDataByPid(_uc, wsId, teamId, pid, createUserList, orgIdList, methodIdList));
|
||||
return ro.toString();
|
||||
}
|
||||
JSONArray result = PALRepositoryQueryAPIManager.getInstance().getUsedPalRepositoryTreeDataByPidNew(_uc, wsId, teamId, pid);
|
||||
|
||||
// 架构过滤
|
||||
@ -10619,6 +10627,9 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
* @return
|
||||
*/
|
||||
public String getPalProcessLevelRepositoryChildData(String wsId, String teamId, String id, String createUsers, String orgIds, String methodIds) {
|
||||
if (OrgRoleModelUtil.isOrgRoleModel(id)) {// 组织-角色模型单独处理
|
||||
return OrgRoleModelUtil.getPalRoleLevelRepositoryChildData(_uc, wsId, teamId, id, createUsers, orgIds, methodIds);
|
||||
}
|
||||
ResponseObject ro = ResponseObject.newOkResponse();
|
||||
// 获取当前文件信息
|
||||
PALRepository coeProcessLevel = CoeProcessLevelDaoFacotory.createCoeProcessLevel();
|
||||
@ -11019,6 +11030,9 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
* @return
|
||||
*/
|
||||
public String getPalProcessLevelRepositoryDetailData(String wsId, String teamId, String id) {
|
||||
if (OrgRoleModelUtil.isOrgRoleModel(id)) {
|
||||
return OrgRoleModelUtil.getPalProcessLevelRepositoryDetailData(_uc, wsId, teamId, id);
|
||||
}
|
||||
PALRepositoryModel model = PALRepositoryCache.getCache().get(id);
|
||||
if (model == null) {
|
||||
return ResponseObject.newErrResponse("模型文件查询失败").toString();
|
||||
|
||||
@ -13,4 +13,4 @@
|
||||
var mainType = "<#mainType>";
|
||||
var uid = "<#uid>";
|
||||
var wHref = "./w";
|
||||
var jdHref = "./jd";</script><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-000a72de.ef0a5aa8.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-1183d26a.c5c7126f.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-37cfda4c.283a9f57.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-4c9d1ae3.dbfe5264.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-4f4c2e05.d3570084.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-60212f14.adde4cab.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-629d0f3f.cf3ea8d1.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-aa4b8a60.38619268.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-c9eae4cc.e55cad48.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-000a72de.4c8508e9.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-1183d26a.f9062ed8.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-2d0ab156.31c0b86a.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-2d0f078a.25ac9a98.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-2d212b99.36769e0d.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-2d216d3a.934e0ebd.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-2d224b23.2293ea1b.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-2d224ef1.5a3f5338.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-3178e2bf.c29081dd.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-37cfda4c.f5dec896.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-3a9b7577.d0fe904b.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-4c9d1ae3.3582e5a9.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-4f4c2e05.d3ca43d3.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-60212f14.f776f6dd.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-629d0f3f.2867cbfa.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-aa4b8a60.2d2dc5ff.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-c9eae4cc.edb88981.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/app.64a72b43.css rel=preload as=style><link href=../apps/com.actionsoft.apps.coe.pal/main/js/app.782c46ef.js rel=preload as=script><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-vendors.2e024dfd.js rel=preload as=script><link href=../apps/com.actionsoft.apps.coe.pal/main/css/app.64a72b43.css rel=stylesheet></head><body style=margin:0;><div id=app></div><script src=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-vendors.2e024dfd.js></script><script src=../apps/com.actionsoft.apps.coe.pal/main/js/app.782c46ef.js></script></body></html>
|
||||
var jdHref = "./jd";</script><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-000a72de.ef0a5aa8.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-1183d26a.c5c7126f.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-37cfda4c.283a9f57.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-4c9d1ae3.dbfe5264.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-4f4c2e05.d3570084.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-60212f14.adde4cab.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-9f49d6ae.07bd2af2.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-aa4b8a60.38619268.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/chunk-c9eae4cc.e55cad48.css rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-000a72de.4c8508e9.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-1183d26a.f9062ed8.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-2d0ab156.31c0b86a.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-2d0f078a.25ac9a98.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-2d212b99.36769e0d.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-2d216d3a.934e0ebd.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-2d224b23.2293ea1b.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-2d224ef1.5a3f5338.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-3178e2bf.c29081dd.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-37cfda4c.f5dec896.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-3a9b7577.d0fe904b.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-4c9d1ae3.3582e5a9.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-4f4c2e05.d3ca43d3.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-60212f14.f776f6dd.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-9f49d6ae.8adbb2be.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-aa4b8a60.2d2dc5ff.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-c9eae4cc.edb88981.js rel=prefetch><link href=../apps/com.actionsoft.apps.coe.pal/main/css/app.64a72b43.css rel=preload as=style><link href=../apps/com.actionsoft.apps.coe.pal/main/js/app.85ebeda4.js rel=preload as=script><link href=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-vendors.2e024dfd.js rel=preload as=script><link href=../apps/com.actionsoft.apps.coe.pal/main/css/app.64a72b43.css rel=stylesheet></head><body style=margin:0;><div id=app></div><script src=../apps/com.actionsoft.apps.coe.pal/main/js/chunk-vendors.2e024dfd.js></script><script src=../apps/com.actionsoft.apps.coe.pal/main/js/app.85ebeda4.js></script></body></html>
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user