Commit a42075ac by renrui
2 parents 23775cd7 14f60854
...@@ -3,6 +3,7 @@ package org.arch.analysis.controller; ...@@ -3,6 +3,7 @@ package org.arch.analysis.controller;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.arch.analysis.dto.ArchMapDto; import org.arch.analysis.dto.ArchMapDto;
import org.arch.analysis.vo.ArchMapVo;
import org.arch.analysis.service.IArchMapService; import org.arch.analysis.service.IArchMapService;
import org.arch.base.Result; import org.arch.base.Result;
import org.arch.log.annotation.OperLog; import org.arch.log.annotation.OperLog;
...@@ -14,7 +15,6 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -14,7 +15,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 架构地图控制器 * 架构地图控制器
...@@ -35,15 +35,12 @@ public class ArchMapController { ...@@ -35,15 +35,12 @@ 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 archType = mapDto.getArchType(); String parentAssetId = mapDto.getParentAssetId();
String level = mapDto.getLevel(); String archiType = mapDto.getArchiType();
String eleName = mapDto.getEleName(); if (StringUtils.isEmpty(archiType) && StringUtils.isEmpty(parentAssetId)) {
if (StringUtils.isEmpty(archType)
|| StringUtils.isEmpty(level)
|| StringUtils.isEmpty(eleName)) {
throw new NullPointerException("架构类型、架构层级及元素名称不能为空;"); throw new NullPointerException("架构类型、架构层级及元素名称不能为空;");
} }
List<Map<String, Object>> resultDatas = archMapService.getOverAllBusAsset(mapDto); List<ArchMapVo> resultDatas = archMapService.getOverAllBusAsset(mapDto);
return Result.success(resultDatas); return Result.success(resultDatas);
} }
...@@ -55,6 +52,7 @@ public class ArchMapController { ...@@ -55,6 +52,7 @@ public class ArchMapController {
@PostMapping("getOverAllAppAsset") @PostMapping("getOverAllAppAsset")
@OperLog(value = LogOperTypeEnum.QUERY, logTypeValue = LogTypeEnum.BUSI_LOG, operDes = "获取总体应用架构资产信息", moduleName = "架构地图") @OperLog(value = LogOperTypeEnum.QUERY, logTypeValue = LogTypeEnum.BUSI_LOG, operDes = "获取总体应用架构资产信息", moduleName = "架构地图")
public Result getOverAllAppAsset() { public Result getOverAllAppAsset() {
return null; return null;
} }
......
...@@ -15,9 +15,13 @@ public class ArchMapDto { ...@@ -15,9 +15,13 @@ public class ArchMapDto {
/** /**
* 级别 * 级别
*/ */
private String level; private String eaLevel;
/** /**
* 架构类型 * 架构类型
*/ */
private String archType; private String archiType;
/**
* 父级资产编号
*/
private String parentAssetId;
} }
...@@ -2,10 +2,10 @@ package org.arch.analysis.mapper; ...@@ -2,10 +2,10 @@ package org.arch.analysis.mapper;
import org.arch.analysis.dto.ArchMapDto; import org.arch.analysis.dto.ArchMapDto;
import org.arch.analysis.vo.ArchMapVo;
import java.util.List; import java.util.List;
import java.util.Map;
public interface ArchMapMapper { public interface ArchMapMapper {
List<Map<String, Object>> getOverAllBusAsset(ArchMapDto mapDto); List<ArchMapVo> getOverAllBusAsset(ArchMapDto mapDto);
} }
...@@ -2,10 +2,10 @@ package org.arch.analysis.service; ...@@ -2,10 +2,10 @@ package org.arch.analysis.service;
import org.arch.analysis.dto.ArchMapDto; import org.arch.analysis.dto.ArchMapDto;
import org.arch.analysis.vo.ArchMapVo;
import java.util.List; import java.util.List;
import java.util.Map;
public interface IArchMapService { public interface IArchMapService {
List<Map<String, Object>> getOverAllBusAsset(ArchMapDto mapDto); List<ArchMapVo> getOverAllBusAsset(ArchMapDto mapDto);
} }
...@@ -2,13 +2,13 @@ package org.arch.analysis.service.impl; ...@@ -2,13 +2,13 @@ package org.arch.analysis.service.impl;
import org.arch.analysis.dto.ArchMapDto; import org.arch.analysis.dto.ArchMapDto;
import org.arch.analysis.vo.ArchMapVo;
import org.arch.analysis.mapper.ArchMapMapper; import org.arch.analysis.mapper.ArchMapMapper;
import org.arch.analysis.service.IArchMapService; import org.arch.analysis.service.IArchMapService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List; import java.util.List;
import java.util.Map;
@Service @Service
public class ArchMapServiceImpl implements IArchMapService { public class ArchMapServiceImpl implements IArchMapService {
...@@ -16,7 +16,7 @@ public class ArchMapServiceImpl implements IArchMapService { ...@@ -16,7 +16,7 @@ public class ArchMapServiceImpl implements IArchMapService {
private ArchMapMapper archMapMapper; private ArchMapMapper archMapMapper;
@Override @Override
public List<Map<String, Object>> getOverAllBusAsset(ArchMapDto mapDto) { public List<ArchMapVo> getOverAllBusAsset(ArchMapDto mapDto) {
return archMapMapper.getOverAllBusAsset(mapDto); return archMapMapper.getOverAllBusAsset(mapDto);
} }
} }
package org.arch.analysis.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ArchMapVo {
/**
* 元素名称
*/
private String eleName;
/**
* 资产名称
*/
private String assetName;
/**
* 元素id
*/
private String elementId;
/**
* 级别
*/
private String eaLevel;
/**
* 父级资产名称
*/
private String parentAssetId;
/**
* 架构类型
*/
private String archiType;
/**
* 上级资产编号
*/
private String assetId;
}
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
<!-- 本地环境 --> <!-- 本地环境 -->
<springProfile name="local"> <springProfile name="local">
<root level="INFO"> <root level="DEBUG">
<appender-ref ref="STDOUT"/> <appender-ref ref="STDOUT"/>
<appender-ref ref="INFO_FILE"/> <appender-ref ref="INFO_FILE"/>
<appender-ref ref="ERROR_FILE"/> <appender-ref ref="ERROR_FILE"/>
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.arch.analysis.mapper.ArchMapMapper"> <mapper namespace="org.arch.analysis.mapper.ArchMapMapper">
<select id="getOverAllBusAsset" resultType="java.util.Map" parameterType="org.arch.analysis.dto.ArchMapDto"> <select id="getOverAllBusAsset" resultType="org.arch.analysis.vo.ArchMapVo" parameterType="org.arch.analysis.dto.ArchMapDto">
SELECT select
n.asset_name, ele_name as eleName,
archi_asset_type, n.asset_name as assetName,
archi_type, m.element_id as elementId,
asset_code m.ea_level as eaLevel,
FROM n.parent_asset_id as parentAssetId,
archi_asset_info n n.archi_type as archiType,
WHERE n.asset_id as assetId
n.archi_type = #{archType} from
AND n.ele_name = #{eleName} archi_asset_info n,
AND n.parent_asset_id = 0 archi_element m
AND n.asset_code IS NOT NULL where
n.archi_type = #{archiType}
and n.archi_ele_id = m.element_id
<if test="eaLevel!=null and eaLevel!=''">
and m.ea_level= #{eaLevel}
</if>
and n.del_flag = 0
and n.archi_stage = 1
and n.state = 1
and m.state=1
and m.del_flag=0
and n.parent_asset_id = #{parentAssetId}
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -5,7 +5,7 @@ import io.swagger.annotations.ApiModelProperty; ...@@ -5,7 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
/** /**
* 组织架构 VO * 组织架构 vo
* *
* @author xh13k * @author xh13k
* @date 2024/05/16 * @date 2024/05/16
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!