落地多段联运私聊:齐了才建单拉群,附件只收格子值,核对改正不再整单重开。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-23 15:08:15 +08:00
co-authored by Cursor
parent 6e3e09a316
commit 2334524bb8
30 changed files with 4033 additions and 40 deletions
@@ -59,6 +59,9 @@ SEA_DISPLAY = {key: label for key, label in SEA_REQUIRED_FIELDS}
# 陆运销售侧名称:卡片写始发站/货物品名;内部仍用合同键起运港/品名。
LAND_DISPLAY = {
"运输类型": "运输类型",
"线路类别": "线路类别",
"运输分类": "运输分类",
"起运港": "始发站",
"目的港": "目的地",
"品名": "货物品名",
@@ -208,6 +211,7 @@ _ALIASES = {
"货好时间": "货好时间",
"提货地址": "提货地址",
"收货地址": "收货地址",
"送货地址": "收货地址",
"贸易条款": "贸易条款",
"货源地(非必填)": "货源地",
"货好时间(非必填)": "货好时间",
@@ -234,6 +238,7 @@ def normalize_facts(facts: dict[str, Any] | None) -> dict[str, str]:
out: dict[str, str] = {}
for raw_key, raw_val in (facts or {}).items():
key = str(raw_key).strip()
key = re.sub(r"(必填)|(非必填)|\(必填\)|\(非必填\)", "", key).strip()
key = _ALIASES.get(key, key)
if raw_val is None:
continue
@@ -528,6 +533,9 @@ def validate_required_fields(
"business_line": line,
}
if line == "LAND":
from agent.schema.land_options import scrub_land_placeholder_ports
normalized = scrub_land_placeholder_ports(normalized)
land_subtype = (land_subtype or "").strip() or str(
normalized.get("运输类型") or ""
).strip()