feat(shipping-notice): 完善订单解析、模板管理与库存 RPA 流程

- 优化订单文档解析、补充合并与坐标重建
- 完善订单模板校验、发布及前端管理界面
- 改进库存 RPA 下载回退与工作流处理
- 补充后端、前端及 RPA 自动化测试
- 更新 Shipping Notice 技术文档与四语言文案
This commit is contained in:
hugo committed 2026-09-09 09:10:10 +08:00
1 parent c4a27324c8
commit 8f2f568f92
46 files changed
+1745 -265

No files matched your search

@@ -153,10 +153,13 @@ def reconstruct_coordinate_profile_rows_with_strategy(
coordinate_transform: dict[str, Any] | None = None,
page_no: int = 1,
) -> tuple[list['CoordinateProfileLogicalRow'], Any]:
"""统一评估 fixed/adaptive/dynamic,并返回唯一安全的坐标明细结果。"""
from app.services.shipping_notice.document_layout.runtime_parse_strategy import (
resolve_runtime_parse_strategy,
)
"""统一评估 fixed/adaptive/dynamic,并返回坐标明细与策略结果。
核心逻辑:三种重建模式都跑一遍再交给策略裁决;``selected`` 时只返回被选中模式。
策略为 ``needs_review`` 时仍返回 fixed→adaptive→dynamic 的最佳努力明细,供盲测/
验证人工核对;正式自动建单路径必须自行检查 ``strategy.status == 'selected'``。
"""
from app.services.shipping_notice.document_layout import runtime_parse_strategy as parse_strategy
fixed_rows = reconstruct_coordinate_profile_rows(
characters=characters, table_bbox=table_bbox, line_layouts=line_layouts,
@@ -197,20 +200,23 @@ def reconstruct_coordinate_profile_rows_with_strategy(
for row in rows
]
strategy = resolve_runtime_parse_strategy(
strategy = parse_strategy.resolve_runtime_parse_strategy(
page_glyphs={str(page_no): characters},
fixed_rows=strategy_rows(fixed_rows),
adaptive_rows=strategy_rows(adaptive_rows),
dynamic_rows=strategy_rows(dynamic_rows),
)
if strategy.status != 'selected' or strategy.row_mode is None:
return [], strategy
return (
fixed_rows if strategy.row_mode == 'fixed_subrows'
else adaptive_rows if strategy.row_mode == 'adaptive_record_columns'
else dynamic_rows,
strategy,
)
if strategy.status == 'selected' and strategy.row_mode is not None:
return (
fixed_rows if strategy.row_mode == 'fixed_subrows'
else adaptive_rows if strategy.row_mode == 'adaptive_record_columns'
else dynamic_rows,
strategy,
)
# 策略需复核时仍返回最佳努力明细,供盲测/验证人工核对;正式自动建单仍以
# strategy.status == 'selected' 为准,不得把 fallback 当成可自动建单结果。
fallback = fixed_rows or adaptive_rows or dynamic_rows
return fallback, strategy
def resolve_line_start_field_code(value: Any = None) -> str: