Commit 39ac59efee240f063d0b8f5074c5e6d388553b33
1 parent
e46286d1
默认禁用报表模块,
Showing
3 changed files
with
40 additions
and
13 deletions
yudao-framework/yudao-spring-boot-starter-banner/src/main/java/cn/iocoder/yudao/framework/banner/core/BannerApplicationRunner.java
| @@ -4,6 +4,7 @@ import cn.hutool.core.thread.ThreadUtil; | @@ -4,6 +4,7 @@ import cn.hutool.core.thread.ThreadUtil; | ||
| 4 | import lombok.extern.slf4j.Slf4j; | 4 | import lombok.extern.slf4j.Slf4j; |
| 5 | import org.springframework.boot.ApplicationArguments; | 5 | import org.springframework.boot.ApplicationArguments; |
| 6 | import org.springframework.boot.ApplicationRunner; | 6 | import org.springframework.boot.ApplicationRunner; |
| 7 | +import org.springframework.util.ClassUtils; | ||
| 7 | 8 | ||
| 8 | import java.util.concurrent.TimeUnit; | 9 | import java.util.concurrent.TimeUnit; |
| 9 | 10 | ||
| @@ -30,7 +31,17 @@ public class BannerApplicationRunner implements ApplicationRunner { | @@ -30,7 +31,17 @@ public class BannerApplicationRunner implements ApplicationRunner { | ||
| 30 | "https://doc.iocoder.cn", | 31 | "https://doc.iocoder.cn", |
| 31 | "https://t.zsxq.com/02Yf6M7Qn", | 32 | "https://t.zsxq.com/02Yf6M7Qn", |
| 32 | "https://t.zsxq.com/02B6ujIee"); | 33 | "https://t.zsxq.com/02B6ujIee"); |
| 34 | + | ||
| 35 | + // 数据报表 | ||
| 36 | + if (isNotPresent("cn.iocoder.yudao.module.visualization.framework.security.config.SecurityConfiguration")) { | ||
| 37 | + System.out.println("[报表模块 yudao-module-visualization-biz - 已禁用][参考 https://doc.iocoder.cn/report/ 开启]"); | ||
| 38 | + } | ||
| 39 | + // 支付模块 | ||
| 33 | }); | 40 | }); |
| 34 | } | 41 | } |
| 35 | 42 | ||
| 43 | + private static boolean isNotPresent(String className) { | ||
| 44 | + return !ClassUtils.isPresent(className, ClassUtils.getDefaultClassLoader()); | ||
| 45 | + } | ||
| 46 | + | ||
| 36 | } | 47 | } |
yudao-framework/yudao-spring-boot-starter-flowable/src/main/java/cn/iocoder/yudao/framework/flowable/config/YudaoFlowableConfiguration.java
| @@ -5,11 +5,32 @@ import cn.iocoder.yudao.framework.flowable.core.web.FlowableWebFilter; | @@ -5,11 +5,32 @@ import cn.iocoder.yudao.framework.flowable.core.web.FlowableWebFilter; | ||
| 5 | import org.springframework.boot.web.servlet.FilterRegistrationBean; | 5 | import org.springframework.boot.web.servlet.FilterRegistrationBean; |
| 6 | import org.springframework.context.annotation.Bean; | 6 | import org.springframework.context.annotation.Bean; |
| 7 | import org.springframework.context.annotation.Configuration; | 7 | import org.springframework.context.annotation.Configuration; |
| 8 | +import org.springframework.core.task.AsyncListenableTaskExecutor; | ||
| 9 | +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; | ||
| 8 | 10 | ||
| 9 | @Configuration | 11 | @Configuration |
| 10 | public class YudaoFlowableConfiguration { | 12 | public class YudaoFlowableConfiguration { |
| 11 | 13 | ||
| 12 | /** | 14 | /** |
| 15 | + * 参考 {@link org.flowable.spring.boot.FlowableJobConfiguration} 类,创建对应的 AsyncListenableTaskExecutor Bean | ||
| 16 | + * | ||
| 17 | + * 如果不创建,会导致项目启动时,Flowable 报错的问题 | ||
| 18 | + */ | ||
| 19 | + @Bean | ||
| 20 | + public AsyncListenableTaskExecutor taskExecutor() { | ||
| 21 | + ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); | ||
| 22 | + executor.setCorePoolSize(8); | ||
| 23 | + executor.setMaxPoolSize(8); | ||
| 24 | + executor.setQueueCapacity(100); | ||
| 25 | + executor.setThreadNamePrefix("flowable-task-Executor-"); | ||
| 26 | + executor.setAwaitTerminationSeconds(30); | ||
| 27 | + executor.setWaitForTasksToCompleteOnShutdown(true); | ||
| 28 | + executor.setAllowCoreThreadTimeOut(true); | ||
| 29 | + executor.initialize(); | ||
| 30 | + return executor; | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + /** | ||
| 13 | * 配置 flowable Web 过滤器 | 34 | * 配置 flowable Web 过滤器 |
| 14 | */ | 35 | */ |
| 15 | @Bean | 36 | @Bean |
yudao-server/pom.xml
| @@ -51,23 +51,18 @@ | @@ -51,23 +51,18 @@ | ||
| 51 | <artifactId>yudao-module-product-biz</artifactId> | 51 | <artifactId>yudao-module-product-biz</artifactId> |
| 52 | <version>${revision}</version> | 52 | <version>${revision}</version> |
| 53 | </dependency> | 53 | </dependency> |
| 54 | - <!--数据可视化报表--> | ||
| 55 | - <dependency> | ||
| 56 | - <groupId>cn.iocoder.boot</groupId> | ||
| 57 | - <artifactId>yudao-module-visualization-biz</artifactId> | ||
| 58 | - <version>${revision}</version> | ||
| 59 | - </dependency> | ||
| 60 | - <!-- 默认引入 yudao-module-bpm-biz-flowable 实现,可以替换为 yudao-module-bpm-biz-activiti 实现--> | 54 | + <!-- 数据报表 --> |
| 61 | <!-- <dependency>--> | 55 | <!-- <dependency>--> |
| 62 | <!-- <groupId>cn.iocoder.boot</groupId>--> | 56 | <!-- <groupId>cn.iocoder.boot</groupId>--> |
| 63 | -<!-- <artifactId>yudao-module-bpm-biz</artifactId>--> | 57 | +<!-- <artifactId>yudao-module-visualization-biz</artifactId>--> |
| 64 | <!-- <version>${revision}</version>--> | 58 | <!-- <version>${revision}</version>--> |
| 65 | <!-- </dependency>--> | 59 | <!-- </dependency>--> |
| 66 | - <!-- <dependency>--> | ||
| 67 | - <!-- <groupId>cn.iocoder.boot</groupId>--> | ||
| 68 | - <!-- <artifactId>yudao-module-bpm-biz-activiti</artifactId>--> | ||
| 69 | - <!-- <version>${revision}</version>--> | ||
| 70 | -<!-- </dependency>--> | 60 | + <!-- 工作流 --> |
| 61 | + <dependency> | ||
| 62 | + <groupId>cn.iocoder.boot</groupId> | ||
| 63 | + <artifactId>yudao-module-bpm-biz</artifactId> | ||
| 64 | + <version>${revision}</version> | ||
| 65 | + </dependency> | ||
| 71 | <dependency> | 66 | <dependency> |
| 72 | <groupId>cn.iocoder.boot</groupId> | 67 | <groupId>cn.iocoder.boot</groupId> |
| 73 | <artifactId>yudao-spring-boot-starter-biz-error-code</artifactId> | 68 | <artifactId>yudao-spring-boot-starter-biz-error-code</artifactId> |