fix(接口测试): 修复接口测试导入报错的缺陷
This commit is contained in:
parent
b26c85d198
commit
53802e892b
|
@ -671,18 +671,15 @@ public class ApiDefinitionImportUtilService {
|
||||||
lastSize = traverseList.size();
|
lastSize = traverseList.size();
|
||||||
List<BaseTreeNode> notMatchedList = new ArrayList<>();
|
List<BaseTreeNode> notMatchedList = new ArrayList<>();
|
||||||
for (BaseTreeNode treeNode : traverseList) {
|
for (BaseTreeNode treeNode : traverseList) {
|
||||||
if (StringUtils.equalsIgnoreCase(treeNode.getParentId(), ModuleConstants.ROOT_NODE_PARENT_ID)) {
|
if (!baseTreeNodeMap.containsKey(treeNode.getParentId()) && !StringUtils.equalsIgnoreCase(treeNode.getParentId(), ModuleConstants.ROOT_NODE_PARENT_ID)) {
|
||||||
BaseTreeNode node = new BaseTreeNode(treeNode.getId(), treeNode.getName(), treeNode.getType(), treeNode.getParentId());
|
notMatchedList.add(treeNode);
|
||||||
node.setPath(StringUtils.join("/", node.getName()));
|
continue;
|
||||||
baseTreeNodeList.add(node);
|
|
||||||
baseTreeNodeMap.put(treeNode.getId(), node);
|
|
||||||
} else {
|
|
||||||
if (baseTreeNodeMap.containsKey(treeNode.getParentId())) {
|
|
||||||
BaseTreeNode node = new BaseTreeNode(treeNode.getId(), treeNode.getName(), treeNode.getType(), treeNode.getParentId());
|
|
||||||
node.setPath(StringUtils.join(baseTreeNodeMap.get(treeNode.getParentId()).getPath(), "/", node.getName()));
|
|
||||||
baseTreeNodeList.add(node);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
BaseTreeNode node = new BaseTreeNode(treeNode.getId(), treeNode.getName(), treeNode.getType(), treeNode.getParentId());
|
||||||
|
node.genModulePath(baseTreeNodeMap.get(treeNode.getParentId()));
|
||||||
|
baseTreeNodeMap.put(treeNode.getId(), node);
|
||||||
|
|
||||||
|
baseTreeNodeList.add(node);
|
||||||
}
|
}
|
||||||
traverseList = notMatchedList;
|
traverseList = notMatchedList;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue