Merge branch 'dev' into test
This commit is contained in:
commit
2d41fc3c6e
5 files changed
+296
-86
No files matched your search
@@ -3,16 +3,16 @@
|
|||||||
# Casdoor 做法 A:与 test/prod 共用同一 Casdoor 地址,但使用独立 Application「hxops-dev」
|
# Casdoor 做法 A:与 test/prod 共用同一 Casdoor 地址,但使用独立 Application「hxops-dev」
|
||||||
# 在 Casdoor 新建 Application,Redirect URLs 填入本环境实际会出现的前端 origin + /casdoor-callback
|
# 在 Casdoor 新建 Application,Redirect URLs 填入本环境实际会出现的前端 origin + /casdoor-callback
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
DATABASE_URL=postgresql://postgres:123456@8.152.207.171/hxops_db
|
DATABASE_URL=postgresql://hxops:1qaz%40WSX@127.0.0.1/hxops
|
||||||
FLASK_APP=run.py
|
FLASK_APP=run.py
|
||||||
FLASK_ENV=development
|
FLASK_ENV=development
|
||||||
|
|
||||||
# 是否启用 JWT 认证
|
# 是否启用 JWT 认证
|
||||||
AUTH_JWT_REQUIRED=true
|
AUTH_JWT_REQUIRED=true
|
||||||
|
|
||||||
AUTH_LOGIN_MODE=casdoor
|
AUTH_LOGIN_MODE=password
|
||||||
# 如果需要用户密码登录,修改该值为password
|
# 如果需要用户密码登录,修改该值为password
|
||||||
#AUTH_LOGIN_MODE=password
|
#AUTH_LOGIN_MODE=casdoor
|
||||||
|
|
||||||
AUTH_JWT_ISSUER=http://192.168.100.192:8870
|
AUTH_JWT_ISSUER=http://192.168.100.192:8870
|
||||||
AUTH_JWT_AUDIENCE=758be5fcba2df784fdb4
|
AUTH_JWT_AUDIENCE=758be5fcba2df784fdb4
|
||||||
@@ -30,3 +30,11 @@ CASDOOR_REDIRECT_URI=http://localhost:8881/casdoor-callback
|
|||||||
CASDOOR_SCOPE=openid profile email
|
CASDOOR_SCOPE=openid profile email
|
||||||
# Casdoor Providers → wecom(Name=wecom,与 prod 共用同一 Provider 即可)
|
# Casdoor Providers → wecom(Name=wecom,与 prod 共用同一 Provider 即可)
|
||||||
CASDOOR_WECOM_PROVIDER_HINT=wecom
|
CASDOOR_WECOM_PROVIDER_HINT=wecom
|
||||||
|
|
||||||
|
# PLM Oracle
|
||||||
|
PLM_ORACLE_HOST=192.168.0.11
|
||||||
|
PLM_ORACLE_PORT=1521
|
||||||
|
PLM_ORACLE_SID=orcl
|
||||||
|
PLM_ORACLE_USERNAME=PLM
|
||||||
|
PLM_ORACLE_PASSWORD=PLM
|
||||||
|
ORACLE_CLIENT_LIB_DIR=C:\Users\PC\Desktop\HX工作目录\0509\hxops\backend\oracle_client\instantclient_19_30
|
||||||
@@ -604,8 +604,11 @@ def chat_completions():
|
|||||||
return jsonify({'error': 'Missing user or agent context'}), 500
|
return jsonify({'error': 'Missing user or agent context'}), 500
|
||||||
|
|
||||||
from app.services.dify import DifyService
|
from app.services.dify import DifyService
|
||||||
|
from app.services.plm_oracle import PLMOracleService
|
||||||
|
|
||||||
if kb_type == 'ERP知识库':
|
if PLMOracleService.supports(query, agent):
|
||||||
|
generator = PLMOracleService.stream_chat(query, user, agent, conversation_id)
|
||||||
|
elif kb_type == 'ERP知识库':
|
||||||
from app.services.hr_leave_sqlserver import HRLeaveSQLServerService
|
from app.services.hr_leave_sqlserver import HRLeaveSQLServerService
|
||||||
from app.services.text2sql import Text2SQLService
|
from app.services.text2sql import Text2SQLService
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,280 @@
|
|||||||
|
import json
|
||||||
|
import os
|
||||||
|
import re
|
||||||
|
import time
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
|
from flask import current_app
|
||||||
|
|
||||||
|
from app.models import ChatLog, db
|
||||||
|
from app.services.text2sql import Text2SQLService
|
||||||
|
|
||||||
|
|
||||||
|
class PLMOracleService:
|
||||||
|
_ALLOWED_AGENT_NAMES = {"通用入口", "生产sop"}
|
||||||
|
_MAX_RESULT_ROWS = 50
|
||||||
|
_MATERIAL_PATTERN = re.compile(r"\b[A-Z0-9]+(?:-[A-Z0-9]+)+\b", re.IGNORECASE)
|
||||||
|
_EXPLICIT_LABEL_PATTERN = re.compile(
|
||||||
|
r"(?:料号|料號|物料料号|物料料號|物料编号|物料編號|part\s*(?:no|number)?)\s*[::]?\s*([A-Z0-9][A-Z0-9._-]{5,})",
|
||||||
|
re.IGNORECASE,
|
||||||
|
)
|
||||||
|
_RELATIONAL_SQL = """
|
||||||
|
select *
|
||||||
|
from bi_file endb
|
||||||
|
where endb.revisionguid in (
|
||||||
|
select bb.revisionguid
|
||||||
|
from (
|
||||||
|
select v.end1, b.*
|
||||||
|
from viewobject_0 v, NT_00064_0 str, NT_00016_0 cad, bi_file b
|
||||||
|
where v.name in ('ITEM-CAD2D$', 'ITEM-CAD3D$')
|
||||||
|
and str.viewfk = v.guid
|
||||||
|
and str.end2$master = cad.masterfk
|
||||||
|
and cad.latestrevision like '%m%'
|
||||||
|
and b.revisionguid = cad.guid
|
||||||
|
union
|
||||||
|
select v.end1, b.*
|
||||||
|
from viewobject_0 v, NT_00064_0 str, NT_00018_0 cad, bi_file b
|
||||||
|
where v.name in ('ITEM-CAD2D$', 'ITEM-CAD3D$')
|
||||||
|
and str.viewfk = v.guid
|
||||||
|
and str.end2$master = cad.masterfk
|
||||||
|
and cad.latestrevision like '%m%'
|
||||||
|
and b.revisionguid = cad.guid
|
||||||
|
union
|
||||||
|
select v.end1, b.*
|
||||||
|
from viewobject_0 v,
|
||||||
|
StructureObject_0 str,
|
||||||
|
document_0 doc,
|
||||||
|
bi_file b
|
||||||
|
where v.name in ('RelatedDoc')
|
||||||
|
and str.viewfk = v.guid
|
||||||
|
and str.end2$master = doc.masterfk
|
||||||
|
and doc.latestrevision like '%m%'
|
||||||
|
and b.revisionguid = doc.guid
|
||||||
|
) bb,
|
||||||
|
item_0 i
|
||||||
|
where bb.end1 = i.guid
|
||||||
|
and i.id = :item_id
|
||||||
|
and i.latestrevision like '%m%'
|
||||||
|
)
|
||||||
|
and endb.lastaccesstime is not null
|
||||||
|
"""
|
||||||
|
_FILENAME_SQL = """
|
||||||
|
select *
|
||||||
|
from bi_file
|
||||||
|
where upper(name) like :name_pattern
|
||||||
|
and lastaccesstime is not null
|
||||||
|
order by lastaccesstime desc nulls last
|
||||||
|
"""
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def supports(cls, query: str, agent) -> bool:
|
||||||
|
return bool(cls.extract_material_no(query) and cls._is_supported_agent(agent))
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def extract_material_no(cls, query: str) -> str | None:
|
||||||
|
text = str(query or "").strip().upper()
|
||||||
|
if not text:
|
||||||
|
return None
|
||||||
|
|
||||||
|
explicit = cls._EXPLICIT_LABEL_PATTERN.search(text)
|
||||||
|
if explicit:
|
||||||
|
return explicit.group(1).strip().upper()
|
||||||
|
|
||||||
|
direct_match = cls._MATERIAL_PATTERN.fullmatch(text)
|
||||||
|
if direct_match:
|
||||||
|
return direct_match.group(0).upper()
|
||||||
|
|
||||||
|
for match in cls._MATERIAL_PATTERN.finditer(text):
|
||||||
|
candidate = match.group(0).upper()
|
||||||
|
if any(ch.isalpha() for ch in candidate) and any(ch.isdigit() for ch in candidate):
|
||||||
|
return candidate
|
||||||
|
return None
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def _is_supported_agent(cls, agent) -> bool:
|
||||||
|
name = str(getattr(agent, "name", "") or "").strip().lower().replace(" ", "")
|
||||||
|
return name in cls._ALLOWED_AGENT_NAMES
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def _get_connect_kwargs() -> dict:
|
||||||
|
dsn = (os.getenv("PLM_ORACLE_DSN") or "").strip()
|
||||||
|
host = (os.getenv("PLM_ORACLE_HOST") or "192.168.0.11").strip()
|
||||||
|
port = int((os.getenv("PLM_ORACLE_PORT") or "1521").strip())
|
||||||
|
service_name = (os.getenv("PLM_ORACLE_SERVICE_NAME") or "").strip()
|
||||||
|
sid = (os.getenv("PLM_ORACLE_SID") or "orcl").strip()
|
||||||
|
|
||||||
|
kwargs = {
|
||||||
|
"user": (os.getenv("PLM_ORACLE_USERNAME") or "PLM").strip(),
|
||||||
|
"password": (os.getenv("PLM_ORACLE_PASSWORD") or "PLM").strip(),
|
||||||
|
}
|
||||||
|
if dsn:
|
||||||
|
kwargs["dsn"] = dsn
|
||||||
|
return kwargs
|
||||||
|
|
||||||
|
import oracledb
|
||||||
|
|
||||||
|
if service_name:
|
||||||
|
kwargs["dsn"] = oracledb.makedsn(host, port, service_name=service_name)
|
||||||
|
else:
|
||||||
|
kwargs["dsn"] = oracledb.makedsn(host, port, sid=sid)
|
||||||
|
return kwargs
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def _connect(cls):
|
||||||
|
try:
|
||||||
|
import oracledb
|
||||||
|
except ImportError as exc:
|
||||||
|
raise RuntimeError("oracledb 未安装,无法连接 PLM Oracle") from exc
|
||||||
|
|
||||||
|
oracle_client_dir = Text2SQLService._get_oracle_client_dir()
|
||||||
|
Text2SQLService._prepare_oracle_runtime_env(oracle_client_dir)
|
||||||
|
Text2SQLService._init_oracle_client(oracledb)
|
||||||
|
return oracledb.connect(**cls._get_connect_kwargs())
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def _execute_query(cls, sql: str, **params) -> tuple[list[str], list[tuple]]:
|
||||||
|
connection = cls._connect()
|
||||||
|
cursor = connection.cursor()
|
||||||
|
try:
|
||||||
|
cursor.execute(sql, params)
|
||||||
|
columns = [col[0] for col in cursor.description] if cursor.description else []
|
||||||
|
rows = cursor.fetchmany(cls._MAX_RESULT_ROWS + 1)
|
||||||
|
return columns, rows
|
||||||
|
finally:
|
||||||
|
try:
|
||||||
|
cursor.close()
|
||||||
|
finally:
|
||||||
|
connection.close()
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def _query_files(cls, material_no: str) -> tuple[list[str], list[tuple], str]:
|
||||||
|
try:
|
||||||
|
columns, rows = cls._execute_query(cls._RELATIONAL_SQL, item_id=material_no)
|
||||||
|
if rows:
|
||||||
|
return columns, rows, "relational"
|
||||||
|
except Exception as exc:
|
||||||
|
if current_app:
|
||||||
|
current_app.logger.warning("[plm-oracle] relational query failed for %s: %s", material_no, exc)
|
||||||
|
|
||||||
|
columns, rows = cls._execute_query(
|
||||||
|
cls._FILENAME_SQL,
|
||||||
|
name_pattern=f"{material_no.upper()}%",
|
||||||
|
)
|
||||||
|
return columns, rows, "filename_fallback"
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def _format_datetime(value) -> str:
|
||||||
|
if value is None:
|
||||||
|
return "-"
|
||||||
|
if isinstance(value, datetime):
|
||||||
|
return value.strftime("%Y-%m-%d %H:%M:%S")
|
||||||
|
return str(value)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def _format_size(value) -> str:
|
||||||
|
if value in (None, ""):
|
||||||
|
return "-"
|
||||||
|
try:
|
||||||
|
size = int(value)
|
||||||
|
except (TypeError, ValueError):
|
||||||
|
return str(value)
|
||||||
|
if size < 1024:
|
||||||
|
return f"{size} B"
|
||||||
|
if size < 1024 * 1024:
|
||||||
|
return f"{size / 1024:.1f} KB"
|
||||||
|
return f"{size / 1024 / 1024:.2f} MB"
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def _build_answer(cls, material_no: str, columns: list[str], rows: list[tuple]) -> str:
|
||||||
|
if not rows:
|
||||||
|
return f"已在 PLM 中查询料号 `{material_no}`,未找到符合条件的相关资料。"
|
||||||
|
|
||||||
|
overflow = len(rows) > cls._MAX_RESULT_ROWS
|
||||||
|
visible_rows = rows[: cls._MAX_RESULT_ROWS]
|
||||||
|
index_map = {name.upper(): idx for idx, name in enumerate(columns)}
|
||||||
|
|
||||||
|
def pick(row: tuple, column_name: str, default: str = "-") -> str:
|
||||||
|
idx = index_map.get(column_name.upper())
|
||||||
|
if idx is None or idx >= len(row):
|
||||||
|
return default
|
||||||
|
value = row[idx]
|
||||||
|
if column_name.upper() in {"CREATETIME", "LASTACCESSTIME"}:
|
||||||
|
return cls._format_datetime(value)
|
||||||
|
if column_name.upper() == "FILESIZE":
|
||||||
|
return cls._format_size(value)
|
||||||
|
return "-" if value in (None, "") else str(value)
|
||||||
|
|
||||||
|
lines = [
|
||||||
|
f"已在 PLM 中查询到料号 `{material_no}` 的相关资料,共返回 {len(visible_rows)} 条记录"
|
||||||
|
+ ("(仅展示前 50 条)" if overflow else "。"),
|
||||||
|
"",
|
||||||
|
"| 序号 | 文件名 | 扩展名 | 文件类型 | 文件大小 | 相对路径 | 最后访问时间 |",
|
||||||
|
"| --- | --- | --- | --- | --- | --- | --- |",
|
||||||
|
]
|
||||||
|
for idx, row in enumerate(visible_rows, start=1):
|
||||||
|
lines.append(
|
||||||
|
f"| {idx} | {pick(row, 'NAME')} | {pick(row, 'EXTENTIONNAME')} | {pick(row, 'FILETYPE')} | "
|
||||||
|
f"{pick(row, 'FILESIZE')} | {pick(row, 'RELATIVEPATH')} | {pick(row, 'LASTACCESSTIME')} |"
|
||||||
|
)
|
||||||
|
|
||||||
|
if overflow:
|
||||||
|
lines.extend(["", "如需查看更多结果,请进一步限定料号或资料范围。"])
|
||||||
|
return "\n".join(lines)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def stream_chat(cls, query: str, user, agent, conversation_id: str | None = None):
|
||||||
|
start_time = time.time()
|
||||||
|
final_conversation_id = conversation_id or f"plm_{int(time.time())}"
|
||||||
|
material_no = cls.extract_material_no(query)
|
||||||
|
|
||||||
|
try:
|
||||||
|
if not material_no:
|
||||||
|
raise RuntimeError("未识别到有效料号,请输入类似 F3-A12M290000019 的料号。")
|
||||||
|
|
||||||
|
yield f"data: {json.dumps({'event': 'message', 'answer': f'已识别料号 `{material_no}`,正在查询 PLM 资料,请稍候...\\n'}, ensure_ascii=False)}\n\n"
|
||||||
|
|
||||||
|
columns, rows, query_mode = cls._query_files(material_no)
|
||||||
|
answer = cls._build_answer(material_no, columns, rows)
|
||||||
|
latency = int((time.time() - start_time) * 1000)
|
||||||
|
|
||||||
|
chat_log_id = None
|
||||||
|
try:
|
||||||
|
chat_log = ChatLog(
|
||||||
|
user_id=user.id,
|
||||||
|
agent_id=agent.id,
|
||||||
|
conversation_id=final_conversation_id,
|
||||||
|
query=query,
|
||||||
|
answer=answer,
|
||||||
|
tokens_used=0,
|
||||||
|
latency=latency,
|
||||||
|
payload={
|
||||||
|
"material_no": material_no,
|
||||||
|
"row_count": min(len(rows), cls._MAX_RESULT_ROWS),
|
||||||
|
"query_mode": query_mode,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
db.session.add(chat_log)
|
||||||
|
db.session.commit()
|
||||||
|
chat_log_id = chat_log.id
|
||||||
|
except Exception as exc:
|
||||||
|
if current_app:
|
||||||
|
current_app.logger.error("Failed to log PLM chat: %s", exc)
|
||||||
|
db.session.rollback()
|
||||||
|
|
||||||
|
end_data = {
|
||||||
|
"event": "message_end",
|
||||||
|
"answer": answer,
|
||||||
|
"replace_answer": True,
|
||||||
|
"chat_log_id": chat_log_id,
|
||||||
|
"conversation_id": final_conversation_id,
|
||||||
|
}
|
||||||
|
yield f"data: {json.dumps(end_data, ensure_ascii=False)}\n\n"
|
||||||
|
except Exception as exc:
|
||||||
|
if current_app:
|
||||||
|
current_app.logger.exception("[plm-oracle] stream_chat failed query=%s", query)
|
||||||
|
error_data = {
|
||||||
|
"event": "error",
|
||||||
|
"message": str(exc) or "PLM 查询失败",
|
||||||
|
"conversation_id": final_conversation_id,
|
||||||
|
}
|
||||||
|
yield f"data: {json.dumps(error_data, ensure_ascii=False)}\n\n"
|
||||||
@@ -2,13 +2,11 @@ import json
|
|||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import time
|
import time
|
||||||
from pathlib import Path
|
|
||||||
from flask import current_app, has_app_context
|
from flask import current_app, has_app_context
|
||||||
|
|
||||||
class Text2SQLService:
|
class Text2SQLService:
|
||||||
_schema_text = None
|
_schema_text = None
|
||||||
_oracle_client_initialized = False
|
_oracle_client_initialized = False
|
||||||
_jdbc_driver_url = "https://repo1.maven.org/maven2/com/oracle/database/jdbc/ojdbc8/19.25.0.0/ojdbc8-19.25.0.0.jar"
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _backend_dir() -> str:
|
def _backend_dir() -> str:
|
||||||
@@ -195,78 +193,6 @@ class Text2SQLService:
|
|||||||
oracledb.init_oracle_client()
|
oracledb.init_oracle_client()
|
||||||
cls._oracle_client_initialized = True
|
cls._oracle_client_initialized = True
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def _jdbc_dir(cls) -> Path:
|
|
||||||
return Path(cls._backend_dir()) / "jdbc"
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def _ensure_jdbc_driver_jar(cls) -> str:
|
|
||||||
env_path = (os.getenv("ERP_JDBC_JAR") or "").strip()
|
|
||||||
if env_path and os.path.exists(env_path):
|
|
||||||
return env_path
|
|
||||||
|
|
||||||
jar_dir = cls._jdbc_dir()
|
|
||||||
jar_dir.mkdir(parents=True, exist_ok=True)
|
|
||||||
jar_path = jar_dir / "ojdbc8-19.25.0.0.jar"
|
|
||||||
if jar_path.exists():
|
|
||||||
return str(jar_path)
|
|
||||||
|
|
||||||
import requests
|
|
||||||
|
|
||||||
driver_url = os.getenv("ERP_JDBC_JAR_URL", cls._jdbc_driver_url).strip() or cls._jdbc_driver_url
|
|
||||||
with requests.get(driver_url, stream=True, timeout=120) as resp:
|
|
||||||
resp.raise_for_status()
|
|
||||||
with open(jar_path, "wb") as f:
|
|
||||||
for chunk in resp.iter_content(chunk_size=1024 * 256):
|
|
||||||
if chunk:
|
|
||||||
f.write(chunk)
|
|
||||||
return str(jar_path)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def _dsn_to_jdbc_url(dsn: str) -> str:
|
|
||||||
dsn = (dsn or "").strip()
|
|
||||||
if not dsn:
|
|
||||||
raise ValueError("ERP_DB_DSN is empty")
|
|
||||||
if dsn.startswith("jdbc:oracle:thin:@"):
|
|
||||||
return dsn
|
|
||||||
if dsn.startswith("("):
|
|
||||||
return f"jdbc:oracle:thin:@{dsn}"
|
|
||||||
match = re.match(r"^(?P<host>[^:/]+)(?::(?P<port>\d+))?/(?P<service>.+)$", dsn)
|
|
||||||
if match:
|
|
||||||
host = match.group("host")
|
|
||||||
port = match.group("port") or "1521"
|
|
||||||
service = match.group("service")
|
|
||||||
return f"jdbc:oracle:thin:@//{host}:{port}/{service}"
|
|
||||||
return f"jdbc:oracle:thin:@{dsn}"
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def _execute_sql_via_jdbc(cls, sql: str, user: str, password: str, dsn: str):
|
|
||||||
import jaydebeapi
|
|
||||||
|
|
||||||
jar_path = cls._ensure_jdbc_driver_jar()
|
|
||||||
jdbc_url = cls._dsn_to_jdbc_url(dsn)
|
|
||||||
connection = jaydebeapi.connect(
|
|
||||||
"oracle.jdbc.OracleDriver",
|
|
||||||
jdbc_url,
|
|
||||||
{
|
|
||||||
"user": user,
|
|
||||||
"password": password,
|
|
||||||
"oracle.jdbc.timezoneAsRegion": "false",
|
|
||||||
},
|
|
||||||
jar_path,
|
|
||||||
)
|
|
||||||
cursor = connection.cursor()
|
|
||||||
try:
|
|
||||||
cursor.execute(sql)
|
|
||||||
columns = [col[0] for col in cursor.description] if cursor.description else []
|
|
||||||
rows = cursor.fetchall() if columns else []
|
|
||||||
return columns, rows
|
|
||||||
finally:
|
|
||||||
try:
|
|
||||||
cursor.close()
|
|
||||||
finally:
|
|
||||||
connection.close()
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_schema(cls):
|
def get_schema(cls):
|
||||||
if cls._schema_text is None:
|
if cls._schema_text is None:
|
||||||
@@ -532,12 +458,7 @@ class Text2SQLService:
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
error_text = str(e)
|
error_text = str(e)
|
||||||
if current_app:
|
if current_app:
|
||||||
current_app.logger.warning(f"Oracle direct query failed, trying JDBC fallback: {error_text}")
|
current_app.logger.warning(f"Oracle direct query failed: {error_text}")
|
||||||
if "DPY-3010" in error_text or "DPI-1047" in error_text:
|
|
||||||
try:
|
|
||||||
return cls._execute_sql_via_jdbc(sql, user, password, dsn)
|
|
||||||
except Exception as jdbc_error:
|
|
||||||
return ["Error"], [[f"{error_text} | JDBC fallback failed: {jdbc_error}"]]
|
|
||||||
return ["Error"], [[error_text]]
|
return ["Error"], [[error_text]]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
@@ -16,8 +16,6 @@ pycryptodome
|
|||||||
PyJWT
|
PyJWT
|
||||||
cryptography
|
cryptography
|
||||||
oracledb
|
oracledb
|
||||||
jaydebeapi
|
|
||||||
JPype1
|
|
||||||
pyodbc>=5.1.0
|
pyodbc>=5.1.0
|
||||||
zeep>=4.2.1
|
zeep>=4.2.1
|
||||||
pywin32; sys_platform == "win32"
|
pywin32; sys_platform == "win32"
|
||||||
|
|||||||
Reference in new issue
Block a user