Browse Source

Pull request #15133: REPORT-130954 fix: 设计器启动屏蔽不支持的功能 - master 分支

Merge in DESIGN/design from ~ANNER/design:fbp/master to fbp/master

* commit '80d07c44c8262b27cbb7200c49a6ddcbef25e204':
  REPORT-138114 fix: 添加一个模块依赖
  REPORT-138114 fix: 修复报表设置显示问题 & 规避服务注册的模块
  REPORT-130954 fix: 设计器启动屏蔽不支持的功能
fbp/master
Anner-王敬松 1 month ago
parent
commit
c098a4a856
  1. 1
      build.gradle
  2. 101
      designer-realize/src/main/java/com/fanruan/boot/adaptation/DesignServerSupportModule.java
  3. 5
      designer-realize/src/main/java/com/fanruan/boot/adaptation/ReportAdaptationComponent.java

1
build.gradle

@ -110,6 +110,7 @@ allprojects {
implementation 'com.fr.datasource:fine-datasource-core:' + fdlVersion
implementation 'com.fr.datasource:fine-datasource-web:' + fdlVersion
implementation 'com.fr.decision:decision-i18n:' + frVersion
implementation 'com.fr.decision:decision-report:' + frVersion
implementation 'com.fr.report:engine-report:' + frDevVersion
implementation 'com.fr.report:engine-x:' + frDevVersion
implementation 'com.fr.report:engine-chart:' + frDevVersion

101
designer-realize/src/main/java/com/fanruan/boot/adaptation/DesignServerSupportModule.java

@ -0,0 +1,101 @@
package com.fanruan.boot.adaptation;
import com.fanruan.carina.Carina;
import com.fanruan.carina.context.ContextListener;
import com.fanruan.portal.module.PortalModuleManager;
import com.fr.third.guava.collect.Sets;
import java.util.Optional;
import java.util.Set;
import static com.fanruan.auth.authority.AuthAuthorityItems.USER_ADD_DEPARTMENT_ID;
import static com.fanruan.auth.authority.AuthAuthorityItems.USER_ADD_ID;
import static com.fanruan.auth.authority.AuthAuthorityItems.USER_ADD_ROLE_ID;
import static com.fanruan.auth.authority.AuthAuthorityItems.USER_DELETE_ID;
import static com.fanruan.auth.authority.AuthAuthorityItems.USER_DELETE_ROLE_ID;
import static com.fanruan.auth.authority.AuthAuthorityItems.USER_EDIT_DEP_ROLE_ID;
import static com.fanruan.auth.authority.AuthAuthorityItems.USER_EDIT_EDIT_INFO_ID;
import static com.fanruan.auth.authority.AuthAuthorityItems.USER_EDIT_ID;
import static com.fanruan.auth.authority.AuthAuthorityItems.USER_EDIT_RESET_PASSWORD_ID;
import static com.fanruan.auth.authority.AuthAuthorityItems.USER_FORBIDDEN_ID;
import static com.fanruan.auth.authority.AuthAuthorityItems.USER_ID;
import static com.fanruan.messenger.ums.authority.UMSAuthorityItems.PORTAL_MANAGEMENT_ENTERPRISE_UMS_ID;
import static com.fanruan.portal.authority.PortalAuthorityItems.ENTERPRISE_GENERAL_ID;
import static com.fanruan.portal.authority.PortalAuthorityItems.ENTERPRISE_ID;
import static com.fanruan.portal.authority.PortalAuthorityItems.MAP_ID;
import static com.fanruan.portal.authority.PortalAuthorityItems.PORTAL_MANAGEMENT_ID;
import static com.fanruan.portal.authority.PortalAuthorityItems.SECURITY_ID;
import static com.fr.decision.authority.base.constant.ReportAuthorityItems.ENTERPRISE_REPORT_BASE_SETTINGS_ID;
import static com.fr.decision.authority.base.constant.ReportAuthorityItems.ENTERPRISE_REPORT_ID;
/**
* 内置服务器支持展示的模块预期调用顺序在业务模块之后
*
* @author Anner
* @since 11.0
* Created on 2024/10/15
*/
public class DesignServerSupportModule {
private final static Set<String> SUPPORT_MODULE = Sets.newHashSet(
// 系统管理
PORTAL_MANAGEMENT_ID,
// 用户管理
USER_ID,
USER_ADD_ROLE_ID,
USER_ADD_DEPARTMENT_ID,
USER_ADD_ID,
USER_EDIT_ID,
USER_EDIT_RESET_PASSWORD_ID,
USER_EDIT_EDIT_INFO_ID,
USER_EDIT_DEP_ROLE_ID,
USER_DELETE_ID,
USER_DELETE_ROLE_ID,
USER_FORBIDDEN_ID,
// 企业设置
ENTERPRISE_ID,
// 企业设置 - 通知中心
PORTAL_MANAGEMENT_ENTERPRISE_UMS_ID,
// 企业设置 - 通用设置
ENTERPRISE_GENERAL_ID,
// 报表设置
ENTERPRISE_REPORT_ID,
// 报表设置 - 基础设置
ENTERPRISE_REPORT_BASE_SETTINGS_ID,
// 安全管理
SECURITY_ID,
// 地图管理
MAP_ID
);
/**
* 注册一下支持展示的模块
*
* @param moduleName name
*/
public static void register(String moduleName) {
Optional.of(moduleName).ifPresent(SUPPORT_MODULE::add);
}
/**
* 取消注册展示的模块
*
* @param moduleName name
*/
public static void unregister(String moduleName) {
Optional.of(moduleName).ifPresent(SUPPORT_MODULE::remove);
}
/**
* 启动入口重建一下展示的module
*/
public static void rebuild() {
Carina.getApplicationContext().addListener(new ContextListener() {
@Override
public void onStart() {
PortalModuleManager.allModules().keySet().stream()
.filter(m -> !SUPPORT_MODULE.contains(m))
.forEach(PortalModuleManager::unregister);
}
});
}
}

5
designer-realize/src/main/java/com/fanruan/boot/adaptation/ReportAdaptationComponent.java

@ -1,6 +1,7 @@
package com.fanruan.boot.adaptation;
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.plugins.resource.PluginResourceHelper;
@ -57,8 +58,8 @@ import java.util.TreeSet;
* Created on 2024/6/24
*/
@FineComponent(name = "fine_report_adaptation")
@DependsOn(dependencies = {"fine_report"})
public class ReportAdaptationComponent {
/**
* 启动
*/
@ -74,6 +75,8 @@ public class ReportAdaptationComponent {
// 插件controller注册
PluginControllerManager.getInstance().init();
// 过滤掉内置服务器不支持的模块
DesignServerSupportModule.rebuild();
}
private void listenEmbedServletFilter(ServletContext servletContext) {

Loading…
Cancel
Save