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 f3de414e70..2bb03fc45d 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 @@ -4,6 +4,7 @@ import com.fanruan.carina.Carina; import com.fanruan.carina.annotions.DependsOn; import com.fanruan.carina.annotions.FineComponent; import com.fanruan.carina.annotions.Start; +import com.fanruan.carina.context.ContextListener; import com.fanruan.plugins.resource.PluginResourceHelper; import com.fanruan.portal.FinePortal; import com.fanruan.portal.module.PortalModule; @@ -23,7 +24,6 @@ import com.fr.general.InterProviderImpl; import com.fr.locale.InterMutableKey; import com.fr.locale.LocaleMarker; import com.fr.locale.LocaleScope; -import com.fr.plugin.ExtraClassManager; import com.fr.plugin.context.PluginContext; import com.fr.plugin.injectable.PluginModule; import com.fr.plugin.observer.PluginEventType; @@ -167,25 +167,31 @@ public class ReportAdaptationComponent { } private void registerPluginModules() { - // 注册插件模块 - try { - Set systemOptionProviders = ExtraClassManager.getInstance().getArray(SystemOptionProvider.XML_TAG); - if (!CollectionUtils.isEmpty(systemOptionProviders)) { - // 资源引入采用新的方式,WebCoalition接口不再继承使用,这里只处理模块注册 - for (SystemOptionProvider optionProvider : systemOptionProviders) { - PortalModule portalModule = PortalModule.create(optionProvider.id(), optionProvider.displayName()) - .sortIndex(optionProvider.sortIndex()) - .dynamicControl(m -> new PluginPortalModuleDevice(optionProvider.parentId(), m)); - - FinePortal.registerModule(optionProvider.parentId(), portalModule); - - // 插件资源注册 - PluginResourceHelper.getInstance().registerAtom2Portal(optionProvider); + + Carina.getApplicationContext().addListener(new ContextListener() { + @Override + public void onStart() { + // 注册插件模块 + try { + Set systemOptionProviders = ExtraDecisionClassManager.getInstance().getArray(SystemOptionProvider.XML_TAG); + if (!CollectionUtils.isEmpty(systemOptionProviders)) { + // 资源引入采用新的方式,WebCoalition接口不再继承使用,这里只处理模块注册 + for (SystemOptionProvider optionProvider : systemOptionProviders) { + PortalModule portalModule = PortalModule.create(optionProvider.id(), optionProvider.displayName()) + .sortIndex(optionProvider.sortIndex()) + .dynamicControl(m -> new PluginPortalModuleDevice(optionProvider.parentId(), m)); + + FinePortal.registerModule(optionProvider.parentId(), portalModule); + + // 插件资源注册 + PluginResourceHelper.getInstance().registerAtom2Portal(optionProvider); + } + } + } catch (Exception e) { + throw new RuntimeException(e); } } - } catch (Exception e) { - throw new RuntimeException(e); - } + }); } private void checkI18n() { for (LocaleMarker marker : Carina.getApplicationContext().group(InterMutableKey.class).getAll()) {