|
@@ -477,16 +477,14 @@ class AgentStateService:
|
|
self.assigned_recycle_millisecond = 60000
|
|
self.assigned_recycle_millisecond = 60000
|
|
|
|
|
|
def idle(self, saas_id, agent_id, phone_num):
|
|
def idle(self, saas_id, agent_id, phone_num):
|
|
- # HumanService 这个地方没实现 没看明白
|
|
|
|
- human_service = HumanService(saas_id, agent_id)
|
|
|
|
|
|
+ human_service = _get_human_service_service(saas_id, agent_id)
|
|
if human_service is None:
|
|
if human_service is None:
|
|
print(f"agent engine idle not have human service {saas_id} {agent_id}") # 使用print替代log
|
|
print(f"agent engine idle not have human service {saas_id} {agent_id}") # 使用print替代log
|
|
return
|
|
return
|
|
self.idle_hash(saas_id, agent_id, phone_num, human_service.service_id)
|
|
self.idle_hash(saas_id, agent_id, phone_num, human_service.service_id)
|
|
|
|
|
|
def busy(self, saas_id, agent_id, phone_num):
|
|
def busy(self, saas_id, agent_id, phone_num):
|
|
- # HumanService 这个地方没实现 没看明白
|
|
|
|
- human_service = HumanService(saas_id, agent_id)
|
|
|
|
|
|
+ human_service = _get_human_service_service(saas_id, agent_id)
|
|
if human_service is None:
|
|
if human_service is None:
|
|
print(f"agent engine busy not hava human service {saas_id} {agent_id}") # 使用print替代log
|
|
print(f"agent engine busy not hava human service {saas_id} {agent_id}") # 使用print替代log
|
|
return
|
|
return
|
|
@@ -656,3 +654,7 @@ def _get_agent_monitor(saas_id, agent_number):
|
|
def _get_phone(saas_id, phone_num):
|
|
def _get_phone(saas_id, phone_num):
|
|
phone = Phone.query.filter(Phone.saas_id == saas_id, Phone.phone_num == phone_num).first()
|
|
phone = Phone.query.filter(Phone.saas_id == saas_id, Phone.phone_num == phone_num).first()
|
|
return phone
|
|
return phone
|
|
|
|
+
|
|
|
|
+def _get_human_service_service(saas_id, agent_id):
|
|
|
|
+ human_service_map = HumanServiceMap.query.filter(HumanServiceMap.saas_id == saas_id, HumanServiceMap.agent_id ==agent_id).first()
|
|
|
|
+ return human_service_map
|