空运未填报价日期时不默认当天,查出舱位后由销售点选再写回日期。

包装类型里的托盘不再被抄进增值服务。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-13 18:35:52 +08:00
co-authored by Cursor
parent dda210c219
commit 7ef4a1b1cf
21 changed files with 1068 additions and 58 deletions
+18 -5
View File
@@ -1,7 +1,8 @@
"""
字段合同校验:读 inquiry-required-fields-v1,只做作用域/非空/默认值。
本文件职责:判断首次查价缺项;报价日期未说则填当天,不进入补问。
本文件职责:判断首次查价缺项。海运、陆运报价日期未说则填当天,不进入补问。
空运报价日期非必填:没说不填当天、不进补问,确认后不带日期查价。
口语已写 TMS 单位(件/KGS/CBM)时,空着的件数/毛重/体积可机读补上。
禁止:正则猜港口/箱型;禁止用封闭枚举拒绝用户原文;禁止改六态。
"""
@@ -37,6 +38,7 @@ AIR_OPTIONAL_FIELDS = (
("提货地址", "提货地址"),
("收货地址", "收货地址"),
("贸易条款", "贸易条款"),
("added_services", "增值服务"),
)
AIR_DISPLAY = {key: label for key, label in AIR_REQUIRED_FIELDS}
AIR_DISPLAY.update({key: label for key, label in AIR_OPTIONAL_FIELDS})
@@ -236,6 +238,9 @@ _ALIASES = {
"贸易条款(非必填)": "贸易条款",
"起运港(非必填)": "起运港",
"起运地(非必填)": "起运港",
"增值服务": "added_services",
"增值服务(非必填)": "added_services",
"addedServices": "added_services",
}
for _quote_alias in QUOTE_DATE_SYNONYMS:
_ALIASES[_quote_alias] = "报价日期"
@@ -645,7 +650,11 @@ def shape_facts_for_chosen_mode(facts: dict[str, str] | None, business_line: str
def apply_quote_date_default(facts: dict[str, str]) -> dict[str, str]:
"""销售未提供报价日期时填当天;已有则不覆盖。"""
"""
海运、陆运:销售未提供报价日期时填上海当天;已有则不覆盖。
空运不要走这里。空运没说日期必须保持空白,不能填成当天。
"""
merged = dict(facts)
if not merged.get("报价日期"):
merged["报价日期"] = shanghai_today()
@@ -730,13 +739,17 @@ def validate_required_fields(
"""
首次查价完整性。
返回:ok / implemented / missing(内部键)/ missing_display / facts(含默认报价日期)/ errors。
报价日期不进 missing。未识别业务线时 missing 为空、need_transport_mode=True。
返回:ok / implemented / missing(内部键)/ missing_display / facts / errors。
报价日期不进 missing。海运、陆运没说则 facts 里带上当天;空运没说则保持空白。
未识别业务线时 missing 为空、need_transport_mode=True,此时不填日期。
"""
_ = require_formal
contract = require_formal_contract("inquiry-required-fields-v1")
normalized = peel_trailing_place_clauses(apply_quote_date_default(normalize_facts(facts)))
normalized = peel_trailing_place_clauses(normalize_facts(facts))
line = (business_line or "").strip().upper()
# 只有海运、陆运把空日期补成当天。空运留给销售稍后在舱位里选定航班日期。
if line in {"SEA", "LAND"}:
normalized = apply_quote_date_default(normalized)
if line == "SEA":
normalized = project_sea_cargo_qty(normalized)
from agent.schema.sea_options import canonicalize_sea_class