Merge remote-tracking branch 'origin/dev' into dev
# Conflicts: # srt-cloud-data-governance/src/main/java/net/srt/service/impl/QualityTaskTableServiceimpl.java # srt-cloud-framework/srt-cloud-flink/build/extends/flink-client-1.14-2.0.0.jar # srt-data-development/src/main/java/net/srt/disposition/dto/DataProductionTreeDto.javapull/3/head
commit
d6c1ebf8cd
1
pom.xml
1
pom.xml
|
@ -24,6 +24,7 @@
|
||||||
<module>srt-cloud-gateway</module>
|
<module>srt-cloud-gateway</module>
|
||||||
<module>srt-data-development</module>
|
<module>srt-data-development</module>
|
||||||
<module>srt-cloud-data-governance</module>
|
<module>srt-cloud-data-governance</module>
|
||||||
|
<module>srt-cloud-data-service</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
|
|
@ -0,0 +1,88 @@
|
||||||
|
package net.srt.api.module.data.governance;
|
||||||
|
|
||||||
|
import net.srt.api.ServerNames;
|
||||||
|
import net.srt.api.module.data.governance.dto.DataGovernanceMetadataCollectDto;
|
||||||
|
import net.srt.api.module.data.governance.dto.DataGovernanceMetadataCollectRecordDto;
|
||||||
|
import net.srt.api.module.data.governance.dto.DataGovernanceMetadataDto;
|
||||||
|
import net.srt.api.module.data.governance.dto.DataGovernanceMetadataPropertyDto;
|
||||||
|
import net.srt.framework.common.utils.Result;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName DataAccessApi
|
||||||
|
* @Author zrx
|
||||||
|
* @Date 2022/10/26 11:39
|
||||||
|
*/
|
||||||
|
@FeignClient(name = ServerNames.DATA_GOVERNANCE_NAME, contextId = "data-governance-metadata-collect")
|
||||||
|
public interface DataMetadataCollectApi {
|
||||||
|
/**
|
||||||
|
* 根据id获取采集任务
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "api/data/governance/metadata-collect/{id}")
|
||||||
|
Result<DataGovernanceMetadataCollectDto> getById(@PathVariable Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id获取采集任务
|
||||||
|
*/
|
||||||
|
@PostMapping(value = "api/data/governance/metadata-collect-record")
|
||||||
|
DataGovernanceMetadataCollectRecordDto addCollectRecord(@RequestBody DataGovernanceMetadataCollectRecordDto collectRecordDto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id获取采集任务
|
||||||
|
*/
|
||||||
|
@PutMapping(value = "api/data/governance/metadata-collect-record")
|
||||||
|
void upCollectRecord(@RequestBody DataGovernanceMetadataCollectRecordDto collectRecordDto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据父级id和数据源id获取
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "api/data/governance/metadata/datasource")
|
||||||
|
Result<DataGovernanceMetadataDto> getByParentIdAndDatasourceId(@RequestParam Long parnetId, @RequestParam Long datasourceId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据父级id和数据源id获取
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "api/data/governance/metadata/info")
|
||||||
|
Result<DataGovernanceMetadataDto> getMetadataById(@RequestParam Long metadataId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据父级id和code以及modelId获取
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "api/data/governance/metadata/child-info")
|
||||||
|
Result<DataGovernanceMetadataDto> getByParentIdAndOtherInfo(@RequestParam Long parnetId, @RequestParam Long datasourceId, @RequestParam String code, @RequestParam Long metamodelId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加元数据
|
||||||
|
*/
|
||||||
|
@PostMapping(value = "api/data/governance/metadata")
|
||||||
|
DataGovernanceMetadataDto addOrUpdateMetadata(@RequestBody DataGovernanceMetadataDto metadataDto);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取元数据属性
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "api/data/governance/metadata-property")
|
||||||
|
Result<DataGovernanceMetadataPropertyDto> getByPropertyIdAndMetadataId(@RequestParam Long propertyId, @RequestParam Long metadataId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加元数据属性
|
||||||
|
*/
|
||||||
|
@PostMapping(value = "api/data/governance/metadata-prpperty")
|
||||||
|
void addOrUpdateMetadataProperty(@RequestBody DataGovernanceMetadataPropertyDto metadataPropertyDto);
|
||||||
|
|
||||||
|
@GetMapping(value = "api/data/governance/metadata/list")
|
||||||
|
Result<List<DataGovernanceMetadataDto>> listParentIdAndDatasourceId(@RequestParam Long parentId, @RequestParam Long datasourceId, @RequestParam Long metamodelId);
|
||||||
|
|
||||||
|
@DeleteMapping(value = "api/data/governance/metadata")
|
||||||
|
void deleteMetadata(@RequestParam Long id);
|
||||||
|
|
||||||
|
@GetMapping(value = "api/data/governance/by-datasourceId")
|
||||||
|
Result<DataGovernanceMetadataCollectDto> getByDatasourceId(Long id);
|
||||||
|
|
||||||
|
@GetMapping(value = "api/data/governance/metadata/by-datasourceId")
|
||||||
|
Result<DataGovernanceMetadataDto> getMetadataByDatasourceId(Long id);
|
||||||
|
|
||||||
|
}
|
|
@ -73,6 +73,10 @@
|
||||||
<groupId>io.minio</groupId>
|
<groupId>io.minio</groupId>
|
||||||
<artifactId>minio</artifactId>
|
<artifactId>minio</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.quartz-scheduler</groupId>
|
||||||
|
<artifactId>quartz</artifactId>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package net.srt;
|
package net.srt;
|
||||||
|
|
||||||
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||||
|
|
|
@ -6,8 +6,9 @@ import net.srt.convert.DatastandardConvert;
|
||||||
import net.srt.entity.DatastandardEntity;
|
import net.srt.entity.DatastandardEntity;
|
||||||
import net.srt.framework.common.page.PageResult;
|
import net.srt.framework.common.page.PageResult;
|
||||||
import net.srt.framework.common.utils.Result;
|
import net.srt.framework.common.utils.Result;
|
||||||
import net.srt.query.StandardManagementQuery;
|
import net.srt.query.DatastandrdQuery;
|
||||||
import net.srt.service.DatastandardService;
|
import net.srt.service.DatastandardService;
|
||||||
|
import net.srt.vo.DatastandardVo;
|
||||||
import net.srt.vo.MetamodelPropertyVO;
|
import net.srt.vo.MetamodelPropertyVO;
|
||||||
import net.srt.vo.StandardManagementVo;
|
import net.srt.vo.StandardManagementVo;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -33,15 +34,15 @@ public class DatastandardController {
|
||||||
|
|
||||||
@GetMapping("page")
|
@GetMapping("page")
|
||||||
@Operation(summary = "分页")
|
@Operation(summary = "分页")
|
||||||
public Result<PageResult<StandardManagementVo>> page(@Valid StandardManagementQuery query){
|
public Result<PageResult<DatastandardVo>> page(@Valid DatastandrdQuery query){
|
||||||
PageResult<StandardManagementVo> page = datastandardService.page(query);
|
PageResult<DatastandardVo> page = datastandardService.page(query);
|
||||||
return Result.ok(page);
|
return Result.ok(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("{id}")
|
@GetMapping("{id}")
|
||||||
@Operation(summary ="信息")
|
@Operation(summary ="信息")
|
||||||
public Result<StandardManagementVo> get(@PathVariable("id") Integer categoryId) {
|
public Result<DatastandardVo> get(@PathVariable("id") Integer categoryId) {
|
||||||
DatastandardEntity entity = datastandardService.getById(categoryId);
|
DatastandardEntity entity = datastandardService.getById(categoryId);
|
||||||
return Result.ok(DatastandardConvert.INSTANCE.convert(entity));
|
return Result.ok(DatastandardConvert.INSTANCE.convert(entity));
|
||||||
}
|
}
|
||||||
|
@ -57,15 +58,15 @@ public class DatastandardController {
|
||||||
|
|
||||||
@PostMapping
|
@PostMapping
|
||||||
@Operation(summary = "保存")
|
@Operation(summary = "保存")
|
||||||
public Result<String> save(@RequestBody DatastandardEntity entity) {
|
public Result<String> save(@RequestBody DatastandardVo vo) {
|
||||||
datastandardService.save(entity);
|
datastandardService.save(vo);
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping
|
@PutMapping
|
||||||
@Operation(summary = "修改")
|
@Operation(summary = "修改")
|
||||||
public Result<String> update(@RequestBody @Valid DatastandardEntity datastandardEntity){
|
public Result<String> update(@RequestBody @Valid DatastandardVo vo){
|
||||||
datastandardService.update1(datastandardEntity);
|
datastandardService.update1(vo);
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,17 +3,18 @@ package net.srt.controller;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
import net.srt.convert.MetadataCollectConvert;
|
||||||
|
import net.srt.entity.MetadataCollectEntity;
|
||||||
import net.srt.entity.MetadataCollectQuery;
|
import net.srt.entity.MetadataCollectQuery;
|
||||||
import net.srt.framework.common.page.PageResult;
|
import net.srt.framework.common.page.PageResult;
|
||||||
import net.srt.framework.common.utils.Result;
|
import net.srt.framework.common.utils.Result;
|
||||||
import net.srt.service.MetadataCollectService;
|
import net.srt.service.MetadataCollectService;
|
||||||
import net.srt.vo.MetadataCollectVO;
|
import net.srt.vo.MetadataCollectVO;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("metadata-collect")
|
@RequestMapping("metadata-collect")
|
||||||
|
@ -24,8 +25,66 @@ public class MetadataCollectController {
|
||||||
|
|
||||||
@GetMapping("page")
|
@GetMapping("page")
|
||||||
@Operation(summary = "分页")
|
@Operation(summary = "分页")
|
||||||
|
@PreAuthorize("hasAuthority('data-governance:metadata-collect:page')")
|
||||||
public Result<PageResult<MetadataCollectVO>> page(@Valid MetadataCollectQuery query){
|
public Result<PageResult<MetadataCollectVO>> page(@Valid MetadataCollectQuery query){
|
||||||
PageResult<MetadataCollectVO> page = metadataCollectService.page(query);
|
PageResult<MetadataCollectVO> page = metadataCollectService.page(query);
|
||||||
return Result.ok(page);
|
return Result.ok(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("{id}")
|
||||||
|
@Operation(summary = "信息")
|
||||||
|
@PreAuthorize("hasAuthority('data-governance:metadata-collect:info')")
|
||||||
|
public Result<MetadataCollectVO> get(@PathVariable("id") Long id){
|
||||||
|
MetadataCollectEntity entity = metadataCollectService.getById(id);
|
||||||
|
return Result.ok(MetadataCollectConvert.INSTANCE.convert(entity));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping
|
||||||
|
@Operation(summary = "保存")
|
||||||
|
@PreAuthorize("hasAuthority('data-governance:metadata-collect:save')")
|
||||||
|
public Result<String> save(@RequestBody MetadataCollectVO vo){
|
||||||
|
metadataCollectService.save(vo);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping
|
||||||
|
@Operation(summary = "修改")
|
||||||
|
@PreAuthorize("hasAuthority('data-governance:metadata-collect:update')")
|
||||||
|
public Result<String> update(@RequestBody @Valid MetadataCollectVO vo){
|
||||||
|
metadataCollectService.update(vo);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/release/{id}")
|
||||||
|
@Operation(summary = "发布")
|
||||||
|
@PreAuthorize("hasAuthority('data-governance:metadata-collect:release')")
|
||||||
|
public Result<String> release(@PathVariable Long id){
|
||||||
|
metadataCollectService.release(id);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/cancel/{id}")
|
||||||
|
@Operation(summary = "取消发布")
|
||||||
|
@PreAuthorize("hasAuthority('data-governance:metadata-collect:cancel')")
|
||||||
|
public Result<String> cancel(@PathVariable Long id){
|
||||||
|
metadataCollectService.cancel(id);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("hand-run/{id}")
|
||||||
|
@Operation(summary = "手动执行")
|
||||||
|
@PreAuthorize("hasAuthority('data-governance:metadata-collect:hand-run')")
|
||||||
|
public Result<String> handRun(@PathVariable Long id){
|
||||||
|
metadataCollectService.handRun(id);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping
|
||||||
|
@Operation(summary = "删除")
|
||||||
|
@PreAuthorize("hasAuthority('data-governance:metadata-collect:delete')")
|
||||||
|
public Result<String> delete(@RequestBody List<Long> idList){
|
||||||
|
metadataCollectService.delete(idList);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,104 @@
|
||||||
|
package net.srt.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import net.srt.framework.common.cache.bean.Neo4jInfo;
|
||||||
|
import net.srt.framework.common.utils.Result;
|
||||||
|
import net.srt.framework.common.utils.TreeNodeVo;
|
||||||
|
import net.srt.service.MetadataService;
|
||||||
|
import net.srt.vo.MetadataVo;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @BelongsProject: srt_cloud
|
||||||
|
* @BelongsPackage: net.srt.controller
|
||||||
|
* @Author: jpz
|
||||||
|
* @CreateTime: 2023/12/24 14:24
|
||||||
|
*/
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import net.srt.service.MetadataService;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("metadata")
|
||||||
|
@Tag(name = "数据治理-元数据")
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class MetadataController {
|
||||||
|
private final MetadataService metadataService;
|
||||||
|
@GetMapping("/list-chlid")
|
||||||
|
@Operation(summary = "根据父类id获取信息")
|
||||||
|
public Result<List<TreeNodeVo>> listByPatenId(@RequestParam Long parentId){
|
||||||
|
List<TreeNodeVo> list=metadataService.listByPatenId(parentId);
|
||||||
|
return Result.ok(list);
|
||||||
|
}
|
||||||
|
@GetMapping("/list-floder")
|
||||||
|
@Operation(summary = "获取目录树")
|
||||||
|
public Result<List<TreeNodeVo>> listFloder(){
|
||||||
|
List<TreeNodeVo> list=metadataService.listFloder();
|
||||||
|
return Result.ok(list);
|
||||||
|
}
|
||||||
|
@GetMapping("/list-db")
|
||||||
|
@Operation(summary = "获取库表目录树")
|
||||||
|
public Result<List<TreeNodeVo>> listDb() {
|
||||||
|
List<TreeNodeVo> list=metadataService.listDb();
|
||||||
|
return Result.ok(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/list-keyword")
|
||||||
|
@Operation(summary = "模糊查询")
|
||||||
|
public Result<List<TreeNodeVo>> listKeyword( String keyword) {
|
||||||
|
List<TreeNodeVo> list=metadataService.listKeyword(keyword);
|
||||||
|
return Result.ok(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("{id}")
|
||||||
|
@Operation(summary = "信息")
|
||||||
|
public Result<MetadataVo> get(@PathVariable("id") Long id){
|
||||||
|
return Result.ok(metadataService.get(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping
|
||||||
|
@Operation(summary = "保存")
|
||||||
|
public Result<String> save(@RequestBody MetadataVo vo){
|
||||||
|
metadataService.save(vo);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping
|
||||||
|
@Operation(summary = "修改")
|
||||||
|
public Result<String> update(@RequestBody @Valid MetadataVo vo){
|
||||||
|
metadataService.update(vo);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("{id}")
|
||||||
|
@Operation(summary = "删除")
|
||||||
|
public Result<String> delete(@PathVariable Long id){
|
||||||
|
metadataService.delete(id);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("{neo4j}")
|
||||||
|
@Operation(summary = "更新neo4路径")
|
||||||
|
public Result<String> updateNeo4j(@PathVariable Neo4jInfo neo4jInfo){
|
||||||
|
metadataService.updateNeo4j(neo4jInfo);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/neo4j")
|
||||||
|
@Operation(summary = "获取neo4的路径")
|
||||||
|
public Result<Neo4jInfo> getNeo4j(){
|
||||||
|
return Result.ok(metadataService.getNeo4j());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,65 @@
|
||||||
|
package net.srt.controller;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import net.srt.convert.QualityConfigCategoryConvert;
|
||||||
|
import net.srt.entity.QualityConfigCategoryEntity;
|
||||||
|
import net.srt.framework.common.utils.Result;
|
||||||
|
import net.srt.framework.common.utils.TreeNodeVo;
|
||||||
|
import net.srt.service.QualityConfigCategoryService;
|
||||||
|
import net.srt.vo.QualityConfigCategoryVo;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @BelongsProject: srt_cloud
|
||||||
|
* @BelongsPackage: net.srt.controller
|
||||||
|
* @Author: jpz
|
||||||
|
* @CreateTime: 2023/12/23 13:31
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/quality-config-category")
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Tag(name = "数据治理-规则配置")
|
||||||
|
public class QualityConfigCategoryController {
|
||||||
|
private final QualityConfigCategoryService qualityConfigCategoryService;
|
||||||
|
|
||||||
|
@GetMapping("/list-tree")
|
||||||
|
@Operation(summary = "获取规则配置数")
|
||||||
|
public Result<List<TreeNodeVo>> listTree(){
|
||||||
|
List<TreeNodeVo> list=qualityConfigCategoryService.listTree();
|
||||||
|
return Result.ok(list);
|
||||||
|
}
|
||||||
|
@GetMapping("{id}")
|
||||||
|
@Operation(summary = "信息")
|
||||||
|
public Result<QualityConfigCategoryVo> get(@PathVariable("id") Long id){
|
||||||
|
QualityConfigCategoryEntity entity=qualityConfigCategoryService.getById(id);
|
||||||
|
return Result.ok(QualityConfigCategoryConvert.INSTANCE.convert(entity));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping()
|
||||||
|
@Operation(summary = "修改")
|
||||||
|
public Result<String> update(@RequestBody @Valid QualityConfigCategoryVo vo){
|
||||||
|
qualityConfigCategoryService.update(vo);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
@PostMapping
|
||||||
|
@Operation(summary = "保存")
|
||||||
|
public Result<String> save(@RequestBody QualityConfigCategoryVo vo){
|
||||||
|
qualityConfigCategoryService.save(vo);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("{id}")
|
||||||
|
@Operation(summary = "删除")
|
||||||
|
public Result<String> delete(@PathVariable Long id){
|
||||||
|
qualityConfigCategoryService.delete(id);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,83 @@
|
||||||
|
package net.srt.controller;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import net.srt.framework.common.page.PageResult;
|
||||||
|
import net.srt.framework.common.utils.Result;
|
||||||
|
import net.srt.query.QualityConfigQuery;
|
||||||
|
import net.srt.service.QualityConfigService;
|
||||||
|
import net.srt.vo.QualityConfigVo;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @BelongsProject: srt_cloud
|
||||||
|
* @BelongsPackage: net.srt.controller
|
||||||
|
* @Author: jpz
|
||||||
|
* @CreateTime: 2023/12/24 19:31
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/quality-config")
|
||||||
|
@Tag(name = "数据治理-质量规则配置")
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class QualityConfigController {
|
||||||
|
private final QualityConfigService qualityConfigService;
|
||||||
|
|
||||||
|
@GetMapping("page")
|
||||||
|
@Operation(summary = "分页")
|
||||||
|
public Result<PageResult<QualityConfigVo>> page(@Valid QualityConfigQuery query){
|
||||||
|
PageResult<QualityConfigVo> page= qualityConfigService.page(query);
|
||||||
|
return Result.ok(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("{id}")
|
||||||
|
@Operation(summary = "信息")
|
||||||
|
public Result<QualityConfigVo> get(@PathVariable("id") Long id){
|
||||||
|
return Result.ok(qualityConfigService.get(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping
|
||||||
|
@Operation(summary = "保存")
|
||||||
|
public Result<String> save(@RequestBody QualityConfigVo vo){
|
||||||
|
qualityConfigService.save(vo);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
@PutMapping
|
||||||
|
@Operation(summary = "修改")
|
||||||
|
public Result<String> update(@RequestBody @Valid QualityConfigVo vo){
|
||||||
|
qualityConfigService.update(vo);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/online/{id}")
|
||||||
|
@Operation(summary = "启用")
|
||||||
|
public Result<String> online(@PathVariable Long id){
|
||||||
|
qualityConfigService.online(id);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/offline/{id}")
|
||||||
|
@Operation(summary = "关闭")
|
||||||
|
public Result<String> offline(@PathVariable Long id){
|
||||||
|
qualityConfigService.offline(id);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/hand-run/{id}")
|
||||||
|
@Operation(summary = "手动执行")
|
||||||
|
public Result<String> handRun(@PathVariable Long id){
|
||||||
|
qualityConfigService.handRun(id);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping
|
||||||
|
@Operation(summary = "删除")
|
||||||
|
public Result<String> delete(@RequestBody List<Long> idList){
|
||||||
|
qualityConfigService.delete(idList);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,40 @@
|
||||||
|
package net.srt.controller;
|
||||||
|
|
||||||
|
import cn.hutool.db.Page;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import net.srt.framework.common.page.PageResult;
|
||||||
|
import net.srt.framework.common.utils.Result;
|
||||||
|
import net.srt.query.QualityTaskColumnQuery;
|
||||||
|
import net.srt.service.QualityTaskColumnService;
|
||||||
|
import net.srt.vo.QualityTaskColumnVo;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @BelongsProject: srt_cloud
|
||||||
|
* @BelongsPackage: net.srt.controller
|
||||||
|
* @Author: jpz
|
||||||
|
* @CreateTime: 2023/12/23 11:19
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/quality-task-column")
|
||||||
|
@Tag(name = "数据治理-列检测模块")
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class QualityTaskColumnController {
|
||||||
|
private final QualityTaskColumnService qualityTaskColumnService;
|
||||||
|
@GetMapping("/page")
|
||||||
|
public Result<PageResult<QualityTaskColumnVo>> page(@Valid QualityTaskColumnQuery query){
|
||||||
|
PageResult<QualityTaskColumnVo> page = qualityTaskColumnService.page(query);
|
||||||
|
return Result.ok(page);
|
||||||
|
}
|
||||||
|
@DeleteMapping
|
||||||
|
@Operation(summary = "删除")
|
||||||
|
public Result<String> delete(@RequestBody List<Long> idlist){
|
||||||
|
qualityTaskColumnService.delete(idlist);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
}
|
|
@ -3,16 +3,17 @@ package net.srt.controller;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
import net.srt.convert.QualityTaskTableConvert;
|
||||||
|
import net.srt.entity.QualityTaskTableEntity;
|
||||||
import net.srt.framework.common.page.PageResult;
|
import net.srt.framework.common.page.PageResult;
|
||||||
import net.srt.framework.common.utils.Result;
|
import net.srt.framework.common.utils.Result;
|
||||||
import net.srt.query.QualityTableQuery;
|
import net.srt.query.QualityTableQuery;
|
||||||
import net.srt.service.QualityTaskTableService;
|
import net.srt.service.QualityTaskTableService;
|
||||||
import net.srt.vo.QualityTaskTableVo;
|
import net.srt.vo.QualityTaskTableVo;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @BelongsProject: srt_cloud
|
* @BelongsProject: srt_cloud
|
||||||
|
@ -32,4 +33,16 @@ public class QualityTaskTableController {
|
||||||
PageResult<QualityTaskTableVo> pageResult =qualityTaskTableService.page(query);
|
PageResult<QualityTaskTableVo> pageResult =qualityTaskTableService.page(query);
|
||||||
return Result.ok(pageResult);
|
return Result.ok(pageResult);
|
||||||
}
|
}
|
||||||
|
@GetMapping("{id}")
|
||||||
|
@Operation(summary = "信息")
|
||||||
|
public Result<QualityTaskTableVo> get(@PathVariable("id") Long id){
|
||||||
|
QualityTaskTableEntity entity=qualityTaskTableService.getById(id);
|
||||||
|
return Result.ok(QualityTaskTableConvert.INSTANCE.convert(entity));
|
||||||
|
}
|
||||||
|
@DeleteMapping
|
||||||
|
@Operation(summary = "删除")
|
||||||
|
private Result<String> delete(@RequestBody List<Long> idlist){
|
||||||
|
qualityTaskTableService.delete(idlist);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,8 @@ import net.srt.vo.StandardManagementVo;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -21,46 +23,39 @@ import java.util.List;
|
||||||
* @Date: 2023-12-20 11:30
|
* @Date: 2023-12-20 11:30
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/standard-category")
|
@RequestMapping("standard-category")
|
||||||
@Tag(name = "标准管理列表")
|
@Tag(name = "数据开发-调度中心目录")
|
||||||
public class StandardController {
|
public class StandardController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private StandardService standardService;
|
StandardService standardService;
|
||||||
@GetMapping("list-tree")
|
|
||||||
|
@GetMapping("/list-tree")
|
||||||
@Operation(summary = "查询文件分组树")
|
@Operation(summary = "查询文件分组树")
|
||||||
public Result<List<TreeNodeVo>> listTree() {
|
public Result<List<TreeNodeVo>> listTree() {
|
||||||
return Result.ok(standardService.listTree());
|
return Result.ok(standardService.listTree());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/{id}")
|
|
||||||
@Operation(summary = "根据id获取")
|
|
||||||
public Result<TreeNodeVo> getById(@PathVariable Integer id) {
|
|
||||||
StandardEntity entity = standardService.getById(id);
|
|
||||||
TreeNodeVo nodeVo = BeanUtil.copyProperties(entity, TreeNodeVo::new);
|
|
||||||
nodeVo.setLabel(entity.getName());
|
|
||||||
nodeVo.setParentPath(entity.getPath().contains("/") ? entity.getPath().substring(0, entity.getPath().lastIndexOf("/")) : null);
|
|
||||||
return Result.ok(nodeVo);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping
|
@PostMapping
|
||||||
@Operation(summary = "保存")
|
@Operation(summary = "保存")
|
||||||
public Result<String > save(@RequestBody StandardEntity standardEntity){
|
public Result<String> save(@RequestBody StandardManagementVo vo) {
|
||||||
standardService.save1(standardEntity);
|
standardService.save1(vo);
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping
|
@PutMapping
|
||||||
@Operation(summary = "修改")
|
@Operation(summary = "修改")
|
||||||
public Result<String > update(@RequestBody StandardEntity standardEntity){
|
public Result<String> update(@RequestBody StandardManagementVo vo) {
|
||||||
standardService.update1(standardEntity);
|
standardService.update1(vo);
|
||||||
return Result.ok();
|
|
||||||
}
|
|
||||||
@DeleteMapping("/id")
|
|
||||||
@Operation(summary = "删除")
|
|
||||||
public Result<String > del(@PathVariable Long id){
|
|
||||||
standardService.del(id);
|
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@DeleteMapping
|
||||||
|
@Operation(summary = "删除")
|
||||||
|
public Result<String> delete(Long id) {
|
||||||
|
standardService.delete(id);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,70 @@
|
||||||
|
package net.srt.controller;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import net.srt.convert.StandardStopwatchConvert;
|
||||||
|
import net.srt.entity.StandardStopwatchEntity;
|
||||||
|
import net.srt.framework.common.page.PageResult;
|
||||||
|
import net.srt.framework.common.utils.Result;
|
||||||
|
import net.srt.query.StandardStopwatchQuery;
|
||||||
|
import net.srt.service.StandardStopwatchService;
|
||||||
|
import net.srt.vo.StandardStopwatchVo;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName : StandardStopwatchController
|
||||||
|
* @Description :
|
||||||
|
* @Author : FJJ
|
||||||
|
* @Date: 2023-12-24 10:32
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/standard-code")
|
||||||
|
@Tag(name="数据治理-标准码表数据")
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class StandardStopwatchController {
|
||||||
|
private final StandardStopwatchService standardStopwatchService;
|
||||||
|
|
||||||
|
@GetMapping("page")
|
||||||
|
@Operation(summary = "分页")
|
||||||
|
public Result<PageResult<StandardStopwatchVo>> page(@Valid StandardStopwatchQuery query){
|
||||||
|
PageResult<StandardStopwatchVo> page = standardStopwatchService.page(query);
|
||||||
|
|
||||||
|
return Result.ok(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("{id}")
|
||||||
|
@Operation(summary = "信息")
|
||||||
|
public Result<StandardStopwatchVo> get(@PathVariable("id") Long id){
|
||||||
|
StandardStopwatchEntity entity = standardStopwatchService.getById(id);
|
||||||
|
|
||||||
|
return Result.ok(StandardStopwatchConvert.INSTANCE.convert(entity));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping
|
||||||
|
@Operation(summary = "保存")
|
||||||
|
public Result<String> save(@RequestBody StandardStopwatchVo vo){
|
||||||
|
standardStopwatchService.save(vo);
|
||||||
|
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping
|
||||||
|
@Operation(summary = "修改")
|
||||||
|
public Result<String> update(@RequestBody @Valid StandardStopwatchVo vo){
|
||||||
|
standardStopwatchService.update(vo);
|
||||||
|
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping
|
||||||
|
@Operation(summary = "删除")
|
||||||
|
public Result<String> delete(@RequestBody List<Long> idList){
|
||||||
|
standardStopwatchService.delete(idList);
|
||||||
|
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
package net.srt.convert;
|
package net.srt.convert;
|
||||||
|
|
||||||
import net.srt.entity.DatastandardEntity;
|
import net.srt.entity.DatastandardEntity;
|
||||||
|
import net.srt.vo.DatastandardVo;
|
||||||
import net.srt.vo.StandardManagementVo;
|
import net.srt.vo.StandardManagementVo;
|
||||||
import org.mapstruct.Mapper;
|
import org.mapstruct.Mapper;
|
||||||
import org.mapstruct.factory.Mappers;
|
import org.mapstruct.factory.Mappers;
|
||||||
|
@ -19,8 +20,10 @@ public interface DatastandardConvert {
|
||||||
DatastandardConvert INSTANCE = Mappers.getMapper(DatastandardConvert.class);
|
DatastandardConvert INSTANCE = Mappers.getMapper(DatastandardConvert.class);
|
||||||
|
|
||||||
|
|
||||||
List<StandardManagementVo> convertList(List<DatastandardEntity> list);
|
List<DatastandardVo> convertList(List<DatastandardEntity> list);
|
||||||
|
|
||||||
StandardManagementVo convert(DatastandardEntity entity);
|
|
||||||
|
DatastandardVo convert(DatastandardEntity entity);
|
||||||
|
DatastandardEntity convert(DatastandardVo entity);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
package net.srt.convert;
|
||||||
|
|
||||||
|
import net.srt.entity.MetadataEntity;
|
||||||
|
import net.srt.vo.MetadataVo;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @BelongsProject: srt_cloud
|
||||||
|
* @BelongsPackage: net.srt.convert
|
||||||
|
* @Author: jpz
|
||||||
|
* @CreateTime: 2023/12/24 15:42
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface MetadataConvert {
|
||||||
|
|
||||||
|
MetadataConvert INSTANCE = Mappers.getMapper(MetadataConvert.class);
|
||||||
|
|
||||||
|
MetadataVo convert(MetadataEntity entity);
|
||||||
|
|
||||||
|
MetadataEntity convert(MetadataVo vo);
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
package net.srt.convert;
|
||||||
|
|
||||||
|
import net.srt.entity.QualityConfigCategoryEntity;
|
||||||
|
import net.srt.vo.QualityConfigCategoryVo;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @BelongsProject: srt_cloud
|
||||||
|
* @BelongsPackage: net.srt.convert
|
||||||
|
* @Author: jpz
|
||||||
|
* @CreateTime: 2023/12/24 10:27
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface QualityConfigCategoryConvert {
|
||||||
|
QualityConfigCategoryConvert INSTANCE = Mappers.getMapper(QualityConfigCategoryConvert.class);
|
||||||
|
|
||||||
|
QualityConfigCategoryEntity convert(QualityConfigCategoryVo vo);
|
||||||
|
QualityConfigCategoryVo convert(QualityConfigCategoryEntity entity);
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
package net.srt.convert;
|
||||||
|
|
||||||
|
import net.srt.entity.QualityConfigEntity;
|
||||||
|
import net.srt.vo.QualityConfigVo;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @BelongsProject: srt_cloud
|
||||||
|
* @BelongsPackage: net.srt.convert
|
||||||
|
* @Author: jpz
|
||||||
|
* @CreateTime: 2023/12/24 19:57
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface QualityConfigConvert {
|
||||||
|
QualityConfigConvert INSTANCE = Mappers.getMapper(QualityConfigConvert.class);
|
||||||
|
|
||||||
|
QualityConfigVo convert(QualityConfigEntity entity);
|
||||||
|
|
||||||
|
QualityConfigEntity convert(QualityConfigVo vo);
|
||||||
|
|
||||||
|
List<QualityConfigVo> convertList(List<QualityConfigEntity> list);
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
package net.srt.convert;
|
||||||
|
|
||||||
|
import net.srt.entity.QualityQueryEntity;
|
||||||
|
import net.srt.entity.QualityTaskColumnEntity;
|
||||||
|
import net.srt.vo.QualityRuleVo;
|
||||||
|
import net.srt.vo.QualityTaskColumnVo;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @BelongsProject: srt_cloud
|
||||||
|
* @BelongsPackage: net.srt.convert
|
||||||
|
* @Author: jpz
|
||||||
|
* @CreateTime: 2023/12/23 11:59
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface QualityTaskColumnConvert {
|
||||||
|
|
||||||
|
|
||||||
|
QualityTaskColumnConvert INSTANCE = Mappers.getMapper(QualityTaskColumnConvert.class);
|
||||||
|
|
||||||
|
|
||||||
|
List<QualityTaskColumnVo> convertList(List<QualityTaskColumnEntity> list);
|
||||||
|
|
||||||
|
QualityTaskColumnEntity conver(QualityTaskColumnVo vo);
|
||||||
|
}
|
|
@ -18,4 +18,6 @@ public interface QualityTaskTableConvert {
|
||||||
QualityTaskTableConvert INSTANCE = Mappers.getMapper(QualityTaskTableConvert.class);
|
QualityTaskTableConvert INSTANCE = Mappers.getMapper(QualityTaskTableConvert.class);
|
||||||
|
|
||||||
List<QualityTaskTableVo> convertList(List<QualityTaskTableEntity> list);
|
List<QualityTaskTableVo> convertList(List<QualityTaskTableEntity> list);
|
||||||
|
|
||||||
|
QualityTaskTableVo convert(QualityTaskTableEntity entity);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
package net.srt.convert;
|
||||||
|
|
||||||
|
import net.srt.entity.StandardEntity;
|
||||||
|
import net.srt.vo.StandardManagementVo;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName : StandardConvert
|
||||||
|
* @Description :
|
||||||
|
* @Author : FJJ
|
||||||
|
* @Date: 2023-12-23 12:14
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface StandardConvert {
|
||||||
|
|
||||||
|
StandardConvert INSTANCE = Mappers.getMapper(StandardConvert.class);
|
||||||
|
|
||||||
|
StandardEntity convert(StandardManagementVo vo);
|
||||||
|
|
||||||
|
StandardManagementVo convert(StandardEntity entity);
|
||||||
|
|
||||||
|
List<StandardManagementVo> convertList(List<StandardEntity> list);
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
package net.srt.convert;
|
||||||
|
|
||||||
|
import net.srt.entity.StandardStopwatchEntity;
|
||||||
|
import net.srt.vo.StandardStopwatchVo;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName : StandardStopwatchConvert
|
||||||
|
* @Description :
|
||||||
|
* @Author : FJJ
|
||||||
|
* @Date: 2023-12-24 10:33
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface StandardStopwatchConvert {
|
||||||
|
StandardStopwatchConvert INSTANCE = Mappers.getMapper(StandardStopwatchConvert.class);
|
||||||
|
|
||||||
|
StandardStopwatchEntity convert(StandardStopwatchVo vo);
|
||||||
|
|
||||||
|
StandardStopwatchVo convert(StandardStopwatchEntity entity);
|
||||||
|
|
||||||
|
List<StandardStopwatchVo> convertList(List<StandardStopwatchEntity> list);
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
package net.srt.dao;
|
||||||
|
|
||||||
|
import net.srt.entity.MetadataEntity;
|
||||||
|
import net.srt.framework.mybatis.dao.BaseDao;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @BelongsProject: srt_cloud
|
||||||
|
* @BelongsPackage: net.srt.dao
|
||||||
|
* @Author: jpz
|
||||||
|
* @CreateTime: 2023/12/24 14:39
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface MetadataDao extends BaseDao<MetadataEntity> {
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
package net.srt.dao;
|
||||||
|
|
||||||
|
import net.srt.entity.MetadataPropertyEntity;
|
||||||
|
import net.srt.framework.mybatis.dao.BaseDao;
|
||||||
|
import net.srt.vo.MetamodelPropertyVO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @BelongsProject: srt_cloud
|
||||||
|
* @BelongsPackage: net.srt.dao
|
||||||
|
* @Author: jpz
|
||||||
|
* @CreateTime: 2023/12/24 15:49
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface MetadataPropertyDao extends BaseDao<MetadataPropertyEntity> {
|
||||||
|
List<MetamodelPropertyVO> listPropertyById(@Param("id") Long id, Long metamodelId);
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
package net.srt.dao;
|
||||||
|
|
||||||
|
import net.srt.entity.QualityConfigCategoryEntity;
|
||||||
|
import net.srt.framework.mybatis.dao.BaseDao;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @BelongsProject: srt_cloud
|
||||||
|
* @BelongsPackage: net.srt.dao
|
||||||
|
* @Author: jpz
|
||||||
|
* @CreateTime: 2023/12/24 9:47
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface QualityConfigCategoryDao extends BaseDao<QualityConfigCategoryEntity> {
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
package net.srt.dao;
|
||||||
|
|
||||||
|
import net.srt.entity.QualityConfigEntity;
|
||||||
|
import net.srt.framework.mybatis.dao.BaseDao;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @BelongsProject: srt_cloud
|
||||||
|
* @BelongsPackage: net.srt.dao
|
||||||
|
* @Author: jpz
|
||||||
|
* @CreateTime: 2023/12/24 11:36
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface QualityConfigDao extends BaseDao<QualityConfigEntity> {
|
||||||
|
}
|
|
@ -1,10 +1,17 @@
|
||||||
package net.srt.dao;
|
package net.srt.dao;
|
||||||
|
|
||||||
|
import net.srt.entity.QualityTaskColumnEntity;
|
||||||
|
import net.srt.entity.QualityTaskEntity;
|
||||||
|
import net.srt.entity.QualityTaskTableEntity;
|
||||||
|
import net.srt.framework.mybatis.dao.BaseDao;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @BelongsProject: srt_cloud
|
* @BelongsProject: srt_cloud
|
||||||
* @BelongsPackage: net.srt.dao
|
* @BelongsPackage: net.srt.dao
|
||||||
* @Author: jpz
|
* @Author: jpz
|
||||||
* @CreateTime: 2023/12/22 21:37
|
* @CreateTime: 2023/12/22 21:37
|
||||||
*/
|
*/
|
||||||
public interface QualityTaskColumnDao {
|
@Mapper
|
||||||
|
public interface QualityTaskColumnDao extends BaseDao<QualityTaskColumnEntity> {
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
package net.srt.dao;
|
||||||
|
|
||||||
|
import net.srt.entity.StandardStopwatchEntity;
|
||||||
|
import net.srt.framework.mybatis.dao.BaseDao;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName : StandardStopwatchDao
|
||||||
|
* @Description :
|
||||||
|
* @Author : FJJ
|
||||||
|
* @Date: 2023-12-24 10:33
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface StandardStopwatchDao extends BaseDao<StandardStopwatchEntity> {
|
||||||
|
void updateCodeNumByStandardId(@Param("standardId") Long standardId);
|
||||||
|
}
|
|
@ -1,57 +0,0 @@
|
||||||
package net.srt.entity;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.SuperBuilder;
|
|
||||||
import net.srt.framework.mybatis.entity.BaseEntity;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文件分组表
|
|
||||||
*
|
|
||||||
* @author zrx 985134801@qq.com
|
|
||||||
* @since 1.0.0 2022-11-12
|
|
||||||
*/
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
@SuperBuilder
|
|
||||||
@Data
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
@TableName("data_file_category")
|
|
||||||
public class DatagovernanceEntity extends BaseEntity {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 父级id(顶级为0)
|
|
||||||
*/
|
|
||||||
private Long parentId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分组名称
|
|
||||||
*/
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分组序号
|
|
||||||
*/
|
|
||||||
private Integer orderNo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 描述
|
|
||||||
*/
|
|
||||||
private String description;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分组路径
|
|
||||||
*/
|
|
||||||
private String path;
|
|
||||||
|
|
||||||
private Integer type;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 项目id
|
|
||||||
*/
|
|
||||||
private Long projectId;
|
|
||||||
|
|
||||||
}
|
|
|
@ -17,8 +17,6 @@ import net.srt.framework.mybatis.entity.BaseEntity;
|
||||||
@TableName("standard_management")
|
@TableName("standard_management")
|
||||||
public class DatastandardEntity extends BaseEntity {
|
public class DatastandardEntity extends BaseEntity {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@TableId("id")
|
|
||||||
private Long id;
|
|
||||||
private Integer categoryId;
|
private Integer categoryId;
|
||||||
private String engName;
|
private String engName;
|
||||||
private String cnName;
|
private String cnName;
|
||||||
|
@ -30,10 +28,8 @@ public class DatastandardEntity extends BaseEntity {
|
||||||
private Integer standardCodeId;
|
private Integer standardCodeId;
|
||||||
private Integer type;
|
private Integer type;
|
||||||
private String note;
|
private String note;
|
||||||
private Integer projectId;
|
private Long projectId;
|
||||||
private Integer status;
|
private Integer status;
|
||||||
private Integer version;
|
|
||||||
private Integer deleted;
|
|
||||||
private Integer ifStandardRel;
|
private Integer ifStandardRel;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,74 @@
|
||||||
|
package net.srt.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import net.srt.framework.mybatis.entity.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @BelongsProject: srt_cloud
|
||||||
|
* @BelongsPackage: net.srt.entity
|
||||||
|
* @Author: jpz
|
||||||
|
* @CreateTime: 2023/12/24 14:36
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Data
|
||||||
|
@TableName("data_governance_metadata")
|
||||||
|
public class MetadataEntity extends BaseEntity {
|
||||||
|
/**
|
||||||
|
* 父级id(默认0为顶级)
|
||||||
|
*/
|
||||||
|
private Long parentId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 树状节点的路径
|
||||||
|
*/
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 节点名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 节点英文名称
|
||||||
|
*/
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
private Integer ifLeaf;
|
||||||
|
/**
|
||||||
|
* 对应的元模型id
|
||||||
|
*/
|
||||||
|
private Long metamodelId;
|
||||||
|
|
||||||
|
private String icon;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详情
|
||||||
|
*/
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据库类型(1-数据库 2-中台库)
|
||||||
|
*/
|
||||||
|
private Integer dbType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 如果是外部系统接入的库表,需要此字段
|
||||||
|
*/
|
||||||
|
private Long datasourceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 采集任务id
|
||||||
|
*/
|
||||||
|
private Long collectTaskId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目id(租户id)
|
||||||
|
*/
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
|
||||||
|
private Integer orderNo;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,38 @@
|
||||||
|
package net.srt.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import net.srt.framework.mybatis.entity.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @BelongsProject: srt_cloud
|
||||||
|
* @BelongsPackage: net.srt.entity
|
||||||
|
* @Author: jpz
|
||||||
|
* @CreateTime: 2023/12/24 15:50
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper=false)
|
||||||
|
@Data
|
||||||
|
@TableName("data_governance_metadata_property")
|
||||||
|
public class MetadataPropertyEntity extends BaseEntity {
|
||||||
|
/**
|
||||||
|
* 属性id
|
||||||
|
*/
|
||||||
|
private Long metamodelPropertyId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 元数据id
|
||||||
|
*/
|
||||||
|
private Long metadataId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 属性值
|
||||||
|
*/
|
||||||
|
private String property;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目id(租户id)
|
||||||
|
*/
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,53 @@
|
||||||
|
package net.srt.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import net.srt.framework.mybatis.entity.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @BelongsProject: srt_cloud
|
||||||
|
* @BelongsPackage: net.srt.entity
|
||||||
|
* @Author: jpz
|
||||||
|
* @CreateTime: 2023/12/24 9:20
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Data
|
||||||
|
@TableName("data_governance_quality_config_category")
|
||||||
|
public class QualityConfigCategoryEntity extends BaseEntity {
|
||||||
|
/**
|
||||||
|
* 0-普通目录 1-规则配置目录
|
||||||
|
*/
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 父级id(顶级为0)
|
||||||
|
*/
|
||||||
|
private Long parentId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 目录名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 目录路径
|
||||||
|
*/
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 序号
|
||||||
|
*/
|
||||||
|
private Integer orderNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 描述
|
||||||
|
*/
|
||||||
|
private String note;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目(租户)id
|
||||||
|
*/
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,73 @@
|
||||||
|
package net.srt.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import net.srt.api.module.data.governance.dto.quality.QualityConfigParam;
|
||||||
|
import net.srt.framework.mybatis.entity.BaseEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @BelongsProject: srt_cloud
|
||||||
|
* @BelongsPackage: net.srt.entity
|
||||||
|
* @Author: jpz
|
||||||
|
* @CreateTime: 2023/12/24 11:32
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Data
|
||||||
|
@TableName(value = "data_governance_quality_config",autoResultMap = true)
|
||||||
|
public class QualityConfigEntity extends BaseEntity {
|
||||||
|
/**
|
||||||
|
* 名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
private Long categoryId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规则id
|
||||||
|
*/
|
||||||
|
private Integer ruleId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 个性化参数json
|
||||||
|
*/
|
||||||
|
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||||
|
private QualityConfigParam param;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 元数据字段列表
|
||||||
|
*/
|
||||||
|
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||||
|
private List<Integer> metadataIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态,1-启用,0-关闭
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务类型,1-一次性任务,2-周期任务
|
||||||
|
*/
|
||||||
|
private Integer taskType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* cron表达式
|
||||||
|
*/
|
||||||
|
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||||
|
private String cron;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String note;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目id
|
||||||
|
*/
|
||||||
|
private Long projectId;
|
||||||
|
}
|
|
@ -0,0 +1,61 @@
|
||||||
|
package net.srt.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import net.srt.framework.mybatis.entity.BaseEntity;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @BelongsProject: srt_cloud
|
||||||
|
* @BelongsPackage: net.srt.entity
|
||||||
|
* @Author: jpz
|
||||||
|
* @CreateTime: 2023/12/23 11:32
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper=false)
|
||||||
|
@Data
|
||||||
|
@TableName("data_governance_quality_task_column")
|
||||||
|
public class QualityTaskColumnEntity extends BaseEntity {
|
||||||
|
/**
|
||||||
|
* 质量任务id
|
||||||
|
*/
|
||||||
|
private Long qualityTaskId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表检测记录id
|
||||||
|
*/
|
||||||
|
private Long qualityTaskTableId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 被检测的数据行
|
||||||
|
*/
|
||||||
|
private String checkRow;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 未通过详情
|
||||||
|
*/
|
||||||
|
private String notPassInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检测时间
|
||||||
|
*/
|
||||||
|
private Date checkTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 0-不通过 1-通过
|
||||||
|
*/
|
||||||
|
private Integer checkResult;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目id
|
||||||
|
*/
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,11 +15,11 @@ import net.srt.framework.mybatis.entity.BaseEntity;
|
||||||
* @since 1.0.0 2022-11-12
|
* @since 1.0.0 2022-11-12
|
||||||
*/
|
*/
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@SuperBuilder
|
|
||||||
@Data
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@TableName("data_file_category")
|
@TableName(value = "data_dispatch_catalogue", autoResultMap = true)
|
||||||
public class StandardEntity extends BaseEntity {
|
public class StandardEntity extends BaseEntity {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -53,5 +53,4 @@ public class StandardEntity extends BaseEntity {
|
||||||
* 项目id
|
* 项目id
|
||||||
*/
|
*/
|
||||||
private Long projectId;
|
private Long projectId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
package net.srt.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import net.srt.framework.mybatis.entity.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName : StandardStopwatchEntity
|
||||||
|
* @Description :
|
||||||
|
* @Author : FJJ
|
||||||
|
* @Date: 2023-12-24 10:30
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Data
|
||||||
|
@TableName("data_standard_stopwatch")
|
||||||
|
public class StandardStopwatchEntity extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 标准码表id
|
||||||
|
*/
|
||||||
|
private Long standardId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 码表数据的id
|
||||||
|
*/
|
||||||
|
private String dataId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 码表数据的name
|
||||||
|
*/
|
||||||
|
private String dataName;
|
||||||
|
|
||||||
|
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
}
|
|
@ -14,7 +14,7 @@ import net.srt.framework.common.query.Query;
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Schema (description = "标准管理列表")
|
@Schema (description = "标准管理列表")
|
||||||
public class StandardManagementQuery extends Query {
|
public class DatastandrdQuery extends Query {
|
||||||
private Integer categoryId;
|
private Integer categoryId;
|
||||||
private String t;
|
private String t;
|
||||||
private String cnName;
|
private String cnName;
|
|
@ -0,0 +1,22 @@
|
||||||
|
package net.srt.query;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import net.srt.framework.common.query.Query;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @BelongsProject: srt_cloud
|
||||||
|
* @BelongsPackage: net.srt.query
|
||||||
|
* @Author: jpz
|
||||||
|
* @CreateTime: 2023/12/24 19:39
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(description = "数据治理-质量规则配置查询")
|
||||||
|
public class QualityConfigQuery extends Query {
|
||||||
|
private Long categoryId;
|
||||||
|
private String name;
|
||||||
|
private Long status;
|
||||||
|
private Long taskType;
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
package net.srt.query;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import net.srt.framework.common.query.Query;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @BelongsProject: srt_cloud
|
||||||
|
* @BelongsPackage: net.srt.query
|
||||||
|
* @Author: jpz
|
||||||
|
* @CreateTime: 2023/12/23 11:28
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper =false)
|
||||||
|
@Schema(description = "数据治理-字段检测记录查询")
|
||||||
|
public class QualityTaskColumnQuery extends Query {
|
||||||
|
private Long qualityTaskTableId;
|
||||||
|
private Integer checkResult;
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
package net.srt.query;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import net.srt.framework.common.query.Query;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName : StandardStopwatchQuery
|
||||||
|
* @Description :
|
||||||
|
* @Author : FJJ
|
||||||
|
* @Date: 2023-12-24 10:29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(description = "数据治理-标准码表数据查询")
|
||||||
|
public class StandardStopwatchQuery extends Query {
|
||||||
|
private Integer standardId;
|
||||||
|
private String dataId;
|
||||||
|
private String dataName;
|
||||||
|
}
|
|
@ -3,7 +3,8 @@ package net.srt.service;
|
||||||
import net.srt.entity.DatastandardEntity;
|
import net.srt.entity.DatastandardEntity;
|
||||||
import net.srt.framework.common.page.PageResult;
|
import net.srt.framework.common.page.PageResult;
|
||||||
import net.srt.framework.mybatis.service.BaseService;
|
import net.srt.framework.mybatis.service.BaseService;
|
||||||
import net.srt.query.StandardManagementQuery;
|
import net.srt.query.DatastandrdQuery;
|
||||||
|
import net.srt.vo.DatastandardVo;
|
||||||
import net.srt.vo.StandardManagementVo;
|
import net.srt.vo.StandardManagementVo;
|
||||||
import org.mybatis.spring.annotation.MapperScan;
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
|
|
||||||
|
@ -17,11 +18,13 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
@MapperScan("net.srt.service.DatastandardService")
|
@MapperScan("net.srt.service.DatastandardService")
|
||||||
public interface DatastandardService extends BaseService<DatastandardEntity> {
|
public interface DatastandardService extends BaseService<DatastandardEntity> {
|
||||||
PageResult<StandardManagementVo> page(StandardManagementQuery query);
|
PageResult<DatastandardVo> page(DatastandrdQuery query);
|
||||||
|
|
||||||
List<DatastandardEntity> getTableCode();
|
List<DatastandardEntity> getTableCode();
|
||||||
|
|
||||||
void update1(DatastandardEntity datastandardEntity);
|
|
||||||
|
|
||||||
void delete(List<Long> idList);
|
void delete(List<Long> idList);
|
||||||
|
|
||||||
|
void update1(DatastandardVo entity);
|
||||||
|
|
||||||
|
void save(DatastandardVo vo);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,21 @@ import net.srt.framework.common.page.PageResult;
|
||||||
import net.srt.framework.mybatis.service.BaseService;
|
import net.srt.framework.mybatis.service.BaseService;
|
||||||
import net.srt.vo.MetadataCollectVO;
|
import net.srt.vo.MetadataCollectVO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public interface MetadataCollectService extends BaseService<MetadataCollectEntity> {
|
public interface MetadataCollectService extends BaseService<MetadataCollectEntity> {
|
||||||
|
|
||||||
PageResult<MetadataCollectVO> page(MetadataCollectQuery query);
|
PageResult<MetadataCollectVO> page(MetadataCollectQuery query);
|
||||||
|
|
||||||
|
void save(MetadataCollectVO vo);
|
||||||
|
|
||||||
|
void update(MetadataCollectVO vo);
|
||||||
|
|
||||||
|
void cancel(Long id);
|
||||||
|
|
||||||
|
void release(Long id);
|
||||||
|
|
||||||
|
void handRun(Long id);
|
||||||
|
|
||||||
|
void delete(List<Long> idList);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
package net.srt.service;
|
||||||
|
|
||||||
|
import net.srt.entity.MetadataEntity;
|
||||||
|
import net.srt.framework.common.cache.bean.Neo4jInfo;
|
||||||
|
import net.srt.framework.common.utils.TreeNodeVo;
|
||||||
|
import net.srt.framework.mybatis.service.BaseService;
|
||||||
|
import net.srt.vo.MetadataVo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @BelongsProject: srt_cloud
|
||||||
|
* @BelongsPackage: net.srt.service
|
||||||
|
* @Author: jpz
|
||||||
|
* @CreateTime: 2023/12/24 14:35
|
||||||
|
*/
|
||||||
|
|
||||||
|
public interface MetadataService extends BaseService<MetadataEntity> {
|
||||||
|
List<TreeNodeVo> listByPatenId(Long parentId);
|
||||||
|
|
||||||
|
List<TreeNodeVo> listFloder();
|
||||||
|
|
||||||
|
List<TreeNodeVo> listDb();
|
||||||
|
|
||||||
|
List<TreeNodeVo> listKeyword(String keyword);
|
||||||
|
|
||||||
|
MetadataVo get(Long id);
|
||||||
|
|
||||||
|
void save(MetadataVo vo);
|
||||||
|
|
||||||
|
void update(MetadataVo vo);
|
||||||
|
|
||||||
|
void delete(Long id);
|
||||||
|
|
||||||
|
void updateNeo4j(Neo4jInfo neo4jInfo);
|
||||||
|
|
||||||
|
Neo4jInfo getNeo4j();
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
package net.srt.service;
|
||||||
|
|
||||||
|
import net.srt.entity.QualityConfigCategoryEntity;
|
||||||
|
import net.srt.framework.common.utils.TreeNodeVo;
|
||||||
|
import net.srt.framework.mybatis.service.BaseService;
|
||||||
|
import net.srt.vo.QualityConfigCategoryVo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @BelongsProject: srt_cloud
|
||||||
|
* @BelongsPackage: net.srt.service
|
||||||
|
* @Author: jpz
|
||||||
|
* @CreateTime: 2023/12/24 9:19
|
||||||
|
*/
|
||||||
|
|
||||||
|
public interface QualityConfigCategoryService extends BaseService<QualityConfigCategoryEntity> {
|
||||||
|
List<TreeNodeVo> listTree();
|
||||||
|
|
||||||
|
void update(QualityConfigCategoryVo vo);
|
||||||
|
|
||||||
|
void save(QualityConfigCategoryVo vo);
|
||||||
|
|
||||||
|
void delete(Long id);
|
||||||
|
}
|
|
@ -0,0 +1,34 @@
|
||||||
|
package net.srt.service;
|
||||||
|
|
||||||
|
import net.srt.entity.QualityConfigEntity;
|
||||||
|
import net.srt.framework.common.page.PageResult;
|
||||||
|
import net.srt.framework.mybatis.service.BaseService;
|
||||||
|
import net.srt.query.QualityConfigQuery;
|
||||||
|
import net.srt.vo.QualityConfigVo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @BelongsProject: srt_cloud
|
||||||
|
* @BelongsPackage: net.srt.service
|
||||||
|
* @Author: jpz
|
||||||
|
* @CreateTime: 2023/12/24 19:33
|
||||||
|
*/
|
||||||
|
public interface QualityConfigService extends BaseService<QualityConfigEntity> {
|
||||||
|
PageResult<QualityConfigVo> page(QualityConfigQuery query);
|
||||||
|
|
||||||
|
QualityConfigVo get(Long id);
|
||||||
|
|
||||||
|
void save(QualityConfigVo vo);
|
||||||
|
|
||||||
|
void update(QualityConfigVo vo);
|
||||||
|
|
||||||
|
void online(Long id);
|
||||||
|
|
||||||
|
void offline(Long id);
|
||||||
|
|
||||||
|
void handRun(Long id);
|
||||||
|
|
||||||
|
|
||||||
|
void delete(List<Long> idList);
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
package net.srt.service;
|
||||||
|
|
||||||
|
import net.srt.entity.QualityTaskColumnEntity;
|
||||||
|
import net.srt.framework.common.page.PageResult;
|
||||||
|
import net.srt.framework.mybatis.service.BaseService;
|
||||||
|
import net.srt.query.QualityTaskColumnQuery;
|
||||||
|
import net.srt.vo.QualityTaskColumnVo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @BelongsProject: srt_cloud
|
||||||
|
* @BelongsPackage: net.srt.service
|
||||||
|
* @Author: jpz
|
||||||
|
* @CreateTime: 2023/12/23 11:23
|
||||||
|
*/
|
||||||
|
public interface QualityTaskColumnService extends BaseService<QualityTaskColumnEntity> {
|
||||||
|
PageResult<QualityTaskColumnVo> page(QualityTaskColumnQuery query);
|
||||||
|
|
||||||
|
void delete(List<Long> idlist);
|
||||||
|
}
|
|
@ -6,6 +6,8 @@ import net.srt.framework.mybatis.service.BaseService;
|
||||||
import net.srt.query.QualityTableQuery;
|
import net.srt.query.QualityTableQuery;
|
||||||
import net.srt.vo.QualityTaskTableVo;
|
import net.srt.vo.QualityTaskTableVo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @BelongsProject: srt_cloud
|
* @BelongsProject: srt_cloud
|
||||||
* @BelongsPackage: net.srt.service
|
* @BelongsPackage: net.srt.service
|
||||||
|
@ -14,4 +16,6 @@ import net.srt.vo.QualityTaskTableVo;
|
||||||
*/
|
*/
|
||||||
public interface QualityTaskTableService extends BaseService<QualityTaskTableEntity> {
|
public interface QualityTaskTableService extends BaseService<QualityTaskTableEntity> {
|
||||||
PageResult<QualityTaskTableVo> page(QualityTableQuery query);
|
PageResult<QualityTaskTableVo> page(QualityTableQuery query);
|
||||||
|
|
||||||
|
void delete(List<Long> idlist);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ package net.srt.service;
|
||||||
import net.srt.entity.StandardEntity;
|
import net.srt.entity.StandardEntity;
|
||||||
import net.srt.framework.common.utils.TreeNodeVo;
|
import net.srt.framework.common.utils.TreeNodeVo;
|
||||||
import net.srt.framework.mybatis.service.BaseService;
|
import net.srt.framework.mybatis.service.BaseService;
|
||||||
|
import net.srt.vo.StandardManagementVo;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -14,12 +15,12 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
public interface StandardService extends BaseService<StandardEntity> {
|
public interface StandardService extends BaseService<StandardEntity> {
|
||||||
|
|
||||||
|
|
||||||
List<TreeNodeVo> listTree();
|
List<TreeNodeVo> listTree();
|
||||||
|
|
||||||
void save1(StandardEntity standardEntity);
|
void save1(StandardManagementVo vo);
|
||||||
|
|
||||||
void update1(StandardEntity standardEntity);
|
void update1(StandardManagementVo vo);
|
||||||
|
|
||||||
void del(Long id);
|
|
||||||
|
|
||||||
|
void delete(Long id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
package net.srt.service;
|
||||||
|
|
||||||
|
import net.srt.entity.StandardStopwatchEntity;
|
||||||
|
import net.srt.framework.common.page.PageResult;
|
||||||
|
import net.srt.framework.mybatis.service.BaseService;
|
||||||
|
import net.srt.query.StandardStopwatchQuery;
|
||||||
|
import net.srt.vo.StandardStopwatchVo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName : StandardStopwatchService
|
||||||
|
* @Description :
|
||||||
|
* @Author : FJJ
|
||||||
|
* @Date: 2023-12-24 10:32
|
||||||
|
*/
|
||||||
|
public interface StandardStopwatchService extends BaseService<StandardStopwatchEntity> {
|
||||||
|
PageResult<StandardStopwatchVo> page(StandardStopwatchQuery query);
|
||||||
|
|
||||||
|
void save(StandardStopwatchVo vo);
|
||||||
|
|
||||||
|
void update(StandardStopwatchVo vo);
|
||||||
|
|
||||||
|
void delete(List<Long> idList);
|
||||||
|
}
|
|
@ -11,8 +11,9 @@ import net.srt.entity.DatastandardEntity;
|
||||||
import net.srt.entity.MetamodelEntity;
|
import net.srt.entity.MetamodelEntity;
|
||||||
import net.srt.framework.common.page.PageResult;
|
import net.srt.framework.common.page.PageResult;
|
||||||
import net.srt.framework.mybatis.service.impl.BaseServiceImpl;
|
import net.srt.framework.mybatis.service.impl.BaseServiceImpl;
|
||||||
import net.srt.query.StandardManagementQuery;
|
import net.srt.query.DatastandrdQuery;
|
||||||
import net.srt.service.DatastandardService;
|
import net.srt.service.DatastandardService;
|
||||||
|
import net.srt.vo.DatastandardVo;
|
||||||
import net.srt.vo.StandardManagementVo;
|
import net.srt.vo.StandardManagementVo;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import srt.cloud.framework.dbswitch.common.util.StringUtil;
|
import srt.cloud.framework.dbswitch.common.util.StringUtil;
|
||||||
|
@ -30,7 +31,7 @@ import java.util.List;
|
||||||
public class DatastandardServiceImpl extends BaseServiceImpl<DatastandardDao, DatastandardEntity> implements DatastandardService {
|
public class DatastandardServiceImpl extends BaseServiceImpl<DatastandardDao, DatastandardEntity> implements DatastandardService {
|
||||||
private final DatastandardDao datastandardDao;
|
private final DatastandardDao datastandardDao;
|
||||||
@Override
|
@Override
|
||||||
public PageResult<StandardManagementVo> page(StandardManagementQuery query) {
|
public PageResult<DatastandardVo> page(DatastandrdQuery query) {
|
||||||
IPage<DatastandardEntity> page = baseMapper.selectPage(getPage(query), getWrapper(query));
|
IPage<DatastandardEntity> page = baseMapper.selectPage(getPage(query), getWrapper(query));
|
||||||
return new PageResult<>(DatastandardConvert.INSTANCE.convertList(page.getRecords()), page.getTotal());
|
return new PageResult<>(DatastandardConvert.INSTANCE.convertList(page.getRecords()), page.getTotal());
|
||||||
}
|
}
|
||||||
|
@ -41,12 +42,7 @@ public class DatastandardServiceImpl extends BaseServiceImpl<DatastandardDao, Da
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void update1(DatastandardEntity datastandardEntity) {
|
|
||||||
StandardManagementVo standardManagementVo=DatastandardConvert.INSTANCE.convert(datastandardEntity);
|
|
||||||
standardManagementVo.setProjectId(getProjectId());
|
|
||||||
updateById(datastandardEntity);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void delete(List<Long> idList) {
|
public void delete(List<Long> idList) {
|
||||||
|
@ -60,8 +56,22 @@ public class DatastandardServiceImpl extends BaseServiceImpl<DatastandardDao, Da
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update1(DatastandardVo vo) {
|
||||||
|
DatastandardEntity entity = DatastandardConvert.INSTANCE.convert(vo);
|
||||||
|
entity.setProjectId(getProjectId());
|
||||||
|
updateById(entity);
|
||||||
|
}
|
||||||
|
|
||||||
private LambdaQueryWrapper<DatastandardEntity> getWrapper(StandardManagementQuery query) {
|
@Override
|
||||||
|
public void save(DatastandardVo vo) {
|
||||||
|
DatastandardEntity entity = DatastandardConvert.INSTANCE.convert(vo);
|
||||||
|
entity.setProjectId(getProjectId());
|
||||||
|
baseMapper.insert(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<DatastandardEntity> getWrapper(DatastandrdQuery query) {
|
||||||
LambdaQueryWrapper<DatastandardEntity> wrapper = Wrappers.lambdaQuery();
|
LambdaQueryWrapper<DatastandardEntity> wrapper = Wrappers.lambdaQuery();
|
||||||
wrapper.like(StringUtil.isNotBlank(query.getCnName()), DatastandardEntity::getCnName, query.getCnName());
|
wrapper.like(StringUtil.isNotBlank(query.getCnName()), DatastandardEntity::getCnName, query.getCnName());
|
||||||
wrapper.like(StringUtil.isNotBlank(query.getEngName()), DatastandardEntity::getEngName, query.getEngName());
|
wrapper.like(StringUtil.isNotBlank(query.getEngName()), DatastandardEntity::getEngName, query.getEngName());
|
||||||
|
|
|
@ -1,30 +1,97 @@
|
||||||
package net.srt.service.impl;
|
package net.srt.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.cron.CronException;
|
||||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
import net.srt.api.module.data.governance.constant.MetadataCollectType;
|
||||||
|
import net.srt.api.module.quartz.QuartzDataGovernanceMetadataCollectApi;
|
||||||
import net.srt.convert.MetadataCollectConvert;
|
import net.srt.convert.MetadataCollectConvert;
|
||||||
import net.srt.dao.MetadataCollectDao;
|
import net.srt.dao.MetadataCollectDao;
|
||||||
import net.srt.entity.MetadataCollectEntity;
|
import net.srt.entity.MetadataCollectEntity;
|
||||||
import net.srt.entity.MetadataCollectQuery;
|
import net.srt.entity.MetadataCollectQuery;
|
||||||
|
import net.srt.framework.common.exception.ServerException;
|
||||||
import net.srt.framework.common.page.PageResult;
|
import net.srt.framework.common.page.PageResult;
|
||||||
import net.srt.framework.mybatis.service.impl.BaseServiceImpl;
|
import net.srt.framework.mybatis.service.impl.BaseServiceImpl;
|
||||||
import net.srt.service.MetadataCollectService;
|
import net.srt.service.MetadataCollectService;
|
||||||
import net.srt.vo.MetadataCollectVO;
|
import net.srt.vo.MetadataCollectVO;
|
||||||
|
import org.quartz.CronExpression;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import srt.cloud.framework.dbswitch.common.util.StringUtil;
|
import srt.cloud.framework.dbswitch.common.util.StringUtil;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class MetadataCollectServiceImpl extends BaseServiceImpl<MetadataCollectDao, MetadataCollectEntity> implements MetadataCollectService {
|
public class MetadataCollectServiceImpl extends BaseServiceImpl<MetadataCollectDao, MetadataCollectEntity> implements MetadataCollectService {
|
||||||
|
|
||||||
|
private final QuartzDataGovernanceMetadataCollectApi metadataCollectApi;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResult<MetadataCollectVO> page(MetadataCollectQuery query) {
|
public PageResult<MetadataCollectVO> page(MetadataCollectQuery query) {
|
||||||
IPage<MetadataCollectEntity> page = baseMapper.selectPage(getPage(query), getWrapper(query));
|
IPage<MetadataCollectEntity> page = baseMapper.selectPage(getPage(query), getWrapper(query));
|
||||||
return new PageResult<>(MetadataCollectConvert.INSTANCE.convertList(page.getRecords()), page.getTotal());
|
return new PageResult<>(MetadataCollectConvert.INSTANCE.convertList(page.getRecords()), page.getTotal());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void save(MetadataCollectVO vo) {
|
||||||
|
checkParam(vo);
|
||||||
|
MetadataCollectEntity entity = MetadataCollectConvert.INSTANCE.convert(vo);
|
||||||
|
entity.setProjectId(getProjectId());
|
||||||
|
baseMapper.insert(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update(MetadataCollectVO vo) {
|
||||||
|
checkParam(vo);
|
||||||
|
MetadataCollectEntity entity = MetadataCollectConvert.INSTANCE.convert(vo);
|
||||||
|
entity.setProjectId(getProjectId());
|
||||||
|
updateById(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void cancel(Long id) {
|
||||||
|
metadataCollectApi.cancel(id);
|
||||||
|
MetadataCollectEntity entity = baseMapper.selectById(id);
|
||||||
|
entity.setReleaseTime(null);
|
||||||
|
entity.setStatus(0);
|
||||||
|
baseMapper.updateById(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void release(Long id) {
|
||||||
|
metadataCollectApi.release(id);
|
||||||
|
MetadataCollectEntity entity = baseMapper.selectById(id);
|
||||||
|
entity.setReleaseTime(new Date());
|
||||||
|
entity.setStatus(1);
|
||||||
|
baseMapper.updateById(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handRun(Long id) {
|
||||||
|
metadataCollectApi.handRun(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void delete(List<Long> idList) {
|
||||||
|
removeByIds(idList);
|
||||||
|
// for (Long id : idList) {
|
||||||
|
// LambdaQueryWrapper<MetadataCollectEntity> wrapper = Wrappers.lambdaQuery();
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkParam(MetadataCollectVO vo){
|
||||||
|
if(MetadataCollectType.CRON.getValue().equals(vo.getTaskType())){
|
||||||
|
if(!CronExpression.isValidExpression(vo.getCron())){
|
||||||
|
throw new ServerException("cron表达式有误,请检查!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private Wrapper<MetadataCollectEntity> getWrapper(MetadataCollectQuery query) {
|
private Wrapper<MetadataCollectEntity> getWrapper(MetadataCollectQuery query) {
|
||||||
LambdaQueryWrapper<MetadataCollectEntity> wrapper = Wrappers.lambdaQuery();
|
LambdaQueryWrapper<MetadataCollectEntity> wrapper = Wrappers.lambdaQuery();
|
||||||
wrapper.like(StringUtil.isNotBlank(query.getName()),MetadataCollectEntity::getName,query.getName())
|
wrapper.like(StringUtil.isNotBlank(query.getName()),MetadataCollectEntity::getName,query.getName())
|
||||||
|
@ -34,4 +101,6 @@ public class MetadataCollectServiceImpl extends BaseServiceImpl<MetadataCollectD
|
||||||
dataScopeWithOrgId(wrapper);
|
dataScopeWithOrgId(wrapper);
|
||||||
return wrapper;
|
return wrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
package net.srt.service.impl;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.servers.Server;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import net.srt.dao.MetadataDao;
|
||||||
|
import net.srt.entity.MetadataEntity;
|
||||||
|
import net.srt.framework.mybatis.service.impl.BaseServiceImpl;
|
||||||
|
import net.srt.service.MetadataService;
|
||||||
|
@Server
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class MetadataServiceImpl extends BaseServiceImpl<MetadataDao, MetadataEntity> implements MetadataService {
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
package net.srt.service.impl;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.servers.Server;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import net.srt.dao.MetadataDao;
|
||||||
|
import net.srt.entity.MetadataEntity;
|
||||||
|
import net.srt.framework.mybatis.service.impl.BaseServiceImpl;
|
||||||
|
import net.srt.service.MetadataService;
|
||||||
|
@Server
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class MetadataServiceImpl extends BaseServiceImpl<MetadataDao, MetadataEntity> implements MetadataService {
|
||||||
|
}
|
|
@ -0,0 +1,101 @@
|
||||||
|
package net.srt.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.spring.util.BeanUtils;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import net.srt.convert.QualityConfigCategoryConvert;
|
||||||
|
import net.srt.dao.QualityConfigCategoryDao;
|
||||||
|
import net.srt.dao.QualityConfigDao;
|
||||||
|
import net.srt.entity.QualityConfigCategoryEntity;
|
||||||
|
import net.srt.entity.QualityConfigEntity;
|
||||||
|
import net.srt.framework.common.exception.ServerException;
|
||||||
|
import net.srt.framework.common.utils.BeanUtil;
|
||||||
|
import net.srt.framework.common.utils.BuildTreeUtils;
|
||||||
|
import net.srt.framework.common.utils.TreeNodeVo;
|
||||||
|
import net.srt.framework.mybatis.service.impl.BaseServiceImpl;
|
||||||
|
import net.srt.service.QualityConfigCategoryService;
|
||||||
|
import net.srt.vo.QualityConfigCategoryVo;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import srt.cloud.framework.dbswitch.common.util.StringUtil;
|
||||||
|
import srt.cloud.framework.dbswitch.pgwriter.util.StringUtils;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @BelongsProject: srt_cloud
|
||||||
|
* @BelongsPackage: net.srt.service.impl
|
||||||
|
* @Author: jpz
|
||||||
|
* @CreateTime: 2023/12/24 9:46
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class QualityConfigCategoryServiceimpl extends BaseServiceImpl<QualityConfigCategoryDao, QualityConfigCategoryEntity> implements QualityConfigCategoryService {
|
||||||
|
private final QualityConfigDao qualityConfigDao;
|
||||||
|
@Override
|
||||||
|
public List<TreeNodeVo> listTree() {
|
||||||
|
LambdaQueryWrapper<QualityConfigCategoryEntity> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.eq(QualityConfigCategoryEntity::getProjectId, getProjectId()).orderByAsc(QualityConfigCategoryEntity::getOrderNo);
|
||||||
|
List<QualityConfigCategoryEntity> list = baseMapper.selectList(wrapper);
|
||||||
|
List<TreeNodeVo> tree = BeanUtil.copyListProperties(list,TreeNodeVo::new,(oldItem,newItem)->{
|
||||||
|
newItem.setLabel(oldItem.getName());
|
||||||
|
newItem.setValue(oldItem.getId());
|
||||||
|
if (newItem.getPath().contains("/")){
|
||||||
|
newItem.setParentPath(newItem.getPath().substring(0, newItem.getPath().lastIndexOf("/")));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
return BuildTreeUtils.buildTree(tree);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update(QualityConfigCategoryVo vo) {
|
||||||
|
QualityConfigCategoryEntity entity= QualityConfigCategoryConvert.INSTANCE.convert(vo);
|
||||||
|
entity.setProjectId(getProjectId());
|
||||||
|
entity.setPath(recursionPath(entity,null));
|
||||||
|
updateById(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void save(QualityConfigCategoryVo vo) {
|
||||||
|
QualityConfigCategoryEntity entity= QualityConfigCategoryConvert.INSTANCE.convert(vo);
|
||||||
|
entity.setProjectId(getProjectId());
|
||||||
|
entity.setPath(recursionPath(entity,null));
|
||||||
|
baseMapper.insert(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void delete(Long id) {
|
||||||
|
LambdaQueryWrapper<QualityConfigCategoryEntity> wrapper = Wrappers.lambdaQuery();
|
||||||
|
wrapper.eq(QualityConfigCategoryEntity::getParentId,id).last("'limit 1");
|
||||||
|
QualityConfigCategoryEntity oneChild=baseMapper.selectOne(wrapper);
|
||||||
|
if (oneChild!=null){
|
||||||
|
throw new ServerException("存在子项,不可删除");
|
||||||
|
}
|
||||||
|
LambdaQueryWrapper<QualityConfigEntity> wrapper1 = Wrappers.lambdaQuery();
|
||||||
|
wrapper1.eq(QualityConfigEntity::getCategoryId,id).last("limit 1");
|
||||||
|
QualityConfigEntity qualityConfigEntity=qualityConfigDao.selectOne(wrapper1);
|
||||||
|
if (qualityConfigEntity!=null){
|
||||||
|
throw new ServerException("目录下存在规则配置,不可删除!");
|
||||||
|
}
|
||||||
|
removeById(id);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private String recursionPath(QualityConfigCategoryEntity entity, String path) {
|
||||||
|
if (StringUtil.isBlank(path)){
|
||||||
|
path=entity.getName();
|
||||||
|
}
|
||||||
|
if (entity.getParentId()!=0){
|
||||||
|
QualityConfigCategoryEntity parent=getById(entity.getParentId());
|
||||||
|
path=parent.getName()+"/"+path;
|
||||||
|
return recursionPath(parent,path);
|
||||||
|
}
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,134 @@
|
||||||
|
package net.srt.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.sun.org.apache.bcel.internal.generic.LADD;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import net.srt.api.module.data.governance.constant.BuiltInQualityRule;
|
||||||
|
import net.srt.api.module.data.governance.dto.quality.QualityConfigParam;
|
||||||
|
import net.srt.api.module.quartz.QuartzDataGovernanceQualityApi;
|
||||||
|
import net.srt.convert.QualityConfigConvert;
|
||||||
|
import net.srt.dao.MetadataDao;
|
||||||
|
import net.srt.dao.QualityConfigDao;
|
||||||
|
import net.srt.entity.MetadataEntity;
|
||||||
|
import net.srt.entity.QualityConfigEntity;
|
||||||
|
import net.srt.framework.common.page.PageResult;
|
||||||
|
import net.srt.framework.mybatis.service.impl.BaseServiceImpl;
|
||||||
|
import net.srt.query.QualityConfigQuery;
|
||||||
|
import net.srt.service.QualityConfigService;
|
||||||
|
import net.srt.vo.QualityConfigVo;
|
||||||
|
import org.springframework.security.core.parameters.P;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import srt.cloud.framework.dbswitch.common.util.StringUtil;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @BelongsProject: srt_cloud
|
||||||
|
* @BelongsPackage: net.srt.service.impl
|
||||||
|
* @Author: jpz
|
||||||
|
* @CreateTime: 2023/12/24 19:42
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class QualityConfigServiceimpl extends BaseServiceImpl<QualityConfigDao, QualityConfigEntity> implements QualityConfigService {
|
||||||
|
private final QuartzDataGovernanceQualityApi quartzDataGovernanceQualityApi;
|
||||||
|
private final MetadataDao metadataDao;
|
||||||
|
@Override
|
||||||
|
public PageResult<QualityConfigVo> page(QualityConfigQuery query) {
|
||||||
|
IPage<QualityConfigEntity> page=baseMapper.selectPage(getPage(query),getWrapper(query));
|
||||||
|
return new PageResult<>(QualityConfigConvert.INSTANCE.convertList(page.getRecords()),page.getTotal());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public QualityConfigVo get(Long id) {
|
||||||
|
QualityConfigVo qualityConfigvo= QualityConfigConvert.INSTANCE.convert(baseMapper.selectById(id));
|
||||||
|
List<Integer> metadataIds=qualityConfigvo.getMetadataIds();
|
||||||
|
LambdaQueryWrapper<MetadataEntity> metadataWrapper= Wrappers.lambdaQuery();
|
||||||
|
metadataWrapper.in(MetadataEntity::getId,metadataIds);
|
||||||
|
List<MetadataEntity> metadataEntities=metadataDao.selectList(metadataWrapper);
|
||||||
|
if (CollectionUtils.isEmpty(metadataEntities)){
|
||||||
|
qualityConfigvo.setMetadataStrs("检测字段已删除,请检查数据信息");
|
||||||
|
}else {
|
||||||
|
qualityConfigvo.setMetadataStrs(metadataEntities.stream().map(MetadataEntity::getPath).collect(Collectors.joining(";")));
|
||||||
|
}
|
||||||
|
if (BuiltInQualityRule.ASSOCIATION_CONSISTENCY.getId().equals(qualityConfigvo.getRuleId())){
|
||||||
|
QualityConfigParam param = qualityConfigvo.getParam();
|
||||||
|
Integer columnMetaId = param.getColumnMetaId();
|
||||||
|
MetadataEntity entity = metadataDao.selectById(columnMetaId);
|
||||||
|
if (entity!= null){
|
||||||
|
qualityConfigvo.setRelMetadataStr(entity.getPath());
|
||||||
|
}else {
|
||||||
|
qualityConfigvo.setMetadataStrs("关联字段已被删除,请检查元数据信息");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return qualityConfigvo;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void save(QualityConfigVo vo) {
|
||||||
|
QualityConfigEntity entity=QualityConfigConvert.INSTANCE.convert(vo);
|
||||||
|
entity.setProjectId(getProjectId());
|
||||||
|
if (!BuiltInQualityRule.UNIQUENESS.getId().equals(entity.getRuleId())&&!BuiltInQualityRule.LENGTH_CHECK.getId().equals(entity.getRuleId())&& !BuiltInQualityRule.ASSOCIATION_CONSISTENCY.getId().equals(entity.getRuleId())&&!BuiltInQualityRule.TIMELINESS.getId().equals(entity.getRuleId())){
|
||||||
|
entity.setParam(null);
|
||||||
|
}
|
||||||
|
baseMapper.insert(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update(QualityConfigVo vo) {
|
||||||
|
if (!BuiltInQualityRule.UNIQUENESS.getId().equals(vo.getRuleId())&&!BuiltInQualityRule.LENGTH_CHECK.getId().equals(vo.getRuleId())&&!BuiltInQualityRule.ASSOCIATION_CONSISTENCY.getId().equals(vo.getRuleId())&&!BuiltInQualityRule.TIMELINESS.getId().equals(vo.getRuleId())){
|
||||||
|
vo.setParam(null);
|
||||||
|
}
|
||||||
|
QualityConfigEntity entity=QualityConfigConvert.INSTANCE.convert(vo);
|
||||||
|
entity.setProjectId(getProjectId());
|
||||||
|
updateById(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void online(Long id) {
|
||||||
|
QualityConfigEntity entity=baseMapper.selectById(id);
|
||||||
|
entity.setStatus(1);
|
||||||
|
quartzDataGovernanceQualityApi.release(id);
|
||||||
|
baseMapper.updateById(entity);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void offline(Long id) {
|
||||||
|
QualityConfigEntity entity=baseMapper.selectById(id);
|
||||||
|
entity.setStatus(0);
|
||||||
|
quartzDataGovernanceQualityApi.cancel(id);
|
||||||
|
baseMapper.updateById(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handRun(Long id) {
|
||||||
|
quartzDataGovernanceQualityApi.handRun(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void delete(List<Long> idList) {
|
||||||
|
for (Long id : idList) {
|
||||||
|
quartzDataGovernanceQualityApi.cancel(id);
|
||||||
|
}
|
||||||
|
removeByIds(idList);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<QualityConfigEntity> getWrapper(QualityConfigQuery query) {
|
||||||
|
LambdaQueryWrapper<QualityConfigEntity> wrapper= Wrappers.lambdaQuery();
|
||||||
|
wrapper.eq(query.getCategoryId()!=null,QualityConfigEntity::getCategoryId,query.getCategoryId())
|
||||||
|
.like(StringUtil.isNotBlank(query.getName()),QualityConfigEntity::getName,query.getName())
|
||||||
|
.eq(query.getStatus()!=null,QualityConfigEntity::getStatus,query.getStatus())
|
||||||
|
.eq(query.getTaskType()!=null,QualityConfigEntity::getTaskType,query.getTaskType())
|
||||||
|
.orderByDesc(QualityConfigEntity::getId );
|
||||||
|
return wrapper;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,59 @@
|
||||||
|
package net.srt.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import net.srt.convert.QualityTaskColumnConvert;
|
||||||
|
import net.srt.dao.QualityTaskColumnDao;
|
||||||
|
import net.srt.entity.QualityTaskColumnEntity;
|
||||||
|
import net.srt.framework.common.page.PageResult;
|
||||||
|
import net.srt.framework.mybatis.service.impl.BaseServiceImpl;
|
||||||
|
import net.srt.query.QualityTaskColumnQuery;
|
||||||
|
import net.srt.service.QualityTaskColumnService;
|
||||||
|
import net.srt.vo.QualityTaskColumnVo;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @BelongsProject: srt_cloud
|
||||||
|
* @BelongsPackage: net.srt.service.impl
|
||||||
|
* @Author: jpz
|
||||||
|
* @CreateTime: 2023/12/23 11:37
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class QualityTaskColumnServiceimpl extends BaseServiceImpl<QualityTaskColumnDao, QualityTaskColumnEntity> implements QualityTaskColumnService {
|
||||||
|
|
||||||
|
private final QualityTaskColumnDao taskColumnDao;
|
||||||
|
@Override
|
||||||
|
public PageResult<QualityTaskColumnVo> page(QualityTaskColumnQuery query) {
|
||||||
|
IPage<QualityTaskColumnEntity> page=baseMapper.selectPage(getPage(query),getWrapper(query));
|
||||||
|
//return new PageResult<>(QualityTaskColumnConvert.INSTANCE.convertList(page.getRecords()),page.getTotal());
|
||||||
|
List<QualityTaskColumnVo> qualityTaskColumnVos = QualityTaskColumnConvert.INSTANCE.convertList(page.getRecords());
|
||||||
|
return new PageResult<>(qualityTaskColumnVos,page.getTotal());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void delete(List<Long> idlist) {
|
||||||
|
for (Long id : idlist) {
|
||||||
|
removeById(id);
|
||||||
|
LambdaQueryWrapper<QualityTaskColumnEntity> wrapper= Wrappers.lambdaQuery();
|
||||||
|
wrapper.eq(QualityTaskColumnEntity::getQualityTaskId,id);
|
||||||
|
taskColumnDao.delete(wrapper);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<QualityTaskColumnEntity> getWrapper(QualityTaskColumnQuery query) {
|
||||||
|
LambdaQueryWrapper<QualityTaskColumnEntity> wrapper= Wrappers.lambdaQuery();
|
||||||
|
wrapper.like(query.getQualityTaskTableId()!=null ,QualityTaskColumnEntity::getQualityTaskTableId,query.getQualityTaskTableId())
|
||||||
|
.eq(query.getCheckResult()!=null,QualityTaskColumnEntity::getCheckResult,query.getCheckResult())
|
||||||
|
.orderByDesc(QualityTaskColumnEntity::getId);
|
||||||
|
|
||||||
|
return wrapper;
|
||||||
|
}
|
||||||
|
}
|
|
@ -34,20 +34,30 @@ import java.util.stream.Collectors;
|
||||||
@Service
|
@Service
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class QualityTaskTableServiceimpl extends BaseServiceImpl<QualityTaskTableDao,QualityTaskTableEntity> implements QualityTaskTableService {
|
public class QualityTaskTableServiceimpl extends BaseServiceImpl<QualityTaskTableDao,QualityTaskTableEntity> implements QualityTaskTableService {
|
||||||
|
private final QualityTaskColumnDao taskColumnDao;
|
||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
@Override
|
@Override
|
||||||
public PageResult<QualityTaskTableVo> page(QualityTableQuery query) {
|
public PageResult<QualityTaskTableVo> page(QualityTableQuery query) {
|
||||||
IPage<QualityTaskTableEntity> page=baseMapper.selectPage(getPage(query),getWrapper(query));
|
IPage<QualityTaskTableEntity> page=baseMapper.selectPage(getPage(query),getWrapper(query));
|
||||||
List<QualityTaskTableVo> taskTableVos= QualityTaskTableConvert.INSTANCE.convertList(page.getRecords());
|
List<QualityTaskTableVo> taskTableVos= QualityTaskTableConvert.INSTANCE.convertList(page.getRecords());
|
||||||
for (QualityTaskTableVo taskTableVo : taskTableVos) {
|
for (QualityTaskTableVo taskTableVo : taskTableVos) { taskTableVo.setColumnInfo(SingletonObject.OBJECT_MAPPER.readValue(SingletonObject.OBJECT_MAPPER.writeValueAsString(taskTableVo.getColumnInfo()), new TypeReference<List<QulaityColumn>>() {
|
||||||
taskTableVo.setColumnInfo(SingletonObject.OBJECT_MAPPER.readValue(SingletonObject.OBJECT_MAPPER.writeValueAsString(taskTableVo.getColumnInfo()), new TypeReference<List<QulaityColumn>>() {
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
taskTableVo.setCheckColumns(taskTableVo.getColumnInfo().stream().map(QulaityColumn::getColumnName).collect(Collectors.joining(",")));
|
taskTableVo.setCheckColumns(taskTableVo.getColumnInfo().stream().map(QulaityColumn::getColumnName).collect(Collectors.joining(",")));
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return new PageResult<>(taskTableVos,page.getTotal());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void delete(List<Long> idlist) {
|
||||||
|
for (Long id : idlist) {
|
||||||
|
removeById(id);
|
||||||
|
LambdaQueryWrapper<QualityTaskTableEntity> task=Wrappers.lambdaQuery();
|
||||||
|
task.eq(QualityTaskTableEntity::getQualityTaskId,id);
|
||||||
|
baseMapper.delete(task);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private LambdaQueryWrapper<QualityTaskTableEntity> getWrapper(QualityTableQuery query) {
|
private LambdaQueryWrapper<QualityTaskTableEntity> getWrapper(QualityTableQuery query) {
|
||||||
|
|
|
@ -2,14 +2,22 @@ package net.srt.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
import net.srt.controller.StandardController;
|
||||||
|
import net.srt.convert.StandardConvert;
|
||||||
import net.srt.dao.StandardDao;
|
import net.srt.dao.StandardDao;
|
||||||
import net.srt.entity.StandardEntity;
|
import net.srt.entity.StandardEntity;
|
||||||
|
import net.srt.framework.common.exception.ServerException;
|
||||||
import net.srt.framework.common.utils.BeanUtil;
|
import net.srt.framework.common.utils.BeanUtil;
|
||||||
import net.srt.framework.common.utils.BuildTreeUtils;
|
import net.srt.framework.common.utils.BuildTreeUtils;
|
||||||
import net.srt.framework.common.utils.TreeNodeVo;
|
import net.srt.framework.common.utils.TreeNodeVo;
|
||||||
import net.srt.framework.mybatis.service.impl.BaseServiceImpl;
|
import net.srt.framework.mybatis.service.impl.BaseServiceImpl;
|
||||||
import net.srt.service.StandardService;
|
import net.srt.service.StandardService;
|
||||||
|
import net.srt.utils.CatalogueBuildTreeUtils;
|
||||||
|
import net.srt.vo.StandardManagementVo;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import srt.cloud.framework.dbswitch.common.util.StringUtil;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -24,6 +32,9 @@ import static net.srt.framework.security.user.SecurityUser.getUserId;
|
||||||
@Service
|
@Service
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class StandardServiceImpl extends BaseServiceImpl<StandardDao, StandardEntity> implements StandardService {
|
public class StandardServiceImpl extends BaseServiceImpl<StandardDao, StandardEntity> implements StandardService {
|
||||||
|
@Autowired
|
||||||
|
StandardDao standardDao;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<TreeNodeVo> listTree() {
|
public List<TreeNodeVo> listTree() {
|
||||||
|
@ -39,48 +50,48 @@ public class StandardServiceImpl extends BaseServiceImpl<StandardDao, StandardEn
|
||||||
newItem.setParentPath(newItem.getPath().substring(0, newItem.getPath().lastIndexOf("/")));
|
newItem.setParentPath(newItem.getPath().substring(0, newItem.getPath().lastIndexOf("/")));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return BuildTreeUtils.buildTree(treeNodeVos);
|
return CatalogueBuildTreeUtils.buildTree(treeNodeVos);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void save1(StandardEntity standardEntity) {
|
public void save1(StandardManagementVo vo) {
|
||||||
if (standardEntity.getId() == null) {
|
StandardEntity entity = StandardConvert.INSTANCE.convert(vo);
|
||||||
standardEntity.setCreateTime(new java.util.Date());
|
entity.setPath(recursionPath(entity, null));
|
||||||
standardEntity.setUpdateTime(new java.util.Date());
|
entity.setProjectId(getProjectId());
|
||||||
standardEntity.setDeleted(0);
|
baseMapper.insert(entity);
|
||||||
standardEntity.setVersion(0);
|
|
||||||
standardEntity.setCreator(getUserId());
|
|
||||||
standardEntity.setUpdater(getUserId());
|
|
||||||
baseMapper.insert(standardEntity);
|
|
||||||
} else {
|
|
||||||
standardEntity.setUpdateTime(new java.util.Date());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update1(StandardEntity standardEntity) {
|
public void update1(StandardManagementVo vo) {
|
||||||
if (standardEntity.getId()!= null) {
|
StandardEntity entity = StandardConvert.INSTANCE.convert(vo);
|
||||||
standardEntity.setUpdateTime(new java.util.Date());
|
entity.setPath(recursionPath(entity, null));
|
||||||
standardEntity.setUpdater(getUserId());
|
entity.setProjectId(getProjectId());
|
||||||
baseMapper.updateById(standardEntity);
|
updateById(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private String recursionPath(StandardEntity categoryEntity, String path) {
|
||||||
|
if (StringUtil.isBlank(path)) {
|
||||||
|
path = categoryEntity.getName();
|
||||||
|
}
|
||||||
|
if (categoryEntity.getParentId() != 0) {
|
||||||
|
StandardEntity parent = getById(categoryEntity.getParentId());
|
||||||
|
path = parent.getName() + "/" + path;
|
||||||
|
return recursionPath(parent, path);
|
||||||
|
}
|
||||||
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void del(Long id) {
|
public void delete(Long id) {
|
||||||
//判断是否有子节点
|
//查询有没有子节点
|
||||||
LambdaQueryWrapper<StandardEntity> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<StandardEntity> wrapper = new LambdaQueryWrapper<>();
|
||||||
wrapper.eq(StandardEntity::getParentId, id).last(" limit 1");
|
wrapper.eq(StandardEntity::getParentId, id).last(" limit 1");
|
||||||
if(baseMapper.selectCount(wrapper)!=null){
|
StandardEntity one = baseMapper.selectOne(wrapper);
|
||||||
throw new RuntimeException("请先删除子节点");
|
if (one != null) {
|
||||||
|
throw new ServerException("存在子节点,不允许删除!");
|
||||||
}
|
}
|
||||||
removeById(id);
|
removeById(id);
|
||||||
//删除属性
|
|
||||||
LambdaQueryWrapper<StandardEntity> wrapper1 = new LambdaQueryWrapper<>();
|
|
||||||
wrapper1.eq(StandardEntity::getParentId,id);
|
|
||||||
baseMapper.delete(wrapper1);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,67 @@
|
||||||
|
package net.srt.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import net.srt.convert.StandardStopwatchConvert;
|
||||||
|
import net.srt.dao.StandardStopwatchDao;
|
||||||
|
import net.srt.entity.StandardStopwatchEntity;
|
||||||
|
import net.srt.framework.common.page.PageResult;
|
||||||
|
import net.srt.framework.mybatis.service.impl.BaseServiceImpl;
|
||||||
|
import net.srt.query.StandardStopwatchQuery;
|
||||||
|
import net.srt.service.StandardStopwatchService;
|
||||||
|
import net.srt.vo.StandardStopwatchVo;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import srt.cloud.framework.dbswitch.common.util.StringUtil;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName : StandardStopwatchServiceImpl
|
||||||
|
* @Description :
|
||||||
|
* @Author : FJJ
|
||||||
|
* @Date: 2023-12-24 10:32
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class StandardStopwatchServiceImpl extends BaseServiceImpl<StandardStopwatchDao, StandardStopwatchEntity> implements StandardStopwatchService {
|
||||||
|
private final StandardStopwatchDao standardStopwatchDao;
|
||||||
|
@Override
|
||||||
|
public PageResult<StandardStopwatchVo> page(StandardStopwatchQuery query) {
|
||||||
|
IPage<StandardStopwatchEntity> page = baseMapper.selectPage(getPage(query), getWrapper(query));
|
||||||
|
|
||||||
|
return new PageResult<>(StandardStopwatchConvert.INSTANCE.convertList(page.getRecords()), page.getTotal());
|
||||||
|
}
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<StandardStopwatchEntity> getWrapper(StandardStopwatchQuery query) {
|
||||||
|
LambdaQueryWrapper<StandardStopwatchEntity> wrapper = Wrappers.lambdaQuery();
|
||||||
|
wrapper.eq(query.getStandardId() != null, StandardStopwatchEntity::getStandardId, query.getStandardId())
|
||||||
|
.eq(StringUtil.isNotBlank(query.getDataId()), StandardStopwatchEntity::getDataId, query.getDataId())
|
||||||
|
.eq(StringUtil.isNotBlank(query.getDataName()), StandardStopwatchEntity::getDataName, query.getDataName());
|
||||||
|
return wrapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void save(StandardStopwatchVo vo) {
|
||||||
|
StandardStopwatchEntity entity =StandardStopwatchConvert.INSTANCE.convert(vo);
|
||||||
|
entity.setProjectId(getProjectId());
|
||||||
|
baseMapper.insert(entity);
|
||||||
|
standardStopwatchDao.updateCodeNumByStandardId(vo.getStandardId());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update(StandardStopwatchVo vo) {
|
||||||
|
StandardStopwatchEntity entity = StandardStopwatchConvert.INSTANCE.convert(vo);
|
||||||
|
entity.setProjectId(getProjectId());
|
||||||
|
updateById(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void delete(List<Long> idList) {
|
||||||
|
Long id = idList.get(0);
|
||||||
|
StandardStopwatchEntity standardCodeEntity = baseMapper.selectById(id);
|
||||||
|
removeByIds(idList);
|
||||||
|
standardStopwatchDao.updateCodeNumByStandardId(standardCodeEntity.getStandardId());
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,54 @@
|
||||||
|
package net.srt.utils;
|
||||||
|
|
||||||
|
import net.srt.framework.common.utils.TreeNodeVo;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName : CatalogueBuildTreeUtils
|
||||||
|
* @Description :
|
||||||
|
* @Author : FJJ
|
||||||
|
* @Date: 2023-12-23 12:40
|
||||||
|
*/
|
||||||
|
public class CatalogueBuildTreeUtils {
|
||||||
|
/**
|
||||||
|
* 构建结构树
|
||||||
|
*
|
||||||
|
* @param nodeVos
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static List<TreeNodeVo> buildTree(List<TreeNodeVo> nodeVos) {
|
||||||
|
List<TreeNodeVo> resultVos = new ArrayList<>(10);
|
||||||
|
for (TreeNodeVo node : nodeVos) {
|
||||||
|
// 一级菜单parentId为0
|
||||||
|
if (node.getParentId() == 0) {
|
||||||
|
resultVos.add(node);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 为一级菜单设置子菜单,getChild是递归调用的
|
||||||
|
for (TreeNodeVo node : resultVos) {
|
||||||
|
node.setChildren(getChild(node.getId(), nodeVos));
|
||||||
|
}
|
||||||
|
return resultVos;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static List<TreeNodeVo> getChild(Long id, List<TreeNodeVo> nodeVos) {
|
||||||
|
// 子菜单
|
||||||
|
List<TreeNodeVo> childList = new ArrayList<>(10);
|
||||||
|
for (TreeNodeVo node : nodeVos) {
|
||||||
|
// 遍历所有节点,将父菜单id与传过来的id比较
|
||||||
|
if (node.getParentId() != 0) {
|
||||||
|
if (node.getParentId().equals(id)) {
|
||||||
|
childList.add(node);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 把子菜单的子菜单再循环一遍
|
||||||
|
for (TreeNodeVo node : childList) {
|
||||||
|
node.setChildren(getChild(node.getId(), nodeVos));
|
||||||
|
}
|
||||||
|
return childList;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,49 @@
|
||||||
|
package net.srt.vo;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName : DatastandardVo
|
||||||
|
* @Description :
|
||||||
|
* @Author : FJJ
|
||||||
|
* @Date: 2023-12-23 12:05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(description = "标准管理查询")
|
||||||
|
public class DatastandardVo implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
@TableId("id")
|
||||||
|
private Long id;
|
||||||
|
private Integer categoryId;
|
||||||
|
private String engName;
|
||||||
|
private String cnName;
|
||||||
|
private Integer codeNum;
|
||||||
|
private String dataType;
|
||||||
|
private Integer dataLength;
|
||||||
|
private Integer dataPrecision;
|
||||||
|
private Integer nullable;
|
||||||
|
private Integer standardCodeId;
|
||||||
|
private Integer type;
|
||||||
|
private String note;
|
||||||
|
private Long projectId;
|
||||||
|
private Integer status;
|
||||||
|
private Integer version;
|
||||||
|
private Integer deleted;
|
||||||
|
private String creator;
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private Date createTime;
|
||||||
|
private String updater;
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private Date updateTime;
|
||||||
|
private Integer ifStandardRel;
|
||||||
|
private String group;
|
||||||
|
}
|
|
@ -0,0 +1,84 @@
|
||||||
|
package net.srt.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import net.srt.framework.common.utils.DateUtils;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @BelongsProject: srt_cloud
|
||||||
|
* @BelongsPackage: net.srt.vo
|
||||||
|
* @Author: jpz
|
||||||
|
* @CreateTime: 2023/12/24 15:37
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(description = "数据治理-元数据")
|
||||||
|
public class MetadataVo implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "主键id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "父级id(默认0为顶级)")
|
||||||
|
private Long parentId;
|
||||||
|
|
||||||
|
@Schema(description = "树状节点的路径")
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
@Schema(description = "节点名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "节点英文名称")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
private String icon;
|
||||||
|
|
||||||
|
private Integer ifLeaf;
|
||||||
|
|
||||||
|
@Schema(description = "对应的元模型id")
|
||||||
|
private Long metamodelId;
|
||||||
|
|
||||||
|
@Schema(description = "详情")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@Schema(description = "数据库类型(1-数据库 2-中台库)")
|
||||||
|
private Integer dbType;
|
||||||
|
|
||||||
|
@Schema(description = "如果是外部系统接入的库表,需要此字段")
|
||||||
|
private Long datasourceId;
|
||||||
|
|
||||||
|
@Schema(description = "采集任务id")
|
||||||
|
private Long collectTaskId;
|
||||||
|
|
||||||
|
@Schema(description = "项目id(租户id)")
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
private Integer orderNo;
|
||||||
|
|
||||||
|
@Schema(description = "版本号")
|
||||||
|
private Integer version;
|
||||||
|
|
||||||
|
@Schema(description = "删除标识 0:正常 1:已删除")
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@Schema(description = "创建者")
|
||||||
|
private Long creator;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@Schema(description = "更新者")
|
||||||
|
private Long updater;
|
||||||
|
|
||||||
|
@Schema(description = "更新时间")
|
||||||
|
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
@Schema(description = "元数据属性列表")
|
||||||
|
private List<MetamodelPropertyVO> properties;
|
||||||
|
}
|
|
@ -0,0 +1,66 @@
|
||||||
|
package net.srt.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import net.srt.framework.common.utils.DateUtils;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @BelongsProject: srt_cloud
|
||||||
|
* @BelongsPackage: net.srt.vo
|
||||||
|
* @Author: jpz
|
||||||
|
* @CreateTime: 2023/12/24 10:22
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(description = "数据治理-规则配置目录")
|
||||||
|
public class QualityConfigCategoryVo implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "主键id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "0-普通目录 1-规则配置目录")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@Schema(description = "父级id(顶级为0)")
|
||||||
|
private Long parentId;
|
||||||
|
|
||||||
|
@Schema(description = "目录名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "目录路径")
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
@Schema(description = "序号")
|
||||||
|
private Integer orderNo;
|
||||||
|
|
||||||
|
@Schema(description = "描述")
|
||||||
|
private String note;
|
||||||
|
|
||||||
|
@Schema(description = "项目(租户)id")
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
@Schema(description = "版本号")
|
||||||
|
private Integer version;
|
||||||
|
|
||||||
|
@Schema(description = "删除标识 0:正常 1:已删除")
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@Schema(description = "创建者")
|
||||||
|
private Long creator;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@Schema(description = "更新者")
|
||||||
|
private Long updater;
|
||||||
|
|
||||||
|
@Schema(description = "更新时间")
|
||||||
|
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,81 @@
|
||||||
|
package net.srt.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import net.srt.api.module.data.governance.dto.quality.QualityConfigParam;
|
||||||
|
import net.srt.framework.common.utils.DateUtils;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @BelongsProject: srt_cloud
|
||||||
|
* @BelongsPackage: net.srt.vo
|
||||||
|
* @Author: jpz
|
||||||
|
* @CreateTime: 2023/12/24 19:35
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(description = "数据治理-质量规则配置")
|
||||||
|
public class QualityConfigVo implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "自增id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
private Long categoryId;
|
||||||
|
|
||||||
|
@Schema(description = "名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "规则id")
|
||||||
|
private Integer ruleId;
|
||||||
|
|
||||||
|
@Schema(description = "个性化参数json")
|
||||||
|
private QualityConfigParam param;
|
||||||
|
@Schema(description = "当选择的规则类型为关联一致性的时候,返回此字段(前台用)")
|
||||||
|
private String relMetadataStr;
|
||||||
|
|
||||||
|
@Schema(description = "元数据字段列表")
|
||||||
|
private List<Integer> metadataIds;
|
||||||
|
@Schema(description = "检测的元数据字段信息字符串(前台用)")
|
||||||
|
private String metadataStrs;
|
||||||
|
|
||||||
|
@Schema(description = "状态,1-启用,0-关闭")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@Schema(description = "任务类型,1-一次性任务,2-周期任务")
|
||||||
|
private Integer taskType;
|
||||||
|
|
||||||
|
@Schema(description = "cron表达式")
|
||||||
|
private String cron;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String note;
|
||||||
|
|
||||||
|
@Schema(description = "项目id")
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
@Schema(description = "版本号")
|
||||||
|
private Integer version;
|
||||||
|
|
||||||
|
@Schema(description = "删除标识 0:正常 1:已删除")
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@Schema(description = "创建者")
|
||||||
|
private Long creator;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@Schema(description = "更新者")
|
||||||
|
private Long updater;
|
||||||
|
|
||||||
|
@Schema(description = "更新时间")
|
||||||
|
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,65 @@
|
||||||
|
package net.srt.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import net.srt.framework.common.utils.DateUtils;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @BelongsProject: srt_cloud
|
||||||
|
* @BelongsPackage: net.srt.vo
|
||||||
|
* @Author: jpz
|
||||||
|
* @CreateTime: 2023/12/23 11:22
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(description = "数据治理-字段检测记录")
|
||||||
|
public class QualityTaskColumnVo implements Serializable {
|
||||||
|
@Schema(description = "主键id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "质量任务id")
|
||||||
|
private Long qualityTaskId;
|
||||||
|
|
||||||
|
@Schema(description = "表检测记录id")
|
||||||
|
private Long qualityTaskTableId;
|
||||||
|
|
||||||
|
@Schema(description = "被检测的数据行")
|
||||||
|
private String checkRow;
|
||||||
|
|
||||||
|
@Schema(description = "未通过详情")
|
||||||
|
private String notPassInfo;
|
||||||
|
|
||||||
|
@Schema(description = "检测时间")
|
||||||
|
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||||
|
private Date checkTime;
|
||||||
|
|
||||||
|
@Schema(description = "0-不通过 1-通过")
|
||||||
|
private Integer checkResult;
|
||||||
|
|
||||||
|
@Schema(description = "项目id")
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
@Schema(description = "版本号")
|
||||||
|
private Integer version;
|
||||||
|
|
||||||
|
@Schema(description = "删除标识 0:正常 1:已删除")
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@Schema(description = "创建者")
|
||||||
|
private Long creator;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@Schema(description = "更新者")
|
||||||
|
private Long updater;
|
||||||
|
|
||||||
|
@Schema(description = "更新时间")
|
||||||
|
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
}
|
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import net.srt.framework.common.utils.DateUtils;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
@ -16,34 +17,49 @@ import java.util.Date;
|
||||||
* @Date: 2023-12-20 11:24
|
* @Date: 2023-12-20 11:24
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Schema(description = "标准管理查询")
|
@Schema(description = "目录表")
|
||||||
public class StandardManagementVo implements Serializable {
|
public class StandardManagementVo implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@TableId("id")
|
|
||||||
|
@Schema(description = "主键id")
|
||||||
private Long id;
|
private Long id;
|
||||||
private Integer categoryId;
|
|
||||||
private String engName;
|
@Schema(description = "父级id(顶级为0)")
|
||||||
private String cnName;
|
private Long parentId;
|
||||||
private Integer codeNum;
|
@Schema(description = "0-文件夹 1-文件目录")
|
||||||
private String dataType;
|
|
||||||
private Integer dataLength;
|
|
||||||
private Integer dataPrecision;
|
|
||||||
private Integer nullable;
|
|
||||||
private Integer standardCodeId;
|
|
||||||
private Integer type;
|
private Integer type;
|
||||||
private String note;
|
@Schema(description = "分组名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "分组序号")
|
||||||
|
private Integer orderNo;
|
||||||
|
|
||||||
|
@Schema(description = "描述")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@Schema(description = "分组路径")
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
@Schema(description = "项目id")
|
||||||
private Long projectId;
|
private Long projectId;
|
||||||
private Integer status;
|
|
||||||
|
@Schema(description = "版本号")
|
||||||
private Integer version;
|
private Integer version;
|
||||||
|
|
||||||
|
@Schema(description = "删除标识 0:正常 1:已删除")
|
||||||
private Integer deleted;
|
private Integer deleted;
|
||||||
private String creator;
|
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@Schema(description = "创建者")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
private Long creator;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
private String updater;
|
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@Schema(description = "更新者")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
private Long updater;
|
||||||
|
|
||||||
|
@Schema(description = "更新时间")
|
||||||
|
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
private Integer ifStandardRel;
|
|
||||||
private String group;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,56 @@
|
||||||
|
package net.srt.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import net.srt.framework.common.utils.DateUtils;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName : StandardStopwatchVo
|
||||||
|
* @Description :
|
||||||
|
* @Author : FJJ
|
||||||
|
* @Date: 2023-12-24 10:26
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(description = "数据治理-标准码表数据")
|
||||||
|
public class StandardStopwatchVo implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "主键id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "标准码表id")
|
||||||
|
private Long standardId;
|
||||||
|
|
||||||
|
@Schema(description = "码表数据的id")
|
||||||
|
private String dataId;
|
||||||
|
|
||||||
|
@Schema(description = "码表数据的name")
|
||||||
|
private String dataName;
|
||||||
|
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
@Schema(description = "版本号")
|
||||||
|
private Integer version;
|
||||||
|
|
||||||
|
@Schema(description = "删除标识 0:正常 1:已删除")
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@Schema(description = "创建者")
|
||||||
|
private Long creator;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@Schema(description = "更新者")
|
||||||
|
private Long updater;
|
||||||
|
|
||||||
|
@Schema(description = "更新时间")
|
||||||
|
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
|
||||||
|
<mapper namespace="net.srt.dao.MetadataPropertyDao">
|
||||||
|
|
||||||
|
|
||||||
|
<select id="listPropertyById" resultType="net.srt.vo.MetamodelPropertyVO">
|
||||||
|
SELECT mo.id,mo.metamodel_id,mo.id AS metamodel_property_id,mo.name,mo.code,mo.data_type,mo.data_length,mo.input_type,mo.nullable,mo.builtin,md.id as metadata_property_id,md.property as `value` FROM data_governance_metamodel_property mo
|
||||||
|
LEFT JOIN data_governance_metadata_property md ON mo.id=md.metamodel_property_id AND md.metadata_id=#{id}
|
||||||
|
WHERE mo.metamodel_id=#{metamodelId} AND mo.deleted=0 AND md.deleted=0 order by mo.order_no
|
||||||
|
</select>
|
||||||
|
</mapper>
|
|
@ -0,0 +1,14 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="net.srt.dao.StandardStopwatchDao">
|
||||||
|
|
||||||
|
|
||||||
|
<update id="updateCodeNumByStandardId">
|
||||||
|
UPDATE data_governance_standard SET code_num=(SELECT COUNT(1)
|
||||||
|
FROM data_governance_standard_code
|
||||||
|
WHERE standard_id=#{standardId} AND deleted=0)
|
||||||
|
WHERE id=#{standardId}
|
||||||
|
</update>
|
||||||
|
</mapper>
|
|
@ -79,6 +79,12 @@
|
||||||
<groupId>io.minio</groupId>
|
<groupId>io.minio</groupId>
|
||||||
<artifactId>minio</artifactId>
|
<artifactId>minio</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.ant</groupId>
|
||||||
|
<artifactId>ant</artifactId>
|
||||||
|
<version>1.9.1</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
|
@ -0,0 +1,84 @@
|
||||||
|
package net.srt.controller;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import net.srt.convert.DataServiceAppConvert;
|
||||||
|
import net.srt.entity.DataServiceAppEntity;
|
||||||
|
import net.srt.framework.common.page.PageResult;
|
||||||
|
import net.srt.framework.common.utils.Result;
|
||||||
|
import net.srt.query.DataServiceAppQuery;
|
||||||
|
import net.srt.service.DataServiceAppService;
|
||||||
|
import net.srt.vo.DataServiceAppVo;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName : DataServiceAppController
|
||||||
|
* @Description :
|
||||||
|
* @Author : FJJ
|
||||||
|
* @Date: 2023-12-23 08:53
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/app")
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class DataServiceAppController {
|
||||||
|
private final DataServiceAppService dataServiceAppService;
|
||||||
|
|
||||||
|
@GetMapping("page")
|
||||||
|
@Operation(summary = "分页")
|
||||||
|
public Result<PageResult<DataServiceAppVo> > page(@Valid DataServiceAppQuery query) {
|
||||||
|
PageResult<DataServiceAppVo> pageResult = dataServiceAppService.page(query);
|
||||||
|
return Result.ok(pageResult);
|
||||||
|
}
|
||||||
|
@GetMapping("{id}")
|
||||||
|
@Operation(summary = "信息")
|
||||||
|
public Result<DataServiceAppVo> get(@PathVariable("id") Long id){
|
||||||
|
DataServiceAppEntity dataServiceAppEntity = dataServiceAppService.getById(id);
|
||||||
|
return Result.ok(DataServiceAppConvert.INSTANCE.convert(dataServiceAppEntity));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping
|
||||||
|
@Operation(summary = "保存")
|
||||||
|
public Result<String> save(@RequestBody DataServiceAppVo vo){
|
||||||
|
dataServiceAppService.save1(vo);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping
|
||||||
|
@Operation(summary = "修改")
|
||||||
|
public Result<String> update(@RequestBody @Valid DataServiceAppVo vo){
|
||||||
|
dataServiceAppService.update1(vo);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping
|
||||||
|
@Operation(summary = "删除")
|
||||||
|
public Result<String> delete(@RequestBody List<Long> idList){
|
||||||
|
dataServiceAppService.delete(idList);
|
||||||
|
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/auth")
|
||||||
|
@Operation(summary = "添加授权")
|
||||||
|
public Result<String> addAuth(@RequestBody DataServiceAppVo authVO){
|
||||||
|
dataServiceAppService.addAuth(authVO);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/auth")
|
||||||
|
@Operation(summary = "修改授权")
|
||||||
|
public Result<String> upAuth(@RequestBody DataServiceAppVo authVO){
|
||||||
|
dataServiceAppService.upAuth(authVO);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/cancel-auth/{authId}")
|
||||||
|
@Operation(summary = "取消授权")
|
||||||
|
public Result<String> cancelAuth(@PathVariable Long authId){
|
||||||
|
dataServiceAppService.cancelAuth(authId);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
package net.srt.convert;
|
||||||
|
|
||||||
|
import net.srt.entity.DataServiceAppEntity;
|
||||||
|
import net.srt.vo.DataServiceAppVo;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName : DataServiceAppConvert
|
||||||
|
* @Description :
|
||||||
|
* @Author : FJJ
|
||||||
|
* @Date: 2023-12-23 09:06
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface DataServiceAppConvert {
|
||||||
|
DataServiceAppConvert INSTANCE = Mappers.getMapper(DataServiceAppConvert.class);
|
||||||
|
|
||||||
|
DataServiceAppEntity convert(DataServiceAppVo vo);
|
||||||
|
|
||||||
|
DataServiceAppVo convert(DataServiceAppEntity entity);
|
||||||
|
|
||||||
|
List<DataServiceAppVo> convertList(List<DataServiceAppEntity> list);
|
||||||
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
package net.srt.dao;
|
||||||
|
|
||||||
|
import net.srt.entity.DataServiceAppEntity;
|
||||||
|
import net.srt.framework.mybatis.dao.BaseDao;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName : DataServiceAppDao
|
||||||
|
* @Description :
|
||||||
|
* @Author : FJJ
|
||||||
|
* @Date: 2023-12-23 08:59
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface DataServiceAppDao extends BaseDao<DataServiceAppEntity> {
|
||||||
|
DataServiceAppEntity selectByApplyId(@Param("applyId") Long applyId);
|
||||||
|
}
|
|
@ -0,0 +1,70 @@
|
||||||
|
//package net.srt.entity;
|
||||||
|
//
|
||||||
|
//import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||||
|
//import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
||||||
|
//import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
//import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
//import lombok.Data;
|
||||||
|
//import lombok.EqualsAndHashCode;
|
||||||
|
//import net.srt.framework.mybatis.entity.BaseEntity;
|
||||||
|
//
|
||||||
|
//import java.util.Date;
|
||||||
|
//
|
||||||
|
///**
|
||||||
|
// * @ClassName : DataServiceApiAuthEnitiy
|
||||||
|
// * @Description :
|
||||||
|
// * @Author : FJJ
|
||||||
|
// * @Date: 2023-12-24 11:30
|
||||||
|
// */
|
||||||
|
//@EqualsAndHashCode(callSuper=false)
|
||||||
|
//@Data
|
||||||
|
//@TableName("data_service_api_auth1")
|
||||||
|
//public class DataServiceApiAuthEnitiy extends BaseEntity {
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * app的id
|
||||||
|
// */
|
||||||
|
// private Long appId;
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 分组id
|
||||||
|
// */
|
||||||
|
// private Long groupId;
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * api的id
|
||||||
|
// */
|
||||||
|
// private Long apiId;
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 调用次数 不限次数为-1
|
||||||
|
// */
|
||||||
|
// private Integer requestTimes;
|
||||||
|
//
|
||||||
|
// @TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||||
|
// private Date startTime;
|
||||||
|
// @TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||||
|
// private Date endTime;
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 已调用次数
|
||||||
|
// */
|
||||||
|
// @TableField(updateStrategy = FieldStrategy.NEVER)
|
||||||
|
// private Integer requestedTimes;
|
||||||
|
// @TableField(updateStrategy = FieldStrategy.NEVER)
|
||||||
|
// private Integer requestedSuccessTimes;
|
||||||
|
// @TableField(updateStrategy = FieldStrategy.NEVER)
|
||||||
|
// private Integer requestedFailedTimes;
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 所属项目id
|
||||||
|
// */
|
||||||
|
// private Long projectId;
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 真删
|
||||||
|
// */
|
||||||
|
// @TableField(fill = FieldFill.INSERT)
|
||||||
|
// private Integer deleted;
|
||||||
|
//
|
||||||
|
//}
|
|
@ -0,0 +1,65 @@
|
||||||
|
package net.srt.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||||
|
import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import net.srt.framework.mybatis.entity.BaseEntity;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName : DataServiceApppEntity
|
||||||
|
* @Description :
|
||||||
|
* @Author : FJJ
|
||||||
|
* @Date: 2023-12-23 08:46
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Data
|
||||||
|
@TableName("data_service_app")
|
||||||
|
public class DataServiceAppEntity extends BaseEntity {
|
||||||
|
/**
|
||||||
|
* 名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String note;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* app_key
|
||||||
|
*/
|
||||||
|
private String appKey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* app_secret
|
||||||
|
*/
|
||||||
|
private String appSecret;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 过期描述
|
||||||
|
*/
|
||||||
|
private String expireDesc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 过期时间 -1永久;0 单次失效;> 0 失效时间
|
||||||
|
*/
|
||||||
|
private Long expireDuration;
|
||||||
|
|
||||||
|
private Integer ifMarket;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属项目id
|
||||||
|
*/
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
package net.srt.query;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import net.srt.framework.common.query.Query;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName : DataServiceAppQuery
|
||||||
|
* @Description :
|
||||||
|
* @Author : FJJ
|
||||||
|
* @Date: 2023-12-23 08:51
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Schema(defaultValue = "app权限")
|
||||||
|
public class DataServiceAppQuery extends Query {
|
||||||
|
private String name;
|
||||||
|
private String appKey;
|
||||||
|
private Integer ifMarket;
|
||||||
|
private Boolean ifInfo;
|
||||||
|
private Long applyId;
|
||||||
|
}
|
|
@ -0,0 +1,31 @@
|
||||||
|
package net.srt.service;
|
||||||
|
|
||||||
|
import net.srt.entity.DataServiceAppEntity;
|
||||||
|
import net.srt.framework.common.page.PageResult;
|
||||||
|
import net.srt.framework.mybatis.service.BaseService;
|
||||||
|
import net.srt.query.DataServiceAppQuery;
|
||||||
|
import net.srt.vo.DataServiceAppVo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName : DataServiceAppService
|
||||||
|
* @Description :
|
||||||
|
* @Author : FJJ
|
||||||
|
* @Date: 2023-12-23 08:53
|
||||||
|
*/
|
||||||
|
public interface DataServiceAppService extends BaseService<DataServiceAppEntity> {
|
||||||
|
PageResult<DataServiceAppVo> page(DataServiceAppQuery query);
|
||||||
|
|
||||||
|
void save1(DataServiceAppVo vo);
|
||||||
|
|
||||||
|
void update1(DataServiceAppVo vo);
|
||||||
|
|
||||||
|
void delete(List<Long> idList);
|
||||||
|
|
||||||
|
void addAuth(DataServiceAppVo authVO);
|
||||||
|
|
||||||
|
void upAuth(DataServiceAppVo authVO);
|
||||||
|
|
||||||
|
void cancelAuth(Long authId);
|
||||||
|
}
|
|
@ -0,0 +1,84 @@
|
||||||
|
package net.srt.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import net.srt.convert.DataServiceAppConvert;
|
||||||
|
import net.srt.dao.DataServiceAppDao;
|
||||||
|
import net.srt.entity.DataServiceAppEntity;
|
||||||
|
import net.srt.framework.common.exception.ServerException;
|
||||||
|
import net.srt.framework.common.page.PageResult;
|
||||||
|
import net.srt.framework.mybatis.service.impl.BaseServiceImpl;
|
||||||
|
import net.srt.framework.security.user.SecurityUser;
|
||||||
|
import net.srt.query.DataServiceAppQuery;
|
||||||
|
import net.srt.service.DataServiceAppService;
|
||||||
|
import net.srt.vo.DataServiceAppVo;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import srt.cloud.framework.dbswitch.common.util.StringUtil;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName : DataServiceAppServiceImpl
|
||||||
|
* @Description :
|
||||||
|
* @Author : FJJ
|
||||||
|
* @Date: 2023-12-23 08:53
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class DataServiceAppServiceImpl extends BaseServiceImpl<DataServiceAppDao, DataServiceAppEntity> implements DataServiceAppService {
|
||||||
|
private final DataServiceAppDao dataServiceAppDao;
|
||||||
|
@Override
|
||||||
|
public PageResult<DataServiceAppVo> page(DataServiceAppQuery query) {
|
||||||
|
IPage<DataServiceAppEntity> page=baseMapper.selectPage(getPage(query),null);
|
||||||
|
return new PageResult<>(DataServiceAppConvert.INSTANCE.convertList(page.getRecords()),page.getTotal());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void save1(DataServiceAppVo vo) {
|
||||||
|
DataServiceAppEntity app = DataServiceAppConvert.INSTANCE.convert(vo);
|
||||||
|
baseMapper.insert(app);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update1(DataServiceAppVo vo) {
|
||||||
|
DataServiceAppEntity app = DataServiceAppConvert.INSTANCE.convert(vo);
|
||||||
|
updateById(app);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void delete(List<Long> idList) {
|
||||||
|
removeByIds(idList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addAuth(DataServiceAppVo authVO) {
|
||||||
|
authVO.setProjectId(getProjectId());
|
||||||
|
dataServiceAppDao.insert(DataServiceAppConvert.INSTANCE.convert(authVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void upAuth(DataServiceAppVo authVO) {
|
||||||
|
dataServiceAppDao.updateById(DataServiceAppConvert.INSTANCE.convert(authVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void cancelAuth(Long authId) {
|
||||||
|
dataServiceAppDao.deleteById(authId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// private LambdaQueryWrapper<DataServiceAppEntity> getWrapper(DataServiceAppQuery query) {
|
||||||
|
// LambdaQueryWrapper<DataServiceAppEntity> wrapper = Wrappers.lambdaQuery();
|
||||||
|
// wrapper.like(StringUtil.isNotBlank(query.getName()), DataServiceAppEntity::getName, query.getName())
|
||||||
|
// .eq(DataServiceAppEntity::getIfMarket, query.getIfMarket() != null ? query.getIfMarket() : 0)
|
||||||
|
// .eq(query.getIfMarket() != null, DataServiceAppEntity::getCreator, SecurityUser.getUserId())
|
||||||
|
// .eq(StringUtil.isNotBlank(query.getAppKey()), DataServiceAppEntity::getAppKey, query.getAppKey())
|
||||||
|
// .orderByDesc(DataServiceAppEntity::getCreateTime).orderByDesc(DataServiceAppEntity::getId);
|
||||||
|
// return wrapper;
|
||||||
|
// }
|
||||||
|
}
|
|
@ -0,0 +1,70 @@
|
||||||
|
package net.srt.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import net.srt.framework.common.utils.DateUtils;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName : DataServiceApiAuthVo
|
||||||
|
* @Description :
|
||||||
|
* @Author : FJJ
|
||||||
|
* @Date: 2023-12-24 11:29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(description = "数据服务-权限关联表")
|
||||||
|
public class DataServiceApiAuthVo implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "主键id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "app的id")
|
||||||
|
private Long appId;
|
||||||
|
|
||||||
|
@Schema(description = "分组id")
|
||||||
|
private Long groupId;
|
||||||
|
|
||||||
|
@Schema(description = "api的id")
|
||||||
|
private Long apiId;
|
||||||
|
|
||||||
|
@Schema(description = "调用次数 不限次数为-1")
|
||||||
|
private Integer requestTimes;
|
||||||
|
|
||||||
|
@Schema(description = "已调用次数")
|
||||||
|
private Integer requestedTimes;
|
||||||
|
private Integer requestedSuccessTimes;
|
||||||
|
private Integer requestedFailedTimes;
|
||||||
|
|
||||||
|
@Schema(description = "所属项目id")
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
@Schema(description = "版本号")
|
||||||
|
private Integer version;
|
||||||
|
|
||||||
|
@Schema(description = "删除标识 0:正常 1:已删除")
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@Schema(description = "创建者")
|
||||||
|
private Long creator;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@Schema(description = "更新者")
|
||||||
|
private Long updater;
|
||||||
|
|
||||||
|
@Schema(description = "更新时间")
|
||||||
|
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||||
|
private Date startTime;
|
||||||
|
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||||
|
private Date endTime;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,70 @@
|
||||||
|
package net.srt.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import net.srt.framework.common.utils.DateUtils;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName : DataServiceAppVo
|
||||||
|
* @Description :
|
||||||
|
* @Author : FJJ
|
||||||
|
* @Date: 2023-12-22 21:21
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(defaultValue = "app权限")
|
||||||
|
public class DataServiceAppVo implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "主键id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String note;
|
||||||
|
|
||||||
|
@Schema(description = "app_key")
|
||||||
|
private String appKey;
|
||||||
|
|
||||||
|
@Schema(description = "app_secret")
|
||||||
|
private String appSecret;
|
||||||
|
|
||||||
|
@Schema(description = "过期描述")
|
||||||
|
private String expireDesc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 过期时间 -1永久;0 单次失效;> 0 失效时间
|
||||||
|
*/
|
||||||
|
private Long expireDuration;
|
||||||
|
|
||||||
|
private Integer ifMarket;
|
||||||
|
|
||||||
|
@Schema(description = "所属项目id")
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
@Schema(description = "版本号")
|
||||||
|
private Integer version;
|
||||||
|
|
||||||
|
@Schema(description = "删除标识 0:正常 1:已删除")
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@Schema(description = "创建者")
|
||||||
|
private Long creator;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@Schema(description = "更新者")
|
||||||
|
private Long updater;
|
||||||
|
|
||||||
|
@Schema(description = "更新时间")
|
||||||
|
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="net.srt.dao.DataServiceAppDao">
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectByApplyId" resultType="net.srt.entity.DataServiceAppEntity">
|
||||||
|
SELECT dsa.* FROM data_service_app dsa INNER JOIN data_market_resource_apply dmra ON dsa.id=dmra.app_id WHERE dmra.id=#{applyId}
|
||||||
|
</select>
|
||||||
|
</mapper>
|
Binary file not shown.
|
@ -0,0 +1,67 @@
|
||||||
|
package net.srt.quartz.api;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import net.srt.api.module.data.governance.DataMetadataCollectApi;
|
||||||
|
import net.srt.api.module.data.governance.constant.MetadataCollectType;
|
||||||
|
import net.srt.api.module.data.governance.dto.DataGovernanceMetadataCollectDto;
|
||||||
|
import net.srt.api.module.quartz.QuartzDataGovernanceMetadataCollectApi;
|
||||||
|
import net.srt.api.module.quartz.constant.QuartzJobType;
|
||||||
|
import net.srt.framework.common.utils.Result;
|
||||||
|
import net.srt.quartz.entity.ScheduleJobEntity;
|
||||||
|
import net.srt.quartz.enums.JobGroupEnum;
|
||||||
|
import net.srt.quartz.enums.ScheduleConcurrentEnum;
|
||||||
|
import net.srt.quartz.enums.ScheduleStatusEnum;
|
||||||
|
import net.srt.quartz.service.ScheduleJobService;
|
||||||
|
import net.srt.quartz.utils.ScheduleUtils;
|
||||||
|
import org.quartz.Scheduler;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 短信服务API
|
||||||
|
*
|
||||||
|
* @author 阿沐 babamu@126.com
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class QuartzDataGovernanceMetadataCollectApiImpl implements QuartzDataGovernanceMetadataCollectApi {
|
||||||
|
|
||||||
|
private final Scheduler scheduler;
|
||||||
|
private final DataMetadataCollectApi dataMetadataCollectApi;
|
||||||
|
private final ScheduleJobService jobService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result<String> release(Long id) {
|
||||||
|
ScheduleJobEntity jobEntity = buildJobEntity(id);
|
||||||
|
//判断是否存在,不存在,新增,存在,设置主键
|
||||||
|
jobService.buildSystemJob(jobEntity);
|
||||||
|
ScheduleUtils.createScheduleJob(scheduler, jobEntity);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result<String> cancel(Long id) {
|
||||||
|
ScheduleJobEntity jobEntity = buildJobEntity(id);
|
||||||
|
jobService.buildSystemJob(jobEntity);
|
||||||
|
ScheduleUtils.deleteScheduleJob(scheduler, jobEntity);
|
||||||
|
//更新任务状态为暂停
|
||||||
|
jobService.pauseSystemJob(jobEntity);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result<String> handRun(Long id) {
|
||||||
|
ScheduleJobEntity jobEntity = buildJobEntity(id);
|
||||||
|
jobEntity.setOnce(true);
|
||||||
|
jobEntity.setSaveLog(false);
|
||||||
|
ScheduleUtils.run(scheduler, jobEntity);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
private ScheduleJobEntity buildJobEntity(Long id) {
|
||||||
|
DataGovernanceMetadataCollectDto collectDto = dataMetadataCollectApi.getById(id).getData();
|
||||||
|
return ScheduleJobEntity.builder().typeId(id).projectId(collectDto.getProjectId()).jobType(QuartzJobType.DATA_GOVERNANCE.getValue()).jobName(String.format("[%s]%s", id.toString(), collectDto.getName())).concurrent(ScheduleConcurrentEnum.NO.getValue())
|
||||||
|
.beanName("dataGovernanceMetadataCollectTask").method("run").jobGroup(JobGroupEnum.DATA_GOVERNANCE.getValue()).saveLog(true).cronExpression(collectDto.getCron()).status(ScheduleStatusEnum.NORMAL.getValue())
|
||||||
|
.params(String.valueOf(id)).once(MetadataCollectType.ONCE.getValue().equals(collectDto.getTaskType())).build();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,67 @@
|
||||||
|
package net.srt.quartz.api;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import net.srt.api.module.data.governance.DataQualityApi;
|
||||||
|
import net.srt.api.module.data.governance.constant.MetadataCollectType;
|
||||||
|
import net.srt.api.module.data.governance.dto.DataGovernanceQualityConfigDto;
|
||||||
|
import net.srt.api.module.quartz.QuartzDataGovernanceQualityApi;
|
||||||
|
import net.srt.api.module.quartz.constant.QuartzJobType;
|
||||||
|
import net.srt.framework.common.utils.Result;
|
||||||
|
import net.srt.quartz.entity.ScheduleJobEntity;
|
||||||
|
import net.srt.quartz.enums.JobGroupEnum;
|
||||||
|
import net.srt.quartz.enums.ScheduleConcurrentEnum;
|
||||||
|
import net.srt.quartz.enums.ScheduleStatusEnum;
|
||||||
|
import net.srt.quartz.service.ScheduleJobService;
|
||||||
|
import net.srt.quartz.utils.ScheduleUtils;
|
||||||
|
import org.quartz.Scheduler;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 短信服务API
|
||||||
|
*
|
||||||
|
* @author 阿沐 babamu@126.com
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class QuartzDataGovernanceQualityApiImpl implements QuartzDataGovernanceQualityApi {
|
||||||
|
|
||||||
|
private final Scheduler scheduler;
|
||||||
|
private final DataQualityApi dataQualityApi;
|
||||||
|
private final ScheduleJobService jobService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result<String> release(Long id) {
|
||||||
|
ScheduleJobEntity jobEntity = buildJobEntity(id);
|
||||||
|
//判断是否存在,不存在,新增,存在,设置主键
|
||||||
|
jobService.buildSystemJob(jobEntity);
|
||||||
|
ScheduleUtils.createScheduleJob(scheduler, jobEntity);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result<String> cancel(Long id) {
|
||||||
|
ScheduleJobEntity jobEntity = buildJobEntity(id);
|
||||||
|
jobService.buildSystemJob(jobEntity);
|
||||||
|
ScheduleUtils.deleteScheduleJob(scheduler, jobEntity);
|
||||||
|
//更新任务状态为暂停
|
||||||
|
jobService.pauseSystemJob(jobEntity);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result<String> handRun(Long id) {
|
||||||
|
ScheduleJobEntity jobEntity = buildJobEntity(id);
|
||||||
|
jobEntity.setOnce(true);
|
||||||
|
jobEntity.setSaveLog(false);
|
||||||
|
ScheduleUtils.run(scheduler, jobEntity);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
private ScheduleJobEntity buildJobEntity(Long id) {
|
||||||
|
DataGovernanceQualityConfigDto qualityConfigDto = dataQualityApi.getById(id).getData();
|
||||||
|
return ScheduleJobEntity.builder().typeId(id).projectId(qualityConfigDto.getProjectId()).jobType(QuartzJobType.DATA_QUALITY.getValue()).jobName(String.format("[%s]%s", id.toString(), qualityConfigDto.getName())).concurrent(ScheduleConcurrentEnum.NO.getValue())
|
||||||
|
.beanName("dataQualityTask").method("run").jobGroup(JobGroupEnum.DATA_QUALITY.getValue()).saveLog(true).cronExpression(qualityConfigDto.getCron()).status(ScheduleStatusEnum.NORMAL.getValue())
|
||||||
|
.params(String.valueOf(id)).once(MetadataCollectType.ONCE.getValue().equals(qualityConfigDto.getTaskType())).build();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,57 @@
|
||||||
|
package net.srt.quartz.api;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import net.srt.api.module.data.development.DataProductionScheduleApi;
|
||||||
|
import net.srt.api.module.data.development.dto.DataProductionScheduleDto;
|
||||||
|
import net.srt.api.module.quartz.QuartzDataProductionScheduleApi;
|
||||||
|
import net.srt.api.module.quartz.constant.QuartzJobType;
|
||||||
|
import net.srt.framework.common.utils.Result;
|
||||||
|
import net.srt.quartz.entity.ScheduleJobEntity;
|
||||||
|
import net.srt.quartz.enums.JobGroupEnum;
|
||||||
|
import net.srt.quartz.enums.ScheduleConcurrentEnum;
|
||||||
|
import net.srt.quartz.enums.ScheduleStatusEnum;
|
||||||
|
import net.srt.quartz.service.ScheduleJobService;
|
||||||
|
import net.srt.quartz.utils.ScheduleUtils;
|
||||||
|
import org.quartz.Scheduler;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 短信服务API
|
||||||
|
*
|
||||||
|
* @author 阿沐 babamu@126.com
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class QuartzDataProductionScheduleApiImpl implements QuartzDataProductionScheduleApi {
|
||||||
|
|
||||||
|
private final Scheduler scheduler;
|
||||||
|
private final DataProductionScheduleApi scheduleApi;
|
||||||
|
private final ScheduleJobService jobService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result<String> release(Long id) {
|
||||||
|
ScheduleJobEntity jobEntity = buildJobEntity(id);
|
||||||
|
//判断是否存在,不存在,新增,存在,设置主键
|
||||||
|
jobService.buildSystemJob(jobEntity);
|
||||||
|
ScheduleUtils.createScheduleJob(scheduler, jobEntity);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result<String> cancle(Long id) {
|
||||||
|
ScheduleJobEntity jobEntity = buildJobEntity(id);
|
||||||
|
jobService.buildSystemJob(jobEntity);
|
||||||
|
ScheduleUtils.deleteScheduleJob(scheduler, jobEntity);
|
||||||
|
//更新任务状态为暂停
|
||||||
|
jobService.pauseSystemJob(jobEntity);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private ScheduleJobEntity buildJobEntity(Long id) {
|
||||||
|
DataProductionScheduleDto scheduleDto = scheduleApi.getById(id).getData();
|
||||||
|
return ScheduleJobEntity.builder().typeId(id).projectId(scheduleDto.getProjectId()).jobType(QuartzJobType.DATA_PRODUCTION.getValue()).jobName(String.format("[%s]%s", id.toString(), scheduleDto.getName())).concurrent(ScheduleConcurrentEnum.NO.getValue())
|
||||||
|
.beanName("dataProductionScheduleTask").method("run").jobGroup(JobGroupEnum.DATA_PRODUCTION.getValue()).saveLog(true).cronExpression(scheduleDto.getCron()).status(ScheduleStatusEnum.NORMAL.getValue())
|
||||||
|
.params(String.valueOf(id)).once(scheduleDto.getIfCycle() == 0).build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -63,5 +63,4 @@ public class DataProductionServiceImpl extends BaseServiceImpl<DataProductionMap
|
||||||
}
|
}
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,8 +11,8 @@ import java.util.List;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class DataProductionTreeVo {
|
public class DataProductionTreeVo {
|
||||||
private Integer id;
|
private Long id;
|
||||||
private Integer parentId;
|
private Long parentId;
|
||||||
private Integer ifLeaf;
|
private Integer ifLeaf;
|
||||||
private Long taskId;
|
private Long taskId;
|
||||||
private String taskType;
|
private String taskType;
|
||||||
|
|
Loading…
Reference in New Issue