feat(shipping-notice): 收敛订单处理状态与履约门禁

This commit is contained in:
hugo committed 2026-09-07 09:42:12 +08:00
1 parent bffcd55b40
commit 70dd0051b8
153 files changed
+10916 -4296

No files matched your search

@@ -417,13 +417,9 @@ def test_gate_maps_to_lifecycle_stage_b(app, gate_chain, scenario):
gate_code=gate_code, status='blocked_manual',
blocking_reason_code='inventory_preparation_failed', next_action_code='retry_inventory_preparation',
)
# 让 notice 路径(_process_gate_user_summary_for_task 按 task.id=notice.id 查 execution)
# 命中同一 execution:B 在生产中把 Notice 传给 build_task_ui_state。
from app.models import ShippingProcessExecution
execution = db.session.get(ShippingProcessExecution, execution_id)
execution.task_id = int(notice.id)
db.session.commit()
# 让 notice 路径经 order_task_id 命中同一 execution(B 在生产中把 Notice
# 传给 build_task_ui_state;Execution.task_id 必须保持为 OT.id)。
assert int(notice.order_task_id) == int(order_task.id)
from app.services.shipping_notice.ui_state import build_task_ui_state
b = build_task_ui_state(notice)
b_stage = str((b.get('stage') or {}).get('code') or '').strip()