feat(oa): 新增审批异常状态的统计与通知

1. 为请假、加班审批流程新增异常状态分类统计和专属报告清单
2. 完善审批提交弹窗选择兼容逻辑,适配多类型确认弹窗
3. 提交失败时自动将单据标记为异常状态并记录原始结论
4. 推送摘要中新增异常审批条目展示
This commit is contained in:
2026-08-20 21:45:44 +08:00
parent 250cfc5eb7
commit cfb4c935da
5 changed files with 63 additions and 374 deletions
+8 -2
View File
@@ -102,9 +102,10 @@ def build_push_summary(results: list, subject: str = "") -> str:
rejected = [r for r in results if r.get("decision") == "驳回"]
review = [r for r in results if r.get("decision") == "人工复核"]
overdue = [r for r in results if r.get("decision") == "超期"]
abnormal = [r for r in results if r.get("decision") == "异常"]
failed = [r for r in results if r.get("decision") == "失败"]
if not passed and not rejected and not review and not overdue:
if not passed and not rejected and not review and not overdue and not abnormal:
return ""
def _item(r):
@@ -114,7 +115,7 @@ def build_push_summary(results: list, subject: str = "") -> str:
vtype = info.get("假期类型") or info.get("加班类型") or ""
return f"{title}-{vtype}" if vtype else title
all_pass = (not rejected and not review and not overdue and not failed)
all_pass = (not rejected and not review and not overdue and not abnormal and not failed)
lines = []
if all_pass:
@@ -147,6 +148,11 @@ def build_push_summary(results: list, subject: str = "") -> str:
for r in overdue:
lines.append(_item(r))
lines.append(f"处理原因:{r.get('note') or r.get('error') or '未知'}")
if abnormal:
lines.append(f"审批异常 {len(abnormal)} 条,分别是:")
for r in abnormal:
lines.append(_item(r))
lines.append(f"详情页:{r.get('detail_url') or '无'}")
if failed:
lines.append(f"另有处理失败 {len(failed)} 条,请查看日志。")