mirror of
https://github.com/jeecgboot/JimuReport.git
synced 2025-10-14 14:30:23 +00:00
jimureport 1.6.2-RC 版本发布
This commit is contained in:
@@ -14,7 +14,7 @@
|
|||||||
<artifactId>jimureport-example</artifactId>
|
<artifactId>jimureport-example</artifactId>
|
||||||
<version>1.6</version>
|
<version>1.6</version>
|
||||||
|
|
||||||
<url>http://jimureport.com</url>
|
<url>http://www.jimureport.com</url>
|
||||||
<description>积木报表集成示例</description>
|
<description>积木报表集成示例</description>
|
||||||
|
|
||||||
<repositories>
|
<repositories>
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
</repositories>
|
</repositories>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<jimureport.version>1.6.2-beta</jimureport.version>
|
<jimureport.version>1.6.2-RC</jimureport.version>
|
||||||
<java.version>1.8</java.version>
|
<java.version>1.8</java.version>
|
||||||
<minio.version>8.0.3</minio.version>
|
<minio.version>8.0.3</minio.version>
|
||||||
<!-- DB驱动 -->
|
<!-- DB驱动 -->
|
||||||
@@ -181,6 +181,7 @@
|
|||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
<!-- SpringBoot启动 -->
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
@@ -37,6 +37,17 @@ public class JimuReportTokenService implements JmReportTokenServiceI {
|
|||||||
return "admin";
|
return "admin";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自定义用户拥有的角色
|
||||||
|
*
|
||||||
|
* @param token
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String[] getRoles(String token) {
|
||||||
|
return new String[]{"admin"};
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Token校验
|
* Token校验
|
||||||
* @param token
|
* @param token
|
||||||
|
@@ -7,9 +7,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/test")
|
@RequestMapping
|
||||||
public class TestController {
|
public class TestController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private JdbcTemplate jdbcTemplate;
|
private JdbcTemplate jdbcTemplate;
|
||||||
@@ -17,10 +18,40 @@ public class TestController {
|
|||||||
private NamedParameterJdbcTemplate namedParameterJdbcTemplate;
|
private NamedParameterJdbcTemplate namedParameterJdbcTemplate;
|
||||||
|
|
||||||
|
|
||||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
@RequestMapping(value = "/test/list", method = RequestMethod.GET)
|
||||||
public void queryPageList(HttpServletRequest req) {
|
public void queryPageList(HttpServletRequest req) {
|
||||||
System.out.println("getMaxRows="+jdbcTemplate.getMaxRows());
|
System.out.println("getMaxRows="+jdbcTemplate.getMaxRows());
|
||||||
System.out.println("getCacheLimit="+namedParameterJdbcTemplate.getCacheLimit());
|
System.out.println("getCacheLimit="+namedParameterJdbcTemplate.getCacheLimit());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = "/jimureport/test/getOne", method = RequestMethod.GET)
|
||||||
|
public Map getOne(HttpServletRequest req) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API示例接口
|
||||||
|
*
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/jimureport/test/getList", method = RequestMethod.GET)
|
||||||
|
public String getList(HttpServletRequest req) {
|
||||||
|
String json = "{\n" +
|
||||||
|
"\t\"data\": [{\n" +
|
||||||
|
"\t\t\"ctotal\": \"125箱\",\n" +
|
||||||
|
"\t\t\"cname\": \"牛奶0\",\n" +
|
||||||
|
"\t\t\"cprice\": \"56\",\n" +
|
||||||
|
"\t\t\"riqi\": \"2021年08月11日\",\n" +
|
||||||
|
"\t\t\"id\": 100,\n" +
|
||||||
|
"\t\t\"dtotal\": \"1256箱\",\n" +
|
||||||
|
"\t\t\"tp\": \"7000\",\n" +
|
||||||
|
"\t\t\"ztotal\": \"589箱\",\n" +
|
||||||
|
"\t\t\"cnum\": \"每箱12瓶\",\n" +
|
||||||
|
"\t\t\"dId\": \"1\"\n" +
|
||||||
|
"\t}]\n" +
|
||||||
|
"}";
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
package com.jeecg.modules.jmreport.testdb;
|
package com.jeecg.modules.jmreport.testdb;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.jeecg.modules.jmreport.common.util.OkConvertUtils;
|
||||||
import org.jeecg.modules.jmreport.desreport.model.JmPage;
|
import org.jeecg.modules.jmreport.desreport.model.JmPage;
|
||||||
import org.jeecg.modules.jmreport.api.data.IDataSetFactory;
|
import org.jeecg.modules.jmreport.api.data.IDataSetFactory;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@@ -51,11 +52,16 @@ public class TestRpSpringBean implements IDataSetFactory {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public JmPage createPageData(Map<String, Object> param) {
|
public JmPage createPageData(Map<String, Object> param) {
|
||||||
|
//默认必须有分页参数 pageSize
|
||||||
|
if(!param.containsKey("pageSize")){
|
||||||
|
param.put("pageSize",1);
|
||||||
|
}
|
||||||
|
|
||||||
log.info(" 自定义javabean,有分页 :" + param);
|
log.info(" 自定义javabean,有分页 :" + param);
|
||||||
|
|
||||||
JmPage page = new JmPage();
|
JmPage page = new JmPage();
|
||||||
List<Map<String, Object>> ls = new ArrayList<>();
|
List<Map<String, Object>> ls = new ArrayList<>();
|
||||||
int pageSize = Integer.parseInt(param.get("pageSize").toString());
|
int pageSize = OkConvertUtils.getInt(param.get("pageSize").toString(),1);
|
||||||
|
|
||||||
Map<String, Object> obj2 = new HashMap<>();
|
Map<String, Object> obj2 = new HashMap<>();
|
||||||
obj2.put("name", "张三");
|
obj2.put("name", "张三");
|
||||||
|
56
jimureport-example/src/main/resources/application-dev.yml
Normal file
56
jimureport-example/src/main/resources/application-dev.yml
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
server:
|
||||||
|
port: 8085
|
||||||
|
spring:
|
||||||
|
#数据库
|
||||||
|
datasource:
|
||||||
|
url: jdbc:mysql://${MYSQL-HOST:127.0.0.1}:${MYSQL-PORT:3306}/${MYSQL-DB:jimureport}?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||||
|
username: root
|
||||||
|
password: root
|
||||||
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
|
#持久层框架
|
||||||
|
minidao:
|
||||||
|
base-package: org.jeecg.modules.jmreport.*
|
||||||
|
jeecg:
|
||||||
|
# local|minio|alioss
|
||||||
|
uploadType: local
|
||||||
|
# local
|
||||||
|
path:
|
||||||
|
#文件路径
|
||||||
|
upload: /opt/upload
|
||||||
|
# alioss
|
||||||
|
oss:
|
||||||
|
endpoint: ??
|
||||||
|
accessKey: ??
|
||||||
|
secretKey: ??
|
||||||
|
bucketName: jimureport
|
||||||
|
# minio
|
||||||
|
minio:
|
||||||
|
minio_url: http://minio.jeecg.com
|
||||||
|
minio_name: ??
|
||||||
|
minio_pass: ??
|
||||||
|
bucketName: ??
|
||||||
|
#大屏报表参数设置
|
||||||
|
jmreport:
|
||||||
|
#多租户模式,默认值为空(created:按照创建人隔离、tenant:按照租户隔离)
|
||||||
|
saasMode:
|
||||||
|
# 平台上线安全配置
|
||||||
|
firewall:
|
||||||
|
# 数据源安全 (开启后,不允许使用平台数据源、SQL解析加签并且不允许查询数据库)
|
||||||
|
dataSourceSafe: false
|
||||||
|
# 低代码开发模式(dev:开发模式,prod:发布模式—关闭在线报表设计功能,分配角色admin、lowdeveloper可放开限制)
|
||||||
|
lowCodeMode: dev
|
||||||
|
# 展示列数
|
||||||
|
col: 100
|
||||||
|
# 展示行数
|
||||||
|
row: 200
|
||||||
|
#自定义API接口的前缀 #{api_base_path}和#{domainURL}的值
|
||||||
|
apiBasePath: http://192.168.1.11:8085
|
||||||
|
pageSize:
|
||||||
|
- 10
|
||||||
|
- 20
|
||||||
|
- 30
|
||||||
|
- 40
|
||||||
|
#输出sql日志
|
||||||
|
logging:
|
||||||
|
level:
|
||||||
|
org.jeecg.modules.jmreport: info
|
56
jimureport-example/src/main/resources/application-prod.yml
Normal file
56
jimureport-example/src/main/resources/application-prod.yml
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
server:
|
||||||
|
port: 8085
|
||||||
|
spring:
|
||||||
|
#数据库
|
||||||
|
datasource:
|
||||||
|
url: jdbc:mysql://${MYSQL-HOST:127.0.0.1}:${MYSQL-PORT:3306}/${MYSQL-DB:jimureport}?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||||
|
username: root
|
||||||
|
password: root
|
||||||
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
|
#持久层框架
|
||||||
|
minidao:
|
||||||
|
base-package: org.jeecg.modules.jmreport.*
|
||||||
|
jeecg:
|
||||||
|
# local|minio|alioss
|
||||||
|
uploadType: local
|
||||||
|
# local
|
||||||
|
path:
|
||||||
|
#文件路径
|
||||||
|
upload: /opt/upload
|
||||||
|
# alioss
|
||||||
|
oss:
|
||||||
|
endpoint: ??
|
||||||
|
accessKey: ??
|
||||||
|
secretKey: ??
|
||||||
|
bucketName: jimureport
|
||||||
|
# minio
|
||||||
|
minio:
|
||||||
|
minio_url: http://minio.jeecg.com
|
||||||
|
minio_name: ??
|
||||||
|
minio_pass: ??
|
||||||
|
bucketName: ??
|
||||||
|
#大屏报表参数设置
|
||||||
|
jmreport:
|
||||||
|
#多租户模式,默认值为空(created:按照创建人隔离、tenant:按照租户隔离)
|
||||||
|
saasMode: created
|
||||||
|
# 平台上线安全配置
|
||||||
|
firewall:
|
||||||
|
# 数据源安全 (开启后,不允许使用平台数据源、SQL解析加签并且不允许查询数据库)
|
||||||
|
dataSourceSafe: true
|
||||||
|
# 低代码开发模式(dev:开发模式,prod:发布模式—关闭在线报表设计功能,分配角色admin、lowdeveloper可放开限制)
|
||||||
|
lowCodeMode: prod
|
||||||
|
# 展示列数
|
||||||
|
col: 100
|
||||||
|
# 展示行数
|
||||||
|
row: 200
|
||||||
|
#自定义API接口的前缀 #{api_base_path}和#{domainURL}的值
|
||||||
|
apiBasePath: http://192.168.1.11:8085
|
||||||
|
pageSize:
|
||||||
|
- 10
|
||||||
|
- 20
|
||||||
|
- 30
|
||||||
|
- 40
|
||||||
|
#输出sql日志
|
||||||
|
logging:
|
||||||
|
level:
|
||||||
|
org.jeecg.modules.jmreport: info
|
@@ -1,49 +1,3 @@
|
|||||||
server:
|
|
||||||
port: 8085
|
|
||||||
spring:
|
spring:
|
||||||
#数据库
|
profiles:
|
||||||
datasource:
|
active: dev
|
||||||
url: jdbc:mysql://${MYSQL-HOST:127.0.0.1}:${MYSQL-PORT:3306}/${MYSQL-DB:jimureport}?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
|
||||||
username: root
|
|
||||||
password: root
|
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
|
||||||
jeecg :
|
|
||||||
# local|minio|alioss
|
|
||||||
uploadType: local
|
|
||||||
# local
|
|
||||||
path :
|
|
||||||
#文件路径
|
|
||||||
upload: /opt/upload
|
|
||||||
# alioss
|
|
||||||
oss:
|
|
||||||
endpoint: ??
|
|
||||||
accessKey: ??
|
|
||||||
secretKey: ??
|
|
||||||
bucketName: jimureport
|
|
||||||
# minio
|
|
||||||
minio:
|
|
||||||
minio_url: http://minio.jeecg.com
|
|
||||||
minio_name: ??
|
|
||||||
minio_pass: ??
|
|
||||||
bucketName: ??
|
|
||||||
#大屏报表参数设置
|
|
||||||
jmreport:
|
|
||||||
#只看自己的数据
|
|
||||||
saas: false
|
|
||||||
#是否开启租户模式 Support By v1.5.5+
|
|
||||||
openTenant: true
|
|
||||||
#安全模式(敏感接口校验、saas模式下不允许使用平台数据源)
|
|
||||||
#safeMode: true
|
|
||||||
# 列索引
|
|
||||||
col: 100
|
|
||||||
#接口超时设置(毫秒)
|
|
||||||
connect-timeout: 300000
|
|
||||||
pageSize:
|
|
||||||
- 10
|
|
||||||
- 20
|
|
||||||
- 30
|
|
||||||
- 40
|
|
||||||
#输出sql日志
|
|
||||||
logging:
|
|
||||||
level:
|
|
||||||
org.jeecg.modules.jmreport : info
|
|
77
jimureport-example/src/main/resources/logback-spring.xml
Normal file
77
jimureport-example/src/main/resources/logback-spring.xml
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<configuration debug="false">
|
||||||
|
<!--定义日志文件的存储地址 -->
|
||||||
|
<property name="LOG_HOME" value="../logs" />
|
||||||
|
|
||||||
|
<!--<property name="COLOR_PATTERN" value="%black(%contextName-) %red(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread]) %highlight(%-5level) %boldMagenta( %replace(%caller{1}){'\t|Caller.{1}0|\r\n', ''})- %gray(%msg%xEx%n)" />-->
|
||||||
|
<!-- 控制台输出 -->
|
||||||
|
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||||
|
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符
|
||||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50}:%L - %msg%n</pattern>-->
|
||||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %highlight(%-5level) %cyan(%logger{50}:%L) - %msg%n</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 按照每天生成日志文件 -->
|
||||||
|
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||||
|
<!--日志文件输出的文件名 -->
|
||||||
|
<FileNamePattern>${LOG_HOME}/jimureport-%d{yyyy-MM-dd}.%i.log</FileNamePattern>
|
||||||
|
<!--日志文件保留天数 -->
|
||||||
|
<MaxHistory>30</MaxHistory>
|
||||||
|
<maxFileSize>10MB</maxFileSize>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||||
|
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符 -->
|
||||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50}:%L - %msg%n</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 生成 error html格式日志开始 -->
|
||||||
|
<appender name="HTML" class="ch.qos.logback.core.FileAppender">
|
||||||
|
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||||
|
<!--设置日志级别,过滤掉info日志,只输入error日志-->
|
||||||
|
<level>ERROR</level>
|
||||||
|
</filter>
|
||||||
|
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||||
|
<layout class="ch.qos.logback.classic.html.HTMLLayout">
|
||||||
|
<pattern>%p%d%msg%M%F{32}%L</pattern>
|
||||||
|
</layout>
|
||||||
|
</encoder>
|
||||||
|
<file>${LOG_HOME}/error-log.html</file>
|
||||||
|
</appender>
|
||||||
|
<!-- 生成 error html格式日志结束 -->
|
||||||
|
|
||||||
|
<!-- 每天生成一个html格式的日志开始 -->
|
||||||
|
<appender name="FILE_HTML" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||||
|
<!--日志文件输出的文件名 -->
|
||||||
|
<FileNamePattern>${LOG_HOME}/jimureport-%d{yyyy-MM-dd}.%i.html</FileNamePattern>
|
||||||
|
<!--日志文件保留天数 -->
|
||||||
|
<MaxHistory>30</MaxHistory>
|
||||||
|
<MaxFileSize>10MB</MaxFileSize>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||||
|
<layout class="ch.qos.logback.classic.html.HTMLLayout">
|
||||||
|
<pattern>%p%d%msg%M%F{32}%L</pattern>
|
||||||
|
</layout>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
<!-- 每天生成一个html格式的日志结束 -->
|
||||||
|
|
||||||
|
<!--myibatis log configure -->
|
||||||
|
<logger name="com.apache.ibatis" level="TRACE" />
|
||||||
|
<logger name="java.sql.Connection" level="DEBUG" />
|
||||||
|
<logger name="java.sql.Statement" level="DEBUG" />
|
||||||
|
<logger name="java.sql.PreparedStatement" level="DEBUG" />
|
||||||
|
|
||||||
|
<!-- 日志输出级别 -->
|
||||||
|
<root level="INFO">
|
||||||
|
<appender-ref ref="STDOUT" />
|
||||||
|
<appender-ref ref="FILE" />
|
||||||
|
<!-- <appender-ref ref="HTML" />
|
||||||
|
<appender-ref ref="FILE_HTML" /> -->
|
||||||
|
</root>
|
||||||
|
|
||||||
|
</configuration>
|
Reference in New Issue
Block a user