Merge remote-tracking branch 'origin/dev' into dev
commit
0363ab8b21
|
@ -0,0 +1,15 @@
|
|||
package net.srt.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import net.srt.service.MetadataCollectService;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("metadata-collect")
|
||||
@Tag(name = "数据治理-元数据采集")
|
||||
@AllArgsConstructor
|
||||
public class MetadataCollectController {
|
||||
private final MetadataCollectService metadataCollectService;
|
||||
}
|
|
@ -21,14 +21,25 @@ import java.util.List;
|
|||
public class MetamodelController {
|
||||
private final MetamodelService metamodelService;
|
||||
|
||||
/**
|
||||
* 获取元模型列表
|
||||
*/
|
||||
@GetMapping("list-tree")
|
||||
@Operation(summary = "获取元模型列表")
|
||||
public Result<List<TreeNodeVo>> listTree(){
|
||||
// 调用metamodelService的listTree方法获取元模型列表
|
||||
List<TreeNodeVo> TreeNodeVos = metamodelService.listTree();
|
||||
// 将元模型列表返回给客户端
|
||||
return Result.ok(TreeNodeVos);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据ID获取信息
|
||||
* @param id ID值
|
||||
* @return 信息的Result对象
|
||||
*/
|
||||
@GetMapping("{id}")
|
||||
@Operation(summary = "信息")
|
||||
public Result<MetamodelVO> get(@PathVariable("id") Long id){
|
||||
|
@ -36,6 +47,13 @@ public class MetamodelController {
|
|||
return Result.ok(MetamodelConvert.INSTANCE.convert(entity));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 保存功能
|
||||
*
|
||||
* @param vo 要保存的信息
|
||||
* @return 保存结果
|
||||
*/
|
||||
@PostMapping
|
||||
@Operation(summary = "保存")
|
||||
public Result<String> save(@RequestBody MetamodelVO vo){
|
||||
|
@ -43,6 +61,13 @@ public class MetamodelController {
|
|||
return Result.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改操作
|
||||
*
|
||||
* @param vo 修改参数
|
||||
* @return 修改结果
|
||||
*/
|
||||
@PutMapping
|
||||
@Operation(summary = "修改")
|
||||
public Result<String> update(@RequestBody MetamodelVO vo){
|
||||
|
@ -50,10 +75,17 @@ public class MetamodelController {
|
|||
return Result.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据指定的ID删除数据
|
||||
* @param id 要删除的数据的ID
|
||||
* @return 删除结果
|
||||
*/
|
||||
@DeleteMapping("/{id}")
|
||||
@Operation(summary = "删除")
|
||||
public Result<String> delete(@PathVariable Long id){
|
||||
metamodelService.delete(id);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -22,6 +22,11 @@ import java.util.List;
|
|||
public class MetamodelPropertyController {
|
||||
private final MetamodelPropertyService metamodelPropertyService;
|
||||
|
||||
/**
|
||||
* 根据id获取属性列表
|
||||
* @param id 属性id
|
||||
* @return 属性列表
|
||||
*/
|
||||
@GetMapping("/properties/{metaModelId}")
|
||||
@Operation(summary = "根据id获取属性列表")
|
||||
public Result<List<MetamodelPropertyVO>> properties(@PathVariable Long id){
|
||||
|
@ -29,6 +34,12 @@ public class MetamodelPropertyController {
|
|||
return Result.ok(properties);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询属性
|
||||
* @param query 属性查询对象
|
||||
* @return 分页结果
|
||||
*/
|
||||
@GetMapping("page")
|
||||
@Operation(summary = "分页")
|
||||
public Result<PageResult<MetamodelPropertyVO>> page(@Valid MetamodelpropertyQuery query){
|
||||
|
@ -36,6 +47,13 @@ public class MetamodelPropertyController {
|
|||
return Result.ok(page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据ID获取信息
|
||||
*
|
||||
* @param id ID值
|
||||
* @return 信息的Result对象
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
@Operation(summary = "信息")
|
||||
public Result<MetamodelPropertyVO> get(@PathVariable("id") Long id){
|
||||
|
@ -43,6 +61,13 @@ public class MetamodelPropertyController {
|
|||
return Result.ok(MetamodelPropertyConvert.INSTANCE.convert(entity));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 保存功能
|
||||
*
|
||||
* @param vo 要保存的数据
|
||||
* @return 保存结果
|
||||
*/
|
||||
@PostMapping
|
||||
@Operation(summary = "保存")
|
||||
public Result<String> save(@RequestBody MetamodelPropertyVO vo){
|
||||
|
@ -50,6 +75,13 @@ public class MetamodelPropertyController {
|
|||
return Result.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param vo 要修改的数据
|
||||
* @return 修改结果
|
||||
*/
|
||||
@PutMapping
|
||||
@Operation(summary = "修改")
|
||||
public Result<String> update(@RequestBody MetamodelPropertyVO vo){
|
||||
|
@ -57,10 +89,18 @@ public class MetamodelPropertyController {
|
|||
return Result.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除功能
|
||||
*
|
||||
* @param idList 要删除的数据ID列表
|
||||
* @return 删除结果
|
||||
*/
|
||||
@DeleteMapping
|
||||
@Operation(summary = "删除")
|
||||
public Result<String> delete(@RequestBody List<Long> idList){
|
||||
metamodelPropertyService.delete(idList);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -11,7 +11,6 @@ import net.srt.framework.common.utils.Result;
|
|||
import net.srt.query.QualityRuleQuery;
|
||||
import net.srt.service.QualityRuleService;
|
||||
import net.srt.vo.QualityRuleVo;
|
||||
import oracle.ucp.proxy.annotation.Post;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
package net.srt.dao;
|
||||
|
||||
import net.srt.entity.MetadataCollectEntity;
|
||||
import net.srt.framework.mybatis.dao.BaseDao;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface MetadataCollectDao extends BaseDao<MetadataCollectEntity> {
|
||||
}
|
|
@ -12,4 +12,5 @@ import org.apache.ibatis.annotations.Mapper;
|
|||
*/
|
||||
@Mapper
|
||||
public interface StandardDao extends BaseMapper<StandardEntity> {
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
package net.srt.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import net.srt.framework.mybatis.entity.BaseEntity;
|
||||
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Data
|
||||
@TableName("data_governance_metadata_collect")
|
||||
public class MetadataCollectEntity extends BaseEntity {
|
||||
|
||||
}
|
|
@ -3,11 +3,12 @@ package net.srt.entity;
|
|||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import net.srt.framework.mybatis.entity.BaseEntity;
|
||||
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Data
|
||||
@TableName("data_governance_metamodel_property")
|
||||
public class MetamodelPropertyEntity {
|
||||
public class MetamodelPropertyEntity extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 元模型id
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
package net.srt.service;
|
||||
|
||||
import net.srt.entity.MetadataCollectEntity;
|
||||
import net.srt.framework.mybatis.service.BaseService;
|
||||
|
||||
public interface MetadataCollectService extends BaseService<MetadataCollectEntity> {
|
||||
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package net.srt.service.impl;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import net.srt.dao.MetadataCollectDao;
|
||||
import net.srt.entity.MetadataCollectEntity;
|
||||
import net.srt.framework.mybatis.service.impl.BaseServiceImpl;
|
||||
import net.srt.service.MetadataCollectService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class MetadataCollectServiceImpl extends BaseServiceImpl<MetadataCollectDao, MetadataCollectEntity> implements MetadataCollectService {
|
||||
}
|
|
@ -13,6 +13,7 @@ import net.srt.query.MetamodelpropertyQuery;
|
|||
import net.srt.service.MetamodelPropertyService;
|
||||
import net.srt.vo.MetamodelPropertyVO;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import srt.cloud.framework.dbswitch.common.util.StringUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -20,45 +21,92 @@ import java.util.List;
|
|||
@Service
|
||||
public class MetamodelPropertyServiceImpl extends BaseServiceImpl<MetamodelPropertyDao, MetamodelPropertyEntity> implements MetamodelPropertyService {
|
||||
|
||||
/**
|
||||
* 根据元模型ID获取属性列表
|
||||
*
|
||||
* @param id 元模型ID
|
||||
* @return 属性列表
|
||||
*/
|
||||
@Override
|
||||
public List<MetamodelPropertyVO> properties(Long id) {
|
||||
LambdaQueryWrapper<MetamodelPropertyEntity> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(MetamodelPropertyEntity::getMetamodelId, id).orderByAsc(MetamodelPropertyEntity::getOrderNo);
|
||||
wrapper.eq(MetamodelPropertyEntity::getMetamodelId, id)
|
||||
.orderByAsc(MetamodelPropertyEntity::getOrderNo);
|
||||
return MetamodelPropertyConvert.INSTANCE.convertList(baseMapper.selectList(wrapper));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询元模型属性
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 分页结果
|
||||
*/
|
||||
@Override
|
||||
public PageResult<MetamodelPropertyVO> page(MetamodelpropertyQuery query) {
|
||||
IPage<MetamodelPropertyEntity> page = baseMapper.selectPage(getPage(query), getWrapper(query));
|
||||
return new PageResult<>(MetamodelPropertyConvert.INSTANCE.convertList(page.getRecords()),page.getTotal());
|
||||
return new PageResult<>(MetamodelPropertyConvert.INSTANCE.convertList(page.getRecords()), page.getTotal());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 生成LambdaQueryWrapper对象,用于查询元模型属性
|
||||
* @param query 元模型属性查询对象
|
||||
* @return LambdaQueryWrapper<MetamodelPropertyEntity> 查询对象
|
||||
*/
|
||||
private LambdaQueryWrapper<MetamodelPropertyEntity> getWrapper(MetamodelpropertyQuery query) {
|
||||
LambdaQueryWrapper<MetamodelPropertyEntity> wrapper = Wrappers.lambdaQuery();
|
||||
wrapper.eq(MetamodelPropertyEntity::getMetamodelId, query.getMetamodelId())
|
||||
.like(StringUtil.isBlank(query.getName()),MetamodelPropertyEntity::getName,query.getName())
|
||||
.like(StringUtil.isBlank(query.getCode()),MetamodelPropertyEntity::getCode,query.getCode())
|
||||
.like(StringUtil.isNotBlank(query.getName()), MetamodelPropertyEntity::getName, query.getName())
|
||||
.like(StringUtil.isNotBlank(query.getCode()), MetamodelPropertyEntity::getCode, query.getCode())
|
||||
.orderByAsc(MetamodelPropertyEntity::getOrderNo);
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void save(MetamodelPropertyVO vo) {
|
||||
// 将MetamodelPropertyVO对象转换为MetamodelPropertyEntity对象
|
||||
MetamodelPropertyEntity entity = MetamodelPropertyConvert.INSTANCE.convert(vo);
|
||||
|
||||
// 设置Builtin为0
|
||||
entity.setBuiltin(0);
|
||||
|
||||
// 设置ProjectId为当前项目Id
|
||||
entity.setProjectId(getProjectId());
|
||||
|
||||
// 将MetamodelPropertyEntity对象插入数据库
|
||||
baseMapper.insert(entity);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void update(MetamodelPropertyVO vo) {
|
||||
// 将MetamodelPropertyVO对象转换为MetamodelPropertyEntity对象
|
||||
MetamodelPropertyEntity entity = MetamodelPropertyConvert.INSTANCE.convert(vo);
|
||||
|
||||
// 设置Builtin为0
|
||||
entity.setBuiltin(0);
|
||||
|
||||
// 设置ProjectId为当前项目Id
|
||||
entity.setProjectId(getProjectId());
|
||||
|
||||
// 根据id更新MetamodelPropertyEntity对象信息
|
||||
updateById(entity);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除指定id列表的数据
|
||||
*
|
||||
* @param idList 要删除的数据id列表
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void delete(List<Long> idList) {
|
||||
|
||||
removeByIds(idList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -17,6 +17,10 @@ import srt.cloud.framework.dbswitch.common.util.StringUtil;
|
|||
import java.util.List;
|
||||
@Service
|
||||
public class MetamodelServiceImpl extends BaseServiceImpl<MetamodelDao, MetamodelEntity> implements MetamodelService {
|
||||
/**
|
||||
* 重写父类方法,查询并返回当前项目下的元模型和公共的元模型的树结构列表
|
||||
* @return List<TreeNodeVo> 树结构列表
|
||||
*/
|
||||
@Override
|
||||
public List<TreeNodeVo> listTree() {
|
||||
LambdaQueryWrapper<MetamodelEntity> wrapper = new LambdaQueryWrapper<>();
|
||||
|
@ -25,65 +29,117 @@ public class MetamodelServiceImpl extends BaseServiceImpl<MetamodelDao, Metamode
|
|||
.or()
|
||||
.eq(MetamodelEntity::getProjectId, 0)
|
||||
.orderByAsc(MetamodelEntity::getOrderNo);
|
||||
|
||||
//查询元模型实体列表
|
||||
List<MetamodelEntity> dataGovernanceMetamodelEntities = baseMapper.selectList(wrapper);
|
||||
|
||||
//将元模型实体列表转换为TreeNodeVo列表
|
||||
List<TreeNodeVo> treeNodeVos = BeanUtil.copyListProperties(dataGovernanceMetamodelEntities, TreeNodeVo::new, (oldItem, newItem) -> {
|
||||
newItem.setLabel(oldItem.getName());
|
||||
newItem.setValue(oldItem.getId());
|
||||
newItem.setDisabled(oldItem.getIfLeaf() == 1);
|
||||
newItem.setLabel(oldItem.getName()); //设置树节点的显示文本
|
||||
newItem.setValue(oldItem.getId()); //设置树节点的值
|
||||
newItem.setDisabled(oldItem.getIfLeaf() == 1); //设置树节点是否禁用
|
||||
if (newItem.getPath().contains("/")) {
|
||||
newItem.setParentPath(newItem.getPath().substring(0, newItem.getPath().lastIndexOf("/")));
|
||||
newItem.setParentPath(newItem.getPath().substring(0, newItem.getPath().lastIndexOf("/"))); //设置树节点的父级路径
|
||||
}
|
||||
});
|
||||
|
||||
//构建树结构
|
||||
return BuildTreeUtils.buildTree(treeNodeVos);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 保存MetamodelVO对象
|
||||
*
|
||||
* @param vo MetamodelVO对象
|
||||
*/
|
||||
@Override
|
||||
public void save(MetamodelVO vo) {
|
||||
// 将MetamodelVO对象转换为MetamodelEntity对象
|
||||
MetamodelEntity entity = MetamodelConvert.INSTANCE.convert(vo);
|
||||
entity.setPath(recursionPath(entity,null));
|
||||
// 设置MetamodelEntity对象的路径
|
||||
entity.setPath(recursionPath(entity, null));
|
||||
// 设置MetamodelEntity对象的项目ID
|
||||
entity.setProjectId(getProjectId());
|
||||
// 设置MetamodelEntity对象的内置属性为0
|
||||
entity.setBuiltin(0);
|
||||
// 构建MetamodelEntity对象的字段
|
||||
buildField(entity);
|
||||
// 将MetamodelEntity对象插入数据库
|
||||
baseMapper.insert(entity);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void update(MetamodelVO vo) {
|
||||
// 将 MetamodelVO 对象转换为 MetamodelEntity 对象
|
||||
MetamodelEntity entity = MetamodelConvert.INSTANCE.convert(vo);
|
||||
entity.setPath(recursionPath(entity,null));
|
||||
|
||||
// 设置 recursionPath 方法返回的路径为当前 entity 对象的路径
|
||||
entity.setPath(recursionPath(entity, null));
|
||||
|
||||
// 设置当前 entity 对象的项目 ID 为当前类实例的项目 ID
|
||||
entity.setProjectId(getProjectId());
|
||||
|
||||
// 设置当前 entity 对象的 builtin 属性为 0
|
||||
entity.setBuiltin(0);
|
||||
|
||||
// 构建当前 entity 对象的字段信息
|
||||
buildField(entity);
|
||||
|
||||
// 根据当前 entity 对象的 ID 更新实体信息
|
||||
updateById(entity);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void delete(Long id) {
|
||||
// 创建一个LambdaQueryWrapper对象,用于构建查询条件
|
||||
LambdaQueryWrapper<MetamodelEntity> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(MetamodelEntity::getParentId,id).last("limit 1");
|
||||
if(baseMapper.selectOne(wrapper)!=null){
|
||||
// 设置查询条件,查找ParentId等于给定id的记录,一次只查询一条记录
|
||||
wrapper.eq(MetamodelEntity::getParentId, id).last("limit 1");
|
||||
// 如果根据查询条件查到的记录不为空,则抛出异常
|
||||
if (baseMapper.selectOne(wrapper) != null) {
|
||||
throw new ServerException("存在子节点,不可删除!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void buildField(MetamodelEntity entity) {
|
||||
// 根据实体类的ifLeaf属性判断该实体是叶子节点还是文件夹节点
|
||||
if(entity.getIfLeaf() == 0){
|
||||
// 如果是叶子节点,则设置图标为模型图片
|
||||
entity.setIcon("/src/assets/model.png");
|
||||
}else {
|
||||
// 如果是文件夹节点,则设置图标为文件夹图片
|
||||
entity.setIcon("/src/assets/folder.png");
|
||||
}
|
||||
}
|
||||
|
||||
private String recursionPath(MetamodelEntity metamodelEntity,String path){
|
||||
|
||||
/**
|
||||
* 递归生成实体类的路径
|
||||
* @param metamodelEntity 实体类对象
|
||||
* @param path 当前路径
|
||||
* @return 生成的路径
|
||||
*/
|
||||
private String recursionPath(MetamodelEntity metamodelEntity, String path){
|
||||
// 如果路径为空,则将路径设置为实体类的名称
|
||||
if(StringUtil.isBlank(path)){
|
||||
path = metamodelEntity.getName();
|
||||
}
|
||||
// 如果实体类的父ID不为0,即存在父类
|
||||
if(metamodelEntity.getParentId()!=0){
|
||||
// 获取父类实体对象
|
||||
MetamodelEntity parent = getById(metamodelEntity.getParentId());
|
||||
// 将父类名称加上斜杠以及当前路径,生成新的路径
|
||||
path = parent.getName() + "/" + path;
|
||||
return recursionPath(parent,path);
|
||||
// 递归调用本方法,传入父类对象以及新的路径
|
||||
return recursionPath(parent, path);
|
||||
}
|
||||
// 返回生成的路径
|
||||
return path;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
package net.srt.system.convert;
|
||||
|
||||
|
||||
import net.srt.system.entity.DatastandardEntity;
|
||||
import net.srt.system.vo.StandardManagementVo;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @BelongsProject: srt_cloud
|
||||
* @BelongsPackage: net.srt.convert
|
||||
* @Author: jpz
|
||||
* @CreateTime: 2023/12/20 19:50
|
||||
*/
|
||||
|
||||
@Mapper
|
||||
public interface DatastandardConvert {
|
||||
DatastandardConvert INSTANCE = Mappers.getMapper(DatastandardConvert.class);
|
||||
|
||||
|
||||
List<StandardManagementVo> convertList(List<DatastandardEntity> list);
|
||||
|
||||
StandardManagementVo convert(DatastandardEntity entity);
|
||||
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package net.srt.system.convert;
|
||||
|
||||
|
||||
import net.srt.system.entity.MetamodelEntity;
|
||||
import net.srt.system.vo.MetamodelVO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
@Mapper
|
||||
public interface MetamodelConvert {
|
||||
MetamodelConvert INSTANCE = Mappers.getMapper(MetamodelConvert.class);
|
||||
|
||||
MetamodelEntity convert(MetamodelVO vo);
|
||||
|
||||
MetamodelVO convert(MetamodelEntity entity);
|
||||
|
||||
List<MetamodelVO> convertList(List<MetamodelEntity> list);
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package net.srt.system.convert;
|
||||
|
||||
|
||||
import net.srt.system.entity.MetamodelPropertyEntity;
|
||||
import net.srt.system.vo.MetamodelPropertyVO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface MetamodelPropertyConvert {
|
||||
MetamodelPropertyConvert INSTANCE = Mappers.getMapper(MetamodelPropertyConvert.class);
|
||||
|
||||
MetamodelPropertyEntity convert(MetamodelPropertyVO vo);
|
||||
|
||||
MetamodelPropertyVO convert(MetamodelPropertyEntity entity);
|
||||
|
||||
List<MetamodelPropertyVO> convertList(List<MetamodelPropertyEntity> list);
|
||||
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package net.srt.system.convert;
|
||||
|
||||
|
||||
import net.srt.system.entity.QualityQueryEntity;
|
||||
import net.srt.system.vo.QualityRuleVo;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @BelongsProject: srt_cloud
|
||||
* @BelongsPackage: net.srt.convert
|
||||
* @Author: jpz
|
||||
* @CreateTime: 2023/12/20 19:50
|
||||
*/
|
||||
@Mapper
|
||||
public interface QualityRuleConvert {
|
||||
|
||||
|
||||
QualityRuleConvert INSTANCE = Mappers.getMapper(QualityRuleConvert.class);
|
||||
|
||||
|
||||
List<QualityRuleVo> convertList(List<QualityQueryEntity> list);
|
||||
|
||||
QualityQueryEntity conver(QualityRuleVo vo);
|
||||
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package net.srt.system.convert;
|
||||
|
||||
|
||||
import net.srt.system.entity.QualityTaskEntity;
|
||||
import net.srt.system.vo.QualityTaskVo;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @BelongsProject: srt_cloud
|
||||
* @BelongsPackage: net.srt.convert
|
||||
* @Author: jpz
|
||||
* @CreateTime: 2023/12/21 11:42
|
||||
*/
|
||||
@Mapper
|
||||
public interface QualityTaskConvert {
|
||||
|
||||
|
||||
QualityTaskConvert INSTANCE = Mappers.getMapper(QualityTaskConvert.class);
|
||||
|
||||
List<QualityTaskVo> covertList(List<QualityTaskEntity> list);
|
||||
|
||||
QualityTaskVo covert(QualityTaskEntity entity);
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
package net.srt.system.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import net.srt.framework.mybatis.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* @ClassName : DatastandardEntity
|
||||
* @Description :
|
||||
* @Author : FJJ
|
||||
* @Date: 2023-12-21 11:09
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Data
|
||||
@TableName("standard_management")
|
||||
public class DatastandardEntity extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
@TableId("id")
|
||||
private Long id;
|
||||
private Integer categoryId;
|
||||
private String engName;
|
||||
private String cnName;
|
||||
private Integer codeNum;
|
||||
private String dataType;
|
||||
private Integer dataLength;
|
||||
private Integer dataPrecision;
|
||||
private Integer nullable;
|
||||
private Integer standardCodeId;
|
||||
private Integer type;
|
||||
private String note;
|
||||
private Integer projectId;
|
||||
private Integer status;
|
||||
private Integer version;
|
||||
private Integer deleted;
|
||||
private Integer ifStandardRel;
|
||||
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
package net.srt.system.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import net.srt.framework.mybatis.entity.BaseEntity;
|
||||
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Data
|
||||
@TableName("data_governance_metamodel")
|
||||
public class MetamodelEntity extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 父id(顶级为0)
|
||||
*/
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 代码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 路径
|
||||
*/
|
||||
private String path;
|
||||
|
||||
/**
|
||||
* 是否内置元模型 0-否,1-是
|
||||
*/
|
||||
private Integer builtin;
|
||||
|
||||
/**
|
||||
* 图标
|
||||
*/
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* 是否是目录 0-否 1-是
|
||||
*/
|
||||
private Integer ifLeaf;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 项目id(租户id)
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
|
||||
private Integer orderNo;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
package net.srt.system.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import net.srt.framework.mybatis.entity.BaseEntity;
|
||||
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Data
|
||||
@TableName("data_governance_metamodel_property")
|
||||
public class MetamodelPropertyEntity extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 元模型id
|
||||
*/
|
||||
private Integer metamodelId;
|
||||
|
||||
/**
|
||||
* 属性名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 属性代码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 数据类型 1-数字 2-字符串
|
||||
*/
|
||||
private Integer dataType;
|
||||
|
||||
/**
|
||||
* 数据长度
|
||||
*/
|
||||
private Integer dataLength;
|
||||
|
||||
/**
|
||||
* 输入控件,1-文本框
|
||||
*/
|
||||
private Integer inputType;
|
||||
|
||||
/**
|
||||
* 允许为空 0-否 1-是
|
||||
*/
|
||||
private Integer nullable;
|
||||
|
||||
/**
|
||||
* 是否内置 0-否 1-是
|
||||
*/
|
||||
private Integer builtin;
|
||||
|
||||
/**
|
||||
* 项目id(租户id)
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 注释
|
||||
*/
|
||||
private String comment;
|
||||
|
||||
/**
|
||||
* 序号
|
||||
*/
|
||||
private Integer orderNo;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
package net.srt.system.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import net.srt.framework.mybatis.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* @BelongsProject: srt_cloud
|
||||
* @BelongsPackage: net.srt.entity
|
||||
* @Author: jpz
|
||||
* @CreateTime: 2023/12/20 19:51
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@SuperBuilder
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName(value = "data_governance_quality_rule")
|
||||
public class QualityQueryEntity extends BaseEntity {
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
// /**
|
||||
// * 英文名称
|
||||
// */
|
||||
// private String engName;
|
||||
//
|
||||
// /**
|
||||
// * 1-唯一性 2-规范性 3-有效性 4-完整性 5-一致性 6-及时性 7-准确性
|
||||
// */
|
||||
// private Integer type;
|
||||
//
|
||||
// /**
|
||||
// * 字段配置 0-单选 1-多选
|
||||
// */
|
||||
// private Integer ifColumnMultiple;
|
||||
//
|
||||
// /**
|
||||
// * 说明
|
||||
// */
|
||||
// private String description;
|
||||
//
|
||||
// /**
|
||||
// * 来源 1-内置
|
||||
// */
|
||||
// private Integer builtIn;
|
||||
//
|
||||
// private Long projectId;
|
||||
// /**
|
||||
// * 个性化参数
|
||||
// */
|
||||
// @TableField(typeHandler = JacksonTypeHandler.class)
|
||||
// private List<QualityParam> param;
|
||||
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
package net.srt.system.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @BelongsProject: srt_cloud
|
||||
* @BelongsPackage: net.srt.entity
|
||||
* @Author: jpz
|
||||
* @CreateTime: 2023/12/21 10:46
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Data
|
||||
@TableName(value = "data_governance_quality_task", autoResultMap = true)
|
||||
public class QualityTaskEntity {
|
||||
//id
|
||||
private Long id;
|
||||
//规则配置
|
||||
private Integer qualityConfigId;
|
||||
//名称
|
||||
private String name;
|
||||
//运行状态(1-等待中 2-运行中 3-正常结束 4-异常异常)
|
||||
private Integer status;
|
||||
//检测条数
|
||||
private Integer checkCount;
|
||||
//检测通过条数
|
||||
private Integer passCount;
|
||||
//未通过条数
|
||||
private Integer notPassCount;
|
||||
//开始时间
|
||||
private Date startTime;
|
||||
//结束时间
|
||||
private Date endTime;
|
||||
//错误日志
|
||||
private String errorLog;
|
||||
//项目id
|
||||
private Integer projectId;
|
||||
//版本号
|
||||
private Integer version;
|
||||
//删除标识 0:正常 1:删除
|
||||
private Integer deleted;
|
||||
//创建者
|
||||
private Integer creator;
|
||||
//创建时间
|
||||
private Date createTime;
|
||||
//更新者
|
||||
private Integer updater;
|
||||
//更新时间
|
||||
private Date updateTime;
|
||||
|
||||
}
|
|
@ -0,0 +1,79 @@
|
|||
package net.srt.system.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import net.srt.framework.common.utils.DateUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Schema(description = "数据治理-元模型属性")
|
||||
public class MetamodelPropertyVO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "主键id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "元模型id")
|
||||
private Integer metamodelId;
|
||||
|
||||
@Schema(description = "属性名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "属性代码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "数据类型 1-数字 2-字符串")
|
||||
private Integer dataType;
|
||||
|
||||
@Schema(description = "数据长度")
|
||||
private Integer dataLength;
|
||||
|
||||
@Schema(description = "输入控件,1-文本框")
|
||||
private Integer inputType;
|
||||
|
||||
@Schema(description = "允许为空 0-否 1-是")
|
||||
private Integer nullable;
|
||||
|
||||
@Schema(description = "是否内置 0-否 1-是")
|
||||
private Integer builtin;
|
||||
|
||||
@Schema(description = "项目id(租户id)")
|
||||
private Long projectId;
|
||||
|
||||
@Schema(description = "注释")
|
||||
private String comment;
|
||||
|
||||
@Schema(description = "序号")
|
||||
private Integer orderNo;
|
||||
|
||||
@Schema(description = "版本号")
|
||||
private Integer version;
|
||||
|
||||
@Schema(description = "删除标识 0:正常 1:已删除")
|
||||
private Integer deleted;
|
||||
|
||||
@Schema(description = "创建者")
|
||||
private Long creator;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||
private Date createTime;
|
||||
|
||||
@Schema(description = "更新者")
|
||||
private Long updater;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||
private Date updateTime;
|
||||
|
||||
@Schema(description = "元模型属性id")
|
||||
private Long metamodelPropertyId;
|
||||
@Schema(description = "元数据的属性值")
|
||||
private String value;
|
||||
@Schema(description = "元数据属性的主键id")
|
||||
private Long metadataPropertyId;
|
||||
|
||||
}
|
|
@ -0,0 +1,69 @@
|
|||
package net.srt.system.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import net.srt.framework.common.utils.DateUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Schema(description = "数据治理-元模型")
|
||||
public class MetamodelVO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "主键id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "父id(顶级为0)")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "代码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "路径")
|
||||
private String path;
|
||||
|
||||
@Schema(description = "是否内置元模型 0-否,1-是")
|
||||
private Integer builtin;
|
||||
|
||||
@Schema(description = "图标")
|
||||
private String icon;
|
||||
|
||||
@Schema(description = "是否是目录 0-否 1-是")
|
||||
private Integer ifLeaf;
|
||||
|
||||
@Schema(description = "描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "项目id(租户id)")
|
||||
private Long projectId;
|
||||
|
||||
private Integer orderNo;
|
||||
|
||||
@Schema(description = "版本号")
|
||||
private Integer version;
|
||||
|
||||
@Schema(description = "删除标识 0:正常 1:已删除")
|
||||
private Integer deleted;
|
||||
|
||||
@Schema(description = "创建者")
|
||||
private Long creator;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||
private Date createTime;
|
||||
|
||||
@Schema(description = "更新者")
|
||||
private Long updater;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,69 @@
|
|||
package net.srt.system.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import net.srt.api.module.data.governance.dto.quality.QualityParam;
|
||||
import net.srt.framework.common.utils.DateUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @BelongsProject: srt_cloud
|
||||
* @BelongsPackage: net.srt.vo
|
||||
* @Author: jpz
|
||||
* @CreateTime: 2023/12/20 19:43
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "数据质量")
|
||||
public class QualityRuleVo implements Serializable{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "主键id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "英文名称")
|
||||
private String engName;
|
||||
|
||||
@Schema(description = "1-唯一性 2-规范性 3-有效性 4-完整性 5-一致性 6-及时性 7-准确性")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "字段配置 0-单选 1-多选")
|
||||
private Integer ifColumnMultiple;
|
||||
|
||||
@Schema(description = "说明")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "来源 1-内置")
|
||||
private Integer builtIn;
|
||||
private Long projectId;
|
||||
|
||||
@Schema(description = "个性化参数")
|
||||
private List<QualityParam> param;
|
||||
|
||||
@Schema(description = "版本号")
|
||||
private Integer version;
|
||||
|
||||
@Schema(description = "删除标识 0:正常 1:已删除")
|
||||
private Integer deleted;
|
||||
|
||||
@Schema(description = "创建者")
|
||||
private Long creator;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||
private Date createTime;
|
||||
|
||||
@Schema(description = "更新者")
|
||||
private Long updater;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||
private Date updateTime;
|
||||
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
package net.srt.system.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import net.srt.framework.common.utils.DateUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @BelongsProject: srt_cloud
|
||||
* @BelongsPackage: net.srt.vo
|
||||
* @Author: jpz
|
||||
* @CreateTime: 2023/12/21 10:43
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "数据治理-质量任务")
|
||||
public class QualityTaskVo implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "主键id")
|
||||
private Long id;
|
||||
@Schema(description = "规则配置id")
|
||||
private Integer qualityConfigId;
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
@Schema(description = "运行状态(1-等待中 2-运行中 3-正常结束 4-异常结束)")
|
||||
private Integer status;
|
||||
@Schema(description = "检测条数")
|
||||
private Integer checkCount;
|
||||
@Schema(description = "检测通过条数")
|
||||
private Integer passCount;
|
||||
@Schema(description = "未通过条数")
|
||||
private Integer notPassCount;
|
||||
@Schema(description = "开始时间")
|
||||
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||
private Date startTime;
|
||||
@Schema(description = "结束时间")
|
||||
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||
private Date endTime;
|
||||
@Schema(description = "错误日志")
|
||||
private String errorLog;
|
||||
@Schema(description = "项目id")
|
||||
private Integer projectId;
|
||||
@Schema(description = "版本号")
|
||||
private Integer version;
|
||||
@Schema(description = "删除标识 0:正常 1:删除")
|
||||
private Integer deleted;
|
||||
@Schema(description = "创建者")
|
||||
private Integer creator;
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||
private Date createTime;
|
||||
@Schema(description = "更新者")
|
||||
private Integer updater;
|
||||
@Schema(description = "更新时间")
|
||||
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
package net.srt.system.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @ClassName : StandardManagementVo
|
||||
* @Description : 标准管理表
|
||||
* @Author : FJJ
|
||||
* @Date: 2023-12-20 11:24
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "标准管理查询")
|
||||
public class StandardManagementVo implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
@TableId("id")
|
||||
private Long id;
|
||||
private Integer categoryId;
|
||||
private String engName;
|
||||
private String cnName;
|
||||
private Integer codeNum;
|
||||
private String dataType;
|
||||
private Integer dataLength;
|
||||
private Integer dataPrecision;
|
||||
private Integer nullable;
|
||||
private Integer standardCodeId;
|
||||
private Integer type;
|
||||
private String note;
|
||||
private Integer projectId;
|
||||
private Integer status;
|
||||
private Integer version;
|
||||
private Integer deleted;
|
||||
private String creator;
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
private String updater;
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date updateTime;
|
||||
private Integer ifStandardRel;
|
||||
private String group;
|
||||
}
|
Loading…
Reference in New Issue