From 74c6ecfb838e453cb2a07634a3380affc61db1e5 Mon Sep 17 00:00:00 2001 From: zhal <15900249928@163.com> Date: Sun, 28 Aug 2022 23:52:24 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AD=9B=E9=80=89=E4=BB=A3=E7=A0=81=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PALRepositoryQueryAPIManager.java | 104 +++++++++++++++++- .../web/DesignerRelationShapeWeb.java | 57 ++++++++-- 2 files changed, 148 insertions(+), 13 deletions(-) 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 18e2d5be..7896f111 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 @@ -1808,7 +1808,7 @@ public class PALRepositoryQueryAPIManager { JSONArray jsonArray = new JSONArray(); for (PALRepositoryModel model : list) { - if(attrId.equals("Process_performance_metrics") || attrId.equals("role")){ + if(attrId.equals("role")){ List data=new ArrayList(); data.add(0,model.getMethodId()); data.add(1,uuid); @@ -1905,10 +1905,104 @@ public class PALRepositoryQueryAPIManager { } }else if(attrId.equals("R_relevant_flies")){ - if(!model.isPublish()){ - continue; - } + if(!model.isPublish()){ + continue; + } + 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()); + 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 (param != null && "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); + }else if(attrId.equals("Process_performance_metrics")){ + List data=new ArrayList(); + data.add(0,model.getMethodId()); + data.add(1,uuid); + + RowMap rowMap = DBSql.getMap("SELECT EXT2 FROM APP_ACT_COE_PAL_REPOSITORY WHERE ID=? AND EXT2=?",model.getId(),data.toString()); + if (rowMap != null || model.getName().equals("L1-L3流程绩效") || model.getName().equals("末级流程绩效")) { JSONObject object = new JSONObject(); object.put("id", model.getId().trim()); object.put("pid", model.getNewParentId().trim()); @@ -1996,6 +2090,7 @@ public class PALRepositoryQueryAPIManager { object.put("dutyPersonId", model.getDutyUser() == null ? "" : model.getDutyUser()); object.put("dutyPersionName", UtilString.isEmpty(plDutyPerson) ? "" : SDK.getORGAPI().getUserAliasNames(plDutyPerson)); jsonArray.add(object); + } } @@ -2004,6 +2099,7 @@ public class PALRepositoryQueryAPIManager { } + /*******************************************************************************************************************************************/ /** diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/relation/web/DesignerRelationShapeWeb.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/relation/web/DesignerRelationShapeWeb.java index 3979faea..83a8abfc 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/relation/web/DesignerRelationShapeWeb.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/relation/web/DesignerRelationShapeWeb.java @@ -767,8 +767,8 @@ public class DesignerRelationShapeWeb extends ActionWeb { JSONArray jsonArr_new = new JSONArray(); JSONArray objects = JSONArray.parseArray(treeJson); //角色图属性代码是role/绩效图属性代码为Process_performance_metrics进行判断 - if (attrId.equals("Process_performance_metrics")) { - if (objects != null) { + /*if (attrId.equals("Process_performance_metrics")) { + *//*if (objects != null) { for (int i = 0; i < objects.size(); i++) { JSONObject jsonObject = objects.getJSONObject(i); String url = jsonObject.getString("url"); @@ -786,9 +786,54 @@ public class DesignerRelationShapeWeb extends ActionWeb { jsonArr_new.add(objects.getJSONObject(i)); } } + }*//* + if (objects != null) { + for (int i = 0; i < objects.size(); i++) { + JSONObject jsonObject = objects.getJSONObject(i); + String id = jsonObject.getString("id"); + String isParent = jsonObject.getString("isParent"); + + if (isParent != null) { + if (isParent.equals("true")) { + String title=jsonObject.getString("title"); + if(title.equals("末级流程绩效") || title.equals("L1-L3流程绩效") ){ + jsonArr_new.add(objects.getJSONObject(i)); + }else{ + List coeProcessLevelModels = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getCoeProcessLevelByPid(id, wsId); + if (coeProcessLevelModels.size() > 0) { + for (int k = 0; k < coeProcessLevelModels.size(); k++) { + PALRepositoryModel coeProcessLevelModel = coeProcessLevelModels.get(k); + if (coeProcessLevelModel != null) { + List data = new ArrayList(); + data.add(0, jsonObject.getString("plMethodId")); + data.add(1, ruuid); + RowMap rowMap = DBSql.getMap("SELECT EXT2 FROM APP_ACT_COE_PAL_REPOSITORY WHERE ID=? AND EXT2=?", coeProcessLevelModel.getId(), data.toString()); + if (rowMap != null) { + JSONObject json = getJSon(coeProcessLevelModel); + jsonArr_new.add(json); + } + } + } + } + } + + } else { + List data = new ArrayList(); + data.add(0, jsonObject.getString("plMethodId")); + data.add(1, ruuid); + RowMap rowMap = DBSql.getMap("SELECT EXT2 FROM APP_ACT_COE_PAL_REPOSITORY WHERE ID=? AND EXT2=?", id, data.toString()); + if (rowMap != null) { + jsonArr_new.add(objects.getJSONObject(i)); + } + } + } else { + jsonArr_new.add(objects.getJSONObject(i)); + } + + } } macroLibraries.put("treeData", jsonArr_new.toString()); - } else if (attrId.equals("role")) { + } else*/ if (attrId.equals("role")) { if (objects != null) { for (int i = 0; i < objects.size(); i++) { JSONObject jsonObject = objects.getJSONObject(i); @@ -811,13 +856,7 @@ public class DesignerRelationShapeWeb extends ActionWeb { data.add(1, ruuid); RowMap rowMap = DBSql.getMap("SELECT EXT2 FROM APP_ACT_COE_PAL_REPOSITORY WHERE ID=? AND EXT2=?", coeProcessLevelModel.getId(), data.toString()); if (rowMap != null) { - /*showflag = false; - if (showflag == false) { - jsonArr_new.add(objects.getJSONObject(i)); - showflag = true; - }*/ JSONObject json = getJSon(coeProcessLevelModel); - jsonArr_new.add(json); } }