From fefc70734cb547d979bd6106839f6e4307849fa9 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Fri, 11 Nov 2022 17:57:17 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E7=A6=85=E9=81=93=E9=9C=80=E6=B1=82=E6=97=B6?= =?UTF-8?q?=E5=8C=85=E5=90=AB=E5=AD=90=E9=9C=80=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1017861 --user=李玉号 【测试跟踪】github#18384,测试跟踪,功能用例详情页,关联需求,需求列表页展示的需求没有包含子需求,只有父需求 https://www.tapd.cn/55049933/s/1295025 --- .../issue/platform/ZentaoPlatform.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/test-track/backend/src/main/java/io/metersphere/service/issue/platform/ZentaoPlatform.java b/test-track/backend/src/main/java/io/metersphere/service/issue/platform/ZentaoPlatform.java index 758d644fac..fb2c5fda72 100644 --- a/test-track/backend/src/main/java/io/metersphere/service/issue/platform/ZentaoPlatform.java +++ b/test-track/backend/src/main/java/io/metersphere/service/issue/platform/ZentaoPlatform.java @@ -133,6 +133,30 @@ public class ZentaoPlatform extends AbstractIssuePlatform { list.add(demandDTO); } } + // {"5": {"children": {"51": {}}}, "6": {}} + else if (data.startsWith("{\"")) { + Map> dataMap = JSON.parseMap(data); + Collection> values = dataMap.values(); + values.forEach(v -> { + Map jsonObject = JSON.parseMap(JSON.toJSONString(v)); + DemandDTO demandDTO = new DemandDTO(); + demandDTO.setId(jsonObject.get("id").toString()); + demandDTO.setName(jsonObject.get("title").toString()); + demandDTO.setPlatform(key); + list.add(demandDTO); + if (jsonObject.get("children") != null) { + LinkedHashMap> children = (LinkedHashMap>) jsonObject.get("children"); + Collection> childrenMap = children.values(); + childrenMap.forEach(ch -> { + DemandDTO dto = new DemandDTO(); + dto.setId(ch.get("id")); + dto.setName(ch.get("title")); + dto.setPlatform(key); + list.add(dto); + }); + } + }); + } // 处理格式 {{"id": {obj}},{"id",{obj}}} else if (data.charAt(0) == '{') { Map dataObject = (Map) obj.get("data");