refactor(yingdao): 重构钉钉推送逻辑,新增VC运行库自包含支持

1.  重构钉钉推送模块:改为接收元组列表参数,移除群消息推送逻辑,拆分单聊/群推送职责
2.  新增VC运行库自动加载逻辑,解决onnxruntime依赖运行库缺失问题
3.  升级依赖包版本并做兼容性降级适配,统一numpy/opencv/onnxruntime版本
4.  更新考勤异常、离职审批脚本及文档,适配新的推送参数格式
This commit is contained in:
2026-08-23 21:20:03 +08:00
parent 5849c1b90f
commit 30611f651b
7 changed files with 270 additions and 147 deletions
+20
View File
@@ -35,6 +35,26 @@ from datetime import datetime, timedelta
from typing import Callable
from urllib.parse import urlencode, urlparse, parse_qs
# ==================== VC++ 运行库预加载(自包含,目标机免装运行库) ====================
# onnxruntime 强依赖新版 MSVC 运行库 DLL(msvcp140*.dll / vcruntime140*.dll),缺失会报
# "onnxruntime DLL 初始化例程失败(1114)"。这里把随包分发的运行库目录加入 DLL 搜索路径,
# 这样任何机型只要带了 vc_redist 目录即可运行,无需手动安装 VC++ 2015-2022 运行库。
def _load_vc_redist():
candidates = [
os.path.join(os.path.dirname(os.path.abspath(__file__)), 'vc_redist'), # 与脚本同目录
os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '..', 'vc_redist')), # 项目根目录
os.path.join(
os.getenv('LOCALAPPDATA') or os.getenv('APPDATA') or os.path.expanduser('~'),
'37duAutomation', 'vc_redist'), # 影刀共享数据目录
]
for _dir in candidates:
if os.path.isdir(_dir):
try:
os.add_dll_directory(_dir)
except Exception:
pass
_load_vc_redist()
# ==================== 第三方库导入(影刀版启动校验:全部必须预先安装,不懒加载) ====================
# 任一依赖缺失会立即报错退出,避免运行到中途才发现缺库
try: