Files
lislgosms/docs/phase-8-operations-acceptance-progress.md

82 lines
4.5 KiB
Markdown
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.
# 阶段 8:查询、统计、验收进度记录
## 当前状态
- 状态:进行中
- 开始时间:2026-07-01
## 计划步骤
1. 创建阶段 8 计划和验收标准。已完成。
2. 实现客户端任务、发送详情、上行短信查询。已完成,`npm --prefix api run build` 通过。
3. 实现运营端发送监控、任务进度、短信记录、上行记录、看板和统计。已完成,`npm --prefix api run build` 通过。
4. 实现操作日志审计查询与汇总。已完成,`npm --prefix api run build` 通过。
5. 实现发送链路追踪和账务对账。已完成,`npm --prefix api run build` 通过。
6. 输出 500 条/秒压测报告。已完成,见 `docs/phase-8-500tps-performance-report.md`
7. 输出 Linux 上线部署文档和回滚方案。已完成,见 `docs/linux-deployment-and-rollback.md`
8. 运行 Prisma generate、API build、阶段验证脚本和 API health smoke。已完成。
9. 在真实 PostgreSQL/Redis/MinIO 下补充最小 seed 和核心 HTTP smoke。已完成。
## 验收记录
- 客户端接口:
- `GET /api/client/operations/batch-tasks`
- `GET /api/client/operations/batch-tasks/:id/messages`
- `GET /api/client/operations/uplink-messages`
- 运营端接口:
- `GET /api/admin/operations/monitor`
- `GET /api/admin/operations/task-progress`
- `GET /api/admin/operations/messages`
- `GET /api/admin/operations/uplink-messages`
- `GET /api/admin/operations/dashboard`
- `GET /api/admin/operations/statistics`
- `GET /api/admin/operations/audit-logs`
- `GET /api/admin/operations/audit-summary`
- `GET /api/admin/operations/trace`
- `GET /api/admin/operations/reconciliation`
- 运营端页面增补:
- 充值记录页增加企业人工充值入口,并展示人工充值记录类型和备注。
- 系统管理增加系统日志页面。
- 客户端页面增补:
- 工作台“剩余条数”改为“剩余余额”。
- 工作台“近24小时成功率”改为今日发送条数和今日成功率。
- 工作台新增今日消费金额和今日返还金额。
- 2026-07-01 需求增补验证:
- `npm --prefix api test -- billing.service.spec.ts` 通过。
- `npm --prefix api run build` 通过。
- `npm run build` 通过。
- `npm run verify:phase8` 复跑通过,BullMQ Spike 端到端约 502.30 TPS。
- API health smoke 通过:`http://localhost:3101/api/health` 返回 `ok`
- `npm run verify:phase8` 通过。
- 队列契约校验通过。
- Go Gateway `go test ./...` 通过。
- BullMQ Spike15000 条消息、并发 500、端到端约 705.65 TPS,满足 500 条/秒指标。
- Prisma Client 生成通过。
- API build 通过。
- 前端 build 通过,仍存在 Vite chunk size warning。
- 真实环境 smoke 通过:
- 依赖连通性:PostgreSQL 5432、Redis 6379、MinIO S3 9000、MinIO Console 9001 均通过 TCP 探测。
- 迁移:`npm --prefix api run prisma:migrate:deploy` 通过,无待应用迁移。
- API 启动:`API_PORT=3101 node api/dist/main.js` 可连接真实 `.env` 并返回 health `ok`
- 核心链路:`node tools/smoke/real-env-smoke.mjs` 通过,覆盖登录、企业/客户、人工充值、余额检查、发送任务、MinIO 预签名上传、运营日志、trace 和 reconciliation。
- 500 条/秒压测报告已输出。
- Linux 上线部署与回滚方案已输出。
## 阶段 8 验收状态
- 可按企业、应用、通道、任务、手机号追踪发送链路:已完成,`/api/admin/operations/trace` 支持相关查询维度。
- 可按账务流水和短信记录对账:已完成,`/api/admin/operations/reconciliation` 聚合短信记录、短信计费记录和账户流水。
- 输出 500 条/秒压测报告:已完成。
- 输出 Linux 部署方案:已完成,覆盖 Docker Compose、systemd、环境变量、数据库迁移、日志目录、备份恢复、服务健康检查和回滚步骤。
- API health smoke 通过:`/api/health` 返回 `ok`
- 真实 PostgreSQL/Redis/MinIO 核心 smoke 通过:最小 seed 与登录、充值、发送、上传、日志、追踪、对账链路均可执行。
## 结论
阶段 8 已完成。第一版阶段 0 至阶段 8 均已完成对应计划、实现、验证和进度记录。
## 风险与说明
- 阶段 8 的统计查询以第一版可运营为目标,优先使用 Prisma 聚合与分页查询;大表分区、物化统计、Redis 热统计将在后续版本增强。
- 当前真实环境 smoke 不包含真实运营商 SMSC/CMPP 互通;该项需运营商测试环境后补充联调记录。