Compare commits

...

292 Commits

Author SHA1 Message Date
6a3b384fc3 merge: sync master-jdk17, keep stripTrailing and trailing comma fix
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 09:24:57 +08:00
eddd21f4e8 fix(infra): 修复 Windows 下 Codegen 单测 2026-06-04 09:21:49 +08:00
78d798bbe9 fix(infra): 修复 windows 代码生成单测换行符差异 2026-06-04 01:18:37 +08:00
83ce168a68 fix(infra): 代码生成统一 LF 与尾逗号处理,修复 Windows 单测 2026-06-03 14:54:01 +08:00
dea5e07ed6 feat(im):增加 im 的功能说明 2026-06-01 08:13:15 +08:00
115055c403 feat(im):增加 im 的功能说明
- 移除 IM 对 websocket starter 的直接依赖
- 改为通过 infra WebSocketSenderApi 发送推送消息
- 同步调整已有 WebSocket 推送单测
2026-06-01 08:08:17 +08:00
c13ca7b4d8 feat(im): 统一 WebSocket 推送依赖
- 移除 IM 对 websocket starter 的直接依赖
- 改为通过 infra WebSocketSenderApi 发送推送消息
- 同步调整已有 WebSocket 推送单测
2026-06-01 00:36:52 +08:00
92c0ea303c feat(im):增加 livekit poc 启动脚本 2026-06-01 00:00:35 +08:00
3235b4e707 fix: 优化对 JDK8 的兼容性 2026-05-31 23:45:15 +08:00
40c9449f39 fix: 优化对 JDK8 的兼容性 2026-05-31 23:36:22 +08:00
5998e7f931 chore: remove macOS metadata file 2026-05-31 23:08:24 +08:00
11b4eef41d fix: add .DS_Store to .gitignore 2026-05-31 23:07:11 +08:00
3d0142abe1 feat(im):合并 im 最新版本到 master 分支 2026-05-31 22:33:58 +08:00
ec9862cd29 Merge branch 'feature/im-dev' of https://gitee.com/zhijiantianya/ruoyi-vue-pro into master-jdk17
# Conflicts:
#	pom.xml
#	yudao-dependencies/pom.xml
#	yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/json/JsonUtils.java
#	yudao-server/pom.xml
2026-05-31 22:25:45 +08:00
bfca0820ca (〃'▽'〃)_v2026_04_发布:新增 WMS 仓储管理系统,完成 Vben5 IoT/MES/WMS 双端适配 2026-05-31 21:27:07 +08:00
ca702b81af fix: 优化对 JDK8 的兼容性 2026-05-31 20:00:40 +08:00
f1660e18e4 fix: 优化对 JDK8 的兼容性 2026-05-31 19:51:03 +08:00
688de72367 fix(bpm): 修复流程摘要解析展示组件时报错
- 表单字段 JSON 改为按 JsonNode 逐个节点递归解析
- 跳过分割线、标签、文字等展示组件的字符串 children
- 默认摘要按表单字段配置顺序取前三个真实字段
- 补充流程摘要解析单元测试,覆盖 DB form_fields 常见格式

对应 https://t.zsxq.com/x1UrW
2026-05-31 19:14:59 +08:00
af9b6253b1 fix(sql): 修复 convertor 索引解析兼容问题
- 兼容 simple-ddl-parser 不同版本的索引列返回结构
- 修复唯一索引列中误混入 ASC/DESC 导致生成 SQL 不合法的问题
- 兼容 Oracle、Kingbase 的 level 等保留字列名转义
- 同步处理 CREATE、COMMENT、INSERT 显式列清单的列名转义
2026-05-31 17:49:23 +08:00
abee9ff48d fix: 修复拼团开团与库存边界校验
- 允许拼团购买数量等于 SKU 库存,仅购买数量大于库存时提示库存不足
- 补充 CombinationRecordServiceImpl 的 DB 单测,覆盖 headId=0 开团、参团、父团不存在、库存边界、重复参团、总限购和过期取消订单等场景
- 补充 promotion_combination_record 单测表结构和清理 SQL

帖子:https://t.zsxq.com/Brapi
2026-05-31 17:11:56 +08:00
eaaeb86a0c feat(mes): add MES production task issue API and improve combination record validation 2026-05-31 16:48:00 +08:00
89c137a915 fix(mall): 修复独立分销固定佣金为空时报错
独立分销商品的 SKU 固定佣金为空时,预计佣金计算和下单分销记录创建统一按 0 处理,避免最小/最大佣金比较或佣金乘数量时出现空指针异常。

补充分销预计佣金和订单转换单元测试,覆盖固定佣金为空与 SKU 列表为空场景。
2026-05-31 16:41:23 +08:00
0943307785 fix(mall): 修复全局比例分佣商品预估佣金为 0,对应 https://t.zsxq.com/Lsu8i 2026-05-31 13:13:53 +08:00
2f5984afd9 fix(pay): 修复微信支付公钥模式配置,兼容 weixin-java-pay 新版本 2026-05-31 09:46:20 +08:00
42d4112bd9 fix(iot):单测报错问题 2026-05-31 09:26:59 +08:00
e03e3c1a89 fix(iot): 修复设备属性上报类型转换
- 抽取物模型属性值转换到 ThingModelService
- 支持 ENUM、DATE、BOOL、STRUCT、ARRAY、TEXT 等 TDengine 类型转换
- 跳过 null、非字符串 key 和无效值,并补充单测
2026-05-31 00:30:21 +08:00
23c642ed72 fix(iot): 清理已删除 Modbus 设备的网关轮询
- 过滤 RPC Modbus 配置列表中的已删除设备
- Modbus TCP Server 刷新配置时清理失效设备资源
- 停止轮询任务并清理 Pending 请求、配置缓存和连接
2026-05-31 00:15:21 +08:00
4ae3f6b2c9 fix(infra): 加强文件上传路径安全校验
- 为 App 文件上传入口启用参数校验,保留 PermitAll
- 统一校验文件名、目录和相对路径,拒绝目录穿越路径
- LocalFileClient 限制最终文件路径必须位于 basePath 内
- 补充文件路径安全相关单元测试
2026-05-30 23:35:30 +08:00
e44011754c feat(member): 会员增加 email 字段 2026-05-30 22:55:27 +08:00
fe4a774c1e !253 iot,MessageBus增加iotRabbitMQMessageBus:https://gitee.com/zhijiantianya/yudao-cloud/pulls/253 2026-05-30 22:19:59 +08:00
5f2abdabbe feat: 优化 IoT 告警模板选择
- 后端 mail/sms/notify 模板 simple-list 仅返回启用模板精简字段
- 前端补充 mail/sms/notify 模板 simple-list API 封装
- vue3 与 vben antd/ele 在各自 system 模块封装模板选择组件
- IoT 告警配置按接收类型动态选择短信、邮件、站内信模板
- 补充前端 IotAlertReceiveTypeEnum,替换表单内裸常量
2026-05-30 22:06:02 +08:00
8ba906c6eb !1540 fix: 优化IoT告警配置支持动态选择邮件、短信、站内信的模板,不再依赖templateCode。
Merge pull request !1540 from 熊猫大侠/master-jdk17-iotalert
2026-05-30 12:41:16 +00:00
b776dc2a06 refactor(mes): update comments and improve code readability in condition matchers 2026-05-30 20:38:05 +08:00
215d0ce8f0 !1541 fix: 修复触发器和条件匹配器中缺少对产品和设备一致性的验证
Merge pull request !1541 from 熊猫大侠/master-jdk17-iotscene
2026-05-30 12:35:49 +00:00
c6813d43af feat(mes-qc): 迁移 antd 来料检验及检测结果、缺陷记录组件(代码优化) 2026-05-29 16:27:15 +08:00
07f26a7e02 fix: 修复触发器和条件匹配器中缺少对产品和设备一致性的验证 2026-05-26 11:16:06 +08:00
c39865e90d fix(mes): 修正安灯迁移的配置角色显示和记录只读字段 2026-05-26 00:08:46 +08:00
bd29116e45 fix: 修复 IM 申请与 RTC 边界问题
- 复用好友申请、群申请和群邀请唯一键冲突后的旧记录,并补充测试
- 收敛 RTC 旁观者加入、忙线校验、追加邀请超员和群通话通知逻辑
- 为 RTC 参与者补充房间用户唯一约束与 MySQL 迁移
- 统一群本体管理请求的 id 字段,并同步前端调用
- 修复前端来电活跃态守卫和 LiveKit 重连前断开旧房间
- 清理群成员通知基类命名和相关注释
2026-05-25 20:54:12 +08:00
a06fb9e995 fix(im):批量修复群管理、RTC 和消息链路问题
- 修复群管理行锁、管理员角色更新、群主转让、置顶消息并发问题
- 修复好友申请 maxId 游标、重复申请排序、通知类型校验和消息内容结构校验
- 修复消息统计口径、RTC token 鉴权、离会通知、前端拉取取消和媒体重试
- 优化表情批量删除、WebSocket 推送注释、群 READ 字段和相关单测
- 更新 bug_todo、bug_done 和 bug_rejected,剩余 9 个待修
2026-05-25 09:04:25 +08:00
9b44ed74e6 fix(im): 批量修复 P1/P2 问题
- 修复管理端消息内容搜索和私聊双向查询
- 加强 RTC 通话并发状态保护,去除重复接口错误提示
- 支持成员永久禁言
- 脱敏群消息 WebSocket 定向收件人字段
- 更新 IM bug 台账,剩余 P1/P2 共 35 个
2026-05-25 00:29:00 +08:00
36c30a431a fix: 加强 IM 上传 URL 与 RTC 来电载荷校验 2026-05-24 23:41:47 +08:00
49241c3123 fix(im): 强化好友关系、消息历史和前端交互
- 校验群资料字段长度,并在同意好友申请时复验双方用户
- 仅向双向有效好友推送资料更新通知
- WebSocket 推送收件人去重,并忽略空用户编号
- 群聊和私聊历史保留撤回消息记录
- 校验群通话排除发起人后仍需存在被邀请人
- 统一 IM 前端接口参数传递方式
- 抽取全局 URL 安全打开工具,并复用到消息预览
- 防止好友申请同意和拒绝按钮重复操作
- 补充好友、消息、RTC、WebSocket 相关测试
2026-05-24 21:24:15 +08:00
f5ef0a8997 fix(im): 批量修复 P0 安全边界和通话流程问题
- 拒绝匿名 WebSocket 握手,收紧 RTC 接听和入会忙线校验
- 支持封禁群解散,管理端解散改为独立权限码
- 增加个人表情数量配置、唯一约束和并发重复兜底
- 修复 RTC 异常断开上报、视频远端音频和好友选择大列表渲染
- 让个人表情添加失败透出后端业务错误
- 流转 P0 bug 文档,并按产品取舍记录 apiSecret 默认值不强制拦截
2026-05-24 20:21:00 +08:00
bda892277d fix(im):加固管理端入参和统计边界
- 校验敏感词、表情包、表情项状态枚举和批量删除数量上限
- 限制私聊、群聊增量拉取 size 最小值
- 收紧表情包项 Mapper 的 in 查询并在 Service 层处理空好友集合
- 兼容统计聚合数值类型并明确当前有效群总数口径
- 固定 LiveKit token 签名编码和 IM web 包说明
- 修正群禁言权限错误码顺序并补充封禁、踢人、禁言回归测试
- 流转 IM bug 文档并记录本轮不修项语义
2026-05-24 19:02:19 +08:00
bb9a2b5382 fix(im):加固好友、群成员与群消息边界流程
- 清理好友重加时的 deleteTime 和历史备注残留
- 清理群成员重入时的 quitTime、muteEndTime 和邀请来源残留
- 允许封禁群成员主动退群,仍拦截已解散群
- 校验群已读游标的消息归属和可见性
- 收窄群消息置顶通知为专用展示对象并同步前端展示
- 回填群成员单查接口的昵称和头像
- 补充相关回归测试并流转 IM bug 状态文档
2026-05-24 18:22:08 +08:00
513c130151 fix(im):加固群聊与好友部分流程
- 拦截对方已拉黑时的静默恢复好友关系
- 入群申请通过前复核群状态和申请人成员状态
- 群消息撤回保留定向可见范围
- 过滤群历史消息和已读用户查询中的定向消息
- 敏感词缓存刷新补充租户上下文
- 补充 IM 测试表约束和好友申请回归用例
2026-05-24 17:13:17 +08:00
a4b485562f feat(mybatis): 支持 likeRightIfPresent 条件拼接 2026-05-24 11:12:04 +08:00
dd6be0e595 feat(mybatis): 支持 likeRightIfPresent 条件拼接 2026-05-23 23:02:15 +08:00
69121bec6e fix(mall): 修复优惠券模板限领数量校验误报库存不足 2026-05-23 18:23:49 +08:00
bac7cf17d8 build: 升级可解析的三方依赖版本 2026-05-23 16:49:28 +08:00
0d6a75a2a6 fix(framework): 锁定 Bouncy Castle 版本避免 Fat Jar 启动失败 2026-05-23 16:14:34 +08:00
da96ceab7a fix(framework): 修复分页排序 SQL 注入风险 2026-05-23 12:27:02 +08:00
cab59d4dd8 fix(framework): 修复分页排序 SQL 注入风险 2026-05-23 12:26:57 +08:00
ff8a52418b refactor(framework): 简化 API 访问日志请求体读取 2026-05-23 11:10:29 +08:00
3b97b1b0a4 Merge remote-tracking branch 'origin/master-jdk17' into master-jdk17 2026-05-23 10:34:42 +08:00
d1242003b1 fix(member): 修复会员详情等级名称返显错误 2026-05-23 10:34:35 +08:00
f0e4639920 feat(im): 修一批群消息撤回与群管理治理问题
- 群主 / 管理员可撤回他人违规消息;治理他人消息时不受撤回时间窗限制,撤回自己的仍受限
- banGroup 校验群未解散(已解散抛 GROUP_DISSOLVED)+ banned 幂等,避免重复封禁广播
- 踢人跳过已退群的失效目标,只踢有效成员,不再因混入历史管理员整批失败
- 退群成员离线 pull 去掉撤回消息过滤,与在群成员的 selectListByMinId 对齐
- 补 removeGroupMember 单测 status 字段 + 新增「跳过失效目标」混合用例
2026-05-22 18:09:47 +08:00
3f1d86efff fix: 优化IoT告警配置支持动态选择邮件、短信、站内信的模板,不再依赖templateCode。 2026-05-22 14:52:02 +08:00
a08526d855 fix(iot):修复 configLevel 传参不对 2026-05-21 18:49:16 +08:00
f938362b04 feat(im): 增加频道消息的已读状态 2026-05-20 01:00:47 +08:00
b18281fc5c feat(im): 修复频道消息的引用展示不对; 2026-05-19 23:57:46 +08:00
79be419067 feat(im): 继续优化频道的各种代码(v4)优化卡片样式 2026-05-19 23:52:11 +08:00
ee9362a2f2 feat(im): 继续优化频道的各种代码(v3) 2026-05-19 22:06:38 +08:00
6bfaa848f2 feat(im): 继续优化频道的各种代码(v2) 2026-05-19 17:48:36 +08:00
865a58a646 feat(im): 继续优化频道的各种代码, 2026-05-19 17:18:49 +08:00
d60156015b feat(im): 增加频道的检查 2026-05-19 14:18:09 +08:00
032d955800 feat(im): 新增频道消息的前端实现 2026-05-19 13:26:33 +08:00
611880a3c4 feat(im): 新增频道消息的后端实现 2026-05-19 11:47:19 +08:00
6b1a0cfce2 feat(im): 更多单元测试 2026-05-18 15:17:08 +08:00
36c4410512 feat(im): 管理后台新增通话记录只读查询(列表 / 详情 / 参与者);im_rtc_participant 增加 call_id 关联 im_rtc_call.id
 feat(im): 管理后台新增通话记录页面(列表 + 详情抽屉 + 参与者表),消息预览补 RTC_CALL_START / END 文案
2026-05-18 12:37:52 +08:00
2fd201bf59 feat(im): 振铃超时 Job 单人粒度标 NO_ANSWER + 独立 NO_ANSWER 信令推送
 feat(im): 处理 RTC_CALL(NO_ANSWER) 信令;私聊气泡显示「未接听」
2026-05-18 09:45:33 +08:00
9e1a6b15e4 feat(im): 振铃超时 Job 单人粒度标 NO_ANSWER + 独立 NO_ANSWER 信令推送
 feat(im): 处理 RTC_CALL(NO_ANSWER) 信令;私聊气泡显示「未接听」
2026-05-18 08:03:53 +08:00
1eda319ea0 feat(im): 通话事件接入会话列表预览(私聊补 START 入消息流);文案统一「语音通话」 2026-05-17 22:26:07 +08:00
dc081cfdd2 fix(im): 简化 LiveKit webhook 的 @PostMapping 注解(移除冗余 consumes)因为 LiveKit webhook 是 webhook/json 非标 2026-05-17 20:27:33 +08:00
9ce816e247 feat(im): 优化群邀请的 incoming、inviting 的交互 2026-05-17 10:36:01 +08:00
bf4e366344 feat:补齐 antd 的 component: 'InputNumber', 的 class full 样式 2026-05-16 22:53:03 +08:00
6a25b298f7 fix(wms):修复 WmsInventoryServiceImplTest 执行失败 2026-05-16 18:08:15 +08:00
2859f0ef48 feat(wms):增加文档说明 2026-05-16 17:25:49 +08:00
74b73e4c77 feat(wms):调整 README.md 2026-05-16 15:08:44 +08:00
324ad8f9d2 feat(wms):调整 README.md 2026-05-16 14:55:48 +08:00
33f75a1ae8 【同步】BOOT 和 CLOUD 的功能(wms) 2026-05-16 14:37:41 +08:00
456e05bb08 feat: 同步最新 ruoyi-vue-pro.sql 2026-05-16 06:30:24 +08:00
fba451afa2 Merge branch 'wms' of https://gitee.com/zhijiantianya/ruoyi-vue-pro into master-jdk17 2026-05-16 06:24:00 +08:00
df676e47fb fix(wms): 代码风格统一 2026-05-15 20:06:38 +08:00
8bbd1d9ca7 fix(wms): 完善单据状态保护与金额精度处理
- 后端补充商品、往来企业唯一性校验
- 单据更新改为按草稿状态条件更新,避免覆盖已完成单据
- 补充 WMS 金额、规格精度迁移 SQL 与测试表结构
- 前端统一明细金额兜底计算,优化完成/作废取消处理
2026-05-15 19:48:34 +08:00
5159b19e2d feat(wms): 统一数量金额精度并清理 schema 脱钩
后端:
- 新增 sql/mysql/wms/20260515_wms_amount_precision.sql
  11 张表金额字段统一升到 decimal(16,2),覆盖 SKU 单价、单据主表/明细
  总金额/行金额、盘库实际金额、库存流水单价/行金额
- 新增 sql/mysql/wms/20260515_wms_sku_dimension_precision.sql
  SKU 长宽高对齐 lite 改为 decimal(10,1)、毛/净重改为 decimal(10,3)
- 测试 SQL create_tables.sql 全量同步生产 MySQL:数量 (20,2)、
  金额 (16,2)、长度 (10,1)、重量 (10,3),修复"测试 schema 与生产
  脱钩"导致单测假阳性的隐患
- WmsWarehouseServiceImpl.validateWarehouseCodeUnique 去掉
  StrUtil.isBlank 提前 return,因 code 已由 VO 层 @NotBlank 强制非空
- WmsWarehouseServiceImplTest 同步调整

前端:
- ReceiptOrderForm / ReceiptOrderDetail 合计行去掉"单价合计"派生展示,
  单价不能跨行相加;保留数量合计与行金额合计

文档:
- review-opus.md 收口至仅剩 F10 (SQL 导出,用户认领)
- 新增 fix-plan.md 与 精度调整-codex讨论.md,沉淀本轮决策依据
2026-05-15 18:52:38 +08:00
c62630f74b feat(wms): 拆 simple-list 列表 VO、补首页校验与业务单号搜索框
后端:
- 新增 WmsItemListReqVO / WmsMerchantListReqVO,simple-list 接口不再
  复用分页 PageReqVO,Swagger 上不再误暴露 pageNo/pageSize 字段
- WmsItemController / WmsMerchantController 的 getXxxSimpleList 改用
  独立 ListReqVO;Mapper.selectList、Service.getXxxList 同步调整签名
- WmsHomeStatisticsServiceImpl 三个查询入口加 validateWarehouseIfPresent,
  非空 warehouseId 走 warehouseService.validateWarehouseExists 校验,
  避免前端误传任意 id 直接落到首页 SQL
- 新增 sql/mysql/wms/20260515_wms_total_price.sql:幂等给 4 张明细 / 流水表
  补 total_price 列并按 ROUND(quantity*price, 2) 回填历史数据

前端:
- receipt/index.vue + shipment/index.vue 搜索栏补 bizOrderNo 输入控件,
  对齐已声明的 queryParams 与后端 PageReqVO 支持
- WmsHomeOrderSummaryCards.getStatusPercent 改 function 声明,并去掉
  最小 4% 占比下限,保留真实比例
2026-05-15 18:23:59 +08:00
a333887bc0 feat(wms): 持久化单据行金额并补全库存流水与仓库删除校验 2026-05-15 15:26:14 +08:00
5f31b32c12 feat(wms): 持久化出入库移库明细行金额并补全库存流水金额展示 2026-05-15 14:11:14 +08:00
34c0197bce feat(wms):优化整体代码结构 2026-05-15 12:59:12 +08:00
3a38a69fa5 feat(wms):调整 check 的实现 2026-05-15 11:00:26 +08:00
d8f9f0d029 feat(wms):调整 check 的实现 2026-05-15 11:00:15 +08:00
10ef807472 feat(wms):库存增加列表接口 2026-05-15 10:40:10 +08:00
9ff3593ffb feat(wms):增加 code 字段生成(从后端到前端),用户更可控 2026-05-15 10:22:38 +08:00
02fe48e408 fix(wms): 简化库存余额并发补行处理
库存变更时,缺失库存余额行改为逐条插入;遇到唯一键冲突时回查并复用已有库存行,避免批量插入异常包装导致并发补行失败。
2026-05-15 08:52:47 +08:00
4749a1e28e feat(wms):WmsInventoryPageReqVO 增加 type 非空校验 2026-05-15 08:47:57 +08:00
32813c0873 feat(wms):优化入库、出库等订单的完成、取消逻辑,避免并发问题 2026-05-15 08:25:17 +08:00
774264026d feat(wms):优化 onlyPositiveQuantity 只查询库存非空的处理。 2026-05-15 08:24:55 +08:00
15d6ca181a feat(wms):优化首页的代码实现 2026-05-14 22:35:54 +08:00
f7cd8573fd feat(wms):增加首页的 review 2026-05-14 18:53:56 +08:00
a946408029 feat(wms):优化盘库单的实现 2026-05-14 17:03:50 +08:00
65a1337dbd feat(wms):移库管理,调整合计金额、数量的字段与交互。(前端负责展示,后端负责计算) 2026-05-14 09:46:20 +08:00
273d911edc feat(wms):出库管理,调整合计金额、数量的字段与交互。(前端负责展示,后端负责计算) 2026-05-14 09:07:27 +08:00
70a6316ce7 feat(wms):入库管理,调整合计金额、数量的字段与交互。(前端负责展示,后端负责计算) 2026-05-14 08:39:04 +08:00
04d1b8655d feat(wms):增加 order_time 单据字段 2026-05-13 23:31:12 +08:00
d1b20eebaa feat(wms):增加 order_time 单据字段 2026-05-13 23:31:04 +08:00
70271c1cbf feat(im): 对齐微信的通话,模拟手机拨打电话。每次都一定有记录 2026-05-13 22:16:21 +08:00
86d760fdb1 feat(wms):减法,去掉批次号等字段 2026-05-13 22:06:38 +08:00
fe38e4fdef feat(wms):减法,去掉 area 表 2026-05-13 20:29:26 +08:00
a1d2f849a6 feat(wms):减法,去掉 detail 表,和 mes 更对齐 2026-05-13 18:42:51 +08:00
45dcdb1105 feat(wms):优化 inventory 的库存加锁,防止并发问题 2026-05-13 17:55:03 +08:00
c69e20d681 feat(im): RTC 接口拆 create / invite + 字段对齐 + 群关房语义升级
- refactor: inviteCall 拆成 createCall(创建新通话)/ inviteCall(追加邀请);VO `ImRtcCallInviteReqVO`(统一版)→ git mv 为 `ImRtcCallCreateReqVO`;恢复 + git mv `ImRtcCallInviteMoreReqVO` → `ImRtcCallInviteReqVO`(room + inviteeIds);Controller 端点 `/invite` → `/create` + 新 `/invite`;Service 内部拆 createGroupCall / createPrivateCall / createCall0
- refactor: VO 字段 `scene` → `conversationType`(CreateReqVO / RespVO 同步),与 ImConversationTypeEnum 对齐;`peerUserId` 融合进 `inviteeIds`,私聊必传 1 个对端从集合派生
- feat: 群通话关房语义升级;shouldCloseGroupRoom 改 `(JOINED==0) || (JOINED==1 && INVITING==0)`,1 人独守 + 无后续即关;endSessionIfTerminal 按 call.status 自动推 reason(CREATED→CANCEL 没真接通过 / RUNNING→HANGUP);rejectCall 群分支末尾触发关房判定,全员拒接自动收敛
- chore: 错误码新增 RTC_GROUP_INVITEE_REQUIRED;validateInviteScene → validateCreateCall;Controller `getLoginUserId` 抽局部变量;resolveDisplayName 抽私有 helper 复用 displayName 派生
- fix: pushCallInviteNotification 加 NPE 防御(getUserMap 缺键时降级为 userId 字符串);pushCallEndNotification 私聊 receiverId 去掉错误的 senderId 兜底
- chore: handleLiveKitEvent 改回传统 switch 兼容 JDK8;其它若干 Javadoc 补齐 / 注释精简 / typo 修复
2026-05-13 13:24:10 +08:00
e838637fd3 feat(wms):增加 SKU、仓库、商户删除前的使用校验 2026-05-13 10:28:36 +08:00
c96487f594 feat(wms):新增移库、盘库管理 2026-05-13 09:47:45 +08:00
9bebb4cea4 feat(wms):增加 SKU 删除前的使用校验 2026-05-13 09:09:03 +08:00
93607eb923 feat(wms):新增出库管理 2026-05-13 08:57:42 +08:00
690a549963 ```
 feat(im): RTC 通话逻辑收口(displayName / inviteeIds 校验 / 配置化阈值)

- fix: pushCallInviteNotification 给被邀请人签 token 时 displayName 改用 invitee 自己的昵称(原来错用 inviter)
- feat: 群通话发起 / 追加邀请均强制 inviteeIds 非空,对齐微信交互;超量改抛 RTC_GROUP_INVITEE_OVER_LIMIT,不再静默截断
- refactor: ImGroupMemberService 抽 validateMembersInGroup(groupId, ids) 批量校验,inviteMoreCall / resolveInvitees 复用
- refactor: 僵尸通话清理阈值从 ImRtcCallCleanupJob 静态常量挪到 ImProperties.rtc.cleanupZombieThresholdMinutes
- perf: createCall / inviteMoreCall 推 INVITE 前一次 getUserMap 批量拉用户,省 N 次 RPC
- refactor: inviteMoreCall 参与者构造改 CollectionUtils.convertList;trim 多余注释
- docs: 补齐 RTC service / controller / job / LiveKitClient 私有方法的 @param / @return
- chore: 错误码新增 RTC_GROUP_INVITEE_REQUIRED / RTC_GROUP_INVITEE_OVER_LIMIT
```
2026-05-13 01:38:01 +08:00
27685b99c8 ```
 feat(im): RTC 通话逻辑收口(displayName / inviteeIds 校验 / 配置化阈值)

- fix: pushCallInviteNotification 给被邀请人签 token 时 displayName 改用 invitee 自己的昵称(原来错用 inviter)
- feat: 群通话发起 / 追加邀请均强制 inviteeIds 非空,对齐微信交互;超量改抛 RTC_GROUP_INVITEE_OVER_LIMIT,不再静默截断
- refactor: ImGroupMemberService 抽 validateMembersInGroup(groupId, ids) 批量校验,inviteMoreCall / resolveInvitees 复用
- refactor: 僵尸通话清理阈值从 ImRtcCallCleanupJob 静态常量挪到 ImProperties.rtc.cleanupZombieThresholdMinutes
- perf: createCall / inviteMoreCall 推 INVITE 前一次 getUserMap 批量拉用户,省 N 次 RPC
- refactor: inviteMoreCall 参与者构造改 CollectionUtils.convertList;trim 多余注释
- docs: 补齐 RTC service / controller / job / LiveKitClient 私有方法的 @param / @return
- chore: 错误码新增 RTC_GROUP_INVITEE_REQUIRED / RTC_GROUP_INVITEE_OVER_LIMIT
```
2026-05-13 01:37:48 +08:00
bb5ac45be8 feat(im): 优化 JDK8 的兼容性 2026-05-13 00:59:06 +08:00
eba504d0bf feat(wms):补充 inventory 相关的单测 2026-05-13 00:57:29 +08:00
d15470efb1 feat(wms):修复只能删除作废的入库单的问题 2026-05-13 00:42:29 +08:00
8996b94795 feat(im): 优化 ImRtcCallServiceImpl 实现类的各种注释,以及编码风格。 2026-05-12 23:48:50 +08:00
076de4008e feat(wms):增加供应商 select 组件 2026-05-12 23:34:45 +08:00
8f9433ece8 feat(wms):进一步优化入库单的后端实现(对齐 mes) 2026-05-12 23:02:47 +08:00
55426245a1 feat(wms):优化 receipt order 实体的实现(增加 code review) 2026-05-12 21:08:36 +08:00
07f3bab72a feat(im): 将后端的 roomName 和 callId 融合,简化字段和逻辑(一致性更好、概念更简洁) 2026-05-12 20:29:09 +08:00
d0aac3824d feat(im): rtc 增加代码评审,进一步优化代码风格; 2026-05-12 19:16:34 +08:00
b683031528 feat(im): rtc 交流通信的部分 2026-05-12 13:52:11 +08:00
8b497fa655 feat(im): 完善 rtc 的后端代码逻辑,各种代码风格的优化 2026-05-12 13:17:04 +08:00
ee20f7778c feat(wms):增加 inv 库存的新增、修改方法,并提供相关单测 2026-05-12 11:14:22 +08:00
530d3b3a5f feat(im): rtc 增加数据库存储(从单体 =》集群) 2026-05-12 09:47:20 +08:00
eb4224191c feat(wms):增加 receipt order 实体 2026-05-11 19:37:21 +08:00
28f62af7aa feat(wms):优化 inventory history 2026-05-11 15:11:39 +08:00
fe77884cc3 feat(friend): 重构好友状态管理逻辑
优化好友状态的获取和验证逻辑,将 ImFriendStateEnum 的使用改为整型状态值,简化了好友关系的校验过程。新增 validateFriend 方法,统一处理好友和黑名单的校验,提升代码可读性和维护性。
2026-05-11 14:25:25 +08:00
144963d07e feat(wms):优化 inventory 的实现 2026-05-11 14:10:16 +08:00
ccaae6675e feat(wms):增加 inventory history 2026-05-11 13:07:36 +08:00
3fcae795ab feat(wms):增加 inventory 2026-05-11 09:45:24 +08:00
dc8883d3c1 feat(wms):完善往来企业 2026-05-10 23:56:29 +08:00
338d834576 feat(wms):完善商品信息、SKU 信息 2026-05-10 22:46:24 +08:00
6d29f96e94 feat(wms):增加商品信息、SKU 信息 2026-05-10 21:33:42 +08:00
22e50bab69 feat(wms):增加商品分类、商品品牌。 2026-05-10 16:38:26 +08:00
00dce6435c feat(wms):迁移到 md 更整体 2026-05-10 09:02:52 +08:00
6cc1550a1f feat(wms):增加 warehouse 功能 2026-05-10 01:22:38 +08:00
c99ae090e9 feat(wms):初始化 2026-05-09 21:56:26 +08:00
bcac553c69 feat(im): 基于 livekit 构建 im 通话(语音聊天、视频聊天、共享桌面)v0.1:推进中 2026-05-09 15:23:07 +08:00
348b97047d feat(im): 拆出私聊 / 群聊已读两个全局开关,关闭后禁用接口与所有 UI 入口(含群回执)
ImProperties.message 新增 privateReadEnabled / groupReadEnabled,前端 config.ts 同步镜像。关闭后:
- 后端:read 系列接口(read / getMaxReadMessageId / getGroupReadUserIds)抛业务异常;sendGroupMessage 强制 NO_RECEIPT 忽略 receipt=true;pull 群消息跳过 Redis 已读游标读取与 readCount 补齐
- 前端:气泡已读标签 / 群回执 popover / 「发送回执消息」下拉入口 / admin 列表「状态」「回执」列与详情对应字段按开关隐藏;自动上报 / 冷启动同步对方已读位置 / WS READ & RECEIPT handler 全部按开关短路兜底,避免打到禁用接口
- 单测:补 @Spy ImProperties 修复原本就在的 NPE,加 disabled 分支断言
2026-05-09 01:07:18 +08:00
3d8b8792fd ♻️ refactor(im): 业务策略数值从 ImCommonConstants 上移到 ImProperties(按 group / message 子模块分组),常量类仅保留 AT_USER_ID_ALL 协议契约值
♻️ refactor(im): 抽出 utils/config.ts 集中数值常量,按业务域统一前缀(GROUP_ / MESSAGE_ / FRIEND_ / CONVERSATION_ / FORWARD_),constants.ts 只留协议枚举与契约值
2026-05-08 17:42:13 +08:00
1db025649a feat(im): 初始化群名片 v0.2:第二次评审(需求各种进群的小问题) 2026-05-07 17:25:03 +08:00
012dc01182 feat(im): 初始化群名片 v0.1:第一次评审 2026-05-07 13:07:56 +08:00
f360040a3d feat(im): 初始化群申请 v0.5:第六把 review(性能 / 健壮性 / 简洁度收口)
后端
- createInviteRequestList N+1 → 3 SQL:批量 select IN + update IN + insertBatch;20 人邀请从 40 RTT 降到 3 RTT
- service 不再出现 mybatis:复用记录的 update(null, wrapper) 下沉到 Im{Group,Friend}RequestMapper.update*Reset helper
- inviteGroupMember 入参去重切 hutool:CollUtil.subtractToList(CollUtil.distinct(...), activeMemberUserIds)
- 删除 dead 字段 inviterUserId(GroupRequestApprovedNotification / GroupRequestRejectedNotification):前端不再消费

前端
- 1505 / 1506 通知改静默:同意走群事件 1509 / 1510 渲染系统提示,拒绝不再打扰
- 修竞态:addByRequestId 校验 handleResult === UNHANDLED,避免 1503 在途时被 1505 / 1506 抢先后又把已处理记录塞回未处理列表
- 修复 dialog 复用记录刷新:watch key 含 inviterUserId / applyContent,同 id 不同内容也触发 refetch;actingId 期间跳过避免本端动作多余 RTT
- 修复 willGoApproval 误报:group.ownerUserId 兜底群主;members 未到位时保守按非审批处理
- unhandledCountMap memoized getter:O(N) 扫一次缓存到 Map,ConversationItem 直读 Map 消除 O(N×M) 重复 filter
2026-05-07 08:13:27 +08:00
ded120902a feat(im): 初始化群申请 v0.4:第五把 review(多轮 finding 修复 + 通知静默化)
- 邀请路径写 addSource=INVITE;群主 / 管理员邀请绕过审批;inviteGroupMember 入参去重
- getGroupRequest 越权校验加成员有效状态判断;新增 list-by-group 接口
- 申请列表按 update_time 倒序,update(null, wrapper) 路径手动刷 updateTime
- addByRequestId 不再 skip 同 id,复用记录刷新并置顶
- GroupRequestListDialog 单群模式订阅 store 增量同步;GroupMemberAddDialog 审批分支文案区分
- ConversationItem 增加 [X 条进群申请] 红字前缀;MessagePanel 顶部胶囊横幅
- 1505 / 1506 通知改静默:同意走群事件渲染系统提示,拒绝不再打扰;清掉 dead inviterUserId 字段
2026-05-07 00:51:48 +08:00
3b0abfb26e feat(im): 初始化群申请 v0.3:第四把 review(优化界面,进一步对齐微信界面)【之前提交错了】 2026-05-06 23:57:54 +08:00
241064e7d0 feat(im): 初始化群申请 v0.3:第四把 review(优化界面,进一步对齐微信界面) 2026-05-06 23:57:03 +08:00
f5bec3eec6 feat(im): 初始化表情包 v0.3:第四把 review(增加表情管理的界面) 2026-05-06 23:00:09 +08:00
ae71b7134c feat(im): 初始化群申请 v0.2:第三把 review 2026-05-06 20:51:46 +08:00
bed0a463f5 feat(im): 初始化表情包 v0.1:第二把 review 2026-05-06 20:50:56 +08:00
8a4ad959d6 feat(im): 初始化表情包 v0.0:第一把 review 2026-05-06 19:42:19 +08:00
b320e3c19a feat(im): 初始化群申请 v0.1:第二把 review 2026-05-06 18:52:31 +08:00
9ebf720901 feat(im): 初始化群申请 v0.0:第一把 review 2026-05-06 14:53:48 +08:00
7d5ee9f1c9 feat(im): 增加名片消息类型 2026-05-06 08:00:36 +08:00
f640b67159 🐛 fix(im):codex 评审修复 IM 单测契约
- ImPrivateMessageServiceImplTest 用 getFriendState 替换已删除的 isFriend mock;返回 ImFriendStateEnum.FRIEND / NONE
- ImFriendServiceImplTest 删 stale 测试(isFriend / addFriend / deleteFriend 二参版本均已不存在);addFriend0 测试参数补齐 null displayName / addSource 凑齐 4 参签名
- 修复后 mvn -pl yudao-module-im test-compile 通过

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-05 22:32:03 +08:00
f2136c43d3 feat(im): 清理一些 TODO 的修复 2026-05-05 22:04:45 +08:00
28cf87ac8a feat(im): 重构普通消息类型,和 openim 的消息编号对齐 2026-05-05 21:56:05 +08:00
0d7cb763ff feat(im): 增加好友申请的管理界面 2026-05-05 19:36:30 +08:00
43b5de5192 feat(im): 群封禁(GROUP_BANNED)全链路实现
1. ImMessageTypeEnum 新增 GROUP_BANNED(1533) 枚举
2. 新增 GroupBannedNotification 通知 DTO
3. ImGroupMessageSendDTO 新增 ofGroupBanned 工厂方法
4. banGroup / unbanGroup 添加 operatorUserId 参数,
   封禁/解封后广播 GROUP_BANNED 通知到全群成员
5. ImGroupManagerController 传递 getLoginUserId()
2026-05-05 18:41:11 +08:00
96ae9bbcb0 feat(IM):群禁言功能(阶段二后端)
1. im_group 新增 muted_all 字段,支持全群禁言 / 取消
2. im_group_member 新增 mute_end_time 字段,支持单成员定时禁言
3. 新增 3 个 API:mute-all、mute-member、cancel-mute-member
4. sendGroupMessage 新增 validateMuteStatus 拦截:全群禁言(群主/管理员豁免)+ 成员禁言
5. 三档分层权限校验:群主可禁言管理员和普通成员,管理员仅可禁言普通成员
6. 新增 4 个 WebSocket 通知类(1512-1515)及对应 DTO 工厂方法
7. Mapper 新增 updateMuteEndTimeNull 方法,解决 MyBatis-Plus 默认跳过 null 字段的问题
8. 新增 5 个错误码(GROUP_MUTED_CANNOT_SEND 等)
2026-05-05 14:44:23 +08:00
14090be672 feat(im):将"免打扰"字段从 muted 全量重命名为 silent(DO/VO/Service/Mapper/测试/SQL + 前端 types/store/组件/管理后台),为后续 mute 禁言功能腾出词族 2026-05-05 13:51:53 +08:00
6e1a8dc343 feat(im):删好友「同时清空聊天记录」选项(DTO 加 persistent 单边 TIP + clear 跨端透传 + clear=true 跳 TIP 避免复活会话;silent re-add 补单边 TIP) 2026-05-05 00:57:49 +08:00
9d11741aa5 feat(im): 优化好友重新添加逻辑,增强用户体验
实现好友关系的单边重新启用,推送隐私友好的通知,确保对方不感知好友状态的变化。此变更提升了用户在好友管理中的体验,保持了社交互动的自然性。
2026-05-05 00:39:44 +08:00
9720f20865 feat(im):增加好友删除时,增加是否删除本地聊天的选项 2026-05-05 00:33:06 +08:00
ee01a16f8b 🐛 fix(im):好友模块 codex 评审修复——1209 改 @TransactionalEventListener(AFTER_COMMIT) 避免幽灵通知、Consumer 过滤下推 SQL、申请表索引带 id 后缀覆盖游标排序、limit 加 @Max(200) 上限 2026-05-04 23:06:04 +08:00
eb2d3c39e2 ♻️ refactor(im):用户申请列表,增加流式查询,避免一次性加载过多,或者历史无法被加载到。 2026-05-04 22:46:21 +08:00
b5f5c408ee feat(im):好友申请通知 payload 补 fromNickname/fromAvatar,前端按 requestId 直推不再回拉 2026-05-04 21:13:29 +08:00
b0221c21cd ♻️ refactor(im):好友模块清理——删 ImFriendServiceImpl 无效的 getSelf 自代理 + Controller 回调参数命名展开 + Consumer 补日志 + silent re-add 注释补充 2026-05-04 19:52:37 +08:00
b51ca45531 feat(im):实现 1209 FRIEND_INFO_UPDATED 推送链路 + 修 deleteFriend 单边 TIP bug + FRIEND_APPLICATION 重命名 FRIEND_REQUEST_RECEIVED 2026-05-04 19:14:36 +08:00
b0ca5b7550 feat(im):实现 1209 FRIEND_INFO_UPDATED 推送(system 发 AdminUserProfileUpdateMessage,IM Consumer 监听后批量推好友多端) 2026-05-04 18:23:58 +08:00
2804e5ed10 fix(im):好友模块 code review 多项修复(缓存事务时序、agree/refuse 乐观锁、补建表 SQL 与字典 seed);framework 开 setTransactionAware 让 @CacheEvict 自动事务感知 2026-05-04 17:31:13 +08:00
ba1a85e38a feat(im): 优化好友申请逻辑,增加自我添加校验与异常处理
更新好友申请功能,使用 computed 包裹当前用户 ID,避免在 keep-alive 实例中持有旧 ID。增加自我添加好友的校验逻辑,防止用户添加自己为好友。同时,增强自动通过好友申请的异常处理,确保在事务提交后能正确处理失败情况。
2026-05-04 16:41:55 +08:00
f0be7ba137 feat(im): 优化好友请求处理逻辑,增加乐观锁支持 2026-05-04 16:29:11 +08:00
e266a0fc4a ♻️ refactor(cache): 开启事务感知以优化缓存管理 2026-05-04 16:10:31 +08:00
f03143c4ee refactor(im): 移除 TIP_TIME 消息类型,时间分隔条改为渲染时按 prevMessage.sendTime 计算
顺带修复 Bug-Y(删除最后一条消息后孤立时间分隔条)
2026-05-04 16:05:23 +08:00
cee0688c30 feat(im): 增加好友申请的逻辑(v1.3:修复各种边界情况,包括静默添加好友) 2026-05-04 11:08:03 +08:00
63d00c2bf2 feat(im): 增加好友申请的逻辑(v1.1:增加各种 code review 注释) 2026-05-04 09:47:25 +08:00
479af56a08 feat(im): 增加好友申请的逻辑(v1) 2026-05-04 09:18:36 +08:00
bfd374eedf ♻️ refactor(im): 清理代码中的 TODO 注释并优化逻辑 2026-05-03 13:27:31 +08:00
4d2f470499 feat(im): 增加群消息的置顶 2026-05-03 12:53:25 +08:00
6e823f848d feat(im): 增加群消息的置顶 2026-05-03 12:15:40 +08:00
ed9f23ae8c feat(im): 重构群通知相关,对齐 openim 的消息编号(继续优化代码) 2026-05-03 09:22:54 +08:00
719b139ca2 feat(im): 重构群通知相关,对齐 openim 的消息编号 2026-05-03 02:00:43 +08:00
1c29398da5 feat(im): 增加群角色(管理员) 2026-05-02 14:31:43 +08:00
37dfd6c07b feat(im): ImMessageTypeEnum 显式化 persistent + normal,sendXxxMessage 收敛 insert 与推送 2026-05-02 09:05:54 +08:00
41762f0ae5 feat(im): 优化【消息引用】的功能,来自第二波 code review,解决安全性问题 2026-05-01 18:20:04 +08:00
53fc9ae4fc feat(im): 优化【消息引用】的功能,来自第一波 code review 2026-05-01 18:09:02 +08:00
ae36d1ad68 feat(im): 增加【消息引用】的功能 2026-05-01 18:03:05 +08:00
5f88c9ca35 feat(im): 增加消息查询条件以排除已删除记录 2026-05-01 11:02:44 +08:00
45889459b7 feat(im): 实现 im 的首页统计 2026-05-01 09:25:39 +08:00
af6e283f49 feat(im): 增加群管理的完善 2026-05-01 08:19:13 +08:00
782314f17f feat(im): 增加群聊消息的管理 2026-05-01 07:08:05 +08:00
a4901a848d feat(im): 增加 pinyin 功能 2026-04-30 15:22:35 +08:00
fc90635abb feat(im): 新增 friend、group 等管理后台接口 2026-04-30 14:07:39 +08:00
37f0a8a01d feat(im): 增加 friend、group、message、sensitiveword 的管理接口 2026-04-30 08:46:28 +08:00
d0fbab8f73 feat(im): 完善 friend、group 相关的本地存储(疯狂优化) 2026-04-29 22:03:55 +08:00
96f2d1a12f feat(friend): 添加好友展示备注功能 2026-04-28 23:28:27 +08:00
b0b707ddc0 feat(im): 新增 GET /max-read-message-id,私聊多端 / 离线补齐对方已读位置
私聊已读语义在 message.status 字段翻转,离线期间错过的 RECEIPT 推送没法
重放(与群聊不同——群聊已读在 message.readCount / receiptStatus 字段自带)。
新增此接口:客户端进入私聊会话或断线重连后,拿到对方已读到我发的最大消息
id,按 id <= maxReadId 翻转本地自发消息状态。
实现:
- mapper 用 order by id desc + LIMIT 1 命中 (sender_id, receiver_id)
  索引,无 max() 聚合开销;
- 对方一条都没读过时返回 null(不做 0 兜底,避免与真实 id 混淆);
- 补齐 hit / miss 两个单测。
2026-04-26 10:30:45 +08:00
711a692c3a 🐛 fix(im): 私聊已读改用前端上报 messageId,修正 RECEIPT 语义
原 readPrivateMessages 走 select-then-update 两步:先按 status=UNREAD
查未读,再按 id in 翻转,maxReadId 取已 update 行的 max(id)。该实现
有两个问题:
1. select 与 update 之间到达的消息会被一并标 READ,但 maxReadId 取的
   是 select 时刻的最大值,对方端拿到的「已读到哪条」语义偏弱,前端按
   maxReadId 卡边界时也会与实际状态错位。
2. 接口与群聊 readGroupMessages(userId, groupId, messageId) 不对称。

改造:
- 接口签名增加 messageId(已读位置,含),与群聊接口对齐;
- mapper 替换为单条 update SQL:id <= messageId AND status=UNREAD 直接
  翻转,消除两步竞态窗口;
- READ / RECEIPT 推送的已读位置直接采用前端上报的 messageId;
- 落地 ImPrivateMessageServiceImpl 原 TODO;
- 同步更新 testReadMessages_success / testReadMessages_noUnread。
2026-04-26 09:41:44 +08:00
ceb609785b 🐛 fix(im): 群聊离线拉取移除 status=RECALL 过滤,与私聊行为对齐 2026-04-26 00:11:18 +08:00
8d1089bac5 🐛 fix(im): 撤回信号错用 TIP_TEXT,应为 RECALL 2026-04-25 11:42:35 +08:00
3ca5db95e0 ♻️ refactor(im): 重命名 IM 模块中的多个类和文件以简化结构 2026-04-23 20:38:27 +08:00
8b908afe90 ♻️ refactor(error): 优化错误码常量和消息提示 2026-04-23 20:08:30 +08:00
6a10ed7d88 feat(im): 更新群组和群成员相关接口,优化成员查询逻辑
- 修改获取当前用户群组列表的接口名称,提升语义清晰度
- 新增获取有效群成员 userId 列表的接口,支持缓存
- 优化群成员查询逻辑,确保历史消息可见性
- 更新相关文档,补充接口说明和使用示例
2026-04-23 18:43:53 +08:00
16d5c0b0cc feat(im): 完善单元测试 2026-04-23 13:46:14 +08:00
843cc90b87 feat(im): 好友/群成员添加增加唯一索引并发兼容
- ImFriendServiceImpl#addFriend0 捕获 DuplicateKeyException
  并发插入冲突时忽略(另一方插入必然为 ENABLE 状态)
- ImGroupMemberServiceImpl#addGroupMember 改为先查后写:
  已存在 DISABLE 复活为 ENABLE,新记录 insert 失败降级 select 返回
- ImGroupMemberServiceImpl#addGroupMembers 批量 insert 触发
  DuplicateKey 时降级为逐个 addGroupMember 走幂等兜底
- 依赖 im_friend.uk_user_friend 与 im_group_member.uk_group_user 唯一索引
2026-04-23 09:12:10 +08:00
106cf1c9f7 feat(im): 好友/群成员添加增加唯一索引并发兼容
- ImFriendServiceImpl#addFriend0 捕获 DuplicateKeyException
  并发插入冲突时忽略(另一方插入必然为 ENABLE 状态)
- ImGroupMemberServiceImpl#addGroupMember 改为先查后写:
  已存在 DISABLE 复活为 ENABLE,新记录 insert 失败降级 select 返回
- ImGroupMemberServiceImpl#addGroupMembers 批量 insert 触发
  DuplicateKey 时降级为逐个 addGroupMember 走幂等兜底
- 依赖 im_friend.uk_user_friend 与 im_group_member.uk_group_user 唯一索引
2026-04-23 09:10:05 +08:00
f5b0750899 ♻️ refactor(im): 将 ImUserController 迁移到 system UserController
- 删除 ImUserController、ImUserRespVO(get-self 复用 UserProfileController#getUserProfile)
- UserController 新增 /get-simple、/list-by-nickname 免鉴权接口(用于 IM 点头像弹名片、加好友搜索),整理到类末尾并用分隔注释标识
- UserSimpleRespVO 补充 avatar、sex 字段
2026-04-23 01:35:41 +08:00
1896721575 feat(im): 群/好友更新消息改为事件通知,客户端自行拉取
- ImPrivateMessageDTO#ofFriendUpdate 移除 content 字段,删除 FriendUpdateMessage
- 新增 ImMessageTypeEnum.GROUP_MEMBER_UPDATE(203) 和 ofGroupMemberUpdate 工厂方法
- ImGroupMemberServiceImpl#updateGroupMember 推送成员变更事件(多端同步,仅推自己)
2026-04-23 01:17:48 +08:00
44981bbee8 ♻️ refactor(im): 拆分 updateGroup 职责,仅保留群整体信息更新
- ImGroupServiceImpl#updateGroup 移除 displayUserName/displayGroupName 处理逻辑,交由 updateGroupMember 承接
- 去掉 hasGroupInfoChange 判断,群主校验前置
- ImGroupUpdateReqVO 清理 displayUserName/displayGroupName 字段
2026-04-23 01:12:27 +08:00
fa474c6f03 feat(group): 添加群聊成员限制及邀请好友功能
新增群聊成员人数限制,最大成员数为 500。实现邀请好友功能,确保被邀请人是当前用户的好友,若不是则返回相应错误提示。更新相关提示信息以提升用户体验。
2026-04-23 00:59:17 +08:00
84304718dc feat(group): 支持批量邀请和移除群成员 2026-04-23 00:42:36 +08:00
b814a87361 feat(group): 添加群成员管理功能
实现群成员的邀请、退出和移除功能,支持群主对成员的管理操作。新增相关提示信息和错误码,优化群成员更新逻辑,确保群主无法退出群聊。

BREAKING CHANGE: 群解散相关逻辑已调整为群删除,更新了相关消息推送类型
2026-04-22 23:57:45 +08:00
ea29dea47c feat(group): 添加群解散功能及提示消息
实现群解散功能,允许群主解散群聊并通知所有成员。新增群解散提示消息格式,并在解散时推送给群成员。增加了校验用户是否为群主的方法,以确保操作的合法性。
2026-04-22 22:24:50 +08:00
886f4fe1f2 ♻️ refactor(group): 移除冗余方法并添加群成员移除功能
重构 ImGroupMemberMapper 和 ImGroupMemberService,移除不再使用的方法,简化代码结构。同时新增群成员移除功能,以支持群解散场景。
2026-04-22 22:11:45 +08:00
cce3dd6110 feat(group): 添加群消息已读位置管理功能
新增删除用户在群中的已读位置和清理群所有用户已读位置的功能,支持成员退群和群解散场景。此功能提升了群消息管理的灵活性和用户体验。
2026-04-22 21:48:10 +08:00
443d91d7e3 feat(group): 添加群成员邀请和更新功能
新增群成员邀请接口,允许用户将其他用户加入群组。同时,更新群成员信息的接口也进行了调整,以支持群内昵称和群名备注的修改。这些改动提升了群组管理的灵活性和用户体验。
2026-04-22 21:16:07 +08:00
e4a6cc932c feat(websocket): 支持事务感知的异步消息推送
实现了在事务中推送 WebSocket 消息的功能,确保在事务提交后再发送消息,避免客户端在查询数据库时看到未提交的变更。新增了 executeAfterTransaction 方法来处理事务同步,优化了私聊和群聊消息的发送逻辑。
2026-04-22 18:47:15 +08:00
736a1a2f16 feat(group): 添加用户侧群组和成员接口
新增获取当前登录用户的群列表和指定群的成员列表接口,支持聚合用户昵称和头像信息。优化群组成员查询逻辑,确保返回有效的群成员数据。

- 实现用户侧接口 `/im/group/list-my` 和 `/im/group-member/list`
- 聚合 AdminUser 的昵称和头像信息
- 过滤已封禁和解散的群组
2026-04-22 12:54:23 +08:00
2ab72872be feat(im): 添加 WebSocket 服务和消息推送功能
新增 IM WebSocket 服务接口及实现,支持异步推送私聊和群聊消息。
同时,重构相关消息发送逻辑,提升代码可读性和维护性。

- 新增 ImWebSocketService 接口
- 实现 ImWebSocketServiceImpl 类
- 更新 ImPrivateMessageService 和 ImGroupMessageService 以使用 WebSocket 推送
2026-04-22 12:30:08 +08:00
e2eab4fe78 ♻️ refactor(friend): 重构好友关系管理逻辑,简化双向绑定方法 2026-04-22 08:52:18 +08:00
15a1bca721 ♻️ refactor(friend): 重构好友关系相关逻辑,优化查询与缓存 2026-04-22 08:39:53 +08:00
affc409022 feat(friend): 新增 IM 好友管理功能,包括添加、删除和更新好友信息
实现了 IM 好友的增删改查功能,支持免打扰状态的更新。新增了相关的请求和响应对象,优化了好友列表的获取逻辑,并确保了好友关系的有效性校验。

- 新增 ImFriendRespVO 和 ImFriendUpdateReqVO 类
- 更新 ImFriendController,添加更新好友信息接口
- 实现 ImFriendService 中的好友管理逻辑
2026-04-21 22:20:52 +08:00
758dfcbb80 📝 docs(controller): 移除控制器类中的作者注释 2026-04-21 20:33:23 +08:00
ef19ad396e feat(message): 优化群聊的 pullGroupMessageList 方法,解决空分页的风险(pro 增强) 2026-04-21 20:11:01 +08:00
2f084bd5e6 feat(message): 优化群聊的 pullGroupMessageList 方法,解决空分页的风险(pro 增强) 2026-04-21 20:10:52 +08:00
99121a25e0 feat(message): 优化群聊的 pullGroupMessageList 方法,解决空分页的风险(pro 增强) 2026-04-21 20:02:47 +08:00
0ce9eddedb feat(message): 优化群聊的 pullGroupMessageList 方法,解决空分页的风险 2026-04-21 17:23:16 +08:00
bf8eb273ec feat(message): 优化群聊的 enrichPullResultForViewer 已读状态、人数 2026-04-21 14:04:21 +08:00
5e824ccb4e feat(message): 优化群聊的 enrichPullResultForViewer 已读状态、人数 2026-04-21 13:20:05 +08:00
3361c75726 feat(message): 继续优化群聊的实现 2026-04-21 11:24:49 +08:00
7057f4715b feat(message): 群聊消息的实现 2026-04-21 09:52:06 +08:00
26413e09f3 feat(message): 评审群聊消息的实现 2026-04-21 00:48:14 +08:00
37cf16c142 📝 docs(model): 添加好友和群组状态字段说明 2026-04-20 23:27:47 +08:00
ab35a13fc4 📝 docs(diff): 更新私聊已读位置文档,明确不再通过 HTTP 读取 maxReadId 2026-04-20 21:24:46 +08:00
4ab9569508 feat(im):优化私聊的推送为 ImPrivateMessageDTO 2026-04-20 20:33:36 +08:00
ca0aadac49 feat(im): 添加私聊历史消息列表请求对象及相关接口调整 2026-04-20 19:08:52 +08:00
e89724e5cd feat(im): 修复单测报错的问题 2026-04-20 14:32:56 +08:00
f495f9c805 feat(im): 添加私聊私聊历史消息查询功能 2026-04-20 14:04:30 +08:00
2ce3a99318 feat(im): 优化消息撤回的逻辑 2026-04-20 10:03:35 +08:00
04ea1c9db5 feat(im): 优化私聊消息已读的处理逻辑 2026-04-20 08:57:18 +08:00
dc7be58506 feat(im): 优化 pullPrivateMessageList 接口的实现 2026-04-19 23:23:58 +08:00
d6d90b2bd5 feat(im): 优化 private message 单挑的发送接口 2026-04-19 22:31:26 +08:00
bee3337925 ♻️ refactor(im): 重命名群聊和私聊消息相关方法以提高可读性
重构了 ImGroupMessageController 和 ImPrivateMessageController 中的方法名称,
将 sendMessage、pullMessages、readMessages 和 recallMessage 等方法重命名为
sendGroupMessage、pullGroupMessages、readGroupMessages 和 recallGroupMessage。
同时,更新了相关服务和测试类中的调用,确保一致性和可读性。
2026-04-18 23:31:31 +08:00
ac05257ec0 ♻️ refactor(im): 修改消息相关字段类型为 Long,优化数据处理 2026-04-18 21:50:50 +08:00
6da5846b74 📝 refactor(ImGroupMessageRespVO): change user ID fields to List<Long> for better type safety 2026-04-12 19:29:50 +08:00
0e3373c553 📝 refactor: 移除不必要的字段,更新接口方法以支持状态参数 2026-04-12 19:21:49 +08:00
5ded56853e 📝 feat(im): 完成代码审查,更新逻辑删除和敏感词处理,优化群聊消息和好友关系管理 2026-04-12 19:01:21 +08:00
16e1936c48 📝 refactor(group): 重命名群组成员相关类和包,统一状态枚举为 CommonStatusEnum 2026-04-12 16:27:26 +08:00
ba5b7dbd0a 📝 refactor(messages): 重构消息类,简化字段命名和结构,增强可读性 2026-04-12 15:27:21 +08:00
f6a29e530a 📝 refactor(im): 移除后端的 conversation 2026-04-12 11:54:00 +08:00
1269e626ca 📝 refactor(controller): 移除不必要的导入和注解,优化会话和群成员响应对象 2026-04-12 11:15:54 +08:00
0ac1f0cc28 📝 refactor(controller): 移除不必要的导入和注解,优化会话和群成员响应对象 2026-04-12 11:15:38 +08:00
2d277765e7 📝 feat(im): 添加 IM 相关服务接口和实现,更新消息处理逻辑,增强敏感词校验功能 2026-04-12 10:39:47 +08:00
984312302a Merge branch 'master-jdk17' of https://gitee.com/zhijiantianya/ruoyi-vue-pro into feature/im-dev
# Conflicts:
#	pom.xml
#	script/idea/http-client.env.json
#	yudao-server/pom.xml
2026-04-11 00:05:34 +08:00
da92b5a582 接口融合 2025-01-04 20:12:17 +08:00
b49339d08b conversationNo更新 2025-01-04 20:08:24 +08:00
1f58fd2be4 【代码评审】IM:消息相关接口 2024-12-15 19:17:04 +08:00
d67362043e 创建会话 2024-12-12 22:21:35 +08:00
29a3ad42b6 TODO处理 2024-10-28 16:29:38 +08:00
40be6ed727 【代码评审】IM:会话、消息相关的接口 2024-10-28 09:30:04 +08:00
788c24dff4 会话和消息处理 2024-10-26 19:42:34 +08:00
b540f8d46d 字段更新 2024-10-19 16:09:27 +08:00
dd272cb54a 【功能修复】IM:解决报错问题 2024-10-14 19:31:16 +08:00
267477c973 Merge branch 'master-jdk17' of https://gitee.com/zhijiantianya/ruoyi-vue-pro into feature/im-dev
# Conflicts:
#	pom.xml
#	yudao-server/pom.xml
#	yudao-server/src/main/resources/application-local.yaml
#	yudao-server/src/main/resources/application.yaml
2024-10-14 12:29:27 +08:00
2c5287a9b2 【修复】IM:基于 offset 读取不到消息时,报 NPE 问题 2024-06-12 19:46:06 +08:00
f1731e4446 【代码评审】IM:review IM 前缀的命名 2024-06-03 12:56:59 +08:00
dc28c7e8a2 【代码评审】IM:review IM 前缀的命名 2024-06-03 12:56:54 +08:00
bada82f8cc 修改:代码优化 2024-06-02 17:01:28 +08:00
651619d5ef 【代码评审】IM:review 消息的实现 2024-04-28 19:46:13 +08:00
fa23ce144d 修改:代码优化 2024-03-31 22:47:18 +08:00
2b891cb432 IM:code review 消息发送的实现 2024-03-30 22:01:44 +08:00
84cea03752 修改: 发送消息使用WebSocketSenderApi 2024-03-28 22:33:01 +08:00
51e724fc90 修改:置顶会话和更新最后已读时间 2024-03-28 21:39:24 +08:00
4015b2f213 新增:消息发送和代码优化 2024-03-27 23:28:00 +08:00
0e79d8ec53 im:code review 消息发送的逻辑 2024-03-21 13:54:49 +08:00
9c1764e36e im:code review 代码风格方面 2024-03-21 12:51:03 +08:00
04123e5987 新增:获取会话列表,获取消息列表 2024-03-18 20:59:29 +08:00
354fe6fcab 新增:im sql建表语句 2024-03-16 15:48:59 +08:00
9cee1b3ceb 新增:群聊发送 2024-03-16 15:43:42 +08:00
f694825435 修改:私聊发送代码优化 2024-03-16 12:17:35 +08:00
ff88d53b3b 新增:私聊消息发送成功后保存会话列表 2024-03-16 11:57:52 +08:00
77f3131ef3 修改:私聊消息判断发送状态 2024-03-13 23:57:34 +08:00
2d052ea752 修改:私聊消息存库 2024-03-13 22:48:18 +08:00
3696b666f4 修改:im 模块简单实现 2024-03-13 21:43:05 +08:00
bb0b7056cf 新建:im 模块 2024-03-12 17:01:37 +08:00
647 changed files with 49390 additions and 369 deletions

BIN
.DS_Store vendored

Binary file not shown.

1
.gitignore vendored
View File

@ -51,4 +51,5 @@ rebel.xml
application-my.yaml
/yudao-ui-app/unpackage/
.DS_Store
**/.DS_Store

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

View File

@ -28,8 +28,8 @@
| 【完整版】[ruoyi-vue-pro](https://gitee.com/zhijiantianya/ruoyi-vue-pro) | [`master`](https://gitee.com/zhijiantianya/ruoyi-vue-pro/tree/master/) 分支 | [`master-jdk17`](https://gitee.com/zhijiantianya/ruoyi-vue-pro/tree/master-jdk17/) 分支 |
| 【精简版】[yudao-boot-mini](https://gitee.com/yudaocode/yudao-boot-mini) | [`master`](https://gitee.com/yudaocode/yudao-boot-mini/tree/master/) 分支 | [`master-jdk17`](https://gitee.com/yudaocode/yudao-boot-mini/tree/master-jdk17/) 分支 |
* 【完整版】包括系统功能、基础设施、会员中心、数据报表、工作流程、商城系统、微信公众号、CRM、ERP、MES、AI 大模型、IoT 物联网 等功能
* 【精简版】只包括系统功能、基础设施功能不包括会员中心、数据报表、工作流程、商城系统、微信公众号、CRM、ERP、MES、AI 大模型、IoT 物联网 等功能
* 【完整版】包括系统功能、基础设施、会员中心、数据报表、工作流程、商城系统、微信公众号、CRM、ERP、WMS、MES、IM 即时通讯、AI 大模型、IoT 物联网等功能
* 【精简版】只包括系统功能、基础设施功能不包括会员中心、数据报表、工作流程、商城系统、微信公众号、CRM、ERP、WMS、MES、IM 即时通讯、AI 大模型、IoT 物联网等功能
可参考 [《迁移文档》](https://doc.iocoder.cn/migrate-module/) ,只需要 5-10 分钟,即可将【完整版】按需迁移到【精简版】
@ -102,7 +102,7 @@
团队包含专业的项目经理、架构师、前端工程师、后端工程师、测试工程师、运维工程师,可以提供全流程的外包服务。
项目可以是商城、SCRM 系统、OA 系统、物流系统、ERP 系统、CMS 系统、HIS 系统、支付系统、IM 聊天、微信公众号、微信小程序等等。
项目可以是商城、SCRM 系统、OA 系统、物流系统、ERP 系统、CMS 系统、HIS 系统、支付系统、IM 即时通讯、微信公众号、微信小程序等等。
## 🐼 内置功能
@ -112,7 +112,7 @@
* 通用模块(必选):系统功能、基础设施
* 通用模块(可选):工作流程、支付系统、数据报表、会员中心
* 业务系统(按需):ERP 系统、CRM 系统、MES 系统、商城系统、微信公众号、AI 大模型、IoT 物联网
* 业务系统(按需):Mall 电子商城、OA 办公自动化、ERP 企业资源计划系统、WMS 仓库管理系统、CRM 客户关系管理、CMS 内容管理系统、MES 执行制造系统、AI 大模型平台、IoT 物联网系统、IM 即时通讯系统、Mobile 手机移动端、Report 数据大屏
> 友情提示:本项目基于 RuoYi-Vue 修改,**重构优化**后端的代码,**美化**前端的界面。
>
@ -270,6 +270,14 @@
![功能图](/.image/common/erp-feature.png)
### WMS 系统
演示地址:<https://doc.iocoder.cn/wms-preview/>
![功能图](/.image/common/wms-feature.png)
![功能图](/.image/common/wms-preview.png)
### CRM 系统
演示地址:<https://doc.iocoder.cn/crm-preview/>
@ -300,6 +308,19 @@
![预览图](/.image/common/iot-preview.png)
### IM 即时通讯
演示地址Boot<https://doc.iocoder.cn/im-preview/>
演示地址Vue3 + Element Plus<http://dashboard-vue3.yudao.iocoder.cn>
![功能图](/.image/common/im-feature.png)
| 聊天界面 | 聊天管理 |
| --- | --- |
| ![聊天界面](/.image/common/im-preview-home.png) | ![聊天管理](/.image/common/im-preview-manager.png) |
## 🐨 技术栈
### 模块
@ -318,6 +339,8 @@
| `yudao-module-erp` | ERP 系统的 Module 模块 |
| `yudao-module-crm` | CRM 系统的 Module 模块 |
| `yudao-module-mes` | MES 系统的 Module 模块 |
| `yudao-module-wms` | WMS 系统的 Module 模块 |
| `yudao-module-im` | IM 即时通讯的 Module 模块 |
| `yudao-module-ai` | AI 大模型的 Module 模块 |
| `yudao-module-iot` | IoT 物联网的 Module 模块 |
| `yudao-module-mp` | 微信公众号的 Module 模块 |

View File

@ -25,6 +25,8 @@
<!-- <module>yudao-module-erp</module>-->
<!-- <module>yudao-module-iot</module>-->
<!-- <module>yudao-module-mes</module>-->
<!-- <module>yudao-module-wms</module>-->
<!-- <module>yudao-module-im</module>-->
<!-- 请参考 https://doc.iocoder.cn/ai/build/ 文档,完成 AI 模块的启动!!! -->
<!-- <module>yudao-module-ai</module>-->
</modules>
@ -34,7 +36,7 @@
<url>https://github.com/YunaiV/ruoyi-vue-pro</url>
<properties>
<revision>2026.04-SNAPSHOT</revision>
<revision>2026.05-SNAPSHOT</revision>
<!-- Maven 相关 -->
<java.version>17</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>

View File

@ -0,0 +1,32 @@
# LiveKit Server PoC
最小可用的 LiveKit Server 自部署验证环境,用于零期 PoC。
## 启动
```bash
cd tools/livekit-poc
docker compose up -d
bash verify.sh
```
## 端口
- 7880HTTP / WebSocket 信令;
- 7881WebRTC TCP fallback
- 7882/UDPWebRTC 媒体;
- macOS / Windows当前 `docker-compose.yml` 走端口映射模式webhook URL 用 `host.docker.internal:48080` 让容器访问到宿主机 yudao 后端;
- macOS 上 host network`network_mode: host`)需要 Docker Desktop 4.34+ 并在 Settings → Resources → Network 勾选「Enable host networking」老版本静默失败容器跑得起来但端口完全不通
- Linux可以把 `docker-compose.yml` 改成 `network_mode: host` + 删 `ports:` 段,并把 `livekit.yaml` 的 webhook URL 改为 `http://127.0.0.1:48080/admin-api/im/livekit/webhook`
## 凭据 (仅 PoC勿用于生产)
- `LIVEKIT_KEYS=devkey: secret-poc-key-min-32-chars-required-here`
- API Key`devkey`
- API Secret`secret-poc-key-min-32-chars-required-here`
生产环境必须改用强随机 secret并通过 `--config /etc/livekit.yaml` 加载。
## 浏览器联调
`verify.sh` 跑完会输出一个 `meet.livekit.io` 链接,用两个浏览器(或两台机器)打开同一链接即可看到对方画面。

View File

@ -0,0 +1,20 @@
services:
livekit:
image: docker.m.daocloud.io/livekit/livekit-server:latest
container_name: yudao-livekit-dev
restart: unless-stopped
# 端口映射模式
# macOS / Windows 必走这种方式Docker Desktop 4.34 以下没有 host network
# Linux 可以改 network_mode: host 省去映射,并把 livekit.yaml 的 webhook url 换成 127.0.0.1
ports:
- "7880:7880" # HTTP / WebSocket 信令
- "7881:7881" # WebRTC TCP fallback
- "7882:7882/udp" # WebRTC UDP (dev 模式 UDP mux 单端口)
volumes:
# 挂载 config 文件webhook 配置在 livekit.yaml 里
- ./livekit.yaml:/etc/livekit.yaml:ro
command:
- --config
- /etc/livekit.yaml
- --bind
- 0.0.0.0

View File

@ -0,0 +1,30 @@
# LiveKit Server 本地开发配置PoC 用,勿用于生产)
# 替代 docker --dev 模式;为支持 webhook 必须用 config 文件而非 env
keys:
devkey: secret-poc-key-min-32-chars-required-here
# 端口
port: 7880
rtc:
tcp_port: 7881
udp_port: 7882
use_external_ip: false
# Webhook成员离开 / 房间结束等事件回调到 yudao 后端做业务态兜底清理
# host.docker.internal 让容器访问宿主机 macOS / Windows 上的 yudao 后端
# Linux 上 docker compose 可改 network_mode: host这里同步改成 127.0.0.1
# api_key 用于签发 JWTyudao 后端用相同 secret 验证签名
webhook:
api_key: devkey
urls:
- http://host.docker.internal:48080/admin-api/im/livekit/webhook
# 房间无人时多久销毁;秒;之前 PoC 默认 300给低些方便排查
room:
empty_timeout: 300
departure_timeout: 20
# 开发模式:放宽 secret 长度限制 + 内置 TURN 服务
development: true
log_level: info

105
script/livekit-poc/verify.sh Executable file
View File

@ -0,0 +1,105 @@
#!/usr/bin/env bash
# LiveKit Server PoC 验证脚本;
# 用法: bash verify.sh
set -e
API_KEY="${LIVEKIT_API_KEY:-devkey}"
API_SECRET="${LIVEKIT_API_SECRET:-secret-poc-key-min-32-chars-required-here}"
HOST="${LIVEKIT_HOST:-localhost:7880}"
ROOM="${LIVEKIT_ROOM:-poc-room}"
ok() { printf "[OK] %s\n" "$1"; }
fail() { printf "[FAIL] %s\n" "$1"; exit 1; }
echo "==> 1/5 等待 HTTP 端点就绪 (http://${HOST}/)"
for i in $(seq 1 20); do
code=$(curl -s -o /dev/null -w "%{http_code}" "http://${HOST}/" || echo "000")
[ "$code" = "200" ] && { ok "HTTP 200"; break; }
[ $i -eq 20 ] && fail "20 秒内未就绪 (last code=${code})"
sleep 1
done
echo "==> 2/5 签发管理 + 客户端权限 Token"
TOKEN=$(API_KEY="$API_KEY" API_SECRET="$API_SECRET" ROOM="$ROOM" python3 - <<'PY'
import json, time, hmac, hashlib, base64, os
def b64u(b): return base64.urlsafe_b64encode(b).rstrip(b'=').decode()
header = b64u(json.dumps({"alg":"HS256","typ":"JWT"}, separators=(',',':')).encode())
payload = b64u(json.dumps({
"iss": os.environ["API_KEY"],
"sub": "poc-tester",
"name": "PoC Tester",
"video": {
"roomJoin": True, "room": os.environ["ROOM"],
"canPublish": True, "canSubscribe": True, "canPublishData": True,
"roomCreate": True, "roomList": True, "roomAdmin": True
},
"exp": int(time.time()) + 3600,
"nbf": int(time.time())
}, separators=(',',':')).encode())
sig = b64u(hmac.new(os.environ["API_SECRET"].encode(),
f"{header}.{payload}".encode(),
hashlib.sha256).digest())
print(f"{header}.{payload}.{sig}")
PY
)
[ -n "$TOKEN" ] || fail "Token 生成失败"
ok "Token 已生成 (${#TOKEN} chars)"
echo "==> 3/5 创建房间 ${ROOM} (CreateRoom RPC)"
create_resp=$(curl -s -X POST "http://${HOST}/twirp/livekit.RoomService/CreateRoom" \
-H "Authorization: Bearer ${TOKEN}" \
-H "Content-Type: application/json" \
-d "{\"name\":\"${ROOM}\",\"empty_timeout\":300,\"max_participants\":10}")
echo " 响应: $create_resp"
echo "$create_resp" | jq -e '.sid' >/dev/null 2>&1 \
&& ok "房间已创建" \
|| fail "CreateRoom 失败"
echo "==> 4/5 列出房间 (ListRooms RPC)"
list_resp=$(curl -s -X POST "http://${HOST}/twirp/livekit.RoomService/ListRooms" \
-H "Authorization: Bearer ${TOKEN}" \
-H "Content-Type: application/json" \
-d '{}')
room_count=$(echo "$list_resp" | jq '.rooms | length' 2>/dev/null || echo "0")
ok "当前房间数: ${room_count}"
echo "$list_resp" | jq '.'
echo "==> 5/5 删除房间 (DeleteRoom RPC) —— 清理"
del_resp=$(curl -s -X POST "http://${HOST}/twirp/livekit.RoomService/DeleteRoom" \
-H "Authorization: Bearer ${TOKEN}" \
-H "Content-Type: application/json" \
-d "{\"room\":\"${ROOM}\"}")
ok "删除响应: $del_resp"
# 重新签一个仅 client 权限的 token用于浏览器进会
CLIENT_TOKEN=$(API_KEY="$API_KEY" API_SECRET="$API_SECRET" ROOM="$ROOM" python3 - <<'PY'
import json, time, hmac, hashlib, base64, os
def b64u(b): return base64.urlsafe_b64encode(b).rstrip(b'=').decode()
header = b64u(json.dumps({"alg":"HS256","typ":"JWT"}, separators=(',',':')).encode())
payload = b64u(json.dumps({
"iss": os.environ["API_KEY"],
"sub": "browser-tester",
"name": "Browser",
"video": {
"roomJoin": True, "room": os.environ["ROOM"],
"canPublish": True, "canSubscribe": True, "canPublishData": True
},
"exp": int(time.time()) + 7200
}, separators=(',',':')).encode())
sig = b64u(hmac.new(os.environ["API_SECRET"].encode(),
f"{header}.{payload}".encode(),
hashlib.sha256).digest())
print(f"{header}.{payload}.{sig}")
PY
)
echo ""
echo "============================================================"
echo " LiveKit Server 验证通过"
echo "============================================================"
echo " 浏览器测试 (开两个窗口能互通)"
echo " https://meet.livekit.io/?liveKitUrl=ws%3A%2F%2F${HOST}&token=${CLIENT_TOKEN}"
echo ""
echo " 停止服务:"
echo " docker compose -f tools/livekit-poc/docker-compose.yml down"
echo "============================================================"

View File

@ -11,7 +11,7 @@
Target Server Version : 80200 (8.2.0)
File Encoding : 65001
Date: 10/05/2026 10:16:10
Date: 31/05/2026 22:29:18
*/
SET NAMES utf8mb4;
@ -92,7 +92,7 @@ CREATE TABLE `infra_api_error_log` (
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_create_time`(`create_time` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 23844 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统异常日志';
) ENGINE = InnoDB AUTO_INCREMENT = 23958 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统异常日志';
-- ----------------------------
-- Records of infra_api_error_log
@ -253,7 +253,7 @@ CREATE TABLE `infra_file` (
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2216 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '文件表';
) ENGINE = InnoDB AUTO_INCREMENT = 2233 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '文件表';
-- ----------------------------
-- Records of infra_file
@ -284,17 +284,17 @@ CREATE TABLE `infra_file_config` (
-- Records of infra_file_config
-- ----------------------------
BEGIN;
INSERT INTO `infra_file_config` (`id`, `name`, `storage`, `remark`, `master`, `config`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (4, '数据库(示例)', 1, '我是数据库', b'0', '{\"@class\":\"cn.iocoder.yudao.module.infra.framework.file.core.client.db.DBFileClientConfig\",\"domain\":\"http://127.0.0.1:48080\"}', '1', '2022-03-15 23:56:24', '1', '2025-11-24 20:57:14', b'0');
INSERT INTO `infra_file_config` (`id`, `name`, `storage`, `remark`, `master`, `config`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (22, '七牛存储器(示例)', 20, '请换成你自己的密钥!!!', b'1', '{\"@class\":\"cn.iocoder.yudao.module.infra.framework.file.core.client.s3.S3FileClientConfig\",\"endpoint\":\"s3.cn-south-1.qiniucs.com\",\"domain\":\"http://test.yudao.iocoder.cn\",\"bucket\":\"ruoyi-vue-pro\",\"accessKey\":\"3TvrJ70gl2Gt6IBe7_IZT1F6i_k0iMuRtyEv4EyS\",\"accessSecret\":\"wd0tbVBYlp0S-ihA8Qg2hPLncoP83wyrIq24OZuY\",\"enablePathStyleAccess\":false,\"enablePublicAccess\":true}', '1', '2024-01-13 22:11:12', '1', '2025-11-24 20:57:14', b'0');
INSERT INTO `infra_file_config` (`id`, `name`, `storage`, `remark`, `master`, `config`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (24, '腾讯云存储(示例)', 20, '请换成你的密钥!!!', b'0', '{\"@class\":\"cn.iocoder.yudao.module.infra.framework.file.core.client.s3.S3FileClientConfig\",\"endpoint\":\"https://cos.ap-shanghai.myqcloud.com\",\"domain\":\"http://tengxun-oss.iocoder.cn\",\"bucket\":\"aoteman-1255880240\",\"accessKey\":\"AKIDAF6WSh1uiIjwqtrOsGSN3WryqTM6cTMt\",\"accessSecret\":\"X\",\"enablePathStyleAccess\":false,\"enablePublicAccess\":true}', '1', '2024-11-09 16:03:22', '1', '2025-11-24 20:57:14', b'0');
INSERT INTO `infra_file_config` (`id`, `name`, `storage`, `remark`, `master`, `config`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (25, '阿里云存储(示例)', 20, '', b'0', '{\"@class\":\"cn.iocoder.yudao.module.infra.framework.file.core.client.s3.S3FileClientConfig\",\"endpoint\":\"oss-cn-beijing.aliyuncs.com\",\"domain\":\"http://ali-oss.iocoder.cn\",\"bucket\":\"yunai-aoteman\",\"accessKey\":\"LTAI5tEQLgnDyjh3WpNcdMKA\",\"accessSecret\":\"X\",\"enablePathStyleAccess\":false,\"enablePublicAccess\":true}', '1', '2024-11-09 16:47:08', '1', '2025-11-24 20:57:14', b'0');
INSERT INTO `infra_file_config` (`id`, `name`, `storage`, `remark`, `master`, `config`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (26, '火山云存储(示例)', 20, '', b'0', '{\"@class\":\"cn.iocoder.yudao.module.infra.framework.file.core.client.s3.S3FileClientConfig\",\"endpoint\":\"tos-s3-cn-beijing.volces.com\",\"domain\":null,\"bucket\":\"yunai\",\"accessKey\":\"AKLTZjc3Zjc4MzZmMjU3NDk0ZTgxYmIyMmFkNTIwMDI1ZGE\",\"accessSecret\":\"X==\",\"enablePathStyleAccess\":false,\"enablePublicAccess\":true}', '1', '2024-11-09 16:56:42', '1', '2025-11-24 20:57:14', b'0');
INSERT INTO `infra_file_config` (`id`, `name`, `storage`, `remark`, `master`, `config`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (27, '华为云存储(示例)', 20, '', b'0', '{\"@class\":\"cn.iocoder.yudao.module.infra.framework.file.core.client.s3.S3FileClientConfig\",\"endpoint\":\"obs.cn-east-3.myhuaweicloud.com\",\"domain\":\"\",\"bucket\":\"yudao\",\"accessKey\":\"PVDONDEIOTW88LF8DC4U\",\"accessSecret\":\"X\",\"enablePathStyleAccess\":false,\"enablePublicAccess\":true}', '1', '2024-11-09 17:18:41', '1', '2025-11-24 20:57:14', b'0');
INSERT INTO `infra_file_config` (`id`, `name`, `storage`, `remark`, `master`, `config`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (28, 'MinIO 存储(示例)', 20, '', b'0', '{\"@class\":\"cn.iocoder.yudao.module.infra.framework.file.core.client.s3.S3FileClientConfig\",\"endpoint\":\"http://127.0.0.1:9000\",\"domain\":\"http://127.0.0.1:9000/yudao\",\"bucket\":\"yudao\",\"accessKey\":\"admin\",\"accessSecret\":\"password\",\"enablePathStyleAccess\":false,\"enablePublicAccess\":true}', '1', '2024-11-09 17:43:10', '1', '2025-11-24 20:57:14', b'0');
INSERT INTO `infra_file_config` (`id`, `name`, `storage`, `remark`, `master`, `config`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (29, '本地存储(示例)', 10, 'mac/linux 使用 /windows 使用 \\', b'0', '{\"@class\":\"cn.iocoder.yudao.module.infra.framework.file.core.client.local.LocalFileClientConfig\",\"basePath\":\"/Users/yunai/tmp/file\",\"domain\":\"http://127.0.0.1:48080\"}', '1', '2025-05-02 11:25:45', '1', '2025-11-24 20:57:14', b'0');
INSERT INTO `infra_file_config` (`id`, `name`, `storage`, `remark`, `master`, `config`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (30, 'SFTP 存储(示例)', 12, '', b'0', '{\"@class\":\"cn.iocoder.yudao.module.infra.framework.file.core.client.sftp.SftpFileClientConfig\",\"basePath\":\"/upload\",\"domain\":\"http://127.0.0.1:48080\",\"host\":\"127.0.0.1\",\"port\":2222,\"username\":\"foo\",\"password\":\"pass\"}', '1', '2025-05-02 16:34:10', '1', '2025-11-24 20:57:14', b'0');
INSERT INTO `infra_file_config` (`id`, `name`, `storage`, `remark`, `master`, `config`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (34, '七牛云存储【私有】(示例)', 20, '请换成你自己的密钥!!!', b'0', '{\"@class\":\"cn.iocoder.yudao.module.infra.framework.file.core.client.s3.S3FileClientConfig\",\"endpoint\":\"s3.cn-south-1.qiniucs.com\",\"domain\":\"http://t151glocd.hn-bkt.clouddn.com\",\"bucket\":\"ruoyi-vue-pro-private\",\"accessKey\":\"3TvrJ70gl2Gt6IBe7_IZT1F6i_k0iMuRtyEv4EyS\",\"accessSecret\":\"wd0tbVBYlp0S-ihA8Qg2hPLncoP83wyrIq24OZuY\",\"enablePathStyleAccess\":false,\"enablePublicAccess\":false}', '1', '2025-08-17 21:22:00', '1', '2025-11-24 20:57:14', b'0');
INSERT INTO `infra_file_config` (`id`, `name`, `storage`, `remark`, `master`, `config`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (35, '1', 20, '1', b'0', '{\"@class\":\"cn.iocoder.yudao.module.infra.framework.file.core.client.s3.S3FileClientConfig\",\"endpoint\":\"http://www.baidu.com\",\"domain\":\"http://www.xxx.com\",\"bucket\":\"1\",\"accessKey\":\"2\",\"accessSecret\":\"3\",\"enablePathStyleAccess\":false,\"enablePublicAccess\":false,\"region\":\"1\"}', '1', '2025-10-02 14:32:12', '1', '2025-11-29 15:59:39', b'0');
INSERT INTO `infra_file_config` (`id`, `name`, `storage`, `remark`, `master`, `config`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (4, '数据库(示例)', 1, '我是数据库', b'0', '{\"@class\":\"cn.iocoder.yudao.module.infra.framework.file.core.client.db.DBFileClientConfig\",\"domain\":\"http://127.0.0.1:48080\"}', '1', '2022-03-15 23:56:24', '1', '2026-05-17 14:05:15', b'0');
INSERT INTO `infra_file_config` (`id`, `name`, `storage`, `remark`, `master`, `config`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (22, '七牛存储器(示例)', 20, '请换成你自己的密钥!!!', b'1', '{\"@class\":\"cn.iocoder.yudao.module.infra.framework.file.core.client.s3.S3FileClientConfig\",\"endpoint\":\"s3.cn-south-1.qiniucs.com\",\"domain\":\"http://test.yudao.iocoder.cn\",\"bucket\":\"ruoyi-vue-pro\",\"accessKey\":\"3TvrJ70gl2Gt6IBe7_IZT1F6i_k0iMuRtyEv4EyS\",\"accessSecret\":\"wd0tbVBYlp0S-ihA8Qg2hPLncoP83wyrIq24OZuY\",\"enablePathStyleAccess\":false,\"enablePublicAccess\":true}', '1', '2024-01-13 22:11:12', '1', '2026-05-17 14:05:15', b'0');
INSERT INTO `infra_file_config` (`id`, `name`, `storage`, `remark`, `master`, `config`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (24, '腾讯云存储(示例)', 20, '请换成你的密钥!!!', b'0', '{\"@class\":\"cn.iocoder.yudao.module.infra.framework.file.core.client.s3.S3FileClientConfig\",\"endpoint\":\"https://cos.ap-shanghai.myqcloud.com\",\"domain\":\"http://tengxun-oss.iocoder.cn\",\"bucket\":\"aoteman-1255880240\",\"accessKey\":\"AKIDAF6WSh1uiIjwqtrOsGSN3WryqTM6cTMt\",\"accessSecret\":\"X\",\"enablePathStyleAccess\":false,\"enablePublicAccess\":true}', '1', '2024-11-09 16:03:22', '1', '2026-05-17 14:05:15', b'0');
INSERT INTO `infra_file_config` (`id`, `name`, `storage`, `remark`, `master`, `config`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (25, '阿里云存储(示例)', 20, '', b'0', '{\"@class\":\"cn.iocoder.yudao.module.infra.framework.file.core.client.s3.S3FileClientConfig\",\"endpoint\":\"oss-cn-beijing.aliyuncs.com\",\"domain\":\"http://ali-oss.iocoder.cn\",\"bucket\":\"yunai-aoteman\",\"accessKey\":\"LTAI5tEQLgnDyjh3WpNcdMKA\",\"accessSecret\":\"X\",\"enablePathStyleAccess\":false,\"enablePublicAccess\":true}', '1', '2024-11-09 16:47:08', '1', '2026-05-17 14:05:15', b'0');
INSERT INTO `infra_file_config` (`id`, `name`, `storage`, `remark`, `master`, `config`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (26, '火山云存储(示例)', 20, '', b'0', '{\"@class\":\"cn.iocoder.yudao.module.infra.framework.file.core.client.s3.S3FileClientConfig\",\"endpoint\":\"tos-s3-cn-beijing.volces.com\",\"domain\":null,\"bucket\":\"yunai\",\"accessKey\":\"AKLTZjc3Zjc4MzZmMjU3NDk0ZTgxYmIyMmFkNTIwMDI1ZGE\",\"accessSecret\":\"X==\",\"enablePathStyleAccess\":false,\"enablePublicAccess\":true}', '1', '2024-11-09 16:56:42', '1', '2026-05-17 14:05:15', b'0');
INSERT INTO `infra_file_config` (`id`, `name`, `storage`, `remark`, `master`, `config`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (27, '华为云存储(示例)', 20, '', b'0', '{\"@class\":\"cn.iocoder.yudao.module.infra.framework.file.core.client.s3.S3FileClientConfig\",\"endpoint\":\"obs.cn-east-3.myhuaweicloud.com\",\"domain\":\"\",\"bucket\":\"yudao\",\"accessKey\":\"PVDONDEIOTW88LF8DC4U\",\"accessSecret\":\"X\",\"enablePathStyleAccess\":false,\"enablePublicAccess\":true}', '1', '2024-11-09 17:18:41', '1', '2026-05-17 14:05:15', b'0');
INSERT INTO `infra_file_config` (`id`, `name`, `storage`, `remark`, `master`, `config`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (28, 'MinIO 存储(示例)', 20, '', b'0', '{\"@class\":\"cn.iocoder.yudao.module.infra.framework.file.core.client.s3.S3FileClientConfig\",\"endpoint\":\"http://127.0.0.1:9000\",\"domain\":\"http://127.0.0.1:9000/yudao\",\"bucket\":\"yudao\",\"accessKey\":\"admin\",\"accessSecret\":\"password\",\"enablePathStyleAccess\":false,\"enablePublicAccess\":true}', '1', '2024-11-09 17:43:10', '1', '2026-05-17 14:05:15', b'0');
INSERT INTO `infra_file_config` (`id`, `name`, `storage`, `remark`, `master`, `config`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (29, '本地存储(示例)', 10, 'mac/linux 使用 /windows 使用 \\', b'0', '{\"@class\":\"cn.iocoder.yudao.module.infra.framework.file.core.client.local.LocalFileClientConfig\",\"basePath\":\"/Users/yunai/tmp/file\",\"domain\":\"http://127.0.0.1:48080\"}', '1', '2025-05-02 11:25:45', '1', '2026-05-17 14:05:15', b'0');
INSERT INTO `infra_file_config` (`id`, `name`, `storage`, `remark`, `master`, `config`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (30, 'SFTP 存储(示例)', 12, '', b'0', '{\"@class\":\"cn.iocoder.yudao.module.infra.framework.file.core.client.sftp.SftpFileClientConfig\",\"basePath\":\"/upload\",\"domain\":\"http://127.0.0.1:48080\",\"host\":\"127.0.0.1\",\"port\":2222,\"username\":\"foo\",\"password\":\"pass\"}', '1', '2025-05-02 16:34:10', '1', '2026-05-17 14:05:15', b'0');
INSERT INTO `infra_file_config` (`id`, `name`, `storage`, `remark`, `master`, `config`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (34, '七牛云存储【私有】(示例)', 20, '请换成你自己的密钥!!!', b'0', '{\"@class\":\"cn.iocoder.yudao.module.infra.framework.file.core.client.s3.S3FileClientConfig\",\"endpoint\":\"s3.cn-south-1.qiniucs.com\",\"domain\":\"http://t151glocd.hn-bkt.clouddn.com\",\"bucket\":\"ruoyi-vue-pro-private\",\"accessKey\":\"3TvrJ70gl2Gt6IBe7_IZT1F6i_k0iMuRtyEv4EyS\",\"accessSecret\":\"wd0tbVBYlp0S-ihA8Qg2hPLncoP83wyrIq24OZuY\",\"enablePathStyleAccess\":false,\"enablePublicAccess\":false}', '1', '2025-08-17 21:22:00', '1', '2026-05-17 14:05:15', b'0');
INSERT INTO `infra_file_config` (`id`, `name`, `storage`, `remark`, `master`, `config`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (35, '1', 20, '1', b'0', '{\"@class\":\"cn.iocoder.yudao.module.infra.framework.file.core.client.s3.S3FileClientConfig\",\"endpoint\":\"http://www.baidu.com\",\"domain\":\"http://www.xxx.com\",\"bucket\":\"1\",\"accessKey\":\"2\",\"accessSecret\":\"3\",\"enablePathStyleAccess\":false,\"enablePublicAccess\":false,\"region\":\"1\"}', '1', '2025-10-02 14:32:12', '1', '2026-05-17 14:05:15', b'0');
COMMIT;
-- ----------------------------
@ -313,7 +313,7 @@ CREATE TABLE `infra_file_content` (
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_config_id_path`(`config_id` ASC, `path` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 286 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '文件表';
) ENGINE = InnoDB AUTO_INCREMENT = 288 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '文件表';
-- ----------------------------
-- Records of infra_file_content
@ -462,7 +462,7 @@ CREATE TABLE `system_dict_data` (
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3603 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '字典数据表';
) ENGINE = InnoDB AUTO_INCREMENT = 1061122 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '字典数据表';
-- ----------------------------
-- Records of system_dict_data
@ -1095,6 +1095,8 @@ INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `st
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (3034, 1, 'ttt', 'tt', 'iot_ota_task_record_status', 0, 'success', '', NULL, '1', '2025-09-06 00:02:21', '1', '2025-09-06 00:02:31', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (3035, 40, '支付宝小程序', '40', 'system_social_type', 0, '', '', '', '1', '2023-11-04 13:05:38', '1', '2023-11-04 13:07:16', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (3036, 60, 'Admin Uniapp 移动端', '60', 'infra_codegen_front_type', 0, '', '', NULL, '1', '2025-12-16 19:25:51', '1', '2025-12-17 09:46:15', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (3037, 42, 'Vben5.0 Antdv Next Schema 模版', '42', 'infra_codegen_front_type', 0, '', '', '', '1', '2026-05-23 13:52:25', '1', '2026-05-23 13:52:25', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (3038, 43, 'Vben5.0 Antdv Next 标准模版', '43', 'infra_codegen_front_type', 0, '', '', '', '1', '2026-05-23 13:52:25', '1', '2026-05-23 13:52:25', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (3040, 1, 'UDP', 'udp', 'iot_protocol_type', 0, '', '', 'UDP 协议', '1', '2026-02-04 00:32:47', '1', '2026-02-04 00:32:47', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (3041, 2, 'WebSocket', 'websocket', 'iot_protocol_type', 0, '', '', 'WebSocket 协议', '1', '2026-02-04 00:32:55', '1', '2026-02-04 00:32:55', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (3042, 3, 'HTTP', 'http', 'iot_protocol_type', 0, '', '', 'HTTP 协议', '1', '2026-02-04 00:32:55', '1', '2026-02-04 00:32:55', b'0');
@ -1437,6 +1439,49 @@ INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `st
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (3600, 1, '未处理', '0', 'im_group_request_handle_result', 0, '', '', NULL, '', '2026-05-06 09:26:36', '', '2026-05-06 09:26:36', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (3601, 2, '同意', '1', 'im_group_request_handle_result', 0, '', '', NULL, '', '2026-05-06 09:26:36', '', '2026-05-06 09:26:36', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (3602, 3, '拒绝', '2', 'im_group_request_handle_result', 0, '', '', NULL, '', '2026-05-06 09:26:36', '', '2026-05-06 09:26:36', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1061051, 1, '客户', '1', 'merchant_type', 0, 'primary', '', '客户', '1', '2026-05-10 15:26:09', '1', '2026-05-10 15:26:09', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1061052, 2, '供应商', '2', 'merchant_type', 0, 'success', '', '供应商', '1', '2026-05-10 15:26:09', '1', '2026-05-10 15:26:09', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1061053, 3, '客户/供应商', '3', 'merchant_type', 0, 'warning', '', '客户/供应商', '1', '2026-05-10 15:26:09', '1', '2026-05-10 15:26:09', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1061061, 1, '入库单', '1', 'wms_order_type', 0, 'success', '', '', '1', '2026-05-10 17:51:46', '1', '2026-05-14 08:14:09', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1061062, 2, '出库单', '2', 'wms_order_type', 0, 'danger', '', '', '1', '2026-05-10 17:51:46', '1', '2026-05-14 08:14:09', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1061063, 3, '移库单', '3', 'wms_order_type', 0, 'primary', '', '', '1', '2026-05-10 17:51:46', '1', '2026-05-14 08:14:09', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1061064, 4, '盘库单', '4', 'wms_order_type', 0, 'warning', '', '', '1', '2026-05-10 17:51:46', '1', '2026-05-14 08:14:09', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1061071, 1, '草稿', '0', 'wms_order_status', 0, 'info', '', '草稿', '1', '2026-05-12 13:40:29', '1', '2026-05-12 13:40:29', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1061072, 2, '已完成', '4', 'wms_order_status', 0, 'success', '', '已完成', '1', '2026-05-12 13:40:29', '1', '2026-05-12 13:40:29', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1061073, 3, '已作废', '5', 'wms_order_status', 0, 'danger', '', '已作废', '1', '2026-05-12 13:40:29', '1', '2026-05-12 13:40:29', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1061081, 1, '生产入库', '100', 'wms_receipt_order_type', 0, 'success', '', '', '1', '2026-05-11 11:21:49', '1', '2026-05-14 02:21:20', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1061082, 2, '采购入库', '101', 'wms_receipt_order_type', 0, 'primary', '', '', '1', '2026-05-11 11:21:49', '1', '2026-05-14 02:21:20', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1061083, 3, '退货入库', '102', 'wms_receipt_order_type', 0, 'warning', '', '', '1', '2026-05-11 11:21:49', '1', '2026-05-14 02:21:20', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1061084, 4, '归还入库', '103', 'wms_receipt_order_type', 0, 'info', '', '', '1', '2026-05-13 16:02:33', '1', '2026-05-14 02:21:20', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1061091, 1, '退货出库', '200', 'wms_shipment_order_type', 0, 'warning', '', '退货出库', '1', '2026-05-12 17:48:35', '1', '2026-05-12 17:48:35', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1061092, 2, '销售出库', '201', 'wms_shipment_order_type', 0, 'primary', '', '销售出库', '1', '2026-05-12 17:48:35', '1', '2026-05-12 17:48:35', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1061093, 3, '生产出库', '202', 'wms_shipment_order_type', 0, 'success', '', '生产出库', '1', '2026-05-12 17:48:35', '1', '2026-05-12 17:48:35', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1061096, 1, '语音', '1', 'im_rtc_call_media_type', 0, '', '', '语音通话', 'admin', '2026-05-16 11:34:50', 'admin', '2026-05-16 11:34:50', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1061097, 2, '视频', '2', 'im_rtc_call_media_type', 0, '', '', '视频通话', 'admin', '2026-05-16 11:34:50', 'admin', '2026-05-16 11:34:50', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1061098, 1, '私聊', '1', 'im_rtc_call_conversation_type', 0, 'primary', '', '一对一私聊通话', 'admin', '2026-05-18 03:36:12', 'admin', '2026-05-18 03:36:12', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1061099, 2, '群聊', '2', 'im_rtc_call_conversation_type', 0, 'success', '', '群内多人通话', 'admin', '2026-05-18 03:36:12', 'admin', '2026-05-18 03:36:12', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1061100, 1, '创建', '10', 'im_rtc_call_status', 0, 'info', '', '通话已创建,等待接通', 'admin', '2026-05-18 03:36:12', 'admin', '2026-05-18 03:36:12', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1061101, 2, '进行中', '20', 'im_rtc_call_status', 0, 'primary', '', '已有人接通,通话中', 'admin', '2026-05-18 03:36:12', 'admin', '2026-05-18 03:36:12', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1061102, 3, '已结束', '30', 'im_rtc_call_status', 0, 'success', '', '通话结束', 'admin', '2026-05-18 03:36:12', 'admin', '2026-05-18 03:36:12', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1061103, 1, '通话结束', '1', 'im_rtc_call_end_reason', 0, 'success', '', '接通后任一方主动挂断', 'admin', '2026-05-18 03:36:12', 'admin', '2026-05-18 03:36:12', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1061104, 2, '已拒绝', '2', 'im_rtc_call_end_reason', 0, 'warning', '', '被叫接通前点拒接', 'admin', '2026-05-18 03:36:12', 'admin', '2026-05-18 03:36:12', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1061105, 3, '已取消', '3', 'im_rtc_call_end_reason', 0, 'info', '', '主叫接通前主动取消', 'admin', '2026-05-18 03:36:12', 'admin', '2026-05-18 03:36:12', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1061106, 4, '无人接听', '4', 'im_rtc_call_end_reason', 0, 'info', '', '振铃超时未接通', 'admin', '2026-05-18 03:36:12', 'admin', '2026-05-18 03:36:12', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1061107, 5, '对方正忙', '5', 'im_rtc_call_end_reason', 0, 'warning', '', '对方在另一通话中', 'admin', '2026-05-18 03:36:12', 'admin', '2026-05-18 03:36:12', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1061108, 6, '通话异常', '9', 'im_rtc_call_end_reason', 0, 'danger', '', '网络中断、设备失败等', 'admin', '2026-05-18 03:36:12', 'admin', '2026-05-18 03:36:12', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1061109, 1, '发起人', '1', 'im_rtc_participant_role', 0, 'primary', '', '通话发起者', 'admin', '2026-05-18 03:36:12', 'admin', '2026-05-18 03:36:12', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1061110, 2, '被邀请者', '2', 'im_rtc_participant_role', 0, 'info', '', '被邀请加入', 'admin', '2026-05-18 03:36:12', 'admin', '2026-05-18 03:36:12', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1061111, 3, '主动加入者', '3', 'im_rtc_participant_role', 0, 'success', '', '群通话场景,旁观者主动加入', 'admin', '2026-05-18 03:36:12', 'admin', '2026-05-18 03:36:12', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1061112, 1, '邀请中', '10', 'im_rtc_participant_status', 0, 'info', '', '已发出 invite等待响应', 'admin', '2026-05-18 03:36:12', 'admin', '2026-05-18 03:36:12', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1061113, 2, '已加入', '20', 'im_rtc_participant_status', 0, 'primary', '', '已接通并进入房间', 'admin', '2026-05-18 03:36:12', 'admin', '2026-05-18 03:36:12', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1061114, 3, '已拒绝', '30', 'im_rtc_participant_status', 0, 'warning', '', '接通前点拒接', 'admin', '2026-05-18 03:36:12', 'admin', '2026-05-18 03:36:12', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1061115, 4, '未应答', '40', 'im_rtc_participant_status', 0, 'info', '', '通话已结束仍未应答', 'admin', '2026-05-18 03:36:12', 'admin', '2026-05-18 03:36:12', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1061116, 5, '已离开', '50', 'im_rtc_participant_status', 0, 'success', '', '接通后挂断 / 离开', 'admin', '2026-05-18 03:36:12', 'admin', '2026-05-18 03:36:12', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1061117, 1610, '通话开始', '1610', 'im_message_type', 0, 'info', '', '入消息流;私聊定向通知,群聊全员广播', 'admin', '2026-05-18 03:36:12', 'admin', '2026-05-18 03:36:12', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1061118, 1611, '通话结束', '1611', 'im_message_type', 0, 'info', '', '入消息流;私聊准气泡,群聊系统 tip', 'admin', '2026-05-18 03:36:12', 'admin', '2026-05-18 03:36:12', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1061119, 125, '素材', '125', 'im_message_type', 0, 'success', '', '频道运营推送的图文卡片消息', '1', '2026-05-18 13:14:34', '1', '2026-05-18 13:14:34', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1061120, 1, '富文本', '1', 'im_channel_material_type', 0, 'primary', '', '', '1', '2026-05-19 14:09:25', '1', '2026-05-19 14:09:25', b'0');
INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1061121, 2, '外链', '2', 'im_channel_material_type', 0, 'info', '', '', '1', '2026-05-19 14:09:25', '1', '2026-05-19 14:09:25', b'0');
COMMIT;
-- ----------------------------
@ -1456,7 +1501,7 @@ CREATE TABLE `system_dict_type` (
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
`deleted_time` datetime NULL DEFAULT NULL COMMENT '删除时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2211 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '字典类型表';
) ENGINE = InnoDB AUTO_INCREMENT = 1061099 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '字典类型表';
-- ----------------------------
-- Records of system_dict_type
@ -1658,6 +1703,18 @@ INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creat
INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (2208, 'IM 好友申请处理结果', 'im_friend_request_handle_result', 0, NULL, '1', '2026-05-04 02:43:41', '1', '2026-05-04 02:43:41', b'0', NULL);
INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (2209, 'IM 加群来源', 'im_group_add_source', 0, NULL, '', '2026-05-06 09:26:36', '', '2026-05-06 09:26:36', b'0', NULL);
INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (2210, 'IM 加群申请处理结果', 'im_group_request_handle_result', 0, NULL, '', '2026-05-06 09:26:36', '', '2026-05-06 09:26:36', b'0', NULL);
INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (1061050, '往来企业类型', 'merchant_type', 0, 'WMS 往来企业类型', '1', '2026-05-10 15:26:09', '1', '2026-05-10 15:26:09', b'0', NULL);
INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (1061060, 'WMS 单据类型', 'wms_order_type', 0, 'WMS 单据类型', '1', '2026-05-10 17:51:46', '1', '2026-05-14 08:14:09', b'0', NULL);
INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (1061070, 'WMS 单据状态', 'wms_order_status', 0, 'WMS 单据状态', '1', '2026-05-12 13:40:29', '1', '2026-05-12 13:40:29', b'0', NULL);
INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (1061080, '入库单类型', 'wms_receipt_order_type', 0, 'WMS 入库单类型', '1', '2026-05-11 11:21:49', '1', '2026-05-12 13:40:29', b'0', NULL);
INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (1061090, '出库单类型', 'wms_shipment_order_type', 0, 'WMS 出库单类型', '1', '2026-05-12 17:48:35', '1', '2026-05-12 17:48:35', b'0', NULL);
INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (1061092, 'IM 通话媒体类型', 'im_rtc_call_media_type', 0, NULL, 'admin', '2026-05-16 11:34:50', 'admin', '2026-05-16 11:34:50', b'0', NULL);
INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (1061093, 'IM 通话会话类型', 'im_rtc_call_conversation_type', 0, '1=私聊2=群聊', 'admin', '2026-05-18 03:36:12', 'admin', '2026-05-18 03:36:12', b'0', NULL);
INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (1061094, 'IM 通话状态', 'im_rtc_call_status', 0, '10=创建20=进行中30=已结束', 'admin', '2026-05-18 03:36:12', 'admin', '2026-05-18 03:36:12', b'0', NULL);
INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (1061095, 'IM 通话结束原因', 'im_rtc_call_end_reason', 0, '1=通话结束2=已拒绝3=已取消4=无人接听5=对方正忙9=通话异常', 'admin', '2026-05-18 03:36:12', 'admin', '2026-05-18 03:36:12', b'0', NULL);
INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (1061096, 'IM 通话参与角色', 'im_rtc_participant_role', 0, '1=发起人2=被邀请者3=主动加入者', 'admin', '2026-05-18 03:36:12', 'admin', '2026-05-18 03:36:12', b'0', NULL);
INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (1061097, 'IM 通话参与状态', 'im_rtc_participant_status', 0, '10=邀请中20=已加入30=已拒绝40=未应答50=已离开', 'admin', '2026-05-18 03:36:12', 'admin', '2026-05-18 03:36:12', b'0', NULL);
INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (1061098, 'IM 频道素材内容类型', 'im_channel_material_type', 0, '1=站内富文本 / 2=外链', '1', '2026-05-19 14:09:25', '1', '2026-05-19 14:09:25', b'0', NULL);
COMMIT;
-- ----------------------------
@ -1683,7 +1740,7 @@ CREATE TABLE `system_login_log` (
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_username`(`username` ASC) USING BTREE,
INDEX `idx_create_time`(`create_time` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4550 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统访问记录';
) ENGINE = InnoDB AUTO_INCREMENT = 4697 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统访问记录';
-- ----------------------------
-- Records of system_login_log
@ -1816,7 +1873,7 @@ CREATE TABLE `system_menu` (
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6611 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '菜单权限表';
) ENGINE = InnoDB AUTO_INCREMENT = 6735 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '菜单权限表';
-- ----------------------------
-- Records of system_menu
@ -2748,7 +2805,7 @@ INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_i
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (5034, 'OTA 固件创建', 'iot:ota-firmware:create', 3, 2, 5032, '', '', '', '', 0, b'1', b'1', b'1', '', '2025-06-30 07:50:29', '\"1\"', '2025-06-30 17:38:21', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (5035, 'OTA 固件更新', 'iot:ota-firmware:update', 3, 3, 5032, '', '', '', '', 0, b'1', b'1', b'1', '', '2025-06-30 07:50:29', '\"1\"', '2025-06-30 17:38:29', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (5036, 'OTA 固件删除', 'iot:ota-firmware:delete', 3, 4, 5032, '', '', '', '', 0, b'1', b'1', b'1', '', '2025-06-30 07:50:29', '\"1\"', '2025-06-30 17:38:37', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (5037, 'OTA 升级任务查询', 'iot:ota-task:create', 3, 11, 5032, '', '', '', '', 0, b'1', b'1', b'1', '1', '2025-07-02 23:56:56', '1', '2025-07-02 23:56:56', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (5037, 'OTA 升级任务查询', 'iot:ota-task:query', 3, 11, 5032, '', '', '', '', 0, b'1', b'1', b'1', '1', '2025-07-02 23:56:56', '1', '2026-05-19 08:48:53', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (5038, 'OTA 升级任务取消', 'iot:ota-task:cancel', 3, 13, 5032, '', '', '', '', 0, b'1', b'1', b'1', '1', '2025-07-02 23:57:26', '1', '2025-07-02 23:57:26', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (5039, 'OTA 升级任务创建', 'iot:ota-task:create', 3, 12, 5032, '', '', '', '', 0, b'1', b'1', b'1', '1', '2025-07-02 23:57:52', '1', '2025-07-02 23:57:52', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (5040, 'OTA 升级记录查询', 'iot:ota-task-record:query', 3, 21, 5032, '', '', '', '', 0, b'1', b'1', b'1', '1', '2025-07-02 23:58:30', '1', '2025-07-02 23:58:30', b'0');
@ -3144,22 +3201,74 @@ INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_i
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (5984, '上工下工', 'mes:pro-workrecord:clock', 3, 3, 5981, '', '', '', '', 0, b'1', b'1', b'1', '1', '2026-04-05 14:08:44', '1', '2026-04-05 14:08:44', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (5985, 'MES 首页', 'mes:home:query', 2, 0, 5100, 'mes/home/index', 'ep:home-filled', 'mes/home/index', 'MesHome', 0, b'1', b'1', b'1', '1', '2026-04-05 23:24:03', '1', '2026-04-06 01:20:52', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6400, 'WMS 系统', '', 1, 310, 0, '/wms', 'ep:box', '', '', 0, b'1', b'1', b'1', '1', '2026-05-09 16:11:01', '1', '2026-05-09 16:11:01', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6401, '基础数据', '', 1, 1, 6400, 'md', 'ep:files', '', '', 0, b'1', b'1', b'1', '1', '2026-05-09 16:11:01', '1', '2026-05-10 00:54:16', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6401, '基础数据', '', 1, 6, 6400, 'md', 'ep:files', '', '', 0, b'1', b'1', b'1', '1', '2026-05-09 16:11:01', '1', '2026-05-12 17:48:35', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6402, '仓库管理', '', 2, 1, 6401, 'warehouse', 'ep:office-building', 'wms/md/warehouse/index', 'WmsWarehouse', 0, b'1', b'1', b'1', '1', '2026-05-09 16:11:01', '1', '2026-05-10 00:54:16', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6403, '仓库查询', 'wms:warehouse:query', 3, 1, 6402, '', '', '', '', 0, b'1', b'1', b'1', '1', '2026-05-09 16:11:01', '1', '2026-05-09 16:11:01', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6404, '仓库创建', 'wms:warehouse:create', 3, 2, 6402, '', '', '', '', 0, b'1', b'1', b'1', '1', '2026-05-09 16:11:01', '1', '2026-05-09 16:11:01', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6405, '仓库更新', 'wms:warehouse:update', 3, 3, 6402, '', '', '', '', 0, b'1', b'1', b'1', '1', '2026-05-09 16:11:01', '1', '2026-05-09 16:11:01', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6406, '仓库删除', 'wms:warehouse:delete', 3, 4, 6402, '', '', '', '', 0, b'1', b'1', b'1', '1', '2026-05-09 16:11:01', '1', '2026-05-09 16:11:01', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6407, '库区查询', 'wms:warehouse-area:query', 3, 5, 6402, '', '', '', '', 0, b'1', b'1', b'1', '1', '2026-05-09 16:11:01', '1', '2026-05-09 16:11:01', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6408, '库区创建', 'wms:warehouse-area:create', 3, 6, 6402, '', '', '', '', 0, b'1', b'1', b'1', '1', '2026-05-09 16:11:01', '1', '2026-05-09 16:11:01', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6409, '库区更新', 'wms:warehouse-area:update', 3, 7, 6402, '', '', '', '', 0, b'1', b'1', b'1', '1', '2026-05-09 16:11:01', '1', '2026-05-09 16:11:01', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6410, '库区删除', 'wms:warehouse-area:delete', 3, 8, 6402, '', '', '', '', 0, b'1', b'1', b'1', '1', '2026-05-09 16:11:01', '1', '2026-05-09 16:11:01', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6411, '商品品牌', '', 2, 3, 6401, 'item/brand', 'ep:price-tag', 'wms/md/item/brand/index', 'WmsItemBrand', 0, b'1', b'1', b'1', '1', '2026-05-10 01:43:12', '1', '2026-05-10 02:12:51', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6412, '品牌查询', 'wms:item-brand:query', 3, 1, 6411, '', '', '', '', 0, b'1', b'1', b'1', '1', '2026-05-10 01:43:12', '1', '2026-05-10 01:43:12', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6413, '品牌创建', 'wms:item-brand:create', 3, 2, 6411, '', '', '', '', 0, b'1', b'1', b'1', '1', '2026-05-10 01:43:12', '1', '2026-05-10 01:43:12', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6414, '品牌更新', 'wms:item-brand:update', 3, 3, 6411, '', '', '', '', 0, b'1', b'1', b'1', '1', '2026-05-10 01:43:12', '1', '2026-05-10 01:43:12', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6415, '品牌删除', 'wms:item-brand:delete', 3, 4, 6411, '', '', '', '', 0, b'1', b'1', b'1', '1', '2026-05-10 01:43:12', '1', '2026-05-10 01:43:12', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6416, '品牌导出', 'wms:item-brand:export', 3, 5, 6411, '', '', '', '', 0, b'1', b'1', b'1', '1', '2026-05-10 01:43:12', '1', '2026-05-10 01:43:12', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6417, '仓库导出', 'wms:warehouse:export', 3, 5, 6402, '', '', '', '', 0, b'1', b'1', b'1', '1', '2026-05-10 02:42:47', '1', '2026-05-10 02:42:47', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6419, '商品分类', '', 2, 2, 6401, 'item/category', 'ep:folder', 'wms/md/item/category/index', 'WmsItemCategory', 0, b'1', b'1', b'1', '1', '2026-05-10 07:14:18', '1', '2026-05-10 07:14:18', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6420, '分类查询', 'wms:item-category:query', 3, 1, 6419, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2026-05-10 07:14:18', '1', '2026-05-10 07:14:18', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6421, '分类创建', 'wms:item-category:create', 3, 2, 6419, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2026-05-10 07:14:18', '1', '2026-05-10 07:14:18', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6422, '分类更新', 'wms:item-category:update', 3, 3, 6419, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2026-05-10 07:14:18', '1', '2026-05-10 07:14:18', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6423, '分类删除', 'wms:item-category:delete', 3, 4, 6419, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2026-05-10 07:14:18', '1', '2026-05-10 07:14:18', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6424, '商品管理', '', 2, 4, 6401, 'item', 'ep:goods', 'wms/md/item/index', 'WmsItem', 0, b'1', b'1', b'1', '1', '2026-05-10 09:15:34', '1', '2026-05-10 09:15:34', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6425, '商品查询', 'wms:item:query', 3, 1, 6424, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2026-05-10 09:15:34', '1', '2026-05-10 09:15:34', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6426, '商品创建', 'wms:item:create', 3, 2, 6424, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2026-05-10 09:15:34', '1', '2026-05-10 09:15:34', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6427, '商品更新', 'wms:item:update', 3, 3, 6424, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2026-05-10 09:15:34', '1', '2026-05-10 09:15:34', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6428, '商品删除', 'wms:item:delete', 3, 4, 6424, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2026-05-10 09:15:34', '1', '2026-05-10 09:15:34', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6429, '商品导出', 'wms:item:export', 3, 5, 6424, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2026-05-10 09:15:34', '1', '2026-05-10 09:15:34', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6430, '往来企业', '', 2, 5, 6401, 'merchant', 'ep:office-building', 'wms/md/merchant/index', 'WmsMerchant', 0, b'1', b'1', b'1', '1', '2026-05-10 15:26:09', '1', '2026-05-10 15:48:07', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6431, '往来企业查询', 'wms:merchant:query', 3, 1, 6430, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2026-05-10 15:26:09', '1', '2026-05-10 15:26:09', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6432, '往来企业创建', 'wms:merchant:create', 3, 2, 6430, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2026-05-10 15:26:09', '1', '2026-05-10 15:26:09', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6433, '往来企业更新', 'wms:merchant:update', 3, 3, 6430, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2026-05-10 15:26:09', '1', '2026-05-10 15:26:09', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6434, '往来企业删除', 'wms:merchant:delete', 3, 4, 6430, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2026-05-10 15:26:09', '1', '2026-05-10 15:26:09', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6435, '往来企业导出', 'wms:merchant:export', 3, 5, 6430, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2026-05-10 15:26:09', '1', '2026-05-10 15:26:09', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6440, '库存管理', '', 1, 5, 6400, 'inventory', 'ep:box', '', '', 0, b'1', b'1', b'1', '1', '2026-05-10 17:51:46', '1', '2026-05-13 01:23:11', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6441, '库存统计', '', 2, 1, 6440, 'index', 'ep:data-board', 'wms/inventory/index/index', 'WmsInventory', 0, b'1', b'1', b'1', '1', '2026-05-10 17:51:46', '1', '2026-05-11 02:08:28', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6442, '库存统计查询', 'wms:inventory:query', 3, 1, 6441, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2026-05-10 17:51:46', '1', '2026-05-11 00:30:41', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6445, '库存流水', '', 2, 2, 6440, 'history', 'ep:document', 'wms/inventory/history/index', 'WmsInventoryHistory', 0, b'1', b'1', b'1', '1', '2026-05-10 17:51:46', '1', '2026-05-14 07:59:15', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6446, '库存流水查询', 'wms:inventory-history:query', 3, 1, 6445, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2026-05-10 17:51:46', '1', '2026-05-11 00:29:15', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6451, '入库管理', '', 2, 1, 6400, 'receipt', 'ep:download', 'wms/order/receipt/index', 'WmsReceiptOrder', 0, b'1', b'1', b'1', '1', '2026-05-11 11:58:58', '1', '2026-05-11 16:58:02', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6452, '入库单查询', 'wms:receipt-order:query', 3, 1, 6451, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2026-05-11 11:58:58', '1', '2026-05-11 16:58:02', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6453, '入库单创建', 'wms:receipt-order:create', 3, 2, 6451, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2026-05-11 11:58:58', '1', '2026-05-11 16:58:02', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6454, '入库单更新', 'wms:receipt-order:update', 3, 3, 6451, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2026-05-11 11:58:58', '1', '2026-05-11 16:58:02', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6455, '入库单删除', 'wms:receipt-order:delete', 3, 4, 6451, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2026-05-11 11:58:58', '1', '2026-05-11 16:58:02', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6456, '入库单完成入库', 'wms:receipt-order:complete', 3, 5, 6451, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2026-05-11 11:58:58', '1', '2026-05-11 16:58:02', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6457, '入库单作废', 'wms:receipt-order:cancel', 3, 6, 6451, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2026-05-11 11:58:58', '1', '2026-05-12 16:27:16', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6458, '入库单导出', 'wms:receipt-order:export', 3, 7, 6451, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2026-05-11 16:58:02', '1', '2026-05-12 16:27:16', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6461, '出库管理', '', 2, 2, 6400, 'shipment', 'ep:upload', 'wms/order/shipment/index', 'WmsShipmentOrder', 0, b'1', b'1', b'1', '1', '2026-05-12 17:48:35', '1', '2026-05-12 17:48:35', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6462, '出库单查询', 'wms:shipment-order:query', 3, 1, 6461, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2026-05-12 17:48:35', '1', '2026-05-12 17:48:35', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6463, '出库单创建', 'wms:shipment-order:create', 3, 2, 6461, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2026-05-12 17:48:35', '1', '2026-05-12 17:48:35', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6464, '出库单更新', 'wms:shipment-order:update', 3, 3, 6461, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2026-05-12 17:48:35', '1', '2026-05-12 17:48:35', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6465, '出库单删除', 'wms:shipment-order:delete', 3, 4, 6461, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2026-05-12 17:48:35', '1', '2026-05-12 17:48:35', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6466, '出库单完成出库', 'wms:shipment-order:complete', 3, 5, 6461, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2026-05-12 17:48:35', '1', '2026-05-12 17:48:35', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6467, '出库单作废', 'wms:shipment-order:cancel', 3, 6, 6461, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2026-05-12 17:48:35', '1', '2026-05-12 17:48:35', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6468, '出库单导出', 'wms:shipment-order:export', 3, 7, 6461, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2026-05-12 17:48:35', '1', '2026-05-12 17:48:35', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6470, '移库管理', '', 2, 3, 6400, 'movement', 'ep:sort', 'wms/order/movement/index', 'WmsMovementOrder', 0, b'1', b'1', b'1', '1', '2026-05-13 01:23:11', '1', '2026-05-14 02:21:20', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6471, '移库单查询', 'wms:movement-order:query', 3, 1, 6470, '', '#', NULL, NULL, 0, b'1', b'1', b'1', '1', '2026-05-13 01:23:11', '1', '2026-05-14 02:21:20', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6472, '移库单创建', 'wms:movement-order:create', 3, 2, 6470, '', '#', NULL, NULL, 0, b'1', b'1', b'1', '1', '2026-05-13 01:23:11', '1', '2026-05-14 02:21:20', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6473, '移库单更新', 'wms:movement-order:update', 3, 3, 6470, '', '#', NULL, NULL, 0, b'1', b'1', b'1', '1', '2026-05-13 01:23:11', '1', '2026-05-14 02:21:20', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6474, '移库单删除', 'wms:movement-order:delete', 3, 4, 6470, '', '#', NULL, NULL, 0, b'1', b'1', b'1', '1', '2026-05-13 01:23:11', '1', '2026-05-14 02:21:20', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6475, '移库单完成移库', 'wms:movement-order:complete', 3, 5, 6470, '', '#', NULL, NULL, 0, b'1', b'1', b'1', '1', '2026-05-13 01:23:11', '1', '2026-05-14 02:21:20', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6476, '移库单作废', 'wms:movement-order:cancel', 3, 6, 6470, '', '#', NULL, NULL, 0, b'1', b'1', b'1', '1', '2026-05-13 01:23:11', '1', '2026-05-14 02:21:20', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6477, '移库单导出', 'wms:movement-order:export', 3, 7, 6470, '', '#', NULL, NULL, 0, b'1', b'1', b'1', '1', '2026-05-13 01:23:11', '1', '2026-05-14 02:21:20', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6480, '盘库管理', '', 2, 4, 6400, 'check', 'ep:circle-check-filled', 'wms/order/check/index', 'WmsCheckOrder', 0, b'1', b'1', b'1', '1', '2026-05-13 01:23:11', '1', '2026-05-14 02:21:20', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6481, '盘库单查询', 'wms:check-order:query', 3, 1, 6480, '', '#', NULL, NULL, 0, b'1', b'1', b'1', '1', '2026-05-13 01:23:11', '1', '2026-05-14 02:21:20', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6482, '盘库单创建', 'wms:check-order:create', 3, 2, 6480, '', '#', NULL, NULL, 0, b'1', b'1', b'1', '1', '2026-05-13 01:23:11', '1', '2026-05-14 02:21:20', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6483, '盘库单更新', 'wms:check-order:update', 3, 3, 6480, '', '#', NULL, NULL, 0, b'1', b'1', b'1', '1', '2026-05-13 01:23:11', '1', '2026-05-14 02:21:20', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6484, '盘库单删除', 'wms:check-order:delete', 3, 4, 6480, '', '#', NULL, NULL, 0, b'1', b'1', b'1', '1', '2026-05-13 01:23:11', '1', '2026-05-14 02:21:20', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6485, '盘库单完成盘库', 'wms:check-order:complete', 3, 5, 6480, '', '#', NULL, NULL, 0, b'1', b'1', b'1', '1', '2026-05-13 01:23:11', '1', '2026-05-14 02:21:20', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6486, '盘库单作废', 'wms:check-order:cancel', 3, 6, 6480, '', '#', NULL, NULL, 0, b'1', b'1', b'1', '1', '2026-05-13 01:23:11', '1', '2026-05-14 02:21:20', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6487, '盘库单导出', 'wms:check-order:export', 3, 7, 6480, '', '#', NULL, NULL, 0, b'1', b'1', b'1', '1', '2026-05-13 01:23:11', '1', '2026-05-14 02:21:20', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6490, 'WMS 首页', 'wms:home:query', 2, 0, 6400, 'home', 'ep:home-filled', 'wms/home/index', 'WmsHome', 0, b'1', b'1', b'1', '1', '2026-05-14 09:34:27', '1', '2026-05-14 10:05:06', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6500, 'IM 即时通讯', '', 1, 501, 0, '/im', 'ep:chat-dot-round', NULL, NULL, 0, b'1', b'1', b'1', 'admin', '2026-04-30 09:11:20', '1', '2026-05-09 16:19:34', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6510, '数据统计', 'im:manager:statistics:query', 2, 10, 6500, 'statistics', 'ep:trend-charts', 'im/manager/statistics/index', 'ImStatistics', 0, b'1', b'1', b'1', 'admin', '2026-04-30 09:11:20', '1', '2026-04-30 19:35:54', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6515, '好友申请', 'im:manager:friend-request:query', 2, 20, 6600, 'friend-request', 'ep:document', 'im/manager/friend/request/index', 'ImFriendRequest', 0, b'1', b'1', b'1', '1', '2026-05-05 11:15:48', '1', '2026-05-07 00:40:35', b'0');
@ -3193,6 +3302,24 @@ INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_i
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6582, '用户表情删除', 'im:manager:face-user-item:delete', 3, 20, 6580, '', '', '', '', 0, b'1', b'1', b'1', '', '2026-05-06 13:56:08', '', '2026-05-06 13:56:08', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6600, '私聊管理', '', 1, 20, 6500, 'private', 'ep:chat-round', NULL, NULL, 0, b'1', b'1', b'1', '1', '2026-05-07 00:40:35', '1', '2026-05-07 00:40:35', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6610, '群聊管理', '', 1, 30, 6500, 'group', 'ep:chat-line-round', NULL, NULL, 0, b'1', b'1', b'1', '1', '2026-05-07 00:40:35', '1', '2026-05-07 00:40:35', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6611, '通话记录', '', 2, 40, 6500, 'rtc', 'ep:phone', 'im/manager/rtc/index', 'ImRtcCall', 0, b'1', b'1', b'1', 'admin', '2026-05-18 03:36:12', 'admin', '2026-05-18 03:36:12', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6612, '通话记录查询', 'im:manager:rtc:query', 3, 1, 6611, '', '', NULL, NULL, 0, b'1', b'1', b'1', 'admin', '2026-05-18 03:36:12', 'admin', '2026-05-18 03:36:12', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6700, '频道管理', '', 1, 90, 6500, 'channel', 'ep:promotion', NULL, NULL, 0, b'1', b'1', b'1', '1', '2026-05-18 13:14:34', '1', '2026-05-18 13:14:34', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6710, '频道列表', '', 2, 1, 6700, 'list', 'ep:promotion', 'im/manager/channel/list/index', 'ImChannel', 0, b'1', b'1', b'1', '1', '2026-05-18 13:14:34', '1', '2026-05-19 09:44:34', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6711, '频道查询', 'im:manager:channel:query', 3, 1, 6710, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2026-05-18 13:14:34', '1', '2026-05-18 13:14:34', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6712, '频道创建', 'im:manager:channel:create', 3, 2, 6710, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2026-05-18 13:14:34', '1', '2026-05-18 13:14:34', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6713, '频道修改', 'im:manager:channel:update', 3, 3, 6710, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2026-05-18 13:14:34', '1', '2026-05-18 13:14:34', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6714, '频道删除', 'im:manager:channel:delete', 3, 4, 6710, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2026-05-18 13:14:34', '1', '2026-05-18 13:14:34', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6720, '频道素材', '', 2, 2, 6700, 'material', 'ep:document', 'im/manager/channel/material/index', 'ImChannelMaterial', 0, b'1', b'1', b'1', '1', '2026-05-18 13:14:34', '1', '2026-05-19 09:44:34', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6721, '素材查询', 'im:manager:channel-material:query', 3, 1, 6720, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2026-05-18 13:14:34', '1', '2026-05-18 13:14:34', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6722, '素材创建', 'im:manager:channel-material:create', 3, 2, 6720, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2026-05-18 13:14:34', '1', '2026-05-18 13:14:34', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6723, '素材修改', 'im:manager:channel-material:update', 3, 3, 6720, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2026-05-18 13:14:34', '1', '2026-05-18 13:14:34', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6724, '素材删除', 'im:manager:channel-material:delete', 3, 4, 6720, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2026-05-18 13:14:34', '1', '2026-05-18 13:14:34', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6730, '频道消息', '', 2, 3, 6700, 'message', 'ep:message', 'im/manager/channel/message/index', 'ImChannelMessage', 0, b'1', b'1', b'1', '1', '2026-05-18 13:14:34', '1', '2026-05-19 09:44:34', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6731, '消息查询', 'im:manager:channel-message:query', 3, 1, 6730, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2026-05-18 13:14:34', '1', '2026-05-18 13:14:34', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6732, '立即推送', 'im:manager:channel-message:send', 3, 2, 6730, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2026-05-18 13:14:34', '1', '2026-05-18 13:14:34', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6733, '消息删除', 'im:manager:channel-message:delete', 3, 3, 6730, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2026-05-18 13:14:34', '1', '2026-05-18 13:14:34', b'0');
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (6734, '解散群', 'im:manager:group:dissolve', 3, 21, 6540, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2026-05-24 12:02:38', '1', '2026-05-24 12:02:38', b'0');
COMMIT;
-- ----------------------------
@ -3315,7 +3442,7 @@ CREATE TABLE `system_oauth2_access_token` (
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_access_token`(`access_token` ASC) USING BTREE,
INDEX `idx_refresh_token`(`refresh_token` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 53612 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'OAuth2 访问令牌';
) ENGINE = InnoDB AUTO_INCREMENT = 57395 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'OAuth2 访问令牌';
-- ----------------------------
-- Records of system_oauth2_access_token
@ -3441,7 +3568,7 @@ CREATE TABLE `system_oauth2_refresh_token` (
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_refresh_token`(`refresh_token` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2583 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'OAuth2 刷新令牌';
) ENGINE = InnoDB AUTO_INCREMENT = 2728 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'OAuth2 刷新令牌';
-- ----------------------------
-- Records of system_oauth2_refresh_token
@ -3477,7 +3604,7 @@ CREATE TABLE `system_operate_log` (
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_user_id`(`user_id` ASC) USING BTREE,
INDEX `idx_create_time`(`create_time` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 9194 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '操作日志记录 V2 版本';
) ENGINE = InnoDB AUTO_INCREMENT = 9195 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '操作日志记录 V2 版本';
-- ----------------------------
-- Records of system_operate_log
@ -3566,7 +3693,7 @@ CREATE TABLE `system_role_menu` (
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_role_id`(`role_id` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6380 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '角色和菜单关联表';
) ENGINE = InnoDB AUTO_INCREMENT = 6381 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '角色和菜单关联表';
-- ----------------------------
-- Records of system_role_menu
@ -4465,10 +4592,7 @@ INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_t
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6369, 2, 6404, '1', '2026-05-09 16:11:01', '1', '2026-05-09 16:11:01', b'0', 1);
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6370, 2, 6405, '1', '2026-05-09 16:11:01', '1', '2026-05-09 16:11:01', b'0', 1);
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6371, 2, 6406, '1', '2026-05-09 16:11:01', '1', '2026-05-09 16:11:01', b'0', 1);
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6372, 2, 6407, '1', '2026-05-09 16:11:01', '1', '2026-05-09 16:11:01', b'0', 1);
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6373, 2, 6408, '1', '2026-05-09 16:11:01', '1', '2026-05-09 16:11:01', b'0', 1);
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6374, 2, 6409, '1', '2026-05-09 16:11:01', '1', '2026-05-09 16:11:01', b'0', 1);
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6375, 2, 6410, '1', '2026-05-09 16:11:01', '1', '2026-05-09 16:11:01', b'0', 1);
INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6380, 2, 6490, '1', '2026-05-14 09:36:12', '1', '2026-05-14 09:36:12', b'0', 1);
COMMIT;
-- ----------------------------
@ -4878,16 +5002,16 @@ CREATE TABLE `system_users` (
INDEX `idx_mobile`(`mobile` ASC) USING BTREE,
INDEX `idx_email`(`email` ASC) USING BTREE,
INDEX `idx_dept_id`(`dept_id` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 145 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户信息表';
) ENGINE = InnoDB AUTO_INCREMENT = 225 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户信息表';
-- ----------------------------
-- Records of system_users
-- ----------------------------
BEGIN;
INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1, 'admin', '$2a$04$.vd8nPeLwxt6hnSzmAoAyul8BOLX7Cib6QhcxRe30rfvrIPQHH1OG', '芋道源码', '管理员', 103, '[1,2]', '13aoteman@126.com', '18818260272', 1, 'http://test.yudao.iocoder.cn/user/avatar/20251220/blob_1766215463801.jpg', 0, '0:0:0:0:0:0:0:1', '2026-05-09 23:54:42', 'admin', '2021-01-05 17:03:47', NULL, '2026-05-09 23:54:42', b'0', 1);
INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1, 'admin', '$2a$04$.vd8nPeLwxt6hnSzmAoAyul8BOLX7Cib6QhcxRe30rfvrIPQHH1OG', '芋道源码', '管理员', 103, '[1,2]', '13aoteman@126.com', '18818260272', 1, 'http://test.yudao.iocoder.cn/20260517/blob_1778998103688.png', 0, '0:0:0:0:0:0:0:1', '2026-05-31 21:54:49', 'admin', '2021-01-05 17:03:47', NULL, '2026-05-31 21:54:49', b'0', 1);
INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (100, 'yudao', '$2a$04$.vd8nPeLwxt6hnSzmAoAyul8BOLX7Cib6QhcxRe30rfvrIPQHH1OG', '芋道', '不要吓我', 104, '[1]', 'yudao@iocoder.cn', '15601691300', 1, NULL, 0, '0:0:0:0:0:0:0:1', '2026-04-19 17:40:55', '', '2021-01-07 09:07:17', NULL, '2026-04-19 17:40:55', b'0', 1);
INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (103, 'yuanma', '$2a$04$k/d6mc0nySN0i2udwcI8Ee8V5aM5OHixBRbQfXmPuFTUl3Zf/DBs.', '源码', NULL, 106, NULL, 'yuanma@iocoder.cn', '15601701300', 0, NULL, 0, '0:0:0:0:0:0:0:1', '2026-04-27 13:19:27', '', '2021-01-13 23:50:35', NULL, '2026-04-27 13:19:27', b'0', 1);
INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (104, 'test', '$2a$04$BrwaYn303hjA/6TnXqdGoOLhyHOAA0bVrAFu6.1dJKycqKUnIoRz2', '测试号', NULL, 107, '[1,2]', '111@qq.com', '15601691200', 1, NULL, 0, '0:0:0:0:0:0:0:1', '2026-05-09 09:57:13', '', '2021-01-21 02:13:53', NULL, '2026-05-09 09:57:13', b'0', 1);
INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (104, 'test', '$2a$04$BrwaYn303hjA/6TnXqdGoOLhyHOAA0bVrAFu6.1dJKycqKUnIoRz2', '测试号', NULL, 107, '[1,2]', '111@qq.com', '15601691200', 1, NULL, 0, '0:0:0:0:0:0:0:1', '2026-05-20 23:37:11', '', '2021-01-21 02:13:53', NULL, '2026-05-20 23:37:11', b'0', 1);
INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (107, 'admin107', '$2a$10$dYOOBKMO93v/.ReCqzyFg.o67Tqk.bbc2bhrpyBGkIw9aypCtr2pm', '芋艿', NULL, NULL, NULL, '', '15601691300', 0, NULL, 0, '', NULL, '1', '2022-02-20 22:59:33', '1', '2025-04-21 14:23:08', b'0', 118);
INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (108, 'admin108', '$2a$10$y6mfvKoNYL1GXWak8nYwVOH.kCWqjactkzdoIDgiKl93WN3Ejg.Lu', '芋艿', NULL, NULL, NULL, '', '15601691300', 0, NULL, 0, '', NULL, '1', '2022-02-20 23:00:50', '1', '2025-04-21 14:23:08', b'0', 119);
INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (109, 'admin109', '$2a$10$JAqvH0tEc0I7dfDVBI7zyuB4E3j.uH6daIjV53.vUS6PknFkDJkuK', '芋艿', NULL, NULL, NULL, '', '15601691300', 0, NULL, 0, '', NULL, '1', '2022-02-20 23:11:50', '1', '2025-04-21 14:23:08', b'0', 120);
@ -4903,7 +5027,7 @@ INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`,
INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (141, 'admin1', '$2a$04$oj6F6d7HrZ70kYVD3TNzEu.m3TPUzajOVuC66zdKna8KRerK1FmVa', '新用户', NULL, NULL, NULL, '', '', 0, '', 0, '0:0:0:0:0:0:0:1', '2025-04-08 13:09:07', '1', '2025-04-08 13:09:07', '1', '2025-05-14 19:11:48', b'0', 1);
INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (142, 'test01', '$2a$04$4bCYWZkjxxOC4QE0LY2M9uEEKWeJbLfs489NFtQoyidL5I0FndRaO', 'test01', '', NULL, '[]', '', '19021719925', 1, '', 0, '0:0:0:0:0:0:0:1', '2025-07-29 19:47:17', '1', '2025-07-09 21:07:10', NULL, '2025-12-02 13:23:11', b'0', 1);
INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (143, 'a00001', '$2a$04$GhVHFviOw/SsTmiQtifHJesDYFlHMeGK7OWh7aGCCjGGVCmbHVAwa', 'a00001', NULL, 104, NULL, '', '', 0, '', 0, '0:0:0:0:0:0:0:1', '2025-12-01 16:10:13', NULL, '2025-12-01 16:10:13', '1', '2025-12-05 21:34:05', b'0', 1);
INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (144, 'aoteman001', '$2a$04$omQOmhz8OyUFBKw77nr8KOtMp6xdvoQ1gWStjk9r8.OYT3Bv6oEYe', 'aoteman001', NULL, 116, NULL, '', '', 0, '', 1, '0:0:0:0:0:0:0:1', '2025-12-01 17:05:27', '1', '2025-12-01 17:05:27', '1', '2025-12-15 15:55:54', b'0', 1);
INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (144, 'aoteman001', '$2a$04$omQOmhz8OyUFBKw77nr8KOtMp6xdvoQ1gWStjk9r8.OYT3Bv6oEYe', 'aoteman001', NULL, 104, NULL, '', '', 0, '', 1, '0:0:0:0:0:0:0:1', '2025-12-01 17:05:27', '1', '2025-12-01 17:05:27', '1', '2026-05-31 21:52:48', b'0', 1);
COMMIT;
-- ----------------------------

View File

@ -77,6 +77,9 @@ def load_and_clean(sql_file: str) -> str:
class Convertor(ABC):
# 不同数据库的关键字不完全一致;子类按需声明需要转义的列名。
reserved_column_names = set()
def __init__(self, src: str, db_type) -> None:
self.src = src
self.db_type = db_type
@ -179,6 +182,31 @@ class Convertor(ABC):
"""
return ""
def escape_column_name(self, name: str) -> str:
"""转义目标库保留字列名,例如 Oracle / Kingbase 的 level。"""
column_name = name.lower()
if column_name in self.reserved_column_names:
return f'"{column_name}"'
return column_name
def escape_insert_columns(self, insert_script: str) -> str:
"""INSERT 显式列清单需要和 CREATE / COMMENT 使用同一套列名转义。"""
match = re.match(
r"(INSERT INTO\s+\S+\s*\()([^)]+)(\)\s+VALUES\s+[\s\S]*)",
insert_script,
flags=re.IGNORECASE,
)
if not match:
return insert_script
columns = [
self.escape_column_name(column.strip())
for column in match.group(2).split(",")
]
return f"{match.group(1)}{', '.join(columns)}{match.group(3)}"
@staticmethod
def inserts(table_name: str, script_content: str) -> Generator:
PREFIX = f"INSERT INTO `{table_name}`"
@ -204,18 +232,55 @@ class Convertor(ABC):
Generator[str]: create index 语句
"""
def generate_columns(columns):
keys = [
f"{col['name'].lower()}{' ' + col['order'].lower() if col['order'] != 'ASC' else ''}"
for col in columns[0]
]
return ", ".join(keys)
for no, index in enumerate(ddl["index"], 1):
columns = generate_columns(index["columns"])
for no, index in enumerate(ddl.get("index", []), 1):
columns = ", ".join(Convertor.index_columns(index.get("columns", [])))
if not columns:
continue
table_name = ddl["table_name"].lower()
yield f"CREATE INDEX idx_{table_name}_{no:02d} ON {table_name} ({columns})"
@staticmethod
def index_columns(columns) -> list:
"""兼容 simple-ddl-parser 不同版本的索引列结构。"""
keys = []
def append(name, order="ASC"):
if not name:
return
column_name = str(name).strip("`").lower()
column_order = str(order or "ASC").upper()
if column_order == "DESC":
keys.append(f"{column_name} desc")
else:
keys.append(column_name)
def visit(value):
# 普通索引常见结构:[[{'name': 'user_id', 'order': 'ASC'}]]
if isinstance(value, (list, tuple)):
for item in value:
visit(item)
return
if isinstance(value, dict):
name = value.get("name")
if isinstance(name, (dict, list, tuple)):
visit(name)
return
append(name, value.get("order", "ASC"))
return
# 唯一索引在部分版本中会被解析成 ['mobile', 'ASC', 'tenant_id', 'ASC']。
if isinstance(value, str):
token = value.strip("`")
order = token.upper()
if order in ("ASC", "DESC"):
if order == "DESC" and keys and not keys[-1].endswith(" desc"):
keys[-1] = f"{keys[-1]} desc"
return
append(token)
visit(columns)
return keys
@staticmethod
def unique_index(ddl: Dict) -> Generator:
if "constraints" in ddl and "uniques" in ddl["constraints"]:
@ -223,7 +288,9 @@ class Convertor(ABC):
for uk in uk_list:
table_name = ddl["table_name"]
uk_name = uk["constraint_name"]
uk_columns = uk["columns"]
uk_columns = Convertor.index_columns(uk["columns"])
if not uk_columns:
continue
yield table_name, uk_name, uk_columns
@staticmethod
@ -381,7 +448,7 @@ class PostgreSQLConvertor(Convertor):
)
nullable = "NULL" if col["nullable"] else "NOT NULL"
default = f"DEFAULT {col['default']}" if col["default"] is not None else ""
return f"{name} {full_type} {nullable} {default}"
return f"{self.escape_column_name(name)} {full_type} {nullable} {default}"
table_name = ddl["table_name"].lower()
columns = [f"{_generate_column(col).strip()}" for col in ddl["columns"]]
@ -406,7 +473,7 @@ CREATE TABLE {table_name} (
for column in table_ddl["columns"]:
table_comment = column["comment"]
script += (
f"COMMENT ON COLUMN {table_ddl['table_name']}.{column['name']} IS '{table_comment}';"
f"COMMENT ON COLUMN {table_ddl['table_name']}.{self.escape_column_name(column['name'])} IS '{table_comment}';"
+ "\n"
)
@ -435,6 +502,7 @@ CREATE TABLE {table_name} (
"""生成 insert 语句,以及根据最后的 insert id+1 生成 Sequence"""
inserts = list(Convertor.inserts(table_name, self.content))
inserts = [self.escape_insert_columns(s) for s in inserts]
# 转换 MySQL 字符串转义为 PostgreSQL 格式:\\ -> \\' -> ''
inserts = [re.sub(r"\\\\|\\'", lambda m: "\\" if m.group() == "\\\\" else "''", s) for s in inserts]
## 生成 insert 脚本
@ -482,6 +550,8 @@ INSERT INTO dual VALUES (1);
class OracleConvertor(Convertor):
reserved_column_names = {"level", "size"}
def __init__(self, src):
super().__init__(src, "Oracle")
@ -526,10 +596,8 @@ class OracleConvertor(Convertor):
# Oracle的 INSERT '' 不能通过NOT NULL校验因此对文字类型字段覆写为 NULL
nullable = "NULL" if type in ("varchar", "text", "longtext") else nullable
default = f"DEFAULT {col['default']}" if col["default"] is not None else ""
# Oracle 中 size 不能作为字段名
field_name = '"size"' if name == "size" else name
# Oracle DEFAULT 定义在 NULLABLE 之前
return f"{field_name} {full_type} {default} {nullable}"
return f"{self.escape_column_name(name)} {full_type} {default} {nullable}"
table_name = ddl["table_name"].lower()
columns = [f"{generate_column(col).strip()}" for col in ddl["columns"]]
@ -554,7 +622,7 @@ CREATE TABLE {table_name} (
for column in table_ddl["columns"]:
table_comment = column["comment"]
script += (
f"COMMENT ON COLUMN {table_ddl['table_name']}.{column['name']} IS '{table_comment}';"
f"COMMENT ON COLUMN {table_ddl['table_name']}.{self.escape_column_name(column['name'])} IS '{table_comment}';"
+ "\n"
)
@ -586,6 +654,7 @@ CREATE TABLE {table_name} (
"""拷贝 INSERT 语句"""
inserts = []
for insert_script in Convertor.inserts(table_name, self.content):
insert_script = self.escape_insert_columns(insert_script)
# 对日期数据添加 TO_DATE 转换
insert_script = re.sub(
r"('\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}')",
@ -907,6 +976,8 @@ SET IDENTITY_INSERT {table_name.lower()} OFF;
class KingbaseConvertor(PostgreSQLConvertor):
reserved_column_names = {"level"}
def __init__(self, src):
super().__init__(src)
self.db_type = "Kingbase"
@ -925,7 +996,7 @@ class KingbaseConvertor(PostgreSQLConvertor):
if full_type == "text":
nullable = "NULL"
default = f"DEFAULT {col['default']}" if col["default"] is not None else ""
return f"{name} {full_type} {nullable} {default}"
return f"{self.escape_column_name(name)} {full_type} {nullable} {default}"
table_name = ddl["table_name"].lower()
columns = [f"{_generate_column(col).strip()}" for col in ddl["columns"]]
@ -945,6 +1016,8 @@ CREATE TABLE {table_name} (
class OpengaussConvertor(KingbaseConvertor):
reserved_column_names = set()
def __init__(self, src):
super().__init__(src)
self.db_type = "OpenGauss"

View File

@ -14,7 +14,7 @@
<url>https://github.com/YunaiV/ruoyi-vue-pro</url>
<properties>
<revision>2026.04-SNAPSHOT</revision>
<revision>2026.05-SNAPSHOT</revision>
<flatten-maven-plugin.version>1.7.2</flatten-maven-plugin.version>
<!-- 统一依赖管理 -->
<spring.boot.version>3.5.14</spring.boot.version>
@ -28,7 +28,7 @@
<mybatis-plus-join.version>1.5.7</mybatis-plus-join.version>
<dynamic-datasource.version>4.5.0</dynamic-datasource.version>
<easy-trans.version>3.0.6</easy-trans.version>
<redisson.version>4.3.1</redisson.version>
<redisson.version>4.4.0</redisson.version>
<dm8.jdbc.version>8.1.3.140</dm8.jdbc.version>
<kingbase.jdbc.version>9.0.1.jre7</kingbase.jdbc.version>
<opengauss.jdbc.version>7.0.0-RC3-og</opengauss.jdbc.version>
@ -50,6 +50,8 @@
<!-- 工具类相关 -->
<anji-plus-captcha.version>1.4.0</anji-plus-captcha.version>
<jsoup.version>1.22.2</jsoup.version>
<sensitive-word.version>0.29.5</sensitive-word.version>
<pinyin4j.version>2.5.1</pinyin4j.version>
<lombok.version>1.18.46</lombok.version>
<mapstruct.version>1.6.3</mapstruct.version>
<hutool-5.version>5.8.44</hutool-5.version>
@ -65,7 +67,7 @@
<tika-core.version>3.3.0</tika-core.version>
<ip2region.version>2.7.0</ip2region.version>
<bizlog-sdk.version>3.0.6</bizlog-sdk.version>
<netty.version>4.2.12.Final</netty.version>
<netty.version>4.2.14.Final</netty.version>
<mqtt.version>1.2.5</mqtt.version>
<vertx.version>4.5.26</vertx.version>
<okhttp.version>4.12.0</okhttp.version>
@ -75,10 +77,11 @@
<awssdk.version>2.44.0</awssdk.version>
<justauth.version>1.16.7</justauth.version>
<justauth-starter.version>1.4.0</justauth-starter.version>
<jimureport.version>2.3.2</jimureport.version>
<jimureport.version>2.3.4</jimureport.version>
<jimubi.version>2.3.2</jimubi.version>
<weixin-java.version>4.8.2-20260501.180637</weixin-java.version>
<alipay-sdk-java.version>4.40.771.ALL</alipay-sdk-java.version>
<bouncycastle.version>1.80</bouncycastle.version>
<alipay-sdk-java.version>4.40.806.ALL</alipay-sdk-java.version>
</properties>
<dependencyManagement>
@ -558,6 +561,18 @@
<version>${jsoup.version}</version>
</dependency>
<dependency>
<groupId>com.github.houbb</groupId>
<artifactId>sensitive-word</artifactId> <!-- 敏感词检测trie 树高效匹配 -->
<version>${sensitive-word.version}</version>
</dependency>
<dependency>
<groupId>com.belerweb</groupId>
<artifactId>pinyin4j</artifactId> <!-- 汉字转拼音:作为 hutool PinyinUtil 的底层引擎 -->
<version>${pinyin4j.version}</version>
</dependency>
<!-- Vert.x -->
<dependency>
<groupId>io.vertx</groupId>
@ -646,6 +661,24 @@
</exclusions>
</dependency>
<!-- 锁定 weixin-java 传递依赖,避免 Maven 版本范围自动升级到 1.80.2 后 Fat Jar 启动失败。
反馈https://t.zsxq.com/pCVBo -->
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk18on</artifactId>
<version>${bouncycastle.version}</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcutil-jdk18on</artifactId>
<version>${bouncycastle.version}</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk18on</artifactId>
<version>${bouncycastle.version}</version>
</dependency>
<dependency>
<groupId>com.github.binarywang</groupId>
<artifactId>weixin-java-pay</artifactId>

View File

@ -124,6 +124,22 @@ public class CollectionUtils {
return from.stream().filter(filter).map(func).filter(Objects::nonNull).collect(Collectors.toSet());
}
public static <T, U> Set<U> convertLinkedSet(Collection<T> from, Function<T, U> func) {
if (CollUtil.isEmpty(from)) {
return new LinkedHashSet<>();
}
return from.stream().map(func).filter(Objects::nonNull)
.collect(Collectors.toCollection(LinkedHashSet::new));
}
public static <T, U> Set<U> convertLinkedSet(Collection<T> from, Function<T, U> func, Predicate<T> filter) {
if (CollUtil.isEmpty(from)) {
return new LinkedHashSet<>();
}
return from.stream().filter(filter).map(func).filter(Objects::nonNull)
.collect(Collectors.toCollection(LinkedHashSet::new));
}
public static <T, K> Map<K, T> convertMapByFilter(Collection<T> from, Predicate<T> filter, Function<T, K> keyFunc) {
if (CollUtil.isEmpty(from)) {
return new HashMap<>();
@ -372,4 +388,14 @@ public class CollectionUtils {
return false;
}
/**
* 把单元素 head 与集合 tail 合并成新 Listhead 在前tail 顺序保留)
*/
public static <T> List<T> of(T head, Collection<T> tail) {
List<T> list = new ArrayList<>();
list.add(head);
CollUtil.addAll(list, tail);
return list;
}
}

View File

@ -236,6 +236,23 @@ public class LocalDateTimeUtils {
return LocalDateTime.now().with(TemporalAdjusters.firstDayOfYear()).with(LocalTime.MIN);
}
/**
* 获取最近 N 天的 0 点时刻序列(升序,含今天)
* <p>
* 例getLatestDays(3) 返回 [前天 00:00, 昨天 00:00, 今天 00:00]
*
* @param days 天数(含今天)
* @return 升序的 LocalDateTime 列表
*/
public static List<LocalDateTime> getLatestDays(int days) {
LocalDateTime today = getToday();
List<LocalDateTime> dates = new ArrayList<>(days);
for (int i = days - 1; i >= 0; i--) {
dates.add(today.minusDays(i));
}
return dates;
}
public static List<LocalDateTime[]> getDateRangeList(LocalDateTime startTime,
LocalDateTime endTime,
Integer interval) {
@ -302,6 +319,17 @@ public class LocalDateTimeUtils {
return timeRanges;
}
/**
* 获取从开始日期起的日期列表
*
* @param startDate 开始日期
* @param days 天数
* @return 日期列表,包含开始日期
*/
public static List<LocalDate> getDateList(LocalDate startDate, int days) {
return startDate.datesUntil(startDate.plusDays(days)).toList();
}
/**
* 格式化时间范围
*

View File

@ -200,4 +200,14 @@ public class HttpUtils {
}
}
/**
* WebSocket URL 切换成 HTTP URLws:// → http://wss:// → https://;其它格式原样保留
*
* @param url 原始 URL
* @return 切换协议后的 URL
*/
public static String wsUrlToHttp(String url) {
return StrUtil.startWithIgnoreCase(url, "ws") ? "http" + url.substring(2) : url;
}
}

View File

@ -22,6 +22,7 @@ import java.lang.reflect.Type;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* JSON 工具类
@ -173,6 +174,23 @@ public class JsonUtils {
}
}
/**
* 解析 JSON 字符串成 Map空字符串或解析失败返回 null
*
* @param text JSON 字符串
* @return Map 对象
*/
public static Map<String, Object> parseMap(String text) {
if (StrUtil.isEmpty(text)) {
return null;
}
try {
return objectMapper.readValue(text, new TypeReference<Map<String, Object>>() {});
} catch (IOException e) {
return null;
}
}
/**
* 解析 JSON 字符串成指定类型的对象,如果解析失败,则返回 null
*
@ -235,6 +253,14 @@ public class JsonUtils {
}
}
public static String getText(JsonNode node, String fieldName) {
if (node == null) {
return null;
}
JsonNode value = node.get(fieldName);
return value != null && !value.isNull() ? value.asText() : null;
}
public static boolean isJson(String text) {
return JSONUtil.isTypeJSON(text);
}

View File

@ -3,6 +3,7 @@ package cn.iocoder.yudao.framework.common.util.string;
import cn.hutool.core.text.StrPool;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.extra.pinyin.PinyinUtil;
import org.aspectj.lang.JoinPoint;
import java.util.Arrays;
@ -78,6 +79,25 @@ public class StrUtils {
.collect(Collectors.joining("\n"));
}
/**
* 转小写拼音,字之间以空格分隔,便于调用方按需拼接 / 取首字母 / 拼音搜索
*
* 例:「老张」→ "lao zhang"、「ZhangSan」→ "zhangsan"
* 英文 / 数字 / 符号原样返回,空值返回 null
*
* 注意:底层依赖 hutool-extra 的 {@link PinyinUtil},需要业务模块自行引入拼音引擎依赖
* pinyin4j / TinyPinyin / Bopomofo4j 任选其一),否则运行时会抛 NoClassDefFoundError
*
* @param str 字符串
* @return 拼音串(保留空格分隔)
*/
public static String toPinyin(String str) {
if (StrUtil.isBlank(str)) {
return null;
}
return PinyinUtil.getPinyin(str);
}
/**
* 拼接方法的参数
*

View File

@ -192,7 +192,12 @@ public class YudaoTenantAutoConfiguration {
RedisCacheWriter cacheWriter = RedisCacheWriter.nonLockingRedisCacheWriter(connectionFactory,
BatchStrategies.scan(yudaoCacheProperties.getRedisScanBatchSize()));
// 创建 TenantRedisCacheManager 对象
return new TenantRedisCacheManager(cacheWriter, redisCacheConfiguration, tenantProperties.getIgnoreCaches());
TenantRedisCacheManager cacheManager = new TenantRedisCacheManager(cacheWriter, redisCacheConfiguration,
tenantProperties.getIgnoreCaches());
// 开启事务感知:@Transactional 方法内的 @CacheEvict / @CachePut 自动延迟到 afterCommit
// 避免事务未提交就清缓存被并发读穿写脏值;无事务时立即生效,行为不变
cacheManager.setTransactionAware(true);
return cacheManager;
}
}

View File

@ -105,6 +105,13 @@
<groupId>com.fhs-opensource</groupId>
<artifactId>easy-trans-mybatis-plus-extend</artifactId>
</dependency>
<!-- Test 测试相关 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>

View File

@ -119,6 +119,31 @@ public interface BaseMapperX<T> extends MPJBaseMapper<T> {
return selectOne(new LambdaQueryWrapper<T>().eq(field1, value1).eq(field2, value2).eq(field3, value3));
}
/**
* 获得满足条件的一条记录,并使用 FOR UPDATE 锁定。
*
* 注意:需要在事务中调用,否则锁会立即释放。
*
* @param queryWrapper 查询条件
* @return 实体
*/
default T selectOneForUpdate(LambdaQueryWrapper<T> queryWrapper) {
return selectOne(queryWrapper.last("FOR UPDATE"));
}
default T selectOneForUpdate(SFunction<T, ?> field, Object value) {
return selectOneForUpdate(new LambdaQueryWrapper<T>().eq(field, value));
}
default T selectOneForUpdate(SFunction<T, ?> field1, Object value1, SFunction<T, ?> field2, Object value2) {
return selectOneForUpdate(new LambdaQueryWrapper<T>().eq(field1, value1).eq(field2, value2));
}
default T selectOneForUpdate(SFunction<T, ?> field1, Object value1, SFunction<T, ?> field2, Object value2,
SFunction<T, ?> field3, Object value3) {
return selectOneForUpdate(new LambdaQueryWrapper<T>().eq(field1, value1).eq(field2, value2).eq(field3, value3));
}
/**
* 获取满足条件的第 1 条记录
*
@ -145,6 +170,17 @@ public interface BaseMapperX<T> extends MPJBaseMapper<T> {
return CollUtil.getFirst(list);
}
/**
* 获取满足条件的最新一条记录
* <p>
* 目的:解决并发场景下,插入多条记录后,使用 selectOne 会报错的问题
*
* @param queryWrapper 查询条件
* @return 最新一条;不存在返回 null
*/
default T selectLastOne(LambdaQueryWrapper<T> queryWrapper) {
return CollUtil.getLast(selectList(queryWrapper));
}
default Long selectCount() {
return selectCount(new QueryWrapper<>());

View File

@ -25,6 +25,13 @@ public class LambdaQueryWrapperX<T> extends LambdaQueryWrapper<T> {
return this;
}
public LambdaQueryWrapperX<T> likeRightIfPresent(SFunction<T, ?> column, String val) {
if (StringUtils.hasText(val)) {
return (LambdaQueryWrapperX<T>) super.likeRight(column, val);
}
return this;
}
public LambdaQueryWrapperX<T> inIfPresent(SFunction<T, ?> column, Collection<?> values) {
if (ObjectUtil.isAllNotEmpty(values) && !ArrayUtil.isEmpty(values)) {
return (LambdaQueryWrapperX<T>) super.in(column, values);

View File

@ -27,6 +27,13 @@ public class MPJLambdaWrapperX<T> extends MPJLambdaWrapper<T> {
return this;
}
public <S> MPJLambdaWrapperX<T> likeRightIfPresent(SFunction<S, ?> column, String val) {
if (StringUtils.hasText(val)) {
return (MPJLambdaWrapperX<T>) super.likeRight(column, val);
}
return this;
}
public <S> MPJLambdaWrapperX<T> inIfPresent(SFunction<S, ?> column, Collection<?> values) {
if (ObjectUtil.isAllNotEmpty(values) && !ArrayUtil.isEmpty(values)) {
return (MPJLambdaWrapperX<T>) super.in(column, values);
@ -102,7 +109,6 @@ public class MPJLambdaWrapperX<T> extends MPJLambdaWrapper<T> {
return this;
}
// ========== 重写父类方法,方便链式调用 ==========
@Override

View File

@ -25,6 +25,13 @@ public class QueryWrapperX<T> extends QueryWrapper<T> {
return this;
}
public QueryWrapperX<T> likeRightIfPresent(String column, String val) {
if (StringUtils.hasText(val)) {
return (QueryWrapperX<T>) super.likeRight(column, val);
}
return this;
}
public QueryWrapperX<T> inIfPresent(String column, Collection<?> values) {
if (!CollectionUtils.isEmpty(values)) {
return (QueryWrapperX<T>) super.in(column, values);
@ -95,13 +102,13 @@ public class QueryWrapperX<T> extends QueryWrapper<T> {
}
public QueryWrapperX<T> betweenIfPresent(String column, Object[] values) {
if (values!= null && values.length != 0 && values[0] != null && values[1] != null) {
if (values != null && values.length != 0 && values[0] != null && values[1] != null) {
return (QueryWrapperX<T>) super.between(column, values[0], values[1]);
}
if (values!= null && values.length != 0 && values[0] != null) {
if (values != null && values.length != 0 && values[0] != null) {
return (QueryWrapperX<T>) ge(column, values[0]);
}
if (values!= null && values.length != 0 && values[1] != null) {
if (values != null && values.length != 0 && values[1] != null) {
return (QueryWrapperX<T>) le(column, values[1]);
}
return this;

View File

@ -23,6 +23,7 @@ import net.sf.jsqlparser.schema.Table;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.regex.Pattern;
/**
* MyBatis 工具类
@ -31,6 +32,8 @@ public class MyBatisUtils {
private static final String MYSQL_ESCAPE_CHARACTER = "`";
private static final Pattern SAFE_COLUMN_NAME_PATTERN = Pattern.compile("^[a-zA-Z0-9_]+(\\.[a-zA-Z0-9_]+)*$");
public static <T> Page<T> buildPage(PageParam pageParam) {
return buildPage(pageParam, null);
}
@ -42,8 +45,11 @@ public class MyBatisUtils {
// 排序字段
if (CollUtil.isNotEmpty(sortingFields)) {
for (SortingField sortingField : sortingFields) {
page.addOrder(new OrderItem().setAsc(SortingField.ORDER_ASC.equals(sortingField.getOrder()))
.setColumn(StrUtil.toUnderlineCase(sortingField.getField())));
String columnName = buildSafeOrderColumn(sortingField.getField());
if (columnName == null) {
continue;
}
page.addOrder(new OrderItem().setAsc(isAscOrder(sortingField.getOrder())).setColumn(columnName));
}
}
return page;
@ -57,23 +63,29 @@ public class MyBatisUtils {
if (wrapper instanceof QueryWrapper<T>) {
QueryWrapper<T> query = (QueryWrapper<T>) wrapper;
for (SortingField sortingField : sortingFields) {
query.orderBy(true,
SortingField.ORDER_ASC.equals(sortingField.getOrder()),
StrUtil.toUnderlineCase(sortingField.getField()));
String columnName = buildSafeOrderColumn(sortingField.getField());
if (columnName == null) {
continue;
}
query.orderBy(true, isAscOrder(sortingField.getOrder()), columnName);
}
} else if (wrapper instanceof LambdaQueryWrapper<T>) {
// LambdaQueryWrapper 不直接支持字符串字段排序,使用 last 方法拼接 ORDER BY
LambdaQueryWrapper<T> lambdaQuery = (LambdaQueryWrapper<T>) wrapper;
StringBuilder orderBy = new StringBuilder();
for (SortingField sortingField : sortingFields) {
String columnName = buildSafeOrderColumn(sortingField.getField());
if (columnName == null) {
continue;
}
if (StrUtil.isNotEmpty(orderBy)) {
orderBy.append(", ");
}
orderBy.append(StrUtil.toUnderlineCase(sortingField.getField()))
.append(" ")
.append(SortingField.ORDER_ASC.equals(sortingField.getOrder()) ? "ASC" : "DESC");
orderBy.append(columnName).append(" ").append(getOrderDirection(sortingField.getOrder()));
}
if (StrUtil.isNotEmpty(orderBy)) {
lambdaQuery.last("ORDER BY " + orderBy);
}
lambdaQuery.last("ORDER BY " + orderBy);
// 另外个思路https://blog.csdn.net/m0_59084856/article/details/138450913
} else {
throw new IllegalArgumentException("Unsupported wrapper type: " + wrapper.getClass().getName());
@ -81,6 +93,22 @@ public class MyBatisUtils {
}
public static boolean isAscOrder(String order) {
return SortingField.ORDER_ASC.equals(order);
}
public static String getOrderDirection(String order) {
return isAscOrder(order) ? "ASC" : "DESC";
}
private static String buildSafeOrderColumn(String field) {
String columnName = StrUtil.toUnderlineCase(field);
if (StrUtil.isEmpty(columnName) || !SAFE_COLUMN_NAME_PATTERN.matcher(columnName).matches()) {
return null;
}
return columnName;
}
/**
* 将拦截器添加到链中
* 由于 MybatisPlusInterceptor 不支持添加拦截器,所以只能全量设置

View File

@ -0,0 +1,106 @@
package cn.iocoder.yudao.framework.mybatis.core.util;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.SortingField;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.junit.jupiter.api.Test;
import java.util.Arrays;
import java.util.List;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
/**
* {@link MyBatisUtils} 的单元测试
*/
public class MyBatisUtilsTest {
@Test
public void testBuildPage_sortingFields() {
// 准备参数
PageParam pageParam = new PageParam();
pageParam.setPageNo(2);
pageParam.setPageSize(20);
List<SortingField> sortingFields = Arrays.asList(
new SortingField("userName", SortingField.ORDER_ASC),
new SortingField("u.id", SortingField.ORDER_DESC),
new SortingField("name desc", SortingField.ORDER_DESC));
// 调用
Page<Object> page = MyBatisUtils.buildPage(pageParam, sortingFields);
// 断言
assertEquals(2, page.getCurrent());
assertEquals(20, page.getSize());
assertEquals(2, page.orders().size());
assertOrderItem(page.orders().get(0), "user_name", true);
assertOrderItem(page.orders().get(1), "u.id", false);
}
@Test
public void testAddOrder_queryWrapper() {
// 准备参数
QueryWrapper<Object> query = new QueryWrapper<>();
List<SortingField> sortingFields = Arrays.asList(
new SortingField("userName", SortingField.ORDER_ASC),
new SortingField("u.id", SortingField.ORDER_DESC),
new SortingField("name;drop", SortingField.ORDER_ASC));
// 调用
MyBatisUtils.addOrder(query, sortingFields);
// 断言
assertEquals(" ORDER BY user_name ASC,u.id DESC", query.getSqlSegment());
}
@Test
public void testAddOrder_lambdaQueryWrapper() {
// 准备参数
LambdaQueryWrapper<Object> query = new LambdaQueryWrapper<>();
List<SortingField> sortingFields = Arrays.asList(
new SortingField("userName", SortingField.ORDER_ASC),
new SortingField("u.id", SortingField.ORDER_DESC),
new SortingField("name`", SortingField.ORDER_ASC));
// 调用
MyBatisUtils.addOrder(query, sortingFields);
// 断言
assertEquals(" ORDER BY user_name ASC, u.id DESC", query.getSqlSegment());
}
@Test
public void testAddOrder_lambdaQueryWrapper_invalidSortingFields() {
// 准备参数
LambdaQueryWrapper<Object> query = new LambdaQueryWrapper<>();
List<SortingField> sortingFields = Arrays.asList(
new SortingField("name desc", SortingField.ORDER_ASC),
new SortingField("name;drop", SortingField.ORDER_DESC));
// 调用
MyBatisUtils.addOrder(query, sortingFields);
// 断言
assertEquals("", query.getSqlSegment());
}
@Test
public void testOrderDirection() {
assertTrue(MyBatisUtils.isAscOrder(SortingField.ORDER_ASC));
assertFalse(MyBatisUtils.isAscOrder(SortingField.ORDER_DESC));
assertEquals("ASC", MyBatisUtils.getOrderDirection(SortingField.ORDER_ASC));
assertEquals("DESC", MyBatisUtils.getOrderDirection(SortingField.ORDER_DESC));
assertEquals("DESC", MyBatisUtils.getOrderDirection(null));
}
private void assertOrderItem(OrderItem orderItem, String column, boolean asc) {
assertEquals(column, orderItem.getColumn());
assertEquals(asc, orderItem.isAsc());
}
}

View File

@ -75,8 +75,12 @@ public class YudaoCacheAutoConfiguration {
RedisConnectionFactory connectionFactory = Objects.requireNonNull(redisTemplate.getConnectionFactory());
RedisCacheWriter cacheWriter = RedisCacheWriter.nonLockingRedisCacheWriter(connectionFactory,
BatchStrategies.scan(yudaoCacheProperties.getRedisScanBatchSize()));
// 创建 TenantRedisCacheManager 对象
return new TimeoutRedisCacheManager(cacheWriter, redisCacheConfiguration);
// 创建 TimeoutRedisCacheManager 对象
TimeoutRedisCacheManager cacheManager = new TimeoutRedisCacheManager(cacheWriter, redisCacheConfiguration);
// 开启事务感知:@Transactional 方法内的 @CacheEvict / @CachePut 自动延迟到 afterCommit
// 避免事务未提交就清缓存被并发读穿写脏值;无事务时立即生效,行为不变
cacheManager.setTransactionAware(true);
return cacheManager;
}
}

View File

@ -69,7 +69,7 @@ public class ApiAccessLogFilter extends ApiRequestFilter {
LocalDateTime beginTime = LocalDateTime.now();
// 提前获得参数,避免 XssFilter 过滤处理
Map<String, String> queryString = ServletUtils.getParamMap(request);
String requestBody = ServletUtils.isJsonRequest(request) ? ServletUtils.getBody(request) : null;
String requestBody = ServletUtils.getBody(request);
try {
// 继续过滤器

View File

@ -44,7 +44,7 @@ public class ApiAccessLogInterceptor implements HandlerInterceptor {
// 打印 request 日志
if (!SpringUtils.isProd()) {
Map<String, String> queryString = ServletUtils.getParamMap(request);
String requestBody = ServletUtils.isJsonRequest(request) ? ServletUtils.getBody(request) : null;
String requestBody = ServletUtils.getBody(request);
if (CollUtil.isEmpty(queryString) && StrUtil.isEmpty(requestBody)) {
log.info("[preHandle][开始请求 URL({}) 无参数]", request.getRequestURI());
} else {

View File

@ -46,10 +46,18 @@ public class BannerApplicationRunner implements ApplicationRunner {
if (isNotPresent("cn.iocoder.yudao.module.erp.framework.web.config.ErpWebConfiguration")) {
System.out.println("[ERP 系统 yudao-module-erp - 已禁用][参考 https://doc.iocoder.cn/erp/build/ 开启]");
}
// WMS 仓库管理系统
if (isNotPresent("cn.iocoder.yudao.module.wms.framework.web.config.WmsWebConfiguration")) {
System.out.println("[WMS 仓库管理系统 yudao-module-wms - 已禁用][参考 https://doc.iocoder.cn/wms/build/ 开启]");
}
// CRM 系统
if (isNotPresent("cn.iocoder.yudao.module.crm.framework.web.config.CrmWebConfiguration")) {
System.out.println("[CRM 系统 yudao-module-crm - 已禁用][参考 https://doc.iocoder.cn/crm/build/ 开启]");
}
// MES 系统
if (isNotPresent("cn.iocoder.yudao.module.mes.framework.web.config.MesWebConfiguration")) {
System.out.println("[MES 系统 yudao-module-mes - 已禁用][参考 https://doc.iocoder.cn/mes/build/ 开启]");
}
// 微信公众号
if (isNotPresent("cn.iocoder.yudao.module.mp.framework.mp.config.MpConfiguration")) {
System.out.println("[微信公众号 yudao-module-mp - 已禁用][参考 https://doc.iocoder.cn/mp/build/ 开启]");
@ -66,6 +74,10 @@ public class BannerApplicationRunner implements ApplicationRunner {
if (isNotPresent("cn.iocoder.yudao.module.iot.framework.web.config.IotWebConfiguration")) {
System.out.println("[IoT 物联网 yudao-module-iot - 已禁用][参考 https://doc.iocoder.cn/iot/build/ 开启]");
}
// IM 即时通讯
if (isNotPresent("cn.iocoder.yudao.module.im.framework.web.config.ImWebConfiguration")) {
System.out.println("[IM 即时通讯 yudao-module-im - 已禁用][参考 https://doc.iocoder.cn/im/build/ 开启]");
}
});
}

View File

@ -423,25 +423,43 @@ public class GlobalExceptionHandler {
return CommonResult.error(NOT_IMPLEMENTED.getCode(),
"[ERP 系统 yudao-module-erp - 表结构未导入][参考 https://cloud.iocoder.cn/erp/build/ 开启]");
}
// 6. CRM 系统
// 6. WMS 仓库管理系统
if (message.contains("wms_")) {
log.error("[WMS 仓库管理系统 yudao-module-wms - 表结构未导入][参考 https://doc.iocoder.cn/wms/build/ 开启]");
return CommonResult.error(NOT_IMPLEMENTED.getCode(),
"[WMS 仓库管理系统 yudao-module-wms - 表结构未导入][参考 https://doc.iocoder.cn/wms/build/ 开启]");
}
// 7. CRM 系统
if (message.contains("crm_")) {
log.error("[CRM 系统 yudao-module-crm - 表结构未导入][参考 https://cloud.iocoder.cn/crm/build/ 开启]");
return CommonResult.error(NOT_IMPLEMENTED.getCode(),
"[CRM 系统 yudao-module-crm - 表结构未导入][参考 https://cloud.iocoder.cn/crm/build/ 开启]");
}
// 7. 支付平台
// 8. MES 系统
if (message.contains("mes_")) {
log.error("[MES 系统 yudao-module-mes - 表结构未导入][参考 https://doc.iocoder.cn/mes/build/ 开启]");
return CommonResult.error(NOT_IMPLEMENTED.getCode(),
"[MES 系统 yudao-module-mes - 表结构未导入][参考 https://doc.iocoder.cn/mes/build/ 开启]");
}
// 9. IM 即时通讯
if (message.contains("im_")) {
log.error("[IM 即时通讯 yudao-module-im - 表结构未导入][参考 https://doc.iocoder.cn/im/build/ 开启]");
return CommonResult.error(NOT_IMPLEMENTED.getCode(),
"[IM 即时通讯 yudao-module-im - 表结构未导入][参考 https://doc.iocoder.cn/im/build/ 开启]");
}
// 10. 支付平台
if (message.contains("pay_")) {
log.error("[支付模块 yudao-module-pay - 表结构未导入][参考 https://cloud.iocoder.cn/pay/build/ 开启]");
return CommonResult.error(NOT_IMPLEMENTED.getCode(),
"[支付模块 yudao-module-pay - 表结构未导入][参考 https://cloud.iocoder.cn/pay/build/ 开启]");
}
// 8. AI 大模型
// 11. AI 大模型
if (message.contains("ai_")) {
log.error("[AI 大模型 yudao-module-ai - 表结构未导入][参考 https://cloud.iocoder.cn/ai/build/ 开启]");
return CommonResult.error(NOT_IMPLEMENTED.getCode(),
"[AI 大模型 yudao-module-ai - 表结构未导入][参考 https://cloud.iocoder.cn/ai/build/ 开启]");
}
// 9. IoT 物联网
// 12. IoT 物联网
if (message.contains("iot_")) {
log.error("[IoT 物联网 yudao-module-iot - 表结构未导入][参考 https://doc.iocoder.cn/iot/build/ 开启]");
return CommonResult.error(NOT_IMPLEMENTED.getCode(),

View File

@ -76,7 +76,7 @@ public class JsonWebSocketMessageHandler extends TextWebSocketHandler {
Long tenantId = WebSocketFrameworkUtils.getTenantId(session);
TenantUtils.execute(tenantId, () -> messageListener.onMessage(session, messageObj));
} catch (Throwable ex) {
log.error("[handleTextMessage][session({}) message({}) 处理异常]", session.getId(), message.getPayload());
log.error("[handleTextMessage][session({}) message({}) 处理异常]", session.getId(), message.getPayload(), ex);
}
}

View File

@ -27,9 +27,10 @@ public class LoginUserHandshakeInterceptor implements HandshakeInterceptor {
public boolean beforeHandshake(ServerHttpRequest request, ServerHttpResponse response,
WebSocketHandler wsHandler, Map<String, Object> attributes) {
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
if (loginUser != null) {
WebSocketFrameworkUtils.setLoginUser(loginUser, attributes);
if (loginUser == null) {
return false;
}
WebSocketFrameworkUtils.setLoginUser(loginUser, attributes);
return true;
}

View File

@ -12,6 +12,7 @@ import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form.BpmFormFi
import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmProcessDefinitionInfoDO;
import cn.iocoder.yudao.module.bpm.enums.definition.BpmModelFormTypeEnum;
import cn.iocoder.yudao.module.bpm.framework.flowable.core.enums.BpmnVariableConstants;
import com.fasterxml.jackson.databind.JsonNode;
import lombok.SneakyThrows;
import org.flowable.common.engine.api.delegate.Expression;
import org.flowable.common.engine.api.variable.VariableContainer;
@ -27,6 +28,7 @@ import org.flowable.engine.runtime.ProcessInstance;
import org.flowable.task.api.TaskInfo;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@ -245,10 +247,10 @@ public class FlowableUtils {
}
// 解析表单配置
Map<String, BpmFormFieldVO> formFieldsMap = new HashMap<>();
Map<String, BpmFormFieldVO> formFieldsMap = new LinkedHashMap<>();
processDefinitionInfo.getFormFields().forEach(formFieldStr -> {
BpmFormFieldVO formField = JsonUtils.parseObject(formFieldStr, BpmFormFieldVO.class);
parseFormField(formField, formFieldsMap);
JsonNode formFieldNode = JsonUtils.parseObject(formFieldStr, JsonNode.class);
parseFormField(formFieldNode, formFieldsMap);
});
// 情况一:当自定义了摘要
@ -275,18 +277,32 @@ public class FlowableUtils {
/**
* 递归解析表单字段
*/
private static void parseFormField(BpmFormFieldVO formField, Map<String, BpmFormFieldVO> formFieldsMap) {
if (formField == null) {
private static void parseFormField(JsonNode formFieldNode, Map<String, BpmFormFieldVO> formFieldsMap) {
if (formFieldNode == null || !formFieldNode.isObject()) {
return;
}
// 如果存在 children -> 说明是布局组件
if (formField.getChildren() != null && !formField.getChildren().isEmpty()) {
for (BpmFormFieldVO child : formField.getChildren()) {
// 如果 children 里存在对象节点,说明是布局组件;字符串节点是分割线、标签、文字等展示组件内容,直接跳过。
JsonNode children = formFieldNode.get("children");
if (children != null && children.isArray() && children.size() > 0) {
boolean hasObjectChild = false;
for (JsonNode child : children) {
if (!child.isObject()) {
continue;
}
hasObjectChild = true;
parseFormField(child, formFieldsMap);
}
return;
if (hasObjectChild) {
return;
}
}
// 真实字段才加入 map
BpmFormFieldVO formField = new BpmFormFieldVO()
.setType(JsonUtils.getText(formFieldNode, "type"))
.setField(JsonUtils.getText(formFieldNode, "field"))
.setTitle(JsonUtils.getText(formFieldNode, "title"));
if (StrUtil.isNotBlank(formField.getField())) {
formFieldsMap.put(formField.getField(), formField);
}

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.bpm.framework.flowable.core.candidate;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.map.MapUtil;
import cn.hutool.extra.spring.SpringUtil;
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
@ -64,7 +65,7 @@ public class BpmTaskCandidateInvokerTest extends BaseMockitoUnitTest {
public void setUp() {
userStrategy = new BpmTaskCandidateUserStrategy(); // 创建 strategy 实例
when(emptyStrategy.getStrategy()).thenReturn(BpmTaskCandidateStrategyEnum.ASSIGN_EMPTY);
strategyList = List.of(userStrategy, emptyStrategy); // 创建 strategyList
strategyList = ListUtil.of(userStrategy, emptyStrategy); // 创建 strategyList
taskCandidateInvoker = new BpmTaskCandidateInvoker(strategyList, adminUserApi);
}

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.bpm.framework.flowable.core.candidate.strategy.dept;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.map.MapUtil;
import cn.iocoder.yudao.framework.test.core.ut.BaseMockitoUnitTest;
import cn.iocoder.yudao.module.bpm.framework.flowable.core.enums.BpmnVariableConstants;
@ -12,7 +13,6 @@ import org.mockito.InjectMocks;
import org.mockito.Mock;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
@ -41,7 +41,7 @@ public class BpmTaskCandidateStartUserSelectStrategyTest extends BaseMockitoUnit
// mock 方法FlowableUtils
Map<String, Object> processVariables = new HashMap<>();
processVariables.put(BpmnVariableConstants.PROCESS_INSTANCE_VARIABLE_START_USER_SELECT_ASSIGNEES,
MapUtil.of("activity_001", List.of(1L, 2L)));
MapUtil.of("activity_001", ListUtil.of(1L, 2L)));
when(processInstance.getProcessVariables()).thenReturn(processVariables);
// 调用
@ -56,7 +56,7 @@ public class BpmTaskCandidateStartUserSelectStrategyTest extends BaseMockitoUnit
String activityId = "activity_001";
Map<String, Object> processVariables = new HashMap<>();
processVariables.put(BpmnVariableConstants.PROCESS_INSTANCE_VARIABLE_START_USER_SELECT_ASSIGNEES,
MapUtil.of("activity_001", List.of(1L, 2L)));
MapUtil.of("activity_001", ListUtil.of(1L, 2L)));
// 调用
Set<Long> userIds = strategy.calculateUsersByActivity(null, activityId, null,

View File

@ -0,0 +1,167 @@
package cn.iocoder.yudao.module.bpm.framework.flowable.core.util;
import cn.iocoder.yudao.framework.common.core.KeyValue;
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model.BpmModelMetaInfoVO;
import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmProcessDefinitionInfoDO;
import cn.iocoder.yudao.module.bpm.enums.definition.BpmModelFormTypeEnum;
import org.junit.jupiter.api.Test;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
/**
* {@link FlowableUtils} 的单元测试。
*
* @author 芋道源码
*/
class FlowableUtilsTest {
@Test
public void testGetSummary_customSummary_parseDbFormFields() {
// 准备参数:模拟 DB 中 form_fields 字段,列表里每个元素都是一个 form-create 字段 JSON。
BpmProcessDefinitionInfoDO processDefinitionInfo = processDefinitionInfo(dbFormFields(),
summarySetting(true, "reason", "days", "notExists", "startTime"));
Map<String, Object> processVariables = processVariables();
// 调用
List<KeyValue<String, String>> summary = FlowableUtils.getSummary(processDefinitionInfo, processVariables);
// 断言
assertEquals(Arrays.asList(
new KeyValue<>("请假原因", "事假"),
new KeyValue<>("请假天数", "3"),
new KeyValue<>("开始时间", "2026-05-31 09:00:00")),
summary);
}
@Test
public void testGetSummary_defaultSummary_parseFirstThreeFieldsByFormOrder() {
// 准备参数:未开启自定义摘要时,默认取表单配置顺序里的前三个真实字段。
BpmProcessDefinitionInfoDO processDefinitionInfo = processDefinitionInfo(dbFormFields(), null);
Map<String, Object> processVariables = processVariables();
// 调用
List<KeyValue<String, String>> summary = FlowableUtils.getSummary(processDefinitionInfo, processVariables);
// 断言
assertEquals(Arrays.asList(
new KeyValue<>("请假原因", "事假"),
new KeyValue<>("开始时间", "2026-05-31 09:00:00"),
new KeyValue<>("请假天数", "3")),
summary);
}
@Test
public void testGetSummary_summaryDisabled_useDefaultSummary() {
// 准备参数:摘要设置存在但未启用时,仍走默认摘要逻辑。
BpmProcessDefinitionInfoDO processDefinitionInfo = processDefinitionInfo(dbFormFields(),
summarySetting(false, "remark"));
Map<String, Object> processVariables = processVariables();
// 调用
List<KeyValue<String, String>> summary = FlowableUtils.getSummary(processDefinitionInfo, processVariables);
// 断言
assertEquals(Arrays.asList(
new KeyValue<>("请假原因", "事假"),
new KeyValue<>("开始时间", "2026-05-31 09:00:00"),
new KeyValue<>("请假天数", "3")),
summary);
}
@Test
public void testGetSummary_displayComponentsOnly_returnEmpty() {
// 准备参数:分割线、标签、文字等展示组件的 children 是字符串数组,不是表单字段对象。
BpmProcessDefinitionInfoDO processDefinitionInfo = processDefinitionInfo(Arrays.asList(
DIVIDER_FIELD,
TEXT_FIELD,
TAG_FIELD), null);
// 调用
List<KeyValue<String, String>> summary = FlowableUtils.getSummary(processDefinitionInfo,
Collections.emptyMap());
// 断言
assertEquals(Collections.emptyList(), summary);
}
@Test
public void testGetSummary_notNormalForm_returnNull() {
// 准备参数
BpmProcessDefinitionInfoDO processDefinitionInfo = BpmProcessDefinitionInfoDO.builder()
.formType(BpmModelFormTypeEnum.CUSTOM.getType())
.build();
// 调用 & 断言
assertNull(FlowableUtils.getSummary(null, Collections.emptyMap()));
assertNull(FlowableUtils.getSummary(processDefinitionInfo, Collections.emptyMap()));
}
private static BpmProcessDefinitionInfoDO processDefinitionInfo(List<String> formFields,
BpmModelMetaInfoVO.SummarySetting summarySetting) {
return BpmProcessDefinitionInfoDO.builder()
.formType(BpmModelFormTypeEnum.NORMAL.getType())
.formFields(formFields)
.summarySetting(summarySetting)
.build();
}
private static BpmModelMetaInfoVO.SummarySetting summarySetting(Boolean enable, String... fields) {
BpmModelMetaInfoVO.SummarySetting summarySetting = new BpmModelMetaInfoVO.SummarySetting();
summarySetting.setEnable(enable);
summarySetting.setSummary(Arrays.asList(fields));
return summarySetting;
}
private static List<String> dbFormFields() {
return Arrays.asList(
DIVIDER_FIELD,
"{\"type\":\"input\",\"field\":\"reason\",\"title\":\"请假原因\",\"value\":\"\","
+ "\"props\":{\"type\":\"textarea\",\"placeholder\":\"请输入请假原因\"},"
+ "\"$required\":\"请输入请假原因\",\"_fc_id\":\"id_F1\",\"_fc_drag_tag\":\"input\","
+ "\"hidden\":false,\"display\":true}",
TEXT_FIELD,
"{\"type\":\"elRow\",\"title\":\"栅格布局\",\"children\":["
+ "{\"type\":\"elCol\",\"props\":{\"span\":12},\"children\":["
+ "{\"type\":\"DatePicker\",\"field\":\"startTime\",\"title\":\"开始时间\","
+ "\"props\":{\"type\":\"datetime\",\"placeholder\":\"请选择开始时间\"},"
+ "\"_fc_id\":\"id_F2\",\"_fc_drag_tag\":\"datePicker\"}]},"
+ "\"字段说明\","
+ "{\"type\":\"elCol\",\"props\":{\"span\":12},\"children\":["
+ "{\"type\":\"inputNumber\",\"field\":\"days\",\"title\":\"请假天数\","
+ "\"props\":{\"min\":0,\"precision\":1},\"_fc_id\":\"id_F3\","
+ "\"_fc_drag_tag\":\"inputNumber\"}]}],\"_fc_id\":\"id_LAYOUT\","
+ "\"_fc_drag_tag\":\"row\"}",
TAG_FIELD,
"{\"type\":\"input\",\"field\":\"remark\",\"title\":\"备注\",\"value\":\"\","
+ "\"props\":{\"placeholder\":\"请输入备注\"},\"_fc_id\":\"id_F4\","
+ "\"_fc_drag_tag\":\"input\",\"hidden\":false,\"display\":true}");
}
private static Map<String, Object> processVariables() {
Map<String, Object> processVariables = new HashMap<>();
processVariables.put("reason", "事假");
processVariables.put("startTime", "2026-05-31 09:00:00");
processVariables.put("days", 3);
processVariables.put("remark", "下午到家");
return processVariables;
}
private static final String DIVIDER_FIELD = "{\"type\":\"elDivider\",\"children\":[\"基础信息\"],"
+ "\"props\":{\"contentPosition\":\"left\"},\"_fc_id\":\"id_DIVIDER\","
+ "\"_fc_drag_tag\":\"elDivider\"}";
private static final String TEXT_FIELD = "{\"type\":\"div\",\"children\":[\"请按实际情况填写\"],"
+ "\"props\":{\"style\":{\"color\":\"#909399\"}},\"_fc_id\":\"id_TEXT\","
+ "\"_fc_drag_tag\":\"text\"}";
private static final String TAG_FIELD = "{\"type\":\"elTag\",\"children\":[\"重要\"],"
+ "\"props\":{\"type\":\"warning\"},\"_fc_id\":\"id_TAG\",\"_fc_drag_tag\":\"elTag\"}";
}

85
yudao-module-im/pom.xml Normal file
View File

@ -0,0 +1,85 @@
<?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>cn.iocoder.boot</groupId>
<artifactId>yudao</artifactId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>yudao-module-im</artifactId>
<packaging>jar</packaging>
<name>${project.artifactId}</name>
<description>
im 模块,我们放即时通讯业务。
例如说:单聊、群聊、消息收发、消息撤回、消息已读等等
</description>
<dependencies>
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-module-system</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-module-infra</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-common</artifactId>
</dependency>
<!-- Web 相关 -->
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-spring-boot-starter-security</artifactId>
</dependency>
<!-- DB 相关 -->
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-spring-boot-starter-mybatis</artifactId>
</dependency>
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-spring-boot-starter-redis</artifactId>
</dependency>
<!-- 工具类相关 -->
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-spring-boot-starter-excel</artifactId>
</dependency>
<!-- 敏感词检测sensitive-wordtrie 树高效匹配,支持忽略大小写 / 全半角 / 数字风格),版本由 yudao-dependencies 统一管理 -->
<dependency>
<groupId>com.github.houbb</groupId>
<artifactId>sensitive-word</artifactId>
</dependency>
<!-- 汉字转拼音:作为 hutool PinyinUtil 的底层引擎,业务侧调用 StrUtils.toPinyin 时按需引入 -->
<dependency>
<groupId>com.belerweb</groupId>
<artifactId>pinyin4j</artifactId>
</dependency>
<!-- Test 测试相关 -->
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-spring-boot-starter-test</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,5 @@
/**
* @author anhaohao
* @since 2024/3/9 下午8:59
*/
package cn.iocoder.yudao.module.im.api;

View File

@ -0,0 +1,37 @@
package cn.iocoder.yudao.module.im.controller.admin.channel;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.im.controller.admin.manager.channel.vo.material.ImChannelMaterialRespVO;
import cn.iocoder.yudao.module.im.dal.dataobject.channel.ImChannelMaterialDO;
import cn.iocoder.yudao.module.im.service.channel.ImChannelMaterialService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Tag(name = "用户 APP - IM 频道素材")
@RestController
@RequestMapping("/im/channel/material")
@Validated
public class ImChannelMaterialController {
@Resource
private ImChannelMaterialService channelMaterialService;
@GetMapping("/get")
@Operation(summary = "获取素材详情;用于客户端点击图文卡片渲染详情页")
@Parameter(name = "id", description = "素材编号", required = true, example = "1024")
public CommonResult<ImChannelMaterialRespVO> getMaterial(@RequestParam("id") Long id) {
ImChannelMaterialDO material = channelMaterialService.validateMaterialExists(id);
return success(BeanUtils.toBean(material, ImChannelMaterialRespVO.class));
}
}

View File

@ -0,0 +1,59 @@
package cn.iocoder.yudao.module.im.controller.admin.face;
import cn.hutool.core.collection.ListUtil;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.im.controller.admin.face.vo.pack.ImFacePackUserRespVO;
import cn.iocoder.yudao.module.im.dal.dataobject.face.ImFacePackDO;
import cn.iocoder.yudao.module.im.dal.dataobject.face.ImFacePackItemDO;
import cn.iocoder.yudao.module.im.service.face.ImFacePackItemService;
import cn.iocoder.yudao.module.im.service.face.ImFacePackService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMultiMap;
@Tag(name = "管理后台 - IM 表情包")
@RestController
@RequestMapping("/im/face-pack")
@Validated
public class ImFacePackController {
@Resource
private ImFacePackService facePackService;
@Resource
private ImFacePackItemService facePackItemService;
@GetMapping("/list")
@Operation(summary = "获得启用的表情包列表(含表情)")
public CommonResult<List<ImFacePackUserRespVO>> getFacePackList() {
// 1.1 拉所有启用表情包
List<ImFacePackDO> packs = facePackService.getEnabledFacePackList();
if (packs.isEmpty()) {
return success(ListUtil.of());
}
// 1.2 拉这些包下所有启用表情,按 packId 分组
List<ImFacePackItemDO> items = facePackItemService.getEnabledItemListByPackIds(
convertList(packs, ImFacePackDO::getId));
Map<Long, List<ImFacePackItemDO>> itemsByPackId = convertMultiMap(items, ImFacePackItemDO::getPackId);
// 2. 拼装BeanUtils 把 pack 字段映射 + 自己塞 items
List<ImFacePackUserRespVO> result = convertList(packs, pack -> {
ImFacePackUserRespVO vo = BeanUtils.toBean(pack, ImFacePackUserRespVO.class);
vo.setItems(BeanUtils.toBean(itemsByPackId.getOrDefault(pack.getId(), ListUtil.of()), ImFacePackUserRespVO.Item.class));
return vo;
});
return success(result);
}
}

View File

@ -0,0 +1,52 @@
package cn.iocoder.yudao.module.im.controller.admin.face;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.im.controller.admin.face.vo.useritem.ImFaceUserItemRespVO;
import cn.iocoder.yudao.module.im.controller.admin.face.vo.useritem.ImFaceUserItemSaveReqVO;
import cn.iocoder.yudao.module.im.dal.dataobject.face.ImFaceUserItemDO;
import cn.iocoder.yudao.module.im.service.face.ImFaceUserItemService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.getLoginUserId;
@Tag(name = "管理后台 - IM 个人表情")
@RestController
@RequestMapping("/im/face-user-item")
@Validated
public class ImFaceUserItemController {
@Resource
private ImFaceUserItemService faceUserItemService;
@GetMapping("/list")
@Operation(summary = "获得我的个人表情列表")
public CommonResult<List<ImFaceUserItemRespVO>> getFaceUserItemList() {
List<ImFaceUserItemDO> items = faceUserItemService.getFaceUserItemList(getLoginUserId());
return success(BeanUtils.toBean(items, ImFaceUserItemRespVO.class));
}
@PostMapping("/create")
@Operation(summary = "添加个人表情")
public CommonResult<Long> createFaceUserItem(@Valid @RequestBody ImFaceUserItemSaveReqVO reqVO) {
return success(faceUserItemService.createFaceUserItem(getLoginUserId(), reqVO));
}
@DeleteMapping("/delete")
@Operation(summary = "删除个人表情")
@Parameter(name = "id", description = "编号", required = true, example = "4096")
public CommonResult<Boolean> deleteFaceUserItem(@RequestParam("id") Long id) {
faceUserItemService.deleteFaceUserItem(getLoginUserId(), id);
return success(true);
}
}

View File

@ -0,0 +1,46 @@
package cn.iocoder.yudao.module.im.controller.admin.face.vo.pack;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.List;
@Schema(description = "IM 表情包(用户端) Response VO")
@Data
public class ImFacePackUserRespVO {
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long id;
@Schema(description = "表情包名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "猫主子")
private String name;
@Schema(description = "表情包图标", example = "https://cdn.example.com/face/pack/cat.png")
private String icon;
@Schema(description = "表情列表", requiredMode = Schema.RequiredMode.REQUIRED)
private List<Item> items;
@Schema(description = "IM 表情包项(用户端)")
@Data
public static class Item {
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2048")
private Long id;
@Schema(description = "表情图 URL", requiredMode = Schema.RequiredMode.REQUIRED,
example = "https://cdn.example.com/face/pack/cat-001.png")
private String url;
@Schema(description = "表情名", example = "狗头")
private String name;
@Schema(description = "渲染宽度(像素)", requiredMode = Schema.RequiredMode.REQUIRED, example = "200")
private Integer width;
@Schema(description = "渲染高度(像素)", requiredMode = Schema.RequiredMode.REQUIRED, example = "200")
private Integer height;
}
}

View File

@ -0,0 +1,26 @@
package cn.iocoder.yudao.module.im.controller.admin.face.vo.useritem;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Schema(description = "IM 个人表情 Response VO")
@Data
public class ImFaceUserItemRespVO {
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "4096")
private Long id;
@Schema(description = "表情图 URL", requiredMode = Schema.RequiredMode.REQUIRED,
example = "https://cdn.example.com/face/user/abc.gif")
private String url;
@Schema(description = "表情名", example = "狗头")
private String name;
@Schema(description = "渲染宽度(像素)", requiredMode = Schema.RequiredMode.REQUIRED, example = "200")
private Integer width;
@Schema(description = "渲染高度(像素)", requiredMode = Schema.RequiredMode.REQUIRED, example = "200")
private Integer height;
}

View File

@ -0,0 +1,37 @@
package cn.iocoder.yudao.module.im.controller.admin.face.vo.useritem;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;
@Schema(description = "IM 个人表情新增 Request VO")
@Data
public class ImFaceUserItemSaveReqVO {
@Schema(description = "表情图 URL", requiredMode = Schema.RequiredMode.REQUIRED,
example = "https://cdn.example.com/face/user/abc.gif")
@NotBlank(message = "表情图 URL 不能为空")
@Size(max = 512, message = "表情图 URL 长度不能超过 512")
private String url;
@Schema(description = "表情名", example = "狗头")
@Size(max = 64, message = "表情名长度不能超过 64")
private String name;
@Schema(description = "渲染宽度(像素)", requiredMode = Schema.RequiredMode.REQUIRED, example = "200")
@NotNull(message = "渲染宽度不能为空")
@Min(value = 1, message = "渲染宽度不能小于 1 像素")
@Max(value = 2048, message = "渲染宽度不能大于 2048 像素")
private Integer width;
@Schema(description = "渲染高度(像素)", requiredMode = Schema.RequiredMode.REQUIRED, example = "200")
@NotNull(message = "渲染高度不能为空")
@Min(value = 1, message = "渲染高度不能小于 1 像素")
@Max(value = 2048, message = "渲染高度不能大于 2048 像素")
private Integer height;
}

View File

@ -0,0 +1,127 @@
package cn.iocoder.yudao.module.im.controller.admin.friend;
import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.collection.MapUtils;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.common.util.string.StrUtils;
import cn.iocoder.yudao.module.im.controller.admin.friend.vo.ImFriendRespVO;
import cn.iocoder.yudao.module.im.controller.admin.friend.vo.ImFriendUpdateReqVO;
import cn.iocoder.yudao.module.im.dal.dataobject.friend.ImFriendDO;
import cn.iocoder.yudao.module.im.service.friend.ImFriendService;
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.singleton;
import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.getLoginUserId;
@Tag(name = "管理后台 - IM 好友")
@RestController
@RequestMapping("/im/friend")
@Validated
public class ImFriendController {
@Resource
private ImFriendService friendService;
@Resource
private AdminUserApi adminUserApi;
@GetMapping("/list")
@Operation(summary = "获得当前登录用户的好友列表")
public CommonResult<List<ImFriendRespVO>> getMyFriendList() {
// 含 DISABLE 历史好友:保留给前端展示「已删除好友」的历史对话信息;前端按 status 决定会话级联清理
List<ImFriendDO> friends = friendService.getFriendList(getLoginUserId());
return success(buildFriendRespVOList(friends));
}
@GetMapping("/get")
@Operation(summary = "获得好友详情")
@Parameter(name = "friendUserId", description = "好友的用户编号", required = true, example = "2048")
public CommonResult<ImFriendRespVO> getFriend(@RequestParam("friendUserId") Long friendUserId) {
ImFriendDO friend = friendService.getFriend(getLoginUserId(), friendUserId);
return success(buildFriendRespVO(friend));
}
@DeleteMapping("/delete")
@Operation(summary = "删除好友(单向软删除)")
@Parameters({
@Parameter(description = "好友的用户编号", required = true, example = "2048"),
@Parameter(description = "是否级联清理本端相关数据(如私聊会话)")
})
public CommonResult<Boolean> deleteFriend(
@RequestParam("friendUserId") @NotNull(message = "好友用户编号不能为空") Long friendUserId,
@RequestParam(value = "clear", required = false) Boolean clear) {
friendService.deleteFriend(getLoginUserId(), friendUserId, clear);
return success(true);
}
@PutMapping("/update")
@Operation(summary = "更新好友单边属性(备注 / 免打扰 / 联系人置顶)")
public CommonResult<Boolean> updateFriend(@Valid @RequestBody ImFriendUpdateReqVO reqVO) {
friendService.updateFriend(getLoginUserId(), reqVO);
return success(true);
}
@PutMapping("/block")
@Operation(summary = "拉黑好友(必须先是好友;单边屏蔽对方私聊消息)")
@Parameter(name = "friendUserId", description = "好友的用户编号", required = true, example = "2048")
public CommonResult<Boolean> blockFriend(
@RequestParam("friendUserId") @NotNull(message = "好友用户编号不能为空") Long friendUserId) {
friendService.blockFriend(getLoginUserId(), friendUserId);
return success(true);
}
@PutMapping("/unblock")
@Operation(summary = "移出黑名单")
@Parameter(name = "friendUserId", description = "好友的用户编号", required = true, example = "2048")
public CommonResult<Boolean> unblockFriend(
@RequestParam("friendUserId") @NotNull(message = "好友用户编号不能为空") Long friendUserId) {
friendService.unblockFriend(getLoginUserId(), friendUserId);
return success(true);
}
// ========== 私有方法VO 组装 ==========
private List<ImFriendRespVO> buildFriendRespVOList(Collection<ImFriendDO> friends) {
if (CollUtil.isEmpty(friends)) {
return Collections.emptyList();
}
// 批量聚合 AdminUser 信息(昵称 / 头像),避免 N+1
Map<Long, AdminUserRespDTO> userMap = adminUserApi.getUserMap(
convertList(friends, ImFriendDO::getFriendUserId));
return convertList(friends, friend -> {
ImFriendRespVO vo = BeanUtils.toBean(friend, ImFriendRespVO.class);
MapUtils.findAndThen(userMap, friend.getFriendUserId(), user ->
vo.setNickname(user.getNickname()).setAvatar(user.getAvatar()));
// 备注 / 昵称的拼音,给前端做字母分桶 + 拼音搜索
vo.setDisplayNamePinyin(StrUtils.toPinyin(vo.getDisplayName()))
.setNicknamePinyin(StrUtils.toPinyin(vo.getNickname()));
return vo;
});
}
private ImFriendRespVO buildFriendRespVO(ImFriendDO friend) {
if (friend == null) {
return null;
}
return CollUtil.getFirst(buildFriendRespVOList(singleton(friend)));
}
}

View File

@ -0,0 +1,125 @@
package cn.iocoder.yudao.module.im.controller.admin.friend;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjUtil;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.collection.MapUtils;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.im.controller.admin.friend.vo.request.ImFriendRequestApplyReqVO;
import cn.iocoder.yudao.module.im.controller.admin.friend.vo.request.ImFriendRequestRespVO;
import cn.iocoder.yudao.module.im.dal.dataobject.friend.ImFriendRequestDO;
import cn.iocoder.yudao.module.im.service.friend.ImFriendRequestService;
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Stream;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSetByFlatMap;
import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.getLoginUserId;
/**
* IM 好友申请记录 Controller
*
* @author 芋道源码
*/
@Tag(name = "管理后台 - IM 好友申请")
@RestController
@RequestMapping("/im/friend-request")
@Validated
public class ImFriendRequestController {
@Resource
private ImFriendRequestService friendRequestService;
@Resource
private AdminUserApi adminUserApi;
@PostMapping("/apply")
@Operation(summary = "发起好友申请")
public CommonResult<Long> applyFriend(@Valid @RequestBody ImFriendRequestApplyReqVO reqVO) {
ImFriendRequestDO request = friendRequestService.applyFriend(getLoginUserId(), reqVO);
return success(request != null ? request.getId() : null);
}
@PutMapping("/agree")
@Operation(summary = "同意好友申请")
@Parameter(name = "id", description = "申请编号", required = true, example = "1024")
public CommonResult<Boolean> agreeFriendRequest(
@RequestParam("id") @NotNull(message = "申请编号不能为空") Long id) {
friendRequestService.agreeFriendRequest(getLoginUserId(), id);
return success(true);
}
@PutMapping("/refuse")
@Operation(summary = "拒绝好友申请")
public CommonResult<Boolean> refuseFriendRequest(
@RequestParam("id") @NotNull(message = "申请编号不能为空") Long id,
@RequestParam(value = "handleContent", required = false)
@Size(max = 255, message = "处理理由最多 255 个字符") String handleContent) {
friendRequestService.refuseFriendRequest(getLoginUserId(), id, handleContent);
return success(true);
}
@GetMapping("/list")
@Operation(summary = "查询「我相关」的好友申请列表(游标分页:传 maxId 加载更多)")
public CommonResult<List<ImFriendRequestRespVO>> getMyFriendRequestList(
@Parameter(description = "当前列表最旧记录的 id首页不传")
@RequestParam(value = "maxId", required = false) Long maxId,
@Parameter(description = "单次拉取条数", required = true)
@RequestParam("limit") @Min(1) @Max(200) Integer limit) {
List<ImFriendRequestDO> list = friendRequestService.getMyFriendRequestList(getLoginUserId(), maxId, limit);
return success(buildList(list));
}
@GetMapping("/get")
@Operation(summary = "按 id 单查「我相关」的申请记录带越权过滤WebSocket 通知到达后用)")
@Parameter(name = "id", description = "申请记录编号", required = true)
public CommonResult<ImFriendRequestRespVO> getMyFriendRequest(@RequestParam("id") Long id) {
ImFriendRequestDO request = friendRequestService.getFriendRequest(id);
// 越权过滤fromUser / toUser 必有一方是当前用户,否则当不存在返回 null
Long currentUserId = getLoginUserId();
if (request == null || (ObjUtil.notEqual(request.getFromUserId(), currentUserId)
&& ObjUtil.notEqual(request.getToUserId(), currentUserId))) {
return success(null);
}
return success(CollUtil.getFirst(buildList(Collections.singletonList(request))));
}
// ========== 私有方法VO 组装 ==========
private List<ImFriendRequestRespVO> buildList(List<ImFriendRequestDO> list) {
if (CollUtil.isEmpty(list)) {
return Collections.emptyList();
}
// 双向 OR 列表userIds 取 from + to 两组并集
Set<Long> userIds = convertSetByFlatMap(list,
request -> Stream.of(request.getFromUserId(), request.getToUserId()));
Map<Long, AdminUserRespDTO> userMap = adminUserApi.getUserMap(userIds);
return convertList(list, request -> {
ImFriendRequestRespVO vo = BeanUtils.toBean(request, ImFriendRequestRespVO.class);
MapUtils.findAndThen(userMap, request.getFromUserId(), user ->
vo.setFromNickname(user.getNickname()).setFromAvatar(user.getAvatar()));
MapUtils.findAndThen(userMap, request.getToUserId(), user ->
vo.setToNickname(user.getNickname()).setToAvatar(user.getAvatar()));
return vo;
});
}
}

View File

@ -0,0 +1,61 @@
package cn.iocoder.yudao.module.im.controller.admin.friend.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* IM 好友 Response VO
*
* @author 芋道源码
*/
@Schema(description = "管理后台 - IM 好友 Response VO")
@Data
public class ImFriendRespVO {
@Schema(description = "关系记录编号", example = "1024")
private Long id;
@Schema(description = "好友的用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2048")
private Long friendUserId;
@Schema(description = "是否免打扰", example = "false")
private Boolean silent;
@Schema(description = "好友展示备注(仅自己可见)", example = "老张")
private String displayName;
@Schema(description = "好友展示备注的拼音(小写无空格)", example = "laozhang")
private String displayNamePinyin;
@Schema(description = "添加来源", example = "1")
private Integer addSource; // 参见 ImFriendAddSourceEnum 枚举
@Schema(description = "是否置顶联系人", example = "false")
private Boolean pinned;
@Schema(description = "是否拉黑(仅自己可见)", example = "false")
private Boolean blocked;
@Schema(description = "好友状态", example = "0")
private Integer status;
@Schema(description = "添加好友时间")
private LocalDateTime addTime;
@Schema(description = "删除好友时间")
private LocalDateTime deleteTime;
// ========== 下面是聚合字段,方便前端显示 ==========
@Schema(description = "好友昵称(实时聚合自 AdminUser", example = "芋道")
private String nickname;
@Schema(description = "好友昵称的拼音(小写无空格)", example = "yudao")
private String nicknamePinyin;
@Schema(description = "好友头像(实时聚合自 AdminUser")
private String avatar;
}

View File

@ -0,0 +1,26 @@
package cn.iocoder.yudao.module.im.controller.admin.friend.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;
@Schema(description = "管理后台 - IM 好友更新 Request VO")
@Data
public class ImFriendUpdateReqVO {
@Schema(description = "好友的用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2048")
@NotNull(message = "好友用户编号不能为空")
private Long friendUserId;
@Schema(description = "是否免打扰;不传表示不修改", example = "true")
private Boolean silent;
@Schema(description = "好友展示备注(仅自己可见);不传表示不修改,传空串表示清空", example = "老张")
@Size(max = 16, message = "好友备注最多 16 个字符")
private String displayName;
@Schema(description = "是否置顶联系人;不传表示不修改", example = "true")
private Boolean pinned;
}

View File

@ -0,0 +1,35 @@
package cn.iocoder.yudao.module.im.controller.admin.friend.vo.request;
import cn.iocoder.yudao.framework.common.validation.InEnum;
import cn.iocoder.yudao.module.im.enums.friend.ImFriendAddSourceEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;
/**
* IM 好友申请 - 发起 Request VO
*
* @author 芋道源码
*/
@Schema(description = "管理后台 - IM 好友申请发起 Request VO")
@Data
public class ImFriendRequestApplyReqVO {
@Schema(description = "接收方用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2048")
@NotNull(message = "接收方用户编号不能为空")
private Long toUserId;
@Schema(description = "申请理由", example = "我是芋艿(一种食材)")
@Size(max = 255, message = "申请理由最多 255 个字符")
private String applyContent;
@Schema(description = "对接收方的备注(仅自己可见)", example = "老张")
@Size(max = 16, message = "好友备注最多 16 个字符")
private String displayName;
@Schema(description = "添加来源", example = "1")
@InEnum(ImFriendAddSourceEnum.class)
private Integer addSource;
}

View File

@ -0,0 +1,58 @@
package cn.iocoder.yudao.module.im.controller.admin.friend.vo.request;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* IM 好友申请 Response VO
*
* @author 芋道源码
*/
@Schema(description = "管理后台 - IM 好友申请 Response VO")
@Data
public class ImFriendRequestRespVO {
@Schema(description = "申请编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long id;
@Schema(description = "发起方用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
private Long fromUserId;
@Schema(description = "接收方用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "200")
private Long toUserId;
@Schema(description = "处理结果", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
private Integer handleResult; // 参见 ImFriendRequestHandleResultEnum 枚举
@Schema(description = "申请理由", example = "我是芋艿(一种食材)")
private String applyContent;
@Schema(description = "处理理由(接收方拒绝时可选填)", example = "暂不通过")
private String handleContent;
@Schema(description = "添加来源", example = "1")
private Integer addSource; // 参见 ImFriendAddSourceEnum 枚举
@Schema(description = "处理时间")
private LocalDateTime handleTime;
@Schema(description = "申请创建时间")
private LocalDateTime createTime;
// ========== 下面是聚合字段,方便前端显示 ==========
@Schema(description = "发起方昵称(实时聚合自 AdminUser", example = "芋道")
private String fromNickname;
@Schema(description = "发起方头像(实时聚合自 AdminUser")
private String fromAvatar;
@Schema(description = "接收方昵称(实时聚合自 AdminUser", example = "老张")
private String toNickname;
@Schema(description = "接收方头像(实时聚合自 AdminUser")
private String toAvatar;
}

View File

@ -0,0 +1,206 @@
package cn.iocoder.yudao.module.im.controller.admin.group;
import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.im.controller.admin.group.vo.*;
import cn.iocoder.yudao.module.im.controller.admin.group.vo.member.ImGroupMemberInviteReqVO;
import cn.iocoder.yudao.module.im.controller.admin.group.vo.member.ImGroupMemberRemoveReqVO;
import cn.iocoder.yudao.module.im.controller.admin.message.vo.group.ImGroupMessageRespVO;
import cn.iocoder.yudao.module.im.dal.dataobject.group.ImGroupDO;
import cn.iocoder.yudao.module.im.dal.dataobject.group.ImGroupMemberDO;
import cn.iocoder.yudao.module.im.dal.dataobject.message.ImGroupMessageDO;
import cn.iocoder.yudao.module.im.service.group.ImGroupMemberService;
import cn.iocoder.yudao.module.im.service.group.ImGroupService;
import cn.iocoder.yudao.module.im.service.message.ImGroupMessageService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.*;
import java.util.stream.Stream;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.*;
import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.getLoginUserId;
@Tag(name = "管理后台 - 群")
@RestController
@RequestMapping("/im/group")
@Validated
public class ImGroupController {
@Resource
private ImGroupService groupService;
@Resource
private ImGroupMemberService groupMemberService;
@Resource
private ImGroupMessageService groupMessageService;
// ==================== 群的写操作 ====================
@PostMapping("/create")
@Operation(summary = "创建群")
public CommonResult<ImGroupRespVO> createGroup(@Valid @RequestBody ImGroupCreateReqVO createReqVO) {
ImGroupDO group = groupService.createGroup(createReqVO, getLoginUserId());
// 新建群必无 pinnedMessages跳过关联回填
return success(BeanUtils.toBean(group, ImGroupRespVO.class));
}
@PutMapping("/update")
@Operation(summary = "更新群")
public CommonResult<ImGroupRespVO> updateGroup(@Valid @RequestBody ImGroupUpdateReqVO updateReqVO) {
ImGroupDO group = groupService.updateGroup(updateReqVO, getLoginUserId());
return success(buildGroupRespVO(group, getLoginUserId()));
}
@DeleteMapping("/dissolve")
@Operation(summary = "解散群")
@Parameter(name = "id", description = "群编号", required = true)
public CommonResult<Boolean> dissolveGroup(@RequestParam("id") Long id) {
groupService.dissolveGroup(id, getLoginUserId());
return success(true);
}
// ==================== 群的读操作 ====================
@GetMapping("/get")
@Operation(summary = "获得群")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
public CommonResult<ImGroupRespVO> getGroup(@RequestParam("id") Long id) {
ImGroupDO group = groupService.getGroup(id);
return success(buildGroupRespVO(group, getLoginUserId()));
}
@GetMapping("/list")
@Operation(summary = "获得当前登录用户的群列表")
public CommonResult<List<ImGroupRespVO>> getMyGroupList() {
Long loginUserId = getLoginUserId();
List<ImGroupDO> groups = groupService.getMyGroupList(loginUserId);
return success(buildGroupRespVOList(groups, loginUserId));
}
// ==================== 群成员的写操作 ====================
@PostMapping("/invite")
@Operation(summary = "邀请用户加入群")
public CommonResult<Boolean> inviteGroupMember(@Valid @RequestBody ImGroupMemberInviteReqVO inviteReqVO) {
groupService.inviteGroupMember(getLoginUserId(), inviteReqVO);
return success(true);
}
@DeleteMapping("/quit")
@Operation(summary = "退出群")
@Parameter(name = "groupId", description = "群编号", required = true)
public CommonResult<Boolean> quitGroup(@RequestParam("groupId") Long groupId) {
groupService.quitGroup(groupId, getLoginUserId());
return success(true);
}
@DeleteMapping("/kicking")
@Operation(summary = "移除群成员")
public CommonResult<Boolean> removeGroupMember(@Valid @RequestBody ImGroupMemberRemoveReqVO removeReqVO) {
groupService.removeGroupMember(getLoginUserId(), removeReqVO);
return success(true);
}
@PutMapping("/add-admin")
@Operation(summary = "添加群管理员")
public CommonResult<Boolean> addGroupAdmin(@Valid @RequestBody ImGroupAdminAddReqVO reqVO) {
groupService.addGroupAdmin(getLoginUserId(), reqVO);
return success(true);
}
@PutMapping("/remove-admin")
@Operation(summary = "撤销群管理员")
public CommonResult<Boolean> removeGroupAdmin(@Valid @RequestBody ImGroupAdminRemoveReqVO reqVO) {
groupService.removeGroupAdmin(getLoginUserId(), reqVO);
return success(true);
}
@PutMapping("/transfer-owner")
@Operation(summary = "转让群主")
public CommonResult<Boolean> transferGroupOwner(@Valid @RequestBody ImGroupTransferOwnerReqVO transferReqVO) {
groupService.transferGroupOwner(getLoginUserId(), transferReqVO);
return success(true);
}
// ==================== 群消息置顶 ====================
@PutMapping("/pin-message")
@Operation(summary = "置顶群消息(群主 / 管理员)")
public CommonResult<Boolean> pinGroupMessage(@Valid @RequestBody ImGroupMessagePinReqVO reqVO) {
groupService.pinGroupMessage(getLoginUserId(), reqVO.getId(), reqVO.getMessageId());
return success(true);
}
@PutMapping("/unpin-message")
@Operation(summary = "取消置顶群消息(群主 / 管理员)")
public CommonResult<Boolean> unpinGroupMessage(@Valid @RequestBody ImGroupMessagePinReqVO reqVO) {
groupService.unpinGroupMessage(getLoginUserId(), reqVO.getId(), reqVO.getMessageId());
return success(true);
}
// ==================== 群禁言 ====================
@PutMapping("/mute-all")
@Operation(summary = "全群禁言 / 取消(群主 / 管理员)")
public CommonResult<Boolean> muteAll(@Valid @RequestBody ImGroupMuteAllReqVO reqVO) {
groupService.muteAll(getLoginUserId(), reqVO);
return success(true);
}
@PutMapping("/mute-member")
@Operation(summary = "禁言成员")
public CommonResult<Boolean> muteMember(@Valid @RequestBody ImGroupMuteMemberReqVO reqVO) {
groupService.muteMember(getLoginUserId(), reqVO);
return success(true);
}
@PutMapping("/cancel-mute-member")
@Operation(summary = "取消成员禁言")
public CommonResult<Boolean> cancelMuteMember(@Valid @RequestBody ImGroupCancelMuteMemberReqVO reqVO) {
groupService.cancelMuteMember(getLoginUserId(), reqVO);
return success(true);
}
/** 单群转 VO + 关联回填 pinnedMessages仅当登录用户是该群有效成员 */
private ImGroupRespVO buildGroupRespVO(ImGroupDO group, Long loginUserId) {
if (group == null) {
return null;
}
return buildGroupRespVOList(Collections.singletonList(group), loginUserId).get(0);
}
/**
* 群列表批量转 VO + 关联回填 pinnedMessages
* <p>
* 仅当登录用户是某群的有效成员时才回填该群的 pinnedMessages避免非成员 / 已退群用户越权拿到置顶消息内容
*/
private List<ImGroupRespVO> buildGroupRespVOList(List<ImGroupDO> groups, Long loginUserId) {
if (CollUtil.isEmpty(groups)) {
return Collections.emptyList();
}
// 仅当前用户是有效成员的群才允许回填置顶消息
Set<Long> activeGroupIds = convertSet(
groupMemberService.getActiveGroupMemberListByUserId(loginUserId), ImGroupMemberDO::getGroupId);
Set<Long> allMessageIds = convertSetByFlatMap(groups, group -> activeGroupIds.contains(group.getId())
? CollUtil.emptyIfNull(group.getPinnedMessageIds()).stream() : Stream.empty());
Map<Long, ImGroupMessageDO> messageMap = groupMessageService.getGroupMessageMap(allMessageIds);
// 转换输出
return convertList(groups, group -> {
ImGroupRespVO vo = BeanUtils.toBean(group, ImGroupRespVO.class);
if (!activeGroupIds.contains(group.getId()) || CollUtil.isEmpty(group.getPinnedMessageIds())) {
return vo;
}
// 按 pin 顺序输出已被删除的消息messageMap 没命中)跳过
List<ImGroupMessageDO> pinnedMesages = convertList(group.getPinnedMessageIds(), messageMap::get);
return vo.setPinnedMessages(BeanUtils.toBean(pinnedMesages, ImGroupMessageRespVO.class));
});
}
}

View File

@ -0,0 +1,125 @@
package cn.iocoder.yudao.module.im.controller.admin.group;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjUtil;
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.collection.MapUtils;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.im.controller.admin.group.vo.member.ImGroupMemberRespVO;
import cn.iocoder.yudao.module.im.controller.admin.group.vo.member.ImGroupMemberUpdateReqVO;
import cn.iocoder.yudao.module.im.dal.dataobject.group.ImGroupMemberDO;
import cn.iocoder.yudao.module.im.service.group.ImGroupMemberService;
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.getLoginUserId;
import static cn.iocoder.yudao.module.im.enums.ErrorCodeConstants.GROUP_MEMBER_NOT_IN_GROUP;
@Tag(name = "管理后台 - 群成员")
@RestController
@RequestMapping("/im/group-member")
@Validated
public class ImGroupMemberController {
@Resource
private ImGroupMemberService groupMemberService;
@Resource
private AdminUserApi adminUserApi;
@PutMapping("/update")
@Operation(summary = "更新群成员")
public CommonResult<Boolean> updateGroupMember(@Valid @RequestBody ImGroupMemberUpdateReqVO updateReqVO) {
groupMemberService.updateGroupMember(getLoginUserId(), updateReqVO);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得群成员")
@Parameters({
@Parameter(name = "id", description = "编号(与 groupId + userId 二选一)", example = "1024"),
@Parameter(name = "groupId", description = "群编号(与 userId 配合查)", example = "1"),
@Parameter(name = "userId", description = "用户编号(与 groupId 配合查)", example = "100")
})
public CommonResult<ImGroupMemberRespVO> getGroupMember(@RequestParam(value = "id", required = false) Long id,
@RequestParam(value = "groupId", required = false) Long groupId,
@RequestParam(value = "userId", required = false) Long userId) {
// 1. 查询群成员
ImGroupMemberDO member;
if (id != null) {
member = groupMemberService.getGroupMember(id);
} else if (groupId != null && userId != null) {
member = groupMemberService.getGroupMember(groupId, userId);
} else {
// 避免 selectByGroupIdAndUserId 收到 null 参数走全表扫 / 抛 SQL 异常
throw new IllegalArgumentException("参数缺失:需传 id 或 (groupId, userId)");
}
if (member == null) {
return success(null);
}
// 2. 校验当前登录用户是该成员所在群的有效成员
Long loginUserId = getLoginUserId();
groupMemberService.validateMemberInGroup(member.getGroupId(), loginUserId);
// 3. 转化 VO
ImGroupMemberRespVO memberVO = BeanUtils.toBean(member, ImGroupMemberRespVO.class);
AdminUserRespDTO user = adminUserApi.getUser(member.getUserId());
if (user != null) {
memberVO.setNickname(user.getNickname()).setAvatar(user.getAvatar());
}
hidePrivateFieldsIfNotSelf(memberVO, member.getUserId(), loginUserId);
return success(memberVO);
}
@GetMapping("/list")
@Operation(summary = "获得指定群的成员列表")
@Parameter(name = "groupId", description = "群编号", required = true, example = "1024")
public CommonResult<List<ImGroupMemberRespVO>> getGroupMemberList(@RequestParam("groupId") Long groupId) {
// 1.1 查询群成员列表(包含 DISABLE 已退群的成员,不按时间过滤)
// 说明:保留已退群成员,是为了前端展示历史消息时,仍能通过该接口拿到已退群成员的昵称 / 头像信息,避免显示为空
List<ImGroupMemberDO> members = groupMemberService.getGroupMemberListByGroupId(groupId);
// 1.2 校验当前登录用户是否为群的有效成员,非成员不可查看
Long loginUserId = getLoginUserId();
if (CollUtil.findOne(members, member -> loginUserId.equals(member.getUserId())
&& CommonStatusEnum.ENABLE.getStatus().equals(member.getStatus())) == null) {
throw exception(GROUP_MEMBER_NOT_IN_GROUP);
}
// 2.批量聚合 AdminUser 信息(昵称 / 头像)
Map<Long, AdminUserRespDTO> userMap = adminUserApi.getUserMap(
convertList(members, ImGroupMemberDO::getUserId));
return success(convertList(members, m -> {
ImGroupMemberRespVO vo = BeanUtils.toBean(m, ImGroupMemberRespVO.class);
MapUtils.findAndThen(userMap, m.getUserId(), user ->
vo.setNickname(user.getNickname()).setAvatar(user.getAvatar()));
hidePrivateFieldsIfNotSelf(vo, m.getUserId(), loginUserId);
return vo;
}));
}
/**
* 非本人查看时置空成员的私人设置字段groupRemark / silent
*/
private void hidePrivateFieldsIfNotSelf(ImGroupMemberRespVO vo, Long memberUserId, Long loginUserId) {
if (ObjUtil.notEqual(loginUserId, memberUserId)) {
vo.setGroupRemark(null).setSilent(null);
}
}
}

View File

@ -0,0 +1,155 @@
package cn.iocoder.yudao.module.im.controller.admin.group;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjUtil;
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.collection.MapUtils;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.im.controller.admin.group.vo.request.ImGroupRequestApplyReqVO;
import cn.iocoder.yudao.module.im.controller.admin.group.vo.request.ImGroupRequestRespVO;
import cn.iocoder.yudao.module.im.dal.dataobject.group.ImGroupDO;
import cn.iocoder.yudao.module.im.dal.dataobject.group.ImGroupMemberDO;
import cn.iocoder.yudao.module.im.dal.dataobject.group.ImGroupRequestDO;
import cn.iocoder.yudao.module.im.enums.group.ImGroupMemberRoleEnum;
import cn.iocoder.yudao.module.im.service.group.ImGroupMemberService;
import cn.iocoder.yudao.module.im.service.group.ImGroupRequestService;
import cn.iocoder.yudao.module.im.service.group.ImGroupService;
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.*;
import java.util.stream.Stream;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.*;
import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.getLoginUserId;
/**
* IM 加群申请 Controller
*
* @author 芋道源码
*/
@Tag(name = "管理后台 - IM 加群申请")
@RestController
@RequestMapping("/im/group-request")
@Validated
public class ImGroupRequestController {
@Resource
private ImGroupRequestService groupRequestService;
@Resource
private ImGroupService groupService;
@Resource
private ImGroupMemberService groupMemberService;
@Resource
private AdminUserApi adminUserApi;
@PostMapping("/apply")
@Operation(summary = "申请加群")
public CommonResult<Long> applyJoinGroup(@Valid @RequestBody ImGroupRequestApplyReqVO reqVO) {
ImGroupRequestDO request = groupRequestService.applyJoinGroup(getLoginUserId(), reqVO);
return success(request != null ? request.getId() : null);
}
@PutMapping("/agree")
@Operation(summary = "同意加群申请(群主或管理员)")
@Parameter(name = "id", description = "申请编号", required = true, example = "1024")
public CommonResult<Boolean> agreeGroupRequest(
@RequestParam("id") @NotNull(message = "申请编号不能为空") Long id) {
groupRequestService.agreeGroupRequest(getLoginUserId(), id);
return success(true);
}
@PutMapping("/refuse")
@Operation(summary = "拒绝加群申请(群主或管理员)")
public CommonResult<Boolean> refuseGroupRequest(
@RequestParam("id") @NotNull(message = "申请编号不能为空") Long id,
@RequestParam(value = "handleContent", required = false)
@Size(max = 255, message = "处理理由最多 255 个字符") String handleContent) {
groupRequestService.refuseGroupRequest(getLoginUserId(), id, handleContent);
return success(true);
}
@GetMapping("/unhandled-list")
@Operation(summary = "查询「我管理的所有群」下的未处理加群申请列表(不分页);前端 store 据此派生横幅红点 + Drawer 列表")
public CommonResult<List<ImGroupRequestRespVO>> getUnhandledRequestList() {
List<ImGroupRequestDO> list = groupRequestService.getUnhandledRequestListByOwnerOrAdmin(getLoginUserId());
return success(buildVOList(list));
}
@GetMapping("/list-by-group")
@Operation(summary = "查询指定群下的全部加群申请(含已处理);仅群主 / 管理员可查")
@Parameter(name = "groupId", description = "群编号", required = true, example = "1024")
public CommonResult<List<ImGroupRequestRespVO>> getGroupRequestListByGroupId(
@RequestParam("groupId") @NotNull(message = "群编号不能为空") Long groupId) {
List<ImGroupRequestDO> list = groupRequestService.getGroupRequestListByGroupId(getLoginUserId(), groupId);
return success(buildVOList(list));
}
@GetMapping("/get")
@Operation(summary = "按 id 单查申请记录带越权过滤WebSocket 通知到达后用)")
@Parameter(name = "id", description = "申请记录编号", required = true)
public CommonResult<ImGroupRequestRespVO> getGroupRequest(@RequestParam("id") Long id) {
ImGroupRequestDO request = groupRequestService.getGroupRequest(id);
if (request == null) {
return success(null);
}
// 越权过滤:申请人 / 邀请人 / 群主 / 管理员之外,当不存在返回 null
Long currentUserId = getLoginUserId();
boolean canSee = ObjUtil.equal(request.getUserId(), currentUserId)
|| ObjUtil.equal(request.getInviterUserId(), currentUserId)
|| isGroupOwnerOrAdmin(request.getGroupId(), currentUserId);
if (!canSee) {
return success(null);
}
// 转换并返回
return success(CollUtil.getFirst(buildVOList(Collections.singletonList(request))));
}
/**
* 当前用户是否该群的有效群主 / 管理员
*/
private boolean isGroupOwnerOrAdmin(Long groupId, Long userId) {
ImGroupMemberDO member = groupMemberService.getGroupMember(groupId, userId);
return member != null
&& !CommonStatusEnum.DISABLE.getStatus().equals(member.getStatus())
&& ImGroupMemberRoleEnum.isOwnerOrAdmin(member.getRole());
}
/** 申请记录列表批量转 VO + 关联回填用户 / 群信息 */
private List<ImGroupRequestRespVO> buildVOList(List<ImGroupRequestDO> list) {
if (CollUtil.isEmpty(list)) {
return Collections.emptyList();
}
// 1. 聚合 user / inviter 用户信息convertSetByFlatMap 内部已过滤 null
Set<Long> userIds = convertSetByFlatMap(list,
request -> Stream.of(request.getUserId(), request.getInviterUserId()));
Map<Long, AdminUserRespDTO> userMap = adminUserApi.getUserMap(userIds);
// 2. 聚合群信息(封禁 / 解散群也要回填,便于前端展示历史)
Set<Long> groupIds = convertSet(list, ImGroupRequestDO::getGroupId);
Map<Long, ImGroupDO> groupMap = groupService.getGroupMap(groupIds);
return convertList(list, request -> {
ImGroupRequestRespVO vo = BeanUtils.toBean(request, ImGroupRequestRespVO.class);
MapUtils.findAndThen(userMap, request.getUserId(), user ->
vo.setUserNickname(user.getNickname()).setUserAvatar(user.getAvatar()));
MapUtils.findAndThen(userMap, request.getInviterUserId(), user ->
vo.setInviterNickname(user.getNickname()).setInviterAvatar(user.getAvatar()));
MapUtils.findAndThen(groupMap, request.getGroupId(), group ->
vo.setGroupName(group.getName()).setGroupAvatar(group.getAvatar()));
return vo;
});
}
}

View File

@ -0,0 +1,22 @@
package cn.iocoder.yudao.module.im.controller.admin.group.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import java.util.List;
@Schema(description = "管理后台 - 添加群管理员 Request VO")
@Data
public class ImGroupAdminAddReqVO {
@Schema(description = "群编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "13279")
@NotNull(message = "群编号不能为空")
private Long id;
@Schema(description = "目标用户编号列表", requiredMode = Schema.RequiredMode.REQUIRED, example = "[101, 102]")
@NotEmpty(message = "目标用户编号列表不能为空")
private List<Long> userIds;
}

View File

@ -0,0 +1,22 @@
package cn.iocoder.yudao.module.im.controller.admin.group.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import java.util.List;
@Schema(description = "管理后台 - 撤销群管理员 Request VO")
@Data
public class ImGroupAdminRemoveReqVO {
@Schema(description = "群编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "13279")
@NotNull(message = "群编号不能为空")
private Long id;
@Schema(description = "目标用户编号列表", requiredMode = Schema.RequiredMode.REQUIRED, example = "[101, 102]")
@NotEmpty(message = "目标用户编号列表不能为空")
private List<Long> userIds;
}

View File

@ -0,0 +1,19 @@
package cn.iocoder.yudao.module.im.controller.admin.group.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
@Schema(description = "管理后台 - 取消成员禁言 Request VO")
@Data
public class ImGroupCancelMuteMemberReqVO {
@Schema(description = "群编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
@NotNull(message = "群编号不能为空")
private Long id;
@Schema(description = "被取消禁言的用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2048")
@NotNull(message = "用户编号不能为空")
private Long userId;
}

View File

@ -0,0 +1,25 @@
package cn.iocoder.yudao.module.im.controller.admin.group.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import lombok.Data;
import java.util.List;
@Schema(description = "管理后台 - 群创建 Request VO")
@Data
public class ImGroupCreateReqVO {
@Schema(description = "群名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道技术交流群")
@NotBlank(message = "群名称不能为空")
@Size(max = 64, message = "群名称长度不能超过 64")
private String name;
@Schema(description = "初始成员用户编号列表(建群同时邀请的好友,不含创建者自己)", example = "[1024, 2048]")
private List<Long> memberUserIds;
@Schema(description = "进群是否需群主 / 管理员审批;不传默认 false 自由进群", example = "false")
private Boolean joinApproval;
}

View File

@ -0,0 +1,22 @@
package cn.iocoder.yudao.module.im.controller.admin.group.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
/**
* 管理后台 - 群消息置顶 / 取消置顶 Request VO
*/
@Schema(description = "管理后台 - 群消息置顶 / 取消置顶 Request VO")
@Data
public class ImGroupMessagePinReqVO {
@Schema(description = "群编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "13279")
@NotNull(message = "群编号不能为空")
private Long id;
@Schema(description = "消息编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "9527")
@NotNull(message = "消息编号不能为空")
private Long messageId;
}

View File

@ -0,0 +1,19 @@
package cn.iocoder.yudao.module.im.controller.admin.group.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
@Schema(description = "管理后台 - 全群禁言 / 取消 Request VO")
@Data
public class ImGroupMuteAllReqVO {
@Schema(description = "群编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
@NotNull(message = "群编号不能为空")
private Long id;
@Schema(description = "是否全群禁言", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
@NotNull(message = "是否全群禁言不能为空")
private Boolean mutedAll;
}

View File

@ -0,0 +1,25 @@
package cn.iocoder.yudao.module.im.controller.admin.group.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
@Schema(description = "管理后台 - 成员禁言 Request VO")
@Data
public class ImGroupMuteMemberReqVO {
@Schema(description = "群编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
@NotNull(message = "群编号不能为空")
private Long id;
@Schema(description = "被禁言的用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2048")
@NotNull(message = "用户编号不能为空")
private Long userId;
@Schema(description = "禁言时长0 表示永久禁言", requiredMode = Schema.RequiredMode.REQUIRED, example = "600")
@NotNull(message = "禁言时长不能为空")
@Min(value = 0, message = "禁言时长不能小于 0 秒")
private Integer mutedSeconds;
}

View File

@ -0,0 +1,30 @@
package cn.iocoder.yudao.module.im.controller.admin.group.vo;
import lombok.*;
import io.swagger.v3.oas.annotations.media.Schema;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 群分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ImGroupPageReqVO extends PageParam {
@Schema(description = "群名称", example = "芋艿")
private String name;
@Schema(description = "群主用户编号", example = "31460")
private Long ownerUserId;
@Schema(description = "群公告")
private String notice;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@ -0,0 +1,53 @@
package cn.iocoder.yudao.module.im.controller.admin.group.vo;
import cn.iocoder.yudao.module.im.controller.admin.message.vo.group.ImGroupMessageRespVO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.time.LocalDateTime;
import java.util.List;
@Schema(description = "管理后台 - 群 Response VO")
@Data
public class ImGroupRespVO {
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1003")
private Long id;
@Schema(description = "群名称", example = "芋艿")
private String name;
@Schema(description = "群主用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "31460")
private Long ownerUserId;
@Schema(description = "群头像")
private String avatar;
@Schema(description = "群公告")
private String notice;
@Schema(description = "是否封禁")
private Boolean banned;
@Schema(description = "是否全群禁言")
private Boolean mutedAll;
@Schema(description = "进群是否需群主 / 管理员审批", example = "false")
private Boolean joinApproval;
@Schema(description = "封禁时间")
private LocalDateTime bannedTime;
@Schema(description = "群状态", requiredMode = Schema.RequiredMode.REQUIRED)
private Integer status;
@Schema(description = "解散时间")
private LocalDateTime dissolvedTime;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime createTime;
@Schema(description = "群置顶消息列表,按 pin 顺序(最先置顶的在前);非该群有效成员时为空")
private List<ImGroupMessageRespVO> pinnedMessages;
}

View File

@ -0,0 +1,27 @@
package cn.iocoder.yudao.module.im.controller.admin.group.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import jakarta.validation.constraints.*;
@Schema(description = "管理后台 - 群新增/修改 Request VO")
@Data
public class ImGroupSaveReqVO {
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1003")
private Long id;
@Schema(description = "群名称", example = "芋艿")
private String name;
@Schema(description = "群主用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "31460")
@NotNull(message = "群主用户编号不能为空")
private Long ownerUserId;
@Schema(description = "群头像")
private String avatar;
@Schema(description = "群公告")
private String notice;
}

View File

@ -0,0 +1,19 @@
package cn.iocoder.yudao.module.im.controller.admin.group.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
@Schema(description = "管理后台 - 群主转让 Request VO")
@Data
public class ImGroupTransferOwnerReqVO {
@Schema(description = "群编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "13279")
@NotNull(message = "群编号不能为空")
private Long id;
@Schema(description = "新群主用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "202")
@NotNull(message = "新群主用户编号不能为空")
private Long newOwnerUserId;
}

View File

@ -0,0 +1,46 @@
package cn.iocoder.yudao.module.im.controller.admin.group.vo;
import cn.hutool.core.util.StrUtil;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.AssertTrue;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;
@Schema(description = "管理后台 - 群更新 Request VO")
@Data
public class ImGroupUpdateReqVO {
@Schema(description = "群编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1003")
@NotNull(message = "群编号不能为空")
private Long id;
@Schema(description = "群名称", example = "芋道技术交流群")
@Size(max = 64, message = "群名称长度不能超过 64")
private String name;
@Schema(description = "群头像")
@Size(max = 512, message = "群头像长度不能超过 512")
private String avatar;
@Schema(description = "群公告")
@Size(max = 2048, message = "群公告长度不能超过 2048")
private String notice;
@Schema(description = "进群是否需群主 / 管理员审批", example = "true")
private Boolean joinApproval;
@AssertTrue(message = "群名称不能为空")
@JsonIgnore
public boolean isNameValid() {
return name == null || StrUtil.isNotBlank(name);
}
@AssertTrue(message = "群头像不能为空")
@JsonIgnore
public boolean isAvatarValid() {
return avatar == null || StrUtil.isNotBlank(avatar);
}
}

View File

@ -0,0 +1,19 @@
package cn.iocoder.yudao.module.im.controller.admin.group.vo.member;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
@Schema(description = "管理后台 - 群成员邀请 Request VO")
@Data
public class ImGroupMemberCreateReqVO {
@Schema(description = "群编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "13279")
@NotNull(message = "群编号不能为空")
private Long groupId;
@Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "21730")
@NotNull(message = "用户编号不能为空")
private Long userId;
}

View File

@ -0,0 +1,22 @@
package cn.iocoder.yudao.module.im.controller.admin.group.vo.member;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import java.util.List;
@Schema(description = "管理后台 - 群成员邀请 Request VO")
@Data
public class ImGroupMemberInviteReqVO {
@Schema(description = "群编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "13279")
@NotNull(message = "群编号不能为空")
private Long groupId;
@Schema(description = "被邀请的用户编号列表", requiredMode = Schema.RequiredMode.REQUIRED, example = "[1, 2, 3]")
@NotEmpty(message = "被邀请的用户编号列表不能为空")
private List<Long> memberUserIds;
}

View File

@ -0,0 +1,22 @@
package cn.iocoder.yudao.module.im.controller.admin.group.vo.member;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import java.util.List;
@Schema(description = "管理后台 - 群成员移除 Request VO")
@Data
public class ImGroupMemberRemoveReqVO {
@Schema(description = "群编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
@NotNull(message = "群编号不能为空")
private Long groupId;
@Schema(description = "被移除的用户编号列表", requiredMode = Schema.RequiredMode.REQUIRED, example = "[1, 2, 3]")
@NotEmpty(message = "被移除的用户编号列表不能为空")
private List<Long> memberUserIds;
}

View File

@ -0,0 +1,56 @@
package cn.iocoder.yudao.module.im.controller.admin.group.vo.member;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 群成员 Response VO")
@Data
public class ImGroupMemberRespVO {
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "17071")
private Long id;
@Schema(description = "群编号", example = "13279")
private Long groupId;
@Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "21730")
private Long userId;
@Schema(description = "组内显示名", example = "芋艿")
private String displayUserName;
@Schema(description = "群备注", example = "核心群")
private String groupRemark;
@Schema(description = "是否免打扰")
private Boolean silent;
@Schema(description = "成员状态", example = "0")
private Integer status;
@Schema(description = "成员角色", example = "3")
private Integer role; // 参见 ImGroupMemberRoleEnum 枚举类
@Schema(description = "入群时间")
private LocalDateTime joinTime;
@Schema(description = "退群时间")
private LocalDateTime quitTime;
@Schema(description = "禁言到期时间")
private LocalDateTime muteEndTime;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime createTime;
// ========== 关联 AdminUser 的字段 ==========
@Schema(description = "用户昵称", example = "芋道")
private String nickname;
@Schema(description = "用户头像")
private String avatar;
}

View File

@ -0,0 +1,26 @@
package cn.iocoder.yudao.module.im.controller.admin.group.vo.member;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.experimental.Accessors;
@Schema(description = "管理后台 - 群成员更新 Request VO")
@Data
@Accessors(chain = true)
public class ImGroupMemberUpdateReqVO {
@Schema(description = "群编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
@NotNull(message = "群编号不能为空")
private Long groupId;
@Schema(description = "群内昵称", example = "芋头")
private String displayUserName;
@Schema(description = "群备注", example = "公司群")
private String groupRemark;
@Schema(description = "是否免打扰")
private Boolean silent;
}

View File

@ -0,0 +1,26 @@
package cn.iocoder.yudao.module.im.controller.admin.group.vo.request;
import cn.iocoder.yudao.framework.common.validation.InEnum;
import cn.iocoder.yudao.module.im.enums.group.ImGroupAddSourceEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;
@Schema(description = "管理后台 - IM 加群申请发起 Request VO")
@Data
public class ImGroupRequestApplyReqVO {
@Schema(description = "群编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
@NotNull(message = "群编号不能为空")
private Long groupId;
@Schema(description = "申请理由", example = "我是芋艿(一种食材)")
@Size(max = 255, message = "申请理由最多 255 个字符")
private String applyContent;
@Schema(description = "加入来源", example = "1")
@InEnum(ImGroupAddSourceEnum.class)
private Integer addSource;
}

View File

@ -0,0 +1,65 @@
package cn.iocoder.yudao.module.im.controller.admin.group.vo.request;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - IM 加群申请 Response VO")
@Data
public class ImGroupRequestRespVO {
@Schema(description = "申请编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long id;
@Schema(description = "群编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long groupId;
@Schema(description = "申请人 / 被邀请人用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
private Long userId;
@Schema(description = "邀请人用户编号NULL 表示用户主动申请", example = "200")
private Long inviterUserId;
@Schema(description = "处理结果", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
private Integer handleResult; // 参见 ImGroupRequestHandleResultEnum 枚举
@Schema(description = "申请理由", example = "我想加入这个群")
private String applyContent;
@Schema(description = "处理理由(拒绝时可选填)", example = "暂不通过")
private String handleContent;
@Schema(description = "处理人用户编号", example = "31460")
private Long handleUserId;
@Schema(description = "加入来源", example = "1")
private Integer addSource; // 参见 ImGroupAddSourceEnum 枚举
@Schema(description = "处理时间")
private LocalDateTime handleTime;
@Schema(description = "申请创建时间")
private LocalDateTime createTime;
// ========== 下面是聚合字段,方便前端显示 ==========
@Schema(description = "申请人 / 被邀请人昵称(实时聚合自 AdminUser", example = "芋道")
private String userNickname;
@Schema(description = "申请人 / 被邀请人头像(实时聚合自 AdminUser")
private String userAvatar;
@Schema(description = "邀请人昵称(实时聚合自 AdminUser", example = "老张")
private String inviterNickname;
@Schema(description = "邀请人头像(实时聚合自 AdminUser")
private String inviterAvatar;
@Schema(description = "群名称(实时聚合自 ImGroup", example = "芋道技术交流群")
private String groupName;
@Schema(description = "群头像(实时聚合自 ImGroup")
private String groupAvatar;
}

View File

@ -0,0 +1,83 @@
package cn.iocoder.yudao.module.im.controller.admin.manager.channel;
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.im.controller.admin.manager.channel.vo.channel.ImChannelPageReqVO;
import cn.iocoder.yudao.module.im.controller.admin.manager.channel.vo.channel.ImChannelRespVO;
import cn.iocoder.yudao.module.im.controller.admin.manager.channel.vo.channel.ImChannelSaveReqVO;
import cn.iocoder.yudao.module.im.dal.dataobject.channel.ImChannelDO;
import cn.iocoder.yudao.module.im.service.channel.ImChannelService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - IM 频道")
@RestController
@RequestMapping("/im/manager/channel")
@Validated
public class ImChannelManagerController {
@Resource
private ImChannelService channelService;
@PostMapping("/create")
@Operation(summary = "新增频道")
@PreAuthorize("@ss.hasPermission('im:manager:channel:create')")
public CommonResult<Long> createChannel(@Valid @RequestBody ImChannelSaveReqVO reqVO) {
return success(channelService.createChannel(reqVO));
}
@PutMapping("/update")
@Operation(summary = "修改频道")
@PreAuthorize("@ss.hasPermission('im:manager:channel:update')")
public CommonResult<Boolean> updateChannel(@Valid @RequestBody ImChannelSaveReqVO reqVO) {
channelService.updateChannel(reqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除频道")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('im:manager:channel:delete')")
public CommonResult<Boolean> deleteChannel(@RequestParam("id") Long id) {
channelService.deleteChannel(id);
return success(true);
}
@GetMapping("/page")
@Operation(summary = "获得频道分页")
@PreAuthorize("@ss.hasPermission('im:manager:channel:query')")
public CommonResult<PageResult<ImChannelRespVO>> getChannelPage(@Valid ImChannelPageReqVO pageReqVO) {
PageResult<ImChannelDO> pageResult = channelService.getChannelPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, ImChannelRespVO.class));
}
@GetMapping("/get")
@Operation(summary = "获得频道详情")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('im:manager:channel:query')")
public CommonResult<ImChannelRespVO> getChannel(@RequestParam("id") Long id) {
ImChannelDO channel = channelService.getChannel(id);
return success(BeanUtils.toBean(channel, ImChannelRespVO.class));
}
@GetMapping("/simple-list")
@Operation(summary = "获得启用的频道精简列表;前端表单选择频道时调用")
public CommonResult<List<ImChannelRespVO>> getSimpleChannelList() {
// TODO DONE @AIgetChannelListByStatus 统一命名
List<ImChannelDO> list = channelService.getChannelListByStatus(CommonStatusEnum.ENABLE.getStatus());
return success(BeanUtils.toBean(list, ImChannelRespVO.class));
}
}

View File

@ -0,0 +1,99 @@
package cn.iocoder.yudao.module.im.controller.admin.manager.channel;
import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.collection.MapUtils;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.im.controller.admin.manager.channel.vo.material.ImChannelMaterialPageReqVO;
import cn.iocoder.yudao.module.im.controller.admin.manager.channel.vo.material.ImChannelMaterialRespVO;
import cn.iocoder.yudao.module.im.controller.admin.manager.channel.vo.material.ImChannelMaterialSaveReqVO;
import cn.iocoder.yudao.module.im.dal.dataobject.channel.ImChannelDO;
import cn.iocoder.yudao.module.im.dal.dataobject.channel.ImChannelMaterialDO;
import cn.iocoder.yudao.module.im.service.channel.ImChannelMaterialService;
import cn.iocoder.yudao.module.im.service.channel.ImChannelService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap;
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
@Tag(name = "管理后台 - IM 频道素材")
@RestController
@RequestMapping("/im/manager/channel-material")
@Validated
public class ImChannelMaterialManagerController {
@Resource
private ImChannelMaterialService channelMaterialService;
@Resource
private ImChannelService channelService;
@PostMapping("/create")
@Operation(summary = "新增素材")
@PreAuthorize("@ss.hasPermission('im:manager:channel-material:create')")
public CommonResult<Long> createMaterial(@Valid @RequestBody ImChannelMaterialSaveReqVO reqVO) {
return success(channelMaterialService.createMaterial(reqVO));
}
@PutMapping("/update")
@Operation(summary = "修改素材")
@PreAuthorize("@ss.hasPermission('im:manager:channel-material:update')")
public CommonResult<Boolean> updateMaterial(@Valid @RequestBody ImChannelMaterialSaveReqVO reqVO) {
channelMaterialService.updateMaterial(reqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除素材")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('im:manager:channel-material:delete')")
public CommonResult<Boolean> deleteMaterial(@RequestParam("id") Long id) {
channelMaterialService.deleteMaterial(id);
return success(true);
}
@GetMapping("/page")
@Operation(summary = "获得素材分页;含频道名回填")
@PreAuthorize("@ss.hasPermission('im:manager:channel-material:query')")
public CommonResult<PageResult<ImChannelMaterialRespVO>> getMaterialPage(@Valid ImChannelMaterialPageReqVO pageReqVO) {
PageResult<ImChannelMaterialDO> pageResult = channelMaterialService.getMaterialPage(pageReqVO);
if (CollUtil.isEmpty(pageResult.getList())) {
return success(PageResult.empty(pageResult.getTotal()));
}
// 回填频道名
List<ImChannelDO> channels = channelService.getChannelList(
convertSet(pageResult.getList(), ImChannelMaterialDO::getChannelId));
Map<Long, ImChannelDO> channelMap = convertMap(channels, ImChannelDO::getId);
return success(BeanUtils.toBean(pageResult, ImChannelMaterialRespVO.class, vo ->
MapUtils.findAndThen(channelMap, vo.getChannelId(), c -> vo.setChannelName(c.getName()))));
}
@GetMapping("/get")
@Operation(summary = "获得素材详情(含富文本正文)")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('im:manager:channel-material:query')")
public CommonResult<ImChannelMaterialRespVO> getMaterial(@RequestParam("id") Long id) {
ImChannelMaterialDO material = channelMaterialService.getMaterial(id);
return success(BeanUtils.toBean(material, ImChannelMaterialRespVO.class));
}
@GetMapping("/simple-list")
@Operation(summary = "获得指定频道下的素材精简列表;用于推送弹窗的素材下拉")
@Parameter(name = "channelId", description = "频道编号", required = true, example = "1")
public CommonResult<List<ImChannelMaterialRespVO>> getSimpleMaterialList(@RequestParam("channelId") Long channelId) {
List<ImChannelMaterialDO> list = channelMaterialService.getMaterialListByChannelId(channelId);
return success(BeanUtils.toBean(list, ImChannelMaterialRespVO.class));
}
}

View File

@ -0,0 +1,22 @@
package cn.iocoder.yudao.module.im.controller.admin.manager.channel.vo.channel;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Schema(description = "管理后台 - IM 频道分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
public class ImChannelPageReqVO extends PageParam {
@Schema(description = "频道业务码", example = "system_notice")
private String code;
@Schema(description = "频道名称", example = "系统")
private String name;
@Schema(description = "状态", example = "0")
private Integer status; // 参见 CommonStatusEnum 枚举类
}

View File

@ -0,0 +1,33 @@
package cn.iocoder.yudao.module.im.controller.admin.manager.channel.vo.channel;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - IM 频道 Response VO")
@Data
public class ImChannelRespVO {
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long id;
@Schema(description = "频道业务码", requiredMode = Schema.RequiredMode.REQUIRED, example = "system_notice")
private String code;
@Schema(description = "频道名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "系统公告")
private String name;
@Schema(description = "频道头像")
private String avatar;
@Schema(description = "排序", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
private Integer sort;
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
private Integer status; // 参见 CommonStatusEnum 枚举类
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime createTime;
}

View File

@ -0,0 +1,40 @@
package cn.iocoder.yudao.module.im.controller.admin.manager.channel.vo.channel;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Data;
@Schema(description = "管理后台 - IM 频道新增 / 修改 Request VO")
@Data
public class ImChannelSaveReqVO {
@Schema(description = "编号(修改时必填)", example = "1024")
private Long id;
@Schema(description = "频道业务码;唯一", requiredMode = Schema.RequiredMode.REQUIRED, example = "system_notice")
@NotBlank(message = "频道编码不能为空")
@Size(max = 64, message = "频道编码长度不能超过 64")
@Pattern(regexp = "^[a-z][a-z0-9_]*$", message = "频道编码只能由小写字母 / 数字 / 下划线组成,且必须以字母开头")
private String code;
@Schema(description = "频道名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "系统公告")
@NotBlank(message = "频道名称不能为空")
@Size(max = 64, message = "频道名称长度不能超过 64")
private String name;
@Schema(description = "频道头像", example = "https://cdn.example.com/channel/system_notice.png")
@Size(max = 512, message = "头像长度不能超过 512")
private String avatar;
@Schema(description = "排序", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
@NotNull(message = "排序不能为空")
private Integer sort;
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
@NotNull(message = "状态不能为空")
private Integer status; // 参见 CommonStatusEnum 枚举类0 启用 / 1 禁用)
}

View File

@ -0,0 +1,31 @@
package cn.iocoder.yudao.module.im.controller.admin.manager.channel.vo.material;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - IM 频道素材分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
public class ImChannelMaterialPageReqVO extends PageParam {
@Schema(description = "频道编号", example = "1")
private Long channelId;
@Schema(description = "内容类型", example = "1")
private Integer type; // 参见 ImChannelMaterialTypeEnum 枚举类
@Schema(description = "标题", example = "活动")
private String title;
@Schema(description = "创建时间", example = "[2026-04-01 00:00:00, 2026-04-30 23:59:59]")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@ -0,0 +1,42 @@
package cn.iocoder.yudao.module.im.controller.admin.manager.channel.vo.material;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - IM 频道素材 Response VO")
@Data
public class ImChannelMaterialRespVO {
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long id;
@Schema(description = "频道编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Long channelId;
@Schema(description = "频道名称(关联查询填充)")
private String channelName;
@Schema(description = "内容类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Integer type; // 参见 ImChannelMaterialTypeEnum 枚举类
@Schema(description = "标题", requiredMode = Schema.RequiredMode.REQUIRED)
private String title;
@Schema(description = "封面图")
private String coverUrl;
@Schema(description = "摘要")
private String summary;
@Schema(description = "正文;富文本 HTML")
private String content;
@Schema(description = "跳转链接")
private String url;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime createTime;
}

View File

@ -0,0 +1,44 @@
package cn.iocoder.yudao.module.im.controller.admin.manager.channel.vo.material;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;
@Schema(description = "管理后台 - IM 频道素材新增 / 修改 Request VO")
@Data
public class ImChannelMaterialSaveReqVO {
@Schema(description = "编号(修改时必填)", example = "1024")
private Long id;
@Schema(description = "频道编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "频道编号不能为空")
private Long channelId;
@Schema(description = "内容类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "内容类型不能为空")
private Integer type; // 参见 ImChannelMaterialTypeEnum 枚举类
@Schema(description = "标题", requiredMode = Schema.RequiredMode.REQUIRED, example = "双十一活动来啦")
@NotBlank(message = "标题不能为空")
@Size(max = 128, message = "标题长度不能超过 128")
private String title;
@Schema(description = "封面图", example = "https://cdn.example.com/cover.png")
@Size(max = 512, message = "封面图长度不能超过 512")
private String coverUrl;
@Schema(description = "摘要", example = "全场五折,戳详情看玩法")
@Size(max = 255, message = "摘要长度不能超过 255")
private String summary;
@Schema(description = "正文;富文本 HTML")
private String content;
@Schema(description = "跳转链接;为空表示走客户端内置详情页", example = "https://example.com/activity/123")
@Size(max = 512, message = "跳转链接长度不能超过 512")
private String url;
}

View File

@ -0,0 +1,85 @@
package cn.iocoder.yudao.module.im.controller.admin.manager.face;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.im.controller.admin.manager.face.vo.item.ImFacePackItemPageReqVO;
import cn.iocoder.yudao.module.im.controller.admin.manager.face.vo.item.ImFacePackItemRespVO;
import cn.iocoder.yudao.module.im.controller.admin.manager.face.vo.item.ImFacePackItemSaveReqVO;
import cn.iocoder.yudao.module.im.dal.dataobject.face.ImFacePackItemDO;
import cn.iocoder.yudao.module.im.service.face.ImFacePackItemService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import jakarta.validation.constraints.Size;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - IM 表情包项")
@RestController
@RequestMapping("/im/manager/face-pack-item")
@Validated
public class ImFacePackItemManagerController {
@Resource
private ImFacePackItemService facePackItemService;
@PostMapping("/create")
@Operation(summary = "新增表情")
@PreAuthorize("@ss.hasPermission('im:manager:face-pack-item:create')")
public CommonResult<Long> createFacePackItem(@Valid @RequestBody ImFacePackItemSaveReqVO reqVO) {
return success(facePackItemService.createFacePackItem(reqVO));
}
@PutMapping("/update")
@Operation(summary = "修改表情")
@PreAuthorize("@ss.hasPermission('im:manager:face-pack-item:update')")
public CommonResult<Boolean> updateFacePackItem(@Valid @RequestBody ImFacePackItemSaveReqVO reqVO) {
facePackItemService.updateFacePackItem(reqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除表情")
@Parameter(name = "id", description = "编号", required = true, example = "2048")
@PreAuthorize("@ss.hasPermission('im:manager:face-pack-item:delete')")
public CommonResult<Boolean> deleteFacePackItem(@RequestParam("id") Long id) {
facePackItemService.deleteFacePackItem(id);
return success(true);
}
@DeleteMapping("/delete-list")
@Operation(summary = "批量删除表情")
@Parameter(name = "ids", description = "编号列表", required = true)
@PreAuthorize("@ss.hasPermission('im:manager:face-pack-item:delete')")
public CommonResult<Boolean> deleteFacePackItemList(
@RequestParam("ids") @Size(max = 100, message = "批量删除最多 100 条") List<Long> ids) {
facePackItemService.deleteFacePackItemList(ids);
return success(true);
}
@GetMapping("/page")
@Operation(summary = "获得表情分页")
@PreAuthorize("@ss.hasPermission('im:manager:face-pack-item:query')")
public CommonResult<PageResult<ImFacePackItemRespVO>> getFacePackItemPage(@Valid ImFacePackItemPageReqVO pageReqVO) {
PageResult<ImFacePackItemDO> pageResult = facePackItemService.getFacePackItemPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, ImFacePackItemRespVO.class));
}
@GetMapping("/get")
@Operation(summary = "获得表情详情")
@Parameter(name = "id", description = "编号", required = true, example = "2048")
@PreAuthorize("@ss.hasPermission('im:manager:face-pack-item:query')")
public CommonResult<ImFacePackItemRespVO> getFacePackItem(@RequestParam("id") Long id) {
ImFacePackItemDO item = facePackItemService.getFacePackItem(id);
return success(BeanUtils.toBean(item, ImFacePackItemRespVO.class));
}
}

View File

@ -0,0 +1,85 @@
package cn.iocoder.yudao.module.im.controller.admin.manager.face;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.im.controller.admin.manager.face.vo.pack.ImFacePackPageReqVO;
import cn.iocoder.yudao.module.im.controller.admin.manager.face.vo.pack.ImFacePackRespVO;
import cn.iocoder.yudao.module.im.controller.admin.manager.face.vo.pack.ImFacePackSaveReqVO;
import cn.iocoder.yudao.module.im.dal.dataobject.face.ImFacePackDO;
import cn.iocoder.yudao.module.im.service.face.ImFacePackService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import jakarta.validation.constraints.Size;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - IM 表情包")
@RestController
@RequestMapping("/im/manager/face-pack")
@Validated
public class ImFacePackManagerController {
@Resource
private ImFacePackService facePackService;
@PostMapping("/create")
@Operation(summary = "新增表情包")
@PreAuthorize("@ss.hasPermission('im:manager:face-pack:create')")
public CommonResult<Long> createFacePack(@Valid @RequestBody ImFacePackSaveReqVO reqVO) {
return success(facePackService.createFacePack(reqVO));
}
@PutMapping("/update")
@Operation(summary = "修改表情包")
@PreAuthorize("@ss.hasPermission('im:manager:face-pack:update')")
public CommonResult<Boolean> updateFacePack(@Valid @RequestBody ImFacePackSaveReqVO reqVO) {
facePackService.updateFacePack(reqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除表情包")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('im:manager:face-pack:delete')")
public CommonResult<Boolean> deleteFacePack(@RequestParam("id") Long id) {
facePackService.deleteFacePack(id);
return success(true);
}
@DeleteMapping("/delete-list")
@Operation(summary = "批量删除表情包")
@Parameter(name = "ids", description = "编号列表", required = true)
@PreAuthorize("@ss.hasPermission('im:manager:face-pack:delete')")
public CommonResult<Boolean> deleteFacePackList(@RequestParam("ids")
@Size(max = 100, message = "批量删除最多 100 条") List<Long> ids) {
facePackService.deleteFacePackList(ids);
return success(true);
}
@GetMapping("/page")
@Operation(summary = "获得表情包分页")
@PreAuthorize("@ss.hasPermission('im:manager:face-pack:query')")
public CommonResult<PageResult<ImFacePackRespVO>> getFacePackPage(@Valid ImFacePackPageReqVO pageReqVO) {
PageResult<ImFacePackDO> pageResult = facePackService.getFacePackPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, ImFacePackRespVO.class));
}
@GetMapping("/get")
@Operation(summary = "获得表情包详情")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('im:manager:face-pack:query')")
public CommonResult<ImFacePackRespVO> getFacePack(@RequestParam("id") Long id) {
ImFacePackDO pack = facePackService.getFacePack(id);
return success(BeanUtils.toBean(pack, ImFacePackRespVO.class));
}
}

View File

@ -0,0 +1,67 @@
package cn.iocoder.yudao.module.im.controller.admin.manager.face;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.im.controller.admin.manager.face.vo.useritem.ImFaceUserItemManagerPageReqVO;
import cn.iocoder.yudao.module.im.controller.admin.manager.face.vo.useritem.ImFaceUserItemManagerRespVO;
import cn.iocoder.yudao.module.im.dal.dataobject.face.ImFaceUserItemDO;
import cn.iocoder.yudao.module.im.service.face.ImFaceUserItemService;
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - IM 用户表情")
@RestController
@RequestMapping("/im/manager/face-user-item")
@Validated
public class ImFaceUserItemManagerController {
@Resource
private ImFaceUserItemService faceUserItemService;
@Resource
private AdminUserApi adminUserApi;
@GetMapping("/page")
@Operation(summary = "获得用户表情分页")
@PreAuthorize("@ss.hasPermission('im:manager:face-user-item:query')")
public CommonResult<PageResult<ImFaceUserItemManagerRespVO>> getFaceUserItemPage(
@Valid ImFaceUserItemManagerPageReqVO pageReqVO) {
PageResult<ImFaceUserItemDO> pageResult = faceUserItemService.getFaceUserItemPage(pageReqVO);
// 关联回填用户昵称
Map<Long, AdminUserRespDTO> userMap = adminUserApi.getUserMap(
CollectionUtils.convertSet(pageResult.getList(), ImFaceUserItemDO::getUserId));
List<ImFaceUserItemManagerRespVO> voList = CollectionUtils.convertList(pageResult.getList(), item -> {
ImFaceUserItemManagerRespVO vo = BeanUtils.toBean(item, ImFaceUserItemManagerRespVO.class);
AdminUserRespDTO user = userMap.get(item.getUserId());
if (user != null) {
vo.setUserNickname(user.getNickname());
}
return vo;
});
return success(new PageResult<>(voList, pageResult.getTotal()));
}
@DeleteMapping("/delete")
@Operation(summary = "删除用户表情")
@Parameter(name = "id", description = "编号", required = true, example = "4096")
@PreAuthorize("@ss.hasPermission('im:manager:face-user-item:delete')")
public CommonResult<Boolean> deleteFaceUserItem(@RequestParam("id") Long id) {
faceUserItemService.deleteFaceUserItem(id);
return success(true);
}
}

View File

@ -0,0 +1,25 @@
package cn.iocoder.yudao.module.im.controller.admin.manager.face.vo.item;
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.validation.InEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Schema(description = "管理后台 - IM 表情包项分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
public class ImFacePackItemPageReqVO extends PageParam {
@Schema(description = "所属表情包编号", example = "1024")
private Long packId;
@Schema(description = "表情名,模糊匹配", example = "")
private String name;
@Schema(description = "状态", example = "0")
@InEnum(value = CommonStatusEnum.class, message = "状态必须是 {value}")
private Integer status; // 参见 CommonStatusEnum 枚举类
}

View File

@ -0,0 +1,40 @@
package cn.iocoder.yudao.module.im.controller.admin.manager.face.vo.item;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - IM 表情包项 Response VO")
@Data
public class ImFacePackItemRespVO {
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2048")
private Long id;
@Schema(description = "所属表情包编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long packId;
@Schema(description = "表情图 URL", requiredMode = Schema.RequiredMode.REQUIRED,
example = "https://cdn.example.com/face/pack/cat-001.png")
private String url;
@Schema(description = "表情名", example = "狗头")
private String name;
@Schema(description = "渲染宽度(像素)", requiredMode = Schema.RequiredMode.REQUIRED, example = "200")
private Integer width;
@Schema(description = "渲染高度(像素)", requiredMode = Schema.RequiredMode.REQUIRED, example = "200")
private Integer height;
@Schema(description = "排序", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
private Integer sort;
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
private Integer status; // 参见 CommonStatusEnum 枚举类
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime createTime;
}

View File

@ -0,0 +1,55 @@
package cn.iocoder.yudao.module.im.controller.admin.manager.face.vo.item;
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.common.validation.InEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;
@Schema(description = "管理后台 - IM 表情包项新增 / 修改 Request VO")
@Data
public class ImFacePackItemSaveReqVO {
@Schema(description = "编号(修改时必填)", example = "2048")
private Long id;
@Schema(description = "所属表情包编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
@NotNull(message = "表情包编号不能为空")
private Long packId;
@Schema(description = "表情图 URL", requiredMode = Schema.RequiredMode.REQUIRED,
example = "https://cdn.example.com/face/pack/cat-001.png")
@NotBlank(message = "表情图 URL 不能为空")
@Size(max = 512, message = "表情图 URL 长度不能超过 512")
private String url;
@Schema(description = "表情名", example = "狗头")
@Size(max = 64, message = "表情名长度不能超过 64")
private String name;
@Schema(description = "渲染宽度(像素)", requiredMode = Schema.RequiredMode.REQUIRED, example = "200")
@NotNull(message = "渲染宽度不能为空")
@Min(value = 1, message = "渲染宽度不能小于 1 像素")
@Max(value = 2048, message = "渲染宽度不能大于 2048 像素")
private Integer width;
@Schema(description = "渲染高度(像素)", requiredMode = Schema.RequiredMode.REQUIRED, example = "200")
@NotNull(message = "渲染高度不能为空")
@Min(value = 1, message = "渲染高度不能小于 1 像素")
@Max(value = 2048, message = "渲染高度不能大于 2048 像素")
private Integer height;
@Schema(description = "排序", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
@NotNull(message = "排序不能为空")
private Integer sort;
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
@NotNull(message = "状态不能为空")
@InEnum(value = CommonStatusEnum.class, message = "状态必须是 {value}")
private Integer status; // 参见 CommonStatusEnum 枚举类0 启用 / 1 禁用)
}

View File

@ -0,0 +1,31 @@
package cn.iocoder.yudao.module.im.controller.admin.manager.face.vo.pack;
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.validation.InEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - IM 表情包分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
public class ImFacePackPageReqVO extends PageParam {
@Schema(description = "表情包名称,模糊匹配", example = "")
private String name;
@Schema(description = "状态", example = "0")
@InEnum(value = CommonStatusEnum.class, message = "状态必须是 {value}")
private Integer status; // 参见 CommonStatusEnum 枚举类
@Schema(description = "创建时间", example = "[2026-04-01 00:00:00, 2026-04-30 23:59:59]")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@ -0,0 +1,30 @@
package cn.iocoder.yudao.module.im.controller.admin.manager.face.vo.pack;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - IM 表情包 Response VO")
@Data
public class ImFacePackRespVO {
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long id;
@Schema(description = "表情包名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "猫主子")
private String name;
@Schema(description = "表情包图标", example = "https://cdn.example.com/face/pack/cat.png")
private String icon;
@Schema(description = "排序", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
private Integer sort;
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
private Integer status; // 参见 CommonStatusEnum 枚举类
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime createTime;
}

View File

@ -0,0 +1,36 @@
package cn.iocoder.yudao.module.im.controller.admin.manager.face.vo.pack;
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.common.validation.InEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;
@Schema(description = "管理后台 - IM 表情包新增 / 修改 Request VO")
@Data
public class ImFacePackSaveReqVO {
@Schema(description = "编号(修改时必填)", example = "1024")
private Long id;
@Schema(description = "表情包名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "猫主子")
@NotBlank(message = "表情包名称不能为空")
@Size(max = 64, message = "表情包名称长度不能超过 64")
private String name;
@Schema(description = "表情包图标", example = "https://cdn.example.com/face/pack/cat.png")
@Size(max = 512, message = "图标长度不能超过 512")
private String icon;
@Schema(description = "排序", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
@NotNull(message = "排序不能为空")
private Integer sort;
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
@NotNull(message = "状态不能为空")
@InEnum(value = CommonStatusEnum.class, message = "状态必须是 {value}")
private Integer status; // 参见 CommonStatusEnum 枚举类0 启用 / 1 禁用)
}

View File

@ -0,0 +1,28 @@
package cn.iocoder.yudao.module.im.controller.admin.manager.face.vo.useritem;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - IM 用户表情分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
public class ImFaceUserItemManagerPageReqVO extends PageParam {
@Schema(description = "所属用户编号", example = "1024")
private Long userId;
@Schema(description = "表情名,模糊匹配", example = "")
private String name;
@Schema(description = "添加时间", example = "[2026-04-01 00:00:00, 2026-04-30 23:59:59]")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@ -0,0 +1,37 @@
package cn.iocoder.yudao.module.im.controller.admin.manager.face.vo.useritem;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - IM 用户表情 Response VO")
@Data
public class ImFaceUserItemManagerRespVO {
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "4096")
private Long id;
@Schema(description = "所属用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long userId;
@Schema(description = "所属用户昵称", example = "张三")
private String userNickname;
@Schema(description = "表情图 URL", requiredMode = Schema.RequiredMode.REQUIRED,
example = "https://cdn.example.com/face/user/abc.gif")
private String url;
@Schema(description = "表情名", example = "狗头")
private String name;
@Schema(description = "渲染宽度(像素)", example = "200")
private Integer width;
@Schema(description = "渲染高度(像素)", example = "200")
private Integer height;
@Schema(description = "添加时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime createTime;
}

View File

@ -0,0 +1,65 @@
package cn.iocoder.yudao.module.im.controller.admin.manager.friend;
import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.collection.MapUtils;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.im.controller.admin.manager.friend.vo.ImFriendManagerPageReqVO;
import cn.iocoder.yudao.module.im.controller.admin.manager.friend.vo.ImFriendManagerRespVO;
import cn.iocoder.yudao.module.im.dal.dataobject.friend.ImFriendDO;
import cn.iocoder.yudao.module.im.service.friend.ImFriendService;
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
import java.util.Set;
import java.util.stream.Stream;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSetByFlatMap;
@Tag(name = "管理后台 - IM 好友管理")
@RestController
@RequestMapping("/im/manager/friend")
@Validated
public class ImFriendManagerController {
@Resource
private ImFriendService friendService;
@Resource
private AdminUserApi adminUserApi;
@GetMapping("/page")
@Operation(summary = "获得好友关系分页")
@PreAuthorize("@ss.hasPermission('im:manager:friend:query')")
public CommonResult<PageResult<ImFriendManagerRespVO>> getFriendPage(
@Valid ImFriendManagerPageReqVO pageReqVO) {
// 1. 分页查询
PageResult<ImFriendDO> pageResult = friendService.getFriendPage(pageReqVO);
if (CollUtil.isEmpty(pageResult.getList())) {
return success(PageResult.empty(pageResult.getTotal()));
}
// 2.1 一次性批量查询用户 + 好友的昵称
Set<Long> userIds = convertSetByFlatMap(pageResult.getList(),
f -> Stream.of(f.getUserId(), f.getFriendUserId()));
Map<Long, AdminUserRespDTO> userMap = adminUserApi.getUserMap(userIds);
// 2.2 转换为 VO填充昵称
return success(BeanUtils.toBean(pageResult, ImFriendManagerRespVO.class, vo -> {
MapUtils.findAndThen(userMap, vo.getUserId(),
user -> vo.setUserNickname(user.getNickname()));
MapUtils.findAndThen(userMap, vo.getFriendUserId(),
user -> vo.setFriendNickname(user.getNickname()));
}));
}
}

View File

@ -0,0 +1,66 @@
package cn.iocoder.yudao.module.im.controller.admin.manager.friend;
import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.collection.MapUtils;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.im.controller.admin.manager.friend.vo.ImFriendRequestManagerPageReqVO;
import cn.iocoder.yudao.module.im.controller.admin.manager.friend.vo.ImFriendRequestManagerRespVO;
import cn.iocoder.yudao.module.im.dal.dataobject.friend.ImFriendRequestDO;
import cn.iocoder.yudao.module.im.service.friend.ImFriendRequestService;
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
import java.util.Set;
import java.util.stream.Stream;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSetByFlatMap;
@Tag(name = "管理后台 - IM 好友申请管理")
@RestController
@RequestMapping("/im/manager/friend-request")
@Validated
public class ImFriendRequestManagerController {
@Resource
private ImFriendRequestService friendRequestService;
@Resource
private AdminUserApi adminUserApi;
@GetMapping("/page")
@Operation(summary = "获得好友申请分页")
@PreAuthorize("@ss.hasPermission('im:manager:friend-request:query')")
public CommonResult<PageResult<ImFriendRequestManagerRespVO>> getFriendRequestPage(
@Valid ImFriendRequestManagerPageReqVO pageReqVO) {
// 1. 分页查询
PageResult<ImFriendRequestDO> pageResult = friendRequestService.getFriendRequestPage(pageReqVO);
if (CollUtil.isEmpty(pageResult.getList())) {
return success(PageResult.empty(pageResult.getTotal()));
}
// 2.1 一次性批量查询发起方 + 接收方的昵称
Set<Long> userIds = convertSetByFlatMap(pageResult.getList(),
request -> Stream.of(request.getFromUserId(), request.getToUserId()));
Map<Long, AdminUserRespDTO> userMap = adminUserApi.getUserMap(userIds);
// 2.2 转换为 VO填充昵称
return success(BeanUtils.toBean(pageResult, ImFriendRequestManagerRespVO.class, vo -> {
MapUtils.findAndThen(userMap, vo.getFromUserId(),
user -> vo.setFromNickname(user.getNickname()));
MapUtils.findAndThen(userMap, vo.getToUserId(),
user -> vo.setToNickname(user.getNickname()));
}));
}
}

View File

@ -0,0 +1,34 @@
package cn.iocoder.yudao.module.im.controller.admin.manager.friend.vo;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - IM 好友关系分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
public class ImFriendManagerPageReqVO extends PageParam {
@Schema(description = "用户编号", example = "1024")
private Long userId;
@Schema(description = "好友用户编号", example = "2048")
private Long friendUserId;
@Schema(description = "好友状态", example = "0")
private Integer status; // 参见 CommonStatusEnum 枚举类
@Schema(description = "是否免打扰", example = "false")
private Boolean silent;
@Schema(description = "添加好友时间", example = "[2026-04-01 00:00:00, 2026-04-30 23:59:59]")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] addTime;
}

View File

@ -0,0 +1,54 @@
package cn.iocoder.yudao.module.im.controller.admin.manager.friend.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - IM 好友关系 Response VO")
@Data
public class ImFriendManagerRespVO {
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long id;
@Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long userId;
@Schema(description = "用户昵称", example = "张三")
private String userNickname;
@Schema(description = "好友用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2048")
private Long friendUserId;
@Schema(description = "好友昵称", example = "李四")
private String friendNickname;
@Schema(description = "好友展示备注")
private String displayName;
@Schema(description = "添加来源", example = "1")
private Integer addSource; // 参见 ImFriendAddSourceEnum 枚举类
@Schema(description = "是否免打扰", requiredMode = Schema.RequiredMode.REQUIRED, example = "false")
private Boolean silent;
@Schema(description = "是否置顶联系人", requiredMode = Schema.RequiredMode.REQUIRED, example = "false")
private Boolean pinned;
@Schema(description = "是否拉黑", requiredMode = Schema.RequiredMode.REQUIRED, example = "false")
private Boolean blocked;
@Schema(description = "好友状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
private Integer status; // 参见 CommonStatusEnum 枚举类
@Schema(description = "添加好友时间")
private LocalDateTime addTime;
@Schema(description = "删除好友时间")
private LocalDateTime deleteTime;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime createTime;
}

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