fix(测试跟踪): 查询禅道需求时包含子需求

--bug=1017861 --user=李玉号
【测试跟踪】github#18384,测试跟踪,功能用例详情页,关联需求,需求列表页展示的需求没有包含子需求,只有父需求
https://www.tapd.cn/55049933/s/1295025
This commit is contained in:
shiziyuan9527 2022-11-11 17:57:17 +08:00 committed by lyh
parent 754df8c88d
commit fefc70734c
1 changed files with 24 additions and 0 deletions

View File

@ -133,6 +133,30 @@ public class ZentaoPlatform extends AbstractIssuePlatform {
list.add(demandDTO);
}
}
// {"5": {"children": {"51": {}}}, "6": {}}
else if (data.startsWith("{\"")) {
Map<String, Map<String, String>> dataMap = JSON.parseMap(data);
Collection<Map<String, String>> 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<String, Map<String, String>> children = (LinkedHashMap<String, Map<String, String>>) jsonObject.get("children");
Collection<Map<String, String>> 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");