Commit 46c3d2a8 by henry

添加pgql

1 parent 3cdc53ab
...@@ -38,9 +38,9 @@ public class ArchMapController { ...@@ -38,9 +38,9 @@ public class ArchMapController {
@PostMapping("getOverAllBusAsset") @PostMapping("getOverAllBusAsset")
@OperLog(value = LogOperTypeEnum.QUERY, logTypeValue = LogTypeEnum.BUSI_LOG, operDes = "获取总体业务架构资产信息", moduleName = "架构地图") @OperLog(value = LogOperTypeEnum.QUERY, logTypeValue = LogTypeEnum.BUSI_LOG, operDes = "获取总体业务架构资产信息", moduleName = "架构地图")
public Result getOverAllBusAsset(@RequestBody ArchMapDto mapDto) { public Result getOverAllBusAsset(@RequestBody ArchMapDto mapDto) {
String parentAssetId = mapDto.getParentAssetId(); long parentAssetId = mapDto.getParentAssetId();
String archiType = mapDto.getArchiType(); String archiType = mapDto.getArchiType();
if (StringUtils.isEmpty(archiType) && StringUtils.isEmpty(parentAssetId)) { if (StringUtils.isEmpty(archiType)) {
throw new NullPointerException("架构类型、架构层级及元素名称不能为空;"); throw new NullPointerException("架构类型、架构层级及元素名称不能为空;");
} }
List<ArchMapVo> resultDatas = archMapService.getOverAllBusAsset(mapDto); List<ArchMapVo> resultDatas = archMapService.getOverAllBusAsset(mapDto);
......
...@@ -23,7 +23,7 @@ public class ArchMapDto { ...@@ -23,7 +23,7 @@ public class ArchMapDto {
/** /**
* 父级资产编号 * 父级资产编号
*/ */
private String parentAssetId; private long parentAssetId;
/** /**
* 架构类别 1:总体架构;2:系统架构 * 架构类别 1:总体架构;2:系统架构
*/ */
......
...@@ -37,12 +37,12 @@ public class ArchMapServiceImpl implements IArchMapService { ...@@ -37,12 +37,12 @@ public class ArchMapServiceImpl implements IArchMapService {
public List<ArchMapVo> getAssetTree(ArchMapDto mapDto) { public List<ArchMapVo> getAssetTree(ArchMapDto mapDto) {
List<ArchMapVo> allDatas = archMapMapper.getOverAllBusAsset(mapDto); List<ArchMapVo> allDatas = archMapMapper.getOverAllBusAsset(mapDto);
List<ArchMapVo> treeList = new ArrayList<>(); List<ArchMapVo> treeList = new ArrayList<>();
mapDto.setParentAssetId("0"); mapDto.setParentAssetId(0);
List<ArchMapVo> rootDatas = archMapMapper.getOverAllBusAsset(mapDto); List<ArchMapVo> rootDatas = archMapMapper.getOverAllBusAsset(mapDto);
if (!Collections.isEmpty(rootDatas)) { if (!Collections.isEmpty(rootDatas)) {
treeList = rootDatas.stream() treeList = rootDatas.stream()
.filter(item -> !StringUtils.isEmpty(item.getParentAssetId())) .filter(item -> !StringUtils.isEmpty(item.getParentAssetId()))
.filter(item -> item.getParentAssetId().equals("0")) .filter(item -> item.getParentAssetId().equals(0))
.peek(item -> item.setChildren(getChildrens(item, allDatas))).collect(Collectors.toList()); .peek(item -> item.setChildren(getChildrens(item, allDatas))).collect(Collectors.toList());
} }
return treeList; return treeList;
......
...@@ -41,7 +41,10 @@ ...@@ -41,7 +41,10 @@
<groupId>com.mysql</groupId> <groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId> <artifactId>mysql-connector-j</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>
<dependency> <dependency>
<groupId>com.alibaba</groupId> <groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId> <artifactId>druid-spring-boot-starter</artifactId>
......
...@@ -82,9 +82,16 @@ ...@@ -82,9 +82,16 @@
<configuration.version>1.10</configuration.version> <configuration.version>1.10</configuration.version>
<mybatisPlus.version>1.4.11</mybatisPlus.version> <mybatisPlus.version>1.4.11</mybatisPlus.version>
<openFeign.version>3.1.5</openFeign.version> <openFeign.version>3.1.5</openFeign.version>
<pgsql.version>42.1.1</pgsql.version>
</properties> </properties>
<dependencyManagement> <dependencyManagement>
<dependencies> <dependencies>
<!--设置具体的依赖-->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${pgsql.version}</version>
</dependency>
<dependency> <dependency>
<groupId>com.github.yulichang</groupId> <groupId>com.github.yulichang</groupId>
<artifactId>mybatis-plus-join-core</artifactId> <artifactId>mybatis-plus-join-core</artifactId>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!