新增失败预警功能

This commit is contained in:
z66
2025-12-11 09:52:59 +08:00
parent 1e83d5b19a
commit 70c375a34e
3 changed files with 199 additions and 158 deletions
+22
View File
@@ -117,6 +117,28 @@ def approve_workflow(data: Dict[str, Any]):
logger.error(f"简道云工作流任务提交失败: {e}")
def execute_failure_handler(data: Dict[str, Any]):
"""
简道云失败流程通知
函数执行失败时调用,通过钉钉webhook通知到指定人员
"""
now = time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime())
pay_load = {
"api_key":"6694d3c4fcb69ca9a111a6c4",
"entry_id":"6938e011b360a1132522a62a",
"data": {
"_widget_1765335060501": {"value": now}, # 失败时间
"_widget_1765335060502": {"value": data['failure_name']}, # 任务名称
"_widget_1765335060503": {"value": data['failure_details']} # 失败明细
}
}
api_instance.data_batch_create(pay_load)
def get_operate_org_id(cookies: Dict[str, str]) -> Optional[str]:
"""
获取操作门店ID