【feat】整合数据质量、数据标准
This commit is contained in:
parent
18445195d6
commit
927912eaeb
@ -0,0 +1,115 @@
|
||||
package com.czsj.web.controller.quality;
|
||||
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.czsj.common.core.controller.BaseController;
|
||||
import com.czsj.common.core.domain.AjaxResult;
|
||||
import com.czsj.core.database.core.JsonPage;
|
||||
import com.czsj.quality.entity.CheckReportEntity;
|
||||
import com.czsj.quality.entity.DataReportEntity;
|
||||
import com.czsj.quality.mapstruct.CheckReportMapper;
|
||||
import com.czsj.quality.query.CheckReportQuery;
|
||||
import com.czsj.quality.service.CheckReportService;
|
||||
import com.czsj.quality.vo.CheckReportVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
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 java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 核查报告信息表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-09-27
|
||||
*/
|
||||
@Api(tags = {"核查报告信息表"})
|
||||
@RestController
|
||||
@RequestMapping("/quality/checkReports")
|
||||
public class CheckReportController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private CheckReportService checkReportService;
|
||||
|
||||
@Autowired
|
||||
private CheckReportMapper checkReportMapper;
|
||||
|
||||
/**
|
||||
* 通过ID查询信息
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "获取详细信息", notes = "根据url的id来获取详细信息")
|
||||
@ApiImplicitParam(name = "id", value = "ID", required = true, dataType = "String", paramType = "path")
|
||||
@GetMapping("/{id}")
|
||||
public AjaxResult getCheckReportById(@PathVariable String id) {
|
||||
CheckReportEntity checkReportEntity = checkReportService.getCheckReportById(id);
|
||||
return AjaxResult.success(checkReportMapper.toVO(checkReportEntity));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询信息
|
||||
*
|
||||
* @param checkReportQuery
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "checkReportQuery", value = "查询实体checkReportQuery", required = true, dataTypeClass = CheckReportQuery.class)
|
||||
})
|
||||
@GetMapping("/page")
|
||||
public AjaxResult getCheckReportPage(CheckReportQuery checkReportQuery) {
|
||||
QueryWrapper<CheckReportEntity> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq(StrUtil.isNotBlank(checkReportQuery.getRuleTypeId()), "r.rule_type_id", checkReportQuery.getRuleTypeId());
|
||||
queryWrapper.like(StrUtil.isNotBlank(checkReportQuery.getRuleName()), "r.rule_name", checkReportQuery.getRuleName());
|
||||
queryWrapper.like(StrUtil.isNotBlank(checkReportQuery.getRuleSource()), "r.rule_source", checkReportQuery.getRuleSource());
|
||||
queryWrapper.like(StrUtil.isNotBlank(checkReportQuery.getRuleTable()), "r.rule_table", checkReportQuery.getRuleTable());
|
||||
queryWrapper.like(StrUtil.isNotBlank(checkReportQuery.getRuleColumn()), "r.rule_column", checkReportQuery.getRuleColumn());
|
||||
// 确定唯一核查报告
|
||||
queryWrapper.apply("c.check_batch = r.last_check_batch");
|
||||
IPage<CheckReportEntity> page = checkReportService.page(new Page<>(checkReportQuery.getPageNum(), checkReportQuery.getPageSize()), queryWrapper);
|
||||
List<CheckReportVo> collect = page.getRecords().stream().map(checkReportMapper::toVO).collect(Collectors.toList());
|
||||
JsonPage<CheckReportVo> jsonPage = new JsonPage<>(page.getCurrent(), page.getSize(), page.getTotal(), collect);
|
||||
return AjaxResult.success(jsonPage);
|
||||
}
|
||||
|
||||
@GetMapping("/getReportBySource")
|
||||
public AjaxResult getReportBySource(CheckReportQuery checkReportQuery) {
|
||||
LocalDate checkDate = checkReportQuery.getCheckDate();
|
||||
String date = DateTimeFormatter.ofPattern("yyyy-MM-dd").format(checkDate);
|
||||
List<DataReportEntity> list = checkReportService.getReportBySource(date);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@GetMapping("/getReportByType")
|
||||
public AjaxResult getReportByType(CheckReportQuery checkReportQuery) {
|
||||
LocalDate checkDate = checkReportQuery.getCheckDate();
|
||||
String date = DateTimeFormatter.ofPattern("yyyy-MM-dd").format(checkDate);
|
||||
List<DataReportEntity> list = checkReportService.getReportByType(date);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@GetMapping("/getReportDetail")
|
||||
public AjaxResult getReportDetail(CheckReportQuery checkReportQuery) {
|
||||
LocalDate checkDate = checkReportQuery.getCheckDate();
|
||||
String date = DateTimeFormatter.ofPattern("yyyy-MM-dd").format(checkDate);
|
||||
Map<String, Object> map = checkReportService.getReportDetail(date);
|
||||
return AjaxResult.success(map);
|
||||
}
|
||||
}
|
@ -0,0 +1,140 @@
|
||||
package com.czsj.web.controller.quality;
|
||||
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.czsj.common.core.controller.BaseController;
|
||||
import com.czsj.common.core.domain.AjaxResult;
|
||||
import com.czsj.core.database.core.JsonPage;
|
||||
import com.czsj.metadata.validate.ValidationGroups;
|
||||
import com.czsj.quality.dto.CheckRuleDto;
|
||||
import com.czsj.quality.entity.CheckRuleEntity;
|
||||
import com.czsj.quality.mapstruct.CheckRuleMapper;
|
||||
import com.czsj.quality.query.CheckRuleQuery;
|
||||
import com.czsj.quality.service.CheckRuleService;
|
||||
import com.czsj.quality.vo.CheckRuleVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 核查规则信息表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-09-27
|
||||
*/
|
||||
@Api(tags = {"核查规则信息表"})
|
||||
@RestController
|
||||
@RequestMapping("/quality/checkRules")
|
||||
public class CheckRuleController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private CheckRuleService checkRuleService;
|
||||
|
||||
@Autowired
|
||||
private CheckRuleMapper checkRuleMapper;
|
||||
|
||||
/**
|
||||
* 通过ID查询信息
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "获取详细信息", notes = "根据url的id来获取详细信息")
|
||||
@ApiImplicitParam(name = "id", value = "ID", required = true, dataType = "String", paramType = "path")
|
||||
@GetMapping("/{id}")
|
||||
public AjaxResult getCheckRuleById(@PathVariable String id) {
|
||||
CheckRuleEntity checkRuleEntity = checkRuleService.getCheckRuleById(id);
|
||||
return AjaxResult.success(checkRuleMapper.toVO(checkRuleEntity));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询信息
|
||||
*
|
||||
* @param checkRuleQuery
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "checkRuleQuery", value = "查询实体checkRuleQuery", required = true, dataTypeClass = CheckRuleQuery.class)
|
||||
})
|
||||
@GetMapping("/page")
|
||||
public AjaxResult getCheckRulePage(CheckRuleQuery checkRuleQuery) {
|
||||
QueryWrapper<CheckRuleEntity> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq(StrUtil.isNotBlank(checkRuleQuery.getRuleTypeId()), "r.rule_type_id", checkRuleQuery.getRuleTypeId());
|
||||
queryWrapper.like(StrUtil.isNotBlank(checkRuleQuery.getRuleName()), "r.rule_name", checkRuleQuery.getRuleName());
|
||||
queryWrapper.like(StrUtil.isNotBlank(checkRuleQuery.getRuleSource()), "r.rule_source", checkRuleQuery.getRuleSource());
|
||||
queryWrapper.like(StrUtil.isNotBlank(checkRuleQuery.getRuleTable()), "r.rule_table", checkRuleQuery.getRuleTable());
|
||||
queryWrapper.like(StrUtil.isNotBlank(checkRuleQuery.getRuleColumn()), "r.rule_column", checkRuleQuery.getRuleColumn());
|
||||
IPage<CheckRuleEntity> page = checkRuleService.page(new Page<>(checkRuleQuery.getPageNum(), checkRuleQuery.getPageSize()), queryWrapper);
|
||||
List<CheckRuleVo> collect = page.getRecords().stream().map(checkRuleMapper::toVO).collect(Collectors.toList());
|
||||
JsonPage<CheckRuleVo> jsonPage = new JsonPage<>(page.getCurrent(), page.getSize(), page.getTotal(), collect);
|
||||
return AjaxResult.success(jsonPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
* @param checkRule
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "添加信息", notes = "根据checkRule对象添加信息")
|
||||
@ApiImplicitParam(name = "checkRule", value = "详细实体checkRule", required = true, dataType = "CheckRuleDto")
|
||||
@PostMapping()
|
||||
public AjaxResult saveCheckRule(@RequestBody @Validated({ValidationGroups.Insert.class}) CheckRuleDto checkRule) {
|
||||
CheckRuleEntity checkRuleEntity = checkRuleService.saveCheckRule(checkRule);
|
||||
return AjaxResult.success(checkRuleMapper.toVO(checkRuleEntity));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param checkRule
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "修改信息", notes = "根据url的id来指定修改对象,并根据传过来的信息来修改详细信息")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "ID", required = true, dataType = "String", paramType = "path"),
|
||||
@ApiImplicitParam(name = "checkRule", value = "详细实体checkRule", required = true, dataType = "CheckRuleDto")
|
||||
})
|
||||
@PutMapping("/{id}")
|
||||
public AjaxResult updateCheckRule(@PathVariable String id, @RequestBody @Validated({ValidationGroups.Update.class}) CheckRuleDto checkRule) {
|
||||
CheckRuleEntity checkRuleEntity = checkRuleService.updateCheckRule(checkRule);
|
||||
return AjaxResult.success(checkRuleMapper.toVO(checkRuleEntity));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "删除", notes = "根据url的id来指定删除对象")
|
||||
@ApiImplicitParam(name = "id", value = "ID", required = true, dataType = "String", paramType = "path")
|
||||
@DeleteMapping("/{id}")
|
||||
public AjaxResult deleteCheckRuleById(@PathVariable String id) {
|
||||
checkRuleService.deleteCheckRuleById(id);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "批量删除", notes = "根据url的ids来批量删除对象")
|
||||
@ApiImplicitParam(name = "ids", value = "ID集合", required = true, dataType = "List", paramType = "path")
|
||||
@DeleteMapping("/batch/{ids}")
|
||||
public AjaxResult deleteCheckRuleBatch(@PathVariable List<String> ids) {
|
||||
checkRuleService.deleteCheckRuleBatch(ids);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
@ -0,0 +1,90 @@
|
||||
package com.czsj.web.controller.quality;
|
||||
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.czsj.common.core.controller.BaseController;
|
||||
import com.czsj.common.core.domain.AjaxResult;
|
||||
import com.czsj.core.database.core.JsonPage;
|
||||
import com.czsj.quality.entity.RuleItemEntity;
|
||||
import com.czsj.quality.mapstruct.RuleItemMapper;
|
||||
import com.czsj.quality.query.RuleItemQuery;
|
||||
import com.czsj.quality.service.RuleItemService;
|
||||
import com.czsj.quality.vo.RuleItemVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
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 java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 规则核查项信息表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-10-15
|
||||
*/
|
||||
@Api(tags = {"规则核查项信息表"})
|
||||
@RestController
|
||||
@RequestMapping("/quality/ruleItems")
|
||||
public class RuleItemController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private RuleItemService ruleItemService;
|
||||
|
||||
@Autowired
|
||||
private RuleItemMapper ruleItemMapper;
|
||||
|
||||
/**
|
||||
* 通过ID查询信息
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "获取详细信息", notes = "根据url的id来获取详细信息")
|
||||
@ApiImplicitParam(name = "id", value = "ID", required = true, dataType = "String", paramType = "path")
|
||||
@GetMapping("/{id}")
|
||||
public AjaxResult getRuleItemById(@PathVariable String id) {
|
||||
RuleItemEntity ruleItemEntity = ruleItemService.getRuleItemById(id);
|
||||
return AjaxResult.success(ruleItemMapper.toVO(ruleItemEntity));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取列表", notes = "")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult getRuleTypeList(RuleItemQuery ruleItemQuery) {
|
||||
QueryWrapper<RuleItemEntity> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq(StrUtil.isNotBlank(ruleItemQuery.getRuleTypeId()), "rule_type_id", ruleItemQuery.getRuleTypeId());
|
||||
List<RuleItemEntity> list = ruleItemService.list(queryWrapper);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询信息
|
||||
*
|
||||
* @param ruleItemQuery
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "ruleItemQuery", value = "查询实体ruleItemQuery", required = true, dataTypeClass = RuleItemQuery.class)
|
||||
})
|
||||
@GetMapping("/page")
|
||||
public AjaxResult getRuleItemPage(RuleItemQuery ruleItemQuery) {
|
||||
QueryWrapper<RuleItemEntity> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq(StrUtil.isNotBlank(ruleItemQuery.getRuleTypeId()), "rule_type_id", ruleItemQuery.getRuleTypeId());
|
||||
IPage<RuleItemEntity> page = ruleItemService.page(new Page<>(ruleItemQuery.getPageNum(), ruleItemQuery.getPageSize()), queryWrapper);
|
||||
List<RuleItemVo> collect = page.getRecords().stream().map(ruleItemMapper::toVO).collect(Collectors.toList());
|
||||
JsonPage<RuleItemVo> jsonPage = new JsonPage<>(page.getCurrent(), page.getSize(), page.getTotal(), collect);
|
||||
return AjaxResult.success(jsonPage);
|
||||
}
|
||||
}
|
@ -0,0 +1,87 @@
|
||||
package com.czsj.web.controller.quality;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.czsj.common.core.controller.BaseController;
|
||||
import com.czsj.common.core.domain.AjaxResult;
|
||||
import com.czsj.core.database.core.JsonPage;
|
||||
import com.czsj.quality.entity.RuleLevelEntity;
|
||||
import com.czsj.quality.mapstruct.RuleLevelMapper;
|
||||
import com.czsj.quality.query.RuleLevelQuery;
|
||||
import com.czsj.quality.service.RuleLevelService;
|
||||
import com.czsj.quality.vo.RuleLevelVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
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 java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 规则级别信息表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-10-14
|
||||
*/
|
||||
@Api(tags = {"规则级别信息表"})
|
||||
@RestController
|
||||
@RequestMapping("/quality/ruleLevels")
|
||||
public class RuleLevelController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private RuleLevelService ruleLevelService;
|
||||
|
||||
@Autowired
|
||||
private RuleLevelMapper ruleLevelMapper;
|
||||
|
||||
/**
|
||||
* 通过ID查询信息
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "获取详细信息", notes = "根据url的id来获取详细信息")
|
||||
@ApiImplicitParam(name = "id", value = "ID", required = true, dataType = "String", paramType = "path")
|
||||
@GetMapping("/{id}")
|
||||
public AjaxResult getRuleLevelById(@PathVariable String id) {
|
||||
RuleLevelEntity ruleLevelEntity = ruleLevelService.getRuleLevelById(id);
|
||||
return AjaxResult.success(ruleLevelMapper.toVO(ruleLevelEntity));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取列表", notes = "")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult getRuleTypeList() {
|
||||
List<RuleLevelEntity> list = ruleLevelService.list(Wrappers.emptyWrapper());
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询信息
|
||||
*
|
||||
* @param ruleLevelQuery
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "ruleLevelQuery", value = "查询实体ruleLevelQuery", required = true, dataTypeClass = RuleLevelQuery.class)
|
||||
})
|
||||
@GetMapping("/page")
|
||||
public AjaxResult getRuleLevelPage(RuleLevelQuery ruleLevelQuery) {
|
||||
QueryWrapper<RuleLevelEntity> queryWrapper = new QueryWrapper<>();
|
||||
IPage<RuleLevelEntity> page = ruleLevelService.page(new Page<>(ruleLevelQuery.getPageNum(), ruleLevelQuery.getPageSize()), queryWrapper);
|
||||
List<RuleLevelVo> collect = page.getRecords().stream().map(ruleLevelMapper::toVO).collect(Collectors.toList());
|
||||
JsonPage<RuleLevelVo> jsonPage = new JsonPage<>(page.getCurrent(), page.getSize(), page.getTotal(), collect);
|
||||
return AjaxResult.success(jsonPage);
|
||||
}
|
||||
}
|
@ -0,0 +1,97 @@
|
||||
package com.czsj.web.controller.quality;
|
||||
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.czsj.common.core.controller.BaseController;
|
||||
import com.czsj.common.core.domain.AjaxResult;
|
||||
import com.czsj.core.database.core.JsonPage;
|
||||
import com.czsj.quality.entity.RuleTypeEntity;
|
||||
import com.czsj.quality.entity.RuleTypeReportEntity;
|
||||
import com.czsj.quality.mapstruct.RuleTypeMapper;
|
||||
import com.czsj.quality.query.RuleTypeQuery;
|
||||
import com.czsj.quality.service.RuleTypeService;
|
||||
import com.czsj.quality.vo.RuleTypeVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
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 java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 规则类型信息表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-09-27
|
||||
*/
|
||||
@Api(tags = {"规则类型信息表"})
|
||||
@RestController
|
||||
@RequestMapping("/quality/ruleTypes")
|
||||
public class RuleTypeController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private RuleTypeService ruleTypeService;
|
||||
|
||||
@Autowired
|
||||
private RuleTypeMapper ruleTypeMapper;
|
||||
|
||||
/**
|
||||
* 通过ID查询信息
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "获取详细信息", notes = "根据url的id来获取详细信息")
|
||||
@ApiImplicitParam(name = "id", value = "ID", required = true, dataType = "String", paramType = "path")
|
||||
@GetMapping("/{id}")
|
||||
public AjaxResult getRuleTypeById(@PathVariable String id) {
|
||||
RuleTypeEntity ruleTypeEntity = ruleTypeService.getRuleTypeById(id);
|
||||
return AjaxResult.success(ruleTypeMapper.toVO(ruleTypeEntity));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取列表", notes = "")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult getRuleTypeList() {
|
||||
List<RuleTypeEntity> list = ruleTypeService.list(Wrappers.emptyWrapper());
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取列表", notes = "")
|
||||
@GetMapping("/report/list")
|
||||
public AjaxResult getRuleTypeListForReport() {
|
||||
List<RuleTypeReportEntity> list = ruleTypeService.getRuleTypeListForReport();
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询信息
|
||||
*
|
||||
* @param ruleTypeQuery
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "ruleTypeQuery", value = "查询实体ruleTypeQuery", required = true, dataTypeClass = RuleTypeQuery.class)
|
||||
})
|
||||
@GetMapping("/page")
|
||||
public AjaxResult getRuleTypePage(RuleTypeQuery ruleTypeQuery) {
|
||||
QueryWrapper<RuleTypeEntity> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.like(StrUtil.isNotBlank(ruleTypeQuery.getName()), "name", ruleTypeQuery.getName());
|
||||
IPage<RuleTypeEntity> page = ruleTypeService.page(new Page<>(ruleTypeQuery.getPageNum(), ruleTypeQuery.getPageSize()), queryWrapper);
|
||||
List<RuleTypeVo> collect = page.getRecords().stream().map(ruleTypeMapper::toVO).collect(Collectors.toList());
|
||||
JsonPage<RuleTypeVo> jsonPage = new JsonPage<>(page.getCurrent(), page.getSize(), page.getTotal(), collect);
|
||||
return AjaxResult.success(jsonPage);
|
||||
}
|
||||
}
|
@ -0,0 +1,165 @@
|
||||
package com.czsj.web.controller.standard;
|
||||
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.czsj.common.core.controller.BaseController;
|
||||
import com.czsj.common.core.domain.AjaxResult;
|
||||
import com.czsj.core.database.core.JsonPage;
|
||||
import com.czsj.metadata.validate.ValidationGroups;
|
||||
import com.czsj.standard.dto.ContrastDto;
|
||||
import com.czsj.standard.entity.ContrastEntity;
|
||||
import com.czsj.standard.mapstruct.ContrastMapper;
|
||||
import com.czsj.standard.query.ContrastQuery;
|
||||
import com.czsj.standard.service.ContrastService;
|
||||
import com.czsj.standard.vo.ContrastStatisticVo;
|
||||
import com.czsj.standard.vo.ContrastTreeVo;
|
||||
import com.czsj.standard.vo.ContrastVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 对照表信息表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-09-27
|
||||
*/
|
||||
@Api(tags = {"对照表信息表"})
|
||||
@RestController
|
||||
@RequestMapping("/standard/contrasts")
|
||||
public class ContrastController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private ContrastService contrastService;
|
||||
|
||||
@Autowired
|
||||
private ContrastMapper contrastMapper;
|
||||
|
||||
/**
|
||||
* 通过ID查询信息
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "获取详细信息", notes = "根据url的id来获取详细信息")
|
||||
@ApiImplicitParam(name = "id", value = "ID", required = true, dataType = "String", paramType = "path")
|
||||
@GetMapping("/{id}")
|
||||
public AjaxResult getContrastById(@PathVariable String id) {
|
||||
ContrastEntity contrastEntity = contrastService.getContrastById(id);
|
||||
return AjaxResult.success(contrastMapper.toVO(contrastEntity));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询信息
|
||||
*
|
||||
* @param contrastQuery
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "contrastQuery", value = "查询实体contrastQuery", required = true, dataTypeClass = ContrastQuery.class)
|
||||
})
|
||||
@GetMapping("/page")
|
||||
public AjaxResult getContrastPage(ContrastQuery contrastQuery) {
|
||||
QueryWrapper<ContrastEntity> queryWrapper = new QueryWrapper<>();
|
||||
IPage<ContrastEntity> page = contrastService.page(new Page<>(contrastQuery.getPageNum(), contrastQuery.getPageSize()), queryWrapper);
|
||||
List<ContrastVo> collect = page.getRecords().stream().map(contrastMapper::toVO).collect(Collectors.toList());
|
||||
JsonPage<ContrastVo> jsonPage = new JsonPage<>(page.getCurrent(), page.getSize(), page.getTotal(), collect);
|
||||
return AjaxResult.success(jsonPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
* @param contrast
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "添加信息", notes = "根据contrast对象添加信息")
|
||||
@ApiImplicitParam(name = "contrast", value = "详细实体contrast", required = true, dataType = "ContrastDto")
|
||||
@PostMapping()
|
||||
public AjaxResult saveContrast(@RequestBody @Validated({ValidationGroups.Insert.class}) ContrastDto contrast) {
|
||||
ContrastEntity contrastEntity = contrastService.saveContrast(contrast);
|
||||
return AjaxResult.success(contrastMapper.toVO(contrastEntity));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param contrast
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "修改信息", notes = "根据url的id来指定修改对象,并根据传过来的信息来修改详细信息")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "ID", required = true, dataType = "String", paramType = "path"),
|
||||
@ApiImplicitParam(name = "contrast", value = "详细实体contrast", required = true, dataType = "ContrastDto")
|
||||
})
|
||||
@PutMapping("/{id}")
|
||||
public AjaxResult updateContrast(@PathVariable String id, @RequestBody @Validated({ValidationGroups.Update.class}) ContrastDto contrast) {
|
||||
ContrastEntity contrastEntity = contrastService.updateContrast(contrast);
|
||||
return AjaxResult.success(contrastMapper.toVO(contrastEntity));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "删除", notes = "根据url的id来指定删除对象")
|
||||
@ApiImplicitParam(name = "id", value = "ID", required = true, dataType = "String", paramType = "path")
|
||||
@DeleteMapping("/{id}")
|
||||
public AjaxResult deleteContrastById(@PathVariable String id) {
|
||||
contrastService.deleteContrastById(id);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "批量删除角色", notes = "根据url的ids来批量删除对象")
|
||||
@ApiImplicitParam(name = "ids", value = "ID集合", required = true, dataType = "List", paramType = "path")
|
||||
@DeleteMapping("/batch/{ids}")
|
||||
public AjaxResult deleteContrastBatch(@PathVariable List<String> ids) {
|
||||
contrastService.deleteContrastBatch(ids);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@GetMapping("/tree")
|
||||
public AjaxResult getContrastTree() {
|
||||
List<ContrastTreeVo> list = contrastService.getContrastTree();
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询统计信息
|
||||
*
|
||||
* @param contrastQuery
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "contrastQuery", value = "查询实体contrastQuery", required = true, dataTypeClass = ContrastQuery.class)
|
||||
})
|
||||
@GetMapping("/stat")
|
||||
public AjaxResult contrastStat(ContrastQuery contrastQuery) {
|
||||
QueryWrapper<ContrastEntity> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.like(StrUtil.isNotBlank(contrastQuery.getSourceName()), "c.source_name", contrastQuery.getSourceName());
|
||||
queryWrapper.like(StrUtil.isNotBlank(contrastQuery.getTableName()), "c.table_name", contrastQuery.getTableName());
|
||||
queryWrapper.like(StrUtil.isNotBlank(contrastQuery.getColumnName()), "c.column_name", contrastQuery.getColumnName());
|
||||
IPage<ContrastEntity> page = contrastService.statistic(new Page<>(contrastQuery.getPageNum(), contrastQuery.getPageSize()), queryWrapper);
|
||||
List<ContrastStatisticVo> collect = page.getRecords().stream().map(contrastMapper::toSVO).collect(Collectors.toList());
|
||||
JsonPage<ContrastStatisticVo> jsonPage = new JsonPage<>(page.getCurrent(), page.getSize(), page.getTotal(), collect);
|
||||
return AjaxResult.success(jsonPage);
|
||||
}
|
||||
}
|
@ -0,0 +1,137 @@
|
||||
package com.czsj.web.controller.standard;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.czsj.common.core.controller.BaseController;
|
||||
import com.czsj.common.core.domain.AjaxResult;
|
||||
import com.czsj.core.database.core.JsonPage;
|
||||
import com.czsj.metadata.validate.ValidationGroups;
|
||||
import com.czsj.standard.dto.ContrastDictDto;
|
||||
import com.czsj.standard.entity.ContrastDictEntity;
|
||||
import com.czsj.standard.mapstruct.ContrastDictMapper;
|
||||
import com.czsj.standard.query.ContrastDictQuery;
|
||||
import com.czsj.standard.service.ContrastDictService;
|
||||
import com.czsj.standard.vo.ContrastDictVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 字典对照信息表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-09-27
|
||||
*/
|
||||
@Api(tags = {"字典对照信息表"})
|
||||
@RestController
|
||||
@RequestMapping("/standard/contrastDicts")
|
||||
public class ContrastDictController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private ContrastDictService contrastDictService;
|
||||
|
||||
@Autowired
|
||||
private ContrastDictMapper contrastDictMapper;
|
||||
|
||||
/**
|
||||
* 通过ID查询信息
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "获取详细信息", notes = "根据url的id来获取详细信息")
|
||||
@ApiImplicitParam(name = "id", value = "ID", required = true, dataType = "String", paramType = "path")
|
||||
@GetMapping("/{id}")
|
||||
public AjaxResult getContrastDictById(@PathVariable String id) {
|
||||
ContrastDictEntity contrastDictEntity = contrastDictService.getContrastDictById(id);
|
||||
return AjaxResult.success(contrastDictMapper.toVO(contrastDictEntity));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询信息
|
||||
*
|
||||
* @param contrastDictQuery
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "contrastDictQuery", value = "查询实体contrastDictQuery", required = true, dataTypeClass = ContrastDictQuery.class)
|
||||
})
|
||||
@GetMapping("/page")
|
||||
public AjaxResult getContrastDictPage(ContrastDictQuery contrastDictQuery) {
|
||||
QueryWrapper<ContrastDictEntity> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq(StrUtil.isNotBlank(contrastDictQuery.getContrastId()), "d.contrast_id", contrastDictQuery.getContrastId());
|
||||
queryWrapper.like(StrUtil.isNotBlank(contrastDictQuery.getColCode()), "d.col_code", contrastDictQuery.getColCode());
|
||||
queryWrapper.like(StrUtil.isNotBlank(contrastDictQuery.getColName()), "d.col_name", contrastDictQuery.getColName());
|
||||
IPage<ContrastDictEntity> page = contrastDictService.page(new Page<>(contrastDictQuery.getPageNum(), contrastDictQuery.getPageSize()), queryWrapper);
|
||||
List<ContrastDictVo> collect = page.getRecords().stream().map(contrastDictMapper::toVO).collect(Collectors.toList());
|
||||
JsonPage<ContrastDictVo> jsonPage = new JsonPage<>(page.getCurrent(), page.getSize(), page.getTotal(), collect);
|
||||
return AjaxResult.success(jsonPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
* @param contrastDict
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "添加信息", notes = "根据contrastDict对象添加信息")
|
||||
@ApiImplicitParam(name = "contrastDict", value = "详细实体contrastDict", required = true, dataType = "ContrastDictDto")
|
||||
@PostMapping()
|
||||
public AjaxResult saveContrastDict(@RequestBody @Validated({ValidationGroups.Insert.class}) ContrastDictDto contrastDict) {
|
||||
ContrastDictEntity contrastDictEntity = contrastDictService.saveContrastDict(contrastDict);
|
||||
return AjaxResult.success(contrastDictMapper.toVO(contrastDictEntity));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param contrastDict
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "修改信息", notes = "根据url的id来指定修改对象,并根据传过来的信息来修改详细信息")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "ID", required = true, dataType = "String", paramType = "path"),
|
||||
@ApiImplicitParam(name = "contrastDict", value = "详细实体contrastDict", required = true, dataType = "ContrastDictDto")
|
||||
})
|
||||
@PutMapping("/{id}")
|
||||
public AjaxResult updateContrastDict(@PathVariable String id, @RequestBody @Validated({ValidationGroups.Update.class}) ContrastDictDto contrastDict) {
|
||||
ContrastDictEntity contrastDictEntity = contrastDictService.updateContrastDict(contrastDict);
|
||||
return AjaxResult.success(contrastDictMapper.toVO(contrastDictEntity));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "删除", notes = "根据url的id来指定删除对象")
|
||||
@ApiImplicitParam(name = "id", value = "ID", required = true, dataType = "String", paramType = "path")
|
||||
@DeleteMapping("/{id}")
|
||||
public AjaxResult deleteContrastDictById(@PathVariable String id) {
|
||||
contrastDictService.deleteContrastDictById(id);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "批量删除角色", notes = "根据url的ids来批量删除对象")
|
||||
@ApiImplicitParam(name = "ids", value = "ID集合", required = true, dataType = "List", paramType = "path")
|
||||
@DeleteMapping("/batch/{ids}")
|
||||
public AjaxResult deleteContrastDictBatch(@PathVariable List<String> ids) {
|
||||
contrastDictService.deleteContrastDictBatch(ids);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
@ -0,0 +1,148 @@
|
||||
package com.czsj.web.controller.standard;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.czsj.common.core.controller.BaseController;
|
||||
import com.czsj.common.core.domain.AjaxResult;
|
||||
import com.czsj.core.database.core.JsonPage;
|
||||
import com.czsj.metadata.validate.ValidationGroups;
|
||||
import com.czsj.standard.dto.DictDto;
|
||||
import com.czsj.standard.entity.DictEntity;
|
||||
import com.czsj.standard.mapstruct.DictMapper;
|
||||
import com.czsj.standard.query.DictQuery;
|
||||
import com.czsj.standard.service.DictService;
|
||||
import com.czsj.standard.vo.DictVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 数据标准字典表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-08-26
|
||||
*/
|
||||
@Api(tags = {"数据标准字典表"})
|
||||
@RestController
|
||||
@RequestMapping("/standard/dicts")
|
||||
public class DictController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private DictService dictService;
|
||||
|
||||
@Autowired
|
||||
private DictMapper dictMapper;
|
||||
|
||||
/**
|
||||
* 通过ID查询信息
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "获取详细信息", notes = "根据url的id来获取详细信息")
|
||||
@ApiImplicitParam(name = "id", value = "ID", required = true, dataType = "String", paramType = "path")
|
||||
@GetMapping("/{id}")
|
||||
public AjaxResult getDictById(@PathVariable String id) {
|
||||
DictEntity dictEntity = dictService.getDictById(id);
|
||||
return AjaxResult.success(dictMapper.toVO(dictEntity));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询信息
|
||||
*
|
||||
* @param dictQuery
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "dictQuery", value = "查询实体dictQuery", required = true, dataTypeClass = DictQuery.class)
|
||||
})
|
||||
@GetMapping("/page")
|
||||
public AjaxResult getDictPage(DictQuery dictQuery) {
|
||||
QueryWrapper<DictEntity> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq(StrUtil.isNotBlank(dictQuery.getTypeId()), "d.type_id", dictQuery.getTypeId());
|
||||
queryWrapper.like(StrUtil.isNotBlank(dictQuery.getGbCode()), "d.gb_code", dictQuery.getGbCode());
|
||||
queryWrapper.like(StrUtil.isNotBlank(dictQuery.getGbName()), "d.gb_name", dictQuery.getGbName());
|
||||
IPage<DictEntity> page = dictService.page(new Page<>(dictQuery.getPageNum(), dictQuery.getPageSize()), queryWrapper);
|
||||
List<DictVo> collect = page.getRecords().stream().map(dictMapper::toVO).collect(Collectors.toList());
|
||||
JsonPage<DictVo> jsonPage = new JsonPage<>(page.getCurrent(), page.getSize(), page.getTotal(), collect);
|
||||
return AjaxResult.success(jsonPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
* @param dict
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "添加信息", notes = "根据dict对象添加信息")
|
||||
@ApiImplicitParam(name = "dict", value = "详细实体dict", required = true, dataType = "DictDto")
|
||||
@PostMapping()
|
||||
public AjaxResult saveDict(@RequestBody @Validated({ValidationGroups.Insert.class}) DictDto dict) {
|
||||
DictEntity dictEntity = dictService.saveDict(dict);
|
||||
return AjaxResult.success(dictMapper.toVO(dictEntity));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param dict
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "修改信息", notes = "根据url的id来指定修改对象,并根据传过来的信息来修改详细信息")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "ID", required = true, dataType = "String", paramType = "path"),
|
||||
@ApiImplicitParam(name = "dict", value = "详细实体dict", required = true, dataType = "DictDto")
|
||||
})
|
||||
@PutMapping("/{id}")
|
||||
public AjaxResult updateDict(@PathVariable String id, @RequestBody @Validated({ValidationGroups.Update.class}) DictDto dict) {
|
||||
DictEntity dictEntity = dictService.updateDict(dict);
|
||||
return AjaxResult.success(dictMapper.toVO(dictEntity));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "删除", notes = "根据url的id来指定删除对象")
|
||||
@ApiImplicitParam(name = "id", value = "ID", required = true, dataType = "String", paramType = "path")
|
||||
@DeleteMapping("/{id}")
|
||||
public AjaxResult deleteDictById(@PathVariable String id) {
|
||||
dictService.deleteDictById(id);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "批量删除角色", notes = "根据url的ids来批量删除对象")
|
||||
@ApiImplicitParam(name = "ids", value = "ID集合", required = true, dataType = "List", paramType = "path")
|
||||
@DeleteMapping("/batch/{ids}")
|
||||
public AjaxResult deleteDictBatch(@PathVariable List<String> ids) {
|
||||
dictService.deleteDictBatch(ids);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新字典缓存
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/refresh")
|
||||
public AjaxResult refreshDict() {
|
||||
dictService.refreshDict();
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
package com.czsj.web.controller.standard;
|
||||
|
||||
import com.czsj.common.core.controller.BaseController;
|
||||
import com.czsj.common.core.domain.AjaxResult;
|
||||
import com.czsj.standard.dto.ManualMappingDto;
|
||||
import com.czsj.standard.service.DictMappingService;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Api(tags = {"字典对照映射"})
|
||||
@RestController
|
||||
@RequestMapping("/standard/mappings")
|
||||
public class DictMappingController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private DictMappingService dictMappingService;
|
||||
|
||||
@GetMapping("/{id}")
|
||||
public AjaxResult getDictMapping(@PathVariable String id) {
|
||||
Map<String, Object> map = dictMappingService.getDictMapping(id);
|
||||
return AjaxResult.success(map);
|
||||
}
|
||||
|
||||
@PostMapping("/auto/{id}")
|
||||
public AjaxResult dictAutoMapping(@PathVariable String id) {
|
||||
dictMappingService.dictAutoMapping(id);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@PostMapping("/manual")
|
||||
public AjaxResult dictManualMapping(@RequestBody @Validated ManualMappingDto manualMappingDto) {
|
||||
dictMappingService.dictManualMapping(manualMappingDto);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@PostMapping("/cancel/{id}")
|
||||
public AjaxResult dictCancelMapping(@PathVariable String id) {
|
||||
dictMappingService.dictCancelMapping(id);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package com.czsj.web.controller.standard;
|
||||
|
||||
import com.czsj.common.core.controller.BaseController;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/standard/inner")
|
||||
public class InnerController extends BaseController {
|
||||
|
||||
}
|
@ -0,0 +1,148 @@
|
||||
package com.czsj.web.controller.standard;
|
||||
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.czsj.common.core.controller.BaseController;
|
||||
import com.czsj.common.core.domain.AjaxResult;
|
||||
import com.czsj.core.database.core.DataConstant;
|
||||
import com.czsj.core.database.core.JsonPage;
|
||||
import com.czsj.metadata.validate.ValidationGroups;
|
||||
import com.czsj.standard.dto.TypeDto;
|
||||
import com.czsj.standard.entity.TypeEntity;
|
||||
import com.czsj.standard.mapstruct.TypeMapper;
|
||||
import com.czsj.standard.query.TypeQuery;
|
||||
import com.czsj.standard.service.TypeService;
|
||||
import com.czsj.standard.vo.TypeVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 数据标准类别表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-08-26
|
||||
*/
|
||||
@Api(tags = {"标准类别信息表"})
|
||||
@RestController
|
||||
@RequestMapping("/standard/types")
|
||||
public class TypeController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private TypeService typeService;
|
||||
|
||||
@Autowired
|
||||
private TypeMapper typeMapper;
|
||||
|
||||
/**
|
||||
* 通过ID查询信息
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "获取详细信息", notes = "根据url的id来获取详细信息")
|
||||
@ApiImplicitParam(name = "id", value = "ID", required = true, dataType = "String", paramType = "path")
|
||||
@GetMapping("/{id}")
|
||||
public AjaxResult getTypeById(@PathVariable String id) {
|
||||
TypeEntity typeEntity = typeService.getTypeById(id);
|
||||
return AjaxResult.success(typeMapper.toVO(typeEntity));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取列表", notes = "")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult getTypeList() {
|
||||
QueryWrapper<TypeEntity> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("status", DataConstant.EnableState.ENABLE.getKey());
|
||||
List<TypeEntity> list = typeService.list(queryWrapper);
|
||||
List<TypeVo> collect = list.stream().map(typeMapper::toVO).collect(Collectors.toList());
|
||||
return AjaxResult.success(collect);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询信息
|
||||
*
|
||||
* @param typeQuery
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页查询", notes = "")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "typeQuery", value = "查询实体typeQuery", required = true, dataTypeClass = TypeQuery.class)
|
||||
})
|
||||
@GetMapping("/page")
|
||||
public AjaxResult getTypePage(TypeQuery typeQuery) {
|
||||
QueryWrapper<TypeEntity> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.like(StrUtil.isNotBlank(typeQuery.getGbTypeCode()), "gb_type_code", typeQuery.getGbTypeCode());
|
||||
queryWrapper.like(StrUtil.isNotBlank(typeQuery.getGbTypeName()), "gb_type_name", typeQuery.getGbTypeName());
|
||||
IPage<TypeEntity> page = typeService.page(new Page<>(typeQuery.getPageNum(), typeQuery.getPageSize()), queryWrapper);
|
||||
List<TypeVo> collect = page.getRecords().stream().map(typeMapper::toVO).collect(Collectors.toList());
|
||||
JsonPage<TypeVo> jsonPage = new JsonPage<>(page.getCurrent(), page.getSize(), page.getTotal(), collect);
|
||||
return AjaxResult.success(jsonPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "添加信息", notes = "根据type对象添加信息")
|
||||
@ApiImplicitParam(name = "type", value = "详细实体type", required = true, dataType = "TypeDto")
|
||||
@PostMapping()
|
||||
public AjaxResult saveType(@RequestBody @Validated({ValidationGroups.Insert.class}) TypeDto type) {
|
||||
TypeEntity typeEntity = typeService.saveType(type);
|
||||
return AjaxResult.success(typeMapper.toVO(typeEntity));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "修改信息", notes = "根据url的id来指定修改对象,并根据传过来的信息来修改详细信息")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "ID", required = true, dataType = "String", paramType = "path"),
|
||||
@ApiImplicitParam(name = "type", value = "详细实体type", required = true, dataType = "TypeDto")
|
||||
})
|
||||
@PutMapping("/{id}")
|
||||
public AjaxResult updateType(@PathVariable String id, @RequestBody @Validated({ValidationGroups.Update.class}) TypeDto type) {
|
||||
TypeEntity typeEntity = typeService.updateType(type);
|
||||
return AjaxResult.success(typeMapper.toVO(typeEntity));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "删除", notes = "根据url的id来指定删除对象")
|
||||
@ApiImplicitParam(name = "id", value = "ID", required = true, dataType = "String", paramType = "path")
|
||||
@DeleteMapping("/{id}")
|
||||
public AjaxResult deleteTypeById(@PathVariable String id) {
|
||||
typeService.deleteTypeById(id);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "批量删除角色", notes = "根据url的ids来批量删除对象")
|
||||
@ApiImplicitParam(name = "ids", value = "ID集合", required = true, dataType = "List", paramType = "path")
|
||||
@DeleteMapping("/batch/{ids}")
|
||||
public AjaxResult deleteTypeBatch(@PathVariable List<String> ids) {
|
||||
typeService.deleteTypeBatch(ids);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
19
czsj-system/src/main/java/com/czsj/quality/dto/Accuracy.java
Normal file
19
czsj-system/src/main/java/com/czsj/quality/dto/Accuracy.java
Normal file
@ -0,0 +1,19 @@
|
||||
package com.czsj.quality.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 com.czsj.quality.dto;
|
||||
|
||||
import com.czsj.metadata.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 yuwei
|
||||
* @since 2020-09-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 com.czsj.quality.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 com.czsj.quality.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 com.czsj.quality.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 com.czsj.quality.dto;
|
||||
|
||||
import com.czsj.metadata.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 yuwei
|
||||
* @since 2020-10-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 com.czsj.quality.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 com.czsj.quality.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 lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 核查报告信息表
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-09-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,118 @@
|
||||
package com.czsj.quality.entity;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||
import com.czsj.core.database.base.DataScopeBaseEntity;
|
||||
import com.czsj.quality.dto.RuleConfig;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 核查规则信息表
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-09-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 com.czsj.quality.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 com.czsj.quality.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 yuwei
|
||||
* @since 2020-10-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 com.czsj.quality.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 yuwei
|
||||
* @since 2020-10-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 com.czsj.quality.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 yuwei
|
||||
* @since 2020-09-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 com.czsj.quality.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RuleTypeReportEntity extends RuleTypeEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 不合规数量
|
||||
*/
|
||||
private Integer checkErrorCount;
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.czsj.quality.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 yuwei
|
||||
* @since 2020-09-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 com.czsj.quality.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 lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 数据质量监控任务日志信息表
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-10-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,36 @@
|
||||
package com.czsj.quality.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,34 @@
|
||||
package com.czsj.quality.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.czsj.core.database.base.BaseDao;
|
||||
import com.czsj.quality.entity.CheckReportEntity;
|
||||
import com.czsj.quality.entity.DataReportEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 核查报告信息表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-09-27
|
||||
*/
|
||||
@Mapper
|
||||
public interface CheckReportDao extends BaseDao<CheckReportEntity> {
|
||||
|
||||
@Override
|
||||
<E extends IPage<CheckReportEntity>> E selectPage(E page, @Param(Constants.WRAPPER) Wrapper<CheckReportEntity> queryWrapper);
|
||||
|
||||
List<DataReportEntity> getReportBySource(@Param("checkDate") String checkDate);
|
||||
|
||||
List<DataReportEntity> getReportByType(@Param("checkDate") String checkDate);
|
||||
|
||||
List<DataReportEntity> getReportDetail(@Param("checkDate") String checkDate);
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.czsj.quality.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.czsj.core.database.base.BaseDao;
|
||||
import com.czsj.quality.entity.CheckRuleEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 核查规则信息表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-09-27
|
||||
*/
|
||||
@Mapper
|
||||
public interface CheckRuleDao extends BaseDao<CheckRuleEntity> {
|
||||
|
||||
@Override
|
||||
CheckRuleEntity selectById(Serializable id);
|
||||
|
||||
@Override
|
||||
List<CheckRuleEntity> selectList(@Param(Constants.WRAPPER) Wrapper<CheckRuleEntity> queryWrapper);
|
||||
|
||||
@Override
|
||||
<E extends IPage<CheckRuleEntity>> E selectPage(E page, @Param(Constants.WRAPPER) Wrapper<CheckRuleEntity> queryWrapper);
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.czsj.quality.mapper;
|
||||
|
||||
import com.czsj.core.database.base.BaseDao;
|
||||
import com.czsj.quality.entity.RuleItemEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 规则核查项信息表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-10-15
|
||||
*/
|
||||
@Mapper
|
||||
public interface RuleItemDao extends BaseDao<RuleItemEntity> {
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.czsj.quality.mapper;
|
||||
|
||||
|
||||
import com.czsj.core.database.base.BaseDao;
|
||||
import com.czsj.quality.entity.RuleLevelEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 规则级别信息表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-10-14
|
||||
*/
|
||||
@Mapper
|
||||
public interface RuleLevelDao extends BaseDao<RuleLevelEntity> {
|
||||
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.czsj.quality.mapper;
|
||||
|
||||
|
||||
import com.czsj.core.database.base.BaseDao;
|
||||
import com.czsj.quality.entity.RuleTypeEntity;
|
||||
import com.czsj.quality.entity.RuleTypeReportEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 规则类型信息表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-09-27
|
||||
*/
|
||||
@Mapper
|
||||
public interface RuleTypeDao extends BaseDao<RuleTypeEntity> {
|
||||
|
||||
List<RuleTypeReportEntity> selectListForReport();
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.czsj.quality.mapper;
|
||||
|
||||
|
||||
import com.czsj.core.database.base.BaseDao;
|
||||
import com.czsj.quality.entity.ScheduleJobEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 数据质量监控任务信息表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-09-29
|
||||
*/
|
||||
@Mapper
|
||||
public interface ScheduleJobDao extends BaseDao<ScheduleJobEntity> {
|
||||
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.czsj.quality.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.czsj.core.database.base.BaseDao;
|
||||
import com.czsj.quality.entity.ScheduleLogEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 数据质量监控任务日志信息表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-10-13
|
||||
*/
|
||||
@Mapper
|
||||
public interface ScheduleLogDao extends BaseDao<ScheduleLogEntity> {
|
||||
|
||||
@Override
|
||||
<E extends IPage<ScheduleLogEntity>> E selectPage(E page, @Param(Constants.WRAPPER) Wrapper<ScheduleLogEntity> queryWrapper);
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.czsj.quality.mapstruct;
|
||||
|
||||
|
||||
import com.czsj.quality.entity.CheckReportEntity;
|
||||
import com.czsj.quality.vo.CheckReportVo;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 核查报告信息表 Mapper 实体映射
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-09-27
|
||||
*/
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface CheckReportMapper {
|
||||
|
||||
/**
|
||||
* 将源对象转换为VO对象
|
||||
* @param e
|
||||
* @return D
|
||||
*/
|
||||
CheckReportVo toVO(CheckReportEntity e);
|
||||
|
||||
/**
|
||||
* 将源对象集合转换为VO对象集合
|
||||
* @param es
|
||||
* @return List<D>
|
||||
*/
|
||||
List<CheckReportVo> toVO(List<CheckReportEntity> es);
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.czsj.quality.mapstruct;
|
||||
|
||||
|
||||
import com.czsj.metadata.mapstruct.EntityMapper;
|
||||
import com.czsj.quality.dto.CheckRuleDto;
|
||||
import com.czsj.quality.entity.CheckRuleEntity;
|
||||
import com.czsj.quality.vo.CheckRuleVo;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 核查规则信息表 Mapper 实体映射
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-09-27
|
||||
*/
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface CheckRuleMapper extends EntityMapper<CheckRuleDto, CheckRuleEntity, CheckRuleVo> {
|
||||
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.czsj.quality.mapstruct;
|
||||
|
||||
|
||||
import com.czsj.quality.entity.RuleItemEntity;
|
||||
import com.czsj.quality.vo.RuleItemVo;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 规则核查项信息表 Mapper 实体映射
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-10-15
|
||||
*/
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface RuleItemMapper {
|
||||
|
||||
/**
|
||||
* 将源对象转换为VO对象
|
||||
* @param e
|
||||
* @return D
|
||||
*/
|
||||
RuleItemVo toVO(RuleItemEntity e);
|
||||
|
||||
/**
|
||||
* 将源对象集合转换为VO对象集合
|
||||
* @param es
|
||||
* @return List<D>
|
||||
*/
|
||||
List<RuleItemVo> toVO(List<RuleItemEntity> es);
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.czsj.quality.mapstruct;
|
||||
|
||||
|
||||
import com.czsj.quality.entity.RuleLevelEntity;
|
||||
import com.czsj.quality.vo.RuleLevelVo;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 规则级别信息表 Mapper 实体映射
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-10-14
|
||||
*/
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface RuleLevelMapper {
|
||||
|
||||
/**
|
||||
* 将源对象转换为VO对象
|
||||
* @param e
|
||||
* @return D
|
||||
*/
|
||||
RuleLevelVo toVO(RuleLevelEntity e);
|
||||
|
||||
/**
|
||||
* 将源对象集合转换为VO对象集合
|
||||
* @param es
|
||||
* @return List<D>
|
||||
*/
|
||||
List<RuleLevelVo> toVO(List<RuleLevelEntity> es);
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package com.czsj.quality.mapstruct;
|
||||
|
||||
|
||||
import com.czsj.quality.entity.RuleTypeEntity;
|
||||
import com.czsj.quality.vo.RuleTypeVo;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 规则类型信息表 Mapper 实体映射
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-09-27
|
||||
*/
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface RuleTypeMapper {
|
||||
|
||||
|
||||
/**
|
||||
* 将源对象转换为VO对象
|
||||
* @param e
|
||||
* @return D
|
||||
*/
|
||||
RuleTypeVo toVO(RuleTypeEntity e);
|
||||
|
||||
/**
|
||||
* 将源对象集合转换为VO对象集合
|
||||
* @param es
|
||||
* @return List<D>
|
||||
*/
|
||||
List<RuleTypeVo> toVO(List<RuleTypeEntity> es);
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.czsj.quality.mapstruct;
|
||||
|
||||
|
||||
import com.czsj.quality.entity.ScheduleJobEntity;
|
||||
import com.czsj.quality.vo.ScheduleJobVo;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 数据质量监控任务信息表 Mapper 实体映射
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-09-29
|
||||
*/
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface ScheduleJobMapper {
|
||||
|
||||
/**
|
||||
* 将源对象转换为VO对象
|
||||
* @param e
|
||||
* @return D
|
||||
*/
|
||||
ScheduleJobVo toVO(ScheduleJobEntity e);
|
||||
|
||||
/**
|
||||
* 将源对象集合转换为VO对象集合
|
||||
* @param es
|
||||
* @return List<D>
|
||||
*/
|
||||
List<ScheduleJobVo> toVO(List<ScheduleJobEntity> es);
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.czsj.quality.mapstruct;
|
||||
|
||||
|
||||
import com.czsj.quality.entity.ScheduleLogEntity;
|
||||
import com.czsj.quality.vo.ScheduleLogVo;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 数据质量监控任务日志信息表 Mapper 实体映射
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-10-13
|
||||
*/
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface ScheduleLogMapper {
|
||||
|
||||
/**
|
||||
* 将源对象转换为VO对象
|
||||
* @param e
|
||||
* @return D
|
||||
*/
|
||||
ScheduleLogVo toVO(ScheduleLogEntity e);
|
||||
|
||||
/**
|
||||
* 将源对象集合转换为VO对象集合
|
||||
* @param es
|
||||
* @return List<D>
|
||||
*/
|
||||
List<ScheduleLogVo> toVO(List<ScheduleLogEntity> es);
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package com.czsj.quality.mapstruct.impl;
|
||||
|
||||
|
||||
import com.czsj.quality.entity.CheckReportEntity;
|
||||
import com.czsj.quality.mapstruct.CheckReportMapper;
|
||||
import com.czsj.quality.vo.CheckReportVo;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class CheckReportMapperImpl implements CheckReportMapper {
|
||||
|
||||
@Override
|
||||
public CheckReportVo toVO(CheckReportEntity e) {
|
||||
if ( e == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
CheckReportVo checkReportVo = new CheckReportVo();
|
||||
|
||||
checkReportVo.setId( e.getId() );
|
||||
checkReportVo.setCheckRuleId( e.getCheckRuleId() );
|
||||
checkReportVo.setCheckDate( e.getCheckDate() );
|
||||
checkReportVo.setCheckResult( e.getCheckResult() );
|
||||
checkReportVo.setCheckTotalCount( e.getCheckTotalCount() );
|
||||
checkReportVo.setCheckErrorCount( e.getCheckErrorCount() );
|
||||
checkReportVo.setRuleName( e.getRuleName() );
|
||||
checkReportVo.setRuleType( e.getRuleType() );
|
||||
checkReportVo.setRuleSource( e.getRuleSource() );
|
||||
checkReportVo.setRuleTable( e.getRuleTable() );
|
||||
checkReportVo.setRuleColumn( e.getRuleColumn() );
|
||||
|
||||
return checkReportVo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CheckReportVo> toVO(List<CheckReportEntity> es) {
|
||||
if ( es == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
List<CheckReportVo> list = new ArrayList<CheckReportVo>( es.size() );
|
||||
for ( CheckReportEntity checkReportEntity : es ) {
|
||||
list.add( toVO( checkReportEntity ) );
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
@ -0,0 +1,148 @@
|
||||
package com.czsj.quality.mapstruct.impl;
|
||||
|
||||
|
||||
import com.czsj.quality.dto.CheckRuleDto;
|
||||
import com.czsj.quality.entity.CheckRuleEntity;
|
||||
import com.czsj.quality.mapstruct.CheckRuleMapper;
|
||||
import com.czsj.quality.vo.CheckRuleVo;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Component
|
||||
public class CheckRuleMapperImpl implements CheckRuleMapper {
|
||||
|
||||
@Override
|
||||
public CheckRuleDto toDTO(CheckRuleEntity e) {
|
||||
if ( e == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
CheckRuleDto checkRuleDto = new CheckRuleDto();
|
||||
|
||||
checkRuleDto.setId( e.getId() );
|
||||
checkRuleDto.setRuleName( e.getRuleName() );
|
||||
checkRuleDto.setRuleTypeId( e.getRuleTypeId() );
|
||||
checkRuleDto.setRuleItemId( e.getRuleItemId() );
|
||||
checkRuleDto.setRuleLevelId( e.getRuleLevelId() );
|
||||
checkRuleDto.setRuleDbType( e.getRuleDbType() );
|
||||
checkRuleDto.setRuleSourceId( e.getRuleSourceId() );
|
||||
checkRuleDto.setRuleSource( e.getRuleSource() );
|
||||
checkRuleDto.setRuleTableId( e.getRuleTableId() );
|
||||
checkRuleDto.setRuleTable( e.getRuleTable() );
|
||||
checkRuleDto.setRuleTableComment( e.getRuleTableComment() );
|
||||
checkRuleDto.setRuleColumnId( e.getRuleColumnId() );
|
||||
checkRuleDto.setRuleColumn( e.getRuleColumn() );
|
||||
checkRuleDto.setRuleColumnComment( e.getRuleColumnComment() );
|
||||
checkRuleDto.setRuleConfig( e.getRuleConfig() );
|
||||
checkRuleDto.setStatus( e.getStatus() );
|
||||
checkRuleDto.setRemark( e.getRemark() );
|
||||
|
||||
return checkRuleDto;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CheckRuleDto> toDTO(List<CheckRuleEntity> es) {
|
||||
if ( es == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
List<CheckRuleDto> list = new ArrayList<CheckRuleDto>( es.size() );
|
||||
for ( CheckRuleEntity checkRuleEntity : es ) {
|
||||
list.add( toDTO( checkRuleEntity ) );
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CheckRuleVo toVO(CheckRuleEntity e) {
|
||||
if ( e == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
CheckRuleVo checkRuleVo = new CheckRuleVo();
|
||||
|
||||
checkRuleVo.setId( e.getId() );
|
||||
checkRuleVo.setStatus( e.getStatus() );
|
||||
checkRuleVo.setCreateTime( e.getCreateTime() );
|
||||
checkRuleVo.setRemark( e.getRemark() );
|
||||
checkRuleVo.setRuleName( e.getRuleName() );
|
||||
checkRuleVo.setRuleTypeId( e.getRuleTypeId() );
|
||||
checkRuleVo.setRuleItemId( e.getRuleItemId() );
|
||||
checkRuleVo.setRuleType( e.getRuleType() );
|
||||
checkRuleVo.setRuleLevelId( e.getRuleLevelId() );
|
||||
checkRuleVo.setRuleLevel( e.getRuleLevel() );
|
||||
checkRuleVo.setRuleDbType( e.getRuleDbType() );
|
||||
checkRuleVo.setRuleSourceId( e.getRuleSourceId() );
|
||||
checkRuleVo.setRuleSource( e.getRuleSource() );
|
||||
checkRuleVo.setRuleTableId( e.getRuleTableId() );
|
||||
checkRuleVo.setRuleTable( e.getRuleTable() );
|
||||
checkRuleVo.setRuleTableComment( e.getRuleTableComment() );
|
||||
checkRuleVo.setRuleColumnId( e.getRuleColumnId() );
|
||||
checkRuleVo.setRuleColumn( e.getRuleColumn() );
|
||||
checkRuleVo.setRuleColumnComment( e.getRuleColumnComment() );
|
||||
checkRuleVo.setRuleConfig( e.getRuleConfig() );
|
||||
|
||||
return checkRuleVo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CheckRuleVo> toVO(List<CheckRuleEntity> es) {
|
||||
if ( es == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
List<CheckRuleVo> list = new ArrayList<CheckRuleVo>( es.size() );
|
||||
for ( CheckRuleEntity checkRuleEntity : es ) {
|
||||
list.add( toVO( checkRuleEntity ) );
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CheckRuleEntity toEntity(CheckRuleDto d) {
|
||||
if ( d == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
CheckRuleEntity checkRuleEntity = new CheckRuleEntity();
|
||||
|
||||
checkRuleEntity.setId( d.getId() );
|
||||
checkRuleEntity.setStatus( d.getStatus() );
|
||||
checkRuleEntity.setRemark( d.getRemark() );
|
||||
checkRuleEntity.setRuleName( d.getRuleName() );
|
||||
checkRuleEntity.setRuleTypeId( d.getRuleTypeId() );
|
||||
checkRuleEntity.setRuleItemId( d.getRuleItemId() );
|
||||
checkRuleEntity.setRuleLevelId( d.getRuleLevelId() );
|
||||
checkRuleEntity.setRuleDbType( d.getRuleDbType() );
|
||||
checkRuleEntity.setRuleSourceId( d.getRuleSourceId() );
|
||||
checkRuleEntity.setRuleSource( d.getRuleSource() );
|
||||
checkRuleEntity.setRuleTableId( d.getRuleTableId() );
|
||||
checkRuleEntity.setRuleTable( d.getRuleTable() );
|
||||
checkRuleEntity.setRuleTableComment( d.getRuleTableComment() );
|
||||
checkRuleEntity.setRuleColumnId( d.getRuleColumnId() );
|
||||
checkRuleEntity.setRuleColumn( d.getRuleColumn() );
|
||||
checkRuleEntity.setRuleColumnComment( d.getRuleColumnComment() );
|
||||
checkRuleEntity.setRuleConfig( d.getRuleConfig() );
|
||||
|
||||
return checkRuleEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CheckRuleEntity> toEntity(List<CheckRuleDto> ds) {
|
||||
if ( ds == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
List<CheckRuleEntity> list = new ArrayList<CheckRuleEntity>( ds.size() );
|
||||
for ( CheckRuleDto checkRuleDto : ds ) {
|
||||
list.add( toEntity( checkRuleDto ) );
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package com.czsj.quality.mapstruct.impl;
|
||||
|
||||
import com.czsj.quality.entity.RuleItemEntity;
|
||||
import com.czsj.quality.mapstruct.RuleItemMapper;
|
||||
import com.czsj.quality.vo.RuleItemVo;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Component
|
||||
public class RuleItemMapperImpl implements RuleItemMapper {
|
||||
|
||||
@Override
|
||||
public RuleItemVo toVO(RuleItemEntity e) {
|
||||
if ( e == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
RuleItemVo ruleItemVo = new RuleItemVo();
|
||||
|
||||
ruleItemVo.setId( e.getId() );
|
||||
ruleItemVo.setRuleTypeId( e.getRuleTypeId() );
|
||||
ruleItemVo.setItemCode( e.getItemCode() );
|
||||
ruleItemVo.setItemExplain( e.getItemExplain() );
|
||||
|
||||
return ruleItemVo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RuleItemVo> toVO(List<RuleItemEntity> es) {
|
||||
if ( es == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
List<RuleItemVo> list = new ArrayList<RuleItemVo>( es.size() );
|
||||
for ( RuleItemEntity ruleItemEntity : es ) {
|
||||
list.add( toVO( ruleItemEntity ) );
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package com.czsj.quality.mapstruct.impl;
|
||||
|
||||
|
||||
import com.czsj.quality.entity.RuleLevelEntity;
|
||||
import com.czsj.quality.mapstruct.RuleLevelMapper;
|
||||
import com.czsj.quality.vo.RuleLevelVo;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class RuleLevelMapperImpl implements RuleLevelMapper {
|
||||
|
||||
@Override
|
||||
public RuleLevelVo toVO(RuleLevelEntity e) {
|
||||
if ( e == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
RuleLevelVo ruleLevelVo = new RuleLevelVo();
|
||||
|
||||
ruleLevelVo.setId( e.getId() );
|
||||
ruleLevelVo.setCode( e.getCode() );
|
||||
ruleLevelVo.setName( e.getName() );
|
||||
|
||||
return ruleLevelVo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RuleLevelVo> toVO(List<RuleLevelEntity> es) {
|
||||
if ( es == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
List<RuleLevelVo> list = new ArrayList<RuleLevelVo>( es.size() );
|
||||
for ( RuleLevelEntity ruleLevelEntity : es ) {
|
||||
list.add( toVO( ruleLevelEntity ) );
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package com.czsj.quality.mapstruct.impl;
|
||||
|
||||
|
||||
import com.czsj.quality.entity.RuleTypeEntity;
|
||||
import com.czsj.quality.mapstruct.RuleTypeMapper;
|
||||
import com.czsj.quality.vo.RuleTypeVo;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class RuleTypeMapperImpl implements RuleTypeMapper {
|
||||
|
||||
@Override
|
||||
public RuleTypeVo toVO(RuleTypeEntity e) {
|
||||
if ( e == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
RuleTypeVo ruleTypeVo = new RuleTypeVo();
|
||||
|
||||
ruleTypeVo.setId( e.getId() );
|
||||
ruleTypeVo.setName( e.getName() );
|
||||
ruleTypeVo.setCode( e.getCode() );
|
||||
|
||||
return ruleTypeVo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RuleTypeVo> toVO(List<RuleTypeEntity> es) {
|
||||
if ( es == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
List<RuleTypeVo> list = new ArrayList<RuleTypeVo>( es.size() );
|
||||
for ( RuleTypeEntity ruleTypeEntity : es ) {
|
||||
list.add( toVO( ruleTypeEntity ) );
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
package com.czsj.quality.mapstruct.impl;
|
||||
|
||||
|
||||
import com.czsj.quality.entity.ScheduleJobEntity;
|
||||
import com.czsj.quality.mapstruct.ScheduleJobMapper;
|
||||
import com.czsj.quality.vo.ScheduleJobVo;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Component
|
||||
public class ScheduleJobMapperImpl implements ScheduleJobMapper {
|
||||
|
||||
@Override
|
||||
public ScheduleJobVo toVO(ScheduleJobEntity e) {
|
||||
if ( e == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
ScheduleJobVo scheduleJobVo = new ScheduleJobVo();
|
||||
|
||||
scheduleJobVo.setId( e.getId() );
|
||||
scheduleJobVo.setStatus( e.getStatus() );
|
||||
scheduleJobVo.setJobName( e.getJobName() );
|
||||
scheduleJobVo.setBeanName( e.getBeanName() );
|
||||
scheduleJobVo.setMethodName( e.getMethodName() );
|
||||
scheduleJobVo.setMethodParams( e.getMethodParams() );
|
||||
scheduleJobVo.setCronExpression( e.getCronExpression() );
|
||||
|
||||
return scheduleJobVo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ScheduleJobVo> toVO(List<ScheduleJobEntity> es) {
|
||||
if ( es == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
List<ScheduleJobVo> list = new ArrayList<ScheduleJobVo>( es.size() );
|
||||
for ( ScheduleJobEntity scheduleJobEntity : es ) {
|
||||
list.add( toVO( scheduleJobEntity ) );
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package com.czsj.quality.mapstruct.impl;
|
||||
|
||||
|
||||
import com.czsj.quality.entity.ScheduleLogEntity;
|
||||
import com.czsj.quality.mapstruct.ScheduleLogMapper;
|
||||
import com.czsj.quality.vo.ScheduleLogVo;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Component
|
||||
public class ScheduleLogMapperImpl implements ScheduleLogMapper {
|
||||
|
||||
@Override
|
||||
public ScheduleLogVo toVO(ScheduleLogEntity e) {
|
||||
if ( e == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
ScheduleLogVo scheduleLogVo = new ScheduleLogVo();
|
||||
|
||||
scheduleLogVo.setId( e.getId() );
|
||||
scheduleLogVo.setStatus( e.getStatus() );
|
||||
scheduleLogVo.setExecuteJobId( e.getExecuteJobId() );
|
||||
scheduleLogVo.setExecuteRuleId( e.getExecuteRuleId() );
|
||||
scheduleLogVo.setExecuteDate( e.getExecuteDate() );
|
||||
scheduleLogVo.setExecuteResult( e.getExecuteResult() );
|
||||
scheduleLogVo.setExecuteBatch( e.getExecuteBatch() );
|
||||
scheduleLogVo.setExecuteJobName( e.getExecuteJobName() );
|
||||
scheduleLogVo.setExecuteRuleName( e.getExecuteRuleName() );
|
||||
scheduleLogVo.setExecuteRuleTypeName( e.getExecuteRuleTypeName() );
|
||||
|
||||
return scheduleLogVo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ScheduleLogVo> toVO(List<ScheduleLogEntity> es) {
|
||||
if ( es == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
List<ScheduleLogVo> list = new ArrayList<ScheduleLogVo>( es.size() );
|
||||
for ( ScheduleLogEntity scheduleLogEntity : es ) {
|
||||
list.add( toVO( scheduleLogEntity ) );
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.czsj.quality.query;
|
||||
|
||||
import com.czsj.core.database.base.BaseQueryParams;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 核查报告信息表 查询实体
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-09-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 com.czsj.quality.query;
|
||||
|
||||
import com.czsj.core.database.base.BaseQueryParams;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 核查规则信息表 查询实体
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-09-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 com.czsj.quality.query;
|
||||
|
||||
import com.czsj.core.database.base.BaseQueryParams;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 规则核查项信息表 查询实体
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-10-15
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class RuleItemQuery extends BaseQueryParams {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
private String ruleTypeId;
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.czsj.quality.query;
|
||||
|
||||
import com.czsj.core.database.base.BaseQueryParams;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 规则级别信息表 查询实体
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-10-14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class RuleLevelQuery extends BaseQueryParams {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.czsj.quality.query;
|
||||
|
||||
import com.czsj.core.database.base.BaseQueryParams;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 规则类型信息表 查询实体
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-09-27
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class RuleTypeQuery extends BaseQueryParams {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
private String name;
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.czsj.quality.query;
|
||||
|
||||
import com.czsj.core.database.base.BaseQueryParams;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 数据质量监控任务信息表 查询实体
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-09-29
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ScheduleJobQuery extends BaseQueryParams {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.czsj.quality.query;
|
||||
|
||||
import com.czsj.core.database.base.BaseQueryParams;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 数据质量监控任务日志信息表 查询实体
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-10-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,21 @@
|
||||
package com.czsj.quality.schedule;
|
||||
|
||||
|
||||
|
||||
import com.aspose.words.net.System.Data.DataException;
|
||||
import com.czsj.quality.schedule.rules.RuleItem;
|
||||
import com.czsj.quality.schedule.rules.RuleItemRegistry;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
public class CheckRuleFactory {
|
||||
|
||||
private static final RuleItemRegistry RULE_ITEM_REGISTRY = new RuleItemRegistry();
|
||||
|
||||
public CheckRuleFactory() {
|
||||
}
|
||||
|
||||
public static RuleItem getRuleItem(String code) {
|
||||
return Optional.ofNullable(RULE_ITEM_REGISTRY.getRuleItem(code)).orElseThrow(() -> new DataException(String.format("%s not supported.", code)));
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.czsj.quality.schedule.rules;
|
||||
|
||||
|
||||
|
||||
import com.czsj.common.database.constants.DbType;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 准确性核查
|
||||
* 核查项:最大长度
|
||||
* select sum(case when length(column) > 15 then 1 else 0 end), count(*) from table;
|
||||
*/
|
||||
public class AccuracyLengthRule implements RuleItem {
|
||||
|
||||
private static String MAX_LENGTH = "max_length";
|
||||
|
||||
@Override
|
||||
public String parse(DbType dbType, String table, String column, Map<String, Object> map) {
|
||||
final StringBuilder builder = new StringBuilder();
|
||||
builder.append("SELECT SUM(CASE WHEN LENGTH(").append(column).append(") > ").append(map.get(MAX_LENGTH)).append(" THEN 1 ELSE 0 END), COUNT(*) FROM ").append(table);
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String code() {
|
||||
return "accuracy_key_length";
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.czsj.quality.schedule.rules;
|
||||
|
||||
|
||||
|
||||
import com.czsj.common.database.constants.DbType;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 一致性核查
|
||||
* 核查项:字典
|
||||
* select sum(case when column not in ('0', '1') then 1 else 0 end), count(*) from table;
|
||||
*/
|
||||
public class ConsistentRule implements RuleItem {
|
||||
|
||||
private static String GB_ITEM = "gb_item";
|
||||
|
||||
@Override
|
||||
public String parse(DbType dbType, String table, String column, Map<String, Object> map) {
|
||||
final StringBuilder builder = new StringBuilder();
|
||||
builder.append("SELECT SUM(CASE WHEN ").append(column).append(" NOT IN (").append(map.get(GB_ITEM)).append(") THEN 1 ELSE 0 END), COUNT(*) FROM ").append(table);
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String code() {
|
||||
return "consistent_key";
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.czsj.quality.schedule.rules;
|
||||
|
||||
|
||||
import com.czsj.common.database.constants.DbType;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 完整性核查
|
||||
* 核查项:非空
|
||||
* select sum(case when column is not null and trim(column) != '' then 1 else 0 end), count(*) from table;
|
||||
*/
|
||||
public class IntegrityRule implements RuleItem {
|
||||
|
||||
@Override
|
||||
public String parse(DbType dbType, String table, String column, Map<String, Object> map) {
|
||||
final StringBuilder builder = new StringBuilder();
|
||||
builder.append("SELECT SUM(CASE WHEN ").append(column).append(" IS NOT NULL AND TRIM(").append(column).append(") != '' THEN 0 ELSE 1 END), COUNT(*) FROM ").append(table);
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String code() {
|
||||
return "integrity_key";
|
||||
}
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package com.czsj.quality.schedule.rules;
|
||||
|
||||
|
||||
import com.czsj.common.database.constants.DbType;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 关联性核查
|
||||
* select SUM(errorCount) errorCount, SUM(totalCount) totalCount
|
||||
* FROM (
|
||||
* select count(*) errorCount, 0 as totalCount from MAIN_TABLE a where not exists(select 1 from FOLLOW_TWO b where a.NAME = b.NAME)
|
||||
* union select 0 as errorCount, count(*) totalCount from MAIN_TABLE
|
||||
* ) temp;
|
||||
*/
|
||||
public class RelevanceRule implements RuleItem {
|
||||
|
||||
private static String RELATED_TABLE = "related_table";
|
||||
private static String RELATED_COLUMN = "related_column";
|
||||
|
||||
@Override
|
||||
public String parse(DbType dbType, String table, String column, Map<String, Object> map) {
|
||||
final StringBuilder builder = new StringBuilder();
|
||||
builder.append("SELECT SUM(errorCount) AS errorCount, SUM(totalCount) AS totalCount FROM (")
|
||||
.append("SELECT COUNT(*) AS errorCount, 0 AS totalCount FROM ")
|
||||
.append(table).append(" a WHERE NOT EXISTS (SELECT 1 FROM ").append(map.get(RELATED_TABLE)).append(" b WHERE a.").append(column).append(" = b.").append(map.get(RELATED_COLUMN)).append(")")
|
||||
.append("UNION SELECT 0 AS errorCount, COUNT(*) AS totalCount FROM ").append(table).append(") TEMP");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String code() {
|
||||
return "relevance_key";
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.czsj.quality.schedule.rules;
|
||||
|
||||
|
||||
|
||||
import com.czsj.common.database.constants.DbType;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface RuleItem {
|
||||
|
||||
String parse(DbType dbType, String table, String column, Map<String, Object> map);
|
||||
|
||||
String code();
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.czsj.quality.schedule.rules;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class RuleItemRegistry {
|
||||
|
||||
private final Map<String, RuleItem> rule_item_map = new HashMap<>();
|
||||
|
||||
public RuleItemRegistry() {
|
||||
this.rule_item_map.put("unique_key", new UniqueRule());
|
||||
this.rule_item_map.put("consistent_key", new ConsistentRule());
|
||||
this.rule_item_map.put("integrity_key", new IntegrityRule());
|
||||
this.rule_item_map.put("relevance_key", new RelevanceRule());
|
||||
this.rule_item_map.put("timeliness_key", new TimelinessRule());
|
||||
this.rule_item_map.put("accuracy_key_length", new AccuracyLengthRule());
|
||||
}
|
||||
|
||||
public RuleItem getRuleItem(String code) {
|
||||
return this.rule_item_map.get(code);
|
||||
}
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package com.czsj.quality.schedule.rules;
|
||||
|
||||
|
||||
import com.czsj.common.database.constants.DbType;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 及时性核查
|
||||
*/
|
||||
public class TimelinessRule implements RuleItem {
|
||||
|
||||
private static String THRESHOLD = "threshold";
|
||||
|
||||
@Override
|
||||
public String parse(DbType dbType, String table, String column, Map<String, Object> map) {
|
||||
final StringBuilder builder = new StringBuilder();
|
||||
switch (dbType) {
|
||||
case ORACLE:
|
||||
case ORACLE_12C:
|
||||
builder.append("SELECT SUM(CASE WHEN ROUND(TO_NUMBER(SYSDATE - ").append(column).append(")) >= ").append(map.get(THRESHOLD)).append(" THEN 1 ELSE 0 END), COUNT(*) FROM ").append(table);
|
||||
break;
|
||||
case MYSQL:
|
||||
case MARIADB:
|
||||
builder.append("SELECT SUM(CASE WHEN DATEDIFF(NOW(), ").append(column).append(") >= ").append(map.get(THRESHOLD)).append(" THEN 1 ELSE 0 END), COUNT(*) FROM ").append(table);
|
||||
break;
|
||||
case SQL_SERVER:
|
||||
case SQL_SERVER2008:
|
||||
builder.append("SELECT SUM(CASE WHEN DATEDIFF(DAY, ").append(column).append(", GETDATE()) >= ").append(map.get(THRESHOLD)).append(" THEN 1 ELSE 0 END), COUNT(*) FROM ").append(table);
|
||||
break;
|
||||
case POSTGRE_SQL:
|
||||
case OTHER:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String code() {
|
||||
return "timeliness_key";
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.czsj.quality.schedule.rules;
|
||||
|
||||
import com.czsj.common.database.constants.DbType;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 唯一性核查
|
||||
* 核查项:主键
|
||||
* select count(distinct id), count(*) from table;
|
||||
*/
|
||||
public class UniqueRule implements RuleItem {
|
||||
|
||||
@Override
|
||||
public String parse(DbType dbType, String table, String column, Map<String, Object> map) {
|
||||
final StringBuilder builder = new StringBuilder();
|
||||
builder.append("SELECT totalCount - errorCount AS errorCount, totalCount FROM (");
|
||||
builder.append("SELECT COUNT(DISTINCT ").append(column).append(") AS errorCount, COUNT(*) AS totalCount FROM ").append(table);
|
||||
builder.append(") TEMP");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String code() {
|
||||
return "unique_key";
|
||||
}
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package com.czsj.quality.service;
|
||||
|
||||
|
||||
|
||||
import com.czsj.core.database.base.BaseService;
|
||||
import com.czsj.quality.entity.CheckReportEntity;
|
||||
import com.czsj.quality.entity.DataReportEntity;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 核查报告信息表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-09-27
|
||||
*/
|
||||
public interface CheckReportService extends BaseService<CheckReportEntity> {
|
||||
|
||||
CheckReportEntity getCheckReportById(String id);
|
||||
|
||||
/**
|
||||
* 按数据源统计
|
||||
* @return
|
||||
*/
|
||||
List<DataReportEntity> getReportBySource(String checkDate);
|
||||
|
||||
/**
|
||||
* 按规则类型统计
|
||||
* @return
|
||||
*/
|
||||
List<DataReportEntity> getReportByType(String checkDate);
|
||||
|
||||
Map<String, Object> getReportDetail(String checkDate);
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.czsj.quality.service;
|
||||
|
||||
|
||||
import com.czsj.core.database.base.BaseService;
|
||||
import com.czsj.quality.dto.CheckRuleDto;
|
||||
import com.czsj.quality.entity.CheckRuleEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 核查规则信息表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-09-27
|
||||
*/
|
||||
public interface CheckRuleService extends BaseService<CheckRuleEntity> {
|
||||
|
||||
CheckRuleEntity saveCheckRule(CheckRuleDto checkRule);
|
||||
|
||||
CheckRuleEntity updateCheckRule(CheckRuleDto checkRule);
|
||||
|
||||
CheckRuleEntity getCheckRuleById(String id);
|
||||
|
||||
void deleteCheckRuleById(String id);
|
||||
|
||||
void deleteCheckRuleBatch(List<String> ids);
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.czsj.quality.service;
|
||||
|
||||
|
||||
import com.czsj.core.database.base.BaseService;
|
||||
import com.czsj.quality.entity.RuleItemEntity;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 规则核查项信息表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-10-15
|
||||
*/
|
||||
public interface RuleItemService extends BaseService<RuleItemEntity> {
|
||||
|
||||
RuleItemEntity getRuleItemById(String id);
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.czsj.quality.service;
|
||||
|
||||
import com.czsj.core.database.base.BaseService;
|
||||
import com.czsj.quality.entity.RuleLevelEntity;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 规则级别信息表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-10-14
|
||||
*/
|
||||
public interface RuleLevelService extends BaseService<RuleLevelEntity> {
|
||||
|
||||
RuleLevelEntity getRuleLevelById(String id);
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.czsj.quality.service;
|
||||
|
||||
|
||||
import com.czsj.core.database.base.BaseService;
|
||||
import com.czsj.quality.entity.RuleTypeEntity;
|
||||
import com.czsj.quality.entity.RuleTypeReportEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 规则类型信息表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-09-27
|
||||
*/
|
||||
public interface RuleTypeService extends BaseService<RuleTypeEntity> {
|
||||
|
||||
RuleTypeEntity getRuleTypeById(String id);
|
||||
|
||||
List<RuleTypeReportEntity> getRuleTypeListForReport();
|
||||
}
|
@ -0,0 +1,102 @@
|
||||
package com.czsj.quality.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.czsj.core.database.base.BaseServiceImpl;
|
||||
import com.czsj.quality.entity.CheckReportEntity;
|
||||
import com.czsj.quality.entity.DataReportEntity;
|
||||
import com.czsj.quality.entity.RuleLevelEntity;
|
||||
import com.czsj.quality.entity.RuleTypeEntity;
|
||||
import com.czsj.quality.mapper.CheckReportDao;
|
||||
import com.czsj.quality.mapper.RuleLevelDao;
|
||||
import com.czsj.quality.mapper.RuleTypeDao;
|
||||
import com.czsj.quality.mapstruct.CheckReportMapper;
|
||||
import com.czsj.quality.service.CheckReportService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 核查报告信息表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-09-27
|
||||
*/
|
||||
@Service
|
||||
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
|
||||
public class CheckReportServiceImpl extends BaseServiceImpl<CheckReportDao, CheckReportEntity> implements CheckReportService {
|
||||
|
||||
@Autowired
|
||||
private CheckReportDao checkReportDao;
|
||||
|
||||
@Autowired
|
||||
private CheckReportMapper checkReportMapper;
|
||||
|
||||
@Autowired
|
||||
private RuleLevelDao ruleLevelDao;
|
||||
|
||||
@Autowired
|
||||
private RuleTypeDao ruleTypeDao;
|
||||
|
||||
@Override
|
||||
public CheckReportEntity getCheckReportById(String id) {
|
||||
CheckReportEntity checkReportEntity = super.getById(id);
|
||||
return checkReportEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DataReportEntity> getReportBySource(String checkDate) {
|
||||
List<RuleLevelEntity> ruleLevelList = ruleLevelDao.selectList(Wrappers.emptyWrapper());
|
||||
List<DataReportEntity> list = checkReportDao.getReportBySource(checkDate);
|
||||
// 补全数据
|
||||
List<DataReportEntity> differenceReportList = new ArrayList<>();
|
||||
// 补全数据源分组缺失的规则级别数据
|
||||
Map<String, List<DataReportEntity>> sourceMap = list.stream().collect(Collectors.groupingBy(DataReportEntity::getRuleSourceId));
|
||||
Iterator<Map.Entry<String, List<DataReportEntity>>> sourceIterator = sourceMap.entrySet().iterator();
|
||||
while (sourceIterator.hasNext()) {
|
||||
Map.Entry<String, List<DataReportEntity>> sourceEntry = sourceIterator.next();
|
||||
List<DataReportEntity> entryValue = sourceEntry.getValue();
|
||||
DataReportEntity dataReportEntity = entryValue.get(0);
|
||||
// 差集 (ruleLevelList - entryValue)
|
||||
ruleLevelList.stream().filter(item -> entryValue.stream().map(DataReportEntity::getRuleLevelId).noneMatch(id -> Objects.equals(item.getId(), id)))
|
||||
.forEach(s -> {
|
||||
DataReportEntity report = new DataReportEntity();
|
||||
report.setRuleSourceId(dataReportEntity.getRuleSourceId());
|
||||
report.setRuleSourceName(dataReportEntity.getRuleSourceName());
|
||||
report.setRuleLevelId(s.getId());
|
||||
report.setRuleLevelName(s.getName());
|
||||
report.setCheckErrorCount(0);
|
||||
differenceReportList.add(report);
|
||||
});
|
||||
}
|
||||
list.addAll(differenceReportList);
|
||||
// 排序
|
||||
list = list.stream().sorted(Comparator.comparing(DataReportEntity::getRuleSourceId).thenComparing(DataReportEntity::getRuleLevelId)).collect(Collectors.toList());
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DataReportEntity> getReportByType(String checkDate) {
|
||||
List<DataReportEntity> list = checkReportDao.getReportByType(checkDate);
|
||||
// 排序
|
||||
list = list.stream().sorted(Comparator.comparing(DataReportEntity::getRuleTypeId)).collect(Collectors.toList());
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getReportDetail(String checkDate) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
List<RuleTypeEntity> ruleTypeList = ruleTypeDao.selectList(Wrappers.emptyWrapper());
|
||||
List<DataReportEntity> dataReportList = checkReportDao.getReportDetail(checkDate);
|
||||
Map<String, List<DataReportEntity>> listMap = dataReportList.stream().collect(Collectors.groupingBy(DataReportEntity::getRuleTypeCode));
|
||||
ruleTypeList.stream().forEach(s -> {
|
||||
map.put(s.getCode(), listMap.get(s.getCode()));
|
||||
});
|
||||
return map;
|
||||
}
|
||||
}
|
@ -0,0 +1,131 @@
|
||||
package com.czsj.quality.service.impl;
|
||||
|
||||
import com.czsj.common.core.redis.RedisCache;
|
||||
import com.czsj.common.database.constants.DbType;
|
||||
import com.czsj.core.database.base.BaseServiceImpl;
|
||||
import com.czsj.core.database.core.RedisConstant;
|
||||
import com.czsj.quality.dto.*;
|
||||
import com.czsj.quality.entity.CheckRuleEntity;
|
||||
import com.czsj.quality.enums.RuleItem;
|
||||
import com.czsj.quality.mapper.CheckRuleDao;
|
||||
import com.czsj.quality.mapstruct.CheckRuleMapper;
|
||||
import com.czsj.quality.schedule.CheckRuleFactory;
|
||||
import com.czsj.quality.service.CheckRuleService;
|
||||
import com.czsj.standard.entity.DictEntity;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 核查规则信息表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-09-27
|
||||
*/
|
||||
@Service
|
||||
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
|
||||
public class CheckRuleServiceImpl extends BaseServiceImpl<CheckRuleDao, CheckRuleEntity> implements CheckRuleService {
|
||||
|
||||
@Autowired
|
||||
private CheckRuleDao checkRuleDao;
|
||||
|
||||
@Autowired
|
||||
private CheckRuleMapper checkRuleMapper;
|
||||
|
||||
@Autowired
|
||||
private RedisCache redisService;
|
||||
|
||||
private static String BIND_GB_CODE = "gb_code";
|
||||
private static String BIND_GB_NAME = "gb_name";
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public CheckRuleEntity saveCheckRule(CheckRuleDto checkRuleDto) {
|
||||
CheckRuleEntity checkRule = checkRuleMapper.toEntity(checkRuleDto);
|
||||
String sql = parseSql(checkRule);
|
||||
checkRule.setRuleSql(sql);
|
||||
checkRuleDao.insert(checkRule);
|
||||
return checkRule;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public CheckRuleEntity updateCheckRule(CheckRuleDto checkRuleDto) {
|
||||
CheckRuleEntity checkRule = checkRuleMapper.toEntity(checkRuleDto);
|
||||
String sql = parseSql(checkRule);
|
||||
checkRule.setRuleSql(sql);
|
||||
checkRuleDao.updateById(checkRule);
|
||||
return checkRule;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CheckRuleEntity getCheckRuleById(String id) {
|
||||
CheckRuleEntity checkRuleEntity = super.getById(id);
|
||||
return checkRuleEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteCheckRuleById(String id) {
|
||||
checkRuleDao.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteCheckRuleBatch(List<String> ids) {
|
||||
checkRuleDao.deleteBatchIds(ids);
|
||||
}
|
||||
|
||||
private String parseSql(CheckRuleEntity checkRule) {
|
||||
RuleConfig ruleConfig = checkRule.getRuleConfig();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
RuleItem ruleItem = RuleItem.getRuleItem(ruleConfig.getRuleItemCode());
|
||||
switch (ruleItem) {
|
||||
case Unique:
|
||||
case Integrity:
|
||||
break;
|
||||
// 一致性参数处理
|
||||
case Consistent:
|
||||
Consistent consistent = ruleConfig.getConsistent();
|
||||
List<DictEntity> dictEntityList = (List<DictEntity>) redisService.hget(RedisConstant.STANDARD_DICT_KEY, consistent.getGbTypeId());
|
||||
String collect = dictEntityList.stream().map(s -> {
|
||||
if (BIND_GB_CODE.equals(consistent.getBindGbColumn())) {
|
||||
return "\'" + s.getGbCode() + "\'";
|
||||
} else {
|
||||
return "\'" + s.getGbName() + "\'";
|
||||
}
|
||||
}).collect(Collectors.joining(","));
|
||||
map.put("gb_item", collect);
|
||||
break;
|
||||
// 关联性参数处理
|
||||
case Relevance:
|
||||
Relevance relevance = ruleConfig.getRelevance();
|
||||
map.put("related_table", relevance.getRelatedTable());
|
||||
map.put("related_column", relevance.getRelatedColumn());
|
||||
break;
|
||||
// 及时性参数处理
|
||||
case Timeliness:
|
||||
Timeliness timeliness = ruleConfig.getTimeliness();
|
||||
map.put("threshold", timeliness.getThreshold());
|
||||
break;
|
||||
// 准确性参数处理
|
||||
case AccuracyLength:
|
||||
Accuracy accuracy = ruleConfig.getAccuracy();
|
||||
map.put("max_length", accuracy.getMaxLength());
|
||||
break;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
DbType dbType = DbType.getDbType(checkRule.getRuleDbType());
|
||||
String sql = CheckRuleFactory.getRuleItem(ruleConfig.getRuleItemCode()).parse(dbType, checkRule.getRuleTable(), checkRule.getRuleColumn(), map);
|
||||
return sql;
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package com.czsj.quality.service.impl;
|
||||
|
||||
import com.czsj.core.database.base.BaseServiceImpl;
|
||||
import com.czsj.quality.entity.RuleItemEntity;
|
||||
import com.czsj.quality.mapper.RuleItemDao;
|
||||
import com.czsj.quality.mapstruct.RuleItemMapper;
|
||||
import com.czsj.quality.service.RuleItemService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 规则核查项信息表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-10-15
|
||||
*/
|
||||
@Service
|
||||
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
|
||||
public class RuleItemServiceImpl extends BaseServiceImpl<RuleItemDao, RuleItemEntity> implements RuleItemService {
|
||||
|
||||
@Autowired
|
||||
private RuleItemDao ruleItemDao;
|
||||
|
||||
@Autowired
|
||||
private RuleItemMapper ruleItemMapper;
|
||||
|
||||
@Override
|
||||
public RuleItemEntity getRuleItemById(String id) {
|
||||
RuleItemEntity ruleItemEntity = super.getById(id);
|
||||
return ruleItemEntity;
|
||||
}
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package com.czsj.quality.service.impl;
|
||||
|
||||
|
||||
import com.czsj.core.database.base.BaseServiceImpl;
|
||||
import com.czsj.quality.entity.RuleLevelEntity;
|
||||
import com.czsj.quality.mapper.RuleLevelDao;
|
||||
import com.czsj.quality.mapstruct.RuleLevelMapper;
|
||||
import com.czsj.quality.service.RuleLevelService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 规则级别信息表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-10-14
|
||||
*/
|
||||
@Service
|
||||
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
|
||||
public class RuleLevelServiceImpl extends BaseServiceImpl<RuleLevelDao, RuleLevelEntity> implements RuleLevelService {
|
||||
|
||||
@Autowired
|
||||
private RuleLevelDao ruleLevelDao;
|
||||
|
||||
@Autowired
|
||||
private RuleLevelMapper ruleLevelMapper;
|
||||
|
||||
@Override
|
||||
public RuleLevelEntity getRuleLevelById(String id) {
|
||||
RuleLevelEntity ruleLevelEntity = super.getById(id);
|
||||
return ruleLevelEntity;
|
||||
}
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package com.czsj.quality.service.impl;
|
||||
|
||||
|
||||
import com.czsj.core.database.base.BaseServiceImpl;
|
||||
import com.czsj.quality.entity.RuleTypeEntity;
|
||||
import com.czsj.quality.entity.RuleTypeReportEntity;
|
||||
import com.czsj.quality.mapper.RuleTypeDao;
|
||||
import com.czsj.quality.mapstruct.RuleTypeMapper;
|
||||
import com.czsj.quality.service.RuleTypeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 规则类型信息表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-09-27
|
||||
*/
|
||||
@Service
|
||||
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
|
||||
public class RuleTypeServiceImpl extends BaseServiceImpl<RuleTypeDao, RuleTypeEntity> implements RuleTypeService {
|
||||
|
||||
@Autowired
|
||||
private RuleTypeDao ruleTypeDao;
|
||||
|
||||
@Autowired
|
||||
private RuleTypeMapper ruleTypeMapper;
|
||||
|
||||
@Override
|
||||
public RuleTypeEntity getRuleTypeById(String id) {
|
||||
RuleTypeEntity ruleTypeEntity = super.getById(id);
|
||||
return ruleTypeEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RuleTypeReportEntity> getRuleTypeListForReport() {
|
||||
List<RuleTypeReportEntity> list = ruleTypeDao.selectListForReport();
|
||||
return list;
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.czsj.quality.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 核查报告信息表 实体VO
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-09-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 com.czsj.quality.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.czsj.quality.dto.RuleConfig;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 核查规则信息表 实体VO
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-09-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 Date 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 com.czsj.quality.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 规则核查项信息表 实体VO
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-10-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 com.czsj.quality.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 规则级别信息表 实体VO
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-10-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 com.czsj.quality.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 规则类型信息表 实体VO
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-09-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 com.czsj.quality.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 数据质量监控任务信息表 实体VO
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-09-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 com.czsj.quality.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 数据质量监控任务日志信息表 实体VO
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-10-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,40 @@
|
||||
package com.czsj.standard.dto;
|
||||
|
||||
import com.czsj.metadata.validate.ValidationGroups;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 字典对照信息表 实体DTO
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-09-27
|
||||
*/
|
||||
@ApiModel(value = "字典对照信息表Model")
|
||||
@Data
|
||||
public class ContrastDictDto 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 contrastId;
|
||||
@ApiModelProperty(value = "字典编码")
|
||||
private String colCode;
|
||||
@ApiModelProperty(value = "字典名称")
|
||||
private String colName;
|
||||
@ApiModelProperty(value = "状态")
|
||||
@NotNull(message = "状态不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
private String status;
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
package com.czsj.standard.dto;
|
||||
|
||||
import com.czsj.metadata.validate.ValidationGroups;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 对照表信息表 实体DTO
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-09-27
|
||||
*/
|
||||
@ApiModel(value = "对照表信息表Model")
|
||||
@Data
|
||||
public class ContrastDto 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 sourceId;
|
||||
@ApiModelProperty(value = "数据源")
|
||||
private String sourceName;
|
||||
@ApiModelProperty(value = "数据表主键")
|
||||
private String tableId;
|
||||
@ApiModelProperty(value = "数据表")
|
||||
private String tableName;
|
||||
@ApiModelProperty(value = "数据表名称")
|
||||
private String tableComment;
|
||||
@ApiModelProperty(value = "对照字段主键")
|
||||
private String columnId;
|
||||
@ApiModelProperty(value = "对照字段")
|
||||
private String columnName;
|
||||
@ApiModelProperty(value = "对照字段名称")
|
||||
private String columnComment;
|
||||
@ApiModelProperty(value = "标准类别主键")
|
||||
private String gbTypeId;
|
||||
@ApiModelProperty(value = "绑定标准字段")
|
||||
private String bindGbColumn;
|
||||
}
|
43
czsj-system/src/main/java/com/czsj/standard/dto/DictDto.java
Normal file
43
czsj-system/src/main/java/com/czsj/standard/dto/DictDto.java
Normal file
@ -0,0 +1,43 @@
|
||||
package com.czsj.standard.dto;
|
||||
|
||||
|
||||
import com.czsj.metadata.validate.ValidationGroups;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
/**
|
||||
* <p>
|
||||
* 数据标准字典表 实体DTO
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-08-26
|
||||
*/
|
||||
@ApiModel(value = "数据标准字典表Model")
|
||||
@Data
|
||||
public class DictDto implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
@NotBlank(message = "主键ID不能为空", groups = {ValidationGroups.Update.class})
|
||||
private String id;
|
||||
@ApiModelProperty(value = "所属类别")
|
||||
@NotBlank(message = "所属类别不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
private String typeId;
|
||||
@ApiModelProperty(value = "标准编码")
|
||||
@NotBlank(message = "标准编码不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
private String gbCode;
|
||||
@ApiModelProperty(value = "标准名称")
|
||||
@NotBlank(message = "标准名称不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
private String gbName;
|
||||
@ApiModelProperty(value = "状态")
|
||||
@NotNull(message = "状态不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
private String status;
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.czsj.standard.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class Endpoint implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@NotBlank(message = "源端点不能为空")
|
||||
private String sourceId;
|
||||
|
||||
@NotBlank(message = "目标端点不能为空")
|
||||
private String targetId;
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.czsj.standard.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class ManualMappingDto implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@Valid
|
||||
@NotEmpty(message = "对照关系不能为空")
|
||||
@Size(min = 1, message="对照关系长度不能少于{min}位")
|
||||
private List<Endpoint> endpoints;
|
||||
}
|
33
czsj-system/src/main/java/com/czsj/standard/dto/TypeDto.java
Normal file
33
czsj-system/src/main/java/com/czsj/standard/dto/TypeDto.java
Normal file
@ -0,0 +1,33 @@
|
||||
package com.czsj.standard.dto;
|
||||
|
||||
import com.czsj.metadata.validate.ValidationGroups;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.io.Serializable;
|
||||
/**
|
||||
* <p>
|
||||
* 数据标准类别表 实体DTO
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-08-26
|
||||
*/
|
||||
@ApiModel(value = "数据标准类别表Model")
|
||||
@Data
|
||||
public class TypeDto implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
@NotBlank(message = "主键ID不能为空", groups = {ValidationGroups.Update.class})
|
||||
private String id;
|
||||
@ApiModelProperty(value = "标准类别编码")
|
||||
@NotBlank(message = "标准类别编码不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
private String gbTypeCode;
|
||||
@ApiModelProperty(value = "标准类别名称")
|
||||
@NotBlank(message = "标准类别名称不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
|
||||
private String gbTypeName;
|
||||
}
|
@ -0,0 +1,88 @@
|
||||
package com.czsj.standard.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.czsj.core.database.base.DataScopeBaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 字典对照信息表
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-09-27
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@TableName(value = "standard_contrast_dict", autoResultMap = true)
|
||||
public class ContrastDictEntity extends DataScopeBaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 字典对照主键
|
||||
*/
|
||||
private String contrastId;
|
||||
|
||||
/**
|
||||
* 数据源
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String sourceName;
|
||||
|
||||
/**
|
||||
* 数据表
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String tableName;
|
||||
|
||||
/**
|
||||
* 对照字段
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String columnName;
|
||||
|
||||
/**
|
||||
* 标准类别编码
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String gbTypeCode;
|
||||
|
||||
/**
|
||||
* 标准类别名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String gbTypeName;
|
||||
|
||||
/**
|
||||
* 字典编码
|
||||
*/
|
||||
private String colCode;
|
||||
|
||||
/**
|
||||
* 字典名称
|
||||
*/
|
||||
private String colName;
|
||||
|
||||
/**
|
||||
* 对照的标准字典
|
||||
*/
|
||||
private String contrastGbId;
|
||||
|
||||
/**
|
||||
* 对照的标准编码
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String contrastGbCode;
|
||||
|
||||
/**
|
||||
* 对照的标准名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String contrastGbName;
|
||||
|
||||
}
|
@ -0,0 +1,99 @@
|
||||
package com.czsj.standard.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.czsj.core.database.base.DataScopeBaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 对照表信息表
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-09-27
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@TableName(value = "standard_contrast", autoResultMap = true)
|
||||
public class ContrastEntity extends DataScopeBaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 数据源主键
|
||||
*/
|
||||
private String sourceId;
|
||||
|
||||
/**
|
||||
* 数据源
|
||||
*/
|
||||
private String sourceName;
|
||||
|
||||
/**
|
||||
* 数据表主键
|
||||
*/
|
||||
private String tableId;
|
||||
|
||||
/**
|
||||
* 数据表
|
||||
*/
|
||||
private String tableName;
|
||||
|
||||
/**
|
||||
* 数据表名称
|
||||
*/
|
||||
private String tableComment;
|
||||
|
||||
/**
|
||||
* 对照字段主键
|
||||
*/
|
||||
private String columnId;
|
||||
|
||||
/**
|
||||
* 对照字段
|
||||
*/
|
||||
private String columnName;
|
||||
|
||||
/**
|
||||
* 对照字段名称
|
||||
*/
|
||||
private String columnComment;
|
||||
|
||||
/**
|
||||
* 标准类别主键
|
||||
*/
|
||||
private String gbTypeId;
|
||||
|
||||
/**
|
||||
* 标准类别编码
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String gbTypeCode;
|
||||
|
||||
/**
|
||||
* 标准类别名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String gbTypeName;
|
||||
|
||||
/**
|
||||
* 绑定标准字段
|
||||
*/
|
||||
private String bindGbColumn;
|
||||
|
||||
/**
|
||||
* 对照数量
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private Integer mappingCount;
|
||||
|
||||
/**
|
||||
* 未对照数量
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private Integer unMappingCount;
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
package com.czsj.standard.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.czsj.core.database.base.DataScopeBaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 数据标准字典表
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-08-26
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@TableName("standard_dict")
|
||||
public class DictEntity extends DataScopeBaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 所属类别
|
||||
*/
|
||||
private String typeId;
|
||||
|
||||
/**
|
||||
* 标准类别编码
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String gbTypeCode;
|
||||
|
||||
/**
|
||||
* 标准类别名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String gbTypeName;
|
||||
|
||||
/**
|
||||
* 标准编码
|
||||
*/
|
||||
private String gbCode;
|
||||
|
||||
/**
|
||||
* 标准名称
|
||||
*/
|
||||
private String gbName;
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.czsj.standard.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.czsj.core.database.base.DataScopeBaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 数据标准类别表
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-08-26
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@TableName("standard_type")
|
||||
public class TypeEntity extends DataScopeBaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 标准类别编码
|
||||
*/
|
||||
private String gbTypeCode;
|
||||
|
||||
/**
|
||||
* 标准类别名称
|
||||
*/
|
||||
private String gbTypeName;
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.czsj.standard.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.czsj.core.database.base.BaseDao;
|
||||
import com.czsj.standard.entity.ContrastEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 对照表信息表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-09-27
|
||||
*/
|
||||
@Mapper
|
||||
public interface ContrastDao extends BaseDao<ContrastEntity> {
|
||||
|
||||
@Override
|
||||
ContrastEntity selectById(Serializable id);
|
||||
|
||||
IPage<ContrastEntity> statistic(IPage<ContrastEntity> page, @Param(Constants.WRAPPER) Wrapper<ContrastEntity> queryWrapper);
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.czsj.standard.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.czsj.core.database.base.BaseDao;
|
||||
import com.czsj.standard.entity.ContrastDictEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 字典对照信息表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-09-27
|
||||
*/
|
||||
@Mapper
|
||||
public interface ContrastDictDao extends BaseDao<ContrastDictEntity> {
|
||||
|
||||
@Override
|
||||
List<ContrastDictEntity> selectList(@Param(Constants.WRAPPER) Wrapper<ContrastDictEntity> queryWrapper);
|
||||
|
||||
@Override
|
||||
<E extends IPage<ContrastDictEntity>> E selectPage(E page, @Param(Constants.WRAPPER) Wrapper<ContrastDictEntity> queryWrapper);
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.czsj.standard.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.czsj.core.database.base.BaseDao;
|
||||
import com.czsj.standard.entity.DictEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 数据标准字典表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-08-26
|
||||
*/
|
||||
@Mapper
|
||||
public interface DictDao extends BaseDao<DictEntity> {
|
||||
|
||||
@Override
|
||||
DictEntity selectById(Serializable id);
|
||||
|
||||
@Override
|
||||
<E extends IPage<DictEntity>> E selectPage(E page, @Param(Constants.WRAPPER) Wrapper<DictEntity> queryWrapper);
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.czsj.standard.mapper;
|
||||
|
||||
|
||||
import com.czsj.core.database.base.BaseDao;
|
||||
import com.czsj.standard.entity.TypeEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 数据标准类别表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-08-26
|
||||
*/
|
||||
@Mapper
|
||||
public interface TypeDao extends BaseDao<TypeEntity> {
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.czsj.standard.mapstruct;
|
||||
|
||||
|
||||
import com.czsj.metadata.mapstruct.EntityMapper;
|
||||
import com.czsj.standard.dto.ContrastDictDto;
|
||||
import com.czsj.standard.entity.ContrastDictEntity;
|
||||
import com.czsj.standard.vo.ContrastDictVo;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 字典对照信息表 Mapper 实体映射
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-09-27
|
||||
*/
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface ContrastDictMapper extends EntityMapper<ContrastDictDto, ContrastDictEntity, ContrastDictVo> {
|
||||
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package com.czsj.standard.mapstruct;
|
||||
|
||||
|
||||
import com.czsj.metadata.mapstruct.EntityMapper;
|
||||
import com.czsj.standard.dto.ContrastDto;
|
||||
import com.czsj.standard.entity.ContrastEntity;
|
||||
import com.czsj.standard.vo.ContrastStatisticVo;
|
||||
import com.czsj.standard.vo.ContrastVo;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 对照表信息表 Mapper 实体映射
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-09-27
|
||||
*/
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface ContrastMapper extends EntityMapper<ContrastDto, ContrastEntity, ContrastVo> {
|
||||
|
||||
/**
|
||||
* 将源对象转换为VO对象
|
||||
* @param e
|
||||
* @return D
|
||||
*/
|
||||
ContrastStatisticVo toSVO(ContrastEntity e);
|
||||
|
||||
/**
|
||||
* 将源对象集合转换为VO对象集合
|
||||
* @param es
|
||||
* @return List<D>
|
||||
*/
|
||||
List<ContrastStatisticVo> toSVO(List<ContrastEntity> es);
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.czsj.standard.mapstruct;
|
||||
|
||||
import com.czsj.metadata.mapstruct.EntityMapper;
|
||||
import com.czsj.standard.dto.DictDto;
|
||||
import com.czsj.standard.entity.DictEntity;
|
||||
import com.czsj.standard.vo.DictVo;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 数据标准字典表 Mapper 实体映射
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-08-26
|
||||
*/
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface DictMapper extends EntityMapper<DictDto, DictEntity, DictVo> {
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.czsj.standard.mapstruct;
|
||||
|
||||
|
||||
import com.czsj.metadata.mapstruct.EntityMapper;
|
||||
import com.czsj.standard.dto.TypeDto;
|
||||
import com.czsj.standard.entity.TypeEntity;
|
||||
import com.czsj.standard.vo.TypeVo;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 数据标准类别表 Mapper 实体映射
|
||||
* </p>
|
||||
*
|
||||
* @author yuwei
|
||||
* @since 2020-08-26
|
||||
*/
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface TypeMapper extends EntityMapper<TypeDto, TypeEntity, TypeVo> {
|
||||
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user