报告生成器增加发布部门筛选回显数据修改

This commit is contained in:
zhaol 2024-11-20 14:15:03 +08:00
parent 82ab4c2de0
commit 8b602b3a47
3 changed files with 62 additions and 103 deletions

View File

@ -1269,7 +1269,7 @@ public class PALRepositoryQueryAPIManager {
}
public List<PALRepositoryModel> getPalRepositoryModelsByTeamIdByDeptId(String wsId, String userId, String teamId, boolean isUsed, boolean isPublished,String departId) {
List<PALRepositoryModel> list = CoeProcessLevelUtil.getPermRepositoryListByDeptId(wsId, teamId, userId, null, null, isUsed, isPublished,departId);
List<PALRepositoryModel> list = CoeProcessLevelUtil.getPermRepositoryListByDeptId(wsId, teamId, userId, null, null, isUsed, isPublished,departId);
return list;
}
@ -2181,7 +2181,7 @@ public class PALRepositoryQueryAPIManager {
removeIds.append(model.getId()).append(",");
}
}
result.addAll(list2DepartJson(context, newList, isUsed, isPublished, removeIds.toString(), type, true,departId));
result.addAll(list2DepartJson(context, newList, isUsed, isPublished, removeIds.toString(), type, true,departId,methods));
return result;
}
@ -2645,37 +2645,19 @@ public class PALRepositoryQueryAPIManager {
}
private JSONArray list2DepartJson(UserContext context, List<PALRepositoryModel> list, boolean isUsed, boolean isPublished, String removeIds, String param, boolean statusSuffix,String departId) {
private JSONArray list2DepartJson(UserContext context, List<PALRepositoryModel> list, boolean isUsed, boolean isPublished, String removeIds, String param, boolean statusSuffix,String departId,String methods) {
JSONArray jsonArray = new JSONArray();
/*DepartmentModel departmentById = SDK.getORGAPI().getDepartmentById(departId);
ArrayList<String> dep=new ArrayList<String>();
dep.add(departId);
ArrayList subDepartmentsList = getChildDept(departId, new ArrayList<>());
long startTime = System.currentTimeMillis();*/
for(PALRepositoryModel o:list){
System.out.println("过滤前======="+o.getName());
}
// 先过滤掉空的架构与空的文件夹
list = list.stream().filter(model -> {
boolean flag = true;
if (model.getMethodId().equals("process.framework")) {
flag = this.filterEmptyMoldel(model.getWsId(), model.getVersionId());
}
boolean flag = true;
if ("process.framework".equals(model.getMethodId()) || "default".equals(model.getMethodId())) {
flag = this.filterEmptyMoldel(model.getWsId(), model.getVersionId());
}
return flag;
}).collect(Collectors.toList());
for(PALRepositoryModel o:list){
System.out.println("过滤后======="+o.getName());
}
String[] spilt=departId.split(",");
JSONArray orgIdList=new JSONArray();
@ -2684,7 +2666,6 @@ public class PALRepositoryQueryAPIManager {
orgIdList.add(ele);
}
Set<String> tempOrgList = new HashSet<>();
if (orgIdList.size() > 0) {
orgIdList.stream().forEach(parentOrgId -> {
@ -2699,23 +2680,12 @@ public class PALRepositoryQueryAPIManager {
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");
List<RowMap> rlatRowMap = DBSql.getMaps("SELECT RELATIONSHAPETEXT FROM APP_ACT_COE_PAL_SHAPE_RLAT where FILEID = '" + model.getId() + "' and ATTRID='Issuing_department'");
for (RowMap oneRowMap : rlatRowMap) {
String relationshapetext = oneRowMap.getString("RELATIONSHAPETEXT");
JSONObject js = JSONObject.parseObject(relationshapetext);
String deptId = js.getString("id");
flag = tempOrgList.contains(deptId);
if (flag)
break;
}
/*List<DesignerShapeRelationModel> relationModels = DesignerShapeRelationCache.getByFileId(model.getId(), "Issuing_department");
// 是否有发布部门的文件属性可能会有多个值
if (relationModels != null && relationModels.size() > 0) {
for (DesignerShapeRelationModel relationModel : relationModels) {
@ -2725,48 +2695,37 @@ public class PALRepositoryQueryAPIManager {
if (flag)
break;
}
}*/
}
}
return flag;
}).collect(Collectors.toList());
}
String[] method=methods.split(",");
JSONArray methodIdList=new JSONArray();
/*list = list.stream().filter(model -> {
boolean flag = true;
if (model.getMethodId().equals("process.framework")) {
flag = this.filterEmptyMoldel(model.getWsId(), model.getId());
}
return flag;
}).collect(Collectors.toList());*/
for(String ele:method){
methodIdList.add(ele);
}
/*list = list.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(), subDepartmentsList);
} 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 = subDepartmentsList.contains(deptId);
if (flag)
break;
}
if (methodIdList.size() > 0) {
list = list.stream().filter(model -> {
boolean flag = false;
if ("org".equals(model.getMethodCategory()) || "itsystem.normal".equals(model.getMethodId())) {
return true;
}
}
return flag;
}).collect(Collectors.toList());*/
// 代表架构伊利专属需求
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());
}
for (PALRepositoryModel model : list) {
@ -2774,12 +2733,7 @@ public class PALRepositoryQueryAPIManager {
JSONObject object = new JSONObject();
object.put("id", model.getId().trim());
object.put("pid", model.getNewParentId().trim());
if (removeIds != null && removeIds.contains(model.getId().trim())) {
object.put("nocheck", true);
continue;
} else {
object.put("nocheck", false);
}
object.put("plNo", CoeProcessLevelUtil.getProcessLevelNoByUUId(model.getId(), model.getWsId()).trim());
object.put("name", I18nRes.findValue(CoEConstant.APP_ID, context.getLanguage(), model.getName()).trim() + (statusSuffix && !"default".equals(model.getMethodId()) && !"process.framework".equals(model.getMethodId()) ? "" + getStatusLabel(model) + "" : ""));
object.put("wsId", model.getWsId());
@ -2859,31 +2813,8 @@ public class PALRepositoryQueryAPIManager {
String plDutyPerson = model.getDutyUser();
object.put("dutyPersonId", model.getDutyUser() == null ? "" : model.getDutyUser());
object.put("dutyPersionName", UtilString.isEmpty(plDutyPerson) ? "" : SDK.getORGAPI().getUserAliasNames(plDutyPerson));
jsonArray.add(object);
/*if(model.getMethodId().equals("process.framework")) {
}else{
List<RowMap> rlatRowMap = DBSql.getMaps("SELECT RELATIONSHAPETEXT FROM APP_ACT_COE_PAL_SHAPE_RLAT where FILEID = '" + model.getId() + "' and ATTRID='Issuing_department'");
if (rlatRowMap.size() > 0) {
// 发布部门
String dempId = "";
for (RowMap oneRowMap : rlatRowMap) {
String relationshapetext = oneRowMap.getString("RELATIONSHAPETEXT");
JSONObject js = JSONObject.parseObject(relationshapetext);
String getDepartId=js.getString("id");
boolean contains = subDepartmentsList.contains(getDepartId);
if(contains){
jsonArray.add(object);
}
}
}
}*/
}
return jsonArray;
@ -2909,6 +2840,33 @@ public class PALRepositoryQueryAPIManager {
}
/**
* 判断当前架构或者文件夹下是否含有
* 选中的建模小类的文件
*
* @param wsId
* @param pid
* @param methodIdList
* @return
*/
private boolean filterChildLevelModelByPid(String wsId, String pid, JSONArray methodIdList) {
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 = this.filterChildLevelModelByPid(wsId, currentModel.getVersionId(), methodIdList);
} else {
flag = methodIdList.contains(currentModel.getMethodId());
}
if (flag)
break;
}
return flag;
}
/**
* 判断当前架构或者文件夹下是否含有
* 匹配的文件属性发布部门

View File

@ -1622,7 +1622,8 @@ public class CoeProcessLevelUtil {
if (list != null) {
for (PALRepositoryModel model : list) {
if ((isUse && model.isUse()) || (isPublish && model.isPublish())) {
result.add(model);
result.add(model);
}
}
}