feat(in-transit-transfer): inbound/outbound 幂等重命名与解析用途分层

- receipt→inbound 三件套改名(回调桥/文件门禁/触发服务),回调链幂等去重,迁移 tt14 同步台账键与测试基建
- 库存解析用途分层 onhand/inbound/outbound(迁移 tt15):解析档案、文件存储与下载名按用途隔离,管理端表单同步
- 「成熟」概念退役(迁移 tt16):数据无成熟属性,日期边界由调用方入参严格判定
- backlog 新增重解析服务,在途重识别投影 processing,EML 父项不再停留处理中
- 收料 RPA 回调/归档/排程链路同步改名挂点,运维脚本复位假完成状态
- 文档随批:ADR 0003 模块边界决策、10-15/10-16 计划与设计、调拨文档族与 demand/tec/funclist
- 同步 chat/errors 文案四语言、调拨前端卡片与 e2e、测试全家
This commit is contained in:
hugo committed 2026-10-16 19:43:49 +08:00
1 parent 43dceaf027
commit 8102a1fe44
151 files changed
+8057 -2382

No files matched your search

@@ -41,11 +41,9 @@ def serialize_summary(summary) -> dict[str, Any]:
"matching_id": summary.matching_id,
"status": summary.status,
"business_date": summary.business_date,
"eligible_receipt_date_to": summary.eligible_receipt_date_to,
"expires_at": summary.expires_at,
"counts": {
"file_invoice_count": summary.counts.file_invoice_count,
"not_matured_count": summary.counts.not_matured_count,
"matched_count": summary.counts.matched_count,
"executable_count": summary.counts.executable_count,
"blocked_count": summary.counts.blocked_count,
@@ -74,7 +72,7 @@ def serialize_item(item) -> dict[str, Any]:
"specification": item.specification,
"invoice_no": item.invoice_no,
"lot_no": item.lot_no,
"receipt_date": item.receipt_date,
"movement_date": item.movement_date,
"from_warehouse": item.from_warehouse,
"from_quantity": str(item.from_quantity) if item.from_quantity is not None else None,
"to_warehouse": item.to_warehouse,
@@ -137,7 +135,7 @@ def serialize_order(doc, items: list) -> dict[str, Any]:
items: 单挂接行集(TransferInvoiceItem 列表,调用方保证顺序)。
Returns:
单投影 dict(8 键):{doc_no, receipt_date, from_warehouse, to_warehouse,
单投影 dict(8 键):{doc_no, movement_date, from_warehouse, to_warehouse,
status, erp_document_no, error_message, lines}。
"""
# 延迟引用 execution_service 的行聚合(模块级互相引用会循环导入;
@@ -166,7 +164,7 @@ def serialize_order(doc, items: list) -> dict[str, Any]:
reason_by_key[key] = message
return {
"doc_no": doc.doc_no,
"receipt_date": doc.receipt_date,
"movement_date": doc.movement_date,
"from_warehouse": doc.from_warehouse,
"to_warehouse": doc.to_warehouse,
"status": doc.status,
@@ -174,7 +172,7 @@ def serialize_order(doc, items: list) -> dict[str, Any]:
"error_message": doc.error_message,
"lines": [
{
# 行级溯源收料通知号(2026-09-29 契约扩充,随 ERP 写入行同款口径
# 行级溯源来源单号(2026-09-29 契约扩充,随 ERP 写入行同款口径
# 透传):业务上一行恒对应一张 invoice,前端明细表首列展示。
"invoice_no": line["invoice_no"],
"material_no": line["material_no"],
@@ -212,7 +210,7 @@ def serialize_executed_order(doc, items: list) -> dict[str, Any]:
"submit_timestamp": doc.submit_timestamp,
"status": base["status"],
"status_group": order_status_group(doc.status),
"receipt_date": base["receipt_date"],
"movement_date": base["movement_date"],
"from_warehouse": base["from_warehouse"],
"to_warehouse": base["to_warehouse"],
"erp_document_no": base["erp_document_no"],
@@ -227,10 +225,10 @@ def serialize_executed_order(doc, items: list) -> dict[str, Any]:
# 批号保持文件证据原形态(raw 原则);展示侧拨出批号由前端
# deriveBatchNo 镜像转换(与匹配卡/可调拨明细/待办池同规则)。
"lot_no": item.lot_no or "",
"quantity": item.receipt_quantity,
"quantity": item.movement_quantity,
"unit": item.unit or "",
}
# 行序对齐统一规则第三键(2026-09-29):同单内收料日期/数据源恒同
# 行序对齐统一规则第三键(2026-09-29):同单内异动日期/数据源恒同
# (组键含两者),按 invoice_no 升序、id 兜底稳定排序。
for item in sorted(items, key=lambda row: (str(row.invoice_no or ""), row.id))
],