From 5d136679fdb1d7bc13c2d028302baa7cc90c0513 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Thu, 27 Jun 2024 16:54:37 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-114392=20FR-FBP=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E8=AE=BE=E8=AE=A1=E9=80=82=E9=85=8D=20?= =?UTF-8?q?=E9=83=A8=E5=88=86=E4=BB=A3=E7=A0=81=E8=A7=84=E8=8C=83+decision?= =?UTF-8?q?=E4=BE=9D=E8=B5=96=E5=8E=BB=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 2 -- .../fr/start/server/DesignEmbedHelper.java | 1 - .../server/FineEmbedServerActivator.java | 1 + .../adaptation/ReportAdaptationComponent.java | 3 +++ .../boot/pre/DesignPreStartComponent.java | 20 ++++++++++--------- 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/build.gradle b/build.gradle index ac330091bd..471d66de7b 100644 --- a/build.gradle +++ b/build.gradle @@ -101,11 +101,9 @@ allprojects { implementation 'io.socket:socket.io-client:0.7.0' implementation('com.fr.third:fine-third:' + frVersion) { exclude group: "com.fr.cbb", module: "fine-cbb" } implementation 'com.fr.core:fine-core:' + frDevVersion - implementation 'com.fr.activator:fine-activator:' + frVersion implementation 'com.fr.datasource:fine-datasource-api:' + fdlVersion implementation 'com.fr.datasource:fine-datasource-core:' + fdlVersion implementation 'com.fr.decision:decision-i18n:' + frVersion - implementation 'com.fr.schedule:fine-schedule:' + frVersion implementation 'com.fr.report:engine-report:' + frDevVersion implementation 'com.fr.report:engine-x:' + frDevVersion implementation 'com.fr.report:engine-chart:' + frDevVersion diff --git a/designer-base/src/main/java/com/fr/start/server/DesignEmbedHelper.java b/designer-base/src/main/java/com/fr/start/server/DesignEmbedHelper.java index 487e278647..c63c0747cb 100644 --- a/designer-base/src/main/java/com/fr/start/server/DesignEmbedHelper.java +++ b/designer-base/src/main/java/com/fr/start/server/DesignEmbedHelper.java @@ -100,7 +100,6 @@ public class DesignEmbedHelper { Set> classes = new HashSet>(); classes.add(EmbedWebApplicationInitializer.class); context.addServletContainerInitializer(initializer, classes); - context.addServletContainerInitializer(new WsSci(), Sets.newHashSet(WebSocketEndpoint.class)); } /** diff --git a/designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java b/designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java index 37b6effacb..3f97b5dc42 100644 --- a/designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java +++ b/designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java @@ -91,6 +91,7 @@ public class FineEmbedServerActivator extends Activator { //直接指定initializer,tomcat就不用再扫描一遍了 SpringServletContainerInitializer initializer = new SpringServletContainerInitializer(); Set> classes = new HashSet>(); + /// 该Initializer已去除 //classes.add(FineWebApplicationInitializer.class); context.addServletContainerInitializer(initializer, classes); // 后面本地设计的内置服务器考虑用XST diff --git a/designer-realize/src/main/java/com/fanruan/boot/adaptation/ReportAdaptationComponent.java b/designer-realize/src/main/java/com/fanruan/boot/adaptation/ReportAdaptationComponent.java index 30eeb3f302..ecfce94222 100644 --- a/designer-realize/src/main/java/com/fanruan/boot/adaptation/ReportAdaptationComponent.java +++ b/designer-realize/src/main/java/com/fanruan/boot/adaptation/ReportAdaptationComponent.java @@ -20,6 +20,9 @@ import com.fr.locale.LocaleScope; @FineComponent(name = "fine_report_adaptation") public class ReportAdaptationComponent { + /** + * 启动 + */ @Start public void start() { checkI18n(); diff --git a/designer-realize/src/main/java/com/fanruan/boot/pre/DesignPreStartComponent.java b/designer-realize/src/main/java/com/fanruan/boot/pre/DesignPreStartComponent.java index c30a97436d..8f3cdfa09b 100644 --- a/designer-realize/src/main/java/com/fanruan/boot/pre/DesignPreStartComponent.java +++ b/designer-realize/src/main/java/com/fanruan/boot/pre/DesignPreStartComponent.java @@ -84,7 +84,13 @@ import java.util.concurrent.CompletableFuture; */ @FineComponent(name = "design_pre_start") public class DesignPreStartComponent { + private static final String SEPARATOR = "/"; + private static final String CPT = ".cpt"; + private static final String XML = ".xml"; + /** + * 启动 + */ @Start public void start() throws Exception { // 1.注册ConfigFactory与对应的membuilder @@ -146,17 +152,17 @@ public class DesignPreStartComponent { @Override public @Nullable InputStream getResource(@NotNull String resourcePath) { - if (!resourcePath.startsWith("/")) { - resourcePath = "/" + resourcePath; + if (!resourcePath.startsWith(SEPARATOR)) { + resourcePath = SEPARATOR + resourcePath; } InputStream result = null; try { - if (resourcePath.endsWith(".cpt")) { + if (resourcePath.endsWith(CPT)) { result = new ByteArrayInputStream(WorkContext.getWorkResource().readFully(CommonUtils.pathJoin(ProjectConstants.REPORTLETS_NAME, resourcePath))); } - if (resourcePath.endsWith(".xml")) { + if (resourcePath.endsWith(XML)) { result = new ByteArrayInputStream(WorkContext.getWorkResource().readFully(CommonUtils.pathJoin(ProjectConstants.RESOURCES_NAME, resourcePath))); } @@ -167,11 +173,7 @@ public class DesignPreStartComponent { } catch (Exception ignored) { } - if (resourcePath.startsWith("/")) { - result = ResourceLoader.getResourceAsStream(resourcePath, GeneralUtils.class); - } else { - result = ResourceLoader.getResourceAsStream("/" + resourcePath, GeneralUtils.class); - } + result = ResourceLoader.getResourceAsStream(resourcePath, GeneralUtils.class); return result; } });