From ae797ea4eeab0bc62983803d3f10d4354575ba3b Mon Sep 17 00:00:00 2001 From: zhal <15900249928@163.com> Date: Wed, 20 Jul 2022 13:52:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/web/CoeDesignerWeb.java | 43 ++++++++++++------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/web/CoeDesignerWeb.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/web/CoeDesignerWeb.java index b880f510..70c3bc01 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/web/CoeDesignerWeb.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/web/CoeDesignerWeb.java @@ -3031,25 +3031,38 @@ public class CoeDesignerWeb extends ActionWeb { JSONObject relationShapeIds = new JSONObject(); JSONObject relationShapeModels = new JSONObject(); - List> elements = CoeDesignerUtil.getShapeMessageJson(plModel.getId()); - if (elements != null && elements.size() > 0) { - for (Map element : elements) { - String elementId = element.containsKey("id") ? element.get("id").toString() : ""; - if (!UtilString.isEmpty(elementId)) { - Iterator modelIterator = DesignerShapeRelationCache.getByShapeId(plModel.getId(), elementId); - if (modelIterator != null) { - while (modelIterator.hasNext()) { - DesignerShapeRelationModel shapeRelationModel = modelIterator.next(); - PALRepositoryModel relationPalModel = PALRepositoryCache.getCache().get(shapeRelationModel.getRelationFileId()); - if (relationPalModel != null) { - relationShapeIds.put(shapeRelationModel.getRelationShapeId(), shapeRelationModel); - relationShapeModels.put(shapeRelationModel.getShapeId() + "_" + shapeRelationModel.getAttrId(), shapeRelationModel.getRelationShapeText()); - } - } + + + + String define = PALRepositoryQueryAPIManager.getInstance().getProcessDefinition(_uc, plModel.getId()); + JSONObject definition = JSONObject.parseObject(define); + JSONObject elements = definition.getJSONObject("elements"); + for (String id: elements.keySet()) { + JSONObject shapeObj = elements.getJSONObject(id); + String name = shapeObj.getString("name"); + if ("linker".equals(name)) { + continue; + } + Iterator modelIterator = DesignerShapeRelationCache.getByShapeId(plModel.getId(), id); + if (modelIterator != null) { + while (modelIterator.hasNext()) { + DesignerShapeRelationModel shapeRelationModel = modelIterator.next(); + PALRepositoryModel relationPalModel = PALRepositoryCache.getCache().get(shapeRelationModel.getRelationFileId()); + if (relationPalModel != null) { + relationShapeIds.put(shapeRelationModel.getRelationShapeId(), shapeRelationModel); } } } + Map map = PALRepositoryQueryAPIManager.getInstance().queryRepositoryShapeAttributeById(plModel.getId(), id, shapeObj, "|"); + for (Entry entry : map.entrySet()) { + JSONObject object = entry.getValue(); + if (object == null || object.isEmpty()) { + continue; + } + relationShapeModels.put(id + "_" + entry.getKey(), Arrays.asList(object.getString("text").split("\\|"))); + } } + macroLibraries.put("relationShapes", relationShapeIds); macroLibraries.put("relationShapeModels", relationShapeModels);