重启后仍能跳过协同出方案,未成交可同一句带原因;海陆有价卡改为直接生成报价单。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-23 18:45:28 +08:00
co-authored by Cursor
parent 378bb892b3
commit 84207bb4e5
18 changed files with 414 additions and 32 deletions
+13 -3
View File
@@ -609,6 +609,7 @@ def apply_air_deal(
sender_id: str,
outcome: str,
chat_id: str,
text: str = "",
) -> str:
if not is_sales(ticket, sender_id):
send_group_text(group_client_of(flow), chat_id, copy.air_sales_only_deal())
@@ -616,10 +617,11 @@ def apply_air_deal(
stopped = halt_closed_group(flow=flow, ticket=ticket, chat_id=chat_id)
if stopped:
return stopped
from agent.policy.deal_outcome import finish_deal_outcome
from agent.policy.deal_outcome import finish_deal_outcome, harvest_inline_lost_reason
from agent.policy.sea_group_ops import facts_of_group
view = ticket_view(ticket)
inline = harvest_inline_lost_reason(text) if outcome == "未成交" else ""
result = finish_deal_outcome(
ledger=flow.ledger,
work_order_no=ticket_no(ticket),
@@ -628,16 +630,24 @@ def apply_air_deal(
quote=dict(view.get("quote") or {}),
business_line="AIR",
sales_name=str(view.get("sales_name") or ""),
lost_reason=inline,
)
if not result.get("ok"):
send_group_text(group_client_of(flow), chat_id, "主账状态更新失败,成交结果未入账。")
return "ledger_fail"
phase = str(result.get("phase") or "done")
ack_reason = inline if phase == "done" and outcome == "未成交" else ""
send_group_text(
group_client_of(flow),
chat_id,
copy.deal_ack(outcome, ticket_no(ticket), str(result.get("next_followup_at") or "")),
copy.deal_ack(
outcome,
ticket_no(ticket),
str(result.get("next_followup_at") or ""),
lost_reason=ack_reason,
),
)
return str(result.get("phase") or "done")
return phase
def apply_air_lock(