1. 图片调试移除没有关系的图节点

master
xueqingkun 4 months ago
parent dcedd984dc
commit 8f03ed6b6f

@ -463,6 +463,9 @@ public class ModelIndexServiceImpl extends ServiceImpl<ModelIndexMapper, ModelIn
// 尝试转换为图形数据
Pair<List<WebRelDTO>, List<Map<String, String>>> pair = this.neo4jService.mergeRecord(generateNodes(records), generateRelations(records));
graphDebugResVO.setGraphRelList(pair.getKey());
// 移除没有关系的图节点
pair.getValue().removeIf(node -> pair.getKey().stream().noneMatch(
rel -> StrUtil.equals(rel.getSource(), node.get("id")) || StrUtil.equals(rel.getTarget(), node.get("id"))));
graphDebugResVO.setGraphNodeList(pair.getValue());
List<Map<String, Object>> collect = graphDebugResVO.getGraphRelList().stream().collect(Collectors.groupingBy(WebRelDTO::getName, Collectors.counting()))

Loading…
Cancel
Save