diff --git a/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar b/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar index 430661a6..f15b3f7e 100644 Binary files a/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar and b/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar differ diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/PALRepositoryQueryAPIManager.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/PALRepositoryQueryAPIManager.java index c19e0028..bdbcc64e 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/PALRepositoryQueryAPIManager.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/PALRepositoryQueryAPIManager.java @@ -1593,7 +1593,7 @@ public class PALRepositoryQueryAPIManager { List newList = setNewPid(modelList); Collections.sort(newList, new Comparator1()); - result.addAll(list2Json(context, newList, isUsed, isPublished, removeIds.toString(), type)); + result.addAll(list2Json(context, newList, isUsed, isPublished, removeIds.toString(), type, true)); i++; } return result; @@ -2014,7 +2014,7 @@ public class PALRepositoryQueryAPIManager { removeIds.append(model.getId()).append(","); } } - result.addAll(list2Json(context, newList, isUsed, isPublished, removeIds.toString(), type)); + result.addAll(list2Json(context, newList, isUsed, isPublished, removeIds.toString(), type, true)); return result; } @@ -2250,6 +2250,115 @@ public class PALRepositoryQueryAPIManager { return jsonArray; } + private JSONArray list2Json(UserContext context, List list, boolean isUsed, boolean isPublished, String removeIds, String param, boolean statusSuffix) { + JSONArray jsonArray = new JSONArray(); + for (PALRepositoryModel model : list) { + + 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); + } 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()); + PALMethodModel methodModel = PALMethodCache.getPALMethodModelById(model.getMethodId()); + if (methodModel == null || methodModel.isFolder()) {// 没有该建模方法或者是文件夹类 + object.put("title", object.get("name")); + } else { + object.put("title", object.get("name") + " " + VersionUtil.getVersionStrV(model.getVersion()).trim()); + } + //三员管理文件密级校验 + if (HighSecurityUtil.isON() && HighSecurityUtil.fileSecuritySwitch()) { + ResponseObject responseObject = new CoeProcessLevelWeb(DispatcherRequest.getUserContext()).checkFilePemission(model.getId()); + if (responseObject.isErr() && (methodModel != null && !methodModel.isFolder())) { + object.put("nocheck", true); + } + } + object.put("drop", false); + object.put("isSystemFile", model.isSystemFile()); + object.put("plMethodId", model.getMethodId().trim()); + if (methodModel == null || methodModel.isFolder()) {// 没有该建模方法或者是文件夹类 + object.put("iconFont", ""); + } else { + object.put("iconFont", ""); + } + List children = null; + if (isUsed) { + children = getUsedPalRepositoryModelsByPid(model.getWsId(), model.getId()); + if ("designer".equals(param) && children != null && children.size() > 0) {// 过滤掉发布版本 + List tempChildren = new ArrayList<>(); + for (PALRepositoryModel model2 : children) { + if (!model2.isPublish()) { + tempChildren.add(model2); + } + } + children = tempChildren; + } + } else if (isPublished) { + children = getPublishedPalRepositoryModelsByPid(model.getWsId(), model.getId()); + } + if (children == null || children.size() == 0) { + object.put("isParent", false); + //String icon = object.getString("icon"); + object.put("leaf", true);// 叶子节点 + // object.put("icon", icon.replace("16.png", "16.leaf.png")); + } else { + object.put("isParent", true); + object.put("open", false); + } + + 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("url", "./w?sid=" + context.getSessionId() + "&cmd=com.actionsoft.apps.coe.pal_pl_repository_portal_page&ruuid=" + model.getId() + "&type=1&wsid=" + model.getWsId()); + object.put("plCategory", model.getMethodCategory()); + object.put("versionId", model.getVersionId()); + object.put("orderIndex", model.getOrderIndex()); + object.put("isBottomLevel", model.isBottomLevel()); + String dutyDeptId = model.getDutyDept(); + object.put("dutyDeptId", dutyDeptId == null ? "" : dutyDeptId); + String plDutyDeptName = dutyDeptId; + if (!UtilString.isEmpty(dutyDeptId)) { + if (SDK.getORGAPI().getDepartmentById(dutyDeptId) != null) { + plDutyDeptName = SDK.getORGAPI().getDepartmentById(dutyDeptId).getName(); + } + } + object.put("dutyDeptName", UtilString.isEmpty(dutyDeptId) ? "" : plDutyDeptName); + 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); + } + return jsonArray; + } + + private String getStatusLabel(PALRepositoryModel repositoryModel){ + String statusLabel = "设计中"; + if (repositoryModel.isApproval()){ + statusLabel = "审批中"; + }else if (repositoryModel.isStop()){ + statusLabel = "已停用"; + }else if (repositoryModel.isPublish()){ + statusLabel = "已发布"; + }else if (repositoryModel.isUse()){ + statusLabel = "设计中"; + } + return statusLabel; + } + /** * 通过流程model列表,获取流程树的json数组 *