让成交卡等报价文件真正发出后再出现,并收紧 PDF 顶部留白,避免抬头被裁或空一截。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-15 10:36:55 +08:00
co-authored by Cursor
parent cb3bf5238b
commit a7a8487eb3
22 changed files with 1630 additions and 126 deletions
+4 -2
View File
@@ -1,5 +1,5 @@
"""
意图:询价卡片按钮(跳过协同 / 采用 / 不采用 / 成交)。
意图:询价卡片按钮(复制工单号 / 跳过协同 / 采用 / 不采用 / 成交)。
本文件职责:校验当前会话允许的动作后交给流程执行。
禁止:不校验 wait/允许集合就改主账;禁止一个函数处理未声明的新按钮。
@@ -44,7 +44,7 @@ def handle_card_action(
msg_store = store or get_message_store()
def reply(text: str, extra: dict | None = None) -> None:
def reply(text: str, extra: dict | None = None) -> str:
# 销售询价正文不加 [test];[test] 只给运维告警
body = text
extra = dict(extra or {})
@@ -65,6 +65,8 @@ def handle_card_action(
)
if not ok:
logger.warning("card 出站被去重 sender=%s wo=%s info=%s", sender_id, wo or "-", info)
return ""
return info
return engine.on_button(
sender_id=sender_id, action=action, reply=reply, card_meta=payload
@@ -37,7 +37,7 @@ def handle_continue_thread(
engine = flow or get_air_text_flow()
replies: list[str] = []
def reply(text: str, extra: dict | None = None) -> None:
def reply(text: str, extra: dict | None = None) -> str:
replies.append(text)
ok, info = msg_store.enqueue_outbound(
touser=message.sender_id,
@@ -46,6 +46,7 @@ def handle_continue_thread(
payload=dict(extra or {}),
)
logger.info("continue_thread 出站 ok=%s info=%s", ok, info)
return info if ok else ""
wo = (thread_id or "").strip() or copy.extract_work_order_no(message.content or "")
phase = engine.resume_historical(
+2 -1
View File
@@ -42,7 +42,7 @@ def handle_text_inquiry(
engine = flow or get_air_text_flow()
replies: list[str] = []
def reply(text: str, extra: dict | None = None) -> None:
def reply(text: str, extra: dict | None = None) -> str:
# 销售询价正文不加 [test];[test] 只给运维告警
body = text
replies.append(body)
@@ -53,6 +53,7 @@ def handle_text_inquiry(
payload=dict(extra or {}),
)
logger.info("text_inquiry 出站 ok=%s info=%s phase_reply=%s", ok, info, body[:80])
return info if ok else ""
phase = engine.on_text(
sender_id=message.sender_id,