落地空运单聊询价字段与线路选择。

必填核对后再建单;多条线路走 H5 点选;费用只展示该线路 TMS 回包,不套用整单空运费。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-22 15:02:32 +08:00
co-authored by Cursor
parent 8afe909230
commit cfbce2fd69
53 changed files with 3470 additions and 372 deletions
+31 -7
View File
@@ -2,6 +2,8 @@
空运查价参数:对照 TMS V2 /quote/v2/query 是否带全。
本文件职责:询价卡片出现前,确认销售侧空运必填能拼出查价正文。
起运港非必填。货源地/货好时间/提货地址/收货地址有值才带出站键。
贸易条款只留中文键给工单,禁止投影成 transportTerms。
三字码能投影就带;对不上不拦建单、不拦查价。
包装:销售原文非空即收下,禁止白名单拦补问。
禁止:猜没写过的港口;因「对不上字典」跳过 TMS 或对销售说教;改六态。
@@ -35,8 +37,7 @@ _AIRPORTS = {
"北京": "PEK",
}
# TMS air_packaging_type 实测只认 1/2/3。1=全部,这条航线无价;
# 2/3 能出与现网相同的标准价。托盘走 2,纸箱/木箱走 3。
# 历史字典:只给对照,空运出站不再编成 1/2/3。
_PACKS = {
"全部": "1",
"托盘": "2",
@@ -170,10 +171,7 @@ def assemble_air_query(facts: dict[str, Any] | None) -> dict[str, Any]:
missing: list[str] = []
missing_display: list[str] = []
# 销售侧必填只看 8 项是否非空。三字码是出站投影,对不上不拿来再补问起运地/目的地。
if not origin:
missing.append("起运港")
missing_display.append("起运地")
# 起运港改为非必填:空着仍可查价。三字码是出站投影,对不上不拿来再补问。
if not dest:
missing.append("目的港")
missing_display.append("目的地")
@@ -204,6 +202,8 @@ def assemble_air_query(facts: dict[str, Any] | None) -> dict[str, Any]:
out_facts["originCode"] = origin_code
else:
out_facts.pop("originCode", None)
else:
out_facts.pop("originCode", None)
if dest:
out_facts["目的港"] = dest
if dest_code:
@@ -220,10 +220,34 @@ def assemble_air_query(facts: dict[str, Any] | None) -> dict[str, Any]:
if str(src.get("体积") or "").strip():
out_facts["体积"] = str(src.get("体积")).strip()
if pack_raw:
# 包装出站跟销售原文:输入托盘就传托盘,禁止编成 2。
out_facts["包装方式"] = pack_raw
out_facts["packageType"] = pack_code
out_facts["packageType"] = pack_raw
if quote_date:
out_facts["报价日期"] = quote_date
# 非必填有值才投影出站键;贸易条款禁止写成 TMS 条款字段。
source_place = str(src.get("货源地") or "").strip()
ready = str(src.get("货好时间") or "").strip()
pickup = str(src.get("提货地址") or "").strip()
delivery = str(src.get("收货地址") or "").strip()
trade = str(src.get("贸易条款") or "").strip()
if source_place:
out_facts["货源地"] = source_place
out_facts["cargoSource"] = source_place
if ready:
out_facts["货好时间"] = ready
out_facts["cargoReadyDate"] = ready
if pickup:
out_facts["提货地址"] = pickup
out_facts["placeOfReceipt"] = pickup
if delivery:
out_facts["收货地址"] = delivery
out_facts["deliveryAddress"] = delivery
if trade:
out_facts["贸易条款"] = trade
out_facts.pop("tradeTerms", None)
out_facts.pop("transportTerms", None)
out_facts.pop("trade_terms", None)
logger.info(
"tms.air.assemble ok=%s origin=%s dest=%s pack=%s missing=%s",