Commit a1d62963 by henry

添加接口注释

1 parent 46c3d2a8
......@@ -33,27 +33,34 @@ public class ArchMapServiceImpl implements IArchMapService {
return archMapMapper.getOverAllBusAsset(mapDto);
}
/**
* 获取选择对应架构资产树
* @param mapDto
* @return
*/
@Override
public List<ArchMapVo> getAssetTree(ArchMapDto mapDto) {
//查询所有的对应架构资产数据
List<ArchMapVo> allDatas = archMapMapper.getOverAllBusAsset(mapDto);
List<ArchMapVo> treeList = new ArrayList<>();
mapDto.setParentAssetId(0);
//查询根节点资产数据
List<ArchMapVo> rootDatas = archMapMapper.getOverAllBusAsset(mapDto);
if (!Collections.isEmpty(rootDatas)) {
treeList = rootDatas.stream()
.filter(item -> !StringUtils.isEmpty(item.getParentAssetId()))
.filter(item -> item.getParentAssetId().equals(0))
.peek(item -> item.setChildren(getChildrens(item, allDatas))).collect(Collectors.toList());
.peek(item -> item.setNode(getNode(item, allDatas))).collect(Collectors.toList());
}
return treeList;
}
private List<ArchMapVo> getChildrens(ArchMapVo root, List<ArchMapVo> all) {
private List<ArchMapVo> getNode(ArchMapVo root, List<ArchMapVo> all) {
List<ArchMapVo> children = all.stream()
.filter(item -> !StringUtils.isEmpty(item.getParentAssetId()))
.filter(item -> item.getParentAssetId().equals(root.getAssetId()))
.peek(item -> {
item.setChildren(getChildrens(item, all));
item.setNode(getNode(item, all));
}).collect(Collectors.toList());
return children;
}
......
......@@ -40,6 +40,6 @@ public class ArchMapVo {
private String assetId;
private List<ArchMapVo> children;
private List<ArchMapVo> node;
}
......@@ -57,7 +57,6 @@ public interface RoleService extends BaseService<Role> {
/**
* 编辑
* @param resources /
*/
boolean update(RoleUpdateDto roleUpdate);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!