Davidliu před 2 měsíci
rodič
revize
9f05687f4f
1 změnil soubory, kde provedl 4 přidání a 2 odebrání
  1. 4 2
      src/core/callcenter/data_handler.py

+ 4 - 2
src/core/callcenter/data_handler.py

@@ -38,7 +38,9 @@ class DataHandleServer:
     @with_app_context
     def update_record(self, session_id, **kwargs):
         call_record = CallRecord.query.filter(CallRecord.session_id == session_id).first()
-
+        if not call_record:
+            self.app.logger.info("update_record::call_recard is empty !!!")
+            return
         time_end = kwargs.get('time_end')
         user_id =  kwargs.get('user_id')
         user_name = kwargs.get('user_name')
@@ -46,7 +48,7 @@ class DataHandleServer:
             bot_record = BotRecords.query.filter(BotRecords.session == session_id).first()
             call_record.bussiness_type = bot_record.intent if bot_record else ''
         # 如果记录是转人工并且有客服接通把客服更新到转接字段
-        self.app.logger.debug(f"Received kwargs: {kwargs} user_id:{user_id},user_name:{user_name}")
+        self.app.logger.debug(f"Received kwargs: {kwargs} user_id:{user_id},user_name:{user_name}, call_record:{call_record}")
         # if call_record.service_category==2 and user_id:
         #    call_record.transfer_user_id = user_id
         #    call_record.transfer_user_name =user_name