This commit is contained in:
aaron 2025-02-24 11:37:51 +08:00
parent 7c1e702d6e
commit 3353b88431

View File

@ -152,7 +152,7 @@ class WecomBot:
print(f"发送异常: {str(e)}") print(f"发送异常: {str(e)}")
return False return False
def send_order_notification(self,db: Session, shipping_order: ShippingOrderDB, notify_type: OrderStatus = OrderStatus.CREATED) -> bool: async def send_order_notification(self,db: Session, shipping_order: ShippingOrderDB, notify_type: OrderStatus = OrderStatus.CREATED) -> bool:
""" """
发送订单通知 发送订单通知
@ -174,7 +174,7 @@ class WecomBot:
webhook = community.webot_webhook webhook = community.webot_webhook
if not webhook: if not webhook:
raise ValueError("不支持的通知类型") return False
deliveryman = None deliveryman = None
if shipping_order.deliveryman_user_id: if shipping_order.deliveryman_user_id:
@ -220,7 +220,7 @@ class WecomBot:
> 电话: {deliveryman.phone[:3]}\*\*\*\*{deliveryman.phone[7:]} > 电话: {deliveryman.phone[:3]}\*\*\*\*{deliveryman.phone[7:]}
""" """
return self.send_markdown(content, webhook) return await self.send_markdown(content, webhook)
except Exception as e: except Exception as e:
logging.exception(f"发送企业微信消息失败: {str(e)}") logging.exception(f"发送企业微信消息失败: {str(e)}")