fix: 有价先发出价格明细文字再发卡
避免卡片写详见上一条时销售却先看到卡。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -11,6 +11,7 @@ from __future__ import annotations
|
||||
|
||||
import logging
|
||||
import threading
|
||||
import time
|
||||
from typing import Any, Optional
|
||||
|
||||
from agent.ledger.http_ledger import HttpLedger
|
||||
@@ -41,6 +42,8 @@ class SeaTextInquiryFlow(AirTextInquiryFlow):
|
||||
"""
|
||||
|
||||
bookmark_kind = "sea"
|
||||
# 价格明细文字发出后稍等再发卡,避免企微先画出卡片。
|
||||
_detail_before_card_gap_sec = 0.8
|
||||
|
||||
def __init__(self, ledger: Any = None, group_client: Any = None) -> None:
|
||||
super().__init__(ledger=ledger)
|
||||
@@ -376,16 +379,18 @@ class SeaTextInquiryFlow(AirTextInquiryFlow):
|
||||
business_line: str = "",
|
||||
) -> None:
|
||||
"""
|
||||
先发完整价格明细文本,再发带按钮的卡。
|
||||
先发完整价格明细文本,等它真正发出,再发带按钮的卡。
|
||||
|
||||
企微只发卡时,引用条超长会被截断;文本不受限。
|
||||
测服 WO202609200020:文字和卡同一拍入队,销售先看到卡,
|
||||
「详见上一条明细」对不上。只等这一条出站,不锁其它工单。
|
||||
"""
|
||||
line = (business_line or getattr(self, "business_line", "") or "SEA").upper()
|
||||
if line not in {"SEA", "LAND"}:
|
||||
line = "SEA"
|
||||
src = dict(quote or {})
|
||||
src["business_line"] = line
|
||||
reply(
|
||||
out_id = reply(
|
||||
copy.sea_quote_detail_text(
|
||||
work_order_no=work_order_no,
|
||||
quote=src,
|
||||
@@ -394,7 +399,13 @@ class SeaTextInquiryFlow(AirTextInquiryFlow):
|
||||
status=status,
|
||||
business_line=line,
|
||||
)
|
||||
) or ""
|
||||
self._wait_outbound_sent(
|
||||
str(out_id), work_order_no=work_order_no, what="价格明细文本"
|
||||
)
|
||||
gap = float(getattr(self, "_detail_before_card_gap_sec", 0.8) or 0)
|
||||
if out_id and gap > 0:
|
||||
time.sleep(gap)
|
||||
reply(
|
||||
copy.sea_tms_hit_card(
|
||||
work_order_no=work_order_no,
|
||||
|
||||
Reference in New Issue
Block a user