WMS_MAIN/docs/order-state-machine-dictionary.md
liufumingren 460ce119c5 ok
2026-04-11 17:08:55 +08:00

46 lines
2.1 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.

# 订单发货单 — 状态机字段字典(骨架 v0)
> **单一事实来源(代码)**:`app/model/order_delivery.js` 内 `StatusEnum` 与 `step` 定义。
> 本文档为 **v0 骨架**:便于产品 / 数仓 / 报表对齐;**与数仓字段映射、变更登记** 在后续迭代补全(见 `order_todo.md` §5.2)。
## 1. 主状态与步骤
| 字段 | 类型(ORM) | 枚举或取值 | 说明(摘自模型注释) |
|------|-------------|------------|----------------------|
| `status` | ENUM | `pedding`, `created`, `cancel`, `error` | 订单状态 |
| `step` | INTEGER | `0` 未审核,`1` 已审核,`2` 处理中,`3` 驳回/异常,`4` 配送中,`5` 已完成,`9` 已关闭 | 订单步骤 |
## 2. 各环节状态机(ENUM)
| 字段 | 枚举值 |
|------|--------|
| `sync_status` | `padding`, `fin`, `error` |
| `post_status` | `padding`, `fin`, `timeout`, `error`, `none` |
| `storage_status` | `padding`, `fin`, `error`, `none` |
| `pick_status` | `padding`, `fin`, `error`, `none` |
| `pack_status` | `none`, `padding`, `fin`, `error` |
| `inspection_status` | `none`, `padding`, `running`, `fin`, `error` |
| `print_status` | `none`, `padding`, `fin`, `error` |
| `claim_status` | `none`, `padding`, `fin`, `error` |
| `outbound_status` | `none`, `padding`, `fin`, `error` |
| `lock_status` | `none`, `warehouse`, `store` |
| `intercept_status` | `none`, `requesting`, `requested`, `intercepting`, `intercepted_in_transit`, `intercepted_at_warehouse`, `returning`, `returned`, `delivered_by_mistake`, `timeout`, **`cancelled`**, `failed`, `exception` |
## 3. 其它与展示相关(非 ENUM)
| 字段 | 说明 |
|------|------|
| `delivery_time` | 发货时间;与 M6 出库时间策略相关 |
| `create_at` / `updated_at` | 创建 / 更新时间 |
## 4. 待产品补充(v1+)
- 「取消进 M4」专用标记:若不用 `status`/`step`/`intercept_status` 组合表达,则 **新增列** 后的字典条目与数仓同步表。
- 与奇门 **不同步** 的克隆续单字段(见 `order_todo.md` §2.4)。
## 5. 修订
| 版本 | 说明 |
|------|------|
| v0 | 自 `order_delivery.js` 摘录枚举骨架,无 DB 变更 |