feat: 添加消息卡片更新功能,支持或签/单人审批场景

新增功能:
1. 创建 feishu_message 表,存储消息与审批订单/节点/用户的映射关系
2. 发送审批通知时保存 message_id
3. 审批完成后自动更新其他审批人的消息卡片

使用场景:
- 或签(or_approve):一人通过后,更新其他审批人的消息卡片
- 单人审批(approver):一人通过后,更新其他审批人的消息卡片
- 拒绝(reject):拒绝后更新所有其他审批人的消息卡片

技术细节:
- FeishuMessage 模型:管理消息映射
- FeishuNotificationService::updateMessageCards():更新消息卡片
- ApprovalService:审批完成后调用消息更新逻辑

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
root
2026-02-28 18:06:40 +08:00
parent aeff21aec6
commit 1f72da9ec4
6 changed files with 273 additions and 15 deletions
+24
View File
@@ -307,6 +307,30 @@
---
### 13. feishu_message - 飞书审批消息映射表
用于存储飞书消息与审批订单、节点、用户的映射关系,支持消息卡片更新。
| 字段 | 类型 | 必填 | 默认值 | 说明 |
|------|------|------|--------|------|
| id | bigint unsigned | ✓ | AUTO_INCREMENT | 记录ID |
| order_id | bigint unsigned | ✓ | | 审批订单ID |
| node_id | bigint unsigned | ✓ | | 审批节点ID |
| user_id | bigint unsigned | ✓ | | 审批人ID |
| message_id | varchar(64) | ✓ | | 飞书消息ID |
| msg_token | varchar(128) | | | 消息Token(用于更新卡片) |
| status | varchar(20) | ✓ | active | 状态:active=有效,updated=已更新,deleted=已删除 |
| created_at | timestamp | | CURRENT_TIMESTAMP | 创建时间 |
| updated_at | timestamp | | CURRENT_TIMESTAMP | 更新时间 |
**索引**:
- PRIMARY KEY (`id`)
- UNIQUE KEY `idx_order_node_user` (`order_id`, `node_id`, `user_id`)
- KEY `idx_message_id` (`message_id`)
- KEY `idx_user_id` (`user_id`)
---
## 📊 表关系图
```