员工岗位可重新启用;调价认空运航线;会话存档跳号补拉;陆运报价按车型列回填

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
linmianxun
2026-10-28 19:48:47 +08:00
co-authored by Cursor
parent 2b528758b4
commit 56ba8e93b5
62 changed files with 2960 additions and 793 deletions
@@ -156,6 +156,7 @@ def _drop_other_mode_drafts(*, owner: str, sender_id: str) -> None:
def _flow_waiting_lost_reason(sender_id: str, sea, air, land):
"""谁在等未成交原因就交给谁。刚记下未成交的那条优先。"""
from agent.policy.deal_outcome import ticket_missing_in_ledger
from agent.policy.handoff_human import is_handoff_frozen
waiting = []
@@ -165,6 +166,20 @@ def _flow_waiting_lost_reason(sender_id: str, sea, air, land):
continue
if (sess.phase or "").strip() != "wait_lost_reason":
continue
# 清数后主账无单:丢掉孤儿书签,不要继续抢走新询价。
if ticket_missing_in_ledger(
getattr(flow, "_ledger", None),
work_order_no=str(getattr(sess, "work_order_no", "") or ""),
sender_id=sender_id,
):
abandon = getattr(flow, "abandon_orphan_lost_wait", None)
if callable(abandon):
abandon(sess)
else:
drop = getattr(flow, "drop_current_bookmark", None)
if callable(drop):
drop(sender_id)
continue
waiting.append((int(getattr(sess, "wait_version", 0) or 0), flow))
if not waiting:
return None