Files
huang 6b1fbf4a92
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m30s
修复金额的问题
2026-04-23 10:09:23 +08:00

30 lines
1.5 KiB
Markdown
Raw 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.
## 1. 基线确认
- [x] 1.1 用目标卡/设备样本确认当前问题基线:卡流量增长但套餐 `data_usage_mb` 不增长
- [x] 1.2 记录基线证据(关键日志、`tb_iot_card``tb_package_usage` 当前值)用于修复后对比
## 2. 载体路由修复
- [x] 2.1 调整流量扣减链路,确保扣减入口支持“`iot_card` 未命中时回退 `device` 载体”
- [x] 2.2 在 `UsageService` 内统一实现载体命中逻辑,避免轮询与手动刷新分叉
- [x] 2.3 手动验证绑定设备卡场景:设备级套餐 `data_usage_mb` 可随流量同步增长
## 3. 小数流量精度修复
- [x] 3.1 调整扣减入参与内部计算口径,支持 `float64` 增量处理
- [x] 3.2 增加“流量小数余量”Redis 键与读写逻辑,累计后再执行整数 MB 扣减
- [x] 3.3 手动验证 `<1MB` 高频增量场景:多次同步后套餐扣减累计值正确
## 4. 字段语义对齐
- [x] 4.1 更新相关 DTO/文档描述,明确 `current_month_usage_mb` 是自然月口径
- [x] 4.2 在文档中明确 `last_gateway_reading_mb` 用于运营商周期累计口径展示
## 5. 回归与验收
- [x] 5.1 手动回归轮询与手动刷新两条链路,确认扣减逻辑一致
- [x] 5.2 用 PostgreSQL MCP 复核关键数据:`tb_iot_card.last_gateway_reading_mb``tb_package_usage.data_usage_mb` 变化符合预期
- [x] 5.3 执行 `openspec status --change fix-traffic-deduction-on-device-card`,确认提案进入可执行状态
> 说明2.3、3.3、5.1、5.2 由用户手动验证并确认通过。