余尚辉 4 kuukautta sitten
vanhempi
commit
77b0f45f2a
2 muutettua tiedostoa jossa 7 lisäystä ja 7 poistoa
  1. 5 5
      src/core/callcenter/data_handler.py
  2. 2 2
      src/core/callcenter/esl/client.py

+ 5 - 5
src/core/callcenter/data_handler.py

@@ -35,7 +35,7 @@ class DataHandleServer:
 
     @with_app_context
     def update_record(self, session_id, call_info):
-        call_record = CallRecord.query.filter_by(session_id=session_id).first()
+        call_record = CallRecord.query.filter_by(CallRecord.session_id==session_id).first()
         # 动态更新字段
         for key, value in call_info.items():
             if hasattr(call_record, key):
@@ -44,7 +44,7 @@ class DataHandleServer:
 
     @with_app_context
     def get_user_name(self,agent_num):
-        agent = Agent.query.filter(agent_num == agent_num).first()
+        agent = Agent.query.filter(Agent.agent_num == agent_num).first()
         return agent
 
     @with_app_context
@@ -53,13 +53,13 @@ class DataHandleServer:
 
     @with_app_context
     def update_agent_monitor_service_state(self, agent_num,service_state):
-        agent_monitor = AgentMonitor.query.filter(agent_num == agent_num).first()
+        agent_monitor = AgentMonitor.query.filter(AgentMonitor.agent_num == agent_num).first()
         agent_monitor.service_state = service_state
         db.session.commit()
 
     @with_app_context
     def update_call_record_bussiness_type(self, session):
-        BotRecord = BotRecords.query.filter(session == session).first()
-        print("BotRecord",BotRecord.intent,session)
+        BotRecord = BotRecords.query.filter(BotRecords.session == session).first()
+        print("BotRecord",BotRecord.intent,session,flush=True)
         self.update_record(session, {"bussiness_type": BotRecord.intent})
         db.session.commit()

+ 2 - 2
src/core/callcenter/esl/client.py

@@ -117,13 +117,13 @@ class InboundClient:
         event_name = EslEventUtil.getEventName(e)
         coreUUID = EslEventUtil.getCoreUuid(e)
         address = self.host + ':' + self.port
-        self.logger.info("process_esl_event.event_name=%s,coreUUID=%s", event_name, coreUUID)
+        # self.logger.info("process_esl_event.event_name=%s,coreUUID=%s", event_name, coreUUID)
         try:
             if event_name in self.handler_table:
                 items = self.handler_table.get(event_name)
                 for x in items:
                     try:
-                        self.logger.info("process_esl_event.handle.%s", x.__class__.__name__)
+                        # self.logger.info("process_esl_event.handle.%s", x.__class__.__name__)
                         x.handle(address, e, coreUUID)
                     except:
                         traceback.print_exc()