feat(shipping-notice): 收敛复核阶段同源投影与 OT 后履约推进
统一 Case/Progress 阶段 label_key、修复 Job 成功未推进 OT 的可重试失败投影与写路径,并落地 OT 后行级匹配/波次履约与版面诊断开关。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
74270adc22
commit
fd6a23f870
100 files changed
+12138
-1017
No files matched your search
@@ -3,12 +3,14 @@ services/shipping_notice/ui_state.py
|
||||
|
||||
用途:发货通知任务/批次 UI 状态读模型,作为通知摘要、人工复核与任务工作台的统一状态来源。
|
||||
依赖:models.ShippingNotice、state_machine、query_service、constants、stp_progress_contract、
|
||||
process_gate_projection(统一 Gate 用户摘要)。
|
||||
process_gate_projection(统一 Gate 用户摘要)、
|
||||
order_review_workbench_projection.apply_post_ot_gate_rules。
|
||||
逻辑:从 ShippingNotice DB 字段经状态机解析 checkpoint/checkpoint_kind/action_buttons,
|
||||
再补充七步流程与可解释 summary(当前待办、暂停原因、下一自动步骤、操作入口、
|
||||
stp_facts、progress_nodes);
|
||||
若存在 ProcessExecution:阻断时清空 action_buttons;非阻断时仅保留
|
||||
download_excel / mark_manual_uploaded / refresh(恢复动作仅由 process_gate 驱动);
|
||||
Task 即正式 OT,Gate 摘要必须套用 OT 后规则(系统等待不冒充人工待办);
|
||||
批次 UI 仅作会话上传集合摘要,不作为履约写操作面。
|
||||
"""
|
||||
|
||||
@@ -615,10 +617,16 @@ def _process_gate_user_summary_for_task(task: ShippingNotice) -> dict[str, Any]
|
||||
"""
|
||||
按 Task 查找活动 Execution 的用户 Gate 摘要。
|
||||
|
||||
核心逻辑:Task 本身即正式 OT,套用 apply_post_ot_gate_rules,
|
||||
使 inventory_preparation 等系统等待不进入 current_blocking_gate。
|
||||
|
||||
Returns:
|
||||
project_user_gate_summary;无 Execution 时 None。
|
||||
用户态 Gate 摘要;无 Execution 时 None。
|
||||
"""
|
||||
from app.models import ShippingProcessExecution
|
||||
from app.services.shipping_notice.order_review_workbench_projection import (
|
||||
apply_post_ot_gate_rules,
|
||||
)
|
||||
from app.services.shipping_notice.process_gate_projection import project_user_gate_summary
|
||||
|
||||
task_id = getattr(task, 'id', None)
|
||||
@@ -636,7 +644,10 @@ def _process_gate_user_summary_for_task(task: ShippingNotice) -> dict[str, Any]
|
||||
)
|
||||
if execution is None:
|
||||
return None
|
||||
return project_user_gate_summary(execution)
|
||||
return apply_post_ot_gate_rules(
|
||||
project_user_gate_summary(execution),
|
||||
has_formal_ot=True,
|
||||
)
|
||||
|
||||
|
||||
def build_batch_ui_state(batch: Any) -> dict[str, Any]:
|
||||
|
||||
Reference in new issue
Block a user