feat: 海运查价带贸易条款且不带运输分类

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-20 17:47:12 +08:00
co-authored by Cursor
parent 27aeebb593
commit 3a6884e27d
6 changed files with 67 additions and 5 deletions
+12 -1
View File
@@ -1,8 +1,9 @@
"""
海运查价参数:对照 TMS V2 /quote/v2/query 是否带全。
本文件职责:询价卡片出现前,确认海运七项能拼出查价正文。
本文件职责:询价卡片出现前,确认海运十项里查出站项能拼出查价正文。
港口只带名称,不做港口字典对应;箱型箱量保持原文字段,containerItems 只透传模型投影。
贸易条款必带出站;运输分类只留在工单 facts,不进 tms_facts。
禁止:本地拆箱型;因对不上港口字典跳过 TMS;改六态。
"""
@@ -62,6 +63,8 @@ def assemble_sea_query(facts: dict[str, Any] | None) -> dict[str, Any]:
load = _load_type(str(src.get("整柜或拼柜") or ""))
box = str(src.get("箱型箱量") or "").strip()
quote_date = str(src.get("报价日期") or "").strip()
trade = str(src.get("贸易条款") or src.get("trade_terms") or src.get("tradeTerms") or "").strip()
klass = str(src.get("运输分类") or "").strip()
missing: list[str] = []
missing_display: list[str] = []
@@ -72,6 +75,7 @@ def assemble_sea_query(facts: dict[str, Any] | None) -> dict[str, Any]:
("货量", "货物数量", qty),
("整柜或拼柜", "整柜或拼柜", load),
("箱型箱量", "箱型箱量", box),
("贸易条款", "贸易条款", trade),
("报价日期", "报价日期", quote_date),
)
for key, label, val in pairs:
@@ -93,12 +97,18 @@ def assemble_sea_query(facts: dict[str, Any] | None) -> dict[str, Any]:
out_facts["整柜或拼柜"] = load
if box:
out_facts["箱型箱量"] = box
if trade:
out_facts["贸易条款"] = trade
if klass:
out_facts["运输分类"] = klass
if quote_date:
out_facts["报价日期"] = quote_date
items = parse_container_items(src)
if items:
out_facts["containerItems"] = items
tms_facts = dict(out_facts)
tms_facts.pop("运输分类", None)
logger.info(
"tms.sea.assemble ok=%s origin=%s dest=%s load=%s missing=%s",
ok,
@@ -112,4 +122,5 @@ def assemble_sea_query(facts: dict[str, Any] | None) -> dict[str, Any]:
"missing": missing,
"missing_display": missing_display,
"facts": out_facts,
"tms_facts": tms_facts,
}