feat(in-transit-transfer): 调拨类型配置化与库存异动档原子切换
调拨类型从四处硬编码升级为管理页可配置:范围规则(受控字段白名单,规则间且/值间或)、 仓库定义(映射档/固定仓双模式角色解析)、字段转换(批号前缀替换,匹配时快照固化到 scope_json)。 新建 transfer_movement_ledger 库存异动档(参照 ERP inaj_t):自然键幂等增量落档 (插入/换证更新/跳过/缺席不删/执行封存永不触碰),圈档互斥保证一条档记录一生只绑一次明细; 收料证据落地改写档、停写 items。transfer_invoice_items 出生翻转为匹配时从档圈定创建 (一次匹配永久写入 matching_id+ledger_record_id),回查对账/取消释放/执行门禁/待匹配桶全链路适配。 迁移 tt10→tt13 单 head:类型配置表、异动档、items 档外键、transfer_runs.transfer_type 放宽 String(64)。 随行披露:设计文档与实施计划、ADR 0001/0002、in-transit-transfer 术语表、 demand/funclist/technical 文档更新同批入库。
This commit is contained in:
1 parent
28d6085d07
commit
52c71ee46a
78 files changed
+7423
-1702
No files matched your search
@@ -12,7 +12,7 @@ from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
from app.services.in_transit_transfer.movement_contract import external_lot_no
|
||||
from app.services.in_transit_transfer.matching_service import item_external_lot_no
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# 单状态 → 展示分组映射(Task 17:首页「已执行」区块统计口径)
|
||||
@@ -149,11 +149,11 @@ def serialize_order(doc, items: list) -> dict[str, Any]:
|
||||
name_by_key: dict[tuple[str, str, str, str], str] = {}
|
||||
reason_by_key: dict[tuple[str, str, str, str], str] = {}
|
||||
for item in ordered:
|
||||
# [外部形态] join 键与 _build_order_lines 聚合键同形(批号 WTP→HOW 派生),
|
||||
# 否则 WTP 前缀行的品名/原因投影 lookup 会 miss。
|
||||
# [外部形态] join 键与 _build_order_lines 聚合键同形(批号经行所属匹配
|
||||
# 快照转换规则派生),否则 WTP 前缀行的品名/原因投影 lookup 会 miss。
|
||||
key = (
|
||||
str(item.material_no or "").strip(),
|
||||
external_lot_no(item.lot_no),
|
||||
item_external_lot_no(item),
|
||||
str(item.from_warehouse or "").strip(),
|
||||
str(item.to_warehouse or "").strip(),
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user