diff --git a/srt-cloud-data-governance/src/main/java/net/srt/service/impl/QualityTaskTableServiceimpl.java b/srt-cloud-data-governance/src/main/java/net/srt/service/impl/QualityTaskTableServiceimpl.java index af1bef8..cfadf00 100644 --- a/srt-cloud-data-governance/src/main/java/net/srt/service/impl/QualityTaskTableServiceimpl.java +++ b/srt-cloud-data-governance/src/main/java/net/srt/service/impl/QualityTaskTableServiceimpl.java @@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.fasterxml.jackson.core.type.TypeReference; import lombok.AllArgsConstructor; +import lombok.SneakyThrows; import net.srt.api.module.data.governance.dto.quality.QulaityColumn; import net.srt.convert.QualityTaskTableConvert; import net.srt.dao.QualityTaskColumnDao; @@ -34,11 +35,13 @@ import java.util.stream.Collectors; @AllArgsConstructor public class QualityTaskTableServiceimpl extends BaseServiceImpl implements QualityTaskTableService { + @SneakyThrows @Override public PageResult page(QualityTableQuery query) { IPage page=baseMapper.selectPage(getPage(query),getWrapper(query)); List taskTableVos= QualityTaskTableConvert.INSTANCE.convertList(page.getRecords()); - for (QualityTaskTableVo taskTableVo : taskTableVos) { taskTableVo.setColumnInfo(SingletonObject.OBJECT_MAPPER.readValue(SingletonObject.OBJECT_MAPPER.writeValueAsString(taskTableVo.getColumnInfo()), new TypeReference>() { + for (QualityTaskTableVo taskTableVo : taskTableVos) { + taskTableVo.setColumnInfo(SingletonObject.OBJECT_MAPPER.readValue(SingletonObject.OBJECT_MAPPER.writeValueAsString(taskTableVo.getColumnInfo()), new TypeReference>() { })); taskTableVo.setCheckColumns(taskTableVo.getColumnInfo().stream().map(QulaityColumn::getColumnName).collect(Collectors.joining(","))); diff --git a/srt-cloud-framework/srt-cloud-flink/build/app/flink-app-1.14-2.0.0-jar-with-dependencies.jar b/srt-cloud-framework/srt-cloud-flink/build/app/flink-app-1.14-2.0.0-jar-with-dependencies.jar index 3f435fa..0595467 100644 Binary files a/srt-cloud-framework/srt-cloud-flink/build/app/flink-app-1.14-2.0.0-jar-with-dependencies.jar and b/srt-cloud-framework/srt-cloud-flink/build/app/flink-app-1.14-2.0.0-jar-with-dependencies.jar differ diff --git a/srt-cloud-framework/srt-cloud-flink/build/extends/flink-catalog-mysql-1.14-2.0.0.jar b/srt-cloud-framework/srt-cloud-flink/build/extends/flink-catalog-mysql-1.14-2.0.0.jar index 273eff8..e848764 100644 Binary files a/srt-cloud-framework/srt-cloud-flink/build/extends/flink-catalog-mysql-1.14-2.0.0.jar and b/srt-cloud-framework/srt-cloud-flink/build/extends/flink-catalog-mysql-1.14-2.0.0.jar differ diff --git a/srt-cloud-framework/srt-cloud-flink/build/extends/flink-client-1.14-2.0.0.jar b/srt-cloud-framework/srt-cloud-flink/build/extends/flink-client-1.14-2.0.0.jar index 3786216..94b269e 100644 Binary files a/srt-cloud-framework/srt-cloud-flink/build/extends/flink-client-1.14-2.0.0.jar and b/srt-cloud-framework/srt-cloud-flink/build/extends/flink-client-1.14-2.0.0.jar differ diff --git a/srt-data-development/src/main/java/net/srt/DevelopmentApp.java b/srt-data-development/src/main/java/net/srt/DevelopmentApp.java index 0dab29a..cd75f8b 100644 --- a/srt-data-development/src/main/java/net/srt/DevelopmentApp.java +++ b/srt-data-development/src/main/java/net/srt/DevelopmentApp.java @@ -1,10 +1,19 @@ package net.srt; +import com.alibaba.druid.sql.ast.SQLObject; +import com.alibaba.druid.sql.ast.SQLStatement; +import com.alibaba.druid.sql.parser.SQLParserUtils; +import com.alibaba.druid.sql.parser.SQLStatementParser; +import jdk.nashorn.internal.runtime.ParserException; import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import java.util.List; + +import static com.alibaba.druid.sql.SQLUtils.toSQLString; + @EnableDiscoveryClient @SpringBootApplication @MapperScan("net.srt.Fink.mapper") @@ -12,6 +21,7 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient; @MapperScan("net.srt.disposition.mapper") public class DevelopmentApp { public static void main(String[] args) { + SpringApplication.run(DevelopmentApp.class); System.out.println("数据开发已启动===========>"); } diff --git a/srt-data-development/src/main/java/net/srt/disposition/controller/DataProductionTreeController.java b/srt-data-development/src/main/java/net/srt/disposition/controller/DataProductionTreeController.java index b13dd46..4d40d05 100644 --- a/srt-data-development/src/main/java/net/srt/disposition/controller/DataProductionTreeController.java +++ b/srt-data-development/src/main/java/net/srt/disposition/controller/DataProductionTreeController.java @@ -1,13 +1,13 @@ package net.srt.disposition.controller; import lombok.AllArgsConstructor; -import net.srt.api.module.data.integrate.dto.DataDatabaseDto; import net.srt.disposition.dto.DataProductionTreeDto; import net.srt.disposition.dto.DispositionDto; import net.srt.disposition.service.DataProductionService; import net.srt.disposition.vo.DataProductionTreeVo; import net.srt.disposition.vo.DispositionVo; import net.srt.framework.common.utils.Result; +import net.srt.framework.common.utils.TreeNodeVo; import org.springframework.web.bind.annotation.*; import java.util.List; @@ -20,8 +20,8 @@ public class DataProductionTreeController { private DataProductionService dataProductionService; @GetMapping - public Result> listResult(){ - List dispositionVos=dataProductionService.dataTreeList(); + public Result> listResult(){ + List dispositionVos=dataProductionService.dataTreeList(); return Result.ok(dispositionVos); } diff --git a/srt-data-development/src/main/java/net/srt/disposition/dto/DataProductionTreeDto.java b/srt-data-development/src/main/java/net/srt/disposition/dto/DataProductionTreeDto.java index cbfa2ed..a8a6c99 100644 --- a/srt-data-development/src/main/java/net/srt/disposition/dto/DataProductionTreeDto.java +++ b/srt-data-development/src/main/java/net/srt/disposition/dto/DataProductionTreeDto.java @@ -8,24 +8,13 @@ import java.util.Date; @Data public class DataProductionTreeDto { - private Integer id; - private Integer parentId; + private String description; + private Long id; private Integer ifLeaf; - private Long taskId; - private String taskType; + private String name; + private Integer orderNo; + private Long parentId; private String parentPath; private String path; - private Integer orderNo; - private String label; - private Long metamodelId; - private String name; - private String icon; - private String code; - private Boolean builtin; - private String description; - private Long projectId; - private Integer creator; - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") - private Date creatTime; + private Integer taskType; } diff --git a/srt-data-development/src/main/java/net/srt/disposition/entity/DataProductionTreeEntity.java b/srt-data-development/src/main/java/net/srt/disposition/entity/DataProductionTreeEntity.java index 28518ea..b7cd5c8 100644 --- a/srt-data-development/src/main/java/net/srt/disposition/entity/DataProductionTreeEntity.java +++ b/srt-data-development/src/main/java/net/srt/disposition/entity/DataProductionTreeEntity.java @@ -13,11 +13,11 @@ import java.util.Date; @TableName("data_production_tree") public class DataProductionTreeEntity { @TableId("id") - private Integer id; - private Integer parentId; + private Long id; + private Long parentId; private Integer ifLeaf; private Long taskId; - private String taskType; + private Integer taskType; private String parentPath; private String path; private Integer orderNo; diff --git a/srt-data-development/src/main/java/net/srt/disposition/service/DataProductionService.java b/srt-data-development/src/main/java/net/srt/disposition/service/DataProductionService.java index 1230b9b..0195f21 100644 --- a/srt-data-development/src/main/java/net/srt/disposition/service/DataProductionService.java +++ b/srt-data-development/src/main/java/net/srt/disposition/service/DataProductionService.java @@ -1,16 +1,16 @@ package net.srt.disposition.service; import com.baomidou.mybatisplus.extension.service.IService; -import net.srt.api.module.data.integrate.dto.DataDatabaseDto; import net.srt.disposition.dto.DataProductionTreeDto; import net.srt.disposition.dto.DispositionDto; import net.srt.disposition.entity.DataProductionTreeEntity; import net.srt.disposition.vo.DataProductionTreeVo; +import net.srt.framework.common.utils.TreeNodeVo; import java.util.List; public interface DataProductionService extends IService { - List dataTreeList(); + List dataTreeList(); void add(DataProductionTreeDto dataProductionTreeDto); diff --git a/srt-data-development/src/main/java/net/srt/disposition/service/impl/DataProductionServiceImpl.java b/srt-data-development/src/main/java/net/srt/disposition/service/impl/DataProductionServiceImpl.java index 82bba9a..3121add 100644 --- a/srt-data-development/src/main/java/net/srt/disposition/service/impl/DataProductionServiceImpl.java +++ b/srt-data-development/src/main/java/net/srt/disposition/service/impl/DataProductionServiceImpl.java @@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import lombok.AllArgsConstructor; import net.srt.Fink.entity.FinkEntity; -import net.srt.api.module.data.integrate.dto.DataDatabaseDto; import net.srt.disposition.convert.DataProductionTreeConvert; import net.srt.disposition.dto.DataProductionTreeDto; import net.srt.disposition.dto.DispositionDto; @@ -27,51 +26,22 @@ import java.util.List; @AllArgsConstructor public class DataProductionServiceImpl extends BaseServiceImpl implements DataProductionService { @Override - public List dataTreeList() { + public List dataTreeList() { LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + dataScopeWithoutOrgId(wrapper); wrapper.orderByAsc(DataProductionTreeEntity::getOrderNo); List dataFileCategoryEntities = baseMapper.selectList(wrapper); - List treeNodeVos = BeanUtil.copyListProperties(dataFileCategoryEntities, DataProductionTreeVo::new, (oldItem, newItem) -> { + List treeNodeVos = BeanUtil.copyListProperties(dataFileCategoryEntities, TreeNodeVo::new, (oldItem, newItem) -> { newItem.setLabel(oldItem.getName()); + newItem.setValue(oldItem.getId()); + if (oldItem.getTaskType()!=null){ + newItem.setTaskType(oldItem.getTaskType()); + } if (newItem.getPath().contains("/")) { newItem.setParentPath(newItem.getPath().substring(0, newItem.getPath().lastIndexOf("/"))); } }); - return buildTree(treeNodeVos); - } - - public static List buildTree(List nodeVos) { - List resultVos = new ArrayList<>(10); - for (DataProductionTreeVo node : nodeVos) { - // 一级菜单parentId为0 - if (node.getParentId() == 0) { - resultVos.add(node); - } - } - // 为一级菜单设置子菜单,getChild是递归调用的 - for (DataProductionTreeVo node : resultVos) { - node.setDataProductionTreeVos(getChild(node.getId(), nodeVos)); - } - return resultVos; - } - - - private static List getChild(Integer id, List nodeVos) { - // 子菜单 - List childList = new ArrayList<>(10); - for (DataProductionTreeVo node : nodeVos) { - // 遍历所有节点,将父菜单id与传过来的id比较 - if (node.getParentId() != 0) { - if (node.getParentId().equals(id)) { - childList.add(node); - } - } - } - // 把子菜单的子菜单再循环一遍 - for (DataProductionTreeVo node : childList) { - node.setDataProductionTreeVos(getChild(node.getId(), nodeVos)); - } - return childList; + return BuildTreeUtils.buildTree(treeNodeVos); } @Override