标准管理3.0
parent
e1f085670d
commit
e5c0b86017
|
@ -44,6 +44,7 @@ public class DatastandardController {
|
||||||
return Result.ok(DatastandardConvert.INSTANCE.convert(entity));
|
return Result.ok(DatastandardConvert.INSTANCE.convert(entity));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/table-code/list")
|
@GetMapping("/table-code/list")
|
||||||
@Operation(summary = "查询表编码")
|
@Operation(summary = "查询表编码")
|
||||||
public Result<List<DatastandardEntity>> getTableCode(){
|
public Result<List<DatastandardEntity>> getTableCode(){
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
package net.srt.convert;
|
||||||
|
|
||||||
|
import net.srt.entity.DatastandardEntity;
|
||||||
|
import net.srt.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);
|
||||||
|
|
||||||
|
}
|
|
@ -4,7 +4,6 @@ import net.srt.entity.QualityQueryEntity;
|
||||||
import net.srt.vo.QualityRuleVo;
|
import net.srt.vo.QualityRuleVo;
|
||||||
import org.mapstruct.Mapper;
|
import org.mapstruct.Mapper;
|
||||||
import org.mapstruct.factory.Mappers;
|
import org.mapstruct.factory.Mappers;
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -16,6 +15,8 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface QualityRuleConvert {
|
public interface QualityRuleConvert {
|
||||||
|
|
||||||
|
|
||||||
QualityRuleConvert INSTANCE = Mappers.getMapper(QualityRuleConvert.class);
|
QualityRuleConvert INSTANCE = Mappers.getMapper(QualityRuleConvert.class);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
package net.srt.dao;
|
||||||
|
|
||||||
|
import net.srt.entity.DatastandardEntity;
|
||||||
|
import net.srt.framework.mybatis.dao.BaseDao;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName : DatastandardDao
|
||||||
|
* @Description :
|
||||||
|
* @Author : FJJ
|
||||||
|
* @Date: 2023-12-21 11:09
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface DatastandardDao extends BaseDao<DatastandardEntity> {
|
||||||
|
}
|
|
@ -0,0 +1,39 @@
|
||||||
|
package net.srt.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;
|
||||||
|
|
||||||
|
}
|
|
@ -3,8 +3,11 @@ package net.srt.entity;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
import net.srt.framework.mybatis.entity.BaseEntity;
|
import net.srt.framework.mybatis.entity.BaseEntity;
|
||||||
import net.srt.vo.QualityParam;
|
import net.srt.vo.QualityParam;
|
||||||
|
|
||||||
|
@ -16,9 +19,12 @@ import java.util.List;
|
||||||
* @Author: jpz
|
* @Author: jpz
|
||||||
* @CreateTime: 2023/12/20 19:51
|
* @CreateTime: 2023/12/20 19:51
|
||||||
*/
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@SuperBuilder
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@AllArgsConstructor
|
||||||
@TableName(value = "data_governance_quality_rule",autoResultMap=true)
|
@NoArgsConstructor
|
||||||
|
@TableName(value = "data_governance_quality_rule")
|
||||||
public class QualityQueryEntity extends BaseEntity {
|
public class QualityQueryEntity extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 名称
|
* 名称
|
||||||
|
|
|
@ -0,0 +1,57 @@
|
||||||
|
package net.srt.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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件分组表
|
||||||
|
*
|
||||||
|
* @author zrx 985134801@qq.com
|
||||||
|
* @since 1.0.0 2022-11-12
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@SuperBuilder
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@TableName("data_file_category")
|
||||||
|
public class StandardEntity extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 父级id(顶级为0)
|
||||||
|
*/
|
||||||
|
private Long parentId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分组名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分组序号
|
||||||
|
*/
|
||||||
|
private Integer orderNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 描述
|
||||||
|
*/
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分组路径
|
||||||
|
*/
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目id
|
||||||
|
*/
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
package net.srt.service;
|
||||||
|
|
||||||
|
import net.srt.entity.DatastandardEntity;
|
||||||
|
import net.srt.framework.common.page.PageResult;
|
||||||
|
import net.srt.framework.mybatis.service.BaseService;
|
||||||
|
import net.srt.query.StandardManagementQuery;
|
||||||
|
import net.srt.vo.StandardManagementVo;
|
||||||
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName : DatastandardService
|
||||||
|
* @Description :
|
||||||
|
* @Author : FJJ
|
||||||
|
* @Date: 2023-12-21 11:21
|
||||||
|
*/
|
||||||
|
@MapperScan("net.srt.service.DatastandardService")
|
||||||
|
public interface DatastandardService extends BaseService<DatastandardEntity> {
|
||||||
|
PageResult<StandardManagementVo> page(StandardManagementQuery query);
|
||||||
|
|
||||||
|
List<DatastandardEntity> getTableCode();
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,54 @@
|
||||||
|
package net.srt.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import net.srt.convert.DatastandardConvert;
|
||||||
|
import net.srt.dao.DatastandardDao;
|
||||||
|
import net.srt.entity.DatastandardEntity;
|
||||||
|
import net.srt.framework.common.page.PageResult;
|
||||||
|
import net.srt.framework.mybatis.service.impl.BaseServiceImpl;
|
||||||
|
import net.srt.query.StandardManagementQuery;
|
||||||
|
import net.srt.service.DatastandardService;
|
||||||
|
import net.srt.vo.StandardManagementVo;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import srt.cloud.framework.dbswitch.common.util.StringUtil;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName : DatastandardServiceImpl
|
||||||
|
* @Description :
|
||||||
|
* @Author : FJJ
|
||||||
|
* @Date: 2023-12-21 11:21
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class DatastandardServiceImpl extends BaseServiceImpl<DatastandardDao, DatastandardEntity> implements DatastandardService {
|
||||||
|
private final DatastandardDao datastandardDao;
|
||||||
|
@Override
|
||||||
|
public PageResult<StandardManagementVo> page(StandardManagementQuery query) {
|
||||||
|
IPage<DatastandardEntity> page = baseMapper.selectPage(getPage(query), getWrapper(query));
|
||||||
|
return new PageResult<>(DatastandardConvert.INSTANCE.convertList(page.getRecords()), page.getTotal());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DatastandardEntity> getTableCode() {
|
||||||
|
List<DatastandardEntity> list= datastandardDao.selectList(Wrappers.lambdaQuery());
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<DatastandardEntity> getWrapper(StandardManagementQuery query) {
|
||||||
|
LambdaQueryWrapper<DatastandardEntity> wrapper = Wrappers.lambdaQuery();
|
||||||
|
wrapper.like(StringUtil.isNotBlank(query.getCnName()), DatastandardEntity::getCnName, query.getCnName());
|
||||||
|
wrapper.like(StringUtil.isNotBlank(query.getEngName()), DatastandardEntity::getEngName, query.getEngName());
|
||||||
|
wrapper.eq(query.getCategoryId() != null, DatastandardEntity::getCategoryId, query.getCategoryId());
|
||||||
|
dataScopeWithOrgId(wrapper);
|
||||||
|
return wrapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -42,4 +42,6 @@ public interface Constant {
|
||||||
* OK
|
* OK
|
||||||
*/
|
*/
|
||||||
String OK = "OK";
|
String OK = "OK";
|
||||||
|
|
||||||
|
String STATUS_NORMAL="0";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue