feat(shipping-notice): 收料RPA接入调拨全链路并统一Worker触发目录消费

- 新增 common/trigger_consumer 领取/归档原语,库存与收料 Worker 统一四态目录契约,README 载明契约
- 触发先落单元行再原子写 trigger;假触发器委托真实服务;触发目录不可用单元标 failed
- 回调终态桥接推进调拨来源任务,有推进即 commit 保证持久
- 预检接真实异动文件仓库与 parse_movement_rows,行合成 sheet/row_no 溯源
- 等待回调来源任务超时回收挂每轮排程领取,绝不自动重试
- 三环境补收料共享目录 env,值对齐 §1.9.3 挂载约定
This commit is contained in:
hugo committed 2026-09-18 01:38:29 +08:00
1 parent 80d78130f8
commit 65f751daf4
23 files changed
+607 -91

No files matched your search

+24 -13
View File
@@ -686,7 +686,12 @@ def client(app):
@pytest.fixture
def dbs_ready_file() -> dict:
"""当日 ready 收料全量文件(DBS-AWSBI),含重复 Invoice 多行。"""
"""当日 ready 收料全量文件(DBS-AWSBI),含重复 Invoice 多行。
rows 使用 movement 领域字段键(doc_no/material_code/quantity/movement_date),
与真实仓库 movement_file_repository 产出一致(B5 接线后 run_precheck 按
parse_movement_rows 解析);sheet/row_no 为解析必带溯源字段。
"""
return {
"source_code": "DBS-AWSBI",
"business_date": "2026-08-06",
@@ -696,22 +701,25 @@ def dbs_ready_file() -> dict:
"checksum": "d" * 64,
"status": "ready",
"rows": [
{"sheet": "Receipt", "row_no": 10, "invoice_no": "INV-001", "material_no": "MAT-001",
{"sheet": "Receipt", "row_no": 10, "doc_no": "INV-001", "material_code": "MAT-001",
"material_name": "连接器组件", "specification": "A 型 / 24PIN",
"receipt_date": "2026-08-05", "receipt_quantity": "500", "source_code": "DBS-AWSBI"},
{"sheet": "Receipt", "row_no": 11, "invoice_no": "INV-001", "material_no": "MAT-001",
"movement_date": "2026-08-05", "quantity": "500", "source_code": "DBS-AWSBI"},
{"sheet": "Receipt", "row_no": 11, "doc_no": "INV-001", "material_code": "MAT-001",
"material_name": "连接器组件", "specification": "A 型 / 24PIN",
"receipt_date": "2026-08-05", "receipt_quantity": "700", "source_code": "DBS-AWSBI"},
{"sheet": "Receipt", "row_no": 20, "invoice_no": "INV-002", "material_no": "MAT-002",
"movement_date": "2026-08-05", "quantity": "700", "source_code": "DBS-AWSBI"},
{"sheet": "Receipt", "row_no": 20, "doc_no": "INV-002", "material_code": "MAT-002",
"material_name": "控制器组件", "specification": "标准型 / 48V",
"receipt_date": "2026-08-05", "receipt_quantity": "1200", "source_code": "DBS-AWSBI"},
"movement_date": "2026-08-05", "quantity": "1200", "source_code": "DBS-AWSBI"},
],
}
@pytest.fixture
def crane_ready_file() -> dict:
"""当日 ready 收料全量文件(CRANE-SZ),独立来源。"""
"""当日 ready 收料全量文件(CRANE-SZ),独立来源。
rows 使用 movement 领域字段键,与真实仓库产出一致(B5 接线后)。
"""
return {
"source_code": "CRANE-SZ",
"business_date": "2026-08-06",
@@ -721,16 +729,19 @@ def crane_ready_file() -> dict:
"checksum": "c" * 64,
"status": "ready",
"rows": [
{"sheet": "Inbound", "row_no": 5, "invoice_no": "INV-008", "material_no": "MAT-200",
{"sheet": "Inbound", "row_no": 5, "doc_no": "INV-008", "material_code": "MAT-200",
"material_name": "传感器模组", "specification": "SZ-8 / IP67",
"receipt_date": "2026-08-05", "receipt_quantity": "600", "source_code": "CRANE-SZ"},
"movement_date": "2026-08-05", "quantity": "600", "source_code": "CRANE-SZ"},
],
}
@pytest.fixture
def same_day_receipt_file() -> dict:
"""含业务日期当天收料的文件;这些 Invoice 必须标记 not_matured。"""
"""含业务日期当天收料的文件;这些 Invoice 必须标记 not_matured。
rows 使用 movement 领域字段键,与真实仓库产出一致(B5 接线后)。
"""
return {
"source_code": "DBS-AWSSG",
"business_date": "2026-08-06",
@@ -740,9 +751,9 @@ def same_day_receipt_file() -> dict:
"checksum": "s" * 64,
"status": "ready",
"rows": [
{"sheet": "Receipt", "row_no": 3, "invoice_no": "INV-041", "material_no": "MAT-041",
{"sheet": "Receipt", "row_no": 3, "doc_no": "INV-041", "material_code": "MAT-041",
"material_name": "连接器组件", "specification": "C 型",
"receipt_date": "2026-08-06", "receipt_quantity": "400", "source_code": "DBS-AWSSG"},
"movement_date": "2026-08-06", "quantity": "400", "source_code": "DBS-AWSSG"},
],
}