代码调整

This commit is contained in:
zhal 2022-07-20 13:52:59 +08:00
parent cab618f799
commit ae797ea4ee

View File

@ -3031,25 +3031,38 @@ public class CoeDesignerWeb extends ActionWeb {
JSONObject relationShapeIds = new JSONObject(); JSONObject relationShapeIds = new JSONObject();
JSONObject relationShapeModels = new JSONObject(); JSONObject relationShapeModels = new JSONObject();
List<Map<String, Object>> elements = CoeDesignerUtil.getShapeMessageJson(plModel.getId());
if (elements != null && elements.size() > 0) {
for (Map<String, Object> element : elements) {
String elementId = element.containsKey("id") ? element.get("id").toString() : ""; String define = PALRepositoryQueryAPIManager.getInstance().getProcessDefinition(_uc, plModel.getId());
if (!UtilString.isEmpty(elementId)) { JSONObject definition = JSONObject.parseObject(define);
Iterator<DesignerShapeRelationModel> modelIterator = DesignerShapeRelationCache.getByShapeId(plModel.getId(), elementId); JSONObject elements = definition.getJSONObject("elements");
if (modelIterator != null) { for (String id: elements.keySet()) {
while (modelIterator.hasNext()) { JSONObject shapeObj = elements.getJSONObject(id);
DesignerShapeRelationModel shapeRelationModel = modelIterator.next(); String name = shapeObj.getString("name");
PALRepositoryModel relationPalModel = PALRepositoryCache.getCache().get(shapeRelationModel.getRelationFileId()); if ("linker".equals(name)) {
if (relationPalModel != null) { continue;
relationShapeIds.put(shapeRelationModel.getRelationShapeId(), shapeRelationModel); }
relationShapeModels.put(shapeRelationModel.getShapeId() + "_" + shapeRelationModel.getAttrId(), shapeRelationModel.getRelationShapeText()); Iterator<DesignerShapeRelationModel> 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<String, JSONObject> map = PALRepositoryQueryAPIManager.getInstance().queryRepositoryShapeAttributeById(plModel.getId(), id, shapeObj, "|");
for (Entry<String, JSONObject> 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("relationShapes", relationShapeIds);
macroLibraries.put("relationShapeModels", relationShapeModels); macroLibraries.put("relationShapeModels", relationShapeModels);