agent_9art/add_reminders.sql
jqb 9c3268acdb feat: 新增备忘提醒跟进功能
本次提交完成了备忘提醒全流程功能开发:
1. 新增reminders数据库表与初始化SQL脚本
2. 后端实现提醒CRUD、定时推送任务、企微消息推送
3. 侧边栏新增提醒页面,支持创建/查看/删除/标记已跟进提醒
4. 管理后台新增提醒管理页面,支持多条件查询与删除
5. 优化了会话总结的错误提示文案
6. 补充了企微应用agent-id配置项
2026-08-11 11:54:05 +08:00

20 lines
1.4 KiB
SQL
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- 备忘提醒跟进表
-- 咨询老师在 sidebar 创建提醒,到点后通过企微自建应用 message/send 推送给老师
CREATE TABLE IF NOT EXISTS `reminders` (
`id` BIGINT(20) PRIMARY KEY AUTO_INCREMENT COMMENT '自增主键',
`staff_id` VARCHAR(128) NOT NULL COMMENT '咨询老师企微userid',
`staff_name` VARCHAR(128) NOT NULL DEFAULT '' COMMENT '咨询老师姓名',
`customer_id` VARCHAR(128) NOT NULL COMMENT '学员external_userid',
`customer_name` VARCHAR(256) NOT NULL DEFAULT '' COMMENT '学员姓名',
`remind_time` DATETIME NOT NULL COMMENT '提醒时间(精确到小时,分秒为0)',
`content` VARCHAR(1024) NOT NULL COMMENT '提醒文字',
`status` VARCHAR(16) NOT NULL DEFAULT 'PENDING' COMMENT '状态:PENDING待推送 NOTIFIED已推送 FAILED推送失败',
`notify_time` DATETIME NULL COMMENT '实际推送时间',
`retry_count` INT(11) NOT NULL DEFAULT 0 COMMENT '推送重试次数',
`deleted` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '逻辑删除:0正常 1已删除',
`created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
INDEX `idx_staff_time` (`staff_id`, `remind_time`) COMMENT '老师+提醒时间',
INDEX `idx_status_time` (`status`, `remind_time`) COMMENT '状态+提醒时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='备忘提醒跟进表';