feat(invoice-check): 通过invoice号反查tghx的采购单,生成PO订单

This commit is contained in:
sophie committed 2026-09-15 16:15:08 +08:00
1 parent 1c34ab962f
commit 40cead7430
27 files changed
+792 -74

No files matched your search

@@ -1,9 +1,9 @@
"""
backend/app/services/voucher_check/notification.py
用途:立账凭证检核批次级企微汇总与技术失败告警。
用途:立账凭证检核缺件汇总、以及检核 / PO 生成排程的技术失败告警。
依赖:wecom_notify、ScheduleTask.notify_user_ids_json、engine_persistence。
逻辑:一个批次一条缺件汇总;未配置接收人不发送;设置 domain_notification_managed 避免通用排程重复通知。
逻辑:检核批次一条缺件汇总;PO 生成只在技术失败时告警;未配置接收人不发送;domain_notification_managed 避免通用排程重复通知。
"""
from __future__ import annotations
@@ -186,8 +186,14 @@ def send_failure_alert(
error_code: str,
error_message: str,
enabled: bool,
title: str | None = None,
) -> None:
"""批次级技术失败告警(ERP/DMS/配置异常),不计入缺件通知。"""
"""
批次级技术失败告警(ERP/DMS/配置/上传异常),不计入缺件通知。
Args:
title: 企微标题;默认「立账凭证检核失败」。PO 生成排程传入自己的标题。
"""
if not enabled:
return
if not current_app.config.get("WECOM_NOTIFY_ENABLED", True):
@@ -203,7 +209,7 @@ def send_failure_alert(
if not users:
return
title = f"立账凭证检核失败: {task.name}"
title = title or f"立账凭证检核失败: {task.name}"
description = (
f"批次 {run.run_no}\n"
f"失败阶段:{stage}\n"