Commit 1002c490 by henry

添加获取总体业务架构资产信息

1 parent f8aae0f3
......@@ -3,6 +3,7 @@ package org.arch.analysis.controller;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang.StringUtils;
import org.arch.analysis.dto.ArchMapDto;
import org.arch.analysis.vo.ArchMapVo;
import org.arch.analysis.service.IArchMapService;
import org.arch.base.Result;
import org.arch.log.annotation.OperLog;
......@@ -14,7 +15,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
/**
* 架构地图控制器
......@@ -35,15 +35,13 @@ public class ArchMapController {
@PostMapping("getOverAllBusAsset")
@OperLog(value = LogOperTypeEnum.QUERY, logTypeValue = LogTypeEnum.BUSI_LOG, operDes = "获取总体业务架构资产信息", moduleName = "架构地图")
public Result getOverAllBusAsset(@RequestBody ArchMapDto mapDto) {
String archType = mapDto.getArchType();
String level = mapDto.getLevel();
String parentAssetId = mapDto.getParentAssetId();
String eleName = mapDto.getEleName();
if (StringUtils.isEmpty(archType)
|| StringUtils.isEmpty(level)
|| StringUtils.isEmpty(eleName)) {
if (StringUtils.isEmpty(eleName)
|| StringUtils.isEmpty(parentAssetId)) {
throw new NullPointerException("架构类型、架构层级及元素名称不能为空;");
}
List<Map<String, Object>> resultDatas = archMapService.getOverAllBusAsset(mapDto);
List<ArchMapVo> resultDatas = archMapService.getOverAllBusAsset(mapDto);
return Result.success(resultDatas);
}
......
......@@ -15,9 +15,17 @@ 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;
import org.arch.analysis.dto.ArchMapDto;
import org.arch.analysis.vo.ArchMapVo;
import java.util.List;
import java.util.Map;
public interface ArchMapMapper {
List<Map<String, Object>> getOverAllBusAsset(ArchMapDto mapDto);
List<ArchMapVo> getOverAllBusAsset(ArchMapDto mapDto);
}
......@@ -2,10 +2,10 @@ package org.arch.analysis.service;
import org.arch.analysis.dto.ArchMapDto;
import org.arch.analysis.vo.ArchMapVo;
import java.util.List;
import java.util.Map;
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;
import org.arch.analysis.dto.ArchMapDto;
import org.arch.analysis.vo.ArchMapVo;
import org.arch.analysis.mapper.ArchMapMapper;
import org.arch.analysis.service.IArchMapService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
@Service
public class ArchMapServiceImpl implements IArchMapService {
......@@ -16,7 +16,7 @@ public class ArchMapServiceImpl implements IArchMapService {
private ArchMapMapper archMapMapper;
@Override
public List<Map<String, Object>> getOverAllBusAsset(ArchMapDto mapDto) {
public List<ArchMapVo> getOverAllBusAsset(ArchMapDto mapDto) {
return archMapMapper.getOverAllBusAsset(mapDto);
}
}
package org.arch.analysis.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
public class ArchMapVo {
/**
* 元素名称
*/
private String eleName;
/**
* 资产名称
*/
private String assetName;
/**
* 元素id
*/
private String elementId;
/**
* 级别
*/
private String eaLevel;
/**
* 父级资产名称
*/
private String parentAssetId;
/**
* 架构类型
*/
private String archiType;
public String getEleName() {
return eleName;
}
public void setEleName(String eleName) {
this.eleName = eleName;
}
public String getAssetName() {
return assetName;
}
public void setAssetName(String assetName) {
this.assetName = assetName;
}
public String getElementId() {
return elementId;
}
public void setElementId(String elementId) {
this.elementId = elementId;
}
public String getEaLevel() {
return eaLevel;
}
public void setEaLevel(String eaLevel) {
this.eaLevel = eaLevel;
}
public String getParentAssetId() {
return parentAssetId;
}
public void setParentAssetId(String parentAssetId) {
this.parentAssetId = parentAssetId;
}
public String getArchiType() {
return archiType;
}
public void setArchiType(String archiType) {
this.archiType = archiType;
}
public ArchMapVo() {
}
@Override
public String toString() {
return "ArchMapVo{" +
"eleName='" + eleName + '\'' +
", assetName='" + assetName + '\'' +
", elementId='" + elementId + '\'' +
", eaLevel='" + eaLevel + '\'' +
", parentAssetId='" + parentAssetId + '\'' +
", archiType='" + archiType + '\'' +
'}';
}
}
......@@ -76,7 +76,7 @@
<!-- 本地环境 -->
<springProfile name="local">
<root level="INFO">
<root level="DEBUG">
<appender-ref ref="STDOUT"/>
<appender-ref ref="INFO_FILE"/>
<appender-ref ref="ERROR_FILE"/>
......
<?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">
<mapper namespace="org.arch.analysis.mapper.ArchMapMapper">
<select id="getOverAllBusAsset" resultType="java.util.Map" parameterType="org.arch.analysis.dto.ArchMapDto">
SELECT
n.asset_name,
archi_asset_type,
archi_type,
asset_code
FROM
archi_asset_info n
WHERE
n.archi_type = #{archType}
AND n.ele_name = #{eleName}
AND n.parent_asset_id = 0
AND n.asset_code IS NOT NULL
<select id="getOverAllBusAsset" resultType="org.arch.analysis.vo.ArchMapVo" parameterType="org.arch.analysis.dto.ArchMapDto">
select
ele_name as eleName,
n.asset_name as assetName,
m.element_id as elementId,
m.ea_level as eaLevel,
n.parent_asset_id as parentAssetId,
n.archi_type as archiType
from
archi_asset_info n,
archi_element m
where
n.archi_type = 'ARCHI_BUSINESS'
and n.archi_ele_id = m.element_id
and n.ele_name = #{eleName}
<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>
</mapper>
\ No newline at end of file
......@@ -5,7 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 组织架构 VO
* 组织架构 vo
*
* @author xh13k
* @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!