Commit 0a6fb1a3 authored by 赵建伟's avatar 赵建伟

update codes

parent 8a57f4b4
...@@ -78,6 +78,12 @@ ...@@ -78,6 +78,12 @@
<artifactId>lombok</artifactId> <artifactId>lombok</artifactId>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<!--alibaba easyexcel -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>1.1.2-beta5</version>
</dependency>
<!-- 增加fastjson工具类 --> <!-- 增加fastjson工具类 -->
<dependency> <dependency>
<groupId>com.alibaba</groupId> <groupId>com.alibaba</groupId>
...@@ -128,6 +134,7 @@ ...@@ -128,6 +134,7 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<!-- xxl-job依赖 --> <!-- xxl-job依赖 -->
<dependency> <dependency>
<groupId>com.xuxueli</groupId> <groupId>com.xuxueli</groupId>
......
package com.gmei.data.dqmp.controller;
import javax.servlet.http.HttpServletRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.gmei.data.dqmp.service.DqRuleService;
import com.gmei.data.dqmp.utils.ImportExcelUtils;
import com.gmei.data.dqmp.vo.BaseVo;
@RestController
@RequestMapping(value = "/excel")
public class EasyExcelController {
@Autowired
private DqRuleService dqRuleService;
private static final Logger logger = LoggerFactory.getLogger(EasyExcelController.class);
@PostMapping(value = "export")
public BaseVo exportExcel() {
return new BaseVo();
}
@PostMapping(value = "importUnique")
public BaseVo importUniqueExcel(HttpServletRequest httpServletRequest) {
try {
ImportExcelUtils.saxReadUniqueListString(httpServletRequest,dqRuleService);
}catch (Exception e) {
logger.error(e.getMessage());
return new BaseVo(-1,e.getMessage());
}
return new BaseVo();
}
@PostMapping(value = "importUnblank")
public BaseVo importUnblankExcel(HttpServletRequest httpServletRequest) {
try {
ImportExcelUtils.saxReadUnblankListString(httpServletRequest,dqRuleService);
}catch (Exception e) {
logger.error(e.getMessage());
return new BaseVo(-1,e.getMessage());
}
return new BaseVo();
}
@PostMapping(value = "importRefer")
public BaseVo importReferExcel(HttpServletRequest httpServletRequest) {
try {
ImportExcelUtils.saxReadReferListString(httpServletRequest,dqRuleService);
}catch (Exception e) {
logger.error(e.getMessage());
return new BaseVo(-1,e.getMessage());
}
return new BaseVo();
}
@PostMapping(value = "importVolatility")
public BaseVo importVolatilityExcel(HttpServletRequest httpServletRequest) {
try {
ImportExcelUtils.saxReadVolatilityListString(httpServletRequest,dqRuleService);
}catch (Exception e) {
logger.error(e.getMessage());
return new BaseVo(-1,e.getMessage());
}
return new BaseVo();
}
@PostMapping(value = "importSpecial")
public BaseVo importExcel(HttpServletRequest httpServletRequest) {
try {
ImportExcelUtils.saxReadSpecialListString(httpServletRequest,dqRuleService);
}catch (Exception e) {
logger.error(e.getMessage());
return new BaseVo(-1,e.getMessage());
}
return new BaseVo();
}
}
package com.gmei.data.dqmp.domain;
public class TblCheckMultipleSql {
private Integer id;
private String checkType;
private String checkDbName;
private String checkTbName;
private String checkColName;
private String referDbName;
private String referTbName;
private String referColName;
private Integer isValid;
private String checkTime;
private String createTime;
private String sqlContent;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getCheckType() {
return checkType;
}
public void setCheckType(String checkType) {
this.checkType = checkType == null ? null : checkType.trim();
}
public String getCheckDbName() {
return checkDbName;
}
public void setCheckDbName(String checkDbName) {
this.checkDbName = checkDbName == null ? null : checkDbName.trim();
}
public String getCheckTbName() {
return checkTbName;
}
public void setCheckTbName(String checkTbName) {
this.checkTbName = checkTbName == null ? null : checkTbName.trim();
}
public String getCheckColName() {
return checkColName;
}
public void setCheckColName(String checkColName) {
this.checkColName = checkColName == null ? null : checkColName.trim();
}
public String getReferDbName() {
return referDbName;
}
public void setReferDbName(String referDbName) {
this.referDbName = referDbName == null ? null : referDbName.trim();
}
public String getReferTbName() {
return referTbName;
}
public void setReferTbName(String referTbName) {
this.referTbName = referTbName == null ? null : referTbName.trim();
}
public String getReferColName() {
return referColName;
}
public void setReferColName(String referColName) {
this.referColName = referColName == null ? null : referColName.trim();
}
public Integer getIsValid() {
return isValid;
}
public void setIsValid(Integer isValid) {
this.isValid = isValid;
}
public String getCheckTime() {
return checkTime;
}
public void setCheckTime(String checkTime) {
this.checkTime = checkTime == null ? null : checkTime.trim();
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime == null ? null : createTime.trim();
}
public String getSqlContent() {
return sqlContent;
}
public void setSqlContent(String sqlContent) {
this.sqlContent = sqlContent == null ? null : sqlContent.trim();
}
}
\ No newline at end of file
package com.gmei.data.dqmp.domain;
public class TblCheckSingleSql {
private Integer id;
private String checkType;
private String dbName;
private String tbName;
private String colName;
private Integer isValid;
private String checkTime;
private String createTime;
private String sqlContent;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getCheckType() {
return checkType;
}
public void setCheckType(String checkType) {
this.checkType = checkType == null ? null : checkType.trim();
}
public String getDbName() {
return dbName;
}
public void setDbName(String dbName) {
this.dbName = dbName == null ? null : dbName.trim();
}
public String getTbName() {
return tbName;
}
public void setTbName(String tbName) {
this.tbName = tbName == null ? null : tbName.trim();
}
public String getColName() {
return colName;
}
public void setColName(String colName) {
this.colName = colName == null ? null : colName.trim();
}
public Integer getIsValid() {
return isValid;
}
public void setIsValid(Integer isValid) {
this.isValid = isValid;
}
public String getCheckTime() {
return checkTime;
}
public void setCheckTime(String checkTime) {
this.checkTime = checkTime == null ? null : checkTime.trim();
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime == null ? null : createTime.trim();
}
public String getSqlContent() {
return sqlContent;
}
public void setSqlContent(String sqlContent) {
this.sqlContent = sqlContent == null ? null : sqlContent.trim();
}
}
\ No newline at end of file
package com.gmei.data.dqmp.domain;
public class TblMonitorSpecialSql {
private Integer id;
private String dbName;
private String tbName;
private String timeColName;
private String startTime;
private String endTime;
private Integer isValid;
private String checkTime;
private String createTime;
private String sqlContent;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getDbName() {
return dbName;
}
public void setDbName(String dbName) {
this.dbName = dbName == null ? null : dbName.trim();
}
public String getTbName() {
return tbName;
}
public void setTbName(String tbName) {
this.tbName = tbName == null ? null : tbName.trim();
}
public String getTimeColName() {
return timeColName;
}
public void setTimeColName(String timeColName) {
this.timeColName = timeColName == null ? null : timeColName.trim();
}
public String getStartTime() {
return startTime;
}
public void setStartTime(String startTime) {
this.startTime = startTime == null ? null : startTime.trim();
}
public String getEndTime() {
return endTime;
}
public void setEndTime(String endTime) {
this.endTime = endTime == null ? null : endTime.trim();
}
public Integer getIsValid() {
return isValid;
}
public void setIsValid(Integer isValid) {
this.isValid = isValid;
}
public String getCheckTime() {
return checkTime;
}
public void setCheckTime(String checkTime) {
this.checkTime = checkTime == null ? null : checkTime.trim();
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime == null ? null : createTime.trim();
}
public String getSqlContent() {
return sqlContent;
}
public void setSqlContent(String sqlContent) {
this.sqlContent = sqlContent == null ? null : sqlContent.trim();
}
}
\ No newline at end of file
package com.gmei.data.dqmp.domain;
public class TblMonitorVolatilitySql {
private Integer id;
private String indicatorType;
private String dbName;
private String tbName;
private String colName;
private Integer isValid;
private String checkTime;
private String createTime;
private String sqlContent;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getIndicatorType() {
return indicatorType;
}
public void setIndicatorType(String indicatorType) {
this.indicatorType = indicatorType == null ? null : indicatorType.trim();
}
public String getDbName() {
return dbName;
}
public void setDbName(String dbName) {
this.dbName = dbName == null ? null : dbName.trim();
}
public String getTbName() {
return tbName;
}
public void setTbName(String tbName) {
this.tbName = tbName == null ? null : tbName.trim();
}
public String getColName() {
return colName;
}
public void setColName(String colName) {
this.colName = colName == null ? null : colName.trim();
}
public Integer getIsValid() {
return isValid;
}
public void setIsValid(Integer isValid) {
this.isValid = isValid;
}
public String getCheckTime() {
return checkTime;
}
public void setCheckTime(String checkTime) {
this.checkTime = checkTime == null ? null : checkTime.trim();
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime == null ? null : createTime.trim();
}
public String getSqlContent() {
return sqlContent;
}
public void setSqlContent(String sqlContent) {
this.sqlContent = sqlContent == null ? null : sqlContent.trim();
}
}
\ No newline at end of file
package com.gmei.data.dqmp.domain;
public class TblRuleDuplexInfo {
private Integer id;
private String checkType;
private String checkDbName;
private String checkTbName;
private String checkColName;
private String referDbName;
private String referTbName;
private String referColName;
private Integer isPartitioned;
private Integer isValid;
private String checkTime;
private String createTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getCheckType() {
return checkType;
}
public void setCheckType(String checkType) {
this.checkType = checkType == null ? null : checkType.trim();
}
public String getCheckDbName() {
return checkDbName;
}
public void setCheckDbName(String checkDbName) {
this.checkDbName = checkDbName == null ? null : checkDbName.trim();
}
public String getCheckTbName() {
return checkTbName;
}
public void setCheckTbName(String checkTbName) {
this.checkTbName = checkTbName == null ? null : checkTbName.trim();
}
public String getCheckColName() {
return checkColName;
}
public void setCheckColName(String checkColName) {
this.checkColName = checkColName == null ? null : checkColName.trim();
}
public String getReferDbName() {
return referDbName;
}
public void setReferDbName(String referDbName) {
this.referDbName = referDbName == null ? null : referDbName.trim();
}
public String getReferTbName() {
return referTbName;
}
public void setReferTbName(String referTbName) {
this.referTbName = referTbName == null ? null : referTbName.trim();
}
public String getReferColName() {
return referColName;
}
public void setReferColName(String referColName) {
this.referColName = referColName == null ? null : referColName.trim();
}
public Integer getIsPartitioned() {
return isPartitioned;
}
public void setIsPartitioned(Integer isPartitioned) {
this.isPartitioned = isPartitioned;
}
public Integer getIsValid() {
return isValid;
}
public void setIsValid(Integer isValid) {
this.isValid = isValid;
}
public String getCheckTime() {
return checkTime;
}
public void setCheckTime(String checkTime) {
this.checkTime = checkTime == null ? null : checkTime.trim();
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime == null ? null : createTime.trim();
}
}
\ No newline at end of file
package com.gmei.data.dqmp.domain;
public class TblRuleDuplexInfoWithBLOBs extends TblRuleDuplexInfo {
private String checkFilters;
private String referFilters;
public String getCheckFilters() {
return checkFilters;
}
public void setCheckFilters(String checkFilters) {
this.checkFilters = checkFilters == null ? null : checkFilters.trim();
}
public String getReferFilters() {
return referFilters;
}
public void setReferFilters(String referFilters) {
this.referFilters = referFilters == null ? null : referFilters.trim();
}
}
\ No newline at end of file
package com.gmei.data.dqmp.dto;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.metadata.BaseRowModel;
import lombok.Data;
@Data
public class DqReferRuleDto extends BaseRowModel{
@ExcelProperty(value = "校验类型",index = 1)
private String checkType;
@ExcelProperty(value = "是否启用",index = 2)
private Integer isValid;
@ExcelProperty(value = "校验时间",index = 3)
private String checkTime;
@ExcelProperty(value = "校验数据库名",index = 4)
private String checkDbName;
@ExcelProperty(value = "校验数据表名",index = 5)
private String checkTbName;
@ExcelProperty(value = "校验数据列名",index = 6)
private String checkColName;
@ExcelProperty(value = "校验表过滤条件",index = 7)
private String checkFilters;
@ExcelProperty(value = "参照数据库名",index = 8)
private String referDbName;
@ExcelProperty(value = "参照数据表名",index = 9)
private String referTbName;
@ExcelProperty(value = "参照数据列名",index = 10)
private String referColName;
@ExcelProperty(value = "参照表过滤条件",index = 11)
private String referFilters;
}
package com.gmei.data.dqmp.dto;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.metadata.BaseRowModel;
import lombok.Data;
@Data
public class DqSpecialRuleDto extends BaseRowModel {
@ExcelProperty(value = "校验类型", index = 1)
private String checkType;
@ExcelProperty(value = "是否启用", index = 2)
private Integer isValid;
@ExcelProperty(value = "校验时间", index = 3)
private String checkTime;
@ExcelProperty(value = "数据库名", index = 4)
private String dbName;
@ExcelProperty(value = "数据表名", index = 5)
private String tbName;
@ExcelProperty(value = "数据列名", index = 6)
private String colName;
@ExcelProperty(value = "数据时间列名", index = 7)
private String timeColName;
@ExcelProperty(value = "指标类型", index = 8)
private String indicatorType;
@ExcelProperty(value = "数据校验起始时间", index = 9)
private String startTime;
@ExcelProperty(value = "过滤条件", index = 10)
private String filters;
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -31,8 +31,6 @@ import com.gmei.data.dqmp.utils.DateUtils; ...@@ -31,8 +31,6 @@ import com.gmei.data.dqmp.utils.DateUtils;
@Service @Service
public class CheckServiceImpl implements CheckService { public class CheckServiceImpl implements CheckService {
private static final Logger logger = LoggerFactory.getLogger(CheckServiceImpl.class);
@Autowired @Autowired
private TblCheckSingleSqlMapper tblCheckSingleSqlMapper; private TblCheckSingleSqlMapper tblCheckSingleSqlMapper;
@Autowired @Autowired
...@@ -43,6 +41,7 @@ public class CheckServiceImpl implements CheckService { ...@@ -43,6 +41,7 @@ public class CheckServiceImpl implements CheckService {
private TblResultCheckUnblankMapper tblResultCheckUnblankMapper; private TblResultCheckUnblankMapper tblResultCheckUnblankMapper;
@Autowired @Autowired
private TblResultCheckReferMapper tblResultCheckReferMapper; private TblResultCheckReferMapper tblResultCheckReferMapper;
private static final Logger logger = LoggerFactory.getLogger(CheckServiceImpl.class);
/** /**
* 校验并持久化简单型校验结果 * 校验并持久化简单型校验结果
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment