防骚扰处理逻辑(四)

2017-10-19  本文已影响23人  迟凝丶捏米么

标签:redis oracle treemap 存储过程


目录结构

防骚扰实时语音处理

线程 CheckAnnoyResultThread

线程 AnnoyReportThread

cron="5 /5 * * * ?"
cron="
* * * * ?"

常量

redis的键值

某一通电话
history + "" + subccno + "" + seatId + "_" + callId

关键词集合
keyword + "" + subccno + "" + agentId

发送观澜的数据
annoy + "_" + subccno

读取数据库,获得系统默认配置

from Parameter t where t.parameterName = 'record_move_max_num' or t.parameterName = 'call_time_long' or t.parameterName = 'call_short_time' 

附上图片(由于权限限制,在Cmd中不能上传本地图片):

系统默认配置,可更改

从redis的键值中获取坐席工号

这里取到的坐席工号数,<= 当前线程默认处理的最大键值数

根据坐席ID,获取坐席用户的信息

附上图片(由于权限限制,在Cmd中不能上传本地图片):

坐席信息

处理history中的数据

计算静音总时长逻辑
if(endCall<=start)
{
   continue;
}
else if(startCall<start && endCall>start && endCall<=end)
{
   start = endCall;
}
else if(startCall>=start&&endCall<=end)
{
   muteTime+= (startCall-start);
   start = endCall;
}
else if(startCall>=start&&startCall<=end&&endCall>=end)

   muteTime+= (startCall-start);
   start = 0;
   end = 0;
   break;
}
else if(startCall>=end)
{
   break;
}
else if(startCall<=start && endCall>=end)
{
   start = 0;
   end = 0;
   break;
}
if(start<end)
{
   muteTime+= (end-start);
}
{
  "content": "[{\"id\":\"7346\",\"talkertype\":\"1\",\"content\":\"嗯;time=19080 19140\",\"timestamp\":1508384901850,\"time\":\"11:48:21\",\"cmd\":\"\",\"userphone\":\"013805396267\",\"channelId\":\"4d6d04d2b48011e7\",\"answer\":\"\",\"answerType\":\"3\"}]",
  "fileId": "1508385904-674242",
  "callCenter": 1,
  "callTime": "2017-10-19 11:48:21",
  "voiceId": "1508385904-674242",
  "seatId": "7346",
  "callPhone": "013805396267",
  "voicePath": "",
  "platForm": "XQD-SHW"
}
select count(id) from AgentInfo a where a.agentId=:agentId and (a.agentWorkGroup like  '%营业02部%' or a.agentWorkGroup like '%营业07部%')
这里是oracle的存储过程调用查询
Call p_sinovoice_getrecordfilename(?,?,?,?)
create or replace procedure p_sinovoice_getrecordfilename
(
   iAgentId    number,
   iCallid     varchar2,
   ofilename   OUT varchar2,
   ofailmsg    OUT varchar2
)
as

    v_ErrCode number(6);
    v_ErrMsg varchar2(200);
begin
    p_hw_getrecordfilename(iAgentId,iCallid,ofilename,ofailmsg);

exception
 when others then
    ofailmsg := '';
end p_sinovoice_getrecordfilename;
/

finish

访问 防骚扰处理逻辑(一) 了解详情。

有问题欢迎咨询邮箱[1]


  1. 707093428@qq.com

上一篇 下一篇

猜你喜欢

热点阅读