diff --git a/backend/app/api/chat.py b/backend/app/api/chat.py index 9965f1fa..7c3c8ac5 100644 --- a/backend/app/api/chat.py +++ b/backend/app/api/chat.py @@ -18,7 +18,6 @@ from sqlalchemy import func, desc from openpyxl import load_workbook from app.services.dify import DifyService from app.services.integration_api import IntegrationApiService -from app.services.oa_sqlserver import OASQLServerService from app.decorators import require_agent_permission from app.models import Agent, ChatLog, Feedback from app import db @@ -348,6 +347,7 @@ def get_oa_employees(): page_size = 20 try: + from app.services.oa_sqlserver import OASQLServerService result = OASQLServerService.search_employees(keyword, page, page_size) return jsonify(result) except Exception as e: diff --git a/backend/app/services/oa_leave_workflow.py b/backend/app/services/oa_leave_workflow.py index ac362f46..0c4d0dcf 100644 --- a/backend/app/services/oa_leave_workflow.py +++ b/backend/app/services/oa_leave_workflow.py @@ -9,8 +9,6 @@ import xml.etree.ElementTree as ET import requests from flask import current_app -from app.services.oa_sqlserver import OASQLServerService - SOAP_ENV_NS = 'http://schemas.xmlsoap.org/soap/envelope/' SERVICE_NS = 'webservices.services.weaver.com.cn' @@ -156,6 +154,7 @@ class OALeaveWorkflowService: raise OALeaveWorkflowError(f'缺少{role_label}姓名,无法匹配 OA 用户。') try: + from app.services.oa_sqlserver import OASQLServerService matched = OASQLServerService.get_employee_by_name_and_workcode(real_name, employee_id) except Exception as exc: raise OALeaveWorkflowError(f'查询{role_label} OA 用户失败:{exc}') from exc