✨ Introducing new features. close #3777 jimu-report 支持积木报表

This commit is contained in:
卢本伟 committed 2022-04-08 15:20:15 +08:00
1 parent 99701cb871
commit 7e44f2081f
12 files changed
+352 -31

No files matched your search

@@ -140,4 +140,15 @@ public class PigxTokenEndpoint {
return dealService.queryToken(page);
}
/**
* 查询token
* @param token
* @return
*/
@Inner
@GetMapping("/query-token")
public R queryToken(String token) {
return dealService.queryTokenInfo(token);
}
}
@@ -150,4 +150,9 @@ public class PigxTokenDealServiceImpl {
return result;
}
public R queryTokenInfo(String token) {
OAuth2AccessToken oAuth2AccessToken = tokenStore.readAccessToken(token);
return R.ok(oAuth2AccessToken);
}
}
+1 -1
View File
@@ -21,7 +21,7 @@
<mybatis-plus.version>3.5.1</mybatis-plus.version>
<dynamic-ds.version>3.4.1</dynamic-ds.version>
<druid.version>1.2.8</druid.version>
<hutool.version>5.7.21</hutool.version>
<hutool.version>5.7.22</hutool.version>
<mysql.connector.version>8.0.27</mysql.connector.version>
<oracle.version>21.3.0.0</oracle.version>
<sqlserver.version>8.4.1.jre8</sqlserver.version>
@@ -23,10 +23,7 @@ import com.pig4cloud.pigx.common.core.constant.ServiceNameConstants;
import com.pig4cloud.pigx.common.core.util.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
@@ -58,4 +55,13 @@ public interface RemoteTokenService {
@DeleteMapping("/token/{token}")
R<Boolean> removeTokenById(@PathVariable("token") String token, @RequestHeader(SecurityConstants.FROM) String from);
/**
* 校验令牌获取用户信息
* @param token
* @param from
* @return
*/
@GetMapping("/token/query-token")
R queryToken(@RequestParam("token") String token, @RequestHeader(SecurityConstants.FROM) String from);
}
+18
View File
@@ -0,0 +1,18 @@
FROM pig4cloud/java:8-jre
MAINTAINER wangiegie@gmail.com
ENV TZ=Asia/Shanghai
ENV JAVA_OPTS="-Xms128m -Xmx256m -Djava.security.egd=file:/dev/./urandom"
RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN mkdir -p /pigx-jimu-platform
WORKDIR /pigx-jimu-platform
EXPOSE 5008
ADD ./target/pigx-jimu-platform.jar ./
CMD sleep 120;java $JAVA_OPTS -jar pigx-jimu-platform.jar
+94
View File
@@ -0,0 +1,94 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.pig4cloud</groupId>
<artifactId>pigx-visual</artifactId>
<version>4.3.0</version>
</parent>
<artifactId>pigx-jimu-platform</artifactId>
<packaging>jar</packaging>
<description>积木报表系统</description>
<dependencies>
<!--注册中心客户端-->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<!--配置中心客户端-->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
<!--sentinel-->
<dependency>
<groupId>com.pig4cloud</groupId>
<artifactId>pigx-common-sentinel</artifactId>
</dependency>
<!--feign 调用-->
<dependency>
<groupId>com.pig4cloud</groupId>
<artifactId>pigx-common-feign</artifactId>
</dependency>
<!--API 依赖-->
<dependency>
<groupId>com.pig4cloud</groupId>
<artifactId>pigx-upms-api</artifactId>
</dependency>
<!--web 模块-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!--undertow容器-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
<dependency>
<groupId>org.jeecgframework.jimureport</groupId>
<artifactId>jimureport-spring-boot-starter</artifactId>
<version>${jimu.version}</version>
</dependency>
<!-- druid 连接池 -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
</dependency>
<!--MYSQL 数据驱动-->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!-- ojdbc8 -->
<dependency>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc8</artifactId>
</dependency>
<!--PG-->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<configuration>
<skip>false</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>
@@ -0,0 +1,41 @@
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.pig4cloud.pigx.bi;
import com.pig4cloud.pigx.common.feign.annotation.EnablePigxFeignClients;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
/**
* @author lengleng
* @date 2022-04-06
* <p>
*/
@EnablePigxFeignClients
@EnableDiscoveryClient
@SpringBootApplication(scanBasePackages = { "org.jeecg.modules.jmreport", "com.pig4cloud.pigx.bi" },
exclude = MongoAutoConfiguration.class)
public class PigxJimuApplication {
public static void main(String[] args) {
SpringApplication.run(PigxJimuApplication.class, args);
}
}
@@ -0,0 +1,43 @@
package com.pig4cloud.pigx.bi.config;
import com.pig4cloud.pigx.admin.api.feign.RemoteTokenService;
import com.pig4cloud.pigx.common.core.constant.CommonConstants;
import com.pig4cloud.pigx.common.core.constant.SecurityConstants;
import com.pig4cloud.pigx.common.core.util.R;
import lombok.RequiredArgsConstructor;
import org.jeecg.modules.jmreport.api.JmReportTokenServiceI;
import org.springframework.stereotype.Component;
import java.util.Map;
/**
* @author lengleng
* @date 2022/4/6
*
* 积木安全控制
*/
@Component
@RequiredArgsConstructor
public class JimuReportTokenService implements JmReportTokenServiceI {
private final RemoteTokenService tokenService;
@Override
public String getUsername(String token) {
R<Map<String, Object>> result = tokenService.queryToken(token, SecurityConstants.FROM_IN);
if (CommonConstants.SUCCESS.equals(result.getCode())) {
return (String) result.getData().get("username");
}
return null;
}
@Override
public Boolean verifyToken(String token) {
R<Map<String, Object>> result = tokenService.queryToken(token, SecurityConstants.FROM_IN);
if (CommonConstants.SUCCESS.equals(result.getCode())) {
return true;
}
return false;
}
}
@@ -0,0 +1,19 @@
server:
port: 5008
spring:
application:
name: @artifactId@
cloud:
nacos:
discovery:
server-addr: ${NACOS_HOST:pigx-register}:${NACOS_PORT:8848}
service: @artifactId@
config:
server-addr: ${spring.cloud.nacos.discovery.server-addr}
config:
import:
- optional:nacos:application-${spring.profiles.active}.yml
- optional:nacos:${spring.application.name}-${spring.profiles.active}.yml
profiles:
active: @profiles.active@
@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2018-2025, lengleng All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ Redistributions of source code must retain the above copyright notice,
~ this list of conditions and the following disclaimer.
~ Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ Neither the name of the pig4cloud.com developer nor the names of its
~ contributors may be used to endorse or promote products derived from
~ this software without specific prior written permission.
~ Author: lengleng (wangiegie@gmail.com)
-->
<!--
小技巧: 在根pom里面设置统一存放路径,统一管理方便维护
<properties>
<log-path>/Users/lengleng</log-path>
</properties>
1. 其他模块加日志输出,直接copy本文件放在resources 目录即可
2. 注意修改 <property name="${log-path}/log.path" value=""/> 的value模块
-->
<configuration debug="false" scan="false">
<property name="log.path" value="logs/${project.artifactId}"/>
<!-- 彩色日志格式 -->
<property name="CONSOLE_LOG_PATTERN"
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
<!-- 彩色日志依赖的渲染类 -->
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>
<conversionRule conversionWord="wex"
converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/>
<conversionRule conversionWord="wEx"
converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/>
<!-- Console log output -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
</encoder>
</appender>
<!-- Log file debug output -->
<appender name="debug" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/debug.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${log.path}/%d{yyyy-MM, aux}/debug.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
<maxFileSize>50MB</maxFileSize>
<maxHistory>30</maxHistory>
</rollingPolicy>
<encoder>
<pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
</encoder>
</appender>
<!-- Log file error output -->
<appender name="error" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/error.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${log.path}/%d{yyyy-MM}/error.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
<maxFileSize>50MB</maxFileSize>
<maxHistory>30</maxHistory>
</rollingPolicy>
<encoder>
<pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>ERROR</level>
</filter>
</appender>
<!--nacos 心跳 INFO 屏蔽-->
<logger name="com.alibaba.nacos" level="OFF">
<appender-ref ref="error"/>
</logger>
<!-- Level: FATAL 0 ERROR 3 WARN 4 INFO 6 DEBUG 7 -->
<root level="INFO">
<appender-ref ref="console"/>
<appender-ref ref="debug"/>
</root>
</configuration>
+26 -25
View File
@@ -19,31 +19,32 @@
-->
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.pig4cloud</groupId>
<artifactId>pigx</artifactId>
<version>4.3.0</version>
</parent>
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.pig4cloud</groupId>
<artifactId>pigx</artifactId>
<version>4.3.0</version>
</parent>
<artifactId>pigx-visual</artifactId>
<description>pigx 图形化功能模块</description>
<packaging>pom</packaging>
<artifactId>pigx-visual</artifactId>
<description>pigx 图形化功能模块</description>
<packaging>pom</packaging>
<modules>
<module>pigx-bi-platform</module>
<module>pigx-codegen</module>
<module>pigx-daemon-elastic-job</module>
<module>pigx-daemon-quartz</module>
<module>pigx-oa-platform</module>
<module>pigx-pay-platform</module>
<module>pigx-report-platform</module>
<module>pigx-monitor</module>
<module>pigx-mp-platform</module>
<module>pigx-sso-client-demo</module>
<module>pigx-sentinel-dashboard</module>
<module>pigx-tx-manager</module>
<module>pigx-xxl-job-admin</module>
</modules>
<modules>
<module>pigx-bi-platform</module>
<module>pigx-codegen</module>
<module>pigx-daemon-elastic-job</module>
<module>pigx-daemon-quartz</module>
<module>pigx-jimu-platform</module>
<module>pigx-oa-platform</module>
<module>pigx-pay-platform</module>
<module>pigx-report-platform</module>
<module>pigx-monitor</module>
<module>pigx-mp-platform</module>
<module>pigx-sso-client-demo</module>
<module>pigx-sentinel-dashboard</module>
<module>pigx-tx-manager</module>
<module>pigx-xxl-job-admin</module>
</modules>
</project>
+1 -1
View File
@@ -53,7 +53,7 @@
<jasypt.version>3.0.3</jasypt.version>
<ttl.version>2.11.4</ttl.version>
<ureport.version>2.2.9</ureport.version>
<jimu.version>1.4.32</jimu.version>
<jimu.version>1.4.4-beta</jimu.version>
<aws.version>1.11.543</aws.version>
<xxl.job.version>2.3.0</xxl.job.version>
<activiti.version>5.22.0</activiti.version>