请假推送公司、职务等相关信息

This commit is contained in:
runny committed 2026-05-19 16:34:16 +08:00
1 parent fed57cc3cf
commit 51b466d4ab
4 files changed
+116 -24

No files matched your search

+8 -2
View File
@@ -118,6 +118,9 @@ class HRLeaveSQLServerService:
raise RuntimeError("pyodbc 未安装,无法连接 HR SQL Server") from exc
driver = os.getenv("HR_SQLSERVER_DRIVER", "").strip() or cls._pick_driver(pyodbc)
available_drivers = pyodbc.drivers()
if driver not in available_drivers:
driver = cls._pick_driver(pyodbc)
server = os.getenv("HR_SQLSERVER_HOST", "192.168.100.191").strip()
port = os.getenv("HR_SQLSERVER_PORT", "1433").strip()
database = os.getenv("HR_SQLSERVER_DATABASE", "NH_N8_HEXIN").strip()
@@ -133,9 +136,12 @@ class HRLeaveSQLServerService:
f"DATABASE={database};"
f"UID={username};"
f"PWD={password};"
f"Encrypt={encrypt};"
f"TrustServerCertificate={trust_cert};"
)
if driver != "SQL Server":
conn_str += (
f"Encrypt={encrypt};"
f"TrustServerCertificate={trust_cert};"
)
return pyodbc.connect(conn_str, timeout=timeout)
@staticmethod