数据质量任务列表
parent
56336fadbd
commit
1864500899
|
@ -1,18 +1,21 @@
|
|||
package net.srt.controller;
|
||||
|
||||
import cn.hutool.db.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import net.srt.convert.QualityRuleConvert;
|
||||
import net.srt.entity.QualityQueryEntity;
|
||||
import net.srt.framework.common.page.PageResult;
|
||||
import net.srt.framework.common.utils.Result;
|
||||
import net.srt.query.QualityRuleQuery;
|
||||
import net.srt.service.QualityRuleService;
|
||||
import net.srt.vo.QualityRuleVo;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import oracle.ucp.proxy.annotation.Post;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @BelongsProject: srt_cloud
|
||||
|
@ -26,9 +29,24 @@ import javax.validation.Valid;
|
|||
@AllArgsConstructor
|
||||
public class QualityRuleController {
|
||||
private final QualityRuleService dataGovernanceQualityRuleService;
|
||||
@GetMapping("list")
|
||||
@Operation(summary = "查询列表")
|
||||
public Result<List<QualityRuleVo>> list(){
|
||||
List<QualityQueryEntity> list=dataGovernanceQualityRuleService.list();
|
||||
return Result.ok(QualityRuleConvert.INSTANCE.convertList(list));
|
||||
|
||||
}
|
||||
@GetMapping("page")
|
||||
@Operation(summary = "分页")
|
||||
public Result<PageResult<QualityRuleVo>> page(@Valid QualityRuleQuery query){
|
||||
return Result.ok(dataGovernanceQualityRuleService.pagea(query));
|
||||
PageResult<QualityRuleVo> page=dataGovernanceQualityRuleService.page(query);
|
||||
return Result.ok(page);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Operation(summary = "报存")
|
||||
public Result<String> save(@RequestBody QualityRuleVo vo){
|
||||
dataGovernanceQualityRuleService.save(vo);
|
||||
return Result.ok();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
package net.srt.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.tags.Tags;
|
||||
import lombok.AllArgsConstructor;
|
||||
import net.srt.convert.QualityTaskConvert;
|
||||
import net.srt.entity.QualityTaskEntity;
|
||||
import net.srt.framework.common.page.PageResult;
|
||||
import net.srt.framework.common.utils.Result;
|
||||
import net.srt.query.QualityTaskQuery;
|
||||
import net.srt.service.QualityTaskService;
|
||||
import net.srt.vo.QualityTaskVo;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* @BelongsProject: srt_cloud
|
||||
* @BelongsPackage: net.srt.controller
|
||||
* @Author: jpz
|
||||
* @CreateTime: 2023/12/21 11:29
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/quality-task")
|
||||
@Tag(name = "数据治理-数据质量")
|
||||
@AllArgsConstructor
|
||||
public class QualityTaskController {
|
||||
private final QualityTaskService qualityTaskService;
|
||||
@GetMapping("page")
|
||||
@Operation(summary = "分页")
|
||||
public Result<PageResult<QualityTaskVo>> page(@Valid QualityTaskQuery query){
|
||||
return Result.ok(qualityTaskService.pagea(query));
|
||||
}
|
||||
|
||||
@GetMapping("{id}")
|
||||
@Operation(summary = "信息")
|
||||
public Result<QualityTaskVo> get(@PathVariable("id") Long id){
|
||||
QualityTaskEntity entity=qualityTaskService.getById(id);
|
||||
return Result.ok(QualityTaskConvert.INSTANCE.covert(entity));
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -20,4 +20,7 @@ public interface QualityRuleConvert {
|
|||
|
||||
|
||||
List<QualityRuleVo> convertList(List<QualityQueryEntity> list);
|
||||
|
||||
QualityQueryEntity conver(QualityRuleVo vo);
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
package net.srt.convert;
|
||||
|
||||
import net.srt.controller.QualityTaskController;
|
||||
import net.srt.entity.QualityTaskEntity;
|
||||
import net.srt.vo.QualityTaskVo;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.swing.*;
|
||||
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,15 @@
|
|||
package net.srt.dao;
|
||||
|
||||
import net.srt.entity.QualityTaskEntity;
|
||||
import net.srt.framework.mybatis.dao.BaseDao;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @BelongsProject: srt_cloud
|
||||
* @BelongsPackage: net.srt.dao
|
||||
* @Author: jpz
|
||||
* @CreateTime: 2023/12/21 11:38
|
||||
*/
|
||||
@Mapper
|
||||
public interface QualityTaskDao extends BaseDao<QualityTaskEntity> {
|
||||
}
|
|
@ -18,7 +18,7 @@ import java.util.List;
|
|||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName(value = "data_governance_quality_rule")
|
||||
@TableName(value = "data_governance_quality_rule",autoResultMap=true)
|
||||
public class QualityQueryEntity extends BaseEntity {
|
||||
/**
|
||||
* 名称
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
package net.srt.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,32 @@
|
|||
package net.srt.query;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import net.srt.framework.common.query.Query;
|
||||
import net.srt.framework.common.utils.DateUtils;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @BelongsProject: srt_cloud
|
||||
* @BelongsPackage: net.srt.query
|
||||
* @Author: jpz
|
||||
* @CreateTime: 2023/12/21 11:33
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(description = "数据治理任务查询")
|
||||
public class QualityTaskQuery extends Query {
|
||||
private String name;
|
||||
private Integer status;
|
||||
@DateTimeFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||
private Date startTime;
|
||||
@DateTimeFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||
private Date endTime;
|
||||
|
||||
}
|
|
@ -13,5 +13,7 @@ import net.srt.vo.QualityRuleVo;
|
|||
* @CreateTime: 2023/12/20 19:53
|
||||
*/
|
||||
public interface QualityRuleService extends BaseService<QualityQueryEntity> {
|
||||
PageResult<QualityRuleVo> pagea(QualityRuleQuery query);
|
||||
PageResult<QualityRuleVo> page(QualityRuleQuery query);
|
||||
|
||||
void save(QualityRuleVo vo);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
package net.srt.service;
|
||||
|
||||
import net.srt.entity.QualityTaskEntity;
|
||||
import net.srt.framework.common.page.PageResult;
|
||||
import net.srt.framework.mybatis.service.BaseService;
|
||||
import net.srt.query.QualityTaskQuery;
|
||||
import net.srt.vo.QualityTaskVo;
|
||||
|
||||
/**
|
||||
* @BelongsProject: srt_cloud
|
||||
* @BelongsPackage: net.srt.service
|
||||
* @Author: jpz
|
||||
* @CreateTime: 2023/12/21 11:36
|
||||
*/
|
||||
public interface QualityTaskService extends BaseService<QualityTaskEntity> {
|
||||
PageResult<QualityTaskVo> pagea(QualityTaskQuery query);
|
||||
}
|
|
@ -26,21 +26,23 @@ import srt.cloud.framework.dbswitch.common.util.StringUtil;
|
|||
@AllArgsConstructor
|
||||
public class QualityRuleServiceimpl extends BaseServiceImpl<QualityRuleDao, QualityQueryEntity> implements QualityRuleService {
|
||||
@Override
|
||||
public PageResult<QualityRuleVo> pagea(QualityRuleQuery query) {
|
||||
//查询分页
|
||||
IPage<QualityQueryEntity> page =baseMapper.selectPage(getPage(query),getWrapper(query));
|
||||
//转换vo
|
||||
public PageResult<QualityRuleVo> page(QualityRuleQuery query) {
|
||||
IPage<QualityQueryEntity> page=baseMapper.selectPage(getPage(query),getWrapper(query));
|
||||
return new PageResult<>(QualityRuleConvert.INSTANCE.convertList(page.getRecords()),page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save(QualityRuleVo vo) {
|
||||
QualityQueryEntity entity=QualityRuleConvert.INSTANCE.conver(vo);
|
||||
entity.setProjectId(getProjectId());
|
||||
baseMapper.insert(entity);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<QualityQueryEntity> getWrapper(QualityRuleQuery query) {
|
||||
if (query!=null){
|
||||
LambdaQueryWrapper<QualityQueryEntity> wrapper = Wrappers.lambdaQuery();
|
||||
wrapper.like(StringUtil.isNotBlank(query.getName()), QualityQueryEntity::getName, query.getName())
|
||||
.like(StringUtil.isNotBlank(query.getEngName()), QualityQueryEntity::getEngName, query.getEngName());
|
||||
return wrapper;
|
||||
}
|
||||
return null;
|
||||
LambdaQueryWrapper<QualityQueryEntity> wrapper=Wrappers.lambdaQuery();
|
||||
wrapper.like(StringUtil.isNotBlank(query.getName()),QualityQueryEntity::getName,query.getName())
|
||||
.like(StringUtil.isNotBlank(query.getEngName()),QualityQueryEntity::getEngName,query.getName());
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,50 @@
|
|||
package net.srt.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
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.QualityRuleConvert;
|
||||
import net.srt.convert.QualityTaskConvert;
|
||||
import net.srt.dao.QualityTaskDao;
|
||||
import net.srt.entity.QualityQueryEntity;
|
||||
import net.srt.entity.QualityTaskEntity;
|
||||
import net.srt.framework.common.page.PageResult;
|
||||
import net.srt.framework.mybatis.service.impl.BaseServiceImpl;
|
||||
import net.srt.query.QualityTaskQuery;
|
||||
import net.srt.service.QualityTaskService;
|
||||
import net.srt.vo.QualityTaskVo;
|
||||
import org.springframework.stereotype.Service;
|
||||
import srt.cloud.framework.dbswitch.common.util.StringUtil;
|
||||
|
||||
/**
|
||||
* @BelongsProject: srt_cloud
|
||||
* @BelongsPackage: net.srt.service.impl
|
||||
* @Author: jpz
|
||||
* @CreateTime: 2023/12/21 11:38
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class QualityTaskServiceimpl extends BaseServiceImpl<QualityTaskDao, QualityTaskEntity> implements QualityTaskService {
|
||||
@Override
|
||||
public PageResult<QualityTaskVo> pagea(QualityTaskQuery query) {
|
||||
//查询分页
|
||||
IPage<QualityTaskEntity> page =baseMapper.selectPage(getPage(query),getWrapper(query));
|
||||
return new PageResult<>(QualityTaskConvert.INSTANCE.covertList(page.getRecords()),page.getTotal());
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<QualityTaskEntity> getWrapper(QualityTaskQuery query) {
|
||||
LambdaQueryWrapper<QualityTaskEntity> wrapper= Wrappers.lambdaQuery();
|
||||
wrapper.like(StringUtil.isNotBlank(query.getName()),QualityTaskEntity::getName,query.getName())
|
||||
.eq(query.getStatus()!=null,QualityTaskEntity::getQualityConfigId,query.getStatus())
|
||||
.eq(query.getStartTime()!=null,QualityTaskEntity::getStartTime,query.getStartTime())
|
||||
.eq(query.getEndTime()!=null,QualityTaskEntity::getEndTime,query.getEndTime())
|
||||
.orderByDesc(QualityTaskEntity::getId);
|
||||
dataScopeWithOrgId(wrapper);
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -17,7 +17,7 @@ import java.util.List;
|
|||
*/
|
||||
@Data
|
||||
@Schema(description = "数据质量")
|
||||
public class QualityRuleVo implements Serializable {
|
||||
public class QualityRuleVo implements Serializable{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "主键id")
|
||||
|
|
|
@ -0,0 +1,62 @@
|
|||
package net.srt.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;
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue