feat(freight-rpa): 批次R解耦编排层并切换 onhand/inbound 契约
将 RPA 编排收编至 freight_rpa,回调迁 /api/freight-rpa/*。 共享目录与 Worker 契约一次切换至 onhand/inbound/upload, 并补 outbound 骨架与 tt16 排程 job key 迁移。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
bf3154033b
commit
ffc0d4a430
147 files changed
+4221
-2678
No files matched your search
@@ -94,11 +94,11 @@ def _shipping_notice_stable_auto_config(request, monkeypatch):
|
||||
app.config["SHIPPING_NOTICE_AUTO_PROGRESS_ENABLED"] = True
|
||||
app.config["SHIPPING_NOTICE_BATCH_ORCHESTRATOR_ENABLED"] = False
|
||||
monkeypatch.setattr(
|
||||
"app.services.shipping_notice.rpa_worker_heartbeat.assert_inventory_rpa_worker_ready",
|
||||
"app.services.freight_rpa.common.worker_heartbeat.assert_inventory_rpa_worker_ready",
|
||||
lambda: None,
|
||||
)
|
||||
monkeypatch.setattr(
|
||||
"app.services.shipping_notice.rpa_worker_heartbeat.assert_freight_upload_rpa_ready",
|
||||
"app.services.freight_rpa.common.worker_heartbeat.assert_freight_upload_rpa_ready",
|
||||
lambda: None,
|
||||
)
|
||||
return
|
||||
@@ -111,10 +111,10 @@ def _shipping_notice_stable_auto_config(request, monkeypatch):
|
||||
app.config["FREIGHT_RPA_WORKER_HEARTBEAT_REQUIRED"] = False
|
||||
app.config["FREIGHT_RPA_WORKER_HEARTBEAT_REQUIRE_REDIS"] = False
|
||||
app.config["FREIGHT_RPA_WORKER_HEARTBEAT_ALLOW_MEMORY_FALLBACK"] = True
|
||||
from app.services.shipping_notice.rpa_worker_heartbeat import reset_rpa_worker_heartbeat_state_for_tests
|
||||
from app.services.freight_rpa.common.worker_heartbeat import reset_rpa_worker_heartbeat_state_for_tests
|
||||
|
||||
reset_rpa_worker_heartbeat_state_for_tests()
|
||||
from app.services.shipping_notice.rpa_worker_heartbeat_alert import reset_rpa_worker_alert_state_for_tests
|
||||
from app.services.freight_rpa.common.worker_heartbeat_alert import reset_rpa_worker_alert_state_for_tests
|
||||
|
||||
reset_rpa_worker_alert_state_for_tests()
|
||||
|
||||
@@ -475,10 +475,10 @@ def scheduled_rpa_batch_item(source_code: str, **overrides) -> dict[str, str]:
|
||||
|
||||
|
||||
def v2_inventory_batch_payload(payload: dict) -> dict:
|
||||
"""测试构造器:补齐冻结 shipping_inventory_rpa.v2 回调 envelope。"""
|
||||
"""测试构造器:补齐冻结 freight_rpa.onhand.v1 回调 envelope。"""
|
||||
body = dict(payload or {})
|
||||
run_no = str(body.get('batch_run_no') or body.get('run_no') or '').strip()
|
||||
body.setdefault('schema_version', 'shipping_inventory_rpa.v2')
|
||||
body.setdefault('schema_version', 'freight_rpa.onhand.v1')
|
||||
body.setdefault('callback_id', f'test-callback:{run_no or "unknown"}')
|
||||
body.setdefault('batch_run_no', run_no)
|
||||
return body
|
||||
@@ -498,7 +498,7 @@ def rpa_callback_payload(
|
||||
source_code = next(iter(task_frozen_inventory_source_codes(task)), '')
|
||||
source = get_database_inventory_source(source_code) or {}
|
||||
return {
|
||||
"schema_version": "shipping_inventory_rpa.v2",
|
||||
"schema_version": "freight_rpa.onhand.v1",
|
||||
"callback_id": f"test-callback:{run_no}",
|
||||
"task_id": task.task_no,
|
||||
"status": status,
|
||||
|
||||
Reference in new issue
Block a user