补齐成交跟进:按线路推成交通知、收下未成交原因、协商中按工作日再问。
成交走询价消息服务;陆运/海运私聊下一句能记下原因;协商中回执写明顺延三个工作日和下次 9:00。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -43,6 +43,15 @@ class ChannelRuntime:
|
||||
secret=settings.wecom_secret,
|
||||
agent_id=agent_id,
|
||||
)
|
||||
notify_id = int(getattr(settings, "wecom_notify_agent_id", "") or "0") or 0
|
||||
notify_secret = str(getattr(settings, "wecom_notify_secret", "") or "").strip()
|
||||
self._notify_client = None
|
||||
if notify_id and notify_secret:
|
||||
self._notify_client = WeComAppClient(
|
||||
corp_id=settings.wecom_corp_id,
|
||||
secret=notify_secret,
|
||||
agent_id=notify_id,
|
||||
)
|
||||
|
||||
@property
|
||||
def store(self):
|
||||
@@ -105,10 +114,20 @@ class ChannelRuntime:
|
||||
logger.warning("outbox 过期丢弃 id=%s", item.id)
|
||||
self._store.complete_outbound(item.id)
|
||||
continue
|
||||
result = self._client.send_outbound(
|
||||
payload = getattr(item, "payload", None) or {}
|
||||
client = self._client
|
||||
if payload.get("wecom_app") == "notify":
|
||||
if self._notify_client is None:
|
||||
logger.error("询价消息服务未配置,成交通知丢弃 id=%s", item.id)
|
||||
self._store.complete_outbound(
|
||||
item.id, error="notify_app_missing", permanent=True
|
||||
)
|
||||
continue
|
||||
client = self._notify_client
|
||||
result = client.send_outbound(
|
||||
touser=item.touser,
|
||||
content=item.content,
|
||||
payload=getattr(item, "payload", None) or {},
|
||||
payload=payload,
|
||||
)
|
||||
if result.ok:
|
||||
self._store.complete_outbound(item.id)
|
||||
|
||||
Reference in New Issue
Block a user