init
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>data-quality-service-parent</artifactId>
|
||||
<groupId>com.platform</groupId>
|
||||
<version>0.4.x</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<version>0.4.x</version>
|
||||
<artifactId>data-quality-service-api</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>knife4j-micro-spring-boot-starter</artifactId>
|
||||
<version>${knife4j.version}</version>
|
||||
</dependency>
|
||||
<!--feign 依赖-->
|
||||
<dependency>
|
||||
<groupId>io.github.openfeign</groupId>
|
||||
<artifactId>feign-okhttp</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.platform</groupId>
|
||||
<artifactId>common-core</artifactId>
|
||||
<version>0.4.x</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-web</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -0,0 +1,19 @@
|
||||
package cn.datax.service.data.quality.api.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 准确性
|
||||
*/
|
||||
@Data
|
||||
public class Accuracy implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 最大长度
|
||||
*/
|
||||
private Integer maxLength;
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package cn.datax.service.data.quality.api.dto;
|
||||
|
||||
import cn.datax.common.validate.ValidationGroups;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 核查规则信息表 实体DTO
|
||||
* </p>
|
||||
*
|
||||
* @author AllDataDC
|
||||
* @date 2022-11-27
|
||||
*/
|
||||
@ApiModel(value = "核查规则信息表Model")
|
||||
@Data
|
||||
public class CheckRuleDto implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
@NotBlank(message = "主键ID不能为空", groups = {ValidationGroups.Update.class})
|
||||
private String id;
|
||||
@ApiModelProperty(value = "规则名称")
|
||||
private String ruleName;
|
||||
@ApiModelProperty(value = "规则类型")
|
||||
private String ruleTypeId;
|
||||
@ApiModelProperty(value = "核查类型")
|
||||
private String ruleItemId;
|
||||
@ApiModelProperty(value = "规则级别(3高、2中、1低)")
|
||||
private String ruleLevelId;
|
||||
@ApiModelProperty(value = "数据源类型")
|
||||
private String ruleDbType;
|
||||
@ApiModelProperty(value = "数据源主键")
|
||||
private String ruleSourceId;
|
||||
@ApiModelProperty(value = "数据源")
|
||||
private String ruleSource;
|
||||
@ApiModelProperty(value = "数据表主键")
|
||||
private String ruleTableId;
|
||||
@ApiModelProperty(value = "数据表")
|
||||
private String ruleTable;
|
||||
@ApiModelProperty(value = "数据表名称")
|
||||
private String ruleTableComment;
|
||||
@ApiModelProperty(value = "核查字段主键")
|
||||
private String ruleColumnId;
|
||||
@ApiModelProperty(value = "核查字段")
|
||||
private String ruleColumn;
|
||||
@ApiModelProperty(value = "核查字段名称")
|
||||
private String ruleColumnComment;
|
||||
@ApiModelProperty(value = "核查配置")
|
||||
@Valid
|
||||
private RuleConfig ruleConfig;
|
||||
@ApiModelProperty(value = "状态")
|
||||
@NotNull(message = "状态不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
private String status;
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package cn.datax.service.data.quality.api.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 一致性
|
||||
*/
|
||||
@Data
|
||||
public class Consistent implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String gbTypeId;
|
||||
private String gbTypeCode;
|
||||
private String gbTypeName;
|
||||
private String bindGbColumn;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package cn.datax.service.data.quality.api.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 关联性
|
||||
*/
|
||||
@Data
|
||||
public class Relevance implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String relatedTableId;
|
||||
private String relatedTable;
|
||||
private String relatedTableComment;
|
||||
private String relatedColumnId;
|
||||
private String relatedColumn;
|
||||
private String relatedColumnComment;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package cn.datax.service.data.quality.api.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class RuleConfig implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@ApiModelProperty(value = "核查类型编码")
|
||||
private String ruleItemCode;
|
||||
|
||||
/**
|
||||
* 一致性
|
||||
*/
|
||||
private Consistent consistent;
|
||||
|
||||
/**
|
||||
* 关联性
|
||||
*/
|
||||
private Relevance relevance;
|
||||
|
||||
/**
|
||||
* 及时性
|
||||
*/
|
||||
private Timeliness timeliness;
|
||||
|
||||
/**
|
||||
* 准确性
|
||||
*/
|
||||
private Accuracy accuracy;
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package cn.datax.service.data.quality.api.dto;
|
||||
|
||||
import cn.datax.common.validate.ValidationGroups;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 数据质量监控任务日志信息表 实体DTO
|
||||
* </p>
|
||||
*
|
||||
* @author AllDataDC
|
||||
* @date 2022-11-13
|
||||
*/
|
||||
@ApiModel(value = "数据质量监控任务日志信息表Model")
|
||||
@Data
|
||||
public class ScheduleLogDto implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
@NotBlank(message = "主键ID不能为空", groups = {ValidationGroups.Update.class})
|
||||
private String id;
|
||||
@ApiModelProperty(value = "状态(1成功 0失败)")
|
||||
private String status;
|
||||
@ApiModelProperty(value = "执行任务主键")
|
||||
private String executeJobId;
|
||||
@ApiModelProperty(value = "执行规则主键")
|
||||
private String executeRuleId;
|
||||
@ApiModelProperty(value = "执行时间")
|
||||
private LocalDateTime executeDate;
|
||||
@ApiModelProperty(value = "执行结果")
|
||||
private String executeResult;
|
||||
@ApiModelProperty(value = "执行批次号")
|
||||
private String executeBatch;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package cn.datax.service.data.quality.api.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 及时性
|
||||
*/
|
||||
@Data
|
||||
public class Timeliness implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 判定阀值 当前时间-业务时间>阀值
|
||||
*/
|
||||
private Integer threshold;
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package cn.datax.service.data.quality.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 核查报告信息表
|
||||
* </p>
|
||||
*
|
||||
* @author AllDataDC
|
||||
* @date 2022-11-27
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@TableName(value = "quality_check_report", autoResultMap = true)
|
||||
public class CheckReportEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 核查规则主键
|
||||
*/
|
||||
private String checkRuleId;
|
||||
|
||||
/**
|
||||
* 核查时间
|
||||
*/
|
||||
private LocalDateTime checkDate;
|
||||
|
||||
/**
|
||||
* 核查结果
|
||||
*/
|
||||
private String checkResult;
|
||||
|
||||
/**
|
||||
* 核查数量
|
||||
*/
|
||||
private Integer checkTotalCount;
|
||||
|
||||
/**
|
||||
* 不合规数量
|
||||
*/
|
||||
private Integer checkErrorCount;
|
||||
|
||||
/**
|
||||
* 核查批次号
|
||||
*/
|
||||
private String checkBatch;
|
||||
|
||||
/**
|
||||
* 规则名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String ruleName;
|
||||
|
||||
/**
|
||||
* 规则类型
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String ruleType;
|
||||
|
||||
/**
|
||||
* 数据源
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String ruleSource;
|
||||
|
||||
/**
|
||||
* 数据表
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String ruleTable;
|
||||
|
||||
/**
|
||||
* 核查字段
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String ruleColumn;
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
package cn.datax.service.data.quality.api.entity;
|
||||
|
||||
import cn.datax.common.base.DataScopeBaseEntity;
|
||||
import cn.datax.service.data.quality.api.dto.RuleConfig;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 核查规则信息表
|
||||
* </p>
|
||||
*
|
||||
* @author AllDataDC
|
||||
* @date 2022-11-27
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@TableName(value = "quality_check_rule", autoResultMap = true)
|
||||
public class CheckRuleEntity extends DataScopeBaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 规则名称
|
||||
*/
|
||||
private String ruleName;
|
||||
|
||||
/**
|
||||
* 规则类型主键
|
||||
*/
|
||||
private String ruleTypeId;
|
||||
|
||||
/**
|
||||
* 核查类型主键
|
||||
*/
|
||||
private String ruleItemId;
|
||||
|
||||
/**
|
||||
* 规则类型
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String ruleType;
|
||||
|
||||
/**
|
||||
* 规则级别(3高、2中、1低)
|
||||
*/
|
||||
private String ruleLevelId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String ruleLevel;
|
||||
|
||||
/**
|
||||
* 数据源类型
|
||||
*/
|
||||
private String ruleDbType;
|
||||
|
||||
/**
|
||||
* 数据源主键
|
||||
*/
|
||||
private String ruleSourceId;
|
||||
|
||||
/**
|
||||
* 数据源
|
||||
*/
|
||||
private String ruleSource;
|
||||
|
||||
/**
|
||||
* 数据表主键
|
||||
*/
|
||||
private String ruleTableId;
|
||||
|
||||
/**
|
||||
* 数据表
|
||||
*/
|
||||
private String ruleTable;
|
||||
|
||||
/**
|
||||
* 数据表名称
|
||||
*/
|
||||
private String ruleTableComment;
|
||||
|
||||
/**
|
||||
* 核查字段主键
|
||||
*/
|
||||
private String ruleColumnId;
|
||||
|
||||
/**
|
||||
* 核查字段
|
||||
*/
|
||||
private String ruleColumn;
|
||||
|
||||
/**
|
||||
* 核查字段名称
|
||||
*/
|
||||
private String ruleColumnComment;
|
||||
|
||||
/**
|
||||
* 核查配置
|
||||
*/
|
||||
@TableField(value = "config_json", typeHandler = JacksonTypeHandler.class)
|
||||
private RuleConfig ruleConfig;
|
||||
|
||||
/**
|
||||
* 核查脚本
|
||||
*/
|
||||
private String ruleSql;
|
||||
|
||||
/**
|
||||
* 最近核查批次号(关联确定唯一核查报告)
|
||||
*/
|
||||
private String lastCheckBatch;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package cn.datax.service.data.quality.api.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class DataReportEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
private String ruleTypeId;
|
||||
private String ruleTypeName;
|
||||
private String ruleId;
|
||||
private String ruleName;
|
||||
private String ruleSourceId;
|
||||
private String ruleSourceName;
|
||||
private String ruleLevelId;
|
||||
private String ruleLevelName;
|
||||
private Integer checkErrorCount;
|
||||
|
||||
private String ruleTypeCode;
|
||||
private String ruleTableName;
|
||||
private String ruleTableComment;
|
||||
private String ruleColumnName;
|
||||
private String ruleColumnComment;
|
||||
private Integer checkTotalCount;
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package cn.datax.service.data.quality.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 规则核查类型信息表
|
||||
* </p>
|
||||
*
|
||||
* @author AllDataDC
|
||||
* @date 2022-11-15
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@TableName("quality_rule_item")
|
||||
public class RuleItemEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 规则类型
|
||||
*/
|
||||
private String ruleTypeId;
|
||||
|
||||
/**
|
||||
* 核查类型编码
|
||||
*/
|
||||
private String itemCode;
|
||||
|
||||
/**
|
||||
* 核查类型解释
|
||||
*/
|
||||
private String itemExplain;
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package cn.datax.service.data.quality.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 规则级别信息表
|
||||
* </p>
|
||||
*
|
||||
* @author AllDataDC
|
||||
* @date 2022-11-14
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@TableName("quality_rule_level")
|
||||
public class RuleLevelEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 规则级别编码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 规则级别名称
|
||||
*/
|
||||
private String name;
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package cn.datax.service.data.quality.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 规则类型信息表
|
||||
* </p>
|
||||
*
|
||||
* @author AllDataDC
|
||||
* @date 2022-11-27
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@TableName("quality_rule_type")
|
||||
public class RuleTypeEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 类型名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 类型编码
|
||||
*/
|
||||
private String code;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package cn.datax.service.data.quality.api.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RuleTypeReportEntity extends RuleTypeEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 不合规数量
|
||||
*/
|
||||
private Integer checkErrorCount;
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package cn.datax.service.data.quality.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 数据质量监控任务信息表
|
||||
* </p>
|
||||
*
|
||||
* @author AllDataDC
|
||||
* @date 2022-11-29
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@TableName("quality_schedule_job")
|
||||
public class ScheduleJobEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 任务名称
|
||||
*/
|
||||
private String jobName;
|
||||
|
||||
/**
|
||||
* bean名称
|
||||
*/
|
||||
private String beanName;
|
||||
|
||||
/**
|
||||
* 方法名称
|
||||
*/
|
||||
private String methodName;
|
||||
|
||||
/**
|
||||
* 方法参数
|
||||
*/
|
||||
private String methodParams;
|
||||
|
||||
/**
|
||||
* cron表达式
|
||||
*/
|
||||
private String cronExpression;
|
||||
|
||||
/**
|
||||
* 状态(1运行 0暂停)
|
||||
*/
|
||||
private String status;
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package cn.datax.service.data.quality.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 数据质量监控任务日志信息表
|
||||
* </p>
|
||||
*
|
||||
* @author AllDataDC
|
||||
* @date 2022-11-13
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@TableName(value = "quality_schedule_log")
|
||||
public class ScheduleLogEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 状态(1成功 0失败)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 执行任务主键
|
||||
*/
|
||||
private String executeJobId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String executeJobName;
|
||||
|
||||
/**
|
||||
* 执行规则主键
|
||||
*/
|
||||
private String executeRuleId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String executeRuleName;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String executeRuleTypeName;
|
||||
|
||||
/**
|
||||
* 执行时间
|
||||
*/
|
||||
private LocalDateTime executeDate;
|
||||
|
||||
/**
|
||||
* 执行结果
|
||||
*/
|
||||
private String executeResult;
|
||||
|
||||
/**
|
||||
* 执行批次号
|
||||
*/
|
||||
private String executeBatch;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package cn.datax.service.data.quality.api.enums;
|
||||
|
||||
public enum RuleItem {
|
||||
|
||||
Unique("unique_key", "验证用户指定的字段是否具有唯一性"),
|
||||
AccuracyLength("accuracy_key_length", "验证长度是否符合规定"),
|
||||
Integrity("integrity_key", "验证表中必须出现的字段非空"),
|
||||
Relevance("relevance_key", "验证关联性"),
|
||||
Timeliness("timeliness_key", "验证及时性"),
|
||||
Consistent("consistent_key", "验证用户指定的字段枚举值是否合乎要求");
|
||||
|
||||
private final String code;
|
||||
|
||||
private final String desc;
|
||||
|
||||
RuleItem(String code, String desc) {
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public static RuleItem getRuleItem(String code) {
|
||||
for (RuleItem item : RuleItem.values()) {
|
||||
if (item.code.equals(code)) {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package cn.datax.service.data.quality.api.feign;
|
||||
|
||||
|
||||
import cn.datax.service.data.quality.api.entity.CheckRuleEntity;
|
||||
import cn.datax.service.data.quality.api.feign.factory.QualityServiceFeignFallbackFactory;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
|
||||
@FeignClient(contextId = "qualityServiceFeign", value = "service-data-quality", fallbackFactory = QualityServiceFeignFallbackFactory.class)
|
||||
public interface QualityServiceFeign {
|
||||
|
||||
@GetMapping("/checkRules/source/{sourceId}")
|
||||
CheckRuleEntity getBySourceId(@PathVariable String sourceId);
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package cn.datax.service.data.quality.api.feign.factory;
|
||||
|
||||
import cn.datax.service.data.quality.api.feign.QualityServiceFeign;
|
||||
import cn.datax.service.data.quality.api.feign.fallback.QualityServiceFeignFallbackImpl;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class QualityServiceFeignFallbackFactory implements FallbackFactory<QualityServiceFeign> {
|
||||
|
||||
@Override
|
||||
public QualityServiceFeign create(Throwable throwable) {
|
||||
QualityServiceFeignFallbackImpl feignFallback = new QualityServiceFeignFallbackImpl();
|
||||
feignFallback.setCause(throwable);
|
||||
return feignFallback;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package cn.datax.service.data.quality.api.feign.fallback;
|
||||
|
||||
|
||||
import cn.datax.service.data.quality.api.entity.CheckRuleEntity;
|
||||
import cn.datax.service.data.quality.api.feign.QualityServiceFeign;
|
||||
import lombok.Setter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class QualityServiceFeignFallbackImpl implements QualityServiceFeign {
|
||||
|
||||
@Setter
|
||||
private Throwable cause;
|
||||
|
||||
@Override
|
||||
public CheckRuleEntity getBySourceId(String sourceId) {
|
||||
log.error("feign 调用数据质量管理查询出错", cause);
|
||||
throw new RuntimeException("feign 调用数据质量管理查询出错", cause);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package cn.datax.service.data.quality.api.query;
|
||||
|
||||
import cn.datax.common.base.BaseQueryParams;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 核查报告信息表 查询实体
|
||||
* </p>
|
||||
*
|
||||
* @author AllDataDC
|
||||
* @date 2022-11-27
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class CheckReportQuery extends BaseQueryParams {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
private String ruleTypeId;
|
||||
private String ruleName;
|
||||
private String ruleSource;
|
||||
private String ruleTable;
|
||||
private String ruleColumn;
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate checkDate;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package cn.datax.service.data.quality.api.query;
|
||||
|
||||
import cn.datax.common.base.BaseQueryParams;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 核查规则信息表 查询实体
|
||||
* </p>
|
||||
*
|
||||
* @author AllDataDC
|
||||
* @date 2022-11-27
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class CheckRuleQuery extends BaseQueryParams {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
private String ruleTypeId;
|
||||
private String ruleName;
|
||||
private String ruleSource;
|
||||
private String ruleTable;
|
||||
private String ruleColumn;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package cn.datax.service.data.quality.api.query;
|
||||
|
||||
import cn.datax.common.base.BaseQueryParams;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 规则核查项信息表 查询实体
|
||||
* </p>
|
||||
*
|
||||
* @author AllDataDC
|
||||
* @date 2022-11-15
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class RuleItemQuery extends BaseQueryParams {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
private String ruleTypeId;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package cn.datax.service.data.quality.api.query;
|
||||
|
||||
import cn.datax.common.base.BaseQueryParams;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 规则级别信息表 查询实体
|
||||
* </p>
|
||||
*
|
||||
* @author AllDataDC
|
||||
* @date 2022-11-14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class RuleLevelQuery extends BaseQueryParams {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package cn.datax.service.data.quality.api.query;
|
||||
|
||||
import cn.datax.common.base.BaseQueryParams;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 规则类型信息表 查询实体
|
||||
* </p>
|
||||
*
|
||||
* @author AllDataDC
|
||||
* @date 2022-11-27
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class RuleTypeQuery extends BaseQueryParams {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
private String name;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package cn.datax.service.data.quality.api.query;
|
||||
|
||||
import cn.datax.common.base.BaseQueryParams;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 数据质量监控任务信息表 查询实体
|
||||
* </p>
|
||||
*
|
||||
* @author AllDataDC
|
||||
* @date 2022-11-29
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ScheduleJobQuery extends BaseQueryParams {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package cn.datax.service.data.quality.api.query;
|
||||
|
||||
import cn.datax.common.base.BaseQueryParams;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 数据质量监控任务日志信息表 查询实体
|
||||
* </p>
|
||||
*
|
||||
* @author AllDataDC
|
||||
* @date 2022-11-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ScheduleLogQuery extends BaseQueryParams {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
private String executeJobId;
|
||||
private String ruleTypeId;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package cn.datax.service.data.quality.api.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 核查报告信息表 实体VO
|
||||
* </p>
|
||||
*
|
||||
* @author AllDataDC
|
||||
* @date 2022-11-27
|
||||
*/
|
||||
@Data
|
||||
public class CheckReportVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
private String id;
|
||||
private String checkRuleId;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private LocalDateTime checkDate;
|
||||
private String checkResult;
|
||||
private Integer checkTotalCount;
|
||||
private Integer checkErrorCount;
|
||||
private String ruleName;
|
||||
private String ruleType;
|
||||
private String ruleSource;
|
||||
private String ruleTable;
|
||||
private String ruleColumn;
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package cn.datax.service.data.quality.api.vo;
|
||||
|
||||
import cn.datax.service.data.quality.api.dto.RuleConfig;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 核查规则信息表 实体VO
|
||||
* </p>
|
||||
*
|
||||
* @author AllDataDC
|
||||
* @date 2022-11-27
|
||||
*/
|
||||
@Data
|
||||
public class CheckRuleVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
private String id;
|
||||
private String status;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private LocalDateTime createTime;
|
||||
private String remark;
|
||||
private String ruleName;
|
||||
private String ruleTypeId;
|
||||
private String ruleItemId;
|
||||
private String ruleType;
|
||||
private String ruleLevelId;
|
||||
private String ruleLevel;
|
||||
private String ruleDbType;
|
||||
private String ruleSourceId;
|
||||
private String ruleSource;
|
||||
private String ruleTableId;
|
||||
private String ruleTable;
|
||||
private String ruleTableComment;
|
||||
private String ruleColumnId;
|
||||
private String ruleColumn;
|
||||
private String ruleColumnComment;
|
||||
private RuleConfig ruleConfig;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package cn.datax.service.data.quality.api.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 规则核查项信息表 实体VO
|
||||
* </p>
|
||||
*
|
||||
* @author AllDataDC
|
||||
* @date 2022-11-15
|
||||
*/
|
||||
@Data
|
||||
public class RuleItemVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
private String id;
|
||||
private String ruleTypeId;
|
||||
private String itemCode;
|
||||
private String itemExplain;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package cn.datax.service.data.quality.api.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 规则级别信息表 实体VO
|
||||
* </p>
|
||||
*
|
||||
* @author AllDataDC
|
||||
* @date 2022-11-14
|
||||
*/
|
||||
@Data
|
||||
public class RuleLevelVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
private String id;
|
||||
private String code;
|
||||
private String name;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package cn.datax.service.data.quality.api.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 规则类型信息表 实体VO
|
||||
* </p>
|
||||
*
|
||||
* @author AllDataDC
|
||||
* @date 2022-11-27
|
||||
*/
|
||||
@Data
|
||||
public class RuleTypeVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
private String id;
|
||||
private String name;
|
||||
private String code;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package cn.datax.service.data.quality.api.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 数据质量监控任务信息表 实体VO
|
||||
* </p>
|
||||
*
|
||||
* @author AllDataDC
|
||||
* @date 2022-11-29
|
||||
*/
|
||||
@Data
|
||||
public class ScheduleJobVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
private String id;
|
||||
private String status;
|
||||
private String jobName;
|
||||
private String beanName;
|
||||
private String methodName;
|
||||
private String methodParams;
|
||||
private String cronExpression;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package cn.datax.service.data.quality.api.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 数据质量监控任务日志信息表 实体VO
|
||||
* </p>
|
||||
*
|
||||
* @author AllDataDC
|
||||
* @date 2022-11-13
|
||||
*/
|
||||
@Data
|
||||
public class ScheduleLogVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
private String id;
|
||||
private String status;
|
||||
private String executeJobId;
|
||||
private String executeRuleId;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private LocalDateTime executeDate;
|
||||
private String executeResult;
|
||||
private String executeBatch;
|
||||
private String executeJobName;
|
||||
private String executeRuleName;
|
||||
private String executeRuleTypeName;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||
cn.datax.service.data.quality.api.feign.factory.QualityServiceFeignFallbackFactory,\
|
||||
cn.datax.service.data.quality.api.feign.fallback.QualityServiceFeignFallbackImpl
|
||||
Reference in New Issue
Block a user