Compare commits

..

420 Commits

Author SHA1 Message Date
秋辞未寒
39781fbe7f add 添加 maven-wrapper 以支持项目构建环境的一致性 2026-02-21 21:12:36 +08:00
秋辞未寒
819234610c update spring-boot 4.0.1 => 4.0.3
update spring-boot-admin 3.5.6 => 4.0.1
update redisson 4.1.0 => 4.2.0
update bcprov 1.80 => 1.83
update aws-sdk 2.28.22 => 2.41.34
update anyline 8.7.3-20251210 => 8.7.3-20260202
update maven-jar-plugin 3.4.2 => 3.5.0
update maven-war-plugin 3.4.0 => 3.5.1
update maven-compiler-plugin 3.14.0 => 3.15.0
update maven-surefire-plugin 3.5.3 => 3.5.4
update flatten-maven-plugin 1.3.0 => 1.7.3
2026-02-21 21:09:22 +08:00
秋辞未寒
391b674945 update 优化模块pom.xml结构格式 2026-02-21 21:01:10 +08:00
AprilWind
ea32d9c4c8 update 将 application.yml 中的 biz-thread-pool-size 重命名为 mqtt-executor-size 2026-02-12 13:41:45 +08:00
秋辞未寒
4fb9858190 update FastExcel升级迁移至Apache Fesod 2026-02-11 14:09:20 +08:00
疯狂的狮子Li
3b5d7eba37 update 优化 mqtt 客户端 增加虚拟线程支持 2026-02-10 16:32:50 +08:00
疯狂的狮子Li
529f614dae Merge remote-tracking branch 'origin/dev' into futuer/boot4
# Conflicts:
#	pom.xml
2026-02-10 13:03:48 +08:00
疯狂的狮子Li
ac6fe13bcf update 重构 将 idempotent 与 ratelimiter 模块统一合并到 redis 模块 降级模块使用复杂度 2026-02-10 11:59:59 +08:00
AprilWind
4468656a97 update 优化mqtt模块依赖 2026-02-06 14:31:26 +08:00
Kayleigh Wang
310bffef54 !830 fix 修复删除租户功能后SQL执行异常
* fix 修复删除租户功能后SQL执行异常
2026-02-05 07:24:41 +00:00
秋辞未寒
240a581311 update 更新 RedisConfig 的 Jackson 反序列化安全验证策略与旧版本保持一致 2026-01-30 00:33:50 +08:00
疯狂的狮子Li
6c1eef7ff4 update 优化 RedisConfig 的 jackson配置写法 2026-01-29 17:55:00 +08:00
疯狂的狮子Li
efae1c914b Revert "update 使用Spring Redis Data自动配置项优化Redisson 4.X配置流程"
This reverts commit 7c3a5c4a1d.
2026-01-29 09:41:17 +00:00
秋辞未寒
7c3a5c4a1d update 使用Spring Redis Data自动配置项优化Redisson 4.X配置流程
update 优化Redisson自定义配置,Json序列化依赖升级至Jackson3.X
2026-01-29 17:13:19 +08:00
疯狂的狮子Li
ed9de38c6f fix 修复 TestDemoImportVo 包放置错误 2026-01-29 15:21:53 +08:00
清酒
28d4c88387 !828 fix: 修复演示案例导入 VO 缺失 AutoMapper 注解导致导入数据功能转换失败的问题
* fix: 修复演示案例导入 VO 缺失 AutoMapper 注解导致导入数据功能转换失败的问题
2026-01-29 07:20:57 +00:00
疯狂的狮子Li
c656f3340d update 优化 增加工作流短信发送案例 2026-01-28 15:29:07 +08:00
ColorDreams
cd0ee3f016 update 更新ip2region版本,优化IP未知地区占位符为0的情况 2026-01-28 13:14:35 +08:00
ColorDreams
48ea66cb1a update 使用release指令代替source和target指令进行编译构建 2026-01-28 13:12:56 +08:00
疯狂的狮子Li
34c3b81190 fix 修复 springboot升级到3.5.10之后大文件上传请求无响应问题(不清楚原因等spring修复) 2026-01-27 16:10:02 +08:00
疯狂的狮子Li
3797d9b8ed update 优化 使用虚拟线程优化查询速度 2026-01-23 14:56:05 +08:00
疯狂的狮子Li
59e0e6ab95 🧨🧨🧨发布 5.5.3 版本 提前祝大家新年快乐 2026-01-23 14:54:04 +08:00
疯狂的狮子Li
c2da068482 update springboot 3.5.9 => 3.5.10
update springdoc 2.8.14 => 2.8.15
update mybatis-plus 3.5.14 => 3.5.16
update hutool 5.8.40 => 5.8.43
update spring-boot-admin 3.5.5 => 3.5.6
2026-01-23 14:53:39 +08:00
疯狂的狮子Li
1bb597b855 🧨🧨🧨发布 5.5.3 版本 提前祝大家新年快乐 2026-01-23 14:00:24 +08:00
疯狂的狮子Li
348d7fc534 update springboot 3.5.9 => 3.5.10
update springdoc 2.8.14 => 2.8.15
update mybatis-plus 3.5.14 => 3.5.16
update hutool 5.8.40 => 5.8.43
update spring-boot-admin 3.5.5 => 3.5.6
2026-01-23 13:48:15 +08:00
Coast
8d19744cbc !824 update 优化 oss 依赖注释说明
* update 优化 oss 依赖注释说明
2026-01-22 18:03:42 +08:00
疯狂的狮子Li
32dba43ec4 update 优化 oss 依赖注释说明 2026-01-22 18:03:42 +08:00
疯狂的狮子Li
8666815963 fix 修复 不同类别菜单的判断逻辑有误问题 2026-01-22 18:03:42 +08:00
疯狂的狮子Li
eec3c44866 update README.md 2026-01-22 18:03:42 +08:00
疯狂的狮子Li
fb631283ca fix 修复 按钮菜单 不应该校验路由的问题 2026-01-22 18:03:42 +08:00
疯狂的狮子Li
9c0636978f update 优化 自行实现更漂亮的验证码图案 2026-01-22 18:03:42 +08:00
疯狂的狮子Li
fc00210a39 update 修改验证码默认样式 2026-01-22 18:03:42 +08:00
疯狂的狮子Li
ff299cea86 fix 修复 顶节点判断条件缺失 2026-01-22 18:03:42 +08:00
羡民Coding
7ffd918338 !822 fix: 文案错误
* fix: 文案错误
2026-01-22 18:03:42 +08:00
疯狂的狮子Li
19ef199da7 update 优化 StringUtils 过期的方法 2026-01-22 18:02:14 +08:00
疯狂的狮子Li
b8571e9ca1 update 优化 增加线程工具简化虚拟线程语法 2026-01-22 18:01:45 +08:00
疯狂的狮子Li
660757cb71 update 优化 使用虚拟线程优化查询速度 2026-01-22 11:27:58 +08:00
疯狂的狮子Li
4072b080fe update 优化 增加mqtt模块配置开关 2026-01-22 09:33:40 +08:00
Coast
76218091ad !824 update 优化 oss 依赖注释说明
* update 优化 oss 依赖注释说明
2026-01-21 06:41:34 +00:00
疯狂的狮子Li
95c9e37797 update 优化 oss 依赖注释说明 2026-01-21 11:51:43 +08:00
疯狂的狮子Li
aa277b373b fix 修复 不同类别菜单的判断逻辑有误问题 2026-01-21 11:46:33 +08:00
疯狂的狮子Li
79d9f47053 update README.md 2026-01-19 15:09:07 +08:00
疯狂的狮子Li
f984f08a14 fix 修复 按钮菜单 不应该校验路由的问题 2026-01-16 16:47:12 +08:00
疯狂的狮子Li
161b52d8d7 update 优化 mqtt-server 文档搭建说明 2026-01-16 15:44:42 +08:00
疯狂的狮子Li
befabc61de update 优化 mqtt-server 文档搭建说明 2026-01-16 15:42:02 +08:00
疯狂的狮子Li
5b82c12e17 add 增加 ruoyi-common-mqtt 模块 2026-01-16 15:39:10 +08:00
疯狂的狮子Li
6f94095bb0 update 优化 自行实现更漂亮的验证码图案 2026-01-14 18:28:37 +08:00
疯狂的狮子Li
2d4685ac5f update 修改验证码默认样式 2026-01-14 16:38:17 +08:00
疯狂的狮子Li
7f9e4e14f0 fix 修复 顶节点判断条件缺失 2026-01-14 09:19:46 +08:00
疯狂的狮子Li
145b903185 [重大更改] 移除多租户相关功能 2026-01-13 16:14:52 +08:00
羡民Coding
c5777c01c1 !822 fix: 文案错误
* fix: 文案错误
2026-01-12 06:01:54 +00:00
疯狂的狮子Li
55098339d4 update 优化 兼容path大写开头搜索 2026-01-12 09:28:02 +08:00
疯狂的狮子Li
469274d9b1 update 优化 大家都认可用"账"统一改为账 2026-01-12 09:28:02 +08:00
疯狂的狮子Li
596e83701a update 优化 添加菜单路由地址和名称的校验规则 2026-01-12 09:28:02 +08:00
疯狂的狮子Li
8a87c7aa4e update 优化 添加菜单路由地址和名称的校验规则 2026-01-12 09:28:01 +08:00
疯狂的狮子Li
b4467aa8e9 update 优化 统一用词 2026-01-12 09:28:01 +08:00
AprilWind
5de3114f05 update 优化oss日志侦听器打印级别 2026-01-12 09:28:01 +08:00
ColorDreams
8d4fdd9fc8 update ip2region version to 3.3.2 2026-01-12 09:28:01 +08:00
疯狂的狮子Li
459e9caf14 update 优化 兼容path大写开头搜索 2026-01-12 09:21:01 +08:00
疯狂的狮子Li
0940ba6762 update 优化 大家都认可用"账"统一改为账 2026-01-12 09:17:39 +08:00
疯狂的狮子Li
d8ed23f227 update 优化 添加菜单路由地址和名称的校验规则 2026-01-09 17:10:51 +08:00
疯狂的狮子Li
948eba6566 update 优化 添加菜单路由地址和名称的校验规则 2026-01-09 13:19:21 +08:00
疯狂的狮子Li
1a14bdf256 update 优化 统一用词 2026-01-09 11:50:28 +08:00
疯狂的狮子Li
bbc684b335 update 删除已经过期的配置类 2026-01-06 17:26:45 +08:00
疯狂的狮子Li
2b8f4e1d2c update 下架过期的赞助商 2026-01-06 17:22:44 +08:00
疯狂的狮子Li
2f4e89ee42 update 不兼容整体升级 springboot 4.X
update springboot 3.5 => 4.0
update springdoc 2.8 => 3.0
update mybatis-plus 3.5.14 => 3.5.15
update redisson 3.52.0 => 4.1.0
update dynamic-ds 4.3.1 => 4.5.0
2026-01-06 17:18:08 +08:00
AprilWind
d634c2a292 update 优化oss日志侦听器打印级别 2026-01-05 14:39:40 +08:00
ColorDreams
8b97e7bc53 update ip2region version to 3.3.2 2025-12-24 19:09:36 +08:00
疯狂的狮子Li
874ad7c9b7 fix 修复 判断条件写反问题 2025-12-24 13:10:47 +08:00
miracle-bean
89d6f6f247 !815 fix websocket 多线程下IO阻塞的问题
* fix websocket 多线程下IO阻塞的问题
2025-12-23 07:55:24 +00:00
疯狂的狮子Li
1324a1cb16 update 优化 增加 HandlerMethodValidationException 参数校验异常连接 2025-12-23 15:30:32 +08:00
ColorDreams
961bca462e fix 临时修复Ip2Region InputStream读取函数导致的OOM问题 2025-12-23 14:32:48 +08:00
疯狂的狮子Li
496df8494e update 优化 翻译实现类逻辑 2025-12-23 10:38:18 +08:00
疯狂的狮子Li
2f1f9689e0 🧨🧨🧨发布 5.5.2 版本 2025年最后一版 2025-12-23 09:28:20 +08:00
疯狂的狮子Li
8110413fdf update 删除错误的配置 2025-12-23 09:22:42 +08:00
疯狂的狮子Li
c1f64d3450 update anyline 8.7.2-20250603 => 8.7.3-20251210 2025-12-22 13:11:38 +08:00
疯狂的狮子Li
cb00f4c9c1 update snailjob 1.8.0 => 1.9.0 2025-12-22 09:42:56 +08:00
疯狂的狮子Li
79512c69b2 fix 修复 创建租户同步工作流数据 在没有流程定义的情况下不会复制流程类别的问题 2025-12-19 19:38:45 +08:00
疯狂的狮子Li
a5fb128f11 update springboot 3.5.8 => 3.5.9 2025-12-19 11:31:53 +08:00
dr5hx
8a04e3c88f !811 feat(excel): 增强单元格合并处理逻辑
* feat(excel): 增强单元格合并处理逻辑
2025-12-19 01:48:31 +00:00
疯狂的狮子Li
dac447b76f fix 修复 listenerVariable.getVariable() 获取null问题 2025-12-19 09:36:22 +08:00
AprilWind
35a9e4c8e8 update 增加高安全脱敏方法 2025-12-18 19:19:01 +08:00
AprilWind
0d87c12d3c update 优化灵活脱敏方法 2025-12-18 17:30:32 +08:00
AprilWind
f20a0c4342 update 优化构建流程参数 2025-12-16 18:27:21 +08:00
AprilWind
6c8d637bd2 update 优化报错信息提示 2025-12-16 17:05:18 +08:00
马铃薯头
20e9957db2 !807 update 代码生成字典类型字段新增更新验证策略
* update 代码生成字典类型字段新增更新验证策略
2025-12-16 08:36:03 +00:00
AprilWind
9baded9326 update 测试单表和测试树表增加搜索条件 2025-12-16 14:16:13 +08:00
疯狂的狮子Li
b5902debb6 update 优化 删除无用配置类代码 2025-12-15 15:44:54 +08:00
AprilWind
bcd5bb0f86 !805 update 优化我的待办时间展示
* update 优化我的待办时间展示
2025-12-15 06:19:29 +00:00
AprilWind
1a461f7d3d !804 update 优化登录提示语
* update 优化登录提示语
2025-12-15 03:10:49 +00:00
疯狂的狮子Li
e23d99d85b fix 修复 form_path 输入空字符串导致的问题 2025-12-15 09:36:12 +08:00
秋辞未寒
f07c20afab update Ip2Region version to 3.3.1,使用新的xdb文件加载函数优化xdb数据库的加载流程 2025-12-12 22:50:23 +08:00
疯狂的狮子Li
420553eaa6 fix 修复 工作流类别 顶节点父级可以被修改导致无法加载的问题 2025-12-12 17:15:35 +08:00
疯狂的狮子Li
1d8d93eaa3 fix 修复 微软三方对接参数缺失 2025-12-12 11:40:51 +08:00
疯狂的狮子Li
5f0d09fd45 update 优化 日志输出内容 2025-12-12 09:32:07 +08:00
AprilWind
1c2b7d7017 update 优化Ip2Region初始化打印日志 2025-12-12 09:25:18 +08:00
AprilWind
5fb2890167 update 增加对IPv6地址库的支持,优化Ip2Region初始化逻辑 2025-12-11 19:57:27 +08:00
秋辞未寒
1165c8dc06 !803 feat IP地址行政区域离线查询支持IPv6(已提供相关代码,开发者自行决定是否使用)
* update IP地址行政区域助手类重命名以匹配其工具类的功能定位
* feat IP地址行政区域离线查询支持IPv6(已提供相关代码,开发者自行决定是否使用)
2025-12-11 05:23:09 +00:00
AprilWind
ee09377997 !802 update 添加 ID 生成工具类,支持多种 ID 生成方式
* update 使用 IdGeneratorUtil 替代主键生成
* update 添加 ID 生成工具类,支持多种 ID 生成方式
2025-12-11 02:22:49 +00:00
疯狂的狮子Li
1921b22a57 fix 修复 获取可驳回节点重复问题(感谢 搬砖的小庄) 2025-12-11 10:19:11 +08:00
疯狂的狮子Li
8718989c52 update 优化 任务执行监听器 传递任务的相关数据 不传递实例相关数据了(避免并行节点覆盖问题) 2025-12-11 09:43:29 +08:00
疯狂的狮子Li
36069cd0e4 update 优化 加签判断逻辑 2025-12-11 09:17:58 +08:00
马铃薯头
39b19ac361 !798 fix 修复 excel 导出多 sheet 合并单元格失效问题
* fix 修复 excel 导出多 sheet 合并单元格失效问题
2025-12-10 09:22:14 +00:00
疯狂的狮子Li
279488e7ed update warm-flow 1.8.3 => 1.8.4 2025-12-10 17:01:19 +08:00
疯狂的狮子Li
e28e15d943 update warm-flow 1.8.3 => 1.8.4 2025-12-10 16:31:55 +08:00
疯狂的狮子Li
b44b5551e3 update warm-flow 1.8.3 => 1.8.4 2025-12-10 16:29:59 +08:00
疯狂的狮子Li
0cb4b35f53 update 优化 文件上传增加文件内容长度校验 2025-12-10 09:46:18 +08:00
疯狂的狮子Li
9571e71707 fix 修复 本地文件上传 无法获取文件长度问题 2025-12-09 17:02:43 +08:00
疯狂的狮子Li
dfa7d88255 update 优化 日志脱敏改用JsonNode处理提高效率 2025-12-09 16:14:56 +08:00
疯狂的狮子Li
8d29091afa fix 修复 jsonParam 参数可能为空问题 2025-12-09 15:50:39 +08:00
疯狂的狮子Li
116fa0053d add 新增 Topiam 赞助商 2025-12-08 13:04:12 +08:00
疯狂的狮子Li
0c08455b32 update 优化 接口访问日志 排除敏感参数输出 2025-12-08 10:00:57 +08:00
疯狂的狮子Li
581203ba15 update 优化 修改 ossclient 并发配置 2025-12-08 09:26:12 +08:00
AprilWind
50fa220471 update 任务处理增加Lock4j锁支持 2025-12-04 14:54:01 +08:00
AprilWind
287effdc6d update 增加SpEL表达式解析异常处理 2025-12-02 19:02:21 +08:00
AprilWind
1d4fcf737a refactor 优化工作流服务中的异常处理 2025-12-02 17:28:35 +08:00
AprilWind
e672a3bc6c update 增加SpEL表达式解析异常处理 2025-12-02 16:28:09 +08:00
AprilWind
ec703ceeb8 update 优化代码生成中的Lock4j锁 2025-12-02 10:10:24 +08:00
AprilWind
6aa4e83413 update 优化我的任务查询条件 2025-12-01 17:21:09 +08:00
gssong
65d677ac90 fix 修复排他网关执行后,驳回选到未执行的网关 2025-11-25 18:52:25 +08:00
gssong
aca2b6d498 update 补充操作日志 2025-11-25 11:26:10 +08:00
gssong
dd5f72cc99 update 补充操作日志 2025-11-25 11:25:14 +08:00
gssong
b1d3d87360 fix 修复指定选人审批后 再次驳回到指定选人环节后 全部人能看到待办问题 2025-11-24 18:06:09 +08:00
AprilWind
e67fc5ebd4 !789 update 增加脱敏工具类支持灵活配置可见长度和掩码长度
* update 增加脱敏工具类支持灵活配置可见长度和掩码长度
2025-11-24 06:20:37 +00:00
疯狂的狮子Li
6a2c74537e update 增加 fory 开启日志说明 2025-11-24 11:54:52 +08:00
疯狂的狮子Li
041e226059 update springboot 3.5.7 => 3.5.8
update springdoc 2.8.13 => 2.8.14
update redisson 3.51.0 => 3.52.0
update fury 更名为 fory 0.9.0 => 0.13.1
2025-11-24 10:05:38 +08:00
AprilWind
0418b6c6ff !788 update 参数配置服务 增加多种配置获取方法,支持不同类型的配置解析
* update 参数配置服务 增加多种配置获取方法,支持不同类型的配置解析
2025-11-24 01:18:49 +00:00
AprilWind
c9272acce2 update 增加流程定义发布检查,确保流程在执行前已发布 2025-11-21 09:47:05 +08:00
疯狂的狮子Li
8d51adee10 reset 回滚 snailjob 1.8.1版本到1.8.0版本 出现严重依赖冲突问题 2025-11-20 17:46:24 +08:00
AprilWind
6d4cc28dcd update 优化消息发送逻辑,增加异常处理并记录未处理的消息类型 2025-11-20 16:38:46 +08:00
疯狂的狮子Li
fc35a1469f update 优化 pg 字段类型适配 2025-11-19 17:41:07 +08:00
疯狂的狮子Li
f70a37c050 update 优化 将特殊方法改为私有禁止不懂的用户乱用 2025-11-19 16:23:51 +08:00
疯狂的狮子Li
181f461984 fix 修复 pg更新sql书写错误 2025-11-14 13:21:46 +08:00
AprilWind
75618347fa update 优化删除业务ID的方法,支持字符串类型的业务ID 2025-11-14 09:38:00 +08:00
疯狂的狮子Li
5a57e6b835 update 优化 更正注释描述错误 2025-11-13 16:34:03 +08:00
Jack
d1d47d2599 !786 update 上传请求的预签名URL
* update 上传请求的预签名URL
2025-11-13 08:31:04 +00:00
AprilWind
f35938a068 update 升级 snailjob 和 warm-flow 版本至 1.8.1 和 1.8.3 2025-11-13 09:02:33 +08:00
秋辞未寒
888c14615d update 优化 !781Excel 模版动态数据下拉 泛型逻辑 2025-11-11 17:02:53 +08:00
王志龙
fa6c9696f0 !785 FlwSpelController类注释补全
* FlwSpelController类注释补全
2025-11-11 05:34:06 +00:00
Angus
37038449ab !781 Excel模版动态数据下拉
* Excel模版动态数据下拉
* Excel模版动态数据下拉
2025-11-11 01:58:55 +00:00
gssong
9bff358afd fix 修复申请人提交可直接结束流程 2025-11-09 08:44:25 +08:00
疯狂的狮子Li
d2a45156a2 fix 修复 warmflow的官方sql书写不正确问题 2025-10-29 10:13:46 +08:00
Tyler Ge
9df0a8de1c !780 fix: 修复CompleteTaskDTO中getVariables()中variables == null 时的返回值问题
* fix: 修复CompleteTaskDTO中getVariables()中variables == null 时的返回值问题
2025-10-29 01:26:05 +00:00
疯狂的狮子Li
5ea8d8c950 🐳🐳🐳发布 5.5.1 正式版 日常依赖升级bug修复 2025-10-28 11:14:44 +08:00
疯狂的狮子Li
3318109044 update springboot 3.5.6 => 3.5.7 2025-10-27 09:41:00 +08:00
AprilWind
aa1f89e253 update 优化 SSE 心跳检测逻辑,增强连接管理与异常处理 2025-10-24 10:53:52 +08:00
马铃薯头
35c77403d6 !778 update 客户端管理新增客户端key唯一校验逻辑
* update 客户端管理新增客户端key唯一校验逻辑
2025-10-22 07:29:27 +00:00
疯狂的狮子Li
603fb7b92d fix 修复 全局处理器不生效问题 根据官方issue改为特殊写法(不理解为什么 https://github.com/apache/fesod/issues/648) 2025-10-22 14:20:53 +08:00
疯狂的狮子Li
6cf0c79433 fix 修复 查询任务扩展数据不存在导致的空报错 2025-10-22 11:03:04 +08:00
草編的戒指礻
3934e119d6 !776 update 优化 sse 修复相同token历史连接未关闭问题;新增心跳监测,关闭无效连接
* update 优化 sse 心跳定时器执行方式
* update 优化 sse 心跳检测写法
* update 优化 sse 修复相同token历史连接未关闭问题;新增心跳监测,关闭无效连接
2025-10-20 04:01:21 +00:00
AprilWind
33a6a21fdf update warm-flow同步升级sql 2025-10-16 16:40:02 +08:00
AprilWind
7800b1259f update warm-flow 升级 1.8.2 2025-10-16 16:24:06 +08:00
疯狂的狮子Li
3623fc33d9 fix 修复 修复查询pg类型问题 2025-10-15 18:02:53 +08:00
疯狂的狮子Li
f8612eb52e fix 修复 翻译时异常导致json序列化结构体不符合预期 2025-10-15 13:31:24 +08:00
疯狂的狮子Li
8d32b0311a fix 修复 orderby属性书写重复问题 2025-10-14 18:52:49 +08:00
AprilWind
60bcd2d6e9 update 添加菜单可见性和状态字段到菜单树 2025-10-14 10:24:38 +08:00
AprilWind
5ccb511064 !772 update 优化 nginx 配置,增强性能与安全性
* update 优化 nginx 配置,增强性能与安全性
2025-09-30 02:07:34 +00:00
疯狂的狮子Li
78baf6497a update 优化 拦截sse超时异常 不需要额外处理 2025-09-29 13:35:10 +08:00
疯狂的狮子Li
0719e53f01 update springboot-admin 3.5.3 -> 3.5.5 修复登录白屏问题 2025-09-29 11:57:18 +08:00
疯狂的狮子Li
5f2c4205a5 fix 修复 三方授权 钉钉回调地址未进行url编码问题 由全局编码改为单独编码 避免其他三方调用重复编码 2025-09-28 16:18:02 +08:00
疯狂的狮子Li
2fe4c96706 update 优化 删除Threads类 已经不需要了 2025-09-26 15:24:04 +08:00
AprilWind
5c634940c2 update 增强 Mybatis 异常处理,添加根因查找功能 2025-09-26 14:41:32 +08:00
疯狂的狮子Li
6036f8750b add 增加 同步租户参数配置功能 2025-09-26 11:57:24 +08:00
疯狂的狮子Li
dbcd8f58eb fix 修复 mybatis内报token异常无法正常返回前端信息 2025-09-26 11:19:59 +08:00
疯狂的狮子Li
8905e232e5 fix 修复 mybatis内报token异常无法正常返回前端信息 2025-09-26 11:19:48 +08:00
疯狂的狮子Li
4f15158486 update 优化 satoken 异常信息 强制返回json格式 2025-09-26 09:54:43 +08:00
AprilWind
d2413abd5c update 优化工作流常量使用 2025-09-26 09:41:54 +08:00
友杰
f7ffadeaff !771 bug-修改遗漏的常量替换
* bug-修改遗漏的常量替换
2025-09-26 01:30:47 +00:00
AprilWind
f9eec856e7 !769 update 添加 JSON 格式校验注解及实现
* update 添加 JSON 格式校验注解及实现
2025-09-25 10:50:34 +00:00
疯狂的狮子Li
62562650fe update 更新流程案例json文件 2025-09-25 11:57:55 +08:00
疯狂的狮子Li
df171097c3 update 优化 后端发起流程增加扩展表对象 2025-09-24 16:52:46 +08:00
AprilWind
1977aabc9a update 忽略压缩后的日志文件 *.log.gz 2025-09-23 10:20:51 +08:00
AprilWind
483c4e6d0a update 隐藏 nginx 版本号以增强安全性 2025-09-23 09:25:42 +08:00
疯狂的狮子Li
f616c6931c 发布 5.5.0 喜迎国庆🧨🧨🧨 2025-09-22 11:13:32 +08:00
疯狂的狮子Li
26e10293f5 update snailjob 1.7.2 => 1.8.0 2025-09-22 11:11:06 +08:00
疯狂的狮子Li
60e578f763 Revert "update 更新工作流sql"
This reverts commit 8909b8a7d4.
2025-09-22 11:08:23 +08:00
疯狂的狮子Li
5cd4d8ca11 Revert "update warm-flow 升级 1.8.2-m2"
This reverts commit 8ae9bde731.
2025-09-22 11:08:18 +08:00
疯狂的狮子Li
41a6230b6e update 优化 去除不应该加压缩的日志文件 2025-09-22 11:05:13 +08:00
Lau
effda4f6e8 !765 update 历史日志文件增加压缩
* update 历史日志文件增加压缩
2025-09-22 03:00:08 +00:00
疯狂的狮子Li
af4c38e439 update 优化 更新ip2region.xdb文件 2025-09-19 17:44:32 +08:00
疯狂的狮子Li
fafa8cd573 update springboot 3.5.4 => 3.5.6 2025-09-19 14:12:47 +08:00
疯狂的狮子Li
8909b8a7d4 update 更新工作流sql 2025-09-18 18:17:33 +08:00
AprilWind
8ae9bde731 update warm-flow 升级 1.8.2-m2 2025-09-16 21:21:08 +08:00
疯狂的狮子Li
a703cb2ad1 update 增加 加密头用来判断数据是否已经被加密了 防止重复加密 2025-09-15 17:14:47 +08:00
疯狂的狮子Li
a918b880d6 update 增加 加密头用来判断数据是否已经被加密了 防止重复加密 2025-09-15 17:10:31 +08:00
疯狂的狮子Li
e795e315eb update 生成模板前端增加fixed 2025-09-15 15:46:01 +08:00
Lau
81869cfeb3 !764 update 生成模板前端增加fixed
* update 生成模板前端增加fixed
2025-09-15 07:39:34 +00:00
疯狂的狮子Li
fc6f61bc95 update springboot-admin 3.5.1 => 3.5.3
update springdoc 2.8.11 => 2.8.13
update mybatis-plus 3.5.12 => 3.5.14
update mapstruct-plus 1.4.8 => 1.5.0
update sms4j 3.3.4 => 3.3.5
2025-09-15 11:52:05 +08:00
AprilWind
d44e45ad3b update 添加节点悬浮提示配置开关 2025-09-04 17:30:15 +08:00
AprilWind
00ed9ddd10 update 优化 SysMenu 的 selectObjs 查询 2025-09-04 16:04:36 +08:00
疯狂的狮子Li
341fc144a1 fix 修复 自定义sql在pg数据库类型异常问题 2025-09-04 15:42:30 +08:00
AprilWind
b6b1b2de18 update 优化全局日期格式转换逻辑 2025-09-04 15:30:09 +08:00
疯狂的狮子Li
c19f2b9e4e update 优化 岗位页面查询权限问题 2025-09-03 14:14:35 +08:00
秋辞未寒
3a11f18656 fix 修复 StreamUtils 返回不可变类型报错问题 2025-09-02 15:58:11 +08:00
疯狂的狮子Li
5a43212ccc fix 修复 StreamUtils 返回不可变类型报错问题 2025-09-02 15:51:42 +08:00
Rogue杨
f4cfd1c913 !759 [fix] 解决工作流通知messageType参数判空逻辑错误的问题
* [fix] 解决工作流通知messageType参数判空逻辑错误的问题
2025-09-02 04:57:56 +00:00
疯狂的狮子Li
26ce8f30c9 update 优化 支持子菜单配置默认激活的父菜单activeMenu 2025-09-02 10:45:54 +08:00
疯狂的狮子Li
2258962770 Revert "!734 update 重写selectOne方法"
This reverts commit f2e0361fb6.
2025-09-01 14:25:47 +08:00
疯狂的狮子Li
655e84012c Revert "update 优化 增加selectOne使用注意事项"
This reverts commit bf10a13088.
2025-09-01 14:25:40 +08:00
疯狂的狮子Li
f683ef00b8 fix 修复 json模块配置 默认覆盖了spring module 配置问题 改为让spring自动加载注册 2025-09-01 11:46:57 +08:00
秋辞未寒
424b2ea164 update Excel写出包装器添加泛型用于限定write入参类型 2025-08-31 13:24:12 +08:00
秋辞未寒
7bb4838132 feat add Excel工具类支持更灵活的自定义导出方式,以便用户分批处理导出数据 2025-08-30 18:09:01 +08:00
秋辞未寒
20516758ea upadte 优化Stream流工具类 2025-08-30 16:53:13 +08:00
秋辞未寒
2d5f84ebc2 upadte 优化Stream流工具类 2025-08-30 16:46:04 +08:00
疯狂的狮子Li
6bc28e41de update 优化 工作流代码 2025-08-29 10:06:22 +08:00
疯狂的狮子Li
a4fb3fadaf update 优化 将返回值从bo改为vo 2025-08-29 09:52:21 +08:00
疯狂的狮子Li
cfa67fcd8c Revert "update 添加 FlowCopyVo 类,优化抄送对象处理逻辑"
This reverts commit e5e8d305d2.
2025-08-29 01:35:27 +00:00
AprilWind
e5e8d305d2 update 添加 FlowCopyVo 类,优化抄送对象处理逻辑 2025-08-29 09:29:12 +08:00
疯狂的狮子Li
9d0084409e update 优化 支持后端监听器解析节点扩展数据到流程变量(按钮权限 抄送人 扩展变量) 2025-08-28 17:56:10 +08:00
疯狂的狮子Li
ee02f46dfd update 优化 支持前端返回节点扩展数据(按钮权限 抄送人 扩展变量) 2025-08-28 17:55:04 +08:00
AprilWind
25de0b3530 update 解析扩展属性 JSON,构建 Node 扩展属性对象,增强代码可读性 2025-08-28 16:25:33 +08:00
AprilWind
aa76859a05 update 添加抄送设置和变量枚举,优化扩展节点配置逻辑 2025-08-28 15:00:32 +08:00
疯狂的狮子Li
71b70a59fe fix 修复 判断错误导致新增报错问题 2025-08-28 10:59:00 +08:00
AprilWind
05c9528549 !752 update 优化流程实例业务扩展的保存和删除逻辑,增强代码可读性
* update 优化流程实例业务扩展的保存和删除逻辑,增强代码可读性
2025-08-27 11:10:03 +00:00
疯狂的狮子Li
1feb2a3861 fix 修复 菜单与部门 未做角色状态判断 2025-08-27 17:54:05 +08:00
疯狂的狮子Li
237e78e80c update hutool 5.8.38 => 5.8.40 默认支持了验证码不生成负数 2025-08-27 11:58:07 +08:00
秋辞未寒
ffc3dcaec9 upadte 优化Excel单元格合并处理器代码逻辑分支 2025-08-26 17:13:35 +08:00
疯狂的狮子Li
a94e474069 fix 修复 时间解析类异常问题 2025-08-26 16:10:17 +08:00
疯狂的狮子Li
40a0e57870 fix 修复 时间解析类异常问题 2025-08-26 16:02:11 +08:00
疯狂的狮子Li
c01ed34602 update fastexcel 1.2.0 => 1.3.0 2025-08-25 13:50:09 +08:00
疯狂的狮子Li
26a99003d2 update springdoc 2.8.10 => 2.8.11
update redisson 3.50.0 => 3.51.0
2025-08-25 09:58:46 +08:00
疯狂的狮子Li
93c886d3ed update 优化 对三方授权 redirectUri 回调地址进行url编码 2025-08-25 09:58:06 +08:00
AprilWind
9e1027690b update 更新 warm-flow 版本至 1.8.1 2025-08-22 10:23:37 +08:00
Lapwing
cc120c06fd !746 update 优化代码生成模板空格对齐
* update 优化代码生成模板空格对齐
2025-08-22 02:16:51 +00:00
AprilWind
3827da078a update 移除不必要的流程状态颜色配置 2025-08-22 09:54:40 +08:00
疯狂的狮子Li
70d3505b94 update springdoc 2.8.9 => 2.8.10 2025-08-21 10:07:15 +08:00
疯狂的狮子Li
a39a69cac5 reset 回滚错误提交 2025-08-21 09:25:56 +08:00
疯狂的狮子Li
1dbce3ab7c fix 修复 校验租户账号余额 查询语句错误 2025-08-21 09:20:35 +08:00
疯狂的狮子Li
9742b1b596 fix 修复 流程重新提交报错问题 2025-08-19 17:59:29 +08:00
疯狂的狮子Li
d98d11ae2d fix 修复 流程重新提交报错问题 2025-08-19 17:48:30 +08:00
疯狂的狮子Li
6742dcb33e fix 修复 sql书写错误 2025-08-19 17:18:37 +08:00
疯狂的狮子Li
09a51478a5 add 新增 请假表 申请编号字段sql 2025-08-18 09:44:22 +08:00
疯狂的狮子Li
f02601ab2c update 优化 表sql书写格式 2025-08-16 11:31:45 +08:00
gssong
ac56ca0e81 add 补充流程扩展sql 2025-08-15 21:35:42 +08:00
gssong
0fcf77e2ed add 增加流程业务扩展 2025-08-15 21:18:25 +08:00
DoubleH
0f0a3a181e !743 update 注册功能同步优化 验证码校验逻辑
* update 注册功能同步优化 验证码校验逻辑
2025-08-15 08:29:49 +00:00
疯狂的狮子Li
e24e2c51e4 update 优化 验证码校验逻辑 2025-08-15 14:04:17 +08:00
疯狂的狮子Li
2b0dd82d3d update 优化 工作流后台发起或审批可以手动设置办理人 2025-08-15 11:18:46 +08:00
疯狂的狮子Li
b97f711eb4 update snailjob 1.7.0 => 1.7.2 2025-08-14 09:52:46 +08:00
疯狂的狮子Li
0250ca4eb8 update warm-flow 升级 1.8.0 正式版 2025-08-14 09:51:44 +08:00
疯狂的狮子Li
23338995d7 update warm-flow 升级 1.8.0-m3 2025-08-13 10:27:52 +08:00
AprilWind
84fd02e7d8 update 优化数据库类型获取和判断逻辑,增强代码可读性 2025-08-12 21:55:24 +08:00
秋辞未寒
ae5bec994d upadte 优化Excel单元格合并代码逻辑,明确处理类职责 2025-08-12 18:26:18 +08:00
秋辞未寒
8f3a1b589e upadte 优化OSS文件下载代码 2025-08-12 16:37:06 +08:00
秋辞未寒
ad6b3d4b3f update 改用发布订阅的方式替代阻塞流,优化大文件下载时的内存占用 2025-08-12 16:17:07 +08:00
疯狂的狮子Li
e2801037cf update 优化 删除监控无用配置代码(升级之后不需要了) 2025-08-11 14:04:39 +08:00
疯狂的狮子Li
65061f17fe update 优化 由spring自己初始化线程池 2025-08-11 09:47:08 +08:00
chengliejian
d0f4d93615 !739 支持 @ExcelIgnoreUnannotated 注解,修复未注解字段导致列合并错位的问题
* 优化避免每个字段都进行ExcelIgnoreUnannotated.class判断
* 支持 @ExcelIgnoreUnannotated 注解,修复未注解字段导致列合并错位的问题
2025-08-07 09:11:42 +00:00
AprilWind
5d69832423 update 优化以逗号拼接元素 2025-08-06 11:43:37 +08:00
AprilWind
0c1e39ea14 update 优化以逗号拼接元素 2025-08-06 11:18:06 +08:00
AprilWind
a39bc870d1 update 优化发布流程定义抛出异常
- StringUtils.join 默认会跳过 null,不会抛异常
2025-08-06 10:51:51 +08:00
AprilWind
7357912681 update 新增支持占位符格式的 ServiceException 构造方法
- 新增 ServiceException(String message, Object... args) 构造器,内部使用 Hutool StrFormatter.format 格式化消息
- 解决日志打印和异常抛出信息格式不统一的问题,统一使用 {} 占位符
- 优化异常消息书写,简化拼接,提升代码可读性和维护性
2025-08-06 10:43:41 +08:00
疯狂的狮子Li
901992674e add 增加赞助商 2025-08-06 10:21:12 +08:00
疯狂的狮子Li
7ceb85ffa0 add 增加赞助商 2025-08-06 10:08:22 +08:00
疯狂的狮子Li
4672d7de4d fix 修复 撤销终止等操作 都变成退回的问题 2025-08-05 11:55:15 +08:00
gssong
87ab6e1744 remove 删除无用代码 2025-08-04 18:43:39 +08:00
gssong
ae0a03728b Merge branch 'dev' of https://gitee.com/dromara/RuoYi-Vue-Plus into dev 2025-08-04 18:41:02 +08:00
gssong
6fc82a59f1 add 增加启动流程并办理第一个任务接口 2025-08-04 18:40:14 +08:00
疯狂的狮子Li
6c33fa48ec update snailjob 1.6.0 => 1.7.0(新增的网卡配置有异常等待官方修复 不耽误正常使用) 2025-08-04 14:32:56 +08:00
疯狂的狮子Li
343d5d21d8 update 更新工作流sql 2025-08-04 11:15:57 +08:00
AprilWind
0ba909c52e update work-flow 1.6.8 => 1.8.0-m1 2025-08-01 18:34:09 +08:00
AprilWind
808ce9c25a update 优化办理人权限设置列表 2025-08-01 17:57:46 +08:00
疯狂的狮子Li
4351fc5239 update 优化 升级jdk版本 2025-08-01 17:22:47 +08:00
疯狂的狮子Li
a545f7fc44 update 优化 setCacheObject 简化写法 2025-08-01 16:30:33 +08:00
AprilWind
acfcdf4d9a update 全局替换为 Convert.toStr,优化 null 字符串处理 2025-08-01 15:29:36 +08:00
疯狂的狮子Li
9683252783 fix 修复 配置缺失 2025-08-01 09:19:15 +08:00
疯狂的狮子Li
49c00e162b update 删除无用依赖引入 2025-07-31 11:25:07 +08:00
疯狂的狮子Li
076a0a44fa update 优化 isLogin 判断逻辑 2025-07-31 10:17:27 +08:00
疯狂的狮子Li
0d93589d99 update 优化 PlusSaTokenDao 删除key同步删除本地缓存 2025-07-31 10:11:46 +08:00
疯狂的狮子Li
54a8189e27 fix 修复 依赖漏删 2025-07-31 09:21:18 +08:00
疯狂的狮子Li
84f17011ad fix 修复 监控代码报错问题 2025-07-30 16:57:57 +08:00
疯狂的狮子Li
f47bd39644 update 优化 springboot 3.5 新特性与过期代码 2025-07-30 16:10:00 +08:00
疯狂的狮子Li
89f9617ccb update springboot 3.4.7 => 3.5.4
update springboot-admin 3.4.7 => 3.5.1
update springdoc 2.8.8 => 2.8.9
update lombok 1.18.36 => 1.18.38
2025-07-30 15:09:18 +08:00
疯狂的狮子Li
bf10a13088 update 优化 增加selectOne使用注意事项 2025-07-30 15:07:38 +08:00
AprilWind
f2e0361fb6 !734 update 重写selectOne方法
* update 重写selectOne方法
2025-07-30 02:46:51 +00:00
秋辞未寒
554152635d update 优化数据权限注解切点逻辑,使切点逻辑更清晰 2025-07-29 15:52:08 +08:00
疯狂的狮子Li
b379574637 update 优化 压制配置警告 2025-07-29 14:57:42 +08:00
疯狂的狮子Li
6a556cc6ff fix 修复 snailjob 未判断配置空的情况 2025-07-29 14:27:18 +08:00
疯狂的狮子Li
a6950275ad update 优化 调整包名 2025-07-29 11:27:42 +08:00
秋辞未寒
58b1bf5c33 !731 update 把数据权限注解全部交给AOP处理,使用自定义动态方法匹配器匹配注解
* update 把数据权限注解全部交给AOP处理,使用自定义动态方法匹配器匹配注解
2025-07-29 03:25:59 +00:00
疯狂的狮子Li
c85f693ca6 update 优化 调整自动审批代码逻辑 2025-07-28 17:09:45 +08:00
疯狂的狮子Li
5f466fd0c4 update 优化 getBackTaskNode 获取驳回节点接口 如果是委派直接返回当前节点 不允许驳回到其他节点 2025-07-28 16:25:20 +08:00
疯狂的狮子Li
127eaf936c update 增加国内文档加速地址 2025-07-28 13:38:27 +08:00
Rogue杨
fcd8556076 !732 [fix] 解决委托、转办时nextTasks为空导致空指针的问题
* [fix] 解决委托、转办时nextTasks为空导致空指针的问题
2025-07-28 02:24:27 +00:00
疯狂的狮子Li
0512781513 update 优化代码 2025-07-28 09:58:40 +08:00
may
2472359adb add 增加下一节点执行人是当前任务处理人自动审批
fix 修复已完成的实例删除失败
2025-07-27 10:44:57 +08:00
AprilWind
29d4bb4e59 fix 修复权限判断逻辑 2025-07-26 16:58:26 +08:00
AprilWind
cce95424ce fix 修复权限判断逻辑 2025-07-26 16:40:07 +08:00
may
8d7358e663 update 调整变量修改 2025-07-25 23:18:28 +08:00
may
240f10ab45 update 调整变量修改 2025-07-25 23:16:22 +08:00
疯狂的狮子Li
48213bc9c9 fix 修复 个人中心数据被脱敏问题 2025-07-25 16:36:24 +08:00
疯狂的狮子Li
3995d9699d fix 修复 权限为null导致报错问题 2025-07-25 15:47:16 +08:00
疯狂的狮子Li
ecd4e3eaf0 fix 修复 监听器变量使用错误 2025-07-24 15:23:23 +08:00
疯狂的狮子Li
2e3a42c669 update 优化 调整上传超时时间 2025-07-23 17:46:30 +08:00
疯狂的狮子Li
82997fc6cd update 优化 getInfo 接口忽略数据权限 2025-07-22 18:08:44 +08:00
songgaoshuai
0dce571270 add 增加催办接口,调整消息发送 2025-07-22 11:46:04 +08:00
songgaoshuai
9375578925 add 增加修改流程变量接口 2025-07-22 10:39:17 +08:00
songgaoshuai
e19ccf5064 remove 删除无用导入 2025-07-22 09:49:40 +08:00
疯狂的狮子Li
1cea7b72d7 update 优化 去除无用配置 2025-07-19 23:48:30 +08:00
疯狂的狮子Li
5da9ddf5e3 update 新增赞助商 2025-07-19 23:47:29 +08:00
AprilWind
93ee01c6b9 update 更新snailjob服务端配置 2025-07-19 18:07:09 +08:00
疯狂的狮子Li
acd30fda3c update 优化 删除无用sql 2025-07-18 23:52:28 +08:00
秋辞未寒
3f62a76cc8 update 更新snailjob版本到1.6.0 2025-07-18 18:26:09 +08:00
疯狂的狮子Li
b0b4e573f6 fix 修复 oracle数据库无法使用不等于语法问题 2025-07-17 16:16:28 +08:00
疯狂的狮子Li
de61899eed update 优化 对登录也租户列表接口进行限流 防止盗刷 2025-07-17 15:15:28 +08:00
疯狂的狮子Li
3a9bdb36f1 update 优化 增加请求流程后端发起demo案例 2025-07-17 14:28:37 +08:00
may
b815b8e574 fix 修复退回后审批记录申请人错误 #ICMEJ1 2025-07-15 20:22:07 +08:00
疯狂的狮子Li
45edee4e63 update 优化 支持在监听器设置流程变量 2025-07-15 16:57:44 +08:00
疯狂的狮子Li
868bc492a2 update 优化 支持在监听器设置流程变量 2025-07-15 16:56:57 +08:00
疯狂的狮子Li
90fef1bb17 update 优化 菜单权限查询 2025-07-14 10:58:12 +08:00
may
d79b48ea99 fix 修复设计器画线驳回驳回到申请人后状态未修改 2025-07-12 14:49:32 +08:00
疯狂的狮子Li
f6993a1491 update 优化 日志脱敏支持List参数 2025-07-11 18:14:14 +08:00
AprilWind
6b0b7382a6 update 优化判断流程是否已结束 2025-07-10 17:36:42 +08:00
疯狂的狮子Li
c41add355f update 优化 任务创建监听器 使用下一个节点的任务数据 2025-07-10 17:05:33 +08:00
疯狂的狮子Li
74e3d232f5 update 优化 工作流任务创建监听器 传递流程参数 2025-07-09 10:43:22 +08:00
疯狂的狮子Li
03fca40c7d update 优化 监控使用springSecurity新语法 2025-07-09 09:56:32 +08:00
疯狂的狮子Li
b2ad257bd8 fix 修复 代码生成 setIsRequired 标志写反 2025-07-09 09:35:35 +08:00
AprilWind
7e4f0d73f4 update 优化流程分类新增修改 2025-07-08 18:01:38 +08:00
疯狂的狮子Li
2ec802f17f fix 修复 satokenDao 无法更新已存在数据的ttl问题 2025-07-08 14:33:50 +08:00
AprilWind
e0ce662c28 update 优化SpEL表达式回显查询条件 2025-07-07 16:10:34 +08:00
疯狂的狮子Li
3d9ed1b92f update 优化 sse 登录校验 避免大量报错 2025-07-07 15:45:34 +08:00
疯狂的狮子Li
d4e6e70c43 update 优化 sql版本号更新 2025-07-07 15:30:22 +08:00
疯狂的狮子Li
2095a96e67 update 优化 删除无用接口 2025-07-07 15:27:49 +08:00
秋辞未寒
328b61b252 !726 update 优化租户字典同步逻辑代码并添加注释
* update 优化字典同步逻辑代码并添加注释
2025-07-07 01:11:31 +00:00
AprilWind
781463417c update 优化SpEL表达式回显名称 2025-07-06 19:24:37 +08:00
AprilWind
446a14b928 update SpEL表达式回显名称 2025-07-06 19:21:23 +08:00
AprilWind
6c2518640b update 补充工作流动态启用注解 2025-07-06 17:50:25 +08:00
AprilWind
d8d138092f update 优化接口防重和加锁 2025-07-06 17:04:46 +08:00
MichelleChung
ec31b736c7 !725 更新 pr!723 xml
* update: 更新 mapper.xml ;
* update: 更新 FlowSpelBo 参数空值校验 ;
2025-07-06 06:08:44 +00:00
MichelleChung
e7467b2c5c !724 更新 pr!723 参数校验以及sql脚本
* update: 更新 FlowSpelBo 参数空值校验 ;
2025-07-06 06:02:44 +00:00
疯狂的狮子Li
8050e2f1b1 update 优化 !pr723 排除租户全局使用 优化sql脚本 2025-07-06 11:16:23 +08:00
疯狂的狮子Li
7de4559b4a update 优化 !pr723 排除租户全局使用 优化sql脚本 2025-07-06 11:10:18 +08:00
疯狂的狮子Li
fc9c0d7657 update 优化 !pr723 排除租户全局使用 优化sql脚本 2025-07-06 11:05:46 +08:00
MichelleChung
ab3037dc4f !723 新增工作流扩展spel表达式
* update: 更新变量名称以及初始化数据 ;
* add: 新增 FlowSpel sql 脚本 ;
2025-07-06 02:54:04 +00:00
疯狂的狮子Li
8281b838b9 update 优化 删除无用注释 导致代码报null问题 2025-07-06 10:41:18 +08:00
AprilWind
2bc7171abd fix 修复密码校验误删字段 2025-07-04 19:29:30 +08:00
AprilWind
4f99487d24 update 优化密码校验 2025-07-04 19:18:42 +08:00
AprilWind
a7cddc8d40 update 优化校验角色是否有数据权限 2025-07-04 18:52:29 +08:00
AprilWind
f3c4c02d73 update 优化校验角色是否有数据权限 2025-07-04 18:39:54 +08:00
疯狂的狮子Li
eb631360f4 update 优化 删除无用注释 2025-07-04 18:19:50 +08:00
秋辞未寒
a62bf04428 !721 update 发号器工具类便利性优化
* update 发号器工具类便利性优化
2025-07-04 09:46:23 +00:00
疯狂的狮子Li
7147f81b42 fix 修复 错误修改导致页面逻辑错误 2025-07-04 17:42:19 +08:00
疯狂的狮子Li
c9098563ca fix 修复 数据权限字段编辑错误 2025-07-04 16:55:20 +08:00
AprilWind
d4a8c25eab update 优化数据权限 2025-07-04 16:53:18 +08:00
AprilWind
0ddba506bf update 优化新增角色信息 2025-07-04 16:16:12 +08:00
AprilWind
d02bea85cb update 优化新增用户岗位信息判空逻辑 2025-07-04 15:54:39 +08:00
AprilWind
d27c58bfe8 docs 补充重构数据权限注释 2025-07-04 15:35:04 +08:00
疯狂的狮子Li
34bb51f5c0 update 优化 增加岗位修改校验 2025-07-04 15:29:51 +08:00
疯狂的狮子Li
64c37aaec6 update 重构用户 角色 部门 菜单的数据权限设计逻辑更符合实际业务场景与优化查询写法提高效率 2025-07-04 14:50:33 +08:00
疯狂的狮子Li
3de036adde update 优化 屏蔽掉无用接口 2025-07-04 09:34:15 +08:00
疯狂的狮子Li
e0df8c15d8 update 优化 修改类名 避免无用扫描 2025-07-04 09:19:29 +08:00
疯狂的狮子Li
176793e15b update 优化 工作流代码写法 2025-07-03 14:48:53 +08:00
疯狂的狮子Li
589ec1fdbc update 优化 增加oss扩展contentType存储 2025-07-03 10:39:23 +08:00
AprilWind
b421c8d017 !711 update 优化附件扩展字段对象(存储在 SysOss.ext1 的 JSON 字符串中)
* update 优化文件上传附件扩展字段对象
* update 优化保存文件的大小,方便前端进行分片下载
2025-07-03 02:20:53 +00:00
AprilWind
e2200bac71 update 优化流程图按审批人分组去重 2025-07-02 19:08:52 +08:00
AprilWind
f8950d1e20 update 优化获取流程记录 2025-07-02 18:21:53 +08:00
AprilWind
9dfe9f610d !715 update 优化工作流待办任务查询
* update 优化工作流待办任务查询
2025-07-02 09:15:56 +00:00
疯狂的狮子Li
17610e8721 remove 删除 无用注解 2025-07-02 14:55:44 +08:00
疯狂的狮子Li
f29b787767 fix 修复 有某些无聊人士 对一个demo案例提漏洞 CVE-2025-6925 2025-07-02 14:35:25 +08:00
AprilWind
9775283a24 !714 update 优化工作流小改动
* update 优化工作流小改动
2025-07-02 05:17:43 +00:00
AprilWind
debc73d7d4 !713 update 优化StreamUtils使用以及岗位删除优化
* update 优化命名含义
* update 优化StreamUtils使用以及岗位删除优化
2025-07-02 05:17:18 +00:00
疯狂的狮子Li
d501e82541 🐳🐳🐳发布 5.4.1 小步迭代修复问题 2025-07-01 09:11:10 +08:00
疯狂的狮子Li
3002585e63 fix 修复 修改数据权限漏改语句 2025-06-30 16:31:58 +08:00
AprilWind
60aca2eef3 !710 update 使用新版数据权限
* update 使用新版数据权限
2025-06-30 01:42:51 +00:00
AprilWind
5baf342478 !708 update 优化代码小改动
* update 优化代码小改动的逻辑性错误
* update 优化代码小改动
2025-06-27 05:34:43 +00:00
疯狂的狮子Li
3f9919fbee update 优化 Redis缓存监控接口 手动归还连接给连接池 提高效率 2025-06-27 10:19:26 +08:00
AprilWind
682d8b0099 !705 update 优化分页写法
* update 优化分页写法
2025-06-27 01:32:55 +00:00
AprilWind
bbabffe191 !702 update 优化参数配置
* update 优化参数配置
2025-06-27 01:10:26 +00:00
AprilWind
6722f2eeed !703 update 优化客户端管理
* update 优化客户端管理
2025-06-27 01:07:11 +00:00
AprilWind
5a9728c868 update 优化流程查询以及多根节点构建树结构 2025-06-26 17:20:04 +08:00
AprilWind
eea96e87d9 update 优化构建多根节点的树结构(支持多个顶级节点) 2025-06-26 15:10:17 +08:00
疯狂的狮子Li
e659740cb8 Revert "update 升级warm-flow1.7.4->1.7.5-m2 优化流程图悬浮窗"
This reverts commit 8f5d60f543.
2025-06-26 07:07:03 +00:00
疯狂的狮子Li
314909a536 fix 修复 excel 备注与必填注解指定下标位置问题 去除下标跟随主要注解顺序 2025-06-26 14:04:36 +08:00
AprilWind
8f5d60f543 update 升级warm-flow1.7.4->1.7.5-m2 优化流程图悬浮窗 2025-06-26 11:26:17 +08:00
疯狂的狮子Li
1ad0d5387b fix 修复 单元格样式覆盖问题 2025-06-26 10:41:06 +08:00
疯狂的狮子Li
770c3bd03e fix 修复 删除错误的注解导致前端时间不显示问题 2025-06-26 09:53:40 +08:00
AprilWind
4b04a4bf09 update 优化全局日期格式转换配置,提升日期参数解析兼容性 2025-06-24 16:10:26 +08:00
疯狂的狮子Li
1598447f6b Revert "update 优化SSE连接"
This reverts commit a8a1db4463.
2025-06-24 06:51:28 +00:00
AprilWind
a8a1db4463 update 优化SSE连接 2025-06-24 14:37:02 +08:00
疯狂的狮子Li
4b47053dcf fix 修复 超时时间单位设置错误 应该是毫秒 2025-06-24 11:42:22 +08:00
疯狂的狮子Li
03054fc1e8 reset 回滚aws-s3版本 有未知问题 2025-06-24 11:24:28 +08:00
疯狂的狮子Li
9dce540a09 fix 修复 sqlserver 字段长度错误 2025-06-23 18:17:41 +08:00
红藕香残玉簟秋
534182deff !698 fix 修复 办理任务时未传参数,导致执行任务无法获取到任务参数的问题
* fix 修复 办理任务时未传参数,导致执行任务无法获取到任务参数的问题
2025-06-23 08:57:30 +00:00
疯狂的狮子Li
4577c45110 fix 修复 升级anyline返回值类型变更导致问题 2025-06-23 14:55:51 +08:00
疯狂的狮子Li
0796791ec9 fix 修复 升级anyline返回值类型变更导致问题 2025-06-23 14:42:06 +08:00
疯狂的狮子Li
84baac0a4f update 优化 sse 超时时间设置为一天 避免连接之后直接关闭浏览器导致连接停滞 2025-06-22 16:39:05 +08:00
疯狂的狮子Li
74d257a610 update 更新工作流sql(小改动) 2025-06-20 11:01:17 +08:00
疯狂的狮子Li
cb8fa6ff9a update QueueUtils 与相关代码标记过期(redisson 新版本已经将队列功能标记删除 一些技术问题无法解决 建议搭建MQ使用) 2025-06-20 10:25:43 +08:00
疯狂的狮子Li
c157012807 update spring-boot 3.4.6 => 3.4.7
update satoken 1.42.0 => 1.44.0
update hutool 5.8.35 => 5.8.38
update redisson 3.45.1 => 3.50.0
update aws-s3 2.28.22 => 2.31.67
update anyline 8.7.2-20250101 => 8.7.2-20250603
update maven-jar-plugin 3.2.2 => 3.4.2
update maven-war-plugin 3.2.2 => 3.4.0
update maven-compiler-plugin 3.11.0 => 3.14.0
update maven-surefire-plugin 3.1.2 => 3.5.3
2025-06-20 10:25:42 +08:00
AprilWind
ffa01bdb3a update 优化类型转换逻辑、删除冗余代码 2025-06-20 10:25:02 +08:00
疯狂的狮子Li
3fa572f0a8 update 优化 去除自动注入日志警告改为默认值 避免一大堆人去定时任务搞什么登录 2025-06-20 09:27:49 +08:00
AprilWind
f868de1b7b fix 临时修复流程图提示信息,后续版本将通过defjson获取流程实例ID 2025-06-19 19:02:22 +08:00
AprilWind
fb785dc17f update 优化工作流的流程图提示信息查询 2025-06-19 18:31:58 +08:00
AprilWind
f3d475438f update 优化工作流的流程图提示信息 2025-06-19 18:13:34 +08:00
AprilWind
d7af327248 update 升级warm-flow1.7.3->1.7.4 支持流程图悬浮窗 2025-06-19 17:16:18 +08:00
疯狂的狮子Li
bd88e27c82 update 优化 加密模块 解密拦截器 将参数一起解密了 防止参数被多次加密不正常 2025-06-17 11:03:20 +08:00
AprilWind
83b6addbba update 优化工作流设计器获取任务执行人默认正常状态 2025-06-17 09:49:31 +08:00
AprilWind
d51f3b9f4e update 优化工作流内置变量表达式解析日志级别 2025-06-17 09:17:49 +08:00
AprilWind
9256432532 update 优化工作流,跳过以 $ 或 # 开头的内置变量表达式解析 2025-06-16 19:55:34 +08:00
疯狂的狮子Li
97d3a31aba fix 修复 snailjob的oracle.sql书写错误 2025-06-16 11:27:49 +08:00
疯狂的狮子Li
d9cc85187a update 删除无用功能 2025-06-13 17:30:01 +08:00
疯狂的狮子Li
2ff2d89b2d update 删除无用功能 2025-06-13 14:24:27 +08:00
疯狂的狮子Li
be2e5059fd update 优化 去除snailjob的jvm参数 默认不限制 2025-06-12 17:39:34 +08:00
疯狂的狮子Li
fad91f01ff update 优化 去除正则校验 无用配置导致问题 2025-06-09 14:54:03 +08:00
AprilWind
8f95374cef update 优化默认部门,不允许删除 2025-06-06 10:06:23 +08:00
AprilWind
7471fa7ee0 update 优化根部门不允许删除以及办理人权限名称回显 2025-06-06 09:45:06 +08:00
疯狂的狮子Li
529f1e5dbb update 优化 租户套餐菜单查询过滤掉 租户管理相关菜单 2025-06-05 18:27:44 +08:00
疯狂的狮子Li
eff131a1ed update 优化 忽略租户表判断改为精确匹配 2025-06-05 16:47:34 +08:00
疯狂的狮子Li
60b0faa3c6 update 优化 将debian换为更新更契合的rockylinux(centos作者写的稳定) 升级jdk版本避免漏洞 2025-06-03 17:11:39 +08:00
疯狂的狮子Li
b2d694b90b reset 修复 satoken异步调用需要手动传递上下文 (跟satoken无关的场景不用处理) 2025-06-03 16:13:05 +08:00
疯狂的狮子Li
fecc564099 fix 修复 部分数据库转移符解析问题导致路由不生效 统一改为使用单斜杠处理 2025-06-03 11:17:17 +08:00
疯狂的狮子Li
297e920179 fix 修复 satoken异步调用需要手动传递上下文 2025-06-03 10:14:13 +08:00
疯狂的狮子Li
ea9379a52f fix 修复 justauth 官方代码bug 2025-05-30 23:40:39 +08:00
dhb52
0b0f2ee8ea !692 fix: 需要传递 version 字段才能启用乐观锁
* fix: 需要传递 version 字段才能启用乐观锁
2025-05-30 08:07:24 +00:00
秋辞未寒
6d2f104a43 fixbug 修复地址解析工具类报错#ICBHUQ 2025-05-29 19:50:50 +08:00
疯狂的狮子Li
2e50e30778 fix 修复 流程数据重复更新 状态被覆盖 无法完成流程问题 2025-05-29 18:15:47 +08:00
疯狂的狮子Li
daf79683b3 update 优化 给测试用户增加菜单权限(可不更新) 2025-05-29 17:22:14 +08:00
疯狂的狮子Li
5849ddc160 update 优化 给测试用户增加菜单权限(可不更新) 2025-05-29 17:05:29 +08:00
疯狂的狮子Li
c88367939c update 优化 PermissionService 无实现类也可以启动服务 2025-05-29 16:28:09 +08:00
疯狂的狮子Li
a748d0d62c fix 修复 监听器 flowParams 为null报错问题 2025-05-29 15:38:29 +08:00
467 changed files with 12456 additions and 9294 deletions

2
.gitattributes vendored Normal file
View File

@@ -0,0 +1,2 @@
/mvnw text eol=lf
*.cmd text eol=crlf

1
.gitignore vendored
View File

@@ -38,6 +38,7 @@ nbdist/
######################################################################
# Others
*.log
*.log.gz
*.xml.versionsBackup
*.swp

8
.mvn/wrapper/maven-wrapper.properties vendored Normal file
View File

@@ -0,0 +1,8 @@
wrapperVersion=3.3.4
distributionType=only-script
# Maven 3.9.X
distributionUrl=https://mirrors.huaweicloud.com/apache/maven/maven-3/3.9.12/binaries/apache-maven-3.9.12-bin.zip
# Maven 4.0
#distributionUrl=https://mirrors.huaweicloud.com/apache/maven/maven-4/4.0.0-rc-5/binaries/apache-maven-4.0.0-rc-5-bin.zip
# 分发类型为 only-script 或 bin 可以不需要该项因为用不到具体参考https://maven.apache.org/tools/wrapper/maven-wrapper-distribution/index.html
#wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.4/maven-wrapper-3.3.4.jar

View File

@@ -2,7 +2,7 @@
<configuration default="false" name="ruoyi-monitor-admin" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
<deployment type="dockerfile">
<settings>
<option name="imageTag" value="ruoyi/ruoyi-monitor-admin:5.4.0" />
<option name="imageTag" value="ruoyi/ruoyi-monitor-admin:5.5.3" />
<option name="buildOnly" value="true" />
<option name="sourceFilePath" value="ruoyi-extend/ruoyi-monitor-admin/Dockerfile" />
</settings>

View File

@@ -2,7 +2,7 @@
<configuration default="false" name="ruoyi-server" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
<deployment type="dockerfile">
<settings>
<option name="imageTag" value="ruoyi/ruoyi-server:5.4.0" />
<option name="imageTag" value="ruoyi/ruoyi-server:5.5.3" />
<option name="buildOnly" value="true" />
<option name="sourceFilePath" value="ruoyi-admin/Dockerfile" />
</settings>

View File

@@ -2,7 +2,7 @@
<configuration default="false" name="ruoyi-snailjob-server" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
<deployment type="dockerfile">
<settings>
<option name="imageTag" value="ruoyi/ruoyi-snailjob-server:5.4.0" />
<option name="imageTag" value="ruoyi/ruoyi-snailjob-server:5.5.3" />
<option name="buildOnly" value="true" />
<option name="sourceFilePath" value="ruoyi-extend/ruoyi-snailjob-server/Dockerfile" />
</settings>

View File

@@ -8,10 +8,9 @@
[![GitHub](https://img.shields.io/github/stars/dromara/RuoYi-Vue-Plus.svg?style=social&label=Stars)](https://github.com/dromara/RuoYi-Vue-Plus)
[![Star](https://gitcode.com/dromara/RuoYi-Vue-Plus/star/badge.svg)](https://gitcode.com/dromara/RuoYi-Vue-Plus)
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://gitee.com/dromara/RuoYi-Vue-Plus/blob/5.X/LICENSE)
[![使用IntelliJ IDEA开发维护](https://img.shields.io/badge/IntelliJ%20IDEA-提供支持-blue.svg)](https://www.jetbrains.com/?from=RuoYi-Vue-Plus)
<br>
[![RuoYi-Vue-Plus](https://img.shields.io/badge/RuoYi_Vue_Plus-5.4.0-success.svg)](https://gitee.com/dromara/RuoYi-Vue-Plus)
[![Spring Boot](https://img.shields.io/badge/Spring%20Boot-3.4-blue.svg)]()
[![RuoYi-Vue-Plus](https://img.shields.io/badge/RuoYi_Vue_Plus-5.5.3-success.svg)](https://gitee.com/dromara/RuoYi-Vue-Plus)
[![Spring Boot](https://img.shields.io/badge/Spring%20Boot-3.5-blue.svg)]()
[![JDK-17](https://img.shields.io/badge/JDK-17-green.svg)]()
[![JDK-21](https://img.shields.io/badge/JDK-21-green.svg)]()
@@ -27,17 +26,20 @@
> 成员前端项目地址: 基于soybean [ruoyi-plus-soybean](https://gitee.com/xlsea/ruoyi-plus-soybean)<br>
> 成员项目地址: 删除多租户与工作流 [RuoYi-Vue-Plus-Single](https://gitee.com/ColorDreams/RuoYi-Vue-Plus-Single)<br>
> 文档地址: [plus-doc](https://plus-doc.dromara.org) 文档在华为云上如果打不开大概率是DNS问题 可以尝试切换网络等方式(或者科学上网)
> 文档地址: [plus-doc](https://plus-doc.dromara.org) 国内加速: [plus-doc.top](https://plus-doc.top)
## 赞助商
MaxKey 业界领先单点登录产品 - https://gitee.com/dromara/MaxKey <br>
CCFlow 驰聘低代码-流程-表单 - https://gitee.com/opencc/RuoYi-JFlow <br>
数舵科技 软件定制开发APP小程序等 - http://www.shuduokeji.com/ <br>
数舵科技 软件定制开发APP小程序等 - https://www.shuduokeji.com/ <br>
引迈信息 软件开发平台 - https://www.jnpfsoft.com/index.html?from=plus-doc <br>
<font color="red">**启山商城系统 多租户商城源码可免费商用可二次开发 - https://www.73app.cn/** </font><br>
Mall4J 高质量Java商城系统 - https://www.mall4j.com/cn/?statId=11 <br>
[如何成为赞助商 加群联系作者详谈](https://plus-doc.dromara.org/#/common/add_group)
aizuda flowlong 工作流 - https://gitee.com/aizuda/flowlong <br>
Ruoyi-Plus-Uniapp - https://ruoyi.plus <br>
Topiam IAM/IDaaS身份管理平台 - https://www.topiam.cn/ <br>
[如何成为赞助商 加群联系作者详谈 每日PV2500-3000 IP1700-2500](https://plus-doc.dromara.org/#/common/add_group)
# 本框架与RuoYi的功能差异

295
mvnw vendored Normal file
View File

@@ -0,0 +1,295 @@
#!/bin/sh
# ----------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Apache Maven Wrapper startup batch script, version 3.3.4
#
# Optional ENV vars
# -----------------
# JAVA_HOME - location of a JDK home dir, required when download maven via java source
# MVNW_REPOURL - repo url base for downloading maven distribution
# MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
# MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output
# ----------------------------------------------------------------------------
set -euf
[ "${MVNW_VERBOSE-}" != debug ] || set -x
# OS specific support.
native_path() { printf %s\\n "$1"; }
case "$(uname)" in
CYGWIN* | MINGW*)
[ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")"
native_path() { cygpath --path --windows "$1"; }
;;
esac
# set JAVACMD and JAVACCMD
set_java_home() {
# For Cygwin and MinGW, ensure paths are in Unix format before anything is touched
if [ -n "${JAVA_HOME-}" ]; then
if [ -x "$JAVA_HOME/jre/sh/java" ]; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
JAVACCMD="$JAVA_HOME/jre/sh/javac"
else
JAVACMD="$JAVA_HOME/bin/java"
JAVACCMD="$JAVA_HOME/bin/javac"
if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then
echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2
echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2
return 1
fi
fi
else
JAVACMD="$(
'set' +e
'unset' -f command 2>/dev/null
'command' -v java
)" || :
JAVACCMD="$(
'set' +e
'unset' -f command 2>/dev/null
'command' -v javac
)" || :
if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then
echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2
return 1
fi
fi
}
# hash string like Java String::hashCode
hash_string() {
str="${1:-}" h=0
while [ -n "$str" ]; do
char="${str%"${str#?}"}"
h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296))
str="${str#?}"
done
printf %x\\n $h
}
verbose() { :; }
[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; }
die() {
printf %s\\n "$1" >&2
exit 1
}
trim() {
# MWRAPPER-139:
# Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds.
# Needed for removing poorly interpreted newline sequences when running in more
# exotic environments such as mingw bash on Windows.
printf "%s" "${1}" | tr -d '[:space:]'
}
scriptDir="$(dirname "$0")"
scriptName="$(basename "$0")"
# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties
while IFS="=" read -r key value; do
case "${key-}" in
distributionUrl) distributionUrl=$(trim "${value-}") ;;
distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;;
esac
done <"$scriptDir/.mvn/wrapper/maven-wrapper.properties"
[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties"
case "${distributionUrl##*/}" in
maven-mvnd-*bin.*)
MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/
case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in
*AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;;
:Darwin*x86_64) distributionPlatform=darwin-amd64 ;;
:Darwin*arm64) distributionPlatform=darwin-aarch64 ;;
:Linux*x86_64*) distributionPlatform=linux-amd64 ;;
*)
echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2
distributionPlatform=linux-amd64
;;
esac
distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip"
;;
maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;;
*) MVN_CMD="mvn${scriptName#mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;;
esac
# apply MVNW_REPOURL and calculate MAVEN_HOME
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
[ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}"
distributionUrlName="${distributionUrl##*/}"
distributionUrlNameMain="${distributionUrlName%.*}"
distributionUrlNameMain="${distributionUrlNameMain%-bin}"
MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}"
MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")"
exec_maven() {
unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || :
exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD"
}
if [ -d "$MAVEN_HOME" ]; then
verbose "found existing MAVEN_HOME at $MAVEN_HOME"
exec_maven "$@"
fi
case "${distributionUrl-}" in
*?-bin.zip | *?maven-mvnd-?*-?*.zip) ;;
*) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;;
esac
# prepare tmp dir
if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then
clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; }
trap clean HUP INT TERM EXIT
else
die "cannot create temp dir"
fi
mkdir -p -- "${MAVEN_HOME%/*}"
# Download and Install Apache Maven
verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
verbose "Downloading from: $distributionUrl"
verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
# select .zip or .tar.gz
if ! command -v unzip >/dev/null; then
distributionUrl="${distributionUrl%.zip}.tar.gz"
distributionUrlName="${distributionUrl##*/}"
fi
# verbose opt
__MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR=''
[ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v
# normalize http auth
case "${MVNW_PASSWORD:+has-password}" in
'') MVNW_USERNAME='' MVNW_PASSWORD='' ;;
has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;;
esac
if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then
verbose "Found wget ... using wget"
wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl"
elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then
verbose "Found curl ... using curl"
curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl"
elif set_java_home; then
verbose "Falling back to use Java to download"
javaSource="$TMP_DOWNLOAD_DIR/Downloader.java"
targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName"
cat >"$javaSource" <<-END
public class Downloader extends java.net.Authenticator
{
protected java.net.PasswordAuthentication getPasswordAuthentication()
{
return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() );
}
public static void main( String[] args ) throws Exception
{
setDefault( new Downloader() );
java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() );
}
}
END
# For Cygwin/MinGW, switch paths to Windows format before running javac and java
verbose " - Compiling Downloader.java ..."
"$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java"
verbose " - Running Downloader.java ..."
"$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")"
fi
# If specified, validate the SHA-256 sum of the Maven distribution zip file
if [ -n "${distributionSha256Sum-}" ]; then
distributionSha256Result=false
if [ "$MVN_CMD" = mvnd.sh ]; then
echo "Checksum validation is not supported for maven-mvnd." >&2
echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
exit 1
elif command -v sha256sum >/dev/null; then
if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c - >/dev/null 2>&1; then
distributionSha256Result=true
fi
elif command -v shasum >/dev/null; then
if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then
distributionSha256Result=true
fi
else
echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2
echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
exit 1
fi
if [ $distributionSha256Result = false ]; then
echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2
echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2
exit 1
fi
fi
# unzip and move
if command -v unzip >/dev/null; then
unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip"
else
tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar"
fi
# Find the actual extracted directory name (handles snapshots where filename != directory name)
actualDistributionDir=""
# First try the expected directory name (for regular distributions)
if [ -d "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" ]; then
if [ -f "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/bin/$MVN_CMD" ]; then
actualDistributionDir="$distributionUrlNameMain"
fi
fi
# If not found, search for any directory with the Maven executable (for snapshots)
if [ -z "$actualDistributionDir" ]; then
# enable globbing to iterate over items
set +f
for dir in "$TMP_DOWNLOAD_DIR"/*; do
if [ -d "$dir" ]; then
if [ -f "$dir/bin/$MVN_CMD" ]; then
actualDistributionDir="$(basename "$dir")"
break
fi
fi
done
set -f
fi
if [ -z "$actualDistributionDir" ]; then
verbose "Contents of $TMP_DOWNLOAD_DIR:"
verbose "$(ls -la "$TMP_DOWNLOAD_DIR")"
die "Could not find Maven distribution directory in extracted archive"
fi
verbose "Found extracted Maven distribution directory: $actualDistributionDir"
printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$actualDistributionDir/mvnw.url"
mv -- "$TMP_DOWNLOAD_DIR/$actualDistributionDir" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME"
clean || :
exec_maven "$@"

189
mvnw.cmd vendored Normal file
View File

@@ -0,0 +1,189 @@
<# : batch portion
@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM http://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------
@REM ----------------------------------------------------------------------------
@REM Apache Maven Wrapper startup batch script, version 3.3.4
@REM
@REM Optional ENV vars
@REM MVNW_REPOURL - repo url base for downloading maven distribution
@REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
@REM MVNW_VERBOSE - true: enable verbose log; others: silence the output
@REM ----------------------------------------------------------------------------
@IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0)
@SET __MVNW_CMD__=
@SET __MVNW_ERROR__=
@SET __MVNW_PSMODULEP_SAVE=%PSModulePath%
@SET PSModulePath=
@FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @(
IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B)
)
@SET PSModulePath=%__MVNW_PSMODULEP_SAVE%
@SET __MVNW_PSMODULEP_SAVE=
@SET __MVNW_ARG0_NAME__=
@SET MVNW_USERNAME=
@SET MVNW_PASSWORD=
@IF NOT "%__MVNW_CMD__%"=="" ("%__MVNW_CMD__%" %*)
@echo Cannot start maven from wrapper >&2 && exit /b 1
@GOTO :EOF
: end batch / begin powershell #>
$ErrorActionPreference = "Stop"
if ($env:MVNW_VERBOSE -eq "true") {
$VerbosePreference = "Continue"
}
# calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties
$distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl
if (!$distributionUrl) {
Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties"
}
switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) {
"maven-mvnd-*" {
$USE_MVND = $true
$distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip"
$MVN_CMD = "mvnd.cmd"
break
}
default {
$USE_MVND = $false
$MVN_CMD = $script -replace '^mvnw','mvn'
break
}
}
# apply MVNW_REPOURL and calculate MAVEN_HOME
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
if ($env:MVNW_REPOURL) {
$MVNW_REPO_PATTERN = if ($USE_MVND -eq $False) { "/org/apache/maven/" } else { "/maven/mvnd/" }
$distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace "^.*$MVNW_REPO_PATTERN",'')"
}
$distributionUrlName = $distributionUrl -replace '^.*/',''
$distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$',''
$MAVEN_M2_PATH = "$HOME/.m2"
if ($env:MAVEN_USER_HOME) {
$MAVEN_M2_PATH = "$env:MAVEN_USER_HOME"
}
if (-not (Test-Path -Path $MAVEN_M2_PATH)) {
New-Item -Path $MAVEN_M2_PATH -ItemType Directory | Out-Null
}
$MAVEN_WRAPPER_DISTS = $null
if ((Get-Item $MAVEN_M2_PATH).Target[0] -eq $null) {
$MAVEN_WRAPPER_DISTS = "$MAVEN_M2_PATH/wrapper/dists"
} else {
$MAVEN_WRAPPER_DISTS = (Get-Item $MAVEN_M2_PATH).Target[0] + "/wrapper/dists"
}
$MAVEN_HOME_PARENT = "$MAVEN_WRAPPER_DISTS/$distributionUrlNameMain"
$MAVEN_HOME_NAME = ([System.Security.Cryptography.SHA256]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join ''
$MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME"
if (Test-Path -Path "$MAVEN_HOME" -PathType Container) {
Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME"
Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"
exit $?
}
if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) {
Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl"
}
# prepare tmp dir
$TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile
$TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir"
$TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null
trap {
if ($TMP_DOWNLOAD_DIR.Exists) {
try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
}
}
New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null
# Download and Install Apache Maven
Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
Write-Verbose "Downloading from: $distributionUrl"
Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
$webclient = New-Object System.Net.WebClient
if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) {
$webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD)
}
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null
# If specified, validate the SHA-256 sum of the Maven distribution zip file
$distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum
if ($distributionSha256Sum) {
if ($USE_MVND) {
Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties."
}
Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash
if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) {
Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property."
}
}
# unzip and move
Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null
# Find the actual extracted directory name (handles snapshots where filename != directory name)
$actualDistributionDir = ""
# First try the expected directory name (for regular distributions)
$expectedPath = Join-Path "$TMP_DOWNLOAD_DIR" "$distributionUrlNameMain"
$expectedMvnPath = Join-Path "$expectedPath" "bin/$MVN_CMD"
if ((Test-Path -Path $expectedPath -PathType Container) -and (Test-Path -Path $expectedMvnPath -PathType Leaf)) {
$actualDistributionDir = $distributionUrlNameMain
}
# If not found, search for any directory with the Maven executable (for snapshots)
if (!$actualDistributionDir) {
Get-ChildItem -Path "$TMP_DOWNLOAD_DIR" -Directory | ForEach-Object {
$testPath = Join-Path $_.FullName "bin/$MVN_CMD"
if (Test-Path -Path $testPath -PathType Leaf) {
$actualDistributionDir = $_.Name
}
}
}
if (!$actualDistributionDir) {
Write-Error "Could not find Maven distribution directory in extracted archive"
}
Write-Verbose "Found extracted Maven distribution directory: $actualDistributionDir"
Rename-Item -Path "$TMP_DOWNLOAD_DIR/$actualDistributionDir" -NewName $MAVEN_HOME_NAME | Out-Null
try {
Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null
} catch {
if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) {
Write-Error "fail to move MAVEN_HOME"
}
} finally {
try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
}
Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"

118
pom.xml
View File

@@ -13,50 +13,52 @@
<description>Dromara RuoYi-Vue-Plus多租户管理系统</description>
<properties>
<revision>5.4.0</revision>
<spring-boot.version>3.4.6</spring-boot.version>
<revision>5.5.3</revision>
<spring-boot.version>4.0.3</spring-boot.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>17</java.version>
<mybatis.version>3.5.16</mybatis.version>
<springdoc.version>2.8.8</springdoc.version>
<java.version>21</java.version>
<mybatis.version>3.5.19</mybatis.version>
<springdoc.version>3.0.1</springdoc.version>
<therapi-javadoc.version>0.15.0</therapi-javadoc.version>
<fastexcel.version>1.2.0</fastexcel.version>
<fesod.version>2.0.1-incubating</fesod.version>
<velocity.version>2.3</velocity.version>
<satoken.version>1.42.0</satoken.version>
<mybatis-plus.version>3.5.12</mybatis-plus.version>
<satoken.version>1.44.0</satoken.version>
<mybatis-plus.version>3.5.16</mybatis-plus.version>
<p6spy.version>3.9.1</p6spy.version>
<hutool.version>5.8.35</hutool.version>
<spring-boot-admin.version>3.4.7</spring-boot-admin.version>
<redisson.version>3.45.1</redisson.version>
<hutool.version>5.8.43</hutool.version>
<spring-boot-admin.version>4.0.1</spring-boot-admin.version>
<redisson.version>4.2.0</redisson.version>
<lock4j.version>2.2.7</lock4j.version>
<dynamic-ds.version>4.3.1</dynamic-ds.version>
<snailjob.version>1.5.0</snailjob.version>
<mapstruct-plus.version>1.4.8</mapstruct-plus.version>
<dynamic-ds.version>4.5.0</dynamic-ds.version>
<snailjob.version>1.9.0</snailjob.version>
<mapstruct-plus.version>1.5.0</mapstruct-plus.version>
<mapstruct-plus.lombok.version>0.2.0</mapstruct-plus.lombok.version>
<lombok.version>1.18.36</lombok.version>
<bouncycastle.version>1.80</bouncycastle.version>
<lombok.version>1.18.42</lombok.version>
<bouncycastle.version>1.83</bouncycastle.version>
<justauth.version>1.16.7</justauth.version>
<!-- 离线IP地址定位库 -->
<ip2region.version>2.7.0</ip2region.version>
<ip2region.version>3.3.4</ip2region.version>
<!-- OSS 配置 -->
<aws.sdk.version>2.28.22</aws.sdk.version>
<aws.sdk.version>2.41.34</aws.sdk.version>
<!-- SMS 配置 -->
<sms4j.version>3.3.4</sms4j.version>
<sms4j.version>3.3.5</sms4j.version>
<!-- 限制框架中的fastjson版本 -->
<fastjson.version>1.2.83</fastjson.version>
<!-- 面向运行时的D-ORM依赖 -->
<anyline.version>8.7.2-20250101</anyline.version>
<anyline.version>8.7.3-20260202</anyline.version>
<!-- 工作流配置 -->
<warm-flow.version>1.7.3</warm-flow.version>
<warm-flow.version>1.8.4</warm-flow.version>
<!-- mqtt客户端 -->
<mica-mqtt.version>2.5.12</mica-mqtt.version>
<!-- 插件版本 -->
<maven-jar-plugin.version>3.2.2</maven-jar-plugin.version>
<maven-war-plugin.version>3.2.2</maven-war-plugin.version>
<maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
<maven-surefire-plugin.version>3.1.2</maven-surefire-plugin.version>
<flatten-maven-plugin.version>1.3.0</flatten-maven-plugin.version>
<maven-jar-plugin.version>3.5.0</maven-jar-plugin.version>
<maven-war-plugin.version>3.5.1</maven-war-plugin.version>
<maven-compiler-plugin.version>3.15.0</maven-compiler-plugin.version>
<maven-surefire-plugin.version>3.5.4</maven-surefire-plugin.version>
<!-- 统一版本号管理Maven3.X需要Maven4.0之后已原生支持 -->
<flatten-maven-plugin.version>1.7.3</flatten-maven-plugin.version>
<!-- 打包默认跳过测试 -->
<skipTests>true</skipTests>
</properties>
@@ -119,25 +121,6 @@
<scope>import</scope>
</dependency>
<!-- Warm-Flow国产工作流引擎, 在线文档http://warm-flow.cn/ -->
<dependency>
<groupId>org.dromara.warm</groupId>
<artifactId>warm-flow-mybatis-plus-sb3-starter</artifactId>
<version>${warm-flow.version}</version>
</dependency>
<dependency>
<groupId>org.dromara.warm</groupId>
<artifactId>warm-flow-plugin-ui-sb-web</artifactId>
<version>${warm-flow.version}</version>
</dependency>
<!-- JustAuth 的依赖配置-->
<dependency>
<groupId>me.zhyd.oauth</groupId>
<artifactId>JustAuth</artifactId>
<version>${justauth.version}</version>
</dependency>
<!-- common 的依赖配置-->
<dependency>
<groupId>org.dromara</groupId>
@@ -165,10 +148,11 @@
<version>${lombok.version}</version>
</dependency>
<!-- fesod (EasyExcel/FastExcel的前身) 的依赖 -->
<dependency>
<groupId>cn.idev.excel</groupId>
<artifactId>fastexcel</artifactId>
<version>${fastexcel.version}</version>
<groupId>org.apache.fesod</groupId>
<artifactId>fesod-sheet</artifactId>
<version>${fesod.version}</version>
</dependency>
<!-- velocity代码生成使用模板 -->
@@ -205,7 +189,7 @@
<!-- dynamic-datasource 多数据源-->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>dynamic-datasource-spring-boot3-starter</artifactId>
<artifactId>dynamic-datasource-spring-boot4-starter</artifactId>
<version>${dynamic-ds.version}</version>
</dependency>
@@ -217,7 +201,7 @@
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-spring-boot3-starter</artifactId>
<artifactId>mybatis-plus-spring-boot4-starter</artifactId>
<version>${mybatis-plus.version}</version>
</dependency>
@@ -246,13 +230,13 @@
<artifactId>s3</artifactId>
<version>${aws.sdk.version}</version>
</dependency>
<!-- 基于 AWS CRT 的 S3 客户端的性能增强的 S3 传输管理器 -->
<!-- 客户端的性能增强传输管理器 -->
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>s3-transfer-manager</artifactId>
<version>${aws.sdk.version}</version>
</dependency>
<!-- 将基于 Netty 的 HTTP 客户端从类路径中移除 -->
<!-- 适用于 Netty 的客户端 -->
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>netty-nio-client</artifactId>
@@ -314,6 +298,31 @@
<version>${mapstruct-plus.version}</version>
</dependency>
<!-- Warm-Flow国产工作流引擎, 在线文档http://warm-flow.cn/ -->
<dependency>
<groupId>org.dromara.warm</groupId>
<artifactId>warm-flow-mybatis-plus-sb3-starter</artifactId>
<version>${warm-flow.version}</version>
</dependency>
<dependency>
<groupId>org.dromara.warm</groupId>
<artifactId>warm-flow-plugin-ui-sb-web</artifactId>
<version>${warm-flow.version}</version>
</dependency>
<dependency>
<groupId>org.dromara.mica-mqtt</groupId>
<artifactId>mica-mqtt-client-spring-boot-starter</artifactId>
<version>${mica-mqtt.version}</version>
</dependency>
<!-- JustAuth 的依赖配置-->
<dependency>
<groupId>me.zhyd.oauth</groupId>
<artifactId>JustAuth</artifactId>
<version>${justauth.version}</version>
</dependency>
<!-- 离线IP地址定位库 ip2region -->
<dependency>
<groupId>org.lionsoul</groupId>
@@ -376,8 +385,7 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<release>${java.version}</release>
<encoding>${project.build.sourceEncoding}</encoding>
<annotationProcessorPaths>
<path>

View File

@@ -1,6 +1,6 @@
# 贝尔实验室 Spring 官方推荐镜像 JDK下载地址 https://bell-sw.com/pages/downloads/
FROM bellsoft/liberica-openjdk-debian:17.0.11-cds
#FROM bellsoft/liberica-openjdk-debian:21.0.5-cds
FROM bellsoft/liberica-openjdk-rocky:17.0.16-cds
#FROM bellsoft/liberica-openjdk-rocky:21.0.8-cds
#FROM findepi/graalvm:java17-native
LABEL maintainer="Lion Li"

View File

@@ -55,11 +55,6 @@
<artifactId>ruoyi-common-social</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-ratelimiter</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-mail</artifactId>

View File

@@ -1,10 +1,7 @@
package org.dromara.web.controller;
import cn.dev33.satoken.annotation.SaIgnore;
import cn.dev33.satoken.exception.NotLoginException;
import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.core.codec.Base64;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import jakarta.servlet.http.HttpServletRequest;
import lombok.RequiredArgsConstructor;
@@ -18,37 +15,34 @@ import org.dromara.common.core.domain.R;
import org.dromara.common.core.domain.model.LoginBody;
import org.dromara.common.core.domain.model.RegisterBody;
import org.dromara.common.core.domain.model.SocialLoginBody;
import org.dromara.common.core.utils.*;
import org.dromara.common.core.utils.DateUtils;
import org.dromara.common.core.utils.MessageUtils;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.core.utils.ValidatorUtils;
import org.dromara.common.encrypt.annotation.ApiEncrypt;
import org.dromara.common.json.utils.JsonUtils;
import org.dromara.common.redis.annotation.RateLimiter;
import org.dromara.common.redis.enums.LimitType;
import org.dromara.common.satoken.utils.LoginHelper;
import org.dromara.common.social.config.properties.SocialLoginConfigProperties;
import org.dromara.common.social.config.properties.SocialProperties;
import org.dromara.common.social.utils.SocialUtils;
import org.dromara.common.sse.dto.SseMessageDto;
import org.dromara.common.sse.utils.SseMessageUtils;
import org.dromara.common.tenant.helper.TenantHelper;
import org.dromara.system.domain.bo.SysTenantBo;
import org.dromara.system.domain.vo.SysClientVo;
import org.dromara.system.domain.vo.SysTenantVo;
import org.dromara.system.service.ISysClientService;
import org.dromara.system.service.ISysConfigService;
import org.dromara.system.service.ISysSocialService;
import org.dromara.system.service.ISysTenantService;
import org.dromara.web.domain.vo.LoginTenantVo;
import org.dromara.web.domain.vo.LoginVo;
import org.dromara.web.domain.vo.TenantListVo;
import org.dromara.web.service.IAuthStrategy;
import org.dromara.web.service.SysLoginService;
import org.dromara.web.service.SysRegisterService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
@@ -68,7 +62,6 @@ public class AuthController {
private final SysLoginService loginService;
private final SysRegisterService registerService;
private final ISysConfigService configService;
private final ISysTenantService tenantService;
private final ISysSocialService socialUserService;
private final ISysClientService clientService;
private final ScheduledExecutorService scheduledExecutorService;
@@ -96,15 +89,13 @@ public class AuthController {
} else if (!SystemConstants.NORMAL.equals(client.getStatus())) {
return R.fail(MessageUtils.message("auth.grant.type.blocked"));
}
// 校验租户
loginService.checkTenant(loginBody.getTenantId());
// 登录
LoginVo loginVo = IAuthStrategy.login(body, client, grantType);
Long userId = LoginHelper.getUserId();
scheduledExecutorService.schedule(() -> {
SseMessageDto dto = new SseMessageDto();
dto.setMessage("欢迎登录RuoYi-Vue-Plus后台管理系统");
dto.setMessage(DateUtils.getTodayHour(new Date()) + "好,欢迎登录 RuoYi-Vue-Plus 后台管理系统");
dto.setUserIds(List.of(userId));
SseMessageUtils.publishMessage(dto);
}, 5, TimeUnit.SECONDS);
@@ -118,18 +109,13 @@ public class AuthController {
* @return 结果
*/
@GetMapping("/binding/{source}")
public R<String> authBinding(@PathVariable("source") String source,
@RequestParam String tenantId, @RequestParam String domain) {
public R<String> authBinding(@PathVariable("source") String source) {
SocialLoginConfigProperties obj = socialProperties.getType().get(source);
if (ObjectUtil.isNull(obj)) {
return R.fail(source + "平台账号暂不支持");
}
AuthRequest authRequest = SocialUtils.getAuthRequest(source, socialProperties);
Map<String, String> map = new HashMap<>();
map.put("tenantId", tenantId);
map.put("domain", domain);
map.put("state", AuthStateUtils.createState());
String authorizeUrl = authRequest.authorize(Base64.encode(JsonUtils.toJsonString(map), StandardCharsets.UTF_8));
String authorizeUrl = authRequest.authorize(AuthStateUtils.createState());
return R.ok("操作成功", authorizeUrl);
}
@@ -145,8 +131,8 @@ public class AuthController {
StpUtil.checkLogin();
// 获取第三方登录信息
AuthResponse<AuthUser> response = SocialUtils.loginAuth(
loginBody.getSource(), loginBody.getSocialCode(),
loginBody.getSocialState(), socialProperties);
loginBody.getSource(), loginBody.getSocialCode(),
loginBody.getSocialState(), socialProperties);
AuthUser authUserData = response.getData();
// 判断授权响应是否成功
if (!response.ok()) {
@@ -186,7 +172,7 @@ public class AuthController {
@ApiEncrypt
@PostMapping("/register")
public R<Void> register(@Validated @RequestBody RegisterBody user) {
if (!configService.selectRegisterEnabled(user.getTenantId())) {
if (!configService.selectRegisterEnabled()) {
return R.fail("当前系统没有开启注册功能!");
}
registerService.register(user);
@@ -198,41 +184,12 @@ public class AuthController {
*
* @return 租户列表
*/
@RateLimiter(time = 60, count = 20, limitType = LimitType.IP)
@GetMapping("/tenant/list")
public R<LoginTenantVo> tenantList(HttpServletRequest request) throws Exception {
// 返回对象
// 暂时预留给前端使用 后续删除
LoginTenantVo result = new LoginTenantVo();
boolean enable = TenantHelper.isEnable();
result.setTenantEnabled(enable);
// 如果未开启租户这直接返回
if (!enable) {
return R.ok(result);
}
List<SysTenantVo> tenantList = tenantService.queryList(new SysTenantBo());
List<TenantListVo> voList = MapstructUtils.convert(tenantList, TenantListVo.class);
try {
// 如果只超管返回所有租户
if (LoginHelper.isSuperAdmin()) {
result.setVoList(voList);
return R.ok(result);
}
} catch (NotLoginException ignored) {
}
// 获取域名
String host;
String referer = request.getHeader("referer");
if (StringUtils.isNotBlank(referer)) {
// 这里从referer中取值是为了本地使用hosts添加虚拟域名方便本地环境调试
host = referer.split("//")[1].split("/")[0];
} else {
host = new URL(request.getRequestURL().toString()).getHost();
}
// 根据域名进行筛选
List<TenantListVo> list = StreamUtils.filter(voList, vo ->
StringUtils.equalsIgnoreCase(vo.getDomain(), host));
result.setVoList(CollUtil.isNotEmpty(list) ? list : voList);
result.setTenantEnabled(false);
return R.ok(result);
}

View File

@@ -1,8 +1,9 @@
package org.dromara.web.controller;
import cn.dev33.satoken.annotation.SaIgnore;
import cn.hutool.captcha.AbstractCaptcha;
import cn.hutool.captcha.generator.CodeGenerator;
import cn.hutool.captcha.generator.MathGenerator;
import cn.hutool.captcha.generator.RandomGenerator;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.RandomUtil;
import jakarta.validation.constraints.NotBlank;
@@ -14,14 +15,13 @@ import org.dromara.common.core.domain.R;
import org.dromara.common.core.exception.ServiceException;
import org.dromara.common.core.utils.SpringUtils;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.core.utils.reflect.ReflectUtils;
import org.dromara.common.mail.config.properties.MailProperties;
import org.dromara.common.mail.utils.MailUtils;
import org.dromara.common.ratelimiter.annotation.RateLimiter;
import org.dromara.common.ratelimiter.enums.LimitType;
import org.dromara.common.redis.annotation.RateLimiter;
import org.dromara.common.redis.enums.LimitType;
import org.dromara.common.redis.utils.RedisUtils;
import org.dromara.common.web.core.WaveAndCircleCaptcha;
import org.dromara.common.web.config.properties.CaptchaProperties;
import org.dromara.common.web.enums.CaptchaType;
import org.dromara.sms4j.api.SmsBlend;
import org.dromara.sms4j.api.entity.SmsResponse;
import org.dromara.sms4j.core.factory.SmsFactory;
@@ -33,6 +33,7 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import java.awt.*;
import java.time.Duration;
import java.util.LinkedHashMap;
@@ -130,16 +131,21 @@ public class CaptchaController {
String uuid = IdUtil.simpleUUID();
String verifyKey = GlobalConstants.CAPTCHA_CODE_KEY + uuid;
// 生成验证码
CaptchaType captchaType = captchaProperties.getType();
boolean isMath = CaptchaType.MATH == captchaType;
Integer length = isMath ? captchaProperties.getNumberLength() : captchaProperties.getCharLength();
CodeGenerator codeGenerator = ReflectUtils.newInstance(captchaType.getClazz(), length);
AbstractCaptcha captcha = SpringUtils.getBean(captchaProperties.getCategory().getClazz());
String captchaType = captchaProperties.getType();
CodeGenerator codeGenerator;
if ("math".equals(captchaType)) {
codeGenerator = new MathGenerator(captchaProperties.getNumberLength(), false);
} else {
codeGenerator = new RandomGenerator(captchaProperties.getCharLength());
}
WaveAndCircleCaptcha captcha = new WaveAndCircleCaptcha(160, 60);
// captcha.setBackground(Color.WHITE); // 不设置就是透明底
captcha.setFont(new Font("Arial", Font.BOLD, 45));
captcha.setGenerator(codeGenerator);
captcha.createCode();
// 如果是数学验证码使用SpEL表达式处理验证码结果
String code = captcha.getCode();
if (isMath) {
if ("math".equals(captchaType)) {
ExpressionParser parser = new SpelExpressionParser();
Expression exp = parser.parseExpression(StringUtils.remove(code, "="));
code = exp.getValue(String.class);

View File

@@ -2,8 +2,6 @@ package org.dromara.web.domain.vo;
import lombok.Data;
import java.util.List;
/**
* 登录租户对象
*
@@ -17,9 +15,4 @@ public class LoginTenantVo {
*/
private Boolean tenantEnabled;
/**
* 租户对象列表
*/
private List<TenantListVo> voList;
}

View File

@@ -1,31 +0,0 @@
package org.dromara.web.domain.vo;
import org.dromara.system.domain.vo.SysTenantVo;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
/**
* 租户列表
*
* @author Lion Li
*/
@Data
@AutoMapper(target = SysTenantVo.class)
public class TenantListVo {
/**
* 租户编号
*/
private String tenantId;
/**
* 企业名称
*/
private String companyName;
/**
* 域名
*/
private String domain;
}

View File

@@ -1,9 +1,7 @@
package org.dromara.web.listener;
import cn.dev33.satoken.listener.SaTokenListener;
import cn.dev33.satoken.stp.StpUtil;
import cn.dev33.satoken.stp.parameter.SaLoginParameter;
import cn.hutool.core.convert.Convert;
import cn.hutool.http.useragent.UserAgent;
import cn.hutool.http.useragent.UserAgentUtil;
import lombok.RequiredArgsConstructor;
@@ -18,7 +16,6 @@ import org.dromara.common.core.utils.ip.AddressUtils;
import org.dromara.common.log.event.LogininforEvent;
import org.dromara.common.redis.utils.RedisUtils;
import org.dromara.common.satoken.utils.LoginHelper;
import org.dromara.common.tenant.helper.TenantHelper;
import org.dromara.web.service.SysLoginService;
import org.springframework.stereotype.Component;
@@ -51,21 +48,18 @@ public class UserActionListener implements SaTokenListener {
dto.setLoginTime(System.currentTimeMillis());
dto.setTokenId(tokenValue);
String username = (String) loginParameter.getExtra(LoginHelper.USER_NAME_KEY);
String tenantId = (String) loginParameter.getExtra(LoginHelper.TENANT_KEY);
dto.setUserName(username);
dto.setClientKey((String) loginParameter.getExtra(LoginHelper.CLIENT_KEY));
dto.setDeviceType(loginParameter.getDeviceType());
dto.setDeptName((String) loginParameter.getExtra(LoginHelper.DEPT_NAME_KEY));
TenantHelper.dynamic(tenantId, () -> {
if(loginParameter.getTimeout() == -1) {
RedisUtils.setCacheObject(CacheConstants.ONLINE_TOKEN_KEY + tokenValue, dto);
} else {
RedisUtils.setCacheObject(CacheConstants.ONLINE_TOKEN_KEY + tokenValue, dto, Duration.ofSeconds(loginParameter.getTimeout()));
}
});
if (loginParameter.getTimeout() == -1) {
RedisUtils.setCacheObject(CacheConstants.ONLINE_TOKEN_KEY + tokenValue, dto);
} else {
RedisUtils.setCacheObject(CacheConstants.ONLINE_TOKEN_KEY + tokenValue, dto, Duration.ofSeconds(loginParameter.getTimeout()));
}
// 记录登录日志
LogininforEvent logininforEvent = new LogininforEvent();
logininforEvent.setTenantId(tenantId);
logininforEvent.setUsername(username);
logininforEvent.setStatus(Constants.LOGIN_SUCCESS);
logininforEvent.setMessage(MessageUtils.message("user.login.success"));
@@ -81,10 +75,7 @@ public class UserActionListener implements SaTokenListener {
*/
@Override
public void doLogout(String loginType, Object loginId, String tokenValue) {
String tenantId = Convert.toStr(StpUtil.getExtra(tokenValue, LoginHelper.TENANT_KEY));
TenantHelper.dynamic(tenantId, () -> {
RedisUtils.deleteObject(CacheConstants.ONLINE_TOKEN_KEY + tokenValue);
});
RedisUtils.deleteObject(CacheConstants.ONLINE_TOKEN_KEY + tokenValue);
log.info("user doLogout, userId:{}, token:{}", loginId, tokenValue);
}
@@ -93,10 +84,7 @@ public class UserActionListener implements SaTokenListener {
*/
@Override
public void doKickout(String loginType, Object loginId, String tokenValue) {
String tenantId = Convert.toStr(StpUtil.getExtra(tokenValue, LoginHelper.TENANT_KEY));
TenantHelper.dynamic(tenantId, () -> {
RedisUtils.deleteObject(CacheConstants.ONLINE_TOKEN_KEY + tokenValue);
});
RedisUtils.deleteObject(CacheConstants.ONLINE_TOKEN_KEY + tokenValue);
log.info("user doKickout, userId:{}, token:{}", loginId, tokenValue);
}
@@ -105,10 +93,7 @@ public class UserActionListener implements SaTokenListener {
*/
@Override
public void doReplaced(String loginType, Object loginId, String tokenValue) {
String tenantId = Convert.toStr(StpUtil.getExtra(tokenValue, LoginHelper.TENANT_KEY));
TenantHelper.dynamic(tenantId, () -> {
RedisUtils.deleteObject(CacheConstants.ONLINE_TOKEN_KEY + tokenValue);
});
RedisUtils.deleteObject(CacheConstants.ONLINE_TOKEN_KEY + tokenValue);
log.info("user doReplaced, userId:{}, token:{}", loginId, tokenValue);
}
@@ -158,6 +143,6 @@ public class UserActionListener implements SaTokenListener {
* 每次Token续期时触发
*/
@Override
public void doRenewTimeout(String tokenValue, Object loginId, long timeout) {
public void doRenewTimeout(String loginType, Object loginId, String tokenValue, long timeout) {
}
}

View File

@@ -12,8 +12,6 @@ import lombok.extern.slf4j.Slf4j;
import me.zhyd.oauth.model.AuthUser;
import org.dromara.common.core.constant.CacheConstants;
import org.dromara.common.core.constant.Constants;
import org.dromara.common.core.constant.SystemConstants;
import org.dromara.common.core.constant.TenantConstants;
import org.dromara.common.core.domain.dto.PostDTO;
import org.dromara.common.core.domain.dto.RoleDTO;
import org.dromara.common.core.domain.model.LoginUser;
@@ -25,8 +23,6 @@ import org.dromara.common.log.event.LogininforEvent;
import org.dromara.common.mybatis.helper.DataPermissionHelper;
import org.dromara.common.redis.utils.RedisUtils;
import org.dromara.common.satoken.utils.LoginHelper;
import org.dromara.common.tenant.exception.TenantException;
import org.dromara.common.tenant.helper.TenantHelper;
import org.dromara.system.domain.SysUser;
import org.dromara.system.domain.bo.SysSocialBo;
import org.dromara.system.domain.vo.*;
@@ -36,8 +32,9 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.time.Duration;
import java.util.Date;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.function.Supplier;
/**
@@ -56,7 +53,6 @@ public class SysLoginService {
@Value("${user.password.lockTime}")
private Integer lockTime;
private final ISysTenantService tenantService;
private final ISysPermissionService permissionService;
private final ISysSocialService sysSocialService;
private final ISysRoleService roleService;
@@ -113,11 +109,7 @@ public class SysLoginService {
if (ObjectUtil.isNull(loginUser)) {
return;
}
if (TenantHelper.isEnable() && LoginHelper.isSuperAdmin()) {
// 超级管理员 登出清除动态租户
TenantHelper.clearDynamic();
}
recordLogininfor(loginUser.getTenantId(), loginUser.getUsername(), Constants.LOGOUT, MessageUtils.message("user.logout.success"));
recordLogininfor(loginUser.getUsername(), Constants.LOGOUT, MessageUtils.message("user.logout.success"));
} catch (NotLoginException ignored) {
} finally {
try {
@@ -130,14 +122,12 @@ public class SysLoginService {
/**
* 记录登录信息
*
* @param tenantId 租户ID
* @param username 用户名
* @param status 状态
* @param message 消息内容
*/
public void recordLogininfor(String tenantId, String username, String status, String message) {
public void recordLogininfor(String username, String status, String message) {
LogininforEvent logininforEvent = new LogininforEvent();
logininforEvent.setTenantId(tenantId);
logininforEvent.setUsername(username);
logininforEvent.setStatus(status);
logininforEvent.setMessage(message);
@@ -151,23 +141,27 @@ public class SysLoginService {
public LoginUser buildLoginUser(SysUserVo user) {
LoginUser loginUser = new LoginUser();
Long userId = user.getUserId();
loginUser.setTenantId(user.getTenantId());
loginUser.setUserId(userId);
loginUser.setDeptId(user.getDeptId());
loginUser.setUsername(user.getUserName());
loginUser.setNickname(user.getNickName());
loginUser.setUserType(user.getUserType());
loginUser.setMenuPermission(permissionService.getMenuPermission(userId));
loginUser.setRolePermission(permissionService.getRolePermission(userId));
if (ObjectUtil.isNotNull(user.getDeptId())) {
Opt<SysDeptVo> deptOpt = Opt.of(user.getDeptId()).map(deptService::selectDeptById);
loginUser.setDeptName(deptOpt.map(SysDeptVo::getDeptName).orElse(StringUtils.EMPTY));
loginUser.setDeptCategory(deptOpt.map(SysDeptVo::getDeptCategory).orElse(StringUtils.EMPTY));
}
List<SysRoleVo> roles = roleService.selectRolesByUserId(userId);
List<SysPostVo> posts = postService.selectPostsByUserId(userId);
loginUser.setRoles(BeanUtil.copyToList(roles, RoleDTO.class));
loginUser.setPosts(BeanUtil.copyToList(posts, PostDTO.class));
ThreadUtils.virtualSubmit(() -> {
loginUser.setMenuPermission(permissionService.getMenuPermission(userId));
}, () -> {
loginUser.setRolePermission(permissionService.getRolePermission(userId));
}, () -> {
List<SysRoleVo> roles = roleService.selectRolesByUserId(userId);
loginUser.setRoles(BeanUtil.copyToList(roles, RoleDTO.class));
}, () -> {
List<SysPostVo> posts = postService.selectPostsByUserId(userId);
loginUser.setPosts(BeanUtil.copyToList(posts, PostDTO.class));
});
return loginUser;
}
@@ -188,7 +182,7 @@ public class SysLoginService {
/**
* 登录校验
*/
public void checkLogin(LoginType loginType, String tenantId, String username, Supplier<Boolean> supplier) {
public void checkLogin(LoginType loginType, String username, Supplier<Boolean> supplier) {
String errorKey = CacheConstants.PWD_ERR_CNT_KEY + username;
String loginFail = Constants.LOGIN_FAIL;
@@ -196,7 +190,7 @@ public class SysLoginService {
int errorNumber = ObjectUtil.defaultIfNull(RedisUtils.getCacheObject(errorKey), 0);
// 锁定时间内登录 则踢出
if (errorNumber >= maxRetryCount) {
recordLogininfor(tenantId, username, loginFail, MessageUtils.message(loginType.getRetryLimitExceed(), maxRetryCount, lockTime));
recordLogininfor(username, loginFail, MessageUtils.message(loginType.getRetryLimitExceed(), maxRetryCount, lockTime));
throw new UserException(loginType.getRetryLimitExceed(), maxRetryCount, lockTime);
}
@@ -206,11 +200,11 @@ public class SysLoginService {
RedisUtils.setCacheObject(errorKey, errorNumber, Duration.ofMinutes(lockTime));
// 达到规定错误次数 则锁定登录
if (errorNumber >= maxRetryCount) {
recordLogininfor(tenantId, username, loginFail, MessageUtils.message(loginType.getRetryLimitExceed(), maxRetryCount, lockTime));
recordLogininfor(username, loginFail, MessageUtils.message(loginType.getRetryLimitExceed(), maxRetryCount, lockTime));
throw new UserException(loginType.getRetryLimitExceed(), maxRetryCount, lockTime);
} else {
// 未达到规定错误次数
recordLogininfor(tenantId, username, loginFail, MessageUtils.message(loginType.getRetryLimitCount(), errorNumber));
recordLogininfor(username, loginFail, MessageUtils.message(loginType.getRetryLimitCount(), errorNumber));
throw new UserException(loginType.getRetryLimitCount(), errorNumber);
}
}
@@ -219,33 +213,4 @@ public class SysLoginService {
RedisUtils.deleteObject(errorKey);
}
/**
* 校验租户
*
* @param tenantId 租户ID
*/
public void checkTenant(String tenantId) {
if (!TenantHelper.isEnable()) {
return;
}
if (StringUtils.isBlank(tenantId)) {
throw new TenantException("tenant.number.not.blank");
}
if (TenantConstants.DEFAULT_TENANT_ID.equals(tenantId)) {
return;
}
SysTenantVo tenant = tenantService.queryByTenantId(tenantId);
if (ObjectUtil.isNull(tenant)) {
log.info("登录租户:{} 不存在.", tenantId);
throw new TenantException("tenant.not.exists");
} else if (SystemConstants.DISABLE.equals(tenant.getStatus())) {
log.info("登录租户:{} 已被停用.", tenantId);
throw new TenantException("tenant.blocked");
} else if (ObjectUtil.isNotNull(tenant.getExpireTime())
&& new Date().after(tenant.getExpireTime())) {
log.info("登录租户:{} 已超过有效期.", tenantId);
throw new TenantException("tenant.expired");
}
}
}

View File

@@ -16,7 +16,6 @@ import org.dromara.common.core.utils.SpringUtils;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.log.event.LogininforEvent;
import org.dromara.common.redis.utils.RedisUtils;
import org.dromara.common.tenant.helper.TenantHelper;
import org.dromara.common.web.config.properties.CaptchaProperties;
import org.dromara.system.domain.SysUser;
import org.dromara.system.domain.bo.SysUserBo;
@@ -41,7 +40,6 @@ public class SysRegisterService {
* 注册
*/
public void register(RegisterBody registerBody) {
String tenantId = registerBody.getTenantId();
String username = registerBody.getUsername();
String password = registerBody.getPassword();
// 校验用户类型是否存在
@@ -50,7 +48,7 @@ public class SysRegisterService {
boolean captchaEnabled = captchaProperties.getEnable();
// 验证码开关
if (captchaEnabled) {
validateCaptcha(tenantId, username, registerBody.getCode(), registerBody.getUuid());
validateCaptcha(username, registerBody.getCode(), registerBody.getUuid());
}
SysUserBo sysUser = new SysUserBo();
sysUser.setUserName(username);
@@ -58,18 +56,16 @@ public class SysRegisterService {
sysUser.setPassword(BCrypt.hashpw(password));
sysUser.setUserType(userType);
boolean exist = TenantHelper.dynamic(tenantId, () -> {
return userMapper.exists(new LambdaQueryWrapper<SysUser>()
.eq(SysUser::getUserName, sysUser.getUserName()));
});
boolean exist = userMapper.exists(new LambdaQueryWrapper<SysUser>()
.eq(SysUser::getUserName, sysUser.getUserName()));
if (exist) {
throw new UserException("user.register.save.error", username);
}
boolean regFlag = userService.registerUser(sysUser, tenantId);
boolean regFlag = userService.registerUser(sysUser);
if (!regFlag) {
throw new UserException("user.register.error");
}
recordLogininfor(tenantId, username, Constants.REGISTER, MessageUtils.message("user.register.success"));
recordLogininfor(username, Constants.REGISTER, MessageUtils.message("user.register.success"));
}
/**
@@ -79,16 +75,16 @@ public class SysRegisterService {
* @param code 验证码
* @param uuid 唯一标识
*/
public void validateCaptcha(String tenantId, String username, String code, String uuid) {
public void validateCaptcha(String username, String code, String uuid) {
String verifyKey = GlobalConstants.CAPTCHA_CODE_KEY + StringUtils.blankToDefault(uuid, "");
String captcha = RedisUtils.getCacheObject(verifyKey);
RedisUtils.deleteObject(verifyKey);
if (captcha == null) {
recordLogininfor(tenantId, username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire"));
recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire"));
throw new CaptchaExpireException();
}
if (!code.equalsIgnoreCase(captcha)) {
recordLogininfor(tenantId, username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error"));
if (!StringUtils.equalsIgnoreCase(code, captcha)) {
recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error"));
throw new CaptchaException();
}
}
@@ -96,15 +92,13 @@ public class SysRegisterService {
/**
* 记录登录信息
*
* @param tenantId 租户ID
* @param username 用户名
* @param status 状态
* @param message 消息内容
* @return
*/
private void recordLogininfor(String tenantId, String username, String status, String message) {
private void recordLogininfor(String username, String status, String message) {
LogininforEvent logininforEvent = new LogininforEvent();
logininforEvent.setTenantId(tenantId);
logininforEvent.setUsername(username);
logininforEvent.setStatus(status);
logininforEvent.setMessage(message);

View File

@@ -20,7 +20,6 @@ import org.dromara.common.core.utils.ValidatorUtils;
import org.dromara.common.json.utils.JsonUtils;
import org.dromara.common.redis.utils.RedisUtils;
import org.dromara.common.satoken.utils.LoginHelper;
import org.dromara.common.tenant.helper.TenantHelper;
import org.dromara.system.domain.SysUser;
import org.dromara.system.domain.vo.SysClientVo;
import org.dromara.system.domain.vo.SysUserVo;
@@ -47,15 +46,12 @@ public class EmailAuthStrategy implements IAuthStrategy {
public LoginVo login(String body, SysClientVo client) {
EmailLoginBody loginBody = JsonUtils.parseObject(body, EmailLoginBody.class);
ValidatorUtils.validate(loginBody);
String tenantId = loginBody.getTenantId();
String email = loginBody.getEmail();
String emailCode = loginBody.getEmailCode();
LoginUser loginUser = TenantHelper.dynamic(tenantId, () -> {
SysUserVo user = loadUserByEmail(email);
loginService.checkLogin(LoginType.EMAIL, tenantId, user.getUserName(), () -> !validateEmailCode(tenantId, email, emailCode));
// 此处可根据登录用户的数据不同 自行创建 loginUser 属性不够用继承扩展就行了
return loginService.buildLoginUser(user);
});
SysUserVo user = loadUserByEmail(email);
loginService.checkLogin(LoginType.EMAIL, user.getUserName(), () -> !validateEmailCode(email, emailCode));
// 此处可根据登录用户的数据不同 自行创建 loginUser 属性不够用继承扩展就行了
LoginUser loginUser = loginService.buildLoginUser(user);
loginUser.setClientKey(client.getClientKey());
loginUser.setDeviceType(client.getDeviceType());
SaLoginParameter model = new SaLoginParameter();
@@ -78,10 +74,10 @@ public class EmailAuthStrategy implements IAuthStrategy {
/**
* 校验邮箱验证码
*/
private boolean validateEmailCode(String tenantId, String email, String emailCode) {
private boolean validateEmailCode(String email, String emailCode) {
String code = RedisUtils.getCacheObject(GlobalConstants.CAPTCHA_CODE_KEY + email);
if (StringUtils.isBlank(code)) {
loginService.recordLogininfor(tenantId, email, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire"));
loginService.recordLogininfor(email, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire"));
throw new CaptchaExpireException();
}
return code.equals(emailCode);

View File

@@ -22,7 +22,6 @@ import org.dromara.common.core.utils.ValidatorUtils;
import org.dromara.common.json.utils.JsonUtils;
import org.dromara.common.redis.utils.RedisUtils;
import org.dromara.common.satoken.utils.LoginHelper;
import org.dromara.common.tenant.helper.TenantHelper;
import org.dromara.common.web.config.properties.CaptchaProperties;
import org.dromara.system.domain.SysUser;
import org.dromara.system.domain.vo.SysClientVo;
@@ -51,7 +50,6 @@ public class PasswordAuthStrategy implements IAuthStrategy {
public LoginVo login(String body, SysClientVo client) {
PasswordLoginBody loginBody = JsonUtils.parseObject(body, PasswordLoginBody.class);
ValidatorUtils.validate(loginBody);
String tenantId = loginBody.getTenantId();
String username = loginBody.getUsername();
String password = loginBody.getPassword();
String code = loginBody.getCode();
@@ -60,14 +58,12 @@ public class PasswordAuthStrategy implements IAuthStrategy {
boolean captchaEnabled = captchaProperties.getEnable();
// 验证码开关
if (captchaEnabled) {
validateCaptcha(tenantId, username, code, uuid);
validateCaptcha(username, code, uuid);
}
LoginUser loginUser = TenantHelper.dynamic(tenantId, () -> {
SysUserVo user = loadUserByUsername(username);
loginService.checkLogin(LoginType.PASSWORD, tenantId, username, () -> !BCrypt.checkpw(password, user.getPassword()));
// 此处可根据登录用户的数据不同 自行创建 loginUser
return loginService.buildLoginUser(user);
});
SysUserVo user = loadUserByUsername(username);
loginService.checkLogin(LoginType.PASSWORD, username, () -> !BCrypt.checkpw(password, user.getPassword()));
// 此处可根据登录用户的数据不同 自行创建 loginUser
LoginUser loginUser = loginService.buildLoginUser(user);
loginUser.setClientKey(client.getClientKey());
loginUser.setDeviceType(client.getDeviceType());
SaLoginParameter model = new SaLoginParameter();
@@ -94,16 +90,16 @@ public class PasswordAuthStrategy implements IAuthStrategy {
* @param code 验证码
* @param uuid 唯一标识
*/
private void validateCaptcha(String tenantId, String username, String code, String uuid) {
private void validateCaptcha(String username, String code, String uuid) {
String verifyKey = GlobalConstants.CAPTCHA_CODE_KEY + StringUtils.blankToDefault(uuid, "");
String captcha = RedisUtils.getCacheObject(verifyKey);
RedisUtils.deleteObject(verifyKey);
if (captcha == null) {
loginService.recordLogininfor(tenantId, username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire"));
loginService.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire"));
throw new CaptchaExpireException();
}
if (!code.equalsIgnoreCase(captcha)) {
loginService.recordLogininfor(tenantId, username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error"));
if (!StringUtils.equalsIgnoreCase(code, captcha)) {
loginService.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error"));
throw new CaptchaException();
}
}

View File

@@ -20,7 +20,6 @@ import org.dromara.common.core.utils.ValidatorUtils;
import org.dromara.common.json.utils.JsonUtils;
import org.dromara.common.redis.utils.RedisUtils;
import org.dromara.common.satoken.utils.LoginHelper;
import org.dromara.common.tenant.helper.TenantHelper;
import org.dromara.system.domain.SysUser;
import org.dromara.system.domain.vo.SysClientVo;
import org.dromara.system.domain.vo.SysUserVo;
@@ -47,15 +46,12 @@ public class SmsAuthStrategy implements IAuthStrategy {
public LoginVo login(String body, SysClientVo client) {
SmsLoginBody loginBody = JsonUtils.parseObject(body, SmsLoginBody.class);
ValidatorUtils.validate(loginBody);
String tenantId = loginBody.getTenantId();
String phonenumber = loginBody.getPhonenumber();
String smsCode = loginBody.getSmsCode();
LoginUser loginUser = TenantHelper.dynamic(tenantId, () -> {
SysUserVo user = loadUserByPhonenumber(phonenumber);
loginService.checkLogin(LoginType.SMS, tenantId, user.getUserName(), () -> !validateSmsCode(tenantId, phonenumber, smsCode));
// 此处可根据登录用户的数据不同 自行创建 loginUser 属性不够用继承扩展就行了
return loginService.buildLoginUser(user);
});
SysUserVo user = loadUserByPhonenumber(phonenumber);
loginService.checkLogin(LoginType.SMS, user.getUserName(), () -> !validateSmsCode(phonenumber, smsCode));
// 此处可根据登录用户的数据不同 自行创建 loginUser 属性不够用继承扩展就行了
LoginUser loginUser = loginService.buildLoginUser(user);
loginUser.setClientKey(client.getClientKey());
loginUser.setDeviceType(client.getDeviceType());
SaLoginParameter model = new SaLoginParameter();
@@ -78,10 +74,10 @@ public class SmsAuthStrategy implements IAuthStrategy {
/**
* 校验短信验证码
*/
private boolean validateSmsCode(String tenantId, String phonenumber, String smsCode) {
private boolean validateSmsCode(String phonenumber, String smsCode) {
String code = RedisUtils.getCacheObject(GlobalConstants.CAPTCHA_CODE_KEY + phonenumber);
if (StringUtils.isBlank(code)) {
loginService.recordLogininfor(tenantId, phonenumber, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire"));
loginService.recordLogininfor(phonenumber, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire"));
throw new CaptchaExpireException();
}
return code.equals(smsCode);

View File

@@ -3,10 +3,7 @@ package org.dromara.web.service.impl;
import cn.dev33.satoken.stp.StpUtil;
import cn.dev33.satoken.stp.parameter.SaLoginParameter;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.http.HttpUtil;
import cn.hutool.http.Method;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import me.zhyd.oauth.model.AuthResponse;
@@ -16,13 +13,11 @@ import org.dromara.common.core.domain.model.LoginUser;
import org.dromara.common.core.domain.model.SocialLoginBody;
import org.dromara.common.core.exception.ServiceException;
import org.dromara.common.core.exception.user.UserException;
import org.dromara.common.core.utils.StreamUtils;
import org.dromara.common.core.utils.ValidatorUtils;
import org.dromara.common.json.utils.JsonUtils;
import org.dromara.common.satoken.utils.LoginHelper;
import org.dromara.common.social.config.properties.SocialProperties;
import org.dromara.common.social.utils.SocialUtils;
import org.dromara.common.tenant.helper.TenantHelper;
import org.dromara.system.domain.vo.SysClientVo;
import org.dromara.system.domain.vo.SysSocialVo;
import org.dromara.system.domain.vo.SysUserVo;
@@ -34,7 +29,6 @@ import org.dromara.web.service.SysLoginService;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Optional;
/**
* 第三方授权策略
@@ -68,35 +62,14 @@ public class SocialAuthStrategy implements IAuthStrategy {
throw new ServiceException(response.getMsg());
}
AuthUser authUserData = response.getData();
if ("GITEE".equals(authUserData.getSource())) {
// 如用户使用 gitee 登录顺手 star 给作者一点支持 拒绝白嫖
HttpUtil.createRequest(Method.PUT, "https://gitee.com/api/v5/user/starred/dromara/RuoYi-Vue-Plus")
.formStr(MapUtil.of("access_token", authUserData.getToken().getAccessToken()))
.executeAsync();
HttpUtil.createRequest(Method.PUT, "https://gitee.com/api/v5/user/starred/dromara/RuoYi-Cloud-Plus")
.formStr(MapUtil.of("access_token", authUserData.getToken().getAccessToken()))
.executeAsync();
}
List<SysSocialVo> list = sysSocialService.selectByAuthId(authUserData.getSource() + authUserData.getUuid());
if (CollUtil.isEmpty(list)) {
throw new ServiceException("你还没有绑定第三方账号,绑定后才可以登录!");
}
SysSocialVo social;
if (TenantHelper.isEnable()) {
Optional<SysSocialVo> opt = StreamUtils.findAny(list, x -> x.getTenantId().equals(loginBody.getTenantId()));
if (opt.isEmpty()) {
throw new ServiceException("对不起,你没有权限登录当前租户!");
}
social = opt.get();
} else {
social = list.get(0);
}
LoginUser loginUser = TenantHelper.dynamic(social.getTenantId(), () -> {
SysUserVo user = loadUser(social.getUserId());
// 此处可根据登录用户的数据不同 自行创建 loginUser 属性不够用继承扩展就行了
return loginService.buildLoginUser(user);
});
SysUserVo user = loadUser(list.get(0).getUserId());
// 此处可根据登录用户的数据不同 自行创建 loginUser 属性不够用继承扩展就行了
LoginUser loginUser = loginService.buildLoginUser(user);
loginUser.setClientKey(client.getClientKey());
loginUser.setDeviceType(client.getDeviceType());
SaLoginParameter model = new SaLoginParameter();

View File

@@ -67,7 +67,6 @@ public class XcxAuthStrategy implements IAuthStrategy {
SysUserVo user = loadUserByOpenid(openid);
// 此处可根据登录用户的数据不同 自行创建 loginUser 属性不够用继承扩展就行了
XcxLoginUser loginUser = new XcxLoginUser();
loginUser.setTenantId(user.getTenantId());
loginUser.setUserId(user.getUserId());
loginUser.setUsername(user.getUserName());
loginUser.setNickname(user.getNickName());

View File

@@ -27,8 +27,6 @@ snail-job:
port: 2${server.port}
# 客户端ip指定
host:
# RPC类型: netty, grpc
rpc-type: grpc
--- # 数据源配置
spring:

View File

@@ -30,8 +30,6 @@ snail-job:
port: 2${server.port}
# 客户端ip指定
host:
# RPC类型: netty, grpc
rpc-type: grpc
--- # 数据源配置
spring:

View File

@@ -5,28 +5,21 @@ server:
servlet:
# 应用的访问路径
context-path: /
# undertow 配置
undertow:
# jetty 配置
jetty:
# HTTP post内容的最大大小。当值为-1时默认值为大小是无限的
max-http-post-size: -1
# 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理
# 每块buffer的空间大小,越小的空间被利用越充分
buffer-size: 512
# 是否分配的直接内存
direct-buffers: true
max-http-form-post-size: -1
threads:
# 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程
io: 8
# 阻塞任务线程池, 当执行类似servlet请求阻塞操作, undertow会从这个线程池中取得线程,它的值设置取决于系统的负载
worker: 256
# 最小线程数
min: 8
# 最大线程数
max: 256
captcha:
# 是否启用验证码校验
enable: true
# 验证码类型 math 数组计算 char 字符验证
type: MATH
# line 线段干扰 circle 圆圈干扰 shear 扭曲干扰
category: CIRCLE
type: math
# 数字验证码位数
numberLength: 1
# 字符验证码长度
@@ -57,6 +50,13 @@ spring:
# 开启虚拟线程 仅jdk21可用
virtual:
enabled: false
task:
execution:
# 从 springboot 3.5 开始 spring自带线程池
# 不再需要 AsyncConfig与ThreadPoolConfig 可直接注入线程池使用
thread-name-prefix: async-
# 由spring自己初始化线程池
mode: force
# 资源信息
messages:
# 国际化资源文件路径
@@ -112,22 +112,6 @@ security:
- /*/api-docs/**
- /warm-flow-ui/config
# 多租户配置
tenant:
# 是否开启
enable: true
# 排除表
excludes:
- sys_menu
- sys_tenant
- sys_tenant_package
- sys_role_dept
- sys_role_menu
- sys_user_post
- sys_user_role
- sys_client
- sys_oss_config
# MyBatisPlus配置
# https://baomidou.com/config/
mybatis-plus:
@@ -183,19 +167,12 @@ springdoc:
# 描述
description: '描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...'
# 版本
version: '版本号: ${ruoyi.version}'
version: '版本号: ${project.version}'
# 作者信息
contact:
name: Lion Li
email: crazylionli@163.com
url: https://gitee.com/dromara/RuoYi-Vue-Plus
components:
# 鉴权方式配置
security-schemes:
apiKey:
type: APIKEY
in: HEADER
name: ${sa-token.token-name}
#这里定义了两个分组,可定义多个,也可以不定义
group-configs:
- group: 1.演示模块
@@ -213,20 +190,10 @@ springdoc:
xss:
# 过滤开关
enabled: true
# 排除链接(多个用逗号分隔)
# 排除链接
excludeUrls:
- /system/notice
# 全局线程池相关配置
# 如使用JDK21请直接使用虚拟线程 不要开启此配置
thread-pool:
# 是否开启线程池
enabled: false
# 队列最大长度
queueCapacity: 128
# 线程池维护线程所允许的空闲时间
keepAliveSeconds: 300
--- # 分布式锁 lock4j 全局配置
lock4j:
# 获取分布式锁超时时间,默认为 3000 毫秒
@@ -266,13 +233,49 @@ warm-flow:
enabled: true
# 是否开启设计器ui
ui: true
# 是否显示流程图顶部文字
top-text-show: true
# 是否渲染节点悬浮提示默认true
node-tooltip: true
# 默认Authorization如果有多个token用逗号分隔
token-name: ${sa-token.token-name},clientid
# 流程状态对应的三元色
chart-status-color:
## 未办理
- 62,62,62
## 待办理
- 255,205,23
## 已办理
- 157,255,0
--- # mqtt 配置
# 具体配置还需查看文档
# https://mica-mqtt.dreamlu.net/guide/spring/client.html
mqtt.client:
# 是否开启客户端默认true
enabled: false
# 连接的服务端 ip 默认127.0.0.1
ip: 127.0.0.1
# 端口默认1883
port: 1883
# 客户端名称
name: Mqtt-Client
# 客户端Id非常重要一般为设备 sn不可重复
client-id: 000001
username: ruoyi
password: 123456
# 超时时间单位默认5秒
timeout: 5
# 重连时间,默认 5000 毫秒
re-interval: 5000
# mqtt 协议版本,可选 MQTT_3_1、mqtt_3_1_1、mqtt_5默认mqtt_3_1_1
version: mqtt_3_1_1
# 接收数据的 buffer size默认8k
read-buffer-size: 8KB
# 消息解析最大 bytes 长度默认10M
max-bytes-in-message: 10MB
# keep-alive 时间,单位:秒
keep-alive-secs: 60
# 开启保留 session 时session 的有效期
session-expiry-interval-secs: 0
# 工作线程数,如果消息量比较大,例如做 emqx 的转发消息处理,可以调大此参数
mqtt-executor-size: 2
# 是否开启 ssl
ssl:
enabled: false
keystore-path:
keystore-pass:
truststore-path:
truststore-pass:

View File

@@ -5,7 +5,7 @@ user.jcaptcha.expire=验证码已失效
user.not.exists=对不起, 您的账号:{0} 不存在.
user.password.not.match=用户不存在/密码错误
user.password.retry.limit.count=密码输入错误{0}次
user.password.retry.limit.exceed=密码输入错误{0}次,户锁定{1}分钟
user.password.retry.limit.exceed=密码输入错误{0}次,户锁定{1}分钟
user.password.delete=对不起,您的账号:{0} 已被删除
user.blocked=对不起,您的账号:{0} 已禁用,请联系管理员
role.blocked=角色已封禁,请联系管理员
@@ -17,6 +17,7 @@ user.username.length.valid=账户长度必须在{min}到{max}个字符之间
user.password.not.blank=用户密码不能为空
user.password.length.valid=用户密码长度必须在{min}到{max}个字符之间
user.password.not.valid=* 5-50个字符
user.password.format.valid=密码必须包含大写字母、小写字母、数字和特殊字符
user.email.not.valid=邮箱格式错误
user.email.not.blank=邮箱不能为空
user.phonenumber.not.blank=用户手机号不能为空
@@ -46,16 +47,12 @@ repeat.submit.message=不允许重复提交,请稍候再试
rate.limiter.message=访问过于频繁,请稍候再试
sms.code.not.blank=短信验证码不能为空
sms.code.retry.limit.count=短信验证码输入错误{0}次
sms.code.retry.limit.exceed=短信验证码输入错误{0}次,户锁定{1}分钟
sms.code.retry.limit.exceed=短信验证码输入错误{0}次,户锁定{1}分钟
email.code.not.blank=邮箱验证码不能为空
email.code.retry.limit.count=邮箱验证码输入错误{0}次
email.code.retry.limit.exceed=邮箱验证码输入错误{0}次,户锁定{1}分钟
email.code.retry.limit.exceed=邮箱验证码输入错误{0}次,户锁定{1}分钟
xcx.code.not.blank=小程序[code]不能为空
social.source.not.blank=第三方登录平台[source]不能为空
social.code.not.blank=第三方登录平台[code]不能为空
social.state.not.blank=第三方登录平台[state]不能为空
##租户
tenant.number.not.blank=租户编号不能为空
tenant.not.exists=对不起, 您的租户不存在,请联系管理员
tenant.blocked=对不起,您的租户已禁用,请联系管理员
tenant.expired=对不起,您的租户已过期,请联系管理员

View File

@@ -17,6 +17,7 @@ user.username.length.valid=Account length must be between {min} and {max} charac
user.password.not.blank=Password cannot be empty
user.password.length.valid=Password length must be between {min} and {max} characters
user.password.not.valid=* 5-50 characters
user.password.format.valid=Password must contain uppercase, lowercase, digit, and special character
user.email.not.valid=Mailbox format error
user.email.not.blank=Mailbox cannot be blank
user.phonenumber.not.blank=Phone number cannot be blank
@@ -54,8 +55,4 @@ xcx.code.not.blank=Mini program [code] cannot be blank
social.source.not.blank=Social login platform [source] cannot be blank
social.code.not.blank=Social login platform [code] cannot be blank
social.state.not.blank=Social login platform [state] cannot be blank
##租户
tenant.number.not.blank=Tenant number cannot be blank
tenant.not.exists=Sorry, your tenant does not exist. Please contact the administrator
tenant.blocked=Sorry, your tenant is disabled. Please contact the administrator
tenant.expired=Sorry, your tenant has expired. Please contact the administrator.

View File

@@ -5,7 +5,7 @@ user.jcaptcha.expire=验证码已失效
user.not.exists=对不起, 您的账号:{0} 不存在.
user.password.not.match=用户不存在/密码错误
user.password.retry.limit.count=密码输入错误{0}次
user.password.retry.limit.exceed=密码输入错误{0}次,户锁定{1}分钟
user.password.retry.limit.exceed=密码输入错误{0}次,户锁定{1}分钟
user.password.delete=对不起,您的账号:{0} 已被删除
user.blocked=对不起,您的账号:{0} 已禁用,请联系管理员
role.blocked=角色已封禁,请联系管理员
@@ -17,6 +17,7 @@ user.username.length.valid=账户长度必须在{min}到{max}个字符之间
user.password.not.blank=用户密码不能为空
user.password.length.valid=用户密码长度必须在{min}到{max}个字符之间
user.password.not.valid=* 5-50个字符
user.password.format.valid=密码必须包含大写字母、小写字母、数字和特殊字符
user.email.not.valid=邮箱格式错误
user.email.not.blank=邮箱不能为空
user.phonenumber.not.blank=用户手机号不能为空
@@ -46,16 +47,12 @@ repeat.submit.message=不允许重复提交,请稍候再试
rate.limiter.message=访问过于频繁,请稍候再试
sms.code.not.blank=短信验证码不能为空
sms.code.retry.limit.count=短信验证码输入错误{0}次
sms.code.retry.limit.exceed=短信验证码输入错误{0}次,户锁定{1}分钟
sms.code.retry.limit.exceed=短信验证码输入错误{0}次,户锁定{1}分钟
email.code.not.blank=邮箱验证码不能为空
email.code.retry.limit.count=邮箱验证码输入错误{0}次
email.code.retry.limit.exceed=邮箱验证码输入错误{0}次,户锁定{1}分钟
email.code.retry.limit.exceed=邮箱验证码输入错误{0}次,户锁定{1}分钟
xcx.code.not.blank=小程序[code]不能为空
social.source.not.blank=第三方登录平台[source]不能为空
social.code.not.blank=第三方登录平台[code]不能为空
social.state.not.blank=第三方登录平台[state]不能为空
##租户
tenant.number.not.blank=租户编号不能为空
tenant.not.exists=对不起, 您的租户不存在,请联系管理员
tenant.blocked=对不起,您的租户已禁用,请联系管理员
tenant.expired=对不起,您的租户已过期,请联系管理员

View File

@@ -38,7 +38,7 @@
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log</fileNamePattern>
<fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log.gz</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
@@ -60,7 +60,7 @@
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.log</fileNamePattern>
<fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.log.gz</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>

View File

@@ -8,6 +8,12 @@
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>ruoyi-common</artifactId>
<packaging>pom</packaging>
<description>
common 通用模块
</description>
<modules>
<module>ruoyi-common-bom</module>
@@ -15,13 +21,11 @@
<module>ruoyi-common-core</module>
<module>ruoyi-common-doc</module>
<module>ruoyi-common-excel</module>
<module>ruoyi-common-idempotent</module>
<module>ruoyi-common-job</module>
<module>ruoyi-common-log</module>
<module>ruoyi-common-mail</module>
<module>ruoyi-common-mybatis</module>
<module>ruoyi-common-oss</module>
<module>ruoyi-common-ratelimiter</module>
<module>ruoyi-common-redis</module>
<module>ruoyi-common-satoken</module>
<module>ruoyi-common-security</module>
@@ -31,16 +35,9 @@
<module>ruoyi-common-sensitive</module>
<module>ruoyi-common-json</module>
<module>ruoyi-common-encrypt</module>
<module>ruoyi-common-tenant</module>
<module>ruoyi-common-websocket</module>
<module>ruoyi-common-sse</module>
<module>ruoyi-common-mqtt</module>
</modules>
<artifactId>ruoyi-common</artifactId>
<packaging>pom</packaging>
<description>
common 通用模块
</description>
</project>

View File

@@ -14,7 +14,7 @@
</description>
<properties>
<revision>5.4.0</revision>
<revision>5.5.3</revision>
</properties>
<dependencyManagement>
@@ -40,13 +40,6 @@
<version>${revision}</version>
</dependency>
<!-- 幂等 -->
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-idempotent</artifactId>
<version>${revision}</version>
</dependency>
<!-- 调度模块 -->
<dependency>
<groupId>org.dromara</groupId>
@@ -82,13 +75,6 @@
<version>${revision}</version>
</dependency>
<!-- 限流 -->
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-ratelimiter</artifactId>
<version>${revision}</version>
</dependency>
<!-- 缓存服务 -->
<dependency>
<groupId>org.dromara</groupId>
@@ -158,13 +144,6 @@
<version>${revision}</version>
</dependency>
<!-- 租户模块 -->
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-tenant</artifactId>
<version>${revision}</version>
</dependency>
<!-- WebSocket模块 -->
<dependency>
<groupId>org.dromara</groupId>
@@ -179,6 +158,12 @@
<version>${revision}</version>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-mqtt</artifactId>
<version>${revision}</version>
</dependency>
</dependencies>
</dependencyManagement>

View File

@@ -36,7 +36,7 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
<artifactId>spring-boot-starter-aspectj</artifactId>
</dependency>
<!--常用工具类 -->

View File

@@ -1,52 +0,0 @@
package org.dromara.common.core.config;
import cn.hutool.core.util.ArrayUtil;
import org.dromara.common.core.exception.ServiceException;
import org.dromara.common.core.utils.SpringUtils;
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.core.task.VirtualThreadTaskExecutor;
import org.springframework.scheduling.annotation.AsyncConfigurer;
import java.util.Arrays;
import java.util.concurrent.Executor;
/**
* 异步配置
* <p>
* 如果未使用虚拟线程则生效
*
* @author Lion Li
*/
@AutoConfiguration
public class AsyncConfig implements AsyncConfigurer {
/**
* 自定义 @Async 注解使用系统线程池
*/
@Override
public Executor getAsyncExecutor() {
if(SpringUtils.isVirtual()) {
return new VirtualThreadTaskExecutor("async-");
}
return SpringUtils.getBean("scheduledExecutorService");
}
/**
* 异步执行异常处理
*/
@Override
public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() {
return (throwable, method, objects) -> {
throwable.printStackTrace();
StringBuilder sb = new StringBuilder();
sb.append("Exception message - ").append(throwable.getMessage())
.append(", Method name - ").append(method.getName());
if (ArrayUtil.isNotEmpty(objects)) {
sb.append(", Parameter value - ").append(Arrays.toString(objects));
}
throw new ServiceException(sb.toString());
};
}
}

View File

@@ -3,19 +3,12 @@ package org.dromara.common.core.config;
import jakarta.annotation.PreDestroy;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.concurrent.BasicThreadFactory;
import org.dromara.common.core.config.properties.ThreadPoolProperties;
import org.dromara.common.core.utils.SpringUtils;
import org.dromara.common.core.utils.Threads;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.core.task.VirtualThreadTaskExecutor;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.*;
/**
* 线程池配置
@@ -24,7 +17,6 @@ import java.util.concurrent.ThreadPoolExecutor;
**/
@Slf4j
@AutoConfiguration
@EnableConfigurationProperties(ThreadPoolProperties.class)
public class ThreadPoolConfig {
/**
@@ -34,18 +26,6 @@ public class ThreadPoolConfig {
private ScheduledExecutorService scheduledExecutorService;
@Bean(name = "threadPoolTaskExecutor")
@ConditionalOnProperty(prefix = "thread-pool", name = "enabled", havingValue = "true")
public ThreadPoolTaskExecutor threadPoolTaskExecutor(ThreadPoolProperties threadPoolProperties) {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(core);
executor.setMaxPoolSize(core * 2);
executor.setQueueCapacity(threadPoolProperties.getQueueCapacity());
executor.setKeepAliveSeconds(threadPoolProperties.getKeepAliveSeconds());
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
return executor;
}
/**
* 执行周期性或定时任务
*/
@@ -64,7 +44,7 @@ public class ThreadPoolConfig {
@Override
protected void afterExecute(Runnable r, Throwable t) {
super.afterExecute(r, t);
Threads.printException(r, t);
printException(r, t);
}
};
this.scheduledExecutorService = scheduledThreadPoolExecutor;
@@ -73,15 +53,57 @@ public class ThreadPoolConfig {
/**
* 销毁事件
* 停止线程池
* 先使用shutdown, 停止接收新任务并尝试完成所有已存在任务.
* 如果超时, 则调用shutdownNow, 取消在workQueue中Pending的任务,并中断所有阻塞函数.
* 如果仍然超時,則強制退出.
* 另对在shutdown时线程本身被调用中断做了处理.
*/
@PreDestroy
public void destroy() {
try {
log.info("====关闭后台任务任务线程池====");
Threads.shutdownAndAwaitTermination(scheduledExecutorService);
ScheduledExecutorService pool = scheduledExecutorService;
if (pool != null && !pool.isShutdown()) {
pool.shutdown();
try {
if (!pool.awaitTermination(120, TimeUnit.SECONDS)) {
pool.shutdownNow();
if (!pool.awaitTermination(120, TimeUnit.SECONDS)) {
log.info("Pool did not terminate");
}
}
} catch (InterruptedException ie) {
pool.shutdownNow();
Thread.currentThread().interrupt();
}
}
} catch (Exception e) {
log.error(e.getMessage(), e);
}
}
/**
* 打印线程异常信息
*/
public static void printException(Runnable r, Throwable t) {
if (t == null && r instanceof Future<?>) {
try {
Future<?> future = (Future<?>) r;
if (future.isDone()) {
future.get();
}
} catch (CancellationException ce) {
t = ce;
} catch (ExecutionException ee) {
t = ee.getCause();
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
}
}
if (t != null) {
log.error(t.getMessage(), t);
}
}
}

View File

@@ -3,7 +3,7 @@ package org.dromara.common.core.config;
import jakarta.validation.Validator;
import org.hibernate.validator.HibernateValidator;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration;
import org.springframework.boot.validation.autoconfigure.ValidationAutoConfiguration;
import org.springframework.context.MessageSource;
import org.springframework.context.annotation.Bean;
import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean;

View File

@@ -1,30 +0,0 @@
package org.dromara.common.core.config.properties;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
* 线程池 配置属性
*
* @author Lion Li
*/
@Data
@ConfigurationProperties(prefix = "thread-pool")
public class ThreadPoolProperties {
/**
* 是否开启线程池
*/
private boolean enabled;
/**
* 队列最大长度
*/
private int queueCapacity;
/**
* 线程池维护线程所允许的空闲时间
*/
private int keepAliveSeconds;
}

View File

@@ -36,11 +36,6 @@ public interface CacheNames {
*/
String SYS_DICT_TYPE = "sys_dict_type";
/**
* 租户
*/
String SYS_TENANT = GlobalConstants.GLOBAL_REDIS_KEY + "sys_tenant#30d";
/**
* 客户端
*/

View File

@@ -72,5 +72,10 @@ public interface Constants {
*/
Long TOP_PARENT_ID = 0L;
/**
* 加密头
*/
String ENCRYPT_HEADER = "ENC_";
}

View File

@@ -72,9 +72,25 @@ public interface SystemConstants {
*/
Long SUPER_ADMIN_ID = 1L;
/**
* 超级管理员角色 roleKey
*/
String SUPER_ADMIN_ROLE_KEY = "superadmin";
/**
* 根部门祖级列表
*/
String ROOT_DEPT_ANCESTORS = "0";
/**
* 默认部门 ID
*/
Long DEFAULT_DEPT_ID = 100L;
/**
* 排除敏感属性字段
*/
String[] EXCLUDE_PROPERTIES = { "password", "oldPassword", "newPassword", "confirmPassword" };
}

View File

@@ -1,35 +0,0 @@
package org.dromara.common.core.constant;
/**
* 租户常量信息
*
* @author Lion Li
*/
public interface TenantConstants {
/**
* 超级管理员ID
*/
Long SUPER_ADMIN_ID = 1L;
/**
* 超级管理员角色 roleKey
*/
String SUPER_ADMIN_ROLE_KEY = "superadmin";
/**
* 租户管理员角色 roleKey
*/
String TENANT_ADMIN_ROLE_KEY = "admin";
/**
* 租户管理员角色名称
*/
String TENANT_ADMIN_ROLE_NAME = "管理员";
/**
* 默认租户ID
*/
String DEFAULT_TENANT_ID = "000000";
}

View File

@@ -50,6 +50,11 @@ public class CompleteTaskDTO implements Serializable {
*/
private String notice;
/**
* 办理人(可不填 用于覆盖当前节点办理人)
*/
private String handler;
/**
* 流程变量
*/
@@ -62,7 +67,8 @@ public class CompleteTaskDTO implements Serializable {
public Map<String, Object> getVariables() {
if (variables == null) {
return new HashMap<>(16);
variables = new HashMap<>(16);
return variables;
}
variables.entrySet().removeIf(entry -> Objects.isNull(entry.getValue()));
return variables;

View File

@@ -0,0 +1,45 @@
package org.dromara.common.core.domain.dto;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 流程实例业务扩展对象
*
* @author may
* @date 2025-08-05
*/
@Data
public class FlowInstanceBizExtDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private Long id;
/**
* 流程实例ID
*/
private Long instanceId;
/**
* 业务ID
*/
private String businessId;
/**
* 业务编码
*/
private String businessCode;
/**
* 业务标题
*/
private String businessTitle;
}

View File

@@ -1,6 +1,7 @@
package org.dromara.common.core.domain.dto;
import cn.hutool.core.util.ObjectUtil;
import lombok.Data;
import java.io.Serial;
@@ -30,11 +31,21 @@ public class StartProcessDTO implements Serializable {
*/
private String flowCode;
/**
* 办理人(可不填 用于覆盖当前节点办理人)
*/
private String handler;
/**
* 流程变量,前端会提交一个元素{'entity': {业务详情数据对象}}
*/
private Map<String, Object> variables;
/**
* 流程业务扩展信息
*/
private FlowInstanceBizExtDTO bizExt;
public Map<String, Object> getVariables() {
if (variables == null) {
return new HashMap<>(16);
@@ -42,4 +53,11 @@ public class StartProcessDTO implements Serializable {
variables.entrySet().removeIf(entry -> Objects.isNull(entry.getValue()));
return variables;
}
public FlowInstanceBizExtDTO getBizExt() {
if (ObjectUtil.isNull(bizExt)) {
bizExt = new FlowInstanceBizExtDTO();
}
return bizExt;
}
}

View File

@@ -52,17 +52,17 @@ public class TaskAssigneeDTO implements Serializable {
*/
public static <T> List<TaskHandler> convertToHandlerList(
List<T> sourceList,
Function<T, Long> storageId,
Function<T, String> storageId,
Function<T, String> handlerCode,
Function<T, String> handlerName,
Function<T, Long> groupName,
Function<T, String> groupName,
Function<T, Date> createTimeMapper) {
return sourceList.stream()
.map(item -> new TaskHandler(
String.valueOf(storageId.apply(item)),
storageId.apply(item),
handlerCode.apply(item),
handlerName.apply(item),
groupName != null ? String.valueOf(groupName.apply(item)) : null,
groupName.apply(item),
createTimeMapper.apply(item)
)).collect(Collectors.toList());
}

View File

@@ -61,7 +61,7 @@ public class UserDTO implements Serializable {
private String sex;
/**
* 号状态0正常 1停用
* 号状态0正常 1停用
*/
private String status;

View File

@@ -16,11 +16,6 @@ public class ProcessDeleteEvent implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 租户ID
*/
private String tenantId;
/**
* 流程定义编码
*/

View File

@@ -17,16 +17,16 @@ public class ProcessEvent implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 租户ID
*/
private String tenantId;
/**
* 流程定义编码
*/
private String flowCode;
/**
* 实例id
*/
private Long instanceId;
/**
* 业务id
*/

View File

@@ -4,6 +4,7 @@ import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.Map;
/**
* 流程任务监听
@@ -16,11 +17,6 @@ public class ProcessTaskEvent implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 租户ID
*/
private String tenantId;
/**
* 流程定义编码
*/
@@ -46,6 +42,11 @@ public class ProcessTaskEvent implements Serializable {
*/
private Long taskId;
/**
* 实例id
*/
private Long instanceId;
/**
* 业务id
*/
@@ -56,4 +57,9 @@ public class ProcessTaskEvent implements Serializable {
*/
private String status;
/**
* 办理参数
*/
private Map<String, Object> params;
}

View File

@@ -30,11 +30,6 @@ public class LoginBody implements Serializable {
@NotBlank(message = "{auth.grant.type.not.blank}")
private String grantType;
/**
* 租户ID
*/
private String tenantId;
/**
* 验证码
*/

View File

@@ -22,11 +22,6 @@ public class LoginUser implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 租户ID
*/
private String tenantId;
/**
* 用户ID
*/

View File

@@ -26,6 +26,7 @@ public class PasswordLoginBody extends LoginBody {
*/
@NotBlank(message = "{user.password.not.blank}")
@Length(min = 5, max = 30, message = "{user.password.length.valid}")
// @Pattern(regexp = RegexConstants.PASSWORD, message = "{user.password.format.valid}")
private String password;
}

View File

@@ -26,8 +26,12 @@ public class RegisterBody extends LoginBody {
*/
@NotBlank(message = "{user.password.not.blank}")
@Length(min = 5, max = 30, message = "{user.password.length.valid}")
// @Pattern(regexp = RegexConstants.PASSWORD, message = "{user.password.format.valid}")
private String password;
/**
* 用户类型
*/
private String userType;
}

View File

@@ -1,11 +1,15 @@
package org.dromara.common.core.exception;
import lombok.*;
import cn.hutool.core.text.StrFormatter;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import java.io.Serial;
/**
* 业务异常
* 业务异常(支持占位符 {}
*
* @author ruoyi
*/
@@ -42,6 +46,10 @@ public final class ServiceException extends RuntimeException {
this.code = code;
}
public ServiceException(String message, Object... args) {
this.message = StrFormatter.format(message, args);
}
@Override
public String getMessage() {
return message;

View File

@@ -1,5 +1,11 @@
package org.dromara.common.core.service;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.lang.Dict;
import java.math.BigDecimal;
import java.util.List;
/**
* 通用 参数配置服务
*
@@ -15,4 +21,80 @@ public interface ConfigService {
*/
String getConfigValue(String configKey);
/**
* 根据参数 key 获取布尔值
*
* @param configKey 参数 key
* @return Boolean 值
*/
default Boolean getConfigBool(String configKey) {
return Convert.toBool(getConfigValue(configKey));
}
/**
* 根据参数 key 获取整数值
*
* @param configKey 参数 key
* @return Integer 值
*/
default Integer getConfigInt(String configKey) {
return Convert.toInt(getConfigValue(configKey));
}
/**
* 根据参数 key 获取长整型值
*
* @param configKey 参数 key
* @return Long 值
*/
default Long getConfigLong(String configKey) {
return Convert.toLong(getConfigValue(configKey));
}
/**
* 根据参数 key 获取 BigDecimal 值
*
* @param configKey 参数 key
* @return BigDecimal 值
*/
default BigDecimal getConfigDecimal(String configKey) {
return Convert.toBigDecimal(getConfigValue(configKey));
}
/**
* 根据参数 key 获取 Map 类型的配置
*
* @param configKey 参数 key
* @return Dict 对象,如果配置为空或无法解析,返回空 Dict
*/
Dict getConfigMap(String configKey);
/**
* 根据参数 key 获取 Map 类型的配置列表
*
* @param configKey 参数 key
* @return Dict 列表,如果配置为空或无法解析,返回空列表
*/
List<Dict> getConfigArrayMap(String configKey);
/**
* 根据参数 key 获取指定类型的配置对象
*
* @param configKey 参数 key
* @param clazz 目标对象类型
* @param <T> 目标对象泛型
* @return 对象实例,如果配置为空或无法解析,返回 null
*/
<T> T getConfigObject(String configKey, Class<T> clazz);
/**
* 根据参数 key 获取指定类型的配置列表
*
* @param configKey 参数 key
* @param clazz 目标元素类型
* @param <T> 元素类型泛型
* @return 指定类型列表,如果配置为空或无法解析,返回空列表
*/
<T> List<T> getConfigArray(String configKey, Class<T> clazz);
}

View File

@@ -3,6 +3,7 @@ package org.dromara.common.core.service;
import org.dromara.common.core.domain.dto.DeptDTO;
import java.util.List;
import java.util.Map;
/**
* 通用 部门服务
@@ -34,4 +35,12 @@ public interface DeptService {
*/
List<DeptDTO> selectDeptsByList();
/**
* 根据部门 ID 列表查询部门名称映射关系
*
* @param deptIds 部门 ID 列表
* @return Map其中 key 为部门 IDvalue 为对应的部门名称
*/
Map<Long, String> selectDeptNamesByIds(List<Long> deptIds);
}

View File

@@ -1,5 +1,8 @@
package org.dromara.common.core.service;
import java.util.List;
import java.util.Map;
/**
* 通用 岗位服务
*
@@ -7,4 +10,12 @@ package org.dromara.common.core.service;
*/
public interface PostService {
/**
* 根据岗位 ID 列表查询岗位名称映射关系
*
* @param postIds 岗位 ID 列表
* @return Map其中 key 为岗位 IDvalue 为对应的岗位名称
*/
Map<Long, String> selectPostNamesByIds(List<Long> postIds);
}

View File

@@ -1,5 +1,8 @@
package org.dromara.common.core.service;
import java.util.List;
import java.util.Map;
/**
* 通用 角色服务
*
@@ -7,4 +10,12 @@ package org.dromara.common.core.service;
*/
public interface RoleService {
/**
* 根据角色 ID 列表查询角色名称映射关系
*
* @param roleIds 角色 ID 列表
* @return Map其中 key 为角色 IDvalue 为对应的角色名称
*/
Map<Long, String> selectRoleNamesByIds(List<Long> roleIds);
}

View File

@@ -100,28 +100,4 @@ public interface UserService {
*/
Map<Long, String> selectUserNamesByIds(List<Long> userIds);
/**
* 根据角色 ID 列表查询角色名称映射关系
*
* @param roleIds 角色 ID 列表
* @return Map其中 key 为角色 IDvalue 为对应的角色名称
*/
Map<Long, String> selectRoleNamesByIds(List<Long> roleIds);
/**
* 根据部门 ID 列表查询部门名称映射关系
*
* @param deptIds 部门 ID 列表
* @return Map其中 key 为部门 IDvalue 为对应的部门名称
*/
Map<Long, String> selectDeptNamesByIds(List<Long> deptIds);
/**
* 根据岗位 ID 列表查询岗位名称映射关系
*
* @param postIds 岗位 ID 列表
* @return Map其中 key 为岗位 IDvalue 为对应的岗位名称
*/
Map<Long, String> selectPostNamesByIds(List<Long> postIds);
}

View File

@@ -20,7 +20,7 @@ public interface WorkflowService {
* @param businessIds 业务id
* @return 结果
*/
boolean deleteInstance(List<Long> businessIds);
boolean deleteInstance(List<String> businessIds);
/**
* 获取当前流程状态
@@ -61,13 +61,6 @@ public interface WorkflowService {
*/
Long getInstanceIdByBusinessId(String businessId);
/**
* 新增租户流程定义
*
* @param tenantId 租户id
*/
void syncDef(String tenantId);
/**
* 启动流程
*
@@ -82,6 +75,7 @@ public interface WorkflowService {
* completeTask.getVariables().put("ignore", true);
*
* @param completeTask 参数
* @return 结果
*/
boolean completeTask(CompleteTaskDTO completeTask);
@@ -90,6 +84,15 @@ public interface WorkflowService {
*
* @param taskId 任务ID
* @param message 办理意见
* @return 结果
*/
boolean completeTask(Long taskId, String message);
/**
* 启动流程并办理第一个任务
*
* @param startProcess 参数
* @return 结果
*/
boolean startCompleteTask(StartProcessDTO startProcess);
}

View File

@@ -1,5 +1,7 @@
package org.dromara.common.core.utils;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.dromara.common.core.enums.FormatsType;
import org.dromara.common.core.exception.ServiceException;
@@ -293,8 +295,84 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
// 校验时间跨度不超过最大限制
if (diff > maxValue) {
throw new ServiceException("最大时间跨度为 " + maxValue + " " + unit.toString().toLowerCase());
throw new ServiceException("最大时间跨度为 {} {}", maxValue, unit.toString().toLowerCase());
}
}
/**
* 根据指定日期时间获取时间段(凌晨 / 上午 / 中午 / 下午 / 晚上)
*
* @param date 日期时间
* @return 时间段描述
*/
public static String getTodayHour(Date date) {
int hour = DateUtil.hour(date, true);
if (hour <= 6) {
return "凌晨";
} else if (hour < 12) {
return "上午";
} else if (hour == 12) {
return "中午";
} else if (hour <= 18) {
return "下午";
} else {
return "晚上";
}
}
/**
* 将日期格式化为仿微信的友好时间
* <p>
* 规则说明:
* 1. 未来时间yyyy-MM-dd HH:mm
* 2. 今天:
* - 1 分钟内:刚刚
* - 1 小时内X 分钟前
* - 超过 1 小时:凌晨/上午/中午/下午/晚上 HH:mm
* 3. 昨天:昨天 HH:mm
* 4. 本周周X HH:mm
* 5. 今年内MM-dd HH:mm
* 6. 非今年yyyy-MM-dd HH:mm
*
* @param date 日期时间
* @return 格式化后的时间描述
*/
public static String formatFriendlyTime(Date date) {
if (date == null) {
return "";
}
Date now = DateUtil.date();
// 未来时间或非今年
if (date.after(now) || DateUtil.year(date) != DateUtil.year(now)) {
return parseDateToStr(FormatsType.YYYY_MM_DD_HH_MM, date);
}
// 今天
if (DateUtil.isSameDay(date, now)) {
long minutes = DateUtil.between(date, now, DateUnit.MINUTE);
if (minutes < 1) {
return "刚刚";
}
if (minutes < 60) {
return minutes + "分钟前";
}
return getTodayHour(date) + " " + DateUtil.format(date, "HH:mm");
}
// 昨天
if (DateUtil.isSameDay(date, DateUtil.yesterday())) {
return "昨天 " + DateUtil.format(date, "HH:mm");
}
// 本周
if (DateUtil.isSameWeek(date, now, true)) {
return DateUtil.dayOfWeekEnum(date).toChinese("")
+ " " + DateUtil.format(date, "HH:mm");
}
// 今年内其它时间
return DateUtil.format(date, "MM-dd HH:mm");
}
}

View File

@@ -0,0 +1,87 @@
package org.dromara.common.core.utils;
import cn.hutool.core.util.DesensitizedUtil;
import cn.hutool.core.util.StrUtil;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
/**
* 脱敏工具类
*
* @author AprilWind
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class DesensitizedUtils extends DesensitizedUtil {
/**
* 灵活脱敏方法
*
* @param value 原始字符串
* @param prefixVisible 前面可见长度
* @param suffixVisible 后面可见长度
* @param maskLength 中间掩码长度(固定显示多少 *,如果总长度不足则自动缩减)
* @return 脱敏后字符串
*/
public static String mask(String value, int prefixVisible, int suffixVisible, int maskLength) {
if (StrUtil.isBlank(value)) {
return value;
}
int len = value.length();
int prefixMaskLimit = prefixVisible + maskLength;
int fullLimit = prefixMaskLimit + suffixVisible;
// 规则 1长度 <= 中间掩码长度 → 全掩码
if (len <= maskLength) {
return StrUtil.repeat('*', len);
}
String mask = StrUtil.repeat('*', maskLength);
// 规则 2长度 <= 前缀 + 中间掩码
if (len <= prefixMaskLimit) {
return value.substring(0, len - maskLength) + mask;
}
String prefix = value.substring(0, prefixVisible);
// 规则 3长度 <= 前缀 + 中间掩码 + 后缀
if (len <= fullLimit) {
int suffixLen = len - prefixMaskLimit;
return prefix + mask + value.substring(len - suffixLen);
}
// 规则 4标准形态
return prefix + mask + value.substring(len - suffixVisible);
}
/**
* 高安全级别脱敏方法Token / 私钥)
*
* @param value 原始字符串
* @param prefixVisible 前面可见长度推荐0~4
* @param suffixVisible 后面可见长度推荐0~4
* @return 脱敏后字符串
*/
public static String maskHighSecurity(String value, int prefixVisible, int suffixVisible) {
if (StrUtil.isBlank(value)) {
return value;
}
int len = value.length();
// 规则1长度 <= 前缀可见长度 → 全部掩码
if (len <= prefixVisible) {
return StrUtil.repeat('*', len);
}
// 规则2长度 <= 前缀 + 后缀可见长度 → 优先掩码后面
if (len <= prefixVisible + suffixVisible) {
return value.substring(0, len - prefixVisible) + StrUtil.repeat('*', prefixVisible);
}
// 规则3标准形态 → 前后可见,中间全部掩码
return value.substring(0, prefixVisible)
+ StrUtil.repeat('*', len - prefixVisible - suffixVisible)
+ value.substring(len - suffixVisible);
}
}

View File

@@ -115,7 +115,7 @@ public class ServletUtils extends JakartaServletUtil {
public static Map<String, String> getParamMap(ServletRequest request) {
Map<String, String> params = new HashMap<>();
for (Map.Entry<String, String[]> entry : getParams(request).entrySet()) {
params.put(entry.getKey(), StringUtils.join(entry.getValue(), StringUtils.SEPARATOR));
params.put(entry.getKey(), StringUtils.joinComma(entry.getValue()));
}
return params;
}

View File

@@ -2,7 +2,7 @@ package org.dromara.common.core.utils;
import cn.hutool.extra.spring.SpringUtil;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.boot.autoconfigure.thread.Threading;
import org.springframework.boot.thread.Threading;
import org.springframework.context.ApplicationContext;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;

View File

@@ -7,7 +7,6 @@ import lombok.NoArgsConstructor;
import java.util.*;
import java.util.function.BiFunction;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.stream.Collectors;
@@ -31,8 +30,10 @@ public class StreamUtils {
if (CollUtil.isEmpty(collection)) {
return CollUtil.newArrayList();
}
// 注意此处不要使用 .toList() 新语法 因为返回的是不可变List 会导致序列化问题
return collection.stream().filter(function).collect(Collectors.toList());
return collection.stream()
.filter(function)
// 注意此处不要使用 .toList() 新语法 因为返回的是不可变List 会导致序列化问题
.collect(Collectors.toList());
}
/**
@@ -40,13 +41,26 @@ public class StreamUtils {
*
* @param collection 需要查询的集合
* @param function 过滤方法
* @return 找到符合条件的第一个元素,没有则返回null
* @return 找到符合条件的第一个元素,没有则返回 Optional.empty()
*/
public static <E> E findFirst(Collection<E> collection, Predicate<E> function) {
public static <E> Optional<E> findFirst(Collection<E> collection, Predicate<E> function) {
if (CollUtil.isEmpty(collection)) {
return null;
return Optional.empty();
}
return collection.stream().filter(function).findFirst().orElse(null);
return collection.stream()
.filter(function)
.findFirst();
}
/**
* 找到流中满足条件的第一个元素值
*
* @param collection 需要查询的集合
* @param function 过滤方法
* @return 找到符合条件的第一个元素,没有则返回 null
*/
public static <E> E findFirstValue(Collection<E> collection, Predicate<E> function) {
return findFirst(collection,function).orElse(null);
}
/**
@@ -54,13 +68,26 @@ public class StreamUtils {
*
* @param collection 需要查询的集合
* @param function 过滤方法
* @return 找到符合条件的任意一个元素,没有则返回null
* @return 找到符合条件的任意一个元素,没有则返回 Optional.empty()
*/
public static <E> Optional<E> findAny(Collection<E> collection, Predicate<E> function) {
if (CollUtil.isEmpty(collection)) {
return Optional.empty();
}
return collection.stream().filter(function).findAny();
return collection.stream()
.filter(function)
.findAny();
}
/**
* 找到流中任意一个满足条件的元素值
*
* @param collection 需要查询的集合
* @param function 过滤方法
* @return 找到符合条件的任意一个元素没有则返回null
*/
public static <E> E findAnyValue(Collection<E> collection, Predicate<E> function) {
return findAny(collection,function).orElse(null);
}
/**
@@ -86,7 +113,10 @@ public class StreamUtils {
if (CollUtil.isEmpty(collection)) {
return StringUtils.EMPTY;
}
return collection.stream().map(function).filter(Objects::nonNull).collect(Collectors.joining(delimiter));
return collection.stream()
.map(function)
.filter(Objects::nonNull)
.collect(Collectors.joining(delimiter));
}
/**
@@ -100,8 +130,11 @@ public class StreamUtils {
if (CollUtil.isEmpty(collection)) {
return CollUtil.newArrayList();
}
// 注意此处不要使用 .toList() 新语法 因为返回的是不可变List 会导致序列化问题
return collection.stream().filter(Objects::nonNull).sorted(comparing).collect(Collectors.toList());
return collection.stream()
.filter(Objects::nonNull)
.sorted(comparing)
// 注意此处不要使用 .toList() 新语法 因为返回的是不可变List 会导致序列化问题
.collect(Collectors.toList());
}
/**
@@ -118,7 +151,9 @@ public class StreamUtils {
if (CollUtil.isEmpty(collection)) {
return MapUtil.newHashMap();
}
return collection.stream().filter(Objects::nonNull).collect(Collectors.toMap(key, Function.identity(), (l, r) -> l));
return collection.stream()
.filter(Objects::nonNull)
.collect(Collectors.toMap(key, Function.identity(), (l, r) -> l));
}
/**
@@ -137,7 +172,25 @@ public class StreamUtils {
if (CollUtil.isEmpty(collection)) {
return MapUtil.newHashMap();
}
return collection.stream().filter(Objects::nonNull).collect(Collectors.toMap(key, value, (l, r) -> l));
return collection.stream()
.filter(Objects::nonNull)
.collect(Collectors.toMap(key, value, (l, r) -> l));
}
/**
* 获取 map 中的数据作为新 Map 的 value key 不变
* @param map 需要处理的map
* @param take 取值函数
* @param <K> map中的key类型
* @param <E> map中的value类型
* @param <V> 新map中的value类型
* @return 新的map
*/
public static <K, E, V> Map<K, V> toMap(Map<K, E> map, BiFunction<K, E, V> take) {
if (CollUtil.isEmpty(map)) {
return MapUtil.newHashMap();
}
return toMap(map.entrySet(), Map.Entry::getKey, entry -> take.apply(entry.getKey(), entry.getValue()));
}
/**
@@ -154,8 +207,8 @@ public class StreamUtils {
if (CollUtil.isEmpty(collection)) {
return MapUtil.newHashMap();
}
return collection
.stream().filter(Objects::nonNull)
return collection.stream()
.filter(Objects::nonNull)
.collect(Collectors.groupingBy(key, LinkedHashMap::new, Collectors.toList()));
}
@@ -175,8 +228,8 @@ public class StreamUtils {
if (CollUtil.isEmpty(collection)) {
return MapUtil.newHashMap();
}
return collection
.stream().filter(Objects::nonNull)
return collection.stream()
.filter(Objects::nonNull)
.collect(Collectors.groupingBy(key1, LinkedHashMap::new, Collectors.groupingBy(key2, LinkedHashMap::new, Collectors.toList())));
}
@@ -193,11 +246,11 @@ public class StreamUtils {
* @return 分类后的map
*/
public static <E, T, U> Map<T, Map<U, E>> group2Map(Collection<E> collection, Function<E, T> key1, Function<E, U> key2) {
if (CollUtil.isEmpty(collection) || key1 == null || key2 == null) {
if (CollUtil.isEmpty(collection)) {
return MapUtil.newHashMap();
}
return collection
.stream().filter(Objects::nonNull)
return collection.stream()
.filter(Objects::nonNull)
.collect(Collectors.groupingBy(key1, LinkedHashMap::new, Collectors.toMap(key2, Function.identity(), (l, r) -> l)));
}
@@ -215,8 +268,7 @@ public class StreamUtils {
if (CollUtil.isEmpty(collection)) {
return CollUtil.newArrayList();
}
return collection
.stream()
return collection.stream()
.map(function)
.filter(Objects::nonNull)
// 注意此处不要使用 .toList() 新语法 因为返回的是不可变List 会导致序列化问题
@@ -234,11 +286,10 @@ public class StreamUtils {
* @return 转化后的Set
*/
public static <E, T> Set<T> toSet(Collection<E> collection, Function<E, T> function) {
if (CollUtil.isEmpty(collection) || function == null) {
if (CollUtil.isEmpty(collection)) {
return CollUtil.newHashSet();
}
return collection
.stream()
return collection.stream()
.map(function)
.filter(Objects::nonNull)
.collect(Collectors.toSet());
@@ -258,26 +309,20 @@ public class StreamUtils {
* @return 合并后的map
*/
public static <K, X, Y, V> Map<K, V> merge(Map<K, X> map1, Map<K, Y> map2, BiFunction<X, Y, V> merge) {
if (MapUtil.isEmpty(map1) && MapUtil.isEmpty(map2)) {
if (CollUtil.isEmpty(map1) && CollUtil.isEmpty(map2)) {
// 如果两个 map 都为空,则直接返回空的 map
return MapUtil.newHashMap();
} else if (MapUtil.isEmpty(map1)) {
map1 = MapUtil.newHashMap();
} else if (MapUtil.isEmpty(map2)) {
map2 = MapUtil.newHashMap();
} else if (CollUtil.isEmpty(map1)) {
// 如果 map1 为空,则直接处理返回 map2
return toMap(map2.entrySet(), Map.Entry::getKey, entry -> merge.apply(null, entry.getValue()));
} else if (CollUtil.isEmpty(map2)) {
// 如果 map2 为空,则直接处理返回 map1
return toMap(map1.entrySet(), Map.Entry::getKey, entry -> merge.apply(entry.getValue(), null));
}
Set<K> key = new HashSet<>();
key.addAll(map1.keySet());
key.addAll(map2.keySet());
Map<K, V> map = new HashMap<>();
for (K t : key) {
X x = map1.get(t);
Y y = map2.get(t);
V z = merge.apply(x, y);
if (z != null) {
map.put(t, z);
}
}
return map;
Set<K> keySet = new HashSet<>();
keySet.addAll(map1.keySet());
keySet.addAll(map2.keySet());
return toMap(keySet, key -> key, key -> merge.apply(map1.get(key), map2.get(key)));
}
}

View File

@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.lang.Validator;
import cn.hutool.core.util.StrUtil;
import org.apache.commons.lang3.Strings;
import org.springframework.util.AntPathMatcher;
import java.nio.charset.Charset;
@@ -260,13 +261,13 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
if (s != null) {
final int len = s.length();
if (s.length() <= size) {
sb.append(String.valueOf(c).repeat(size - len));
sb.append(Convert.toStr(c).repeat(size - len));
sb.append(s);
} else {
return s.substring(len - size, len);
}
} else {
sb.append(String.valueOf(c).repeat(Math.max(0, size)));
sb.append(Convert.toStr(c).repeat(Math.max(0, size)));
}
return sb.toString();
}
@@ -333,7 +334,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
public static boolean startWithAnyIgnoreCase(CharSequence str, CharSequence... prefixs) {
// 判断是否是以指定字符串开头
for (CharSequence prefix : prefixs) {
if (StringUtils.startsWithIgnoreCase(str, prefix)) {
if (Strings.CI.startsWith(str, prefix)) {
return true;
}
}
@@ -361,5 +362,91 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
return input;
}
}
/**
* 将可迭代对象中的元素使用逗号拼接成字符串
*
* @param iterable 可迭代对象,如 List、Set 等
* @return 拼接后的字符串
*/
public static String joinComma(Iterable<?> iterable) {
return StringUtils.join(iterable, SEPARATOR);
}
/**
* 将数组中的元素使用逗号拼接成字符串
*
* @param array 任意类型的数组
* @return 拼接后的字符串
*/
public static String joinComma(Object[] array) {
return StringUtils.join(array, SEPARATOR);
}
/**
* 判断两个字符串是否相等
*
* @param cs1 字符串1
* @param cs2 字符串2
* @return 是否相等
*/
public static boolean equals(final CharSequence cs1, final CharSequence cs2) {
return Strings.CS.equals(cs1, cs2);
}
/**
* 判断字符串是否在指定的字符串列表中
*
* @param string 字符串
* @param searchStrings 字符串列表
* @return 是否在列表中
*/
public static boolean equalsAny(final CharSequence string, final CharSequence... searchStrings) {
return Strings.CS.equalsAny(string, searchStrings);
}
/**
* 忽略大小写判断字符串是否在指定的字符串列表中
*
* @param string 字符串
* @param searchStrings 字符串列表
* @return 是否在列表中
*/
public static boolean equalsAnyIgnoreCase(final CharSequence string, final CharSequence... searchStrings) {
return Strings.CI.equalsAny(string, searchStrings);
}
/**
* 忽略大小写判断两个字符串是否相等
*
* @param cs1 字符串1
* @param cs2 字符串2
* @return 是否相等
*/
public static boolean equalsIgnoreCase(final CharSequence cs1, final CharSequence cs2) {
return Strings.CI.equals(cs1, cs2);
}
/**
* 检查指定的字符序列中是否包含另一个字符序列。
*
* @param seq 要检查的字符序列不能为null
* @param searchSeq 要搜索的字符序列不能为null
* @return 如果seq中包含searchSeq则返回true否则返回false
*/
public static boolean contains(final CharSequence seq, final CharSequence searchSeq) {
return Strings.CS.contains(seq, searchSeq);
}
/**
* 移除字符串中的指定字符序列。
*
* @param str 要处理的字符串不能为null
* @param remove 要移除的字符序列不能为null
* @return 处理后的字符串
*/
public static String remove(final String str, final String remove) {
return Strings.CS.remove(str, remove);
}
}

View File

@@ -0,0 +1,36 @@
package org.dromara.common.core.utils;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.*;
/**
* 线程工具
*
* @author Lion Li
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class ThreadUtils {
/**
* 批量执行任务
*/
public static void virtualSubmit(Runnable ...runnableList) {
List<Future<?>> callableList = new ArrayList<>();
try (ExecutorService executor = Executors.newVirtualThreadPerTaskExecutor()) {
for (Runnable runnable : runnableList) {
callableList.add(executor.submit(runnable));
}
for (Future<?> future : callableList) {
future.get();
}
} catch (InterruptedException | ExecutionException e) {
throw new RuntimeException(e);
}
}
}

View File

@@ -1,63 +0,0 @@
package org.dromara.common.core.utils;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import java.util.concurrent.*;
/**
* 线程相关工具类.
*
* @author ruoyi
*/
@Slf4j
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class Threads {
/**
* 停止线程池
* 先使用shutdown, 停止接收新任务并尝试完成所有已存在任务.
* 如果超时, 则调用shutdownNow, 取消在workQueue中Pending的任务,并中断所有阻塞函数.
* 如果仍然超時,則強制退出.
* 另对在shutdown时线程本身被调用中断做了处理.
*/
public static void shutdownAndAwaitTermination(ExecutorService pool) {
if (pool != null && !pool.isShutdown()) {
pool.shutdown();
try {
if (!pool.awaitTermination(120, TimeUnit.SECONDS)) {
pool.shutdownNow();
if (!pool.awaitTermination(120, TimeUnit.SECONDS)) {
log.info("Pool did not terminate");
}
}
} catch (InterruptedException ie) {
pool.shutdownNow();
Thread.currentThread().interrupt();
}
}
}
/**
* 打印线程异常信息
*/
public static void printException(Runnable r, Throwable t) {
if (t == null && r instanceof Future<?>) {
try {
Future<?> future = (Future<?>) r;
if (future.isDone()) {
future.get();
}
} catch (CancellationException ce) {
t = ce;
} catch (ExecutionException ee) {
t = ee.getCause();
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
}
}
if (t != null) {
log.error(t.getMessage(), t);
}
}
}

View File

@@ -10,6 +10,8 @@ import lombok.NoArgsConstructor;
import org.dromara.common.core.utils.reflect.ReflectUtils;
import java.util.List;
import java.util.Set;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@@ -60,6 +62,31 @@ public class TreeBuildUtils extends TreeUtil {
return TreeUtil.build(list, parentId, DEFAULT_CONFIG, nodeParser);
}
/**
* 构建多根节点的树结构(支持多个顶级节点)
*
* @param list 原始数据列表
* @param getId 获取节点 ID 的方法引用例如node -> node.getId()
* @param getParentId 获取节点父级 ID 的方法引用例如node -> node.getParentId()
* @param parser 树节点属性映射器,用于将原始节点 T 转为 Tree 节点
* @param <T> 原始数据类型如实体类、DTO 等)
* @param <K> 节点 ID 类型(如 Long、String
* @return 构建完成的树形结构(可能包含多个顶级根节点)
*/
public static <T, K> List<Tree<K>> buildMultiRoot(List<T> list, Function<T, K> getId, Function<T, K> getParentId, NodeParser<T, K> parser) {
if (CollUtil.isEmpty(list)) {
return CollUtil.newArrayList();
}
Set<K> rootParentIds = StreamUtils.toSet(list, getParentId);
rootParentIds.removeAll(StreamUtils.toSet(list, getId));
// 构建每一个根 parentId 下的树,并合并成最终结果列表
return rootParentIds.stream()
.flatMap(rootParentId -> TreeUtil.build(list, rootParentId, parser).stream())
.collect(Collectors.toList());
}
/**
* 获取节点列表中所有节点的叶子节点
*

View File

@@ -16,28 +16,28 @@ import org.dromara.common.core.utils.StringUtils;
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class AddressUtils {
// 未知地址
public static final String UNKNOWN = "XX XX";
// 未知IP
public static final String UNKNOWN_IP = "XX XX";
// 内网地址
public static final String LOCAL_ADDRESS = "内网IP";
public static String getRealAddressByIP(String ip) {
// 处理空串并过滤HTML标签
ip = HtmlUtil.cleanHtmlTag(StringUtils.blankToDefault(ip,""));
// 判断是否为IPv4
boolean isIPv4 = NetUtils.isIPv4(ip);
// 判断是否为IPv6
boolean isIPv6 = NetUtils.isIPv6(ip);
// 判断是否为IPv4或IPv6如果不是则返回未知地址
if (!NetUtils.isIPv4(ip) && !isIPv6) {
return UNKNOWN;
// 如果不是IPv4或IPv6则返回未知IP
if (!isIPv4 && !isIPv6) {
return UNKNOWN_IP;
}
// 内网不查询
if (NetUtils.isInnerIPv6(ip) || NetUtils.isInnerIP(ip)) {
return "内网IP";
if ((isIPv4 && NetUtils.isInnerIP(ip)) || (isIPv6 && NetUtils.isInnerIPv6(ip))) {
return LOCAL_ADDRESS;
}
// 不支持IPv6不再进行没有必要的IP地址信息的解析直接返回
if (isIPv6) {
log.warn("ip2region不支持IPV6地址解析{}", ip);
// 如有需要可自行实现IPv6地址信息解析逻辑并在这里返回
return "未知";
}
return RegionUtils.getCityInfo(ip);
// TipsIp2Region 提供了精简的IPv6地址库精简的IPv6地址库并不能完全支持IPv6地址的查询且准确度上可能会存在问题如需要准确的IPv6地址查询建议自行实现
return RegionUtils.getRegion(ip);
}
}

View File

@@ -1,50 +1,154 @@
package org.dromara.common.core.utils.ip;
import cn.hutool.core.io.resource.NoResourceException;
import cn.hutool.core.io.resource.ResourceUtil;
import lombok.extern.slf4j.Slf4j;
import org.dromara.common.core.exception.ServiceException;
import org.dromara.common.core.utils.StringUtils;
import org.lionsoul.ip2region.xdb.Searcher;
import org.lionsoul.ip2region.service.Config;
import org.lionsoul.ip2region.service.Ip2Region;
import org.lionsoul.ip2region.xdb.Util;
import java.io.InputStream;
import java.time.Duration;
/**
* 根据ip地址定位工具类离线方式
* 参考地址:<a href="https://gitee.com/lionsoul/ip2region/tree/master/binding/java">集成 ip2region 实现离线IP地址定位库</a>
* IP地址行政区域工具类
* 参考地址:<a href="https://gitee.com/lionsoul/ip2region/tree/master/binding/java">ip2region xdb java 查询客户端实现</a>
* xdb数据库文件下载<a href="https://gitee.com/lionsoul/ip2region/tree/master/data">ip2region data</a>
*
* @author lishuyan
* @author 秋辞未寒
*/
@Slf4j
public class RegionUtils {
// IP地址库文件名称
public static final String IP_XDB_FILENAME = "ip2region.xdb";
// 默认IPv4地址库文件路径
// 下载地址https://gitee.com/lionsoul/ip2region/blob/master/data/ip2region_v4.xdb
public static final String DEFAULT_IPV4_XDB_PATH = "ip2region_v4.xdb";
private static final Searcher SEARCHER;
// 默认IPv6地址库文件路径
// 下载地址https://gitee.com/lionsoul/ip2region/blob/master/data/ip2region_v6.xdb
public static final String DEFAULT_IPV6_XDB_PATH = "ip2region_v6.xdb";
// 默认缓存切片大小为15MB仅针对BufferCache全量读取有效如果你的xdb数据库很大合理设置该值可以有效提升BufferCache模式下的查询效率具体可以查看Ip2Region的README
// 注意设置过大的值可能会申请内存时因内存不足而导致OOM请合理设置该值。
// READMEhttps://gitee.com/lionsoul/ip2region/tree/master/binding/java
public static final int DEFAULT_CACHE_SLICE_BYTES = 1024 * 1024 * 15;
// 未知地址
public static final String UNKNOWN_ADDRESS = "未知";
// Ip2Region服务实例
private static Ip2Region ip2Region;
// 初始化Ip2Region服务实例
static {
try {
// 1、将 ip2region 数据库文件 xdb 从 ClassPath 加载到内存。
// 2、基于加载到内存的 xdb 数据创建一个 Searcher 查询对象
SEARCHER = Searcher.newWithBuffer(ResourceUtil.readBytes(IP_XDB_FILENAME));
log.info("RegionUtils初始化成功加载IP地址库数据成功");
} catch (NoResourceException e) {
throw new ServiceException("RegionUtils初始化失败原因IP地址库数据不存在");
// 注意Ip2Region 的xdb文件加载策略 CachePolicy 有三种分别是BufferCache全量读取xdb到内存中、VIndexCache默认策略按需读取并缓存、NoCache实时读取
// 本项目工具使用的 CachePolicy 为 BufferCacheBufferCache会加载整个xdb文件到内存中setXdbInputStream 仅支持 BufferCache 策略
// 因为加载整个xdb文件会耗费非常大的内存如果你不希望加载整个xdb到内存中更推荐使用 VIndexCache 或 NoCache即实时读取文件策略和 setXdbPath/setXdbFile 加载方法需要注意的一点setXdbPath 和 setXdbFile 不支持读取ClassPath即源码和resource目录中的文件
// 一般而言更建议把xdb数据库放到一个指定的文件目录中即不打包进jar包中然后使用 VIndexCache + 配合SearcherPool的并发池读取数据更方便随时更新xdb数据库
InputStream v4InputStream = ResourceUtil.getStream(DEFAULT_IPV4_XDB_PATH);
// IPv4配置
Config v4Config = Config.custom()
.setCachePolicy(Config.BufferCache)
//.setXdbFile(v4TempXdb)
.setXdbInputStream(v4InputStream)
//
.setCacheSliceBytes(DEFAULT_CACHE_SLICE_BYTES)
.asV4();
// IPv6配置
Config v6Config = null;
InputStream v6XdbInputStream = ResourceUtil.getStreamSafe(DEFAULT_IPV6_XDB_PATH);
if (v6XdbInputStream == null) {
log.warn("未加载 IPv6 地址库:未在类路径下找到文件 {}。当前仅启用 IPv4 查询。如需启用 IPv6请将 ip2region_v6.xdb 放置到 resources 目录", DEFAULT_IPV6_XDB_PATH);
} else {
v6Config = Config.custom()
.setCachePolicy(Config.BufferCache)
//.setXdbFile(v6TempXdb)
.setXdbInputStream(v6XdbInputStream)
.setCacheSliceBytes(DEFAULT_CACHE_SLICE_BYTES)
.asV6();
}
// 初始化Ip2Region实例
RegionUtils.ip2Region = Ip2Region.create(v4Config, v6Config);
log.debug("IP工具初始化成功加载IP地址库数据成功");
} catch (Exception e) {
throw new ServiceException("RegionUtils初始化失败原因" + e.getMessage());
throw new ServiceException("RegionUtils初始化失败原因{}", e.getMessage());
}
}
/**
* 根据IP地址离线获取城市
*
* @param ipString ip地址字符串
*/
public static String getCityInfo(String ip) {
public static String getRegion(String ipString) {
try {
// 3、执行查询
String region = SEARCHER.search(StringUtils.trim(ip));
return region.replace("0|", "").replace("|0", "");
String region = ip2Region.search(ipString);
if (StringUtils.isBlank(region)) {
return UNKNOWN_ADDRESS;
}
return StringUtils.replace(region, "0", UNKNOWN_ADDRESS);
} catch (Exception e) {
log.error("IP地址离线获取城市异常 {}", ip);
return "未知";
log.error("IP地址离线获取城市异常 {}", ipString);
return UNKNOWN_ADDRESS;
}
}
/**
* 根据IP地址离线获取城市
*
* @param ipBytes ip地址字节数组
*/
public static String getRegion(byte[] ipBytes) {
try {
String region = ip2Region.search(ipBytes);
if (StringUtils.isBlank(region)) {
return UNKNOWN_ADDRESS;
}
return StringUtils.replace(region, "0", UNKNOWN_ADDRESS);
} catch (Exception e) {
log.error("IP地址离线获取城市异常 {}", Util.ipToString(ipBytes));
return UNKNOWN_ADDRESS;
}
}
/**
* 关闭Ip2Region服务
*/
public static void close() {
if (ip2Region == null) {
return;
}
try {
ip2Region.close(10000);
} catch (Exception e) {
log.error("Ip2Region服务关闭异常", e);
}
}
/**
* 关闭Ip2Region服务
*
* @param timeout 关闭超时时间
*/
public static void close(final Duration timeout) {
if (ip2Region == null) {
return;
}
if (timeout == null) {
close();
return;
}
try {
ip2Region.close(timeout.toMillis());
} catch (Exception e) {
log.error("Ip2Region服务关闭异常", e);
}
}

View File

@@ -1,5 +1,4 @@
org.dromara.common.core.config.ApplicationConfig
org.dromara.common.core.config.AsyncConfig
org.dromara.common.core.config.ThreadPoolConfig
org.dromara.common.core.config.ValidatorConfig
org.dromara.common.core.utils.SpringUtils

View File

@@ -21,6 +21,11 @@
<artifactId>ruoyi-common-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-web-server</artifactId>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-api</artifactId>

View File

@@ -20,8 +20,8 @@ import org.springdoc.core.utils.PropertyResolverUtils;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.web.ServerProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.server.autoconfigure.ServerProperties;
import org.springframework.context.annotation.Bean;
import java.util.ArrayList;
@@ -54,14 +54,15 @@ public class SpringDocConfig {
openApi.externalDocs(properties.getExternalDocs());
openApi.tags(properties.getTags());
openApi.paths(properties.getPaths());
openApi.components(properties.getComponents());
Set<String> keySet = properties.getComponents().getSecuritySchemes().keySet();
List<SecurityRequirement> list = new ArrayList<>();
SecurityRequirement securityRequirement = new SecurityRequirement();
keySet.forEach(securityRequirement::addList);
list.add(securityRequirement);
openApi.security(list);
if (properties.getComponents() != null) {
openApi.components(properties.getComponents());
Set<String> keySet = properties.getComponents().getSecuritySchemes().keySet();
List<SecurityRequirement> list = new ArrayList<>();
SecurityRequirement securityRequirement = new SecurityRequirement();
keySet.forEach(securityRequirement::addList);
list.add(securityRequirement);
openApi.security(list);
}
return openApi;
}

View File

@@ -39,7 +39,7 @@
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-spring-boot3-starter</artifactId>
<artifactId>mybatis-plus-spring-boot4-starter</artifactId>
<optional>true</optional>
<exclusions>
<exclusion>

View File

@@ -6,6 +6,7 @@ import org.dromara.common.encrypt.properties.ApiDecryptProperties;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.FilterRegistration;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
@@ -20,13 +21,14 @@ import org.springframework.context.annotation.Bean;
public class ApiDecryptAutoConfiguration {
@Bean
public FilterRegistrationBean<CryptoFilter> cryptoFilterRegistration(ApiDecryptProperties properties) {
FilterRegistrationBean<CryptoFilter> registration = new FilterRegistrationBean<>();
registration.setDispatcherTypes(DispatcherType.REQUEST);
registration.setFilter(new CryptoFilter(properties));
registration.addUrlPatterns("/*");
registration.setName("cryptoFilter");
registration.setOrder(FilterRegistrationBean.HIGHEST_PRECEDENCE);
return registration;
@FilterRegistration(
name = "cryptoFilter",
urlPatterns = "/*",
order = FilterRegistrationBean.HIGHEST_PRECEDENCE,
dispatcherTypes = DispatcherType.REQUEST
)
public CryptoFilter cryptoFilter(ApiDecryptProperties properties) {
return new CryptoFilter(properties);
}
}

View File

@@ -5,6 +5,7 @@ import cn.hutool.core.util.ReflectUtil;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.io.Resources;
import org.dromara.common.core.constant.Constants;
import org.dromara.common.core.utils.ObjectUtils;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.encrypt.annotation.EncryptField;
@@ -92,8 +93,12 @@ public class EncryptorManager {
* @param encryptContext 加密相关的配置信息
*/
public String encrypt(String value, EncryptContext encryptContext) {
if (StringUtils.startsWith(value, Constants.ENCRYPT_HEADER)) {
return value;
}
IEncryptor encryptor = this.registAndGetEncryptor(encryptContext);
return encryptor.encrypt(value, encryptContext.getEncode());
String encrypt = encryptor.encrypt(value, encryptContext.getEncode());
return Constants.ENCRYPT_HEADER + encrypt;
}
/**
@@ -103,8 +108,12 @@ public class EncryptorManager {
* @param encryptContext 加密相关的配置信息
*/
public String decrypt(String value, EncryptContext encryptContext) {
if (!StringUtils.startsWith(value, Constants.ENCRYPT_HEADER)) {
return value;
}
IEncryptor encryptor = this.registAndGetEncryptor(encryptContext);
return encryptor.decrypt(value);
String str = StringUtils.removeStart(value, Constants.ENCRYPT_HEADER);
return encryptor.decrypt(str);
}
/**

View File

@@ -5,6 +5,7 @@ import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ObjectUtil;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.executor.parameter.ParameterHandler;
import org.apache.ibatis.executor.resultset.ResultSetHandler;
import org.apache.ibatis.plugin.*;
import org.dromara.common.core.utils.StringUtils;
@@ -39,12 +40,23 @@ public class MybatisDecryptInterceptor implements Interceptor {
@Override
public Object intercept(Invocation invocation) throws Throwable {
// 开始进行参数解密
ResultSetHandler resultSetHandler = (ResultSetHandler) invocation.getTarget();
Field parameterHandlerField = resultSetHandler.getClass().getDeclaredField("parameterHandler");
parameterHandlerField.setAccessible(true);
Object target = parameterHandlerField.get(resultSetHandler);
if (target instanceof ParameterHandler parameterHandler) {
Object parameterObject = parameterHandler.getParameterObject();
if (ObjectUtil.isNotNull(parameterObject) && !(parameterObject instanceof String)) {
this.decryptHandler(parameterObject);
}
}
// 获取执行mysql执行结果
Object result = invocation.proceed();
if (result == null) {
return null;
}
decryptHandler(result);
this.decryptHandler(result);
return result;
}

View File

@@ -22,8 +22,8 @@
</dependency>
<dependency>
<groupId>cn.idev.excel</groupId>
<artifactId>fastexcel</artifactId>
<groupId>org.apache.fesod</groupId>
<artifactId>fesod-sheet</artifactId>
</dependency>
</dependencies>

View File

@@ -0,0 +1,23 @@
package org.dromara.common.excel.annotation;
import org.dromara.common.excel.core.ExcelOptionsProvider;
import java.lang.annotation.*;
/**
* Excel动态下拉选项注解
*
* @author Angus
*/
@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
public @interface ExcelDynamicOptions {
/**
* 提供者类全限定名
* <p>
* {@link org.dromara.common.excel.core.ExcelOptionsProvider} 接口实现类 class
*/
Class<? extends ExcelOptionsProvider> providerClass();
}

View File

@@ -6,17 +6,13 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* 批注
* 批注 此注解仅用于单表头 不支持多层级表头
* @author guzhouyanyu
*/
@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
public @interface ExcelNotation {
/**
* col index
*/
int index() default -1;
/**
* 批注内容
*/

View File

@@ -8,17 +8,13 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* 是否必填
* 是否必填 此注解仅用于单表头 不支持多层级表头
* @author guzhouyanyu
*/
@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
public @interface ExcelRequired {
/**
* col index
*/
int index() default -1;
/**
* 字体颜色
*/

View File

@@ -2,13 +2,13 @@ package org.dromara.common.excel.convert;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ObjectUtil;
import cn.idev.excel.converters.Converter;
import cn.idev.excel.enums.CellDataTypeEnum;
import cn.idev.excel.metadata.GlobalConfiguration;
import cn.idev.excel.metadata.data.ReadCellData;
import cn.idev.excel.metadata.data.WriteCellData;
import cn.idev.excel.metadata.property.ExcelContentProperty;
import lombok.extern.slf4j.Slf4j;
import org.apache.fesod.sheet.converters.Converter;
import org.apache.fesod.sheet.enums.CellDataTypeEnum;
import org.apache.fesod.sheet.metadata.GlobalConfiguration;
import org.apache.fesod.sheet.metadata.data.ReadCellData;
import org.apache.fesod.sheet.metadata.data.WriteCellData;
import org.apache.fesod.sheet.metadata.property.ExcelContentProperty;
import java.math.BigDecimal;
@@ -28,7 +28,7 @@ public class ExcelBigNumberConvert implements Converter<Long> {
@Override
public CellDataTypeEnum supportExcelTypeKey() {
return CellDataTypeEnum.STRING;
return null;
}
@Override

View File

@@ -3,12 +3,12 @@ package org.dromara.common.excel.convert;
import cn.hutool.core.annotation.AnnotationUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ObjectUtil;
import cn.idev.excel.converters.Converter;
import cn.idev.excel.enums.CellDataTypeEnum;
import cn.idev.excel.metadata.GlobalConfiguration;
import cn.idev.excel.metadata.data.ReadCellData;
import cn.idev.excel.metadata.data.WriteCellData;
import cn.idev.excel.metadata.property.ExcelContentProperty;
import org.apache.fesod.sheet.converters.Converter;
import org.apache.fesod.sheet.enums.CellDataTypeEnum;
import org.apache.fesod.sheet.metadata.GlobalConfiguration;
import org.apache.fesod.sheet.metadata.data.ReadCellData;
import org.apache.fesod.sheet.metadata.data.WriteCellData;
import org.apache.fesod.sheet.metadata.property.ExcelContentProperty;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.core.service.DictService;
import org.dromara.common.core.utils.SpringUtils;

View File

@@ -3,12 +3,12 @@ package org.dromara.common.excel.convert;
import cn.hutool.core.annotation.AnnotationUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ObjectUtil;
import cn.idev.excel.converters.Converter;
import cn.idev.excel.enums.CellDataTypeEnum;
import cn.idev.excel.metadata.GlobalConfiguration;
import cn.idev.excel.metadata.data.ReadCellData;
import cn.idev.excel.metadata.data.WriteCellData;
import cn.idev.excel.metadata.property.ExcelContentProperty;
import org.apache.fesod.sheet.converters.Converter;
import org.apache.fesod.sheet.enums.CellDataTypeEnum;
import org.apache.fesod.sheet.metadata.GlobalConfiguration;
import org.apache.fesod.sheet.metadata.data.ReadCellData;
import org.apache.fesod.sheet.metadata.data.WriteCellData;
import org.apache.fesod.sheet.metadata.property.ExcelContentProperty;
import org.dromara.common.core.utils.reflect.ReflectUtils;
import org.dromara.common.excel.annotation.ExcelEnumFormat;
import lombok.extern.slf4j.Slf4j;

View File

@@ -0,0 +1,217 @@
package org.dromara.common.excel.core;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ReflectUtil;
import cn.hutool.core.util.StrUtil;
import org.apache.fesod.sheet.annotation.ExcelIgnore;
import org.apache.fesod.sheet.annotation.ExcelIgnoreUnannotated;
import org.apache.fesod.sheet.annotation.ExcelProperty;
import lombok.SneakyThrows;
import org.apache.poi.ss.util.CellRangeAddress;
import org.dromara.common.core.utils.reflect.ReflectUtils;
import org.dromara.common.excel.annotation.CellMerge;
import java.lang.reflect.Field;
import java.util.*;
/**
* 单元格合并处理器
*
* @author Lion Li
*/
public class CellMergeHandler {
private final boolean hasTitle;
private int rowIndex;
private CellMergeHandler(final boolean hasTitle) {
this.hasTitle = hasTitle;
// 行合并开始下标
this.rowIndex = hasTitle ? 1 : 0;
}
private CellMergeHandler(final boolean hasTitle, final int rowIndex) {
this.hasTitle = hasTitle;
this.rowIndex = hasTitle ? rowIndex : 0;
}
@SneakyThrows
public List<CellRangeAddress> handle(List<?> rows) {
// 如果入参为空集合则返回空集
if (CollUtil.isEmpty(rows)) {
return Collections.emptyList();
}
// 获取有合并注解的字段
Map<Field, FieldColumnIndex> mergeFields = getFieldColumnIndexMap(rows.get(0).getClass());
// 如果没有需要合并的字段则返回空集
if (CollUtil.isEmpty(mergeFields)) {
return Collections.emptyList();
}
// 结果集
List<CellRangeAddress> result = new ArrayList<>();
// 生成两两合并单元格
Map<Field, RepeatCell> rowRepeatCellMap = new HashMap<>();
for (Map.Entry<Field, FieldColumnIndex> item : mergeFields.entrySet()) {
Field field = item.getKey();
FieldColumnIndex itemValue = item.getValue();
int colNum = itemValue.colIndex();
CellMerge cellMerge = itemValue.cellMerge();
for (int i = 0; i < rows.size(); i++) {
// 当前行数据
Object currentRowObj = rows.get(i);
// 当前行数据字段值
Object currentRowObjFieldVal = ReflectUtils.invokeGetter(currentRowObj, field.getName());
// 空值跳过不处理
if (currentRowObjFieldVal == null || "".equals(currentRowObjFieldVal)) {
continue;
}
// 单元格合并Map是否存在数据如果不存在则添加当前行的字段值
if (!rowRepeatCellMap.containsKey(field)) {
rowRepeatCellMap.put(field, RepeatCell.of(currentRowObjFieldVal, i));
continue;
}
// 获取 单元格合并Map 中字段值
RepeatCell repeatCell = rowRepeatCellMap.get(field);
Object cellValue = repeatCell.value();
int current = repeatCell.current();
// 检查是否满足合并条件
// currentRowObj 当前行数据
// rows.get(i - 1) 上一行数据 注:由于 if (!rowRepeatCellMap.containsKey(field)) 条件的存在,所以该 i 必不可能小于1
// cellMerge 当前行字段合并注解
boolean merge = isMerge(currentRowObj, rows.get(i - 1), cellMerge);
// 是否添加到结果集
boolean isAddResult = false;
// 最新行
int lastRow = i + rowIndex - 1;
// 如果当前行字段值和缓存中的字段值不相等,或不满足合并条件,则替换
if (!currentRowObjFieldVal.equals(cellValue) || !merge) {
rowRepeatCellMap.put(field, RepeatCell.of(currentRowObjFieldVal, i));
isAddResult = true;
}
// 如果最后一行不能合并,检查之前的数据是否需要合并;如果最后一行可以合并,则直接合并到最后
if (i == rows.size() - 1) {
isAddResult = true;
if (i > current) {
lastRow = i + rowIndex;
}
}
if (isAddResult && i > current) {
//如果是同一行,则跳过合并
if (current + rowIndex == lastRow) {
continue;
}
result.add(new CellRangeAddress(current + rowIndex, lastRow, colNum, colNum));
}
}
}
return result;
}
/**
* 获取带有合并注解的字段列索引和合并注解信息Map集
*/
private Map<Field, FieldColumnIndex> getFieldColumnIndexMap(Class<?> clazz) {
boolean annotationPresent = clazz.isAnnotationPresent(ExcelIgnoreUnannotated.class);
Field[] fields = ReflectUtils.getFields(clazz, field -> {
if ("serialVersionUID".equals(field.getName())) {
return false;
}
if (field.isAnnotationPresent(ExcelIgnore.class)) {
return false;
}
return !annotationPresent || field.isAnnotationPresent(ExcelProperty.class);
});
// 有注解的字段
Map<Field, FieldColumnIndex> mergeFields = new HashMap<>();
for (int i = 0; i < fields.length; i++) {
Field field = fields[i];
if (!field.isAnnotationPresent(CellMerge.class)) {
continue;
}
CellMerge cm = field.getAnnotation(CellMerge.class);
int index = cm.index() == -1 ? i : cm.index();
mergeFields.put(field, FieldColumnIndex.of(index, cm));
if (hasTitle) {
ExcelProperty property = field.getAnnotation(ExcelProperty.class);
rowIndex = Math.max(rowIndex, property.value().length);
}
}
return mergeFields;
}
private boolean isMerge(Object currentRow, Object preRow, CellMerge cellMerge) {
final String[] mergeBy = cellMerge.mergeBy();
if (StrUtil.isAllNotBlank(mergeBy)) {
// 比对当前行和上一行的各个属性值一一比对 如果全为真 则为真
for (String fieldName : mergeBy) {
final Object valCurrent = ReflectUtil.getFieldValue(currentRow, fieldName);
final Object valPre = ReflectUtil.getFieldValue(preRow, fieldName);
if (!Objects.equals(valPre, valCurrent)) {
// 依赖字段如有任一不等值,则标记为不可合并
return false;
}
}
}
return true;
}
/**
* 单元格合并
*/
record RepeatCell(Object value, int current) {
static RepeatCell of(Object value, int current) {
return new RepeatCell(value, current);
}
}
/**
* 字段列索引和合并注解信息
*/
record FieldColumnIndex(int colIndex, CellMerge cellMerge) {
static FieldColumnIndex of(int colIndex, CellMerge cellMerge) {
return new FieldColumnIndex(colIndex, cellMerge);
}
}
/**
* 创建一个单元格合并处理器实例
*
* @param hasTitle 是否合并标题
* @param rowIndex 行索引
* @return 单元格合并处理器
*/
public static CellMergeHandler of(final boolean hasTitle, final int rowIndex) {
return new CellMergeHandler(hasTitle, rowIndex);
}
/**
* 创建一个单元格合并处理器实例
*
* @param hasTitle 是否合并标题
* @return 单元格合并处理器
*/
public static CellMergeHandler of(final boolean hasTitle) {
return new CellMergeHandler(hasTitle);
}
/**
* 创建一个单元格合并处理器实例(默认不合并标题)
*
* @return 单元格合并处理器
*/
public static CellMergeHandler of() {
return new CellMergeHandler(false);
}
}

View File

@@ -1,25 +1,17 @@
package org.dromara.common.excel.core;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ReflectUtil;
import cn.hutool.core.util.StrUtil;
import cn.idev.excel.annotation.ExcelProperty;
import cn.idev.excel.metadata.Head;
import cn.idev.excel.write.handler.WorkbookWriteHandler;
import cn.idev.excel.write.handler.context.WorkbookWriteHandlerContext;
import cn.idev.excel.write.merge.AbstractMergeStrategy;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.apache.fesod.sheet.metadata.Head;
import org.apache.fesod.sheet.write.handler.SheetWriteHandler;
import org.apache.fesod.sheet.write.merge.AbstractMergeStrategy;
import org.apache.fesod.sheet.write.metadata.holder.WriteSheetHolder;
import org.apache.fesod.sheet.write.metadata.holder.WriteWorkbookHolder;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.util.CellRangeAddress;
import org.dromara.common.core.utils.reflect.ReflectUtils;
import org.dromara.common.excel.annotation.CellMerge;
import java.lang.reflect.Field;
import java.util.*;
import java.util.List;
/**
* 列值重复合并策略
@@ -27,137 +19,47 @@ import java.util.*;
* @author Lion Li
*/
@Slf4j
public class CellMergeStrategy extends AbstractMergeStrategy implements WorkbookWriteHandler {
public class CellMergeStrategy extends AbstractMergeStrategy implements SheetWriteHandler {
private final List<CellRangeAddress> cellList;
private final boolean hasTitle;
private int rowIndex;
public CellMergeStrategy(List<CellRangeAddress> cellList) {
this.cellList = cellList;
}
public CellMergeStrategy(List<?> list, boolean hasTitle) {
this.hasTitle = hasTitle;
// 行合并开始下标
this.rowIndex = hasTitle ? 1 : 0;
this.cellList = handle(list, hasTitle);
this.cellList = CellMergeHandler.of(hasTitle).handle(list);
}
public CellMergeStrategy(List<?> list, boolean hasTitle, int rowIndex) {
this.cellList = CellMergeHandler.of(hasTitle, rowIndex).handle(list);
}
@Override
protected void merge(Sheet sheet, Cell cell, Head head, Integer relativeRowIndex) {
//单元格写入了,遍历合并区域,如果该Cell在区域内,但非首行,则清空
if (CollUtil.isEmpty(cellList)) {
return;
}
// 单元格写入了,遍历合并区域,如果该Cell在区域内,但非首行,则清空
final int rowIndex = cell.getRowIndex();
if (CollUtil.isNotEmpty(cellList)){
for (CellRangeAddress cellAddresses : cellList) {
final int firstRow = cellAddresses.getFirstRow();
if (cellAddresses.isInRange(cell) && rowIndex != firstRow){
cell.setBlank();
}
for (CellRangeAddress cellAddresses : cellList) {
final int firstRow = cellAddresses.getFirstRow();
if (cellAddresses.isInRange(cell) && rowIndex != firstRow) {
cell.setBlank();
}
}
}
@Override
public void afterWorkbookDispose(final WorkbookWriteHandlerContext context) {
//当前表格写完后,统一写入
if (CollUtil.isNotEmpty(cellList)){
for (CellRangeAddress item : cellList) {
context.getWriteContext().writeSheetHolder().getSheet().addMergedRegion(item);
}
public void afterSheetCreate(final WriteWorkbookHolder writeWorkbookHolder, final WriteSheetHolder writeSheetHolder) {
if (CollUtil.isEmpty(cellList)) {
return;
}
// 在 Sheet 创建时提前写入合并区域;后续写入只会影响首格,不会移除合并
final Sheet sheet = writeSheetHolder.getSheet();
for (CellRangeAddress item : cellList) {
sheet.addMergedRegion(item);
}
}
@SneakyThrows
private List<CellRangeAddress> handle(List<?> list, boolean hasTitle) {
List<CellRangeAddress> cellList = new ArrayList<>();
if (CollUtil.isEmpty(list)) {
return cellList;
}
Field[] fields = ReflectUtils.getFields(list.get(0).getClass(), field -> !"serialVersionUID".equals(field.getName()));
// 有注解的字段
List<Field> mergeFields = new ArrayList<>();
List<Integer> mergeFieldsIndex = new ArrayList<>();
for (int i = 0; i < fields.length; i++) {
Field field = fields[i];
if (field.isAnnotationPresent(CellMerge.class)) {
CellMerge cm = field.getAnnotation(CellMerge.class);
mergeFields.add(field);
mergeFieldsIndex.add(cm.index() == -1 ? i : cm.index());
if (hasTitle) {
ExcelProperty property = field.getAnnotation(ExcelProperty.class);
rowIndex = Math.max(rowIndex, property.value().length);
}
}
}
Map<Field, RepeatCell> map = new HashMap<>();
// 生成两两合并单元格
for (int i = 0; i < list.size(); i++) {
for (int j = 0; j < mergeFields.size(); j++) {
Field field = mergeFields.get(j);
Object val = ReflectUtils.invokeGetter(list.get(i), field.getName());
int colNum = mergeFieldsIndex.get(j);
if (!map.containsKey(field)) {
map.put(field, new RepeatCell(val, i));
} else {
RepeatCell repeatCell = map.get(field);
Object cellValue = repeatCell.getValue();
if (cellValue == null || "".equals(cellValue)) {
// 空值跳过不合并
continue;
}
if (!cellValue.equals(val)) {
if ((i - repeatCell.getCurrent() > 1)) {
cellList.add(new CellRangeAddress(repeatCell.getCurrent() + rowIndex, i + rowIndex - 1, colNum, colNum));
}
map.put(field, new RepeatCell(val, i));
} else if (i == list.size() - 1) {
if (!isMerge(list, i, field)) {
// 如果最后一行不能合并,检查之前的数据是否需要合并
if (i - repeatCell.getCurrent() > 1) {
cellList.add(new CellRangeAddress(repeatCell.getCurrent() + rowIndex, i + rowIndex - 1, colNum, colNum));
}
} else if (i > repeatCell.getCurrent()) {
// 如果最后一行可以合并,则直接合并到最后
cellList.add(new CellRangeAddress(repeatCell.getCurrent() + rowIndex, i + rowIndex, colNum, colNum));
}
} else if (!isMerge(list, i, field)) {
if ((i - repeatCell.getCurrent() > 1)) {
cellList.add(new CellRangeAddress(repeatCell.getCurrent() + rowIndex, i + rowIndex - 1, colNum, colNum));
}
map.put(field, new RepeatCell(val, i));
}
}
}
}
return cellList;
}
private boolean isMerge(List<?> list, int i, Field field) {
boolean isMerge = true;
CellMerge cm = field.getAnnotation(CellMerge.class);
final String[] mergeBy = cm.mergeBy();
if (StrUtil.isAllNotBlank(mergeBy)) {
//比对当前list(i)和list(i - 1)的各个属性值一一比对 如果全为真 则为真
for (String fieldName : mergeBy) {
final Object valCurrent = ReflectUtil.getFieldValue(list.get(i), fieldName);
final Object valPre = ReflectUtil.getFieldValue(list.get(i - 1), fieldName);
if (!Objects.equals(valPre, valCurrent)) {
//依赖字段如有任一不等值,则标记为不可合并
isMerge = false;
}
}
}
return isMerge;
}
@Data
@AllArgsConstructor
static class RepeatCell {
private Object value;
private int current;
}
}

View File

@@ -1,10 +1,10 @@
package org.dromara.common.excel.core;
import cn.hutool.core.util.StrUtil;
import cn.idev.excel.context.AnalysisContext;
import cn.idev.excel.event.AnalysisEventListener;
import cn.idev.excel.exception.ExcelAnalysisException;
import cn.idev.excel.exception.ExcelDataConvertException;
import org.apache.fesod.sheet.context.AnalysisContext;
import org.apache.fesod.sheet.event.AnalysisEventListener;
import org.apache.fesod.sheet.exception.ExcelAnalysisException;
import org.apache.fesod.sheet.exception.ExcelDataConvertException;
import org.dromara.common.core.utils.StreamUtils;
import org.dromara.common.core.utils.ValidatorUtils;
import org.dromara.common.json.utils.JsonUtils;

View File

@@ -1,5 +1,6 @@
package org.dromara.common.excel.core;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.StrUtil;
import lombok.AllArgsConstructor;
import lombok.Data;
@@ -65,7 +66,7 @@ public class DropDownOptions {
StringBuilder stringBuffer = new StringBuilder();
String regex = "^[\\S\\d\\u4e00-\\u9fa5]+$";
for (int i = 0; i < vars.length; i++) {
String var = StrUtil.trimToEmpty(String.valueOf(vars[i]));
String var = StrUtil.trimToEmpty(Convert.toStr(vars[i]));
if (!var.matches(regex)) {
throw new ServiceException("选项数据不符合规则,仅允许使用中英文字符以及数字");
}

View File

@@ -1,16 +1,17 @@
package org.dromara.common.excel.core;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.EnumUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.idev.excel.metadata.FieldCache;
import cn.idev.excel.metadata.FieldWrapper;
import cn.idev.excel.util.ClassUtils;
import cn.idev.excel.write.handler.SheetWriteHandler;
import cn.idev.excel.write.metadata.holder.WriteSheetHolder;
import cn.idev.excel.write.metadata.holder.WriteWorkbookHolder;
import org.apache.fesod.sheet.metadata.FieldCache;
import org.apache.fesod.sheet.metadata.FieldWrapper;
import org.apache.fesod.sheet.util.ClassUtils;
import org.apache.fesod.sheet.write.handler.SheetWriteHandler;
import org.apache.fesod.sheet.write.metadata.holder.WriteSheetHolder;
import org.apache.fesod.sheet.write.metadata.holder.WriteWorkbookHolder;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddressList;
@@ -22,6 +23,7 @@ import org.dromara.common.core.utils.SpringUtils;
import org.dromara.common.core.utils.StreamUtils;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.annotation.ExcelDynamicOptions;
import org.dromara.common.excel.annotation.ExcelEnumFormat;
import java.lang.reflect.Field;
@@ -103,7 +105,7 @@ public class ExcelDownHandler implements SheetWriteHandler {
if (StringUtils.isNotBlank(dictType)) {
// 如果传递了字典名,则依据字典建立下拉
Collection<String> values = Optional.ofNullable(dictService.getAllDictByDictType(dictType))
.orElseThrow(() -> new ServiceException(String.format("字典 %s 不存在", dictType)))
.orElseThrow(() -> new ServiceException("字典 {} 不存在", dictType))
.values();
options = new ArrayList<>(values);
} else if (StringUtils.isNotBlank(converterExp)) {
@@ -115,7 +117,16 @@ public class ExcelDownHandler implements SheetWriteHandler {
// 否则如果指定了@ExcelEnumFormat则使用枚举的逻辑
ExcelEnumFormat format = field.getDeclaredAnnotation(ExcelEnumFormat.class);
List<Object> values = EnumUtil.getFieldValues(format.enumClass(), format.textField());
options = StreamUtils.toList(values, String::valueOf);
options = StreamUtils.toList(values, Convert::toStr);
} else if (field.isAnnotationPresent(ExcelDynamicOptions.class)) {
// 处理动态下拉选项
ExcelDynamicOptions dynamicOptions = field.getDeclaredAnnotation(ExcelDynamicOptions.class);
// 获取提供者实例
ExcelOptionsProvider provider = SpringUtils.getBean(dynamicOptions.providerClass());
Set<String> providerOptions = provider.getOptions();
if (CollUtil.isNotEmpty(providerOptions)) {
options = new ArrayList<>(providerOptions);
}
}
if (ObjectUtil.isNotEmpty(options)) {
// 仅当下拉可选项不为空时执行

View File

@@ -1,6 +1,6 @@
package org.dromara.common.excel.core;
import cn.idev.excel.read.listener.ReadListener;
import org.apache.fesod.sheet.read.listener.ReadListener;
/**
* Excel 导入监听

View File

@@ -0,0 +1,19 @@
package org.dromara.common.excel.core;
import java.util.Set;
/**
* Excel下拉选项数据提供接口
*
* @author Angus
*/
public interface ExcelOptionsProvider {
/**
* 获取下拉选项数据
*
* @return 下拉选项列表
*/
Set<String> getOptions();
}

View File

@@ -1,19 +1,19 @@
package org.dromara.common.excel.handler;
import cn.hutool.core.collection.CollUtil;
import cn.idev.excel.metadata.data.DataFormatData;
import cn.idev.excel.metadata.data.WriteCellData;
import cn.idev.excel.util.StyleUtil;
import cn.idev.excel.write.handler.CellWriteHandler;
import cn.idev.excel.write.handler.SheetWriteHandler;
import cn.idev.excel.write.handler.context.CellWriteHandlerContext;
import cn.idev.excel.write.metadata.holder.WriteSheetHolder;
import cn.idev.excel.write.metadata.style.WriteCellStyle;
import cn.idev.excel.write.metadata.style.WriteFont;
import org.apache.fesod.sheet.annotation.ExcelProperty;
import org.apache.fesod.sheet.metadata.data.DataFormatData;
import org.apache.fesod.sheet.metadata.data.WriteCellData;
import org.apache.fesod.sheet.util.StyleUtil;
import org.apache.fesod.sheet.write.handler.CellWriteHandler;
import org.apache.fesod.sheet.write.handler.SheetWriteHandler;
import org.apache.fesod.sheet.write.handler.context.CellWriteHandlerContext;
import org.apache.fesod.sheet.write.metadata.holder.WriteSheetHolder;
import org.apache.fesod.sheet.write.metadata.style.WriteCellStyle;
import org.apache.fesod.sheet.write.metadata.style.WriteFont;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFClientAnchor;
import org.apache.poi.xssf.usermodel.XSSFRichTextString;
import org.dromara.common.core.utils.reflect.ReflectUtils;
import org.dromara.common.excel.annotation.ExcelNotation;
import org.dromara.common.excel.annotation.ExcelRequired;
@@ -31,12 +31,12 @@ public class DataWriteHandler implements SheetWriteHandler, CellWriteHandler {
/**
* 批注
*/
private final Map<Integer, String> notationMap;
private final Map<String, String> notationMap;
/**
* 头列字体颜色
*/
private final Map<Integer, Short> headColumnMap;
private final Map<String, Short> headColumnMap;
public DataWriteHandler(Class<?> clazz) {
@@ -49,15 +49,16 @@ public class DataWriteHandler implements SheetWriteHandler, CellWriteHandler {
if (CollUtil.isEmpty(notationMap) && CollUtil.isEmpty(headColumnMap)) {
return;
}
// 第一行
WriteCellData<?> cellData = context.getFirstCellData();
// 第一个格子
WriteCellStyle writeCellStyle = cellData.getOrCreateStyle();
DataFormatData dataFormatData = new DataFormatData();
// 单元格设置为文本格式
dataFormatData.setIndex((short) 49);
writeCellStyle.setDataFormatData(dataFormatData);
if (context.getHead()) {
DataFormatData dataFormatData = new DataFormatData();
// 单元格设置为文本格式
dataFormatData.setIndex((short) 49);
writeCellStyle.setDataFormatData(dataFormatData);
Cell cell = context.getCell();
WriteSheetHolder writeSheetHolder = context.getWriteSheetHolder();
Sheet sheet = writeSheetHolder.getSheet();
@@ -67,17 +68,17 @@ public class DataWriteHandler implements SheetWriteHandler, CellWriteHandler {
WriteFont headWriteFont = new WriteFont();
// 加粗
headWriteFont.setBold(true);
if (CollUtil.isNotEmpty(headColumnMap) && headColumnMap.containsKey(cell.getColumnIndex())) {
if (CollUtil.isNotEmpty(headColumnMap) && headColumnMap.containsKey(cell.getStringCellValue())) {
// 设置字体颜色
headWriteFont.setColor(headColumnMap.get(cell.getColumnIndex()));
headWriteFont.setColor(headColumnMap.get(cell.getStringCellValue()));
}
writeCellStyle.setWriteFont(headWriteFont);
CellStyle cellStyle = StyleUtil.buildCellStyle(workbook, null, writeCellStyle);
cell.setCellStyle(cellStyle);
if (CollUtil.isNotEmpty(notationMap) && notationMap.containsKey(cell.getColumnIndex())) {
if (CollUtil.isNotEmpty(notationMap) && notationMap.containsKey(cell.getStringCellValue())) {
// 批注内容
String notationContext = notationMap.get(cell.getColumnIndex());
String notationContext = notationMap.get(cell.getStringCellValue());
// 创建绘图对象
Comment comment = drawing.createCellComment(new XSSFClientAnchor(0, 0, 0, 0, (short) cell.getColumnIndex(), 0, (short) 5, 5));
comment.setString(new XSSFRichTextString(notationContext));
@@ -89,23 +90,16 @@ public class DataWriteHandler implements SheetWriteHandler, CellWriteHandler {
/**
* 获取必填列
*/
private static Map<Integer, Short> getRequiredMap(Class<?> clazz) {
Map<Integer, Short> requiredMap = new HashMap<>();
private static Map<String, Short> getRequiredMap(Class<?> clazz) {
Map<String, Short> requiredMap = new HashMap<>();
Field[] fields = clazz.getDeclaredFields();
// 检查 fields 数组是否为空
if (fields.length == 0) {
return requiredMap;
}
Field[] filteredFields = ReflectUtils.getFields(clazz, field -> !"serialVersionUID".equals(field.getName()));
for (int i = 0; i < filteredFields.length; i++) {
Field field = filteredFields[i];
for (Field field : fields) {
if (!field.isAnnotationPresent(ExcelRequired.class)) {
continue;
}
ExcelRequired excelRequired = field.getAnnotation(ExcelRequired.class);
int columnIndex = excelRequired.index() == -1 ? i : excelRequired.index();
requiredMap.put(columnIndex, excelRequired.fontColor().getIndex());
ExcelProperty excelProperty = field.getAnnotation(ExcelProperty.class);
requiredMap.put(excelProperty.value()[0], excelRequired.fontColor().getIndex());
}
return requiredMap;
}
@@ -113,22 +107,16 @@ public class DataWriteHandler implements SheetWriteHandler, CellWriteHandler {
/**
* 获取批注
*/
private static Map<Integer, String> getNotationMap(Class<?> clazz) {
Map<Integer, String> notationMap = new HashMap<>();
private static Map<String, String> getNotationMap(Class<?> clazz) {
Map<String, String> notationMap = new HashMap<>();
Field[] fields = clazz.getDeclaredFields();
// 检查 fields 数组是否为空
if (fields.length == 0) {
return notationMap;
}
Field[] filteredFields = ReflectUtils.getFields(clazz, field -> !"serialVersionUID".equals(field.getName()));
for (int i = 0; i < filteredFields.length; i++) {
Field field = filteredFields[i];
for (Field field : fields) {
if (!field.isAnnotationPresent(ExcelNotation.class)) {
continue;
}
ExcelNotation excelNotation = field.getAnnotation(ExcelNotation.class);
int columnIndex = excelNotation.index() == -1 ? i : excelNotation.index();
notationMap.put(columnIndex, excelNotation.value());
ExcelProperty excelProperty = field.getAnnotation(ExcelProperty.class);
notationMap.put(excelProperty.value()[0], excelNotation.value());
}
return notationMap;
}

View File

@@ -3,13 +3,13 @@ package org.dromara.common.excel.utils;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.io.resource.ClassPathResource;
import cn.hutool.core.util.IdUtil;
import cn.idev.excel.FastExcel;
import cn.idev.excel.ExcelWriter;
import cn.idev.excel.write.builder.ExcelWriterSheetBuilder;
import cn.idev.excel.write.metadata.WriteSheet;
import cn.idev.excel.write.metadata.fill.FillConfig;
import cn.idev.excel.write.metadata.fill.FillWrapper;
import cn.idev.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
import org.apache.fesod.sheet.FesodSheet;
import org.apache.fesod.sheet.ExcelWriter;
import org.apache.fesod.sheet.write.builder.ExcelWriterSheetBuilder;
import org.apache.fesod.sheet.write.metadata.WriteSheet;
import org.apache.fesod.sheet.write.metadata.fill.FillConfig;
import org.apache.fesod.sheet.write.metadata.fill.FillWrapper;
import org.apache.fesod.sheet.write.style.column.LongestMatchColumnWidthStyleStrategy;
import jakarta.servlet.ServletOutputStream;
import jakarta.servlet.http.HttpServletResponse;
import lombok.AccessLevel;
@@ -27,6 +27,7 @@ import java.io.UnsupportedEncodingException;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.function.Consumer;
/**
* Excel相关处理
@@ -43,7 +44,7 @@ public class ExcelUtil {
* @return 转换后集合
*/
public static <T> List<T> importExcel(InputStream is, Class<T> clazz) {
return FastExcel.read(is).head(clazz).autoCloseStream(false).sheet().doReadSync();
return FesodSheet.read(is).head(clazz).autoCloseStream(false).sheet().doReadSync();
}
@@ -57,7 +58,7 @@ public class ExcelUtil {
*/
public static <T> ExcelResult<T> importExcel(InputStream is, Class<T> clazz, boolean isValidate) {
DefaultExcelListener<T> listener = new DefaultExcelListener<>(isValidate);
FastExcel.read(is, clazz, listener).sheet().doRead();
FesodSheet.read(is, clazz, listener).sheet().doRead();
return listener.getExcelResult();
}
@@ -70,7 +71,7 @@ public class ExcelUtil {
* @return 转换后集合
*/
public static <T> ExcelResult<T> importExcel(InputStream is, Class<T> clazz, ExcelListener<T> listener) {
FastExcel.read(is, clazz, listener).sheet().doRead();
FesodSheet.read(is, clazz, listener).sheet().doRead();
return listener.getExcelResult();
}
@@ -186,7 +187,7 @@ public class ExcelUtil {
*/
public static <T> void exportExcel(List<T> list, String sheetName, Class<T> clazz, boolean merge,
OutputStream os, List<DropDownOptions> options) {
ExcelWriterSheetBuilder builder = FastExcel.write(os, clazz)
ExcelWriterSheetBuilder builder = FesodSheet.write(os, clazz)
.autoCloseStream(false)
// 自动适配
.registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
@@ -203,6 +204,44 @@ public class ExcelUtil {
builder.doWrite(list);
}
/**
* 导出excel
*
* @param headType 带Excel注解的类型
* @param os 输出流
* @param options Excel下拉可选项
* @param consumer 导出助手消费函数
*/
public static <T> void exportExcel(Class<T> headType, OutputStream os, List<DropDownOptions> options, Consumer<ExcelWriterWrapper<T>> consumer) {
try (ExcelWriter writer = FesodSheet.write(os, headType)
.autoCloseStream(false)
// 自动适配
.registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
// 大数值自动转换 防止失真
.registerConverter(new ExcelBigNumberConvert())
// 批注必填项处理
.registerWriteHandler(new DataWriteHandler(headType))
// 添加下拉框操作
.registerWriteHandler(new ExcelDownHandler(options))
.build()) {
// 执行消费函数
consumer.accept(ExcelWriterWrapper.of(writer));
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* 导出excel
*
* @param headType 带Excel注解的类型
* @param os 输出流
* @param consumer 导出助手消费函数
*/
public static <T> void exportExcel(Class<T> headType, OutputStream os, Consumer<ExcelWriterWrapper<T>> consumer) {
exportExcel(headType, os, null, consumer);
}
/**
* 单表多数据模板导出 模板格式为 {.属性}
*
@@ -237,14 +276,14 @@ public class ExcelUtil {
*/
public static <T> void exportTemplate(List<T> data, String templatePath, OutputStream os) {
ClassPathResource templateResource = new ClassPathResource(templatePath);
ExcelWriter excelWriter = FastExcel.write(os)
ExcelWriter excelWriter = FesodSheet.write(os)
.withTemplate(templateResource.getStream())
.autoCloseStream(false)
// 大数值自动转换 防止失真
.registerConverter(new ExcelBigNumberConvert())
.registerWriteHandler(new DataWriteHandler(data.get(0).getClass()))
.registerWriteHandler(new DataWriteHandler(data.getFirst().getClass()))
.build();
WriteSheet writeSheet = FastExcel.writerSheet().build();
WriteSheet writeSheet = FesodSheet.writerSheet().build();
FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();
// 单表多数据导出 模板格式为 {.属性}
for (T d : data) {
@@ -310,13 +349,13 @@ public class ExcelUtil {
*/
public static void exportTemplateMultiList(Map<String, Object> data, String templatePath, OutputStream os) {
ClassPathResource templateResource = new ClassPathResource(templatePath);
ExcelWriter excelWriter = FastExcel.write(os)
ExcelWriter excelWriter = FesodSheet.write(os)
.withTemplate(templateResource.getStream())
.autoCloseStream(false)
// 大数值自动转换 防止失真
.registerConverter(new ExcelBigNumberConvert())
.build();
WriteSheet writeSheet = FastExcel.writerSheet().build();
WriteSheet writeSheet = FesodSheet.writerSheet().build();
for (Map.Entry<String, Object> map : data.entrySet()) {
// 设置列表后续还有数据
FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();
@@ -341,14 +380,14 @@ public class ExcelUtil {
*/
public static void exportTemplateMultiSheet(List<Map<String, Object>> data, String templatePath, OutputStream os) {
ClassPathResource templateResource = new ClassPathResource(templatePath);
ExcelWriter excelWriter = FastExcel.write(os)
ExcelWriter excelWriter = FesodSheet.write(os)
.withTemplate(templateResource.getStream())
.autoCloseStream(false)
// 大数值自动转换 防止失真
.registerConverter(new ExcelBigNumberConvert())
.build();
for (int i = 0; i < data.size(); i++) {
WriteSheet writeSheet = FastExcel.writerSheet(i).build();
WriteSheet writeSheet = FesodSheet.writerSheet(i).build();
for (Map.Entry<String, Object> map : data.get(i).entrySet()) {
// 设置列表后续还有数据
FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();
@@ -388,7 +427,7 @@ public class ExcelUtil {
if (StringUtils.containsAny(propertyValue, separator)) {
for (String value : propertyValue.split(separator)) {
if (itemArray[0].equals(value)) {
propertyString.append(itemArray[1] + separator);
propertyString.append(itemArray[1]).append(separator);
break;
}
}
@@ -417,7 +456,7 @@ public class ExcelUtil {
if (StringUtils.containsAny(propertyValue, separator)) {
for (String value : propertyValue.split(separator)) {
if (itemArray[1].equals(value)) {
propertyString.append(itemArray[0] + separator);
propertyString.append(itemArray[0]).append(separator);
break;
}
}

View File

@@ -0,0 +1,127 @@
package org.dromara.common.excel.utils;
import org.apache.fesod.sheet.ExcelWriter;
import org.apache.fesod.sheet.FesodSheet;
import org.apache.fesod.sheet.context.WriteContext;
import org.apache.fesod.sheet.write.builder.ExcelWriterSheetBuilder;
import org.apache.fesod.sheet.write.builder.ExcelWriterTableBuilder;
import org.apache.fesod.sheet.write.metadata.WriteSheet;
import org.apache.fesod.sheet.write.metadata.WriteTable;
import org.apache.fesod.sheet.write.metadata.fill.FillConfig;
import java.util.Collection;
import java.util.function.Supplier;
/**
* ExcelWriterWrapper Excel写出包装器
* <br>
* 提供了一组与 ExcelWriter 一一对应的写出方法,避免直接提供 ExcelWriter 而导致的一些不可控问题比如提前关闭了IO流等
*
* @author 秋辞未寒
* @see ExcelWriter
*/
public record ExcelWriterWrapper<T>(ExcelWriter excelWriter) {
public void write(Collection<T> data, WriteSheet writeSheet) {
excelWriter.write(data, writeSheet);
}
public void write(Supplier<Collection<T>> supplier, WriteSheet writeSheet) {
excelWriter.write(supplier.get(), writeSheet);
}
public void write(Collection<T> data, WriteSheet writeSheet, WriteTable writeTable) {
excelWriter.write(data, writeSheet, writeTable);
}
public void write(Supplier<Collection<T>> supplier, WriteSheet writeSheet, WriteTable writeTable) {
excelWriter.write(supplier.get(), writeSheet, writeTable);
}
public void fill(Object data, WriteSheet writeSheet) {
excelWriter.fill(data, writeSheet);
}
public void fill(Object data, FillConfig fillConfig, WriteSheet writeSheet) {
excelWriter.fill(data, fillConfig, writeSheet);
}
public void fill(Supplier<Object> supplier, WriteSheet writeSheet) {
excelWriter.fill(supplier, writeSheet);
}
public void fill(Supplier<Object> supplier, FillConfig fillConfig, WriteSheet writeSheet) {
excelWriter.fill(supplier, fillConfig, writeSheet);
}
public WriteContext writeContext() {
return excelWriter.writeContext();
}
/**
* 创建一个 ExcelWriterWrapper
*
* @param excelWriter ExcelWriter
* @return ExcelWriterWrapper
*/
public static <T> ExcelWriterWrapper<T> of(ExcelWriter excelWriter) {
return new ExcelWriterWrapper<>(excelWriter);
}
// -------------------------------- sheet start
public static WriteSheet buildSheet(Integer sheetNo, String sheetName) {
return sheetBuilder(sheetNo, sheetName).build();
}
public static WriteSheet buildSheet(Integer sheetNo) {
return sheetBuilder(sheetNo).build();
}
public static WriteSheet buildSheet(String sheetName) {
return sheetBuilder(sheetName).build();
}
public static WriteSheet buildSheet() {
return sheetBuilder().build();
}
public static ExcelWriterSheetBuilder sheetBuilder(Integer sheetNo, String sheetName) {
return FesodSheet.writerSheet(sheetNo, sheetName);
}
public static ExcelWriterSheetBuilder sheetBuilder(Integer sheetNo) {
return FesodSheet.writerSheet(sheetNo);
}
public static ExcelWriterSheetBuilder sheetBuilder(String sheetName) {
return FesodSheet.writerSheet(sheetName);
}
public static ExcelWriterSheetBuilder sheetBuilder() {
return FesodSheet.writerSheet();
}
// -------------------------------- sheet end
// -------------------------------- table start
public static WriteTable buildTable(Integer tableNo) {
return tableBuilder(tableNo).build();
}
public static WriteTable buildTable() {
return tableBuilder().build();
}
public static ExcelWriterTableBuilder tableBuilder(Integer tableNo) {
return FesodSheet.writerTable(tableNo);
}
public static ExcelWriterTableBuilder tableBuilder() {
return FesodSheet.writerTable();
}
// -------------------------------- table end
}

View File

@@ -1,41 +0,0 @@
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common</artifactId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>ruoyi-common-idempotent</artifactId>
<description>
ruoyi-common-idempotent 幂等功能
</description>
<dependencies>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-json</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-redis</artifactId>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-crypto</artifactId>
</dependency>
<dependency>
<groupId>cn.dev33</groupId>
<artifactId>sa-token-core</artifactId>
</dependency>
</dependencies>
</project>

View File

@@ -21,15 +21,9 @@
<artifactId>ruoyi-common-core</artifactId>
</dependency>
<!-- JSON工具类 -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jackson</artifactId>
</dependency>
</dependencies>

Some files were not shown because too many files have changed in this diff Show More