空运附件报价锁舱前先提示航线改发纯文字报价,避免附件金额拆不出导致锁舱失败。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -699,6 +699,9 @@ def apply_air_file(
|
||||
from agent.policy.event_exception import clear_wait
|
||||
|
||||
clear_wait(flow.ledger, work_order_no=no)
|
||||
# 附件不拆金额:锁舱常失败。产品口径改为提示航线改发纯文字报价后再锁。
|
||||
tip = copy.air_attachment_quote_lock_tip(work_order_no=no)
|
||||
send_group_text(client, chat_id, tip)
|
||||
emit_group_deal(flow=flow, ticket=view, quote=quote)
|
||||
return "airline_file_quote"
|
||||
|
||||
@@ -952,7 +955,8 @@ def apply_air_lock(
|
||||
return "no_quote"
|
||||
# 主账在出站前发现三项不齐:只请补,不当 TMS 故障,不通知 IT。
|
||||
reason_text = str(out.get("failReason") or "")
|
||||
if str(out.get("error") or "") == "lock_params_incomplete" or "锁舱参数不完整" in reason_text:
|
||||
err_code = str(out.get("error") or "")
|
||||
if err_code == "lock_params_incomplete" or "锁舱参数不完整" in reason_text:
|
||||
labels = missing or _labels_from_incomplete_reason(reason_text)
|
||||
_remember_partial_lock(
|
||||
flow,
|
||||
@@ -964,8 +968,45 @@ def apply_air_lock(
|
||||
)
|
||||
send_group_text(group_client_of(flow), chat_id, copy.air_lock_need_params(labels))
|
||||
return "wait_lock_params"
|
||||
# 附件/手工报价、运价库无舱位:引导纯文字报价,不算系统异常、不通知 IT。
|
||||
src_label = str((quote or {}).get("source_label") or (quote or {}).get("source") or "")
|
||||
need_text_quote = (
|
||||
err_code in {"lock_incomplete", "lock_fail"}
|
||||
and (
|
||||
"航线附件报价" in src_label
|
||||
or "附件" in src_label
|
||||
or any(
|
||||
x in reason_text
|
||||
for x in (
|
||||
"手工报价",
|
||||
"无匹配舱位",
|
||||
"无匹配报价",
|
||||
"运价库无匹配",
|
||||
"标准运价库无匹配",
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
if need_text_quote:
|
||||
send_group_text(
|
||||
group_client_of(flow),
|
||||
chat_id,
|
||||
copy.air_lock_need_text_quote(
|
||||
work_order_no=no, operator=name, reason=reason_text
|
||||
),
|
||||
)
|
||||
return "need_text_quote"
|
||||
if err_code == "lock_incomplete":
|
||||
send_group_text(
|
||||
group_client_of(flow),
|
||||
chat_id,
|
||||
copy.air_lock_incomplete(
|
||||
work_order_no=no, operator=name, reason=reason_text
|
||||
),
|
||||
)
|
||||
return "lock_incomplete"
|
||||
# 多段是产品限制,不是 TMS 故障。只回原因,不标系统异常、不暂停工单。
|
||||
if str(out.get("error") or "") == "multi_no_lock":
|
||||
if err_code == "multi_no_lock":
|
||||
send_group_text(
|
||||
group_client_of(flow),
|
||||
chat_id,
|
||||
|
||||
Reference in New Issue
Block a user