1. 修复谱查询调试接口

topo_dev
xueqingkun 5 months ago
parent e99c0386af
commit 2bc8cf25a3

@ -3,6 +3,7 @@ package com.supervision.police.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.lang.Pair;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
@ -49,6 +50,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.io.Serializable;
import java.util.*;
import java.util.stream.Collectors;
@ -451,6 +453,15 @@ public class ModelIndexServiceImpl extends ServiceImpl<ModelIndexMapper, ModelIn
graphDebugResVO.setGraphRelList(pair.getKey());
graphDebugResVO.setGraphNodeList(pair.getValue());
List<Map<String, Object>> collect = graphDebugResVO.getGraphRelList().stream().collect(Collectors.groupingBy(WebRelDTO::getName, Collectors.counting()))
.entrySet().stream().map(entry -> {
Map<String, Object> map = new HashMap<>();
map.put("name", entry.getKey());
map.put("count", entry.getValue());
return map;
}).collect(Collectors.toList());
graphDebugResVO.setGraphReCountList(collect);
// 尝试转换为图形数据
return graphDebugResVO;
}

@ -31,6 +31,9 @@ public class GraphDebugResVO {
*/
private List<WebRelDTO> graphRelList;
private List<Map<String, Object>> graphReCountList;
/**
* name/entityName/id
*/

Loading…
Cancel
Save