feat: 架构筛选 方法重构
每个目录节点下存在的子节点(文件类型)必须同时满足三个条件(如果条件存在) 目录节点才会保留
This commit is contained in:
parent
12f1d4fd7c
commit
9e2102a5eb
Binary file not shown.
@ -0,0 +1,317 @@
|
||||
package com.actionsoft.apps.coe.pal.pal.repository.util;
|
||||
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryCache;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.cache.DesignerShapeRelationCache;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.model.DesignerShapeRelationModel;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryModel;
|
||||
import com.actionsoft.bpms.org.model.DepartmentModel;
|
||||
import com.actionsoft.sdk.local.SDK;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author oYang
|
||||
* @Description PAL 左侧目录树 架构过滤 工具类
|
||||
* @createTime 2024年12月23日 16:15:00
|
||||
*/
|
||||
public class PALFrameworkFilterUtil {
|
||||
|
||||
static class Node {
|
||||
private String wsId; // 资产库ID
|
||||
private String id; // 模型ID
|
||||
private String versionId; // 版本ID
|
||||
private String pid;
|
||||
private String name; // 模型名称
|
||||
private String category;
|
||||
private String methodId; // 模型类型 default | framework | 建模
|
||||
private String createUser;
|
||||
private String modifyUser;
|
||||
|
||||
public Node(String wsId, String id, String versionId, String pid, String name, String category, String methodId, String createUser, String modifyUser) {
|
||||
this.wsId = wsId;
|
||||
this.id = id;
|
||||
this.versionId = versionId;
|
||||
this.pid = pid;
|
||||
this.name = name;
|
||||
this.category = category;
|
||||
this.methodId = methodId;
|
||||
this.createUser = createUser;
|
||||
this.modifyUser = modifyUser;
|
||||
}
|
||||
|
||||
public String getWsId() {
|
||||
return wsId;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getVersionId() {
|
||||
return versionId;
|
||||
}
|
||||
|
||||
public String getPid() {
|
||||
return pid;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getCategory() {
|
||||
return category;
|
||||
}
|
||||
|
||||
public String getMethodId() {
|
||||
return methodId;
|
||||
}
|
||||
|
||||
public String getCreateUser() {
|
||||
return createUser;
|
||||
}
|
||||
|
||||
public String getModifyUser() {
|
||||
return modifyUser;
|
||||
}
|
||||
}
|
||||
|
||||
public static Node transform(PALRepositoryModel model) {
|
||||
return new Node(model.getWsId(), model.getId(), model.getVersionId(), model.getNewParentId(), model.getName(), model.getMethodCategory(), model.getMethodId(), model.getCreateUser(), model.getModifyUser());
|
||||
}
|
||||
|
||||
public static Node transform(JSONObject model){
|
||||
return new Node(model.getString("wsId"), model.containsKey("currId") ? model.getString("currId") : model.getString("id"), model.getString("versionId"), model.getString("pid"), model.getString("name"), model.getString("plCategory"), model.getString("plMethodId"), model.getString("createUser"), model.getString("modifyUser"));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 架构过滤
|
||||
* @param dataArray 数据集合
|
||||
* @param createUserList 勾选的创建人集合
|
||||
* @param orgIdList 勾选的部门ID集合
|
||||
* @param methodIdList 勾选的建模方法集合
|
||||
* @return
|
||||
*/
|
||||
public static JSONArray filter(JSONArray dataArray, JSONArray createUserList, JSONArray orgIdList, JSONArray methodIdList) {
|
||||
|
||||
Set<String> orgIds = getOrgIds(orgIdList);
|
||||
|
||||
// 1、过滤掉空文件或者空架构
|
||||
dataArray = filterEmpty(dataArray);
|
||||
|
||||
// 2、根据创建人、组织、建模方法过滤
|
||||
Set<String> setOfId = dataArray.stream()
|
||||
.map(model -> transform((JSONObject) model))
|
||||
.filter(node -> {
|
||||
if ("org".equals(node.getCategory()) || "itsystem.normal".equals(node.getMethodId())) {
|
||||
return true;
|
||||
}
|
||||
return filter(node, createUserList, orgIds, methodIdList);
|
||||
})
|
||||
.map(Node::getId)
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
return dataArray.stream().map(obj -> (JSONObject)obj).filter(obj -> setOfId.stream().anyMatch(id -> id.equals(obj.containsKey("currId") ? obj.getString("currId") : obj.getString("id")))).collect(Collectors.toCollection(JSONArray::new));
|
||||
}
|
||||
|
||||
/**
|
||||
* 架构过滤
|
||||
* @param list 数据集合
|
||||
* @param createUserList 勾选的创建人集合
|
||||
* @param orgIdList 勾选的部门ID集合
|
||||
* @param methodIdList 勾选的建模方法集合
|
||||
* @return
|
||||
*/
|
||||
public static List<PALRepositoryModel> filter(List<PALRepositoryModel> list, JSONArray createUserList, JSONArray orgIdList, JSONArray methodIdList) {
|
||||
|
||||
Set<String> orgIds = getOrgIds(orgIdList);
|
||||
|
||||
// 1、过滤掉空文件或者空架构
|
||||
list = filterEmpty(list);
|
||||
|
||||
// 2、根据创建人、组织、建模方法过滤
|
||||
Set<String> setOfId = list.stream()
|
||||
.map(model -> transform(model))
|
||||
.filter(node -> {
|
||||
if ("org".equals(node.getCategory()) || "itsystem.normal".equals(node.getMethodId())) {
|
||||
return true;
|
||||
}
|
||||
return filter(node, createUserList, orgIds, methodIdList);
|
||||
})
|
||||
.map(Node::getId)
|
||||
.collect(Collectors.toSet());
|
||||
// 3、根据 nodeList 过滤 list
|
||||
return list.stream().filter(model -> setOfId.stream().anyMatch(id -> id.equals(model.getId()))).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 节点过滤
|
||||
* @param node 节点信息
|
||||
* @param createUserList 创建人列表
|
||||
* @param orgIdList 组织列表
|
||||
* @param methodIdList 建模方法列表
|
||||
* @return true:符合 false:不符合
|
||||
*/
|
||||
public static boolean filter(Node node, JSONArray createUserList, Set<String> orgIdList, JSONArray methodIdList){
|
||||
boolean exist = false;
|
||||
// 文件节点直接判断 符合直接保留
|
||||
if (!("process.framework".equals(node.getMethodId()) || "default".equals(node.getMethodId()))){
|
||||
exist = predicateCondition(node, createUserList, orgIdList, methodIdList);
|
||||
if (exist){
|
||||
return exist;
|
||||
}
|
||||
}
|
||||
|
||||
// 非文件节点 或者 文件节点下子节点
|
||||
Iterator<PALRepositoryModel> iterator = PALRepositoryCache.getByPid(node.getWsId(), node.getVersionId());
|
||||
while (iterator.hasNext()){
|
||||
Node childNode = transform(iterator.next());
|
||||
exist = filter(childNode, createUserList, orgIdList, methodIdList);
|
||||
if (exist){
|
||||
return exist;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 节点过滤条件 保证同时满足三个条件
|
||||
* @param node 节点信息
|
||||
* @param createUserList 创建人集合
|
||||
* @param orgIdList 组织集合
|
||||
* @param methodIdList 建模方法集合
|
||||
* @return Boolean
|
||||
*/
|
||||
public static boolean predicateCondition(Node node, JSONArray createUserList, Set<String> orgIdList, JSONArray methodIdList){
|
||||
// 创建人条件
|
||||
boolean createUserCondition = false;
|
||||
if (CollectionUtils.isEmpty(createUserList)){
|
||||
createUserCondition = true;
|
||||
}else {
|
||||
createUserCondition = createUserList.contains(node.getCreateUser()) || createUserList.contains(node.getModifyUser());
|
||||
}
|
||||
boolean publishDeptCondition = false;
|
||||
if (CollectionUtils.isEmpty(orgIdList)){
|
||||
publishDeptCondition = true;
|
||||
}else {
|
||||
List<DesignerShapeRelationModel> relationModels = DesignerShapeRelationCache.getByFileId(node.getId(), "Issuing_department");
|
||||
// 是否有发布部门的文件属性【可能会有多个值】
|
||||
if (CollectionUtils.isNotEmpty(relationModels)) {
|
||||
for (DesignerShapeRelationModel relationModel : relationModels) {
|
||||
JSONObject relationObj = JSONObject.parseObject(relationModel.getRelationShapeText());
|
||||
String deptId = relationObj.getString("id");
|
||||
publishDeptCondition = orgIdList.contains(deptId);
|
||||
if (publishDeptCondition)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
boolean methodIdCondition = false;
|
||||
if (CollectionUtils.isEmpty(methodIdList)){
|
||||
methodIdCondition = true;
|
||||
}else {
|
||||
methodIdCondition = methodIdList.contains(node.getMethodId());
|
||||
}
|
||||
return createUserCondition && publishDeptCondition && methodIdCondition;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有子部门ID
|
||||
* @param orgIdList 勾选的组织ID集合
|
||||
* @return Set<String>
|
||||
*/
|
||||
private static Set<String> getOrgIds(JSONArray orgIdList){
|
||||
Set<String> tempOrgList = new HashSet<>();
|
||||
orgIdList.stream().forEach(parentOrgId -> {
|
||||
List<DepartmentModel> subDepartments = SDK.getORGAPI().getSubDepartments((String) parentOrgId);
|
||||
tempOrgList.add((String) parentOrgId);
|
||||
if (subDepartments.size() > 0) {
|
||||
findSubDepartmentIds((String) parentOrgId, tempOrgList);
|
||||
}
|
||||
});
|
||||
return tempOrgList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归查找当前父部门下的所有子部门
|
||||
*
|
||||
* @param parentOrgId
|
||||
* @param orgIds
|
||||
*/
|
||||
private static void findSubDepartmentIds(String parentOrgId, Set<String> orgIds) {
|
||||
List<DepartmentModel> subDepartments = SDK.getORGAPI().getSubDepartments(parentOrgId);
|
||||
if (subDepartments.size() == 0) {
|
||||
return;
|
||||
}
|
||||
for (DepartmentModel department : subDepartments) {
|
||||
orgIds.add(department.getId());
|
||||
findSubDepartmentIds(department.getId(), orgIds);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 过滤空文件或者空架构
|
||||
* @param dataArray 数据
|
||||
* @return JSONArray
|
||||
*/
|
||||
private static JSONArray filterEmpty(JSONArray dataArray) {
|
||||
return dataArray.stream()
|
||||
.map(o -> (JSONObject)o).filter(obj -> {
|
||||
boolean flag = true;
|
||||
// 组织下的内容不在【架构筛选】功能的影响内
|
||||
if (!("org".equals(obj.getString("plCategory")) || "itsystem.normal".equals(obj.getString("plMethodId")))) {
|
||||
if ("process.framework".equals(obj.getString("plMethodId")) || "default".equals(obj.getString("plMethodId"))) {
|
||||
flag = filterEmptyMoldel(obj.getString("wsId"), obj.getString("versionId"));
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toCollection(JSONArray::new));
|
||||
}
|
||||
|
||||
/**
|
||||
* 过滤空文件或者空架构
|
||||
* @param list 数据
|
||||
* @return List<PALRepositoryModel>
|
||||
*/
|
||||
private static List<PALRepositoryModel> filterEmpty(List<PALRepositoryModel> list) {
|
||||
return list.stream().filter(model -> {
|
||||
boolean flag = true;
|
||||
// 组织下的内容与IT系统图不在【架构筛选】影响范围之内
|
||||
if (!("org".equals(model.getMethodCategory()) || "itsystem.normal".equals(model.getMethodId()))) {
|
||||
if ("process.framework".equals(model.getMethodId()) || "default".equals(model.getMethodId())) {
|
||||
flag = filterEmptyMoldel(model.getWsId(), model.getVersionId());
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归判断是否为空文件或者空架构
|
||||
* @param wsId 资产库ID
|
||||
* @param pid 父节点ID
|
||||
* @return boolean
|
||||
*/
|
||||
private static boolean filterEmptyMoldel(String wsId, String pid) {
|
||||
boolean flag = false;
|
||||
Iterator<PALRepositoryModel> iterator = PALRepositoryCache.getByPid(wsId, pid);
|
||||
while (iterator.hasNext()) {
|
||||
PALRepositoryModel currentModel = iterator.next();
|
||||
if ("process.framework".equals(currentModel.getMethodId()) || "default".equals(currentModel.getMethodId())) {
|
||||
flag = filterEmptyMoldel(wsId, currentModel.getVersionId());
|
||||
} else {
|
||||
flag = true;
|
||||
}
|
||||
if (flag)
|
||||
break;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
@ -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.PALFrameworkFilterUtil;
|
||||
import com.actionsoft.bpms.bo.engine.BO;
|
||||
import com.actionsoft.bpms.commons.formfile.model.delegate.FormFile;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
@ -8295,84 +8296,10 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
JSONArray orgIdList = UtilString.isNotEmpty(orgIds) ? JSONArray.parseArray(orgIds) : new JSONArray();
|
||||
JSONArray methodIdList = UtilString.isNotEmpty(methodIds) ? JSONArray.parseArray(methodIds) : new JSONArray();
|
||||
JSONArray result = PALRepositoryQueryAPIManager.getInstance().getUsedPalRepositoryTreeDataByPidNew(_uc, wsId, teamId, pid);
|
||||
// 先过滤掉空的架构与空的文件夹
|
||||
|
||||
// 架构过滤
|
||||
if (createUserList.size() > 0 || orgIdList.size() > 0 || methodIdList.size() > 0) {
|
||||
result = result.stream().filter(model -> {
|
||||
boolean flag = true;
|
||||
// 组织下的内容不在【架构筛选】功能的影响内
|
||||
if (!("org".equals(((JSONObject) model).getString("plCategory")) || "itsystem.normal".equals(((JSONObject) model).getString("plMethodId")))) {
|
||||
if ("process.framework".equals(((JSONObject) model).getString("plMethodId")) || "default".equals(((JSONObject) model).getString("plMethodId"))) {
|
||||
flag = this.filterEmptyMoldel(((JSONObject) model).getString("wsId"), ((JSONObject) model).getString("versionId"));
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toCollection(JSONArray::new));
|
||||
}
|
||||
// 根据文件类型过滤
|
||||
if (methodIdList.size() > 0) {
|
||||
result = result.stream().filter(item -> {
|
||||
if ("org".equals(((JSONObject) item).getString("plCategory")) || "itsystem.normal".equals(((JSONObject) item).getString("plMethodId"))) {
|
||||
return true;
|
||||
}
|
||||
boolean flag = false;
|
||||
if ("process.framework".equals(((JSONObject) item).getString("plMethodId")) || "default".equals(((JSONObject) item).getString("plMethodId"))) {
|
||||
// 递归判断当前架构下是否有符合的文件类型
|
||||
flag = this.filterChildLevelModelByPid(((JSONObject) item).getString("wsId"), ((JSONObject) item).getString("versionId"), methodIdList);
|
||||
} else {
|
||||
flag = methodIdList.contains(((JSONObject) item).getString("plMethodId"));
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toCollection(JSONArray::new));
|
||||
}
|
||||
// 根据创建人过滤
|
||||
if (createUserList.size() > 0) {
|
||||
result = result.stream().filter(item -> {
|
||||
if ("org".equals(((JSONObject) item).getString("plCategory")) || "itsystem.normal".equals(((JSONObject) item).getString("plMethodId"))) {
|
||||
return true;
|
||||
}
|
||||
boolean flag = false;
|
||||
if ("process.framework".equals(((JSONObject) item).getString("plMethodId")) || "default".equals(((JSONObject) item).getString("plMethodId"))) {
|
||||
// 递归判断当前架构下是否有符合的文件类型
|
||||
flag = this.filterIsMatchRepositoryByCreateUser(((JSONObject) item).getString("wsId"), ((JSONObject) item).getString("versionId"), createUserList);
|
||||
} else {
|
||||
flag = createUserList.contains(((JSONObject) item).getString("createUser")) || createUserList.contains(((JSONObject) item).getString("modifyUser"));
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toCollection(JSONArray::new));
|
||||
}
|
||||
// 根据组织架构过滤
|
||||
if (orgIdList.size() > 0) {
|
||||
Set<String> tempOrgList = new HashSet<>();
|
||||
orgIdList.stream().forEach(parentOrgId -> {
|
||||
List<DepartmentModel> subDepartments = SDK.getORGAPI().getSubDepartments((String) parentOrgId);
|
||||
tempOrgList.add((String) parentOrgId);
|
||||
if (subDepartments.size() > 0) {
|
||||
this.findSubDepartmentIds((String) parentOrgId, tempOrgList);
|
||||
}
|
||||
});
|
||||
result = result.stream().filter(item -> {
|
||||
boolean flag = false;
|
||||
JSONObject itemObj = (JSONObject) item;
|
||||
if ("org".equals(((JSONObject) item).getString("plCategory")) || "itsystem.normal".equals(((JSONObject) item).getString("plMethodId"))) {
|
||||
return true;
|
||||
}
|
||||
if ("process.framework".equals(itemObj.getString("plMethodId")) || "default".equals(itemObj.getString("plMethodId"))) {
|
||||
flag = this.filterIsMatchPropertyModel(itemObj.getString("wsId"), itemObj.getString("versionId"), tempOrgList);
|
||||
} else {
|
||||
List<DesignerShapeRelationModel> relationModels = DesignerShapeRelationCache.getByFileId(itemObj.getString("currId"), "Issuing_department");
|
||||
// 是否有发布部门的文件属性【可能会有多个值】
|
||||
if (relationModels != null && relationModels.size() > 0) {
|
||||
for (DesignerShapeRelationModel relationModel : relationModels) {
|
||||
JSONObject relationObj = JSONObject.parseObject(relationModel.getRelationShapeText());
|
||||
String deptId = relationObj.getString("id");
|
||||
flag = tempOrgList.contains(deptId);
|
||||
if (flag)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toCollection(JSONArray::new));
|
||||
result = PALFrameworkFilterUtil.filter(result, createUserList, orgIdList, methodIdList);
|
||||
}
|
||||
ro.setData(result);
|
||||
return ro.toString();
|
||||
@ -10159,83 +10086,8 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
List<PALRepositoryModel> recentList = CoeProcessLevelUtil.getRecentUpdateRepositoryList(wsId, teamId, _uc.getUID(), null, null, 30);
|
||||
|
||||
// 伊利需求【架构筛选】不过滤组织图与IT系统图
|
||||
// 先过滤掉空的架构与空的文件夹
|
||||
if (createUserList.size() > 0 || orgIdList.size() > 0 || methodIdList.size() > 0) {
|
||||
recentList = recentList.stream().filter(model -> {
|
||||
boolean flag = true;
|
||||
// 组织下的内容与IT系统图不在【架构筛选】影响范围之内
|
||||
if (!("org".equals(model.getMethodCategory()) || "itsystem.normal".equals(model.getMethodId()))) {
|
||||
if ("process.framework".equals(model.getMethodId()) || "default".equals(model.getMethodId())) {
|
||||
flag = this.filterEmptyMoldel(model.getWsId(), model.getVersionId());
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
if (methodIdList.size() > 0) {
|
||||
recentList = recentList.stream().filter(model -> {
|
||||
boolean flag = false;
|
||||
if ("org".equals(model.getMethodCategory()) || "itsystem.normal".equals(model.getMethodId())) {
|
||||
return true;
|
||||
}
|
||||
// 代表【架构】伊利专属需求
|
||||
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());
|
||||
}
|
||||
// 如果勾选了创建人则用创建人与模型的创建人与修改人匹配
|
||||
if (createUserList.size() > 0) {
|
||||
recentList = recentList.stream().filter(model -> {
|
||||
boolean flag = false;
|
||||
if ("org".equals(model.getMethodCategory()) || "itsystem.normal".equals(model.getMethodId())) {
|
||||
return true;
|
||||
}
|
||||
if ("process.framework".equals(model.getMethodId()) || "default".equals(model.getMethodId())) {
|
||||
// 递归判断当前架构下是否有符合的文件类型
|
||||
flag = this.filterIsMatchRepositoryByCreateUser(model.getWsId(), model.getVersionId(), createUserList);
|
||||
} else {
|
||||
flag = createUserList.contains(model.getCreateUser()) || createUserList.contains(model.getModifyUser());
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
// 如果勾选了组织机构则根据文件属性中的发布部门去匹配
|
||||
Set<String> tempOrgList = new HashSet<>();
|
||||
if (orgIdList.size() > 0) {
|
||||
orgIdList.stream().forEach(parentOrgId -> {
|
||||
List<DepartmentModel> subDepartments = SDK.getORGAPI().getSubDepartments((String) parentOrgId);
|
||||
tempOrgList.add((String) parentOrgId);
|
||||
if (subDepartments.size() > 0) {
|
||||
this.findSubDepartmentIds((String) parentOrgId, tempOrgList);
|
||||
}
|
||||
});
|
||||
recentList = recentList.stream().filter(model -> {
|
||||
boolean flag = false;
|
||||
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<DesignerShapeRelationModel> 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 = tempOrgList.contains(deptId);
|
||||
if (flag)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
recentList = PALFrameworkFilterUtil.filter(recentList, createUserList, orgIdList, methodIdList);
|
||||
}
|
||||
JSONArray recentData = new JSONArray();
|
||||
for (PALRepositoryModel model : recentList) {
|
||||
@ -10308,69 +10160,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
List<PALRepositoryModel> commonList = CoeProcessLevelUtil.getCommonRepositoryList(_uc, wsId, teamId, _uc.getUID());
|
||||
// 先过滤掉空的架构与空的文件夹
|
||||
if (createUserList.size() > 0 || orgIdList.size() > 0 || methodIdList.size() > 0) {
|
||||
commonList = commonList.stream().filter(model -> {
|
||||
boolean flag = true;
|
||||
if (!("org".equals(model.getMethodCategory()) || "itsystem.normal".equals(model.getMethodId()))) {
|
||||
flag = this.filterEmptyMoldel(model.getWsId(), model.getVersionId());
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
// 伊利需求【架构筛选】
|
||||
if (methodIdList.size() > 0) {
|
||||
commonList = commonList.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.filterChildLevelModelByPid(model.getWsId(), model.getVersionId(), methodIdList);
|
||||
} else {
|
||||
flag = methodIdList.contains(model.getMethodId());
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
if (createUserList.size() > 0) {
|
||||
commonList = commonList.stream().filter(model -> {
|
||||
boolean flag = false;
|
||||
if ("org".equals(model.getMethodCategory()) || "itsystem.normal".equals(model.getMethodId())) {
|
||||
return true;
|
||||
}
|
||||
if ("process.framework".equals(model.getMethodId()) || "default".equals(model.getMethodId())) {
|
||||
// 递归判断当前架构下是否有符合的文件类型
|
||||
flag = this.filterIsMatchRepositoryByCreateUser(model.getWsId(), model.getVersionId(), createUserList);
|
||||
} else {
|
||||
flag = createUserList.contains(model.getCreateUser()) || createUserList.contains(model.getModifyUser());
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
if (orgIdList.size() > 0) {
|
||||
commonList = commonList.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(), tempOrgList);
|
||||
} else {
|
||||
List<DesignerShapeRelationModel> 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 = tempOrgList.contains(deptId);
|
||||
if (flag)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
commonList = PALFrameworkFilterUtil.filter(commonList, createUserList, orgIdList, methodIdList);
|
||||
}
|
||||
JSONArray commonData = new JSONArray();
|
||||
for (PALRepositoryModel model : commonList) {
|
||||
@ -10833,81 +10623,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
|
||||
// 先过滤掉空的架构与空的文件夹
|
||||
if (createUserList.size() > 0 || orgIdList.size() > 0 || methodIdList.size() > 0) {
|
||||
tableData = tableData.stream().filter(item -> {
|
||||
boolean flag = true;
|
||||
if (!("org".equals(((JSONObject) item).getString("category")) || "itsystem.normal".equals(((JSONObject) item).getString("methodId")))) {
|
||||
if ("process.framework".equals(((JSONObject) item).getString("methodId")) || "default".equals(((JSONObject) item).getString("methodId"))) {
|
||||
flag = this.filterEmptyMoldel(((JSONObject) item).getString("wsId"), ((JSONObject) item).getString("versionId"));
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toCollection(JSONArray::new));
|
||||
}
|
||||
// 根据文件类型过滤
|
||||
if (methodIdList.size() > 0) {
|
||||
tableData = tableData.stream().filter(item -> {
|
||||
if ("org".equals(((JSONObject) item).getString("category")) || "itsystem.normal".equals(((JSONObject) item).getString("methodId"))) {
|
||||
return true;
|
||||
}
|
||||
boolean flag = false;
|
||||
if ("process.framework".equals(((JSONObject) item).getString("methodId")) || "default".equals(((JSONObject) item).getString("methodId"))) {
|
||||
// 递归判断当前架构下是否有符合的文件类型
|
||||
flag = this.filterChildLevelModelByPid(((JSONObject) item).getString("wsId"), ((JSONObject) item).getString("versionId"), methodIdList);
|
||||
} else {
|
||||
flag = methodIdList.contains(((JSONObject) item).getString("methodId"));
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toCollection(JSONArray::new));
|
||||
}
|
||||
// 根据创建人过滤
|
||||
if (createUserList.size() > 0) {
|
||||
tableData = tableData.stream().filter(item -> {
|
||||
if ("org".equals(((JSONObject) item).getString("category")) || "itsystem.normal".equals(((JSONObject) item).getString("methodId"))) {
|
||||
return true;
|
||||
}
|
||||
boolean flag = false;
|
||||
if ("process.framework".equals(((JSONObject) item).getString("methodId")) || "default".equals(((JSONObject) item).getString("methodId"))) {
|
||||
// 递归判断当前架构下是否有符合的文件类型
|
||||
flag = this.filterIsMatchRepositoryByCreateUser(((JSONObject) item).getString("wsId"), ((JSONObject) item).getString("versionId"), createUserList);
|
||||
} else {
|
||||
flag = createUserList.contains(((JSONObject) item).getString("createUser")) || createUserList.contains(((JSONObject) item).getString("modifyUser"));
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toCollection(JSONArray::new));
|
||||
}
|
||||
// 根据组织架构过滤
|
||||
if (orgIdList.size() > 0) {
|
||||
Set<String> tempOrgList = new HashSet<>();
|
||||
orgIdList.stream().forEach(parentOrgId -> {
|
||||
List<DepartmentModel> subDepartments = SDK.getORGAPI().getSubDepartments((String) parentOrgId);
|
||||
tempOrgList.add((String) parentOrgId);
|
||||
if (subDepartments.size() > 0) {
|
||||
this.findSubDepartmentIds((String) parentOrgId, tempOrgList);
|
||||
}
|
||||
});
|
||||
tableData = tableData.stream().filter(item -> {
|
||||
boolean flag = false;
|
||||
JSONObject itemObj = (JSONObject) item;
|
||||
if ("org".equals(((JSONObject) item).getString("category")) || "itsystem.normal".equals(((JSONObject) item).getString("methodId"))) {
|
||||
return true;
|
||||
}
|
||||
if ("process.framework".equals(itemObj.getString("methodId")) || "default".equals(itemObj.getString("methodId"))) {
|
||||
flag = this.filterIsMatchPropertyModel(itemObj.getString("wsId"), itemObj.getString("versionId"), tempOrgList);
|
||||
} else {
|
||||
List<DesignerShapeRelationModel> relationModels = DesignerShapeRelationCache.getByFileId(itemObj.getString("id"), "Issuing_department");
|
||||
// 是否有发布部门的文件属性【可能会有多个值】
|
||||
if (relationModels != null && relationModels.size() > 0) {
|
||||
for (DesignerShapeRelationModel relationModel : relationModels) {
|
||||
JSONObject relationObj = JSONObject.parseObject(relationModel.getRelationShapeText());
|
||||
String deptId = relationObj.getString("id");
|
||||
flag = tempOrgList.contains(deptId);
|
||||
if (flag)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toCollection(JSONArray::new));
|
||||
tableData = PALFrameworkFilterUtil.filter(tableData, createUserList, orgIdList, methodIdList);
|
||||
}
|
||||
// 串联分析应用是否安装
|
||||
if (SDK.getAppAPI().isInstalled(CoEConstant.APP_PROCESSLINK_ID) && SDK.getAppAPI().isActive(CoEConstant.APP_PROCESSLINK_ID)) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user