伊利项目【架构筛选】部门条件BUG
This commit is contained in:
parent
8109487746
commit
38f38bf910
Binary file not shown.
@ -7831,6 +7831,14 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
}
|
||||
// 根据组织架构过滤
|
||||
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;
|
||||
@ -7839,7 +7847,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
return true;
|
||||
}
|
||||
if ("process.framework".equals(itemObj.getString("plMethodId")) || "default".equals(itemObj.getString("plMethodId"))){
|
||||
flag = this.filterIsMatchPropertyModel(itemObj.getString("wsId"),itemObj.getString("currId"),orgIdList);
|
||||
flag = this.filterIsMatchPropertyModel(itemObj.getString("wsId"),itemObj.getString("currId"),tempOrgList);
|
||||
}else {
|
||||
List<DesignerShapeRelationModel> relationModels = DesignerShapeRelationCache.getByFileId(itemObj.getString("currId"), "Issuing_department");
|
||||
// 是否有发布部门的文件属性【可能会有多个值】
|
||||
@ -7847,7 +7855,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
for (DesignerShapeRelationModel relationModel : relationModels) {
|
||||
JSONObject relationObj = JSONObject.parseObject(relationModel.getRelationShapeText());
|
||||
String deptId = relationObj.getString("id");
|
||||
flag = orgIdList.contains(deptId);
|
||||
flag = tempOrgList.contains(deptId);
|
||||
if (flag) break;
|
||||
}
|
||||
}
|
||||
@ -9304,7 +9312,15 @@ public String deleteReply(String replyid, String messageid) {
|
||||
}).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;
|
||||
@ -9312,7 +9328,7 @@ public String deleteReply(String replyid, String messageid) {
|
||||
return true;
|
||||
}
|
||||
if ("process.framework".equals(model.getMethodId()) || "default".equals(model.getMethodId())){
|
||||
flag = this.filterIsMatchPropertyModel(model.getWsId(),model.getId(),orgIdList);
|
||||
flag = this.filterIsMatchPropertyModel(model.getWsId(),model.getId(),tempOrgList);
|
||||
}else {
|
||||
List<DesignerShapeRelationModel> relationModels = DesignerShapeRelationCache.getByFileId(model.getId(), "Issuing_department");
|
||||
// 是否有发布部门的文件属性【可能会有多个值】
|
||||
@ -9320,7 +9336,7 @@ public String deleteReply(String replyid, String messageid) {
|
||||
for (DesignerShapeRelationModel relationModel : relationModels) {
|
||||
JSONObject relationObj = JSONObject.parseObject(relationModel.getRelationShapeText());
|
||||
String deptId = relationObj.getString("id");
|
||||
flag = orgIdList.contains(deptId);
|
||||
flag = tempOrgList.contains(deptId);
|
||||
if (flag) break;
|
||||
}
|
||||
}
|
||||
@ -9447,7 +9463,7 @@ public String deleteReply(String replyid, String messageid) {
|
||||
}
|
||||
boolean flag = false;
|
||||
if ("process.framework".equals(model.getMethodId()) || "default".equals(model.getMethodId())){
|
||||
flag = this.filterIsMatchPropertyModel(model.getWsId(),model.getId(),orgIdList);
|
||||
flag = this.filterIsMatchPropertyModel(model.getWsId(),model.getId(),tempOrgList);
|
||||
}else {
|
||||
List<DesignerShapeRelationModel> relationModels = DesignerShapeRelationCache.getByFileId(model.getId(), "Issuing_department");
|
||||
// 是否有发布部门的文件属性【可能会有多个值】
|
||||
@ -9455,7 +9471,7 @@ public String deleteReply(String replyid, String messageid) {
|
||||
for (DesignerShapeRelationModel relationModel : relationModels) {
|
||||
JSONObject relationObj = JSONObject.parseObject(relationModel.getRelationShapeText());
|
||||
String deptId = relationObj.getString("id");
|
||||
flag = orgIdList.contains(deptId);
|
||||
flag = tempOrgList.contains(deptId);
|
||||
if (flag) break;
|
||||
}
|
||||
}
|
||||
@ -9580,6 +9596,22 @@ public String deleteReply(String replyid, String messageid) {
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归查找当前父部门下的所有子部门
|
||||
* @param parentOrgId
|
||||
* @param orgIds
|
||||
*/
|
||||
private 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());
|
||||
this.findSubDepartmentIds(department.getId(),orgIds);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断当前架构或者文件夹下是否含有
|
||||
* 匹配的文件属性【发布部门】
|
||||
@ -9588,7 +9620,7 @@ public String deleteReply(String replyid, String messageid) {
|
||||
* @param orgIdList
|
||||
* @return
|
||||
*/
|
||||
private boolean filterIsMatchPropertyModel(String wsId,String pid,JSONArray orgIdList){
|
||||
private boolean filterIsMatchPropertyModel(String wsId,String pid,Set<String> orgIdList){
|
||||
boolean flag = false;
|
||||
Iterator<PALRepositoryModel> iterator = PALRepositoryCache.getByPid(wsId, pid);
|
||||
while (iterator.hasNext()) {
|
||||
@ -9911,6 +9943,14 @@ public String deleteReply(String replyid, String messageid) {
|
||||
}
|
||||
// 根据组织架构过滤
|
||||
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;
|
||||
@ -9919,7 +9959,7 @@ public String deleteReply(String replyid, String messageid) {
|
||||
return true;
|
||||
}
|
||||
if ("process.framework".equals(itemObj.getString("methodId")) || "default".equals(itemObj.getString("methodId"))){
|
||||
flag = this.filterIsMatchPropertyModel(itemObj.getString("wsId"),itemObj.getString("id"),orgIdList);
|
||||
flag = this.filterIsMatchPropertyModel(itemObj.getString("wsId"),itemObj.getString("id"),tempOrgList);
|
||||
}else {
|
||||
List<DesignerShapeRelationModel> relationModels = DesignerShapeRelationCache.getByFileId(itemObj.getString("id"), "Issuing_department");
|
||||
// 是否有发布部门的文件属性【可能会有多个值】
|
||||
@ -9927,7 +9967,7 @@ public String deleteReply(String replyid, String messageid) {
|
||||
for (DesignerShapeRelationModel relationModel : relationModels) {
|
||||
JSONObject relationObj = JSONObject.parseObject(relationModel.getRelationShapeText());
|
||||
String deptId = relationObj.getString("id");
|
||||
flag = orgIdList.contains(deptId);
|
||||
flag = tempOrgList.contains(deptId);
|
||||
if (flag) break;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user