Pārlūkot izejas kodu

通话记录,质检录音下载文件名称格式为 客户号码-录音时间-坐席工号

yuqian 8 gadi atpakaļ
vecāks
revīzija
bdc55e4dfe

+ 1 - 0
CallCenterApi/CallCenterApi.DAL/CallRecords.cs

@@ -23,6 +23,7 @@ namespace CallCenterApi.DAL
23 23
             {
24 24
                 model.Id = row["Id"] == DBNull.Value ? 0 : Convert.ToInt32(row["Id"]);
25 25
                 model.TaskId = row["itemid"] == DBNull.Value ? 0 : Convert.ToInt32(row["itemid"]);
26
+                model.TaskName = row["TaskName"] == DBNull.Value ? "" : row["TaskName"].ToString();
26 27
                 model.CallNumber = row["Callee"] == DBNull.Value ? "" : row["Callee"].ToString();
27 28
                 model.Usercode = row["AgentId"] == DBNull.Value ? "" : row["AgentId"].ToString();
28 29
                 model.StartDate = row["StartDate"] == DBNull.Value ? (DateTime?)null : Convert.ToDateTime(row["StartDate"].ToString());

+ 3 - 3
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/callout/CallPlanController.cs

@@ -781,7 +781,7 @@ namespace CallCenterApi.Interface.Controllers.callout
781 781
             {
782 782
                 sql += $" and F_HJJGID={filter.HJJGID} ";
783 783
             }
784
-            var field = "F_Id,t.TaskName,F_Phone,F_FPState,F_HCState,F_YJState,F_Username,tn.F_CreateTime,F_HJJGName,F_YHFKName";
784
+            var field = "F_Id,t.TaskName,F_Phone,F_FPState,F_HCState,F_YJState,F_Username,tn.F_CreateTime,F_HJJGName,F_YHFKName,tn.F_LastCallTime";
785 785
             var recordCount = 0;
786 786
             var dt = BLL.PagerBLL.GetListPager(
787 787
                              " T_Call_TaskTelNum tn left join T_CTI_Task t on t.TaskID=tn.F_TaskId",
@@ -1511,8 +1511,8 @@ namespace CallCenterApi.Interface.Controllers.callout
1511 1511
             StringBuilder fields = new StringBuilder();
1512 1512
             var dt = BLL.PagerBLL.GetListPager(
1513 1513
                        "V_AutoCallResult",
1514
-                       "Id",
1515
-                       "id,itemid, callee, agentid, username,startdate,enddate,getinagentdate,calltype,talktime,RecordPath",
1514
+                       " ID ",
1515
+                       " ID,itemid,taskname, callee, agentid, username,startdate,enddate,getinagentdate,calltype,talktime,RecordPath",
1516 1516
                        where.ToString(),
1517 1517
                        sort,
1518 1518
                        filter.PageSize,

+ 12 - 5
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/quality/QCManageController.cs

@@ -12,6 +12,7 @@ namespace CallCenterApi.Interface.Controllers.quality
12 12
 {
13 13
     public class QCManageController : BaseController
14 14
     {
15
+        private readonly BLL.T_Sys_UserAccount userBLL = new BLL.T_Sys_UserAccount();
15 16
         //获取未质检列表
16 17
         public ActionResult GetList()
17 18
         {
@@ -113,6 +114,7 @@ namespace CallCenterApi.Interface.Controllers.quality
113 114
 
114 115
             List<Model.T_Call_CallRecords_QC> Plist = new BLL.T_Call_CallRecords_QC().GetModelList(sql);//.GetListV1(sql);
115 116
             List<Model.T_Call_CallRecordsLD> ldList = new BLL.T_Call_CallRecordsLD().GetModelList("");
117
+            List<Model.T_Sys_UserAccount> userList = userBLL.DataTableToList(userBLL.GetList("").Tables[0]);
116 118
             Model.PageData<object> pageData = new Model.PageData<object>();
117 119
             var list = Plist.Select(d =>
118 120
             {
@@ -130,6 +132,7 @@ namespace CallCenterApi.Interface.Controllers.quality
130 132
                     }
131 133
                     d.FilePath = ym + path.Substring(path.IndexOf(':') + 1).Replace('\\', '/');
132 134
                 }
135
+                var user = userList.SingleOrDefault(x => x.F_UserCode == d.UserCode);
133 136
                 return new
134 137
                 {
135 138
                     _callnumber = d.CallNumber,
@@ -141,14 +144,16 @@ namespace CallCenterApi.Interface.Controllers.quality
141 144
                     _calltype = d.CallType,
142 145
                     _callstate = d.CallState,
143 146
                     _usercode = d.UserCode,
144
-                    _username = d.UserName,
147
+                    _username = user?.F_UserName ?? "",
148
+                    _deptname = d.F_DeptName,
145 149
                     _talkstarttime = d.TalkStartTime,
146 150
                     _talkendtime = d.TalkEndTime,
147 151
                     _talklongtime = d.TalkLongTime,
148 152
                     _businesstype = d.BusinessType,
149 153
                     _f_qclc = lc,
150 154
                     _f_qcdc = dc,
151
-                    _callrecordsid = d.CallRecordsId
155
+                    _callrecordsid = d.CallRecordsId,
156
+                    _callid = d.CallId
152 157
                 };
153 158
             }).ToList<object>();
154 159
             //pageData.Rows = list.Skip((pageindex - 1) * pagesize).Take(pagesize).ToList();
@@ -268,6 +273,7 @@ namespace CallCenterApi.Interface.Controllers.quality
268 273
 
269 274
             List<Model.T_Call_CallRecords_QC> Plist = new BLL.T_Call_CallRecords_QC().GetModelList(sql);//.GetListV1(sql);
270 275
             List<Model.T_Call_CallRecordsLD> ldList = new BLL.T_Call_CallRecordsLD().GetModelList("");
276
+            List<Model.T_Sys_UserAccount> userList = userBLL.DataTableToList(userBLL.GetList("").Tables[0]);
271 277
             Model.PageData<object> pageData = new Model.PageData<object>();
272 278
             var list = Plist.Select(d =>
273 279
             {
@@ -284,7 +290,7 @@ namespace CallCenterApi.Interface.Controllers.quality
284 290
                     }
285 291
                     d.FilePath = ym + path.Substring(path.IndexOf(':') + 1).Replace('\\', '/');
286 292
                 }
287
-
293
+                var user = userList.SingleOrDefault(x => x.F_UserCode == d.UserCode);
288 294
                 return new
289 295
                 {
290 296
                     _callnumber = d.CallNumber,
@@ -296,7 +302,7 @@ namespace CallCenterApi.Interface.Controllers.quality
296 302
                     _calltype = d.CallType,
297 303
                     _callstate = d.CallState,
298 304
                     _usercode = d.UserCode,
299
-                    _username = d.UserName,
305
+                    _username = user?.F_UserName ?? "",
300 306
                     _talkstarttime = d.TalkStartTime,
301 307
                     _talkendtime = d.TalkEndTime,
302 308
                     _talklongtime = d.TalkLongTime,
@@ -304,7 +310,8 @@ namespace CallCenterApi.Interface.Controllers.quality
304 310
                     _f_qclc = lc,
305 311
                     _f_qcdc = dc,
306 312
                     _callrecordsid = d.CallRecordsId,
307
-                    _deptname = d.F_DeptName
313
+                    _deptname = d.F_DeptName,
314
+                    _callid = d.CallId
308 315
                 };
309 316
             }).ToList<object>();
310 317
 

+ 45 - 4
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/ZuoXiWorkTotalController.cs

@@ -25,18 +25,24 @@ namespace CallCenterApi.Interface.Controllers.report
25 25
                         ,"置忙次数","休息时长分钟数","平均每天休息时长(小时)"
26 26
                         ,"置忙平均休息分钟数","质检平均成绩"
27 27
                 };
28
+
29
+            //string[] str = { "部门", "坐席姓名", "角色", "固话号码",
30
+            //                 "呼入电话数", "坐席接通量", "接通率", "通话分钟数",
31
+            //                 "呼出电话数", "坐席呼通量", "接通率", "通话分钟数",
32
+            //                 "坐席登陆次数", "登陆时长分钟数", "工作时长分钟数", "平均每天工作时长(小时)", "休息时长分钟数", "质检平均成绩"
33
+            //};
28 34
             res = Success("获取坐席工作统计表头成功", str);
29 35
 
30 36
             return res;
31 37
         }
32 38
 
33 39
         //获取数据
34
-        public ActionResult GetDataList(string stime, string endtime, string dpt, string dayss)
40
+        public ActionResult GetDataList(string stime, string endtime, string dpt, string dayss, string usercode = "")
35 41
         {
36 42
             ActionResult res = NoToken("未知错误,请重新登录");
37 43
 
38 44
             DataTable dtNew = new DataTable();
39
-            dtNew = getData(stime, endtime, dpt, dayss);
45
+            dtNew = getData(stime, endtime, dpt, dayss, usercode);
40 46
             #region
41 47
             //#region
42 48
             //DataColumn dc1 = new DataColumn("部门");
@@ -407,10 +413,31 @@ namespace CallCenterApi.Interface.Controllers.report
407 413
             return res;
408 414
         }
409 415
 
410
-        private DataTable getData(string stime, string endtime, string dpt, string dayss)
416
+        private DataTable getData(string stime, string endtime, string dpt, string dayss, string _usercode = "")
411 417
         {
412 418
             DataTable dtNew = new DataTable();
413 419
             #region
420
+            //dtNew.Columns.AddRange(new DataColumn[] {
421
+            //     new DataColumn("部门"),
422
+            //     new DataColumn("坐席姓名"),
423
+            //     new DataColumn("角色"),
424
+            //     new DataColumn("固话号码"),
425
+            //     new DataColumn("呼入电话数"),
426
+            //     new DataColumn("坐席接通量"),
427
+            //     new DataColumn("接通率"),
428
+            //     new DataColumn("通话分钟数"),
429
+            //     new DataColumn("呼出电话数"),
430
+            //     new DataColumn("坐席呼通量"),
431
+            //     new DataColumn("接通率"),
432
+            //     new DataColumn("通话分钟数"),
433
+            //     new DataColumn("坐席登陆次数"),
434
+            //     new DataColumn("登陆时长分钟数"),
435
+            //     new DataColumn("工作时长分钟数"),
436
+            //     new DataColumn("平均每天工作时长(小时)"),
437
+            //     new DataColumn("休息时长分钟数"),
438
+            //     new DataColumn("质检平均成绩")
439
+            //});
440
+
414 441
             DataColumn dc1 = new DataColumn("部门");
415 442
             DataColumn dc2 = new DataColumn("坐席");
416 443
             DataColumn dc3 = new DataColumn("坐席工号");
@@ -542,7 +569,10 @@ namespace CallCenterApi.Interface.Controllers.report
542 569
 
543 570
                 }
544 571
             }
545
-
572
+            if (!string.IsNullOrWhiteSpace(_usercode))
573
+            {
574
+                usercodeSQL += $" and F_UserCode='{_usercode}' ";
575
+            }
546 576
             DataTable dtdpt = null;
547 577
             if (!string.IsNullOrWhiteSpace(dpt) && Convert.ToInt32(dpt) >= 0)
548 578
             {
@@ -568,6 +598,12 @@ namespace CallCenterApi.Interface.Controllers.report
568 598
                         drNew["坐席"] = dt.Rows[i]["F_UserName"].ToString();
569 599
                         drNew["坐席工号"] = dt.Rows[i]["F_WorkNumber"].ToString();
570 600
                         drNew["角色"] = dt.Rows[i]["F_RoleName"].ToString();
601
+
602
+                        //drNew["部门"] = dr["F_DeptName"].ToString();
603
+                        //drNew["坐席姓名"] = $"{dt.Rows[i]["F_WorkNumber"].ToString()}—{dt.Rows[i]["F_UserName"].ToString()}";
604
+                        //drNew["角色"] = dt.Rows[i]["F_RoleName"].ToString();
605
+                        //drNew["固话号码"] = "15537150907";  // TODO 固话号码
606
+
571 607
                         //if (i == 0)
572 608
                         //{//呼入电话
573 609
 
@@ -631,6 +667,11 @@ namespace CallCenterApi.Interface.Controllers.report
631 667
                         drNew["呼损率"] = (itrunkhsl * 100).ToString("0.00") + "%";
632 668
                         drNew["平均排队时间"] = itrunkpjpd.ToString("0.00");
633 669
 
670
+
671
+                        //drNew["呼入电话数"] = itrunkct;
672
+                        //drNew["坐席接通量"] = itrunkjj;
673
+                        //drNew["接通率"] = (itrunkjtl * 100).ToString("0.00") + "%";
674
+
634 675
                         //}
635 676
                         //else
636 677
                         //{

+ 34 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/CallrecordsController.cs

@@ -4,7 +4,10 @@ using CallCenterApi.Interface.Controllers.Base;
4 4
 using System;
5 5
 using System.Collections.Generic;
6 6
 using System.Data;
7
+using System.IO;
7 8
 using System.Linq;
9
+using System.Net;
10
+using System.Text;
8 11
 using System.Web;
9 12
 using System.Web.Mvc;
10 13
 
@@ -287,5 +290,36 @@ namespace CallCenterApi.Interface.Controllers.tel
287 290
             }
288 291
             return res;
289 292
         }
293
+
294
+
295
+        public ActionResult GetCallVoiceRemoveName(string callId)
296
+        {
297
+            var callRecord = new BLL.T_Call_CallRecords().GetModelByCallId(callId);
298
+            if (callRecord == null)
299
+                return Error("通话记录不存在");
300
+            var filePath = "";
301
+            var config = new BLL.T_Sys_SystemConfig().GetModelList(" F_ParamCode='PlayPath' ").FirstOrDefault();
302
+            string path = callRecord.FilePath ?? "";
303
+            if (path != "" && config != null && !string.IsNullOrEmpty(config.F_ParamValue))
304
+            {
305
+                var ym = config.F_ParamValue;
306
+                if (ym.Substring(ym.Length - 1) == "/")
307
+                {
308
+                    ym = ym.Substring(0, ym.Length - 1);
309
+                }
310
+                filePath = ym + path.Substring(path.IndexOf(':') + 1).Replace('\\', '/');
311
+            }
312
+
313
+
314
+            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(filePath);
315
+            request.Method = "GET";
316
+            request.ContentType = "audio/wav";
317
+
318
+            HttpWebResponse response = (HttpWebResponse)request.GetResponse();
319
+            Stream myResponseStream = response.GetResponseStream();
320
+            StreamReader myStreamReader = new StreamReader(myResponseStream, Encoding.UTF8);
321
+            return File(myResponseStream, "audio/wav", $"{callRecord.CallNumber}-{callRecord.BeginTime?.ToString("yyyyMMdd") ?? DateTime.Now.ToString("yyyyMMdd")}-{callRecord.UserCode}.wav");
322
+
323
+        }
290 324
     }
291 325
 }

+ 4 - 0
CallCenterApi/CallCenterApi.Model/CallResult.cs

@@ -13,6 +13,10 @@ namespace CallCenterApi.Model
13 13
         /// </summary>
14 14
         public int TaskId { get; set; }
15 15
         /// <summary>
16
+        /// 任务名称
17
+        /// </summary>
18
+        public string TaskName { get; set; }
19
+        /// <summary>
16 20
         /// 被叫号码
17 21
         /// </summary>
18 22
         public string CallNumber { get; set; }