Files
junhong_cmp_fiber/docs/device-status-split/功能总结.md
huang ed071918ed
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 8m7s
钱包订单退款时应当正确退回,充值时允许最低充值1分
2026-05-18 09:51:59 +08:00

32 lines
942 B
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.
# 设备状态拆分功能总结
## 背景
设备原 `status` 同时表达在库、分销、激活和停用,导致“已分销且已激活”的设备只能展示一个状态,语义混淆。
## 调整内容
- `status` 收敛为设备归属状态:`1=在库``2=已分销`
- 设备响应新增 `activation_status``activation_status_name`
- 设备列表和批量筛选支持按 `activation_status` 查询
- 设备激活状态不落库,按查询实时计算
- 历史 `status=3/4` 迁移为归属状态:有 `shop_id` 归为已分销,无 `shop_id` 归为在库
## 激活判定
设备激活必须同时满足:
1. 存在生效中的主套餐(`tb_package_usage.status=1``master_usage_id IS NULL`
2. 设备任意绑定卡已实名(`tb_iot_card.real_name_status=1`
## 响应示例
```json
{
"status": 2,
"status_name": "已分销",
"activation_status": 1,
"activation_status_name": "已激活"
}
```