From 4fb4af2c5c9854db57d9244a941671308f695bb9 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 3 May 2025 10:26:14 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E9=9B=86=E6=88=90=E7=A7=AF?= =?UTF-8?q?=E6=9C=A8=E4=BB=AA=E8=A1=A8=E7=9B=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yudao-dependencies/pom.xml | 9 ++- .../yudao-module-report-biz/pom.xml | 4 ++ .../config/JmReportConfiguration.java | 11 ++- .../service/JmOnlDragExternalServiceImpl.java | 68 +++++++++++++++++++ .../config/SecurityConfiguration.java | 6 +- 5 files changed, 93 insertions(+), 5 deletions(-) create mode 100644 yudao-module-report/yudao-module-report-biz/src/main/java/cn/iocoder/yudao/module/report/framework/jmreport/core/service/JmOnlDragExternalServiceImpl.java diff --git a/yudao-dependencies/pom.xml b/yudao-dependencies/pom.xml index 426bb36390..b40005ab74 100644 --- a/yudao-dependencies/pom.xml +++ b/yudao-dependencies/pom.xml @@ -585,10 +585,15 @@ org.jeecgframework.jimureport jimureport-spring-boot3-starter-fastjson2 ${jimureport.version} + + + org.jeecgframework.jimureport + jimubi-spring-boot3-starter + ${jimureport.version} - com.alibaba - druid + com.github.jsqlparser + jsqlparser diff --git a/yudao-module-report/yudao-module-report-biz/pom.xml b/yudao-module-report/yudao-module-report-biz/pom.xml index d78a61000f..6437b69106 100644 --- a/yudao-module-report/yudao-module-report-biz/pom.xml +++ b/yudao-module-report/yudao-module-report-biz/pom.xml @@ -64,6 +64,10 @@ org.jeecgframework.jimureport jimureport-spring-boot3-starter-fastjson2 + + org.jeecgframework.jimureport + jimubi-spring-boot3-starter + cn.iocoder.boot diff --git a/yudao-module-report/yudao-module-report-biz/src/main/java/cn/iocoder/yudao/module/report/framework/jmreport/config/JmReportConfiguration.java b/yudao-module-report/yudao-module-report-biz/src/main/java/cn/iocoder/yudao/module/report/framework/jmreport/config/JmReportConfiguration.java index 1946d052e8..49eaa09313 100644 --- a/yudao-module-report/yudao-module-report-biz/src/main/java/cn/iocoder/yudao/module/report/framework/jmreport/config/JmReportConfiguration.java +++ b/yudao-module-report/yudao-module-report-biz/src/main/java/cn/iocoder/yudao/module/report/framework/jmreport/config/JmReportConfiguration.java @@ -1,13 +1,15 @@ package cn.iocoder.yudao.module.report.framework.jmreport.config; import cn.iocoder.yudao.framework.security.config.SecurityProperties; -import cn.iocoder.yudao.module.system.api.oauth2.OAuth2TokenApi; +import cn.iocoder.yudao.module.report.framework.jmreport.core.service.JmOnlDragExternalServiceImpl; import cn.iocoder.yudao.module.report.framework.jmreport.core.service.JmReportTokenServiceImpl; +import cn.iocoder.yudao.module.system.api.oauth2.OAuth2TokenApi; import cn.iocoder.yudao.module.system.api.permission.PermissionApi; import org.jeecg.modules.jmreport.api.JmReportTokenServiceI; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; /** * 积木报表的配置类 @@ -19,11 +21,16 @@ import org.springframework.context.annotation.Configuration; public class JmReportConfiguration { @Bean - @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection") public JmReportTokenServiceI jmReportTokenService(OAuth2TokenApi oAuth2TokenApi, PermissionApi permissionApi, SecurityProperties securityProperties) { return new JmReportTokenServiceImpl(oAuth2TokenApi, permissionApi, securityProperties); } + @Bean // 暂时注释:可以按需实现后打开 + @Primary + public JmOnlDragExternalServiceImpl jmOnlDragExternalService2() { + return new JmOnlDragExternalServiceImpl(); + } + } diff --git a/yudao-module-report/yudao-module-report-biz/src/main/java/cn/iocoder/yudao/module/report/framework/jmreport/core/service/JmOnlDragExternalServiceImpl.java b/yudao-module-report/yudao-module-report-biz/src/main/java/cn/iocoder/yudao/module/report/framework/jmreport/core/service/JmOnlDragExternalServiceImpl.java new file mode 100644 index 0000000000..a61a42f843 --- /dev/null +++ b/yudao-module-report/yudao-module-report-biz/src/main/java/cn/iocoder/yudao/module/report/framework/jmreport/core/service/JmOnlDragExternalServiceImpl.java @@ -0,0 +1,68 @@ +package cn.iocoder.yudao.module.report.framework.jmreport.core.service; + +import com.alibaba.fastjson.JSONObject; +import lombok.RequiredArgsConstructor; +import org.jeecg.modules.drag.service.IOnlDragExternalService; +import org.jeecg.modules.drag.vo.DragDictModel; +import org.jeecg.modules.drag.vo.DragLogDTO; + +import java.util.List; +import java.util.Map; + +/** + * {@link IOnlDragExternalService} 实现类,提供积木仪表盘的查询等功能 + * + * 实现可参考: + * 1. jimureport-example + * 2. JeecgBoot 集成 + * + * @author 芋道源码 + */ +@RequiredArgsConstructor +public class JmOnlDragExternalServiceImpl implements IOnlDragExternalService { + + // ========== DictItem 相关 ========== + + @Override + public Map> getManyDictItems(List codeList, List tableDictList) { + return IOnlDragExternalService.super.getManyDictItems(codeList, tableDictList); + } + + @Override + public List getDictItems(String dictCode) { + return IOnlDragExternalService.super.getDictItems(dictCode); + } + + @Override + public List getTableDictItems(String dictTable, String dictText, String dictCode) { + return IOnlDragExternalService.super.getTableDictItems(dictTable, dictText, dictCode); + } + + @Override + public List getCategoryTreeDictItems(List ids) { + return IOnlDragExternalService.super.getCategoryTreeDictItems(ids); + } + + @Override + public List getUserDictItems(List ids) { + return IOnlDragExternalService.super.getUserDictItems(ids); + } + + @Override + public List getDeptsDictItems(List ids) { + return IOnlDragExternalService.super.getDeptsDictItems(ids); + } + + // ========== Log 相关 ========== + + @Override + public void addLog(DragLogDTO dto) { + IOnlDragExternalService.super.addLog(dto); + } + + @Override + public void addLog(String logMsg, int logType, int operateType) { + IOnlDragExternalService.super.addLog(logMsg, logType, operateType); + } + +} diff --git a/yudao-module-report/yudao-module-report-biz/src/main/java/cn/iocoder/yudao/module/report/framework/security/config/SecurityConfiguration.java b/yudao-module-report/yudao-module-report-biz/src/main/java/cn/iocoder/yudao/module/report/framework/security/config/SecurityConfiguration.java index 5e5297127e..b56144dc92 100644 --- a/yudao-module-report/yudao-module-report-biz/src/main/java/cn/iocoder/yudao/module/report/framework/security/config/SecurityConfiguration.java +++ b/yudao-module-report/yudao-module-report-biz/src/main/java/cn/iocoder/yudao/module/report/framework/security/config/SecurityConfiguration.java @@ -18,7 +18,11 @@ public class SecurityConfiguration { @Override public void customize(AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistry registry) { - registry.requestMatchers("/jmreport/**").permitAll(); // 积木报表 + // 积木报表 + registry.requestMatchers("/jmreport/**").permitAll(); + // 积木仪表盘 + registry.requestMatchers("/drag/**").permitAll(); + registry.requestMatchers("/jimubi/**").permitAll(); } };