feat: 海运询价必填加上贸易条款和运输分类

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-20 17:45:08 +08:00
co-authored by Cursor
parent 54b818915e
commit 27aeebb593
4 changed files with 76 additions and 6 deletions
+11 -2
View File
@@ -32,7 +32,7 @@ AIR_REQUIRED_FIELDS = (
)
AIR_DISPLAY = {key: label for key, label in AIR_REQUIRED_FIELDS}
# 海运询价必填 7 项:销售侧名称。内部键「货量」对外叫「货物数量」。
# 海运询价必填 10 项(销售侧含运输方式):内部键「货量」对外叫「货物数量」。
SEA_REQUIRED_FIELDS = (
("起运港", "起运港"),
("目的港", "目的港"),
@@ -40,6 +40,8 @@ SEA_REQUIRED_FIELDS = (
("货量", "货物数量"),
("整柜或拼柜", "整柜或拼柜"),
("箱型箱量", "箱型箱量"),
("贸易条款", "贸易条款"),
("运输分类", "运输分类"),
("报价日期", "报价日期"),
)
SEA_DISPLAY = {key: label for key, label in SEA_REQUIRED_FIELDS}
@@ -57,7 +59,7 @@ LAND_DISPLAY = {
}
# 协同补充字段:拉群后可静默写入,不挡首次查价。内部键仍是 HS编码。
SEA_COLLAB_FIELDS = ("贸易条款", "货好时间", "HS编码", "是否含油", "是否含电", "是否含磁")
SEA_COLLAB_FIELDS = ("货好时间", "HS编码", "是否含油", "是否含电", "是否含磁")
# 空运群只补含电/含磁,摘要不要把海运六项搬过去。
AIR_COLLAB_FIELDS = ("是否含电", "是否含磁")
# 群摘要对外展示名。内部继续用 HS编码,避免改合同键。
@@ -485,6 +487,13 @@ def validate_required_fields(
line = (business_line or "").strip().upper()
if line == "SEA":
normalized = project_sea_cargo_qty(normalized)
from agent.schema.sea_options import canonicalize_sea_class
klass = canonicalize_sea_class(str(normalized.get("运输分类") or ""))
if klass:
normalized["运输分类"] = klass
else:
normalized.pop("运输分类", None)
if line not in {"SEA", "AIR", "LAND"}:
return {
"ok": False,