Browse Source

feat:集成积木仪表盘

YunaiV 6 months ago
parent
commit
4fb4af2c5c

+ 7 - 2
yudao-dependencies/pom.xml

@@ -585,10 +585,15 @@
                 <groupId>org.jeecgframework.jimureport</groupId>
                 <artifactId>jimureport-spring-boot3-starter-fastjson2</artifactId>
                 <version>${jimureport.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.jeecgframework.jimureport</groupId>
+                <artifactId>jimubi-spring-boot3-starter</artifactId>
+                <version>${jimureport.version}</version>
                 <exclusions>
                     <exclusion>
-                        <groupId>com.alibaba</groupId>
-                        <artifactId>druid</artifactId>
+                        <groupId>com.github.jsqlparser</groupId>
+                        <artifactId>jsqlparser</artifactId>
                     </exclusion>
                 </exclusions>
             </dependency>

+ 4 - 0
yudao-module-report/yudao-module-report-biz/pom.xml

@@ -64,6 +64,10 @@
             <groupId>org.jeecgframework.jimureport</groupId>
             <artifactId>jimureport-spring-boot3-starter-fastjson2</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.jeecgframework.jimureport</groupId>
+            <artifactId>jimubi-spring-boot3-starter</artifactId>
+        </dependency>
 
         <dependency>
             <groupId>cn.iocoder.boot</groupId>

+ 9 - 2
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();
+    }
+
 }

+ 68 - 0
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. <a href="https://github.com/jeecgboot/jimureport/blob/master/jimureport-example/src/main/java/com/jeecg/modules/jmreport/extend/JimuDragExternalServiceImpl.java">jimureport-example</a>
+ * 2. <a href="https://gitee.com/jeecg/JeecgBoot/blob/master/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/config/jimureport/JimuDragExternalServiceImpl.java">JeecgBoot 集成</a>
+ *
+ * @author 芋道源码
+ */
+@RequiredArgsConstructor
+public class JmOnlDragExternalServiceImpl implements IOnlDragExternalService {
+
+    // ========== DictItem 相关 ==========
+
+    @Override
+    public Map<String, List<DragDictModel>> getManyDictItems(List<String> codeList, List<JSONObject> tableDictList) {
+        return IOnlDragExternalService.super.getManyDictItems(codeList, tableDictList);
+    }
+
+    @Override
+    public List<DragDictModel> getDictItems(String dictCode) {
+        return IOnlDragExternalService.super.getDictItems(dictCode);
+    }
+
+    @Override
+    public List<DragDictModel> getTableDictItems(String dictTable, String dictText, String dictCode) {
+        return IOnlDragExternalService.super.getTableDictItems(dictTable, dictText, dictCode);
+    }
+
+    @Override
+    public List<DragDictModel> getCategoryTreeDictItems(List<String> ids) {
+        return IOnlDragExternalService.super.getCategoryTreeDictItems(ids);
+    }
+
+    @Override
+    public List<DragDictModel> getUserDictItems(List<String> ids) {
+        return IOnlDragExternalService.super.getUserDictItems(ids);
+    }
+
+    @Override
+    public List<DragDictModel> getDeptsDictItems(List<String> 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);
+    }
+
+}

+ 5 - 1
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<HttpSecurity>.AuthorizationManagerRequestMatcherRegistry registry) {
-                registry.requestMatchers("/jmreport/**").permitAll(); // 积木报表
+                // 积木报表
+                registry.requestMatchers("/jmreport/**").permitAll();
+                // 积木仪表盘
+                registry.requestMatchers("/drag/**").permitAll();
+                registry.requestMatchers("/jimubi/**").permitAll();
             }
 
         };