From 8ec267ac4ba53a0a6055ce42428de2f0d8d29b0c Mon Sep 17 00:00:00 2001 From: Saisai Liu <1374434128@qq.com> Date: Thu, 9 May 2024 21:55:18 +0800 Subject: [PATCH] =?UTF-8?q?feat():=E5=88=86=E7=A6=BB=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/constant/ServiceNameConstants.java | 5 + muyu-modules/muyu-etl/muyu-etl-client/pom.xml | 126 ++++++++++++++++++ .../java/com/muyu/EtlClientApplication.java | 19 +++ .../src/main/java/com/muyu/etl/EtlRunner.java | 33 +++++ .../muyu/etl/config/AssetClientConfig.java | 17 +++ ...ot.autoconfigure.AutoConfiguration.imports | 1 + .../muyu-etl-common/pom.xml | 2 +- .../com/muyu/etl/domain/AssetDataDict.java | 0 .../com/muyu/etl/domain/AssetImpower.java | 0 .../com/muyu/etl/domain/BasicConfigInfo.java | 0 .../java/com/muyu/etl/domain/DictInfo.java | 0 .../java/com/muyu/etl/domain/Structure.java | 0 .../java/com/muyu/etl/domain/TableInfo.java | 0 .../muyu/etl/domain/req/AssetImpowerReq.java | 0 .../etl/domain/req/BasicConfigQueryReq.java | 0 .../etl/domain/req/TableInfoScopeReq.java | 59 ++++++++ .../muyu/etl/domain/resp/BasicConfigResp.java | 0 .../muyu/etl/domain/resp/BasicDictResp.java | 0 .../etl/domain/resp/BasicTableInfoResp.java | 0 .../etl/domain/resp/StructureValueResp.java | 97 ++++++++++++++ .../domain/resp/TableInfoStructureResp.java | 0 .../muyu/etl/domain/resp/TableTreeResp.java | 0 .../muyu-etl-remote/pom.xml | 10 +- .../main/java/com/etl/RemoteAssetService.java | 32 +++++ .../factory/RemoteAssetFallbackFactory.java | 32 +++++ ...ot.autoconfigure.AutoConfiguration.imports | 1 + .../muyu-etl-service/pom.xml | 2 +- .../java/com/muyu/MuYuEtlApplication.java | 0 .../controller/AssetImpowerController.java | 0 .../controller/BasicConfigInfoController.java | 40 ++++-- .../muyu/etl/mapper/AssetDataDictMapper.java | 0 .../muyu/etl/mapper/AssetImpowerMapper.java | 0 .../etl/mapper/BasicConfigInfoMapper.java | 0 .../com/muyu/etl/mapper/DictInfoMapper.java | 0 .../com/muyu/etl/mapper/StructureMapper.java | 0 .../com/muyu/etl/mapper/TableInfoMapper.java | 2 + .../etl/service/AssetDataDictService.java | 0 .../muyu/etl/service/AssetImpowerService.java | 0 .../etl/service/BasicConfigInfoService.java | 7 + .../com/muyu/etl/service/DictInfoService.java | 0 .../muyu/etl/service/StructureService.java | 0 .../muyu/etl/service/TableInfoService.java | 4 + .../impl/AssetDataDictServiceImpl.java | 0 .../service/impl/AssetImpowerServiceImpl.java | 0 .../impl/BasicConfigInfoServiceImpl.java | 90 ++++++++++--- .../etl/service/impl/DictInfoServiceImpl.java | 0 .../service/impl/StructureServiceImpl.java | 0 .../service/impl/TableInfoServiceImpl.java | 15 +++ .../src/main/resources/bootstrap.yml | 0 .../resources/mapper/AssetDataDictMapper.xml | 0 .../resources/mapper/AssetImpowerMapper.xml | 0 .../mapper/BasicConfigInfoMapper.xml | 0 .../main/resources/mapper/DictInfoMapper.xml | 0 .../main/resources/mapper/StructureMapper.xml | 0 .../main/resources/mapper/TableInfoMapper.xml | 5 + muyu-modules/{muyv-etl => muyu-etl}/pom.xml | 3 +- .../muyu-ruleEngine-client/pom.xml | 120 +++++++++++++++++ .../com/muyu/EngineClientApplication.java | 18 +++ ...ot.autoconfigure.AutoConfiguration.imports | 0 .../muyu-ruleEngine-remote/pom.xml | 6 + .../src/main/java/com/muyu/Main.java | 7 - .../muyu/remote/RemoteRuleEngineService.java | 35 +++++ .../RemoteRuleEngineFallbackFactory.java | 31 +++++ ...ot.autoconfigure.AutoConfiguration.imports | 1 + .../RuleEngineVersionController.java | 4 +- .../service/RuleEngineVersionService.java | 4 +- .../impl/RuleEngineVersionServiceImpl.java | 6 +- muyu-modules/muyu-ruleEngine/pom.xml | 1 + muyu-modules/pom.xml | 2 +- 69 files changed, 789 insertions(+), 48 deletions(-) create mode 100644 muyu-modules/muyu-etl/muyu-etl-client/pom.xml create mode 100644 muyu-modules/muyu-etl/muyu-etl-client/src/main/java/com/muyu/EtlClientApplication.java create mode 100644 muyu-modules/muyu-etl/muyu-etl-client/src/main/java/com/muyu/etl/EtlRunner.java create mode 100644 muyu-modules/muyu-etl/muyu-etl-client/src/main/java/com/muyu/etl/config/AssetClientConfig.java create mode 100644 muyu-modules/muyu-etl/muyu-etl-client/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports rename muyu-modules/{muyv-etl => muyu-etl}/muyu-etl-common/pom.xml (95%) rename muyu-modules/{muyv-etl => muyu-etl}/muyu-etl-common/src/main/java/com/muyu/etl/domain/AssetDataDict.java (100%) rename muyu-modules/{muyv-etl => muyu-etl}/muyu-etl-common/src/main/java/com/muyu/etl/domain/AssetImpower.java (100%) rename muyu-modules/{muyv-etl => muyu-etl}/muyu-etl-common/src/main/java/com/muyu/etl/domain/BasicConfigInfo.java (100%) rename muyu-modules/{muyv-etl => muyu-etl}/muyu-etl-common/src/main/java/com/muyu/etl/domain/DictInfo.java (100%) rename muyu-modules/{muyv-etl => muyu-etl}/muyu-etl-common/src/main/java/com/muyu/etl/domain/Structure.java (100%) rename muyu-modules/{muyv-etl => muyu-etl}/muyu-etl-common/src/main/java/com/muyu/etl/domain/TableInfo.java (100%) rename muyu-modules/{muyv-etl => muyu-etl}/muyu-etl-common/src/main/java/com/muyu/etl/domain/req/AssetImpowerReq.java (100%) rename muyu-modules/{muyv-etl => muyu-etl}/muyu-etl-common/src/main/java/com/muyu/etl/domain/req/BasicConfigQueryReq.java (100%) create mode 100644 muyu-modules/muyu-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/req/TableInfoScopeReq.java rename muyu-modules/{muyv-etl => muyu-etl}/muyu-etl-common/src/main/java/com/muyu/etl/domain/resp/BasicConfigResp.java (100%) rename muyu-modules/{muyv-etl => muyu-etl}/muyu-etl-common/src/main/java/com/muyu/etl/domain/resp/BasicDictResp.java (100%) rename muyu-modules/{muyv-etl => muyu-etl}/muyu-etl-common/src/main/java/com/muyu/etl/domain/resp/BasicTableInfoResp.java (100%) create mode 100644 muyu-modules/muyu-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/resp/StructureValueResp.java rename muyu-modules/{muyv-etl => muyu-etl}/muyu-etl-common/src/main/java/com/muyu/etl/domain/resp/TableInfoStructureResp.java (100%) rename muyu-modules/{muyv-etl => muyu-etl}/muyu-etl-common/src/main/java/com/muyu/etl/domain/resp/TableTreeResp.java (100%) rename muyu-modules/{muyv-etl => muyu-etl}/muyu-etl-remote/pom.xml (74%) create mode 100644 muyu-modules/muyu-etl/muyu-etl-remote/src/main/java/com/etl/RemoteAssetService.java create mode 100644 muyu-modules/muyu-etl/muyu-etl-remote/src/main/java/com/etl/factory/RemoteAssetFallbackFactory.java create mode 100644 muyu-modules/muyu-etl/muyu-etl-remote/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports rename muyu-modules/{muyv-etl => muyu-etl}/muyu-etl-service/pom.xml (98%) rename muyu-modules/{muyv-etl => muyu-etl}/muyu-etl-service/src/main/java/com/muyu/MuYuEtlApplication.java (100%) rename muyu-modules/{muyv-etl => muyu-etl}/muyu-etl-service/src/main/java/com/muyu/etl/controller/AssetImpowerController.java (100%) rename muyu-modules/{muyv-etl => muyu-etl}/muyu-etl-service/src/main/java/com/muyu/etl/controller/BasicConfigInfoController.java (89%) rename muyu-modules/{muyv-etl => muyu-etl}/muyu-etl-service/src/main/java/com/muyu/etl/mapper/AssetDataDictMapper.java (100%) rename muyu-modules/{muyv-etl => muyu-etl}/muyu-etl-service/src/main/java/com/muyu/etl/mapper/AssetImpowerMapper.java (100%) rename muyu-modules/{muyv-etl => muyu-etl}/muyu-etl-service/src/main/java/com/muyu/etl/mapper/BasicConfigInfoMapper.java (100%) rename muyu-modules/{muyv-etl => muyu-etl}/muyu-etl-service/src/main/java/com/muyu/etl/mapper/DictInfoMapper.java (100%) rename muyu-modules/{muyv-etl => muyu-etl}/muyu-etl-service/src/main/java/com/muyu/etl/mapper/StructureMapper.java (100%) rename muyu-modules/{muyv-etl => muyu-etl}/muyu-etl-service/src/main/java/com/muyu/etl/mapper/TableInfoMapper.java (95%) rename muyu-modules/{muyv-etl => muyu-etl}/muyu-etl-service/src/main/java/com/muyu/etl/service/AssetDataDictService.java (100%) rename muyu-modules/{muyv-etl => muyu-etl}/muyu-etl-service/src/main/java/com/muyu/etl/service/AssetImpowerService.java (100%) rename muyu-modules/{muyv-etl => muyu-etl}/muyu-etl-service/src/main/java/com/muyu/etl/service/BasicConfigInfoService.java (87%) rename muyu-modules/{muyv-etl => muyu-etl}/muyu-etl-service/src/main/java/com/muyu/etl/service/DictInfoService.java (100%) rename muyu-modules/{muyv-etl => muyu-etl}/muyu-etl-service/src/main/java/com/muyu/etl/service/StructureService.java (100%) rename muyu-modules/{muyv-etl => muyu-etl}/muyu-etl-service/src/main/java/com/muyu/etl/service/TableInfoService.java (90%) rename muyu-modules/{muyv-etl => muyu-etl}/muyu-etl-service/src/main/java/com/muyu/etl/service/impl/AssetDataDictServiceImpl.java (100%) rename muyu-modules/{muyv-etl => muyu-etl}/muyu-etl-service/src/main/java/com/muyu/etl/service/impl/AssetImpowerServiceImpl.java (100%) rename muyu-modules/{muyv-etl => muyu-etl}/muyu-etl-service/src/main/java/com/muyu/etl/service/impl/BasicConfigInfoServiceImpl.java (87%) rename muyu-modules/{muyv-etl => muyu-etl}/muyu-etl-service/src/main/java/com/muyu/etl/service/impl/DictInfoServiceImpl.java (100%) rename muyu-modules/{muyv-etl => muyu-etl}/muyu-etl-service/src/main/java/com/muyu/etl/service/impl/StructureServiceImpl.java (100%) rename muyu-modules/{muyv-etl => muyu-etl}/muyu-etl-service/src/main/java/com/muyu/etl/service/impl/TableInfoServiceImpl.java (85%) rename muyu-modules/{muyv-etl => muyu-etl}/muyu-etl-service/src/main/resources/bootstrap.yml (100%) rename muyu-modules/{muyv-etl => muyu-etl}/muyu-etl-service/src/main/resources/mapper/AssetDataDictMapper.xml (100%) rename muyu-modules/{muyv-etl => muyu-etl}/muyu-etl-service/src/main/resources/mapper/AssetImpowerMapper.xml (100%) rename muyu-modules/{muyv-etl => muyu-etl}/muyu-etl-service/src/main/resources/mapper/BasicConfigInfoMapper.xml (100%) rename muyu-modules/{muyv-etl => muyu-etl}/muyu-etl-service/src/main/resources/mapper/DictInfoMapper.xml (100%) rename muyu-modules/{muyv-etl => muyu-etl}/muyu-etl-service/src/main/resources/mapper/StructureMapper.xml (100%) rename muyu-modules/{muyv-etl => muyu-etl}/muyu-etl-service/src/main/resources/mapper/TableInfoMapper.xml (96%) rename muyu-modules/{muyv-etl => muyu-etl}/pom.xml (91%) create mode 100644 muyu-modules/muyu-ruleEngine/muyu-ruleEngine-client/pom.xml create mode 100644 muyu-modules/muyu-ruleEngine/muyu-ruleEngine-client/src/main/java/com/muyu/EngineClientApplication.java create mode 100644 muyu-modules/muyu-ruleEngine/muyu-ruleEngine-client/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports delete mode 100644 muyu-modules/muyu-ruleEngine/muyu-ruleEngine-remote/src/main/java/com/muyu/Main.java create mode 100644 muyu-modules/muyu-ruleEngine/muyu-ruleEngine-remote/src/main/java/com/muyu/remote/RemoteRuleEngineService.java create mode 100644 muyu-modules/muyu-ruleEngine/muyu-ruleEngine-remote/src/main/java/com/muyu/remote/factory/RemoteRuleEngineFallbackFactory.java create mode 100644 muyu-modules/muyu-ruleEngine/muyu-ruleEngine-remote/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports diff --git a/muyu-common/muyu-common-core/src/main/java/com/muyu/common/core/constant/ServiceNameConstants.java b/muyu-common/muyu-common-core/src/main/java/com/muyu/common/core/constant/ServiceNameConstants.java index 25c918e..784fee7 100644 --- a/muyu-common/muyu-common-core/src/main/java/com/muyu/common/core/constant/ServiceNameConstants.java +++ b/muyu-common/muyu-common-core/src/main/java/com/muyu/common/core/constant/ServiceNameConstants.java @@ -16,6 +16,11 @@ public class ServiceNameConstants { */ public static final String SYSTEM_SERVICE = "muyu-system"; + /** + * 系统模块的serviceid + */ + public static final String ENGINE_SERVICE = "muyu-engine"; + /** * 文件服务的serviceid */ diff --git a/muyu-modules/muyu-etl/muyu-etl-client/pom.xml b/muyu-modules/muyu-etl/muyu-etl-client/pom.xml new file mode 100644 index 0000000..c1f29ed --- /dev/null +++ b/muyu-modules/muyu-etl/muyu-etl-client/pom.xml @@ -0,0 +1,126 @@ + + + 4.0.0 + + com.muyu + muyu-etl + 3.6.3 + + + muyu-etl-client + + + 17 + 17 + UTF-8 + + + + + org.postgresql + postgresql + 42.3.8 + + + + com.muyu + muyu-etl-common + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-sentinel + + + + + org.springframework.boot + spring-boot-starter-actuator + + + + + io.springfox + springfox-swagger-ui + ${swagger.fox.version} + + + + + com.mysql + mysql-connector-j + + + + + com.muyu + muyu-common-datasource + + + + + com.muyu + muyu-common-datascope + + + + + com.muyu + muyu-common-log + + + + + com.muyu + muyu-common-swagger + + + com.muyu + muyu-etl-remote + 3.6.3 + compile + + + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + true + + + + + diff --git a/muyu-modules/muyu-etl/muyu-etl-client/src/main/java/com/muyu/EtlClientApplication.java b/muyu-modules/muyu-etl/muyu-etl-client/src/main/java/com/muyu/EtlClientApplication.java new file mode 100644 index 0000000..634be56 --- /dev/null +++ b/muyu-modules/muyu-etl/muyu-etl-client/src/main/java/com/muyu/EtlClientApplication.java @@ -0,0 +1,19 @@ +package com.muyu; + +import com.muyu.common.security.annotation.EnableCustomConfig; +import com.muyu.common.security.annotation.EnableMyFeignClients; +import com.muyu.common.swagger.annotation.EnableCustomSwagger2; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.openfeign.EnableFeignClients; + +@EnableCustomConfig +@EnableCustomSwagger2 +@EnableMyFeignClients +@EnableFeignClients +@SpringBootApplication +public class EtlClientApplication { + public static void main(String[] args) { + SpringApplication.run(EtlClientApplication.class); + } +} diff --git a/muyu-modules/muyu-etl/muyu-etl-client/src/main/java/com/muyu/etl/EtlRunner.java b/muyu-modules/muyu-etl/muyu-etl-client/src/main/java/com/muyu/etl/EtlRunner.java new file mode 100644 index 0000000..86a0f91 --- /dev/null +++ b/muyu-modules/muyu-etl/muyu-etl-client/src/main/java/com/muyu/etl/EtlRunner.java @@ -0,0 +1,33 @@ +package com.muyu.etl; + +import com.etl.RemoteAssetService; +import com.muyu.common.core.constant.SecurityConstants; +import com.muyu.etl.domain.BasicConfigInfo; +import lombok.extern.log4j.Log4j2; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.ApplicationArguments; +import org.springframework.boot.ApplicationRunner; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @ClassName EtlRunner + * @Description 描述 + * @Author SaiSai.Liu + * @Date 2024/5/9 21:26 + */ +@Component +@Log4j2 +public class EtlRunner implements ApplicationRunner { + + @Autowired + private RemoteAssetService remoteAssetService; + + @Override + public void run(ApplicationArguments args) throws Exception { + List rows = remoteAssetService.list(null, SecurityConstants.INNER).getData().getRows(); + log.info(rows); + + } +} diff --git a/muyu-modules/muyu-etl/muyu-etl-client/src/main/java/com/muyu/etl/config/AssetClientConfig.java b/muyu-modules/muyu-etl/muyu-etl-client/src/main/java/com/muyu/etl/config/AssetClientConfig.java new file mode 100644 index 0000000..cd8934a --- /dev/null +++ b/muyu-modules/muyu-etl/muyu-etl-client/src/main/java/com/muyu/etl/config/AssetClientConfig.java @@ -0,0 +1,17 @@ +package com.muyu.etl.config; + +import com.muyu.etl.EtlRunner; +import org.springframework.context.annotation.Import; +import org.springframework.stereotype.Component; + +/** + * @ClassName AssetClientConfig + * @Description 描述 + * @Author SaiSai.Liu + * @Date 2024/5/9 21:45 + */ +@Component +@Import(value = {EtlRunner.class}) +public class AssetClientConfig { + +} diff --git a/muyu-modules/muyu-etl/muyu-etl-client/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/muyu-modules/muyu-etl/muyu-etl-client/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000..dde140c --- /dev/null +++ b/muyu-modules/muyu-etl/muyu-etl-client/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +com.etl.factory.RemoteRuleEngineFallbackFactory diff --git a/muyu-modules/muyv-etl/muyu-etl-common/pom.xml b/muyu-modules/muyu-etl/muyu-etl-common/pom.xml similarity index 95% rename from muyu-modules/muyv-etl/muyu-etl-common/pom.xml rename to muyu-modules/muyu-etl/muyu-etl-common/pom.xml index d1ef131..30a367d 100644 --- a/muyu-modules/muyv-etl/muyu-etl-common/pom.xml +++ b/muyu-modules/muyu-etl/muyu-etl-common/pom.xml @@ -5,7 +5,7 @@ 4.0.0 com.muyu - muyv-etl + muyu-etl 3.6.3 diff --git a/muyu-modules/muyv-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/AssetDataDict.java b/muyu-modules/muyu-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/AssetDataDict.java similarity index 100% rename from muyu-modules/muyv-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/AssetDataDict.java rename to muyu-modules/muyu-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/AssetDataDict.java diff --git a/muyu-modules/muyv-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/AssetImpower.java b/muyu-modules/muyu-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/AssetImpower.java similarity index 100% rename from muyu-modules/muyv-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/AssetImpower.java rename to muyu-modules/muyu-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/AssetImpower.java diff --git a/muyu-modules/muyv-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/BasicConfigInfo.java b/muyu-modules/muyu-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/BasicConfigInfo.java similarity index 100% rename from muyu-modules/muyv-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/BasicConfigInfo.java rename to muyu-modules/muyu-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/BasicConfigInfo.java diff --git a/muyu-modules/muyv-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/DictInfo.java b/muyu-modules/muyu-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/DictInfo.java similarity index 100% rename from muyu-modules/muyv-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/DictInfo.java rename to muyu-modules/muyu-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/DictInfo.java diff --git a/muyu-modules/muyv-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/Structure.java b/muyu-modules/muyu-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/Structure.java similarity index 100% rename from muyu-modules/muyv-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/Structure.java rename to muyu-modules/muyu-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/Structure.java diff --git a/muyu-modules/muyv-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/TableInfo.java b/muyu-modules/muyu-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/TableInfo.java similarity index 100% rename from muyu-modules/muyv-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/TableInfo.java rename to muyu-modules/muyu-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/TableInfo.java diff --git a/muyu-modules/muyv-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/req/AssetImpowerReq.java b/muyu-modules/muyu-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/req/AssetImpowerReq.java similarity index 100% rename from muyu-modules/muyv-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/req/AssetImpowerReq.java rename to muyu-modules/muyu-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/req/AssetImpowerReq.java diff --git a/muyu-modules/muyv-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/req/BasicConfigQueryReq.java b/muyu-modules/muyu-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/req/BasicConfigQueryReq.java similarity index 100% rename from muyu-modules/muyv-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/req/BasicConfigQueryReq.java rename to muyu-modules/muyu-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/req/BasicConfigQueryReq.java diff --git a/muyu-modules/muyu-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/req/TableInfoScopeReq.java b/muyu-modules/muyu-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/req/TableInfoScopeReq.java new file mode 100644 index 0000000..30e3837 --- /dev/null +++ b/muyu-modules/muyu-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/req/TableInfoScopeReq.java @@ -0,0 +1,59 @@ +package com.muyu.etl.domain.req; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.muyu.common.core.annotation.Excel; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +/** + * @ClassName TableInfoScopeReq + * @Description 描述 + * @Author SaiSai.Liu + * @Date 2024/5/9 14:15 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +public class TableInfoScopeReq { + + private static final long serialVersionUID = 1L; + + /** 主键 */ + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private Long basicId; + + /** 表名称/数据库 */ + @Excel(name = "表名称/数据库") + private String tableName; + + /** 表备注 */ + @Excel(name = "表备注") + private String tableRemark; + + /** 表备注 */ + @Excel(name = "数据来源类型") + private String type; + + + /** 数据量 */ + @Excel(name = "数据量") + private Long dataNum; + + /** 是否核心 'Y'是 'N'不是 */ + @Excel(name = "是否核心 'Y'是 'N'不是") + private String center; + + private Long parentId; + + /** + * 作用域级别 + */ + private String level; + +} diff --git a/muyu-modules/muyv-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/resp/BasicConfigResp.java b/muyu-modules/muyu-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/resp/BasicConfigResp.java similarity index 100% rename from muyu-modules/muyv-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/resp/BasicConfigResp.java rename to muyu-modules/muyu-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/resp/BasicConfigResp.java diff --git a/muyu-modules/muyv-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/resp/BasicDictResp.java b/muyu-modules/muyu-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/resp/BasicDictResp.java similarity index 100% rename from muyu-modules/muyv-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/resp/BasicDictResp.java rename to muyu-modules/muyu-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/resp/BasicDictResp.java diff --git a/muyu-modules/muyv-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/resp/BasicTableInfoResp.java b/muyu-modules/muyu-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/resp/BasicTableInfoResp.java similarity index 100% rename from muyu-modules/muyv-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/resp/BasicTableInfoResp.java rename to muyu-modules/muyu-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/resp/BasicTableInfoResp.java diff --git a/muyu-modules/muyu-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/resp/StructureValueResp.java b/muyu-modules/muyu-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/resp/StructureValueResp.java new file mode 100644 index 0000000..e29d440 --- /dev/null +++ b/muyu-modules/muyu-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/resp/StructureValueResp.java @@ -0,0 +1,97 @@ +package com.muyu.etl.domain.resp; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.muyu.common.core.annotation.Excel; +import com.muyu.etl.domain.Structure; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +/** + * @ClassName StructureValueResp + * @Description 描述 + * @Author SaiSai.Liu + * @Date 2024/5/9 15:08 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +public class StructureValueResp { + private static final long serialVersionUID = 1L; + + /** 主键 */ + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** 表id */ + @Excel(name = "表id") + private Long tableId; + + /** 字段名称 */ + @Excel(name = "字段名称") + private String columnName; + + /** 字段注释 */ + @Excel(name = "字段注释") + private String columnRemark; + + /** 是否主键 'Y'是主键 'N'不是主键 */ + @Excel(name = "是否主键 'Y'是主键 'N'不是主键") + private String isPrimary; + + /** 数据类型 */ + @Excel(name = "数据类型") + private String columnType; + + /** 映射类型 */ + @Excel(name = "映射类型") + private String javaType; + + /** 字段长度 */ + @Excel(name = "字段长度") + private String columnLength; + + /** 小数位数 */ + @Excel(name = "小数位数") + private String columnDecimals; + + /** 是否为空 'Y'是 'N'不是 */ + @Excel(name = "是否为空 'Y'是 'N'不是") + private String isNull; + + /** 默认值 */ + @Excel(name = "默认值") + private String defaultValue; + + /** 是否字典 'Y'是 'N'不是 */ + @Excel(name = "是否字典 'Y'是 'N'不是") + private String isDictionary; + + /** 映射字典 */ + @Excel(name = "映射字典") + private String dictionaryTable; + + private String value; + + public static StructureValueResp saveBuilder(Structure structure, String value) { + return StructureValueResp.builder() + .id(structure.getId()) + .columnDecimals(structure.getColumnDecimals()) + .columnLength(structure.getColumnLength()) + .columnName(structure.getColumnName()) + .columnType(structure.getColumnType()) + .columnRemark(structure.getColumnRemark()) + .defaultValue(structure.getDefaultValue()) + .dictionaryTable(structure.getDictionaryTable()) + .isNull(structure.getIsNull()) + .isPrimary(structure.getIsPrimary()) + .isDictionary(structure.getIsDictionary()) + .javaType(structure.getJavaType()) + .tableId(structure.getTableId()) + .value(value) + .build(); + } +} diff --git a/muyu-modules/muyv-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/resp/TableInfoStructureResp.java b/muyu-modules/muyu-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/resp/TableInfoStructureResp.java similarity index 100% rename from muyu-modules/muyv-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/resp/TableInfoStructureResp.java rename to muyu-modules/muyu-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/resp/TableInfoStructureResp.java diff --git a/muyu-modules/muyv-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/resp/TableTreeResp.java b/muyu-modules/muyu-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/resp/TableTreeResp.java similarity index 100% rename from muyu-modules/muyv-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/resp/TableTreeResp.java rename to muyu-modules/muyu-etl/muyu-etl-common/src/main/java/com/muyu/etl/domain/resp/TableTreeResp.java diff --git a/muyu-modules/muyv-etl/muyu-etl-remote/pom.xml b/muyu-modules/muyu-etl/muyu-etl-remote/pom.xml similarity index 74% rename from muyu-modules/muyv-etl/muyu-etl-remote/pom.xml rename to muyu-modules/muyu-etl/muyu-etl-remote/pom.xml index 544f0f9..8094b74 100644 --- a/muyu-modules/muyv-etl/muyu-etl-remote/pom.xml +++ b/muyu-modules/muyu-etl/muyu-etl-remote/pom.xml @@ -5,7 +5,7 @@ 4.0.0 com.muyu - muyv-etl + muyu-etl 3.6.3 @@ -23,6 +23,14 @@ spring-cloud-openfeign-core 3.1.0 + + com.muyu + muyu-common-core + + + com.muyu + muyu-etl-common + diff --git a/muyu-modules/muyu-etl/muyu-etl-remote/src/main/java/com/etl/RemoteAssetService.java b/muyu-modules/muyu-etl/muyu-etl-remote/src/main/java/com/etl/RemoteAssetService.java new file mode 100644 index 0000000..97b3693 --- /dev/null +++ b/muyu-modules/muyu-etl/muyu-etl-remote/src/main/java/com/etl/RemoteAssetService.java @@ -0,0 +1,32 @@ +package com.etl; + +import com.etl.factory.RemoteAssetFallbackFactory; +import com.muyu.common.core.constant.SecurityConstants; +import com.muyu.common.core.constant.ServiceNameConstants; +import com.muyu.common.core.domain.Result; +import com.muyu.common.core.web.page.TableDataInfo; +import com.muyu.etl.domain.BasicConfigInfo; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestHeader; + +/** + * 用户服务 + * + * @author muyu + */ +@FeignClient(contextId = "remoteRuleEngineService", value = ServiceNameConstants.ENGINE_SERVICE, fallbackFactory = RemoteAssetFallbackFactory.class) +public interface RemoteAssetService { + /** + * 通过用户名查询用户信息 + * + * @param basicConfigInfo 用户名 + * @param source 请求来源 + * @return 结果 + */ + @GetMapping("/list") + public Result> list(BasicConfigInfo basicConfigInfo, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); + + + +} diff --git a/muyu-modules/muyu-etl/muyu-etl-remote/src/main/java/com/etl/factory/RemoteAssetFallbackFactory.java b/muyu-modules/muyu-etl/muyu-etl-remote/src/main/java/com/etl/factory/RemoteAssetFallbackFactory.java new file mode 100644 index 0000000..855d5c0 --- /dev/null +++ b/muyu-modules/muyu-etl/muyu-etl-remote/src/main/java/com/etl/factory/RemoteAssetFallbackFactory.java @@ -0,0 +1,32 @@ +package com.etl.factory; + +import com.etl.RemoteAssetService; +import com.muyu.common.core.domain.Result; +import com.muyu.common.core.web.page.TableDataInfo; +import com.muyu.etl.domain.BasicConfigInfo; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.cloud.openfeign.FallbackFactory; +import org.springframework.stereotype.Component; + +/** + * 用户服务降级处理 + * + * @author muyu + */ +@Component +public class RemoteAssetFallbackFactory implements FallbackFactory { + private static final Logger log = LoggerFactory.getLogger(RemoteAssetFallbackFactory.class); + + @Override + public RemoteAssetService create(Throwable throwable) { + log.error("用户服务调用失败:{}", throwable.getMessage()); + return new RemoteAssetService() { + + @Override + public Result> list(BasicConfigInfo basicConfigInfo, String source) { + return Result.error("查询接入信息失败"); + } + }; + } +} diff --git a/muyu-modules/muyu-etl/muyu-etl-remote/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/muyu-modules/muyu-etl/muyu-etl-remote/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000..dde140c --- /dev/null +++ b/muyu-modules/muyu-etl/muyu-etl-remote/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +com.etl.factory.RemoteRuleEngineFallbackFactory diff --git a/muyu-modules/muyv-etl/muyu-etl-service/pom.xml b/muyu-modules/muyu-etl/muyu-etl-service/pom.xml similarity index 98% rename from muyu-modules/muyv-etl/muyu-etl-service/pom.xml rename to muyu-modules/muyu-etl/muyu-etl-service/pom.xml index f24506b..7a85724 100644 --- a/muyu-modules/muyv-etl/muyu-etl-service/pom.xml +++ b/muyu-modules/muyu-etl/muyu-etl-service/pom.xml @@ -5,7 +5,7 @@ 4.0.0 com.muyu - muyv-etl + muyu-etl 3.6.3 diff --git a/muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/MuYuEtlApplication.java b/muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/MuYuEtlApplication.java similarity index 100% rename from muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/MuYuEtlApplication.java rename to muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/MuYuEtlApplication.java diff --git a/muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/controller/AssetImpowerController.java b/muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/controller/AssetImpowerController.java similarity index 100% rename from muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/controller/AssetImpowerController.java rename to muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/controller/AssetImpowerController.java diff --git a/muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/controller/BasicConfigInfoController.java b/muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/controller/BasicConfigInfoController.java similarity index 89% rename from muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/controller/BasicConfigInfoController.java rename to muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/controller/BasicConfigInfoController.java index ea8bb87..bda35f9 100644 --- a/muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/controller/BasicConfigInfoController.java +++ b/muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/controller/BasicConfigInfoController.java @@ -7,10 +7,8 @@ import com.muyu.common.core.web.page.TableDataInfo; import com.muyu.common.log.annotation.Log; import com.muyu.common.log.enums.BusinessType; import com.muyu.common.security.annotation.RequiresPermissions; -import com.muyu.etl.domain.AssetDataDict; -import com.muyu.etl.domain.BasicConfigInfo; -import com.muyu.etl.domain.DictInfo; -import com.muyu.etl.domain.Structure; +import com.muyu.etl.domain.*; +import com.muyu.etl.domain.req.TableInfoScopeReq; import com.muyu.etl.domain.resp.BasicDictResp; import com.muyu.etl.domain.resp.TableInfoStructureResp; import com.muyu.etl.domain.resp.TableTreeResp; @@ -114,16 +112,6 @@ public class BasicConfigInfoController extends BaseController { return toAjax(basicConfigInfoService.connectionTest(basicConfigInfo)); } -// /** -// * 获取成功链接中的 -// * @return -// */ -// @RequiresPermissions("etl:info:test") -// @Log(title = "获取成功链接中的") -// @GetMapping("/dataConstruct") -// public Result> getData() { -// return getDataTable(basicConfigInfoService.getDataByEtl()); -// } /** * 树级结构数据 @@ -211,6 +199,30 @@ public class BasicConfigInfoController extends BaseController { return Result.success(structureService.updateStructureInfoDict(structure), "修改成功"); } + /** + * 获取接入的所有表 + * @return + */ + @RequiresPermissions("etl:table:list") + @Log(title = "描述") + @PostMapping("/getTable") + public Result> getTableList(@RequestBody BasicConfigInfo basicConfigInfo){ + return Result.success(tableInfoService.getTableList(basicConfigInfo)); + } + + + /** + * 获取接入的所有表 + * @return + */ + @RequiresPermissions("etl:table:list") + @Log(title = "描述") + @PostMapping("/structureInfo") + public Result structureInfo(@RequestBody TableInfoScopeReq tableInfoScopeReq){ + return Result.success(basicConfigInfoService.structureInfo(tableInfoScopeReq)); + } + + // /** // * 模板 // * @return diff --git a/muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/mapper/AssetDataDictMapper.java b/muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/mapper/AssetDataDictMapper.java similarity index 100% rename from muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/mapper/AssetDataDictMapper.java rename to muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/mapper/AssetDataDictMapper.java diff --git a/muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/mapper/AssetImpowerMapper.java b/muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/mapper/AssetImpowerMapper.java similarity index 100% rename from muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/mapper/AssetImpowerMapper.java rename to muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/mapper/AssetImpowerMapper.java diff --git a/muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/mapper/BasicConfigInfoMapper.java b/muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/mapper/BasicConfigInfoMapper.java similarity index 100% rename from muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/mapper/BasicConfigInfoMapper.java rename to muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/mapper/BasicConfigInfoMapper.java diff --git a/muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/mapper/DictInfoMapper.java b/muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/mapper/DictInfoMapper.java similarity index 100% rename from muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/mapper/DictInfoMapper.java rename to muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/mapper/DictInfoMapper.java diff --git a/muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/mapper/StructureMapper.java b/muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/mapper/StructureMapper.java similarity index 100% rename from muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/mapper/StructureMapper.java rename to muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/mapper/StructureMapper.java diff --git a/muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/mapper/TableInfoMapper.java b/muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/mapper/TableInfoMapper.java similarity index 95% rename from muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/mapper/TableInfoMapper.java rename to muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/mapper/TableInfoMapper.java index 837ea13..93fda13 100644 --- a/muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/mapper/TableInfoMapper.java +++ b/muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/mapper/TableInfoMapper.java @@ -64,4 +64,6 @@ public interface TableInfoMapper extends BaseMapper TableInfo selectTableInfoByName(TableInfo table); + + TableInfo selectTableInfoByBasicAndParentId(TableInfo table); } diff --git a/muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/AssetDataDictService.java b/muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/AssetDataDictService.java similarity index 100% rename from muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/AssetDataDictService.java rename to muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/AssetDataDictService.java diff --git a/muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/AssetImpowerService.java b/muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/AssetImpowerService.java similarity index 100% rename from muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/AssetImpowerService.java rename to muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/AssetImpowerService.java diff --git a/muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/BasicConfigInfoService.java b/muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/BasicConfigInfoService.java similarity index 87% rename from muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/BasicConfigInfoService.java rename to muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/BasicConfigInfoService.java index 061c77c..8477c1d 100644 --- a/muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/BasicConfigInfoService.java +++ b/muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/BasicConfigInfoService.java @@ -4,11 +4,14 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.muyu.common.core.domain.Result; import com.muyu.common.core.web.page.TableDataInfo; import com.muyu.etl.domain.BasicConfigInfo; +import com.muyu.etl.domain.req.TableInfoScopeReq; import com.muyu.etl.domain.resp.BasicTableInfoResp; import com.muyu.etl.domain.resp.TableInfoStructureResp; import com.muyu.etl.domain.resp.TableTreeResp; import javax.servlet.ServletException; +import java.sql.Connection; +import java.sql.SQLException; import java.util.List; /** @@ -67,6 +70,8 @@ public interface BasicConfigInfoService extends IService */ public int deleteBasicConfigInfoById(Long id); + Connection getConn(BasicConfigInfo basicConfigInfo) throws SQLException; + boolean connectionTest(BasicConfigInfo basicConfigInfo) throws ServletException; // List getDataByEtl(); @@ -76,4 +81,6 @@ public interface BasicConfigInfoService extends IService TableInfoStructureResp getTableInfo(Long tableId); BasicTableInfoResp getBasicTableInfo(Long tableId); + + List structureInfo(TableInfoScopeReq tableInfoScopeReq); } diff --git a/muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/DictInfoService.java b/muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/DictInfoService.java similarity index 100% rename from muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/DictInfoService.java rename to muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/DictInfoService.java diff --git a/muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/StructureService.java b/muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/StructureService.java similarity index 100% rename from muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/StructureService.java rename to muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/StructureService.java diff --git a/muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/TableInfoService.java b/muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/TableInfoService.java similarity index 90% rename from muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/TableInfoService.java rename to muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/TableInfoService.java index b600922..79f2f0d 100644 --- a/muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/TableInfoService.java +++ b/muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/TableInfoService.java @@ -3,7 +3,9 @@ package com.muyu.etl.service; import java.util.List; import com.baomidou.mybatisplus.extension.service.IService; +import com.muyu.etl.domain.BasicConfigInfo; import com.muyu.etl.domain.TableInfo; +import com.muyu.etl.domain.req.TableInfoScopeReq; import com.muyu.etl.domain.resp.TableInfoStructureResp; /** @@ -64,4 +66,6 @@ public interface TableInfoService extends IService TableInfo selectTableInfoByName(TableInfo build); + List getTableList(BasicConfigInfo basicConfigInfo); + } diff --git a/muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/impl/AssetDataDictServiceImpl.java b/muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/impl/AssetDataDictServiceImpl.java similarity index 100% rename from muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/impl/AssetDataDictServiceImpl.java rename to muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/impl/AssetDataDictServiceImpl.java diff --git a/muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/impl/AssetImpowerServiceImpl.java b/muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/impl/AssetImpowerServiceImpl.java similarity index 100% rename from muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/impl/AssetImpowerServiceImpl.java rename to muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/impl/AssetImpowerServiceImpl.java diff --git a/muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/impl/BasicConfigInfoServiceImpl.java b/muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/impl/BasicConfigInfoServiceImpl.java similarity index 87% rename from muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/impl/BasicConfigInfoServiceImpl.java rename to muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/impl/BasicConfigInfoServiceImpl.java index db7cdab..0dba7f3 100644 --- a/muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/impl/BasicConfigInfoServiceImpl.java +++ b/muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/impl/BasicConfigInfoServiceImpl.java @@ -7,7 +7,9 @@ import com.muyu.common.security.utils.SecurityUtils; import com.muyu.etl.domain.BasicConfigInfo; import com.muyu.etl.domain.Structure; import com.muyu.etl.domain.TableInfo; +import com.muyu.etl.domain.req.TableInfoScopeReq; import com.muyu.etl.domain.resp.BasicTableInfoResp; +import com.muyu.etl.domain.resp.StructureValueResp; import com.muyu.etl.domain.resp.TableInfoStructureResp; import com.muyu.etl.domain.resp.TableTreeResp; import com.muyu.etl.mapper.BasicConfigInfoMapper; @@ -23,8 +25,8 @@ import org.springframework.transaction.annotation.Transactional; import javax.servlet.ServletException; import java.sql.*; import java.util.Date; +import java.util.HashMap; import java.util.List; -import java.util.concurrent.Callable; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; @@ -115,6 +117,23 @@ public class BasicConfigInfoServiceImpl extends ServiceImpl() {{ eq(BasicConfigInfo::getId, basicConfigInfo.getId()); @@ -375,18 +386,11 @@ public class BasicConfigInfoServiceImpl extends ServiceImpl structureList = structureService.list(new LambdaQueryWrapper() {{ + eq(Structure::getTableId, tableInfoScopeReq.getId()); + }}); + + //字段级 + if (tableInfoScopeReq.getLevel().equals("data-field")) { + return getList(tableInfoScopeReq, structureList, 1); + } + //行级 + if (tableInfoScopeReq.getLevel().equals("data-record")) { + return getList(tableInfoScopeReq, structureList, 5); + } + //页级 + if (tableInfoScopeReq.getLevel().equals("data-set")) { + return getList(tableInfoScopeReq, structureList, 10); + } + return null; + } + + /** + * 获取kvt结构及数据 + * + * @return + */ + public List> getList(TableInfoScopeReq tableInfoScopeReq, List structureList, int num) { + List> list = null; + HashMap valueRespHashMap = new HashMap<>(); + BasicConfigInfo basicConfigInfo = this.selectBasicConfigInfoById(tableInfoScopeReq.getBasicId()); + try { + Connection conn = this.getConn(basicConfigInfo); + PreparedStatement ps = conn.prepareStatement("select * from " + tableInfoScopeReq.getTableName() + " limit ?" ); + ResultSet rs = ps.executeQuery(); + while (rs.next()) { + for (int i = 0; i < structureList.size(); i++) { + StructureValueResp structureValueResp = StructureValueResp.saveBuilder(structureList.get(i), + String.valueOf(rs.getObject(i + 1))); + valueRespHashMap.put(structureList.get(i).getColumnName(), structureValueResp); + list.add(valueRespHashMap); + } + } + } catch (SQLException e) { + throw new RuntimeException(e); + } + return list; + } + } diff --git a/muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/impl/DictInfoServiceImpl.java b/muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/impl/DictInfoServiceImpl.java similarity index 100% rename from muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/impl/DictInfoServiceImpl.java rename to muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/impl/DictInfoServiceImpl.java diff --git a/muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/impl/StructureServiceImpl.java b/muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/impl/StructureServiceImpl.java similarity index 100% rename from muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/impl/StructureServiceImpl.java rename to muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/impl/StructureServiceImpl.java diff --git a/muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/impl/TableInfoServiceImpl.java b/muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/impl/TableInfoServiceImpl.java similarity index 85% rename from muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/impl/TableInfoServiceImpl.java rename to muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/impl/TableInfoServiceImpl.java index 0899b56..cbc59d9 100644 --- a/muyu-modules/muyv-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/impl/TableInfoServiceImpl.java +++ b/muyu-modules/muyu-etl/muyu-etl-service/src/main/java/com/muyu/etl/service/impl/TableInfoServiceImpl.java @@ -1,5 +1,6 @@ package com.muyu.etl.service.impl; +import java.util.ArrayList; import java.util.List; import java.util.concurrent.Future; @@ -8,6 +9,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.muyu.common.core.utils.DateUtils; import com.muyu.etl.domain.BasicConfigInfo; import com.muyu.etl.domain.Structure; +import com.muyu.etl.domain.req.TableInfoScopeReq; import com.muyu.etl.domain.resp.TableInfoStructureResp; import com.muyu.etl.service.BasicConfigInfoService; import com.muyu.etl.service.StructureService; @@ -106,5 +108,18 @@ public class TableInfoServiceImpl extends ServiceImpl getTableList(BasicConfigInfo basicConfigInfo) { + TableInfo tableInfo = tableInfoMapper.selectTableInfoByBasicAndParentId(new TableInfo() {{ + setBasicId(basicConfigInfo.getId()); + }}); + return tableInfoMapper.selectTableInfoList(new TableInfo() {{ + setParentId(tableInfo.getId()); + setBasicId(basicConfigInfo.getId()); + }}); + } + + + } diff --git a/muyu-modules/muyv-etl/muyu-etl-service/src/main/resources/bootstrap.yml b/muyu-modules/muyu-etl/muyu-etl-service/src/main/resources/bootstrap.yml similarity index 100% rename from muyu-modules/muyv-etl/muyu-etl-service/src/main/resources/bootstrap.yml rename to muyu-modules/muyu-etl/muyu-etl-service/src/main/resources/bootstrap.yml diff --git a/muyu-modules/muyv-etl/muyu-etl-service/src/main/resources/mapper/AssetDataDictMapper.xml b/muyu-modules/muyu-etl/muyu-etl-service/src/main/resources/mapper/AssetDataDictMapper.xml similarity index 100% rename from muyu-modules/muyv-etl/muyu-etl-service/src/main/resources/mapper/AssetDataDictMapper.xml rename to muyu-modules/muyu-etl/muyu-etl-service/src/main/resources/mapper/AssetDataDictMapper.xml diff --git a/muyu-modules/muyv-etl/muyu-etl-service/src/main/resources/mapper/AssetImpowerMapper.xml b/muyu-modules/muyu-etl/muyu-etl-service/src/main/resources/mapper/AssetImpowerMapper.xml similarity index 100% rename from muyu-modules/muyv-etl/muyu-etl-service/src/main/resources/mapper/AssetImpowerMapper.xml rename to muyu-modules/muyu-etl/muyu-etl-service/src/main/resources/mapper/AssetImpowerMapper.xml diff --git a/muyu-modules/muyv-etl/muyu-etl-service/src/main/resources/mapper/BasicConfigInfoMapper.xml b/muyu-modules/muyu-etl/muyu-etl-service/src/main/resources/mapper/BasicConfigInfoMapper.xml similarity index 100% rename from muyu-modules/muyv-etl/muyu-etl-service/src/main/resources/mapper/BasicConfigInfoMapper.xml rename to muyu-modules/muyu-etl/muyu-etl-service/src/main/resources/mapper/BasicConfigInfoMapper.xml diff --git a/muyu-modules/muyv-etl/muyu-etl-service/src/main/resources/mapper/DictInfoMapper.xml b/muyu-modules/muyu-etl/muyu-etl-service/src/main/resources/mapper/DictInfoMapper.xml similarity index 100% rename from muyu-modules/muyv-etl/muyu-etl-service/src/main/resources/mapper/DictInfoMapper.xml rename to muyu-modules/muyu-etl/muyu-etl-service/src/main/resources/mapper/DictInfoMapper.xml diff --git a/muyu-modules/muyv-etl/muyu-etl-service/src/main/resources/mapper/StructureMapper.xml b/muyu-modules/muyu-etl/muyu-etl-service/src/main/resources/mapper/StructureMapper.xml similarity index 100% rename from muyu-modules/muyv-etl/muyu-etl-service/src/main/resources/mapper/StructureMapper.xml rename to muyu-modules/muyu-etl/muyu-etl-service/src/main/resources/mapper/StructureMapper.xml diff --git a/muyu-modules/muyv-etl/muyu-etl-service/src/main/resources/mapper/TableInfoMapper.xml b/muyu-modules/muyu-etl/muyu-etl-service/src/main/resources/mapper/TableInfoMapper.xml similarity index 96% rename from muyu-modules/muyv-etl/muyu-etl-service/src/main/resources/mapper/TableInfoMapper.xml rename to muyu-modules/muyu-etl/muyu-etl-service/src/main/resources/mapper/TableInfoMapper.xml index 0e750b9..c3bef9a 100644 --- a/muyu-modules/muyv-etl/muyu-etl-service/src/main/resources/mapper/TableInfoMapper.xml +++ b/muyu-modules/muyu-etl/muyu-etl-service/src/main/resources/mapper/TableInfoMapper.xml @@ -46,6 +46,11 @@ where basic_id = #{basicId} and table_name = #{tableName} + + insert into table_info diff --git a/muyu-modules/muyv-etl/pom.xml b/muyu-modules/muyu-etl/pom.xml similarity index 91% rename from muyu-modules/muyv-etl/pom.xml rename to muyu-modules/muyu-etl/pom.xml index 43647bd..5456726 100644 --- a/muyu-modules/muyv-etl/pom.xml +++ b/muyu-modules/muyu-etl/pom.xml @@ -9,12 +9,13 @@ 3.6.3 - muyv-etl + muyu-etl pom muyu-etl-common muyu-etl-remote muyu-etl-service + muyu-etl-client diff --git a/muyu-modules/muyu-ruleEngine/muyu-ruleEngine-client/pom.xml b/muyu-modules/muyu-ruleEngine/muyu-ruleEngine-client/pom.xml new file mode 100644 index 0000000..fdd1088 --- /dev/null +++ b/muyu-modules/muyu-ruleEngine/muyu-ruleEngine-client/pom.xml @@ -0,0 +1,120 @@ + + + 4.0.0 + + com.muyu + muyu-ruleEngine + 3.6.3 + + + muyu-ruleEngine-client + + + 17 + 17 + UTF-8 + + + + org.postgresql + postgresql + 42.3.8 + + + + com.muyu + muyu-etl-common + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-sentinel + + + + + org.springframework.boot + spring-boot-starter-actuator + + + + + io.springfox + springfox-swagger-ui + ${swagger.fox.version} + + + + + com.mysql + mysql-connector-j + + + + + com.muyu + muyu-common-datasource + + + + + com.muyu + muyu-common-datascope + + + + + com.muyu + muyu-common-log + + + + + com.muyu + muyu-common-swagger + + + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + true + + + + + + diff --git a/muyu-modules/muyu-ruleEngine/muyu-ruleEngine-client/src/main/java/com/muyu/EngineClientApplication.java b/muyu-modules/muyu-ruleEngine/muyu-ruleEngine-client/src/main/java/com/muyu/EngineClientApplication.java new file mode 100644 index 0000000..e155da5 --- /dev/null +++ b/muyu-modules/muyu-ruleEngine/muyu-ruleEngine-client/src/main/java/com/muyu/EngineClientApplication.java @@ -0,0 +1,18 @@ +package com.muyu; + +import com.muyu.common.security.annotation.EnableCustomConfig; +import com.muyu.common.security.annotation.EnableMyFeignClients; +import com.muyu.common.swagger.annotation.EnableCustomSwagger2; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.openfeign.EnableFeignClients; + +@EnableCustomConfig +@EnableCustomSwagger2 +@EnableMyFeignClients +@EnableFeignClients +@SpringBootApplication +public class EngineClientApplication { + public static void main(String[] args) { + System.out.println("Hello world!"); + } +} diff --git a/muyu-modules/muyu-ruleEngine/muyu-ruleEngine-client/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/muyu-modules/muyu-ruleEngine/muyu-ruleEngine-client/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000..e69de29 diff --git a/muyu-modules/muyu-ruleEngine/muyu-ruleEngine-remote/pom.xml b/muyu-modules/muyu-ruleEngine/muyu-ruleEngine-remote/pom.xml index b125bcc..8fe2ae6 100644 --- a/muyu-modules/muyu-ruleEngine/muyu-ruleEngine-remote/pom.xml +++ b/muyu-modules/muyu-ruleEngine/muyu-ruleEngine-remote/pom.xml @@ -16,5 +16,11 @@ 17 UTF-8 + + + com.muyu + muyu-common-core + + diff --git a/muyu-modules/muyu-ruleEngine/muyu-ruleEngine-remote/src/main/java/com/muyu/Main.java b/muyu-modules/muyu-ruleEngine/muyu-ruleEngine-remote/src/main/java/com/muyu/Main.java deleted file mode 100644 index 95690d4..0000000 --- a/muyu-modules/muyu-ruleEngine/muyu-ruleEngine-remote/src/main/java/com/muyu/Main.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.muyu; - -public class Main { - public static void main(String[] args) { - System.out.println("Hello world!"); - } -} \ No newline at end of file diff --git a/muyu-modules/muyu-ruleEngine/muyu-ruleEngine-remote/src/main/java/com/muyu/remote/RemoteRuleEngineService.java b/muyu-modules/muyu-ruleEngine/muyu-ruleEngine-remote/src/main/java/com/muyu/remote/RemoteRuleEngineService.java new file mode 100644 index 0000000..6a9e3b4 --- /dev/null +++ b/muyu-modules/muyu-ruleEngine/muyu-ruleEngine-remote/src/main/java/com/muyu/remote/RemoteRuleEngineService.java @@ -0,0 +1,35 @@ +//package com.muyu.remote; +// +//import com.muyu.common.core.constant.SecurityConstants; +//import com.muyu.common.core.constant.ServiceNameConstants; +//import com.muyu.common.core.domain.Result; +//import com.muyu.common.system.domain.LoginUser; +//import com.muyu.remote.factory.RemoteRuleEngineFallbackFactory; +//import org.springframework.cloud.openfeign.FeignClient; +//import org.springframework.web.bind.annotation.GetMapping; +//import org.springframework.web.bind.annotation.PathVariable; +//import org.springframework.web.bind.annotation.RequestHeader; +// +///** +// * 用户服务 +// * +// * @author muyu +// */ +//@FeignClient(contextId = "remoteRuleEngineService", value = ServiceNameConstants.ENGINE_SERVICE, fallbackFactory = RemoteRuleEngineFallbackFactory.class) +//public interface RemoteRuleEngineService { +// /** +// * 通过用户名查询用户信息 +// * +// * @param username 用户名 +// * @param source 请求来源 +// * +// * @return 结果 +// */ +// @GetMapping("/user/info/{username}") +// public Result getUserInfo (@PathVariable("username") String username, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); +// +// +// +// +// +//} diff --git a/muyu-modules/muyu-ruleEngine/muyu-ruleEngine-remote/src/main/java/com/muyu/remote/factory/RemoteRuleEngineFallbackFactory.java b/muyu-modules/muyu-ruleEngine/muyu-ruleEngine-remote/src/main/java/com/muyu/remote/factory/RemoteRuleEngineFallbackFactory.java new file mode 100644 index 0000000..4612f07 --- /dev/null +++ b/muyu-modules/muyu-ruleEngine/muyu-ruleEngine-remote/src/main/java/com/muyu/remote/factory/RemoteRuleEngineFallbackFactory.java @@ -0,0 +1,31 @@ +//package com.muyu.remote.factory; +// +//import com.muyu.common.core.domain.Result; +//import com.muyu.common.system.domain.LoginUser; +//import com.muyu.remote.RemoteRuleEngineService; +//import org.slf4j.Logger; +//import org.slf4j.LoggerFactory; +//import org.springframework.cloud.openfeign.FallbackFactory; +//import org.springframework.stereotype.Component; +// +///** +// * 用户服务降级处理 +// * +// * @author muyu +// */ +//@Component +//public class RemoteRuleEngineFallbackFactory implements FallbackFactory { +// private static final Logger log = LoggerFactory.getLogger(RemoteRuleEngineFallbackFactory.class); +// +// @Override +// public RemoteRuleEngineService create(Throwable throwable) { +// log.error("用户服务调用失败:{}", throwable.getMessage()); +// return new RemoteRuleEngineService() { +// +// @Override +// public Result getUserInfo(String username, String source) { +// return null; +// } +// }; +// } +//} diff --git a/muyu-modules/muyu-ruleEngine/muyu-ruleEngine-remote/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/muyu-modules/muyu-ruleEngine/muyu-ruleEngine-remote/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000..59c8409 --- /dev/null +++ b/muyu-modules/muyu-ruleEngine/muyu-ruleEngine-remote/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +com.muyu.remote.factory.RemoteRuleEngineFallbackFactory diff --git a/muyu-modules/muyu-ruleEngine/muyu-ruleEngine-service/src/main/java/com/muyu/engine/controller/RuleEngineVersionController.java b/muyu-modules/muyu-ruleEngine/muyu-ruleEngine-service/src/main/java/com/muyu/engine/controller/RuleEngineVersionController.java index 8872324..87de74f 100644 --- a/muyu-modules/muyu-ruleEngine/muyu-ruleEngine-service/src/main/java/com/muyu/engine/controller/RuleEngineVersionController.java +++ b/muyu-modules/muyu-ruleEngine/muyu-ruleEngine-service/src/main/java/com/muyu/engine/controller/RuleEngineVersionController.java @@ -1,6 +1,7 @@ package com.muyu.engine.controller; import java.util.List; +import javax.servlet.ServletException; import javax.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; @@ -107,8 +108,7 @@ public class RuleEngineVersionController extends BaseController @RequiresPermissions("engine:version:update") @Log(title = "规则版本", businessType = BusinessType.DELETE) @PostMapping("/saveCoding") - public Result saveCoding(@RequestBody RuleEngineVersion ruleEngineVersion) - { + public Result saveCoding(@RequestBody RuleEngineVersion ruleEngineVersion) throws ServletException { return toAjax(ruleEngineVersionService.saveCoding(ruleEngineVersion)); } diff --git a/muyu-modules/muyu-ruleEngine/muyu-ruleEngine-service/src/main/java/com/muyu/engine/service/RuleEngineVersionService.java b/muyu-modules/muyu-ruleEngine/muyu-ruleEngine-service/src/main/java/com/muyu/engine/service/RuleEngineVersionService.java index 1195a47..a85ccca 100644 --- a/muyu-modules/muyu-ruleEngine/muyu-ruleEngine-service/src/main/java/com/muyu/engine/service/RuleEngineVersionService.java +++ b/muyu-modules/muyu-ruleEngine/muyu-ruleEngine-service/src/main/java/com/muyu/engine/service/RuleEngineVersionService.java @@ -5,6 +5,8 @@ import java.util.List; import com.baomidou.mybatisplus.extension.service.IService; import com.muyu.engine.domain.RuleEngineVersion; +import javax.servlet.ServletException; + /** * 规则版本Service接口 * @@ -66,7 +68,7 @@ public interface RuleEngineVersionService extends IService * @param ruleEngineVersion * @return boolean */ - boolean saveCoding(RuleEngineVersion ruleEngineVersion); + boolean saveCoding(RuleEngineVersion ruleEngineVersion) throws ServletException; /** * 测试引擎版本 diff --git a/muyu-modules/muyu-ruleEngine/muyu-ruleEngine-service/src/main/java/com/muyu/engine/service/impl/RuleEngineVersionServiceImpl.java b/muyu-modules/muyu-ruleEngine/muyu-ruleEngine-service/src/main/java/com/muyu/engine/service/impl/RuleEngineVersionServiceImpl.java index 8ab6903..d4a3f4b 100644 --- a/muyu-modules/muyu-ruleEngine/muyu-ruleEngine-service/src/main/java/com/muyu/engine/service/impl/RuleEngineVersionServiceImpl.java +++ b/muyu-modules/muyu-ruleEngine/muyu-ruleEngine-service/src/main/java/com/muyu/engine/service/impl/RuleEngineVersionServiceImpl.java @@ -111,7 +111,11 @@ public class RuleEngineVersionServiceImpl extends ServiceImpl() {{ + eq(RuleEngineVersion::getCode, ruleEngineVersion.getCode()); + }}); + if (!"null".equals(one)) throw new ServletException("该版本已存在"); String codeIng = ruleEngineVersion.getCodeIng(); try { String path = codeIng.substring(codeIng.indexOf("com"), codeIng.indexOf(";")).replaceAll("\\.", "/").trim(); diff --git a/muyu-modules/muyu-ruleEngine/pom.xml b/muyu-modules/muyu-ruleEngine/pom.xml index 33b2b1e..7a4f5a9 100644 --- a/muyu-modules/muyu-ruleEngine/pom.xml +++ b/muyu-modules/muyu-ruleEngine/pom.xml @@ -16,6 +16,7 @@ muyu-ruleEngine-common muyu-ruleEngine-remote muyu-ruleEngine-service + muyu-ruleEngine-client diff --git a/muyu-modules/pom.xml b/muyu-modules/pom.xml index 1b901cf..b193b26 100644 --- a/muyu-modules/pom.xml +++ b/muyu-modules/pom.xml @@ -13,7 +13,7 @@ muyu-gen muyu-job muyu-file - muyv-etl + muyu-etl muyu-ruleEngine