5 Commits

Author SHA1 Message Date
RuoYi
43728c99f0 升级spring-cloud相关组件到最新版 2026-03-10 11:47:38 +08:00
RuoYi
c600cb7ac1 升级fastjson到最新版2.0.61 2026-03-09 17:58:01 +08:00
RuoYi
6a074c8832 update deprecated 2026-03-09 17:57:51 +08:00
RuoYi
fefad4e147 update userid default value 2026-03-09 17:57:03 +08:00
RuoYi
316117524d 优化Excel自定义格式样式重复创建问题 2026-03-09 15:14:51 +08:00
14 changed files with 71 additions and 50 deletions

18
pom.xml
View File

@@ -17,23 +17,23 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>17</java.version> <java.version>17</java.version>
<spring-boot.version>3.3.5</spring-boot.version> <spring-boot.version>3.5.11</spring-boot.version>
<spring-cloud.version>2023.0.3</spring-cloud.version> <spring-cloud.version>2025.0.1</spring-cloud.version>
<spring-cloud-alibaba.version>2023.0.1.2</spring-cloud-alibaba.version> <spring-cloud-alibaba.version>2025.0.0.0</spring-cloud-alibaba.version>
<spring-boot-admin.version>3.3.5</spring-boot-admin.version> <spring-boot-admin.version>3.5.8</spring-boot-admin.version>
<mybatis-spring.version>3.0.3</mybatis-spring.version> <mybatis-spring.version>3.0.5</mybatis-spring.version>
<kaptcha.version>2.3.3</kaptcha.version> <kaptcha.version>2.3.3</kaptcha.version>
<pagehelper.boot.version>2.1.0</pagehelper.boot.version> <pagehelper.boot.version>2.1.0</pagehelper.boot.version>
<druid.version>1.2.27</druid.version> <druid.version>1.2.27</druid.version>
<dynamic-ds.version>4.3.1</dynamic-ds.version> <dynamic-ds.version>4.5.0</dynamic-ds.version>
<commons.io.version>2.21.0</commons.io.version> <commons.io.version>2.21.0</commons.io.version>
<velocity.version>2.3</velocity.version> <velocity.version>2.3</velocity.version>
<fastjson.version>2.0.60</fastjson.version> <fastjson.version>2.0.61</fastjson.version>
<jjwt.version>0.9.1</jjwt.version> <jjwt.version>0.9.1</jjwt.version>
<minio.version>8.2.2</minio.version> <minio.version>8.2.2</minio.version>
<poi.version>4.1.2</poi.version> <poi.version>4.1.2</poi.version>
<springdoc.version>2.6.0</springdoc.version> <springdoc.version>2.8.16</springdoc.version>
<transmittable-thread-local.version>2.14.4</transmittable-thread-local.version> <transmittable-thread-local.version>2.14.5</transmittable-thread-local.version>
</properties> </properties>
<!-- 依赖声明 --> <!-- 依赖声明 -->

View File

@@ -18,8 +18,9 @@ spring:
config: config:
# 配置中心地址 # 配置中心地址
server-addr: 127.0.0.1:8848 server-addr: 127.0.0.1:8848
config:
# 配置文件格式 # 配置文件格式
file-extension: yml file-extension: yml
# 共享配置 import:
shared-configs: - nacos:application-${spring.profiles.active}.${spring.config.file-extension}
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} - nacos:${spring.application.name}-${spring.profiles.active}.${spring.config.file-extension}

View File

@@ -53,7 +53,7 @@ public class SecurityContextHolder
public static Long getUserId() public static Long getUserId()
{ {
return Convert.toLong(get(SecurityConstants.DETAILS_USER_ID), 0L); return Convert.toLong(get(SecurityConstants.DETAILS_USER_ID), null);
} }
public static void setUserId(String account) public static void setUserId(String account)

View File

@@ -16,6 +16,7 @@ import org.apache.commons.lang3.time.DateFormatUtils;
* *
* @author ruoyi * @author ruoyi
*/ */
@SuppressWarnings("deprecation")
public class DateUtils extends org.apache.commons.lang3.time.DateUtils public class DateUtils extends org.apache.commons.lang3.time.DateUtils
{ {
public static String YYYY = "yyyy"; public static String YYYY = "yyyy";

View File

@@ -12,6 +12,7 @@ import com.ruoyi.common.core.text.StrFormatter;
* *
* @author ruoyi * @author ruoyi
*/ */
@SuppressWarnings("deprecation")
public class StringUtils extends org.apache.commons.lang3.StringUtils public class StringUtils extends org.apache.commons.lang3.StringUtils
{ {
/** 空字符串 */ /** 空字符串 */

View File

@@ -79,6 +79,11 @@ public class ExcelUtil<T>
public static final String[] FORMULA_STR = { "=", "-", "+", "@" }; public static final String[] FORMULA_STR = { "=", "-", "+", "@" };
/**
* 单元格样式缓存
*/
private Map<String, CellStyle> cellStyleCache = new HashMap<String, CellStyle>();
/** /**
* Excel sheet最大行数默认65536 * Excel sheet最大行数默认65536
*/ */
@@ -1043,9 +1048,16 @@ public class ExcelUtil<T>
*/ */
private CellStyle createCellStyle(CellStyle cellStyle, String format) private CellStyle createCellStyle(CellStyle cellStyle, String format)
{ {
String key = cellStyle.getIndex() + "|" + format;
CellStyle cached = cellStyleCache.get(key);
if (cached != null)
{
return cached;
}
CellStyle style = wb.createCellStyle(); CellStyle style = wb.createCellStyle();
style.cloneStyleFrom(cellStyle); style.cloneStyleFrom(cellStyle);
style.setDataFormat(wb.getCreationHelper().createDataFormat().getFormat(format)); style.setDataFormat(wb.getCreationHelper().createDataFormat().getFormat(format));
cellStyleCache.put(key, style);
return style; return style;
} }

View File

@@ -19,7 +19,7 @@
<!-- SpringCloud Gateway --> <!-- SpringCloud Gateway -->
<dependency> <dependency>
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-gateway</artifactId> <artifactId>spring-cloud-starter-gateway-server-webflux</artifactId>
</dependency> </dependency>
<!-- SpringCloud Alibaba Nacos --> <!-- SpringCloud Alibaba Nacos -->

View File

@@ -18,11 +18,6 @@ spring:
config: config:
# 配置中心地址 # 配置中心地址
server-addr: 127.0.0.1:8848 server-addr: 127.0.0.1:8848
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
sentinel: sentinel:
# 取消控制台懒加载 # 取消控制台懒加载
eager: true eager: true
@@ -38,3 +33,9 @@ spring:
groupId: DEFAULT_GROUP groupId: DEFAULT_GROUP
data-type: json data-type: json
rule-type: gw-flow rule-type: gw-flow
config:
# 配置文件格式
file-extension: yml
import:
- nacos:application-${spring.profiles.active}.${spring.config.file-extension}
- nacos:${spring.application.name}-${spring.profiles.active}.${spring.config.file-extension}

View File

@@ -18,8 +18,9 @@ spring:
config: config:
# 配置中心地址 # 配置中心地址
server-addr: 127.0.0.1:8848 server-addr: 127.0.0.1:8848
config:
# 配置文件格式 # 配置文件格式
file-extension: yml file-extension: yml
# 共享配置 import:
shared-configs: - nacos:application-${spring.profiles.active}.${spring.config.file-extension}
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} - nacos:${spring.application.name}-${spring.profiles.active}.${spring.config.file-extension}

View File

@@ -18,8 +18,9 @@ spring:
config: config:
# 配置中心地址 # 配置中心地址
server-addr: 127.0.0.1:8848 server-addr: 127.0.0.1:8848
config:
# 配置文件格式 # 配置文件格式
file-extension: yml file-extension: yml
# 共享配置 import:
shared-configs: - nacos:application-${spring.profiles.active}.${spring.config.file-extension}
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} - nacos:${spring.application.name}-${spring.profiles.active}.${spring.config.file-extension}

View File

@@ -18,8 +18,9 @@ spring:
config: config:
# 配置中心地址 # 配置中心地址
server-addr: 127.0.0.1:8848 server-addr: 127.0.0.1:8848
config:
# 配置文件格式 # 配置文件格式
file-extension: yml file-extension: yml
# 共享配置 import:
shared-configs: - nacos:application-${spring.profiles.active}.${spring.config.file-extension}
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} - nacos:${spring.application.name}-${spring.profiles.active}.${spring.config.file-extension}

View File

@@ -18,8 +18,9 @@ spring:
config: config:
# 配置中心地址 # 配置中心地址
server-addr: 127.0.0.1:8848 server-addr: 127.0.0.1:8848
config:
# 配置文件格式 # 配置文件格式
file-extension: yml file-extension: yml
# 共享配置 import:
shared-configs: - nacos:application-${spring.profiles.active}.${spring.config.file-extension}
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} - nacos:${spring.application.name}-${spring.profiles.active}.${spring.config.file-extension}

View File

@@ -18,8 +18,9 @@ spring:
config: config:
# 配置中心地址 # 配置中心地址
server-addr: 127.0.0.1:8848 server-addr: 127.0.0.1:8848
config:
# 配置文件格式 # 配置文件格式
file-extension: yml file-extension: yml
# 共享配置 import:
shared-configs: - nacos:application-${spring.profiles.active}.${spring.config.file-extension}
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} - nacos:${spring.application.name}-${spring.profiles.active}.${spring.config.file-extension}

View File

@@ -33,8 +33,8 @@ CREATE TABLE `config_info` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='config_info'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='config_info';
insert into config_info(id, data_id, group_id, content, md5, gmt_create, gmt_modified, src_user, src_ip, app_name, tenant_id, c_desc, c_use, effect, type, c_schema, encrypted_data_key) values insert into config_info(id, data_id, group_id, content, md5, gmt_create, gmt_modified, src_user, src_ip, app_name, tenant_id, c_desc, c_use, effect, type, c_schema, encrypted_data_key) values
(1,'application-dev.yml','DEFAULT_GROUP','spring:\n autoconfigure:\n exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure\n\n# feign 配置\nfeign:\n sentinel:\n enabled: true\n okhttp:\n enabled: true\n httpclient:\n enabled: false\n client:\n config:\n default:\n connectTimeout: 10000\n readTimeout: 10000\n compression:\n request:\n enabled: true\n min-request-size: 8192\n response:\n enabled: true\n\n# 暴露监控端点\nmanagement:\n endpoints:\n web:\n exposure:\n include: \'*\'\n','9928f41dfb10386ad38b3254af5692e0','2020-05-20 12:00:00','2024-08-29 12:14:45','nacos','0:0:0:0:0:0:0:1','','','通用配置','null','null','yaml','',''), (1,'application-dev.yml','DEFAULT_GROUP','spring:\n autoconfigure:\n exclude: com.alibaba.druid.spring.boot3.autoconfigure.DruidDataSourceAutoConfigure\n\n# feign 配置\nfeign:\n sentinel:\n enabled: true\n okhttp:\n enabled: true\n httpclient:\n enabled: false\n client:\n config:\n default:\n connectTimeout: 10000\n readTimeout: 10000\n compression:\n request:\n enabled: true\n min-request-size: 8192\n response:\n enabled: true\n\n# 暴露监控端点\nmanagement:\n endpoints:\n web:\n exposure:\n include: \'*\'\n','9928f41dfb10386ad38b3254af5692e0','2020-05-20 12:00:00','2024-08-29 12:14:45','nacos','0:0:0:0:0:0:0:1','','','通用配置','null','null','yaml','',''),
(2,'ruoyi-gateway-dev.yml','DEFAULT_GROUP','spring:\n data:\n redis:\n host: localhost\n port: 6379\n password: \n cloud:\n gateway:\n discovery:\n locator:\n lowerCaseServiceId: true\n enabled: true\n routes:\n # 认证中心\n - id: ruoyi-auth\n uri: lb://ruoyi-auth\n predicates:\n - Path=/auth/**\n filters:\n # 验证码处理\n - CacheRequestBody\n - ValidateCodeFilter\n - StripPrefix=1\n # 代码生成\n - id: ruoyi-gen\n uri: lb://ruoyi-gen\n predicates:\n - Path=/code/**\n filters:\n - StripPrefix=1\n # 定时任务\n - id: ruoyi-job\n uri: lb://ruoyi-job\n predicates:\n - Path=/schedule/**\n filters:\n - StripPrefix=1\n # 系统模块\n - id: ruoyi-system\n uri: lb://ruoyi-system\n predicates:\n - Path=/system/**\n filters:\n - StripPrefix=1\n # 文件服务\n - id: ruoyi-file\n uri: lb://ruoyi-file\n predicates:\n - Path=/file/**\n filters:\n - StripPrefix=1\n\n# 安全配置\nsecurity:\n # 验证码\n captcha:\n enabled: true\n type: math\n # 防止XSS攻击\n xss:\n enabled: true\n excludeUrls:\n - /system/notice\n\n # 不校验白名单\n ignore:\n whites:\n - /auth/logout\n - /auth/login\n - /auth/register\n - /*/v2/api-docs\n - /*/v3/api-docs\n - /csrf\n\n# springdoc配置\nspringdoc:\n webjars:\n # 访问前缀\n prefix:\n','8c27a047f057fc05e5fc223adeb9c685','2020-05-14 14:17:55','2024-09-14 04:49:34','nacos','0:0:0:0:0:0:0:1','','','网关模块','null','null','yaml','',''), (2,'ruoyi-gateway-dev.yml','DEFAULT_GROUP','spring:\n data:\n redis:\n host: localhost\n port: 6379\n password: \n cloud:\n gateway:\n server:\n webflux:\n discovery:\n locator:\n lowerCaseServiceId: true\n enabled: true\n routes:\n # 认证中心\n - id: ruoyi-auth\n uri: lb://ruoyi-auth\n predicates:\n - Path=/auth/**\n filters:\n # 验证码处理\n - CacheRequestBody\n - ValidateCodeFilter\n - StripPrefix=1\n # 代码生成\n - id: ruoyi-gen\n uri: lb://ruoyi-gen\n predicates:\n - Path=/code/**\n filters:\n - StripPrefix=1\n # 定时任务\n - id: ruoyi-job\n uri: lb://ruoyi-job\n predicates:\n - Path=/schedule/**\n filters:\n - StripPrefix=1\n # 系统模块\n - id: ruoyi-system\n uri: lb://ruoyi-system\n predicates:\n - Path=/system/**\n filters:\n - StripPrefix=1\n # 文件服务\n - id: ruoyi-file\n uri: lb://ruoyi-file\n predicates:\n - Path=/file/**\n filters:\n - StripPrefix=1\n\n# 安全配置\nsecurity:\n # 验证码\n captcha:\n enabled: true\n type: math\n # 防止XSS攻击\n xss:\n enabled: true\n excludeUrls:\n - /system/notice\n\n # 不校验白名单\n ignore:\n whites:\n - /auth/logout\n - /auth/login\n - /auth/register\n - /*/v2/api-docs\n - /*/v3/api-docs\n - /csrf\n\n# springdoc配置\nspringdoc:\n webjars:\n # 访问前缀\n prefix:\n','1650061c268e8065f4ca40a1ee99808d','2020-05-14 14:17:55','2026-03-10 10:57:46','nacos_namespace_migrate','192.168.137.1','','','网关模块',NULL,NULL,'yaml',NULL,''),
(3,'ruoyi-auth-dev.yml','DEFAULT_GROUP','spring:\n data:\n redis:\n host: localhost\n port: 6379\n password: \n','72565b1a725e013154ee57c8fd3045c4','2020-11-20 00:00:00','2024-09-14 04:49:42','nacos','0:0:0:0:0:0:0:1','','','认证中心','null','null','yaml','',''), (3,'ruoyi-auth-dev.yml','DEFAULT_GROUP','spring:\n data:\n redis:\n host: localhost\n port: 6379\n password: \n','72565b1a725e013154ee57c8fd3045c4','2020-11-20 00:00:00','2024-09-14 04:49:42','nacos','0:0:0:0:0:0:0:1','','','认证中心','null','null','yaml','',''),
(4,'ruoyi-monitor-dev.yml','DEFAULT_GROUP','# spring\nspring:\n security:\n user:\n name: ruoyi\n password: 123456\n boot:\n admin:\n ui:\n title: 若依服务状态监控\n','6f122fd2bfb8d45f858e7d6529a9cd44','2020-11-20 00:00:00','2024-08-29 12:15:11','nacos','0:0:0:0:0:0:0:1','','','监控中心','null','null','yaml','',''), (4,'ruoyi-monitor-dev.yml','DEFAULT_GROUP','# spring\nspring:\n security:\n user:\n name: ruoyi\n password: 123456\n boot:\n admin:\n ui:\n title: 若依服务状态监控\n','6f122fd2bfb8d45f858e7d6529a9cd44','2020-11-20 00:00:00','2024-08-29 12:15:11','nacos','0:0:0:0:0:0:0:1','','','监控中心','null','null','yaml','',''),
(5,'ruoyi-system-dev.yml','DEFAULT_GROUP','# spring配置\nspring:\n data:\n redis:\n host: localhost\n port: 6379\n password: \n datasource:\n druid:\n stat-view-servlet:\n enabled: true\n loginUsername: ruoyi\n loginPassword: 123456\n dynamic:\n druid:\n initial-size: 5\n min-idle: 5\n maxActive: 20\n maxWait: 60000\n connectTimeout: 30000\n socketTimeout: 60000\n timeBetweenEvictionRunsMillis: 60000\n minEvictableIdleTimeMillis: 300000\n validationQuery: SELECT 1 FROM DUAL\n testWhileIdle: true\n testOnBorrow: false\n testOnReturn: false\n poolPreparedStatements: true\n maxPoolPreparedStatementPerConnectionSize: 20\n filters: stat,slf4j\n connectionProperties: druid.stat.mergeSql\\=true;druid.stat.slowSqlMillis\\=5000\n datasource:\n # 主库数据源\n master:\n driver-class-name: com.mysql.cj.jdbc.Driver\n url: jdbc:mysql://localhost:3306/ry-cloud?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8\n username: root\n password: password\n # 从库数据源\n # slave:\n # username: \n # password: \n # url: \n # driver-class-name: \n\n# mybatis配置\nmybatis:\n # 搜索指定包别名\n typeAliasesPackage: com.ruoyi.system\n # 配置mapper的扫描找到所有的mapper.xml映射文件\n mapperLocations: classpath:mapper/**/*.xml\n\n# springdoc配置\nspringdoc:\n gatewayUrl: http://localhost:8080/${spring.application.name}\n api-docs:\n # 是否开启接口文档\n enabled: true\n info:\n # 标题\n title: \'\'\n # 描述\n description: \'\'\n # 作者信息\n contact:\n name: RuoYi\n url: https://ruoyi.vip\n','a79ae256018abb7f3bbaba923baeb6af','2020-11-20 00:00:00','2024-09-14 04:49:54','nacos','0:0:0:0:0:0:0:1','','','系统模块','null','null','yaml','',''), (5,'ruoyi-system-dev.yml','DEFAULT_GROUP','# spring配置\nspring:\n data:\n redis:\n host: localhost\n port: 6379\n password: \n datasource:\n druid:\n stat-view-servlet:\n enabled: true\n loginUsername: ruoyi\n loginPassword: 123456\n dynamic:\n druid:\n initial-size: 5\n min-idle: 5\n maxActive: 20\n maxWait: 60000\n connectTimeout: 30000\n socketTimeout: 60000\n timeBetweenEvictionRunsMillis: 60000\n minEvictableIdleTimeMillis: 300000\n validationQuery: SELECT 1 FROM DUAL\n testWhileIdle: true\n testOnBorrow: false\n testOnReturn: false\n poolPreparedStatements: true\n maxPoolPreparedStatementPerConnectionSize: 20\n filters: stat,slf4j\n connectionProperties: druid.stat.mergeSql\\=true;druid.stat.slowSqlMillis\\=5000\n datasource:\n # 主库数据源\n master:\n driver-class-name: com.mysql.cj.jdbc.Driver\n url: jdbc:mysql://localhost:3306/ry-cloud?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8\n username: root\n password: password\n # 从库数据源\n # slave:\n # username: \n # password: \n # url: \n # driver-class-name: \n\n# mybatis配置\nmybatis:\n # 搜索指定包别名\n typeAliasesPackage: com.ruoyi.system\n # 配置mapper的扫描找到所有的mapper.xml映射文件\n mapperLocations: classpath:mapper/**/*.xml\n\n# springdoc配置\nspringdoc:\n gatewayUrl: http://localhost:8080/${spring.application.name}\n api-docs:\n # 是否开启接口文档\n enabled: true\n info:\n # 标题\n title: \'\'\n # 描述\n description: \'\'\n # 作者信息\n contact:\n name: RuoYi\n url: https://ruoyi.vip\n','a79ae256018abb7f3bbaba923baeb6af','2020-11-20 00:00:00','2024-09-14 04:49:54','nacos','0:0:0:0:0:0:0:1','','','系统模块','null','null','yaml','',''),