feat(shipping-notice): 落地 XFA 统一视觉拆分确认门禁与处理投影收敛

闭合拆分预览令牌单次消费、样本 checksum 绑定与确认审计;正式提取改为 bindings-only。
同步统一标注工作台交互,并补齐进度投影/任务中心与迁移文档。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
hugoandCursor committed 2026-08-06 10:21:25 +08:00
1 parent d2b3d74def
commit 84a881b554
195 files changed
+20269 -3463

No files matched your search

@@ -9,7 +9,8 @@ services/shipping_notice/query_service.py
co8 起 shipping_batches 已删除,批次 list API 返回空、按 batch_no 查询返回 None;
tools.py 通过 TaskProjection / BatchProjection 委托序列化与任务解析,写路径逐步下沉;
SUMMARY 经 _enrich_task_center_fields 附带 todo_category / can_handle / ui_state / recent_event,
以及统一 shipping_processing_status / progress_version / order_task_no(BE-02);
以及统一 shipping_processing_status / progress_version / order_task_no(BE-02),
并注入 review_run_no 供任务中心深链订单处理工作台(UI-04);
list_my_todos / count_my_todos 合并建单前 Review Case、未建 OT Intake 与 Task 待办;
客户关键字 SQL 同时过滤 Review Case / Intake(文件名)与 Task(客户快照/来源文件名);
待办 todo_category 下推为与状态机同序的 SQL CASE;list 用 UNION ALL + COUNT/OFFSET/LIMIT,
@@ -936,18 +937,19 @@ def _artifact_summary_for_task(task: ShippingNotice) -> dict[str, Any] | None:
def _inject_unified_processing_fields(task: ShippingNotice, data: dict[str, Any]) -> None:
"""
将 Notice 关联 OT 的统一进度写入任务中心字段(BE-02)。
将 Notice 关联 OT 的统一进度写入任务中心字段(BE-02 / UI-04)。
核心逻辑:优先 Notice.order_task_id → ShippingOrderTask;有 OT 时用 Notice 履约
process_status 映射为 shipping_processing_status(与 shipping_processing_projection 同源),
并注入 shipping_processing_stage / progress_version / order_task_no;
无 OT 时仍按 Notice.process_status 映射,保证列表/详情轮询可读同一字段。
另附带 review_run_no / owner_agent_id / conversation_id(经 OT.extraction_run),
供任务中心「进入订单处理」深链;无 OT 时仍按 Notice.process_status 映射。
Args:
task: ShippingNotice(正式发货任务)。
data: 就地写入的序列化字典。
"""
from app.models import ShippingOrderTask
from app.models import ShippingOrderProcessingRun, ShippingOrderTask
from app.services.shipping_notice.shipping_processing_projection import (
_notice_processing_status_stage,
)
@@ -978,6 +980,19 @@ def _inject_unified_processing_fields(task: ShippingNotice, data: dict[str, Any]
data['order_task_no'] = (
str(getattr(order_task, 'task_no', None) or '').strip() or None
)
# [UI-04] 任务中心仅作列表入口;深链订单处理工作台需要 Run 编号与 Agent。
if order_task is not None and getattr(order_task, 'extraction_run_id', None):
run = db.session.get(ShippingOrderProcessingRun, int(order_task.extraction_run_id))
if run is not None:
run_no = str(getattr(run, 'run_no', None) or '').strip() or None
if run_no:
data['review_run_no'] = run_no
if not str(data.get('conversation_id') or '').strip():
cid = str(getattr(run, 'conversation_id', None) or '').strip() or None
if cid:
data['conversation_id'] = cid
if data.get('owner_agent_id') is None and getattr(run, 'owner_agent_id', None) is not None:
data['owner_agent_id'] = int(run.owner_agent_id)
def _enrich_task_center_fields(