空运附件报价锁舱前先提示航线改发纯文字报价,避免附件金额拆不出导致锁舱失败。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
linmianxun
2026-10-13 14:56:09 +08:00
co-authored by Cursor
parent 0b2f0b76c4
commit dda210c219
3 changed files with 105 additions and 3 deletions
+60 -1
View File
@@ -3273,13 +3273,72 @@ def air_lock_fail(*, work_order_no: str, operator: str, reason: str) -> str:
)
def air_text_quote_for_lock_example(work_order_no: str = "") -> str:
"""
需要锁舱时,请航线用纯文字报价的示例句。
附件报价不拆金额、常锁不成;产品口径改为引导航线改发文字价。
"""
no = (work_order_no or "").strip() or "工单号"
return f"{no},空运段,空运费 单价CNY99.00,数量100 ,金额CNY9900.00@询价小助手"
def air_attachment_quote_lock_tip(*, work_order_no: str) -> str:
"""
航线刚发完 Excel/PDF 附件报价后的提示。
附件只存档、不拆费用;若还要锁舱,必须再发一版纯文字报价。
"""
no = (work_order_no or "").strip() or "WO"
example = air_text_quote_for_lock_example(no)
return (
f"工单{no}附件报价已收。\n"
"如需锁舱,请航线人员改用纯文字报价(不要只发附件),例如:\n"
f"{example}"
)
def air_lock_need_text_quote(*, work_order_no: str, operator: str = "", reason: str = "") -> str:
"""
附件/手工报价锁舱走不通时:引导航线先发文字报价,不算系统异常、不通知 IT。
故意不回主账/TMS 原文「原因」(如 AIR-OPT / 运价库无匹配),只留文字报价指引。
reason 参数保留兼容旧调用,出站话术不用。
"""
_ = reason
no = (work_order_no or "").strip() or "WO"
who = (operator or "").strip()
lines = [f"工单{no} 还不能锁舱。"]
if who:
lines.append(f"操作人:{who}")
lines.append("如需锁舱,请航线人员先发纯文字报价,例如:")
lines.append(air_text_quote_for_lock_example(no))
lines.append("文字报价写入后再发锁舱口令(可带舱位、航司、航班号)。")
return "\n".join(lines)
def air_lock_incomplete(*, work_order_no: str, operator: str, reason: str = "") -> str:
"""
锁舱参数不齐(纯手工价、运价库无舱位等):业务补问,不算系统异常,不惊动 IT。
航线按示例回舱位+航司+航班后即可再锁。
附件/无舱位场景改引导纯文字报价;有 TMS 舱位时仍可补 AIR-OPT 三项。
"""
why = (reason or "").strip()
blob = why
if any(
x in blob
for x in (
"手工报价",
"附件",
"无匹配舱位",
"无匹配报价",
"运价库无匹配",
"标准运价库无匹配",
)
):
return air_lock_need_text_quote(
work_order_no=work_order_no, operator=operator, reason=why
)
lines = [
f"工单{work_order_no} 还不能锁舱。",
f"操作人:{operator}",