feat(shipping-notice): 落地 XFA 拆分、版面签名、统一进度与处理域履约

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
hugoandCursor committed 2026-08-06 10:18:37 +08:00
1 parent 3a9fbac2fc
commit d2b3d74def
571 files changed
+78064 -24681

No files matched your search

@@ -2,7 +2,7 @@
services/shipping_notice/attachment_selection.py
用途:基于 Intake 快览事实生成可审计的附件选择计划。
依赖:ShippingNoticeIntake、标准库正则与哈希;只读取 structured_result_json,不回读 Document/布局结果。
依赖:ShippingOrderIntake、标准库正则与哈希;只读取 structured_result_json,不回读 Document/布局结果。
逻辑:发送阶段调用本文件,把当前批次附件目录转换为“为何选择/为何跳过”的稳定计划;
后续深度解析、预算扩展与审计都应复用这份快照,而不是重新猜测附件优先级。
"""
@@ -13,7 +13,7 @@ import re
from collections import defaultdict
from typing import Any
from app.models import ShippingNoticeIntake
from app.models import ShippingOrderIntake
_PO_HINT_RE = re.compile(r'\b(?:PO[-_ ]*)?([A-Z]{0,4}\d{5,})\b', re.IGNORECASE)
_TOKEN_RE = re.compile(r'[A-Z0-9]{4,}', re.IGNORECASE)
@@ -57,7 +57,7 @@ _NEGATIVE_NAME_HINTS: tuple[tuple[str, int, str], ...] = (
)
def _structured(intake: ShippingNoticeIntake) -> dict[str, Any]:
def _structured(intake: ShippingOrderIntake) -> dict[str, Any]:
"""读取 Intake 快览摘要;缺失时返回空对象,调用方决定是否视为不可选。"""
return intake.structured_result_json if isinstance(intake.structured_result_json, dict) else {}
@@ -134,7 +134,7 @@ def _score_attachment(*, filename: str, mime_type: str, size: int, mail_text: st
def build_attachment_selection_snapshot(
*,
intakes: list[ShippingNoticeIntake],
intakes: list[ShippingOrderIntake],
max_initial_attachments: int = 2,
max_initial_concurrency: int = 2,
expansion_batch_size: int = 2,