陆运补问把货物品名放进选项清单,并按销售原文回显已填项。

空着的运输分类不再被菜单第一项认成已填。空运报价改为货物信息加价格方案,锁舱成功回执补起运地、目的地、航司和航班日期。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-14 17:39:54 +08:00
co-authored by Cursor
parent cc8529f569
commit 9ffba70741
21 changed files with 1129 additions and 130 deletions
+11 -3
View File
@@ -1,7 +1,7 @@
"""
陆运文字询价确定性流程。
本文件职责:三项选项各自必填(不联动)→ 按类型补货物 → 无工单号核对卡 →(确定后)建单查 TMS。
本文件职责:三项选项和货物品名同一张清单各自必填(不联动)→ 按类型补始发站等货物 → 无工单号核对卡 →(确定后)建单查 TMS。
查价后:1 条完整线路直接出价格明细;多于 1 条发入口卡,H5 选定后再出该条明细。
查价后半段复用海运拉群/报价单/成交,拉人按线路类别,禁止陆运岗全员。
禁止:字段齐了就建单;直连 TMS;把中转段当成另一条线路。海运私聊同样是核对后确定再查价。
@@ -27,7 +27,10 @@ from agent.policy.air_text_flow import (
from agent.policy.sea_text_flow import SeaTextInquiryFlow
from agent.schema.field_validate import harvest_oral_measures, validate_required_fields
from agent.schema.land_options import (
drop_blank_paste_options,
drop_land_prompt_echo,
harvest_land_options,
land_cargo_name,
looks_like_confirm,
option_prompt,
sample_pair_allowed,
@@ -170,6 +173,8 @@ class LandTextInquiryFlow(SeaTextInquiryFlow):
)
if b_opt:
facts = harvest_land_options(b_opt, facts)
# 复制清单冒号空着的项,菜单文字和模型猜测都不能当成已填。
facts = drop_blank_paste_options(facts, source)
if not mode:
mode = "LAND" if (sess and (sess.business_line or "").upper() == "LAND") else ""
@@ -313,7 +318,7 @@ class LandTextInquiryFlow(SeaTextInquiryFlow):
created = self._ledger.create_ticket(
sender_id=sender_id,
business_line="LAND",
facts=facts,
facts=drop_land_prompt_echo(facts),
idempotency_key=f"create:{sender_id}:{uuid.uuid4().hex}",
)
no = str(created.get("work_order_no") or "").strip()
@@ -582,7 +587,8 @@ class LandTextInquiryFlow(SeaTextInquiryFlow):
merged.update(opt.get("normalized") or {})
if opt.get("errors"):
return {"ready": False, "opt": opt, "facts": merged, "stage": "options_error"}
if not opt.get("ok"):
# 货物品名和三项同一张清单。没填上继续发这张,不挪到始发站补问。
if not opt.get("ok") or not land_cargo_name(merged):
return {"ready": False, "opt": opt, "facts": merged, "stage": "options_missing"}
land_type = (merged.get("运输类型") or "").strip()
check = validate_required_fields(
@@ -658,6 +664,8 @@ class LandTextInquiryFlow(SeaTextInquiryFlow):
return "need_land_options"
if state["stage"] == "options_missing":
keys = list((state.get("opt") or {}).get("missing") or [])
if not land_cargo_name(facts):
keys.append("品名")
logger.info("land.options_missing missing=%s", keys)
new_sess = FlowSession(
sender_id=sender_id,