Pārlūkot izejas kodu

mac地址绑定,优化通话记录性能

zhangkun 5 gadi atpakaļ
vecāks
revīzija
185b57daff

+ 1 - 0
.gitignore

@@ -122,3 +122,4 @@ data/客服php/Db_zzmetro_dtkf_20201102_013001.sql.gz
122 122
 web/YTSoft.BaseCallCenter.MVCWeb/App_Data/
123 123
 web/YTSoft.BaseCallCenter.MVCWeb/log/
124 124
 web/YTSoft.BaseCallCenter.MVCWeb.rar
125
+data/数据迁移准备sql/二期.rar

+ 2 - 0
data/数据迁移准备sql/二期/数据准备.txt

@@ -1,5 +1,7 @@
1 1
 字典数据准备    常用人员    线路  一键转接
2 2
 
3
+触发器trans
4
+
3 5
 
4 6
 人员数据准备   备份原数据库    删除人员表   更新人员最新数据  T_Sys_UserAccount
5 7
 部门数据准备   备份原数据库    删除部门表   更新最新部门数据  T_Sys_Department   

+ 0 - 0
data/数据迁移准备sql/二期/触发器trans.txt


+ 21 - 3
web/BaseCallCenter.DAL/Order/T_Wo_WorkOrderBase.cs

@@ -1553,8 +1553,26 @@ F_SERVICETYPE,F_DECLARATIONTIME,F_SERVICENATURE,F_SERVICEWAY,F_RETURNVISITMAN,F_
1553 1553
                 model.F_OVERTIMES = 0;
1554 1554
 
1555 1555
             }
1556
-
1557
-
1556
+            string F_HOUSINGint = "0";
1557
+            switch (model.F_HOUSING)
1558
+            {
1559
+                case "咨询":
1560
+                    F_HOUSINGint = "1";
1561
+                    break;
1562
+                case "投诉":
1563
+                    F_HOUSINGint = "2";
1564
+                    break;
1565
+                case "建议":
1566
+                    F_HOUSINGint = "3";
1567
+                    break;
1568
+                case "表扬":
1569
+                    F_HOUSINGint = "4";
1570
+                    break;
1571
+                case "挂失":
1572
+                    F_HOUSINGint = "5";
1573
+                    break;
1574
+            }
1575
+            DbHelperSQL.ExecuteSql(string.Format("update T_Call_CallRecords set F_ServiceType={0}  where CallId=(select top 1 F_KSHADDRESSCODE from  T_Wo_WorkOrderBase where F_WORKORDERID={1})", F_HOUSINGint, model.F_WORKORDERID));
1558 1576
 
1559 1577
             StringBuilder strSql = new StringBuilder();
1560 1578
 
@@ -2275,7 +2293,7 @@ F_SERVICETYPE,F_DECLARATIONTIME,F_SERVICENATURE,F_SERVICEWAY,F_RETURNVISITMAN,F_
2275 2293
             {
2276 2294
                 StringBuilder strSql = new StringBuilder();
2277 2295
                 strSql.Append(" update T_Wo_WorkOrderBase set ");
2278
-                strSql.Append(" F_WORKORDERSTATEID=0,F_REPAIRREQUEST='未处理'  where F_WORKORDERID=" + workOrderId);
2296
+                strSql.Append(" F_WORKORDERSTATEID=0,F_REPAIRREQUEST='未处理',F_HASTENCOUNTS=0  where F_WORKORDERID=" + workOrderId);
2279 2297
 
2280 2298
                 int hisid = EditOrderHistoryInfo(workOrderId, byid, byname, bmid, bmmc);
2281 2299
                 if (hisid > 0)

+ 61 - 12
web/YTSoft.BaseCallCenter.MVCWeb/Controllers/DefaultController.cs

@@ -4,6 +4,7 @@ using System.Configuration;
4 4
 using System.Data;
5 5
 using System.Linq;
6 6
 using System.Net.NetworkInformation;
7
+using System.Runtime.InteropServices;
7 8
 using System.Text;
8 9
 using System.Web;
9 10
 using System.Web.Mvc;
@@ -78,7 +79,7 @@ namespace YTSoft.BaseCallCenter.MVCWeb.Controllers
78 79
                             {
79 80
                                 extensionphone = tempExtensionphone.ToMyString();
80 81
                             }
81
-
82
+                            LogHelper.Default.WriteInfo("tsKey:" + extensionphone);
82 83
                             Dictionary<string, string> Dic = new Dictionary<string, string>();
83 84
                             Dic.Add("F_UserID", dt.Rows[0]["F_UserId"].ToString());
84 85
                             Dic.Add("F_UserCode", dt.Rows[0]["F_UserCode"].ToString());
@@ -371,22 +372,70 @@ namespace YTSoft.BaseCallCenter.MVCWeb.Controllers
371 372
         public static int GetNetworkAdpaterID()
372 373
         {
373 374
             int ret = 0;
374
-            NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
375
-            if (nics != null && nics.Length > 0)
375
+            //NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
376
+            //if (nics != null && nics.Length > 0)
377
+            //{
378
+            //    foreach (NetworkInterface nic in nics)
379
+            //    {   string mac = nic.GetPhysicalAddress().ToString();
380
+            //        LogHelper.Default.WriteInfo("MAC:" + mac);
381
+            //        if (string.IsNullOrEmpty(mac))
382
+            //            continue;
383
+            //        ret = new BLL.T_Mac().GetNum(mac);
384
+            //        if (ret > 0)
385
+            //        {
386
+            //            LogHelper.Default.WriteInfo("MAC1:" + mac);
387
+            //            break;
388
+            //        }
389
+            //    }
390
+            //}
391
+            string mac = GetClientMAC();
392
+            ret = new BLL.T_Mac().GetNum(mac);
393
+            return ret;
394
+        }
395
+        [DllImport("Iphlpapi.dll")]
396
+        private static extern int SendARP(Int32 dest, Int32 host, ref Int64 mac, ref Int32 length);
397
+        [DllImport("Ws2_32.dll")]
398
+        private static extern Int32 inet_addr(string ip);
399
+
400
+        private static string GetClientMAC()
401
+        {
402
+            string mac_dest = string.Empty;
403
+            // 在此处放置用户代码以初始化页面
404
+            try
376 405
             {
377
-                foreach (NetworkInterface nic in nics)
378
-                {   string mac = nic.GetPhysicalAddress().ToString();
379
-                    if (string.IsNullOrEmpty(mac))
380
-                        continue;
381
-                    ret = new BLL.T_Mac().GetNum(mac);
382
-                    if (ret > 0)
406
+                string userip = System.Web.HttpContext.Current.Request.UserHostAddress;
407
+                string strClientIP = System.Web.HttpContext.Current.Request.UserHostAddress.ToString().Trim();
408
+                Int32 ldest = inet_addr(strClientIP); //目的地的ip 
409
+                Int32 lhost = inet_addr("");   //本地服务器的ip 
410
+                Int64 macinfo = new Int64();
411
+                Int32 len = 6;
412
+                int res = SendARP(ldest, 0, ref macinfo, ref len);
413
+                string mac_src = macinfo.ToString("X");
414
+                while (mac_src.Length < 12)
415
+                {
416
+                    mac_src = mac_src.Insert(0, "0");
417
+                }
418
+                for (int i = 0; i < 11; i++)
419
+                {
420
+                    if (0 == (i % 2))
383 421
                     {
384
-                       // LogHelper.Default.WriteInfo("MAC:" + mac);
385
-                        break;
422
+                        if (i == 10)
423
+                        {
424
+                            mac_dest = mac_dest.Insert(0, mac_src.Substring(i, 2));
425
+                        }
426
+                        else
427
+                        {
428
+                            mac_dest = "-" + mac_dest.Insert(0, mac_src.Substring(i, 2));
429
+                        }
430
+
386 431
                     }
387 432
                 }
388 433
             }
389
-            return ret;
434
+            catch (Exception ex)
435
+            {
436
+                throw ex;
437
+            }
438
+            return mac_dest;
390 439
         }
391 440
 
392 441
     }

+ 75 - 29
web/YTSoft.BaseCallCenter.MVCWeb/Controllers/HW/CallRecordController.cs

@@ -1056,21 +1056,33 @@ namespace YTSoft.BaseCallCenter.MVCWeb.Controllers
1056 1056
             //工单类型 F_HOUSING select F_WORKORDERTYPEID,F_CONTENT,F_HOUSING from  T_Wo_WorkOrderBase where 1=1  and  F_CONTENT like '%'++'%'
1057 1057
 
1058 1058
             
1059
-            if (F_WORKORDERTYPEID>0)
1060
-            {
1061
-                sql += "  AND  F_WorkOrderTypeId IS NOT null  and F_WORKORDERTYPEID=" + F_WORKORDERTYPEID;
1062
-            }  //工单内容 F_CONTENT
1063
-            if (!string.IsNullOrEmpty(F_CONTENT))
1064
-            {
1065
-                sql += string.Format(" AND  F_WorkOrderTypeId IS NOT null and T2.F_CONTENT like '%{0}%'", F_CONTENT);
1066
-            }
1059
+
1067 1060
             //工单类型
1068 1061
             if (!string.IsNullOrEmpty(F_HOUSING))
1069 1062
             {
1070
-                sql += string.Format("  AND  F_WorkOrderTypeId IS NOT null and T2.F_HOUSING='{0}'", F_HOUSING);
1063
+                //sql += string.Format("  AND  F_WorkOrderTypeId IS NOT null and T2.F_HOUSING='{0}'", F_HOUSING);
1064
+                string F_HOUSINGint = "0";
1065
+                switch (F_HOUSING)
1066
+                {
1067
+                    case "咨询":
1068
+                        F_HOUSINGint = "1";
1069
+                        break;
1070
+                    case "投诉":
1071
+                        F_HOUSINGint = "2";
1072
+                        break;
1073
+                    case "建议":
1074
+                        F_HOUSINGint = "3";
1075
+                        break;
1076
+                    case "表扬":
1077
+                        F_HOUSINGint = "4";
1078
+                        break;
1079
+                    case "挂失":
1080
+                        F_HOUSINGint = "5";
1081
+                        break;
1082
+                }
1083
+                sql += string.Format("AND F_ServiceType={0} ", F_HOUSINGint);
1071 1084
             }
1072 1085
 
1073
-          
1074 1086
 
1075 1087
             //呼叫状态,0:未接通电话1已接通电话
1076 1088
             if (!string.IsNullOrEmpty(callStatus))
@@ -1083,11 +1095,45 @@ namespace YTSoft.BaseCallCenter.MVCWeb.Controllers
1083 1095
             //BLL.T_Call_CallRecords busCall_CallRecords = new BLL.T_Call_CallRecords();
1084 1096
             //busCall_CallRecords.GetListByPage();
1085 1097
             Model.PageData<Model.T_Call_CallRecords_All> pageModel = new Model.PageData<Model.T_Call_CallRecords_All>();
1086
-            dt = BLL.PagerBLL.GetTableList(
1087
-                " (T_Call_CallRecords T1 LEFT JOIN T_Wo_WorkOrderBase T2 ON T1.CallId=T2.F_KSHADDRESSCODE ) ",
1088
-                "CallRecordsId",
1089
-                "T1.*,F_WORKORDERID,F_HOUSING,CONVERT(varchar,BeginTime, 120 ) as BeginTimeNew,CONVERT(varchar,TalkStartTime, 120 ) as TalkStartTimeNew,CONVERT(varchar,TalkEndTime, 120 ) as TalkEndTimeNew"
1090
-                + @",(select top 1 F_ScaleResume from T_Cus_CustomerBase n where
1098
+//            dt = BLL.PagerBLL.GetTableList(
1099
+//                " (T_Call_CallRecords T1 LEFT JOIN T_Wo_WorkOrderBase T2 ON T1.CallId=T2.F_KSHADDRESSCODE ) ",
1100
+//                "CallRecordsId",
1101
+//                "T1.*,F_WORKORDERID,F_HOUSING,CONVERT(varchar,BeginTime, 120 ) as BeginTimeNew,CONVERT(varchar,TalkStartTime, 120 ) as TalkStartTimeNew,CONVERT(varchar,TalkEndTime, 120 ) as TalkEndTimeNew"
1102
+//                + @",(select top 1 F_ScaleResume from T_Cus_CustomerBase n where
1103
+//CallNumber=F_Telephone) as F_ScaleResume,
1104
+//replace(replace(FilePath,'\','/'),'" + GetSysconfig("newFilePath") + "','" + GetSysconfig("newPlayPath") + "')" +
1105
+//@" as fileurl,case
1106
+// when  BusinessType=1 then '咨询'
1107
+// when  BusinessType=2 then '建议'
1108
+// when  BusinessType=3 then '表扬'
1109
+// when  BusinessType=4 then '挂失'
1110
+// when  BusinessType=9 then '投诉'
1111
+
1112
+// when  T1.F_ServiceType=1 then '咨询'
1113
+// when  T1.F_ServiceType = 2 then '投诉'
1114
+// when  T1.F_ServiceType = 3 then '建议'
1115
+// when  T1.F_ServiceType = 4 then '表扬'
1116
+// when  T1.F_ServiceType = 5 then '挂失'
1117
+// else '' end as
1118
+//BType, case when (isnull(BusinessType,0)>0 or isnull(T1.F_ServiceType,0)>0) then '人工服务' else '' end  as ywtype  ", 
1119
+//                sql,
1120
+//                // "ORDER BY LongTime,CallRecordsId desc",
1121
+//                string.IsNullOrEmpty(sort) ? " BeginTime desc":  sort + " desc"
1122
+//                ,
1123
+               
1124
+//                limit,
1125
+//                page,
1126
+//                out recordCount);
1127
+
1128
+
1129
+
1130
+            dt = BLL.PagerBLL.GetListPager(
1131
+    " T_Call_CallRecords ",
1132
+    "CallRecordsId",
1133
+    "*," +
1134
+    "(select top 1 F_WORKORDERID from T_Wo_WorkOrderBase where F_KSHADDRESSCODE=CallId) as F_WORKORDERID," +
1135
+    "CONVERT(varchar,BeginTime, 120 ) as BeginTimeNew,CONVERT(varchar,TalkStartTime, 120 ) as TalkStartTimeNew,CONVERT(varchar,TalkEndTime, 120 ) as TalkEndTimeNew"
1136
+    + @",(select top 1 F_ScaleResume from T_Cus_CustomerBase n where
1091 1137
 CallNumber=F_Telephone) as F_ScaleResume,
1092 1138
 replace(replace(FilePath,'\','/'),'" + GetSysconfig("newFilePath") + "','" + GetSysconfig("newPlayPath") + "')" +
1093 1139
 @" as fileurl,case
@@ -1097,21 +1143,21 @@ replace(replace(FilePath,'\','/'),'" + GetSysconfig("newFilePath") + "','" + Get
1097 1143
  when  BusinessType=4 then '挂失'
1098 1144
  when  BusinessType=9 then '投诉'
1099 1145
 
1100
- when  T1.F_ServiceType=1 then '咨询'
1101
- when  T1.F_ServiceType = 2 then '投诉'
1102
- when  T1.F_ServiceType = 3 then '建议'
1103
- when  T1.F_ServiceType = 4 then '表扬'
1104
- when  T1.F_ServiceType = 5 then '挂失'
1146
+ when  F_ServiceType=1 then '咨询'
1147
+ when  F_ServiceType = 2 then '投诉'
1148
+ when  F_ServiceType = 3 then '建议'
1149
+ when  F_ServiceType = 4 then '表扬'
1150
+ when  F_ServiceType = 5 then '挂失'
1105 1151
  else '' end as
1106
-BType, case when (isnull(BusinessType,0)>0 or isnull(T1.F_ServiceType,0)>0) then '人工服务' else '' end  as ywtype  ", 
1107
-                sql,
1108
-                // "ORDER BY LongTime,CallRecordsId desc",
1109
-                string.IsNullOrEmpty(sort) ? " BeginTime desc":  sort + " desc"
1110
-                ,
1111
-               
1112
-                limit,
1113
-                page,
1114
-                out recordCount);
1152
+ BType, case when (isnull(BusinessType,0)>0 or isnull(F_ServiceType,0)>0) then '人工服务' else '' end  as ywtype  ",
1153
+    sql,
1154
+    // "ORDER BY LongTime,CallRecordsId desc",
1155
+    string.IsNullOrEmpty(sort) ? "ORDER BY BeginTime desc" : "ORDER BY "+ sort + " desc"
1156
+    ,
1157
+    limit,
1158
+    page,
1159
+    true,
1160
+    out recordCount);
1115 1161
 
1116 1162
 
1117 1163
             dataModel.code = 0;

+ 13 - 9
web/YTSoft.BaseCallCenter.MVCWeb/Controllers/KF/QuickMsgsController.cs

@@ -59,9 +59,9 @@ namespace YTSoft.BaseCallCenter.MVCWeb.Controllers
59 59
         #endregion
60 60
 
61 61
         [ActionName("GetListData")]
62
-        public string GetListData(string key = "", int type = -1, int page = 0, int limit = 20)
62
+        public string GetListData(DateTime? NowDateTime,string key = "", int type = -1, int page = 0, int limit = 20)
63 63
         {
64
-            string strWhere = " 1=1 ";
64
+            string strWhere = string.Format("  service_id in (0,{0})", F_PId.ToInt32());
65 65
             if (!string.IsNullOrEmpty(key))
66 66
             {
67 67
                 strWhere += string.Format(" and msg like '%{0}%'", key);
@@ -71,7 +71,8 @@ namespace YTSoft.BaseCallCenter.MVCWeb.Controllers
71 71
                 strWhere += string.Format(" and service_id {0}", type == 1 ? "!=0" : "=0");
72 72
             }
73 73
 
74
-            DataTable dt = busQuickMsgs.GetListByPage(strWhere, "", (page - 1) * limit, limit).Tables[0];
74
+
75
+            DataTable dt = busQuickMsgs.GetListByPage(strWhere, " service_id asc, rate desc ", (page - 1) * limit, limit).Tables[0];
75 76
             int count = busQuickMsgs.GetRecordCount(strWhere);
76 77
             return Success("成功", dt, count);
77 78
         }
@@ -87,7 +88,7 @@ namespace YTSoft.BaseCallCenter.MVCWeb.Controllers
87 88
         }
88 89
 
89 90
         [ActionName("adddata")]
90
-        public string AddData(string msg = "", int type = 0)
91
+        public string AddData(string msg = "", int type = 0,int rate=0)
91 92
         {
92 93
           
93 94
             if (string.IsNullOrEmpty(msg))
@@ -99,7 +100,7 @@ namespace YTSoft.BaseCallCenter.MVCWeb.Controllers
99 100
                 return Error("请输入值type");
100 101
             }
101 102
 
102
-            string strWhere = string.Format("  msg='{0}' and service_id{1} ", msg, type==1 ?"!=0":"=0");
103
+            string strWhere = string.Format("  msg='{0}' and service_id{1} ", msg, type==1 ?"="+F_PId.ToInt32():"=0");
103 104
             int count = busQuickMsgs.GetRecordCount(strWhere);
104 105
             if (count > 0)
105 106
             {
@@ -107,9 +108,9 @@ namespace YTSoft.BaseCallCenter.MVCWeb.Controllers
107 108
             }
108 109
 
109 110
             Model.kf_quick_msgs model = new kf_quick_msgs();            
110
-            model.service_id = type;            
111
+            model.service_id = type==0?0:F_PId.ToInt32();            
111 112
             model.msg = msg;
112
-            model.rate = 0;
113
+            model.rate = rate;
113 114
 
114 115
             if (busQuickMsgs.Add(model))
115 116
             {
@@ -121,7 +122,7 @@ namespace YTSoft.BaseCallCenter.MVCWeb.Controllers
121 122
         }
122 123
 
123 124
         [ActionName("editdata")]
124
-        public string EditData(string msg = "",int id=0)
125
+        public string EditData(string msg = "",int id=0,int rate=-1)
125 126
         {
126 127
 
127 128
             if (string.IsNullOrEmpty(msg))
@@ -135,7 +136,10 @@ namespace YTSoft.BaseCallCenter.MVCWeb.Controllers
135 136
             string modeljson = JsonConvert.SerializeObject(model);
136 137
             
137 138
             model.msg = msg;
138
-
139
+            if (rate >= 0)
140
+            {
141
+                model.rate = rate;
142
+            }
139 143
             if (busQuickMsgs.Update(model))
140 144
             {
141 145
                 AddLog("kf_quick_msgs", model.id.ToString(), "修改消息", modeljson, model);

+ 23 - 3
web/YTSoft.BaseCallCenter.MVCWeb/Controllers/OCXOptController.cs

@@ -4,6 +4,7 @@ using System.Linq;
4 4
 using System.Web;
5 5
 using System.Web.Mvc;
6 6
 using System.Data;
7
+using YTSoft.Common;
7 8
 
8 9
 namespace YTSoft.BaseCallCenter.MVCWeb.Controllers
9 10
 {
@@ -28,7 +29,7 @@ namespace YTSoft.BaseCallCenter.MVCWeb.Controllers
28 29
         {
29 30
             //&timeno=" + timeno+"&callid=" + callID + "&userid=" + userid + "&usercode=" + usercode 
30 31
             //+ "&username=" + username + "&extnumber" + extnumber + "&callernum=" + callerNum
31
-            AddAction("T_Call_CallRecords", callid, "通话处理",string.Format("事件:{0},callid={1},usercode={2},extnumber={3},callernum={4}", optaction, callid, usercode, extnumber, callernum),"关键信息");
32
+            AddAction("T_Call_CallRecords", callid, "通话处理",string.Format("事件:{0},callid={1},userid={5},usercode={2},extnumber={3},callernum={4}", optaction, callid, usercode, extnumber, callernum, userid),"关键信息");
32 33
 
33 34
             string res = "error";
34 35
             try
@@ -508,6 +509,8 @@ namespace YTSoft.BaseCallCenter.MVCWeb.Controllers
508 509
                 if (vmodel != null)
509 510
                 {
510 511
                     #region 存在通话记录
512
+                    AddAction("T_Call_CallRecords", callid, "步骤2", string.Format("存在通话记录 事件:{0},callid={1},usercode={2},extnumber={3},callernum={4}", "zhenlingEvent", callid, usercode, extnumber, callernum), "关键信息");
513
+
511 514
                     Model.T_Call_CallRecords model = new Model.T_Call_CallRecords();
512 515
                     model.CallId = callid;
513 516
                     if (!string.IsNullOrEmpty(userid))
@@ -530,8 +533,11 @@ namespace YTSoft.BaseCallCenter.MVCWeb.Controllers
530 533
                     }
531 534
                     model.DealType = 5;
532 535
                     bool bl = new BLL.T_Call_CallRecords().UpdateCallInRingTelRecord(model);
536
+
533 537
                     if (bl)
534 538
                     {
539
+                        AddAction("T_Call_CallRecords", callid, "步骤3", string.Format("更新成功 事件:{0},callid={1},usercode={2},extnumber={3},callernum={4},userid={5}", "zhenlingEvent", callid, usercode, extnumber, callernum, userid), "关键信息");
540
+
535 541
                         string phone = callernum;
536 542
                         #region 来电归属地查询
537 543
                         string location = "";
@@ -562,13 +568,20 @@ namespace YTSoft.BaseCallCenter.MVCWeb.Controllers
562 568
                             catch { }
563 569
                             res = workorderid.ToString();
564 570
                         }
565
-                        
571
+
566 572
                         #endregion
567 573
                     }
574
+                    else
575
+                    {
576
+                        AddAction("T_Call_CallRecords", callid, "步骤3", string.Format("更新失败 事件:{0},callid={1},usercode={2},extnumber={3},callernum={4},userid={5}", "zhenlingEvent", callid, usercode, extnumber, callernum, userid), "关键信息");
577
+
578
+                    }
568 579
                     #endregion
569 580
                 }
570 581
                 else
571 582
                 {
583
+                    AddAction("T_Call_CallRecords", callid, "步骤2", string.Format("不存在通话记录 事件:{0},callid={1},usercode={2},extnumber={3},callernum={4},userid={5}", "zhenlingEvent", callid, usercode, extnumber, callernum, userid), "关键信息");
584
+
572 585
                     Model.T_Call_CallRecords model = new Model.T_Call_CallRecords();
573 586
                     model.CallId = callid;
574 587
                     model.CallNumber = callernum.Trim();
@@ -600,6 +613,8 @@ namespace YTSoft.BaseCallCenter.MVCWeb.Controllers
600 613
                     int b = new BLL.T_Call_CallRecords().Add(model);
601 614
                     if (b > 0)
602 615
                     {
616
+                        AddAction("T_Call_CallRecords", callid, "步骤3", string.Format("添加成功 事件:{0},callid={1},usercode={2},extnumber={3},callernum={4},userid={5}", "zhenlingEvent", callid, usercode, extnumber, callernum, userid), "关键信息");
617
+
603 618
                         string phone = callernum;
604 619
                         #region 来电归属地查询
605 620
                         string location = "";
@@ -633,11 +648,16 @@ namespace YTSoft.BaseCallCenter.MVCWeb.Controllers
633 648
 
634 649
                         #endregion
635 650
                     }
651
+                    else
652
+                    {
653
+                        AddAction("T_Call_CallRecords", callid, "步骤3", string.Format("添加失败 事件:{0},callid={1},usercode={2},extnumber={3},callernum={4},userid={5}", "zhenlingEvent", callid, usercode, extnumber, callernum, userid), "关键信息");
654
+
655
+                    }
636 656
                 }
637 657
             }
638 658
             catch (Exception ex)
639 659
             {
640
-                //res = ex.ToString();
660
+                LogHelper.Default.WriteError("振铃事件:", ex);
641 661
             }
642 662
             return res;
643 663
         }

+ 5 - 5
web/YTSoft.BaseCallCenter.MVCWeb/Controllers/Order/OrderController.cs

@@ -349,7 +349,7 @@ namespace YTSoft.BaseCallCenter.MVCWeb.Controllers
349 349
                 "T_Wo_WorkOrderBase",
350 350
                 "F_WORKORDERID",
351 351
               "*,CONVERT(varchar,F_CREATEDATE, 120 ) as F_CREATEDATENew"
352
-              + @" , replace(replace(CASE F_WORKORDERFROM WHEN '留言工单' THEN (SELECT F_RecFileUrl FROM dbo.T_Call_LeaveRecord  WHERE F_CallId=F_KSHADDRESSCODE) WHEN '语音工单' THEN (SELECT FilePath FROM dbo.T_Call_CallRecords WHERE CallId=F_KSHADDRESSCODE AND FilePath!='') ELSE NULL END,'\','/'),'" + GetSysconfig("newFilePath") + "','" + GetSysconfig("newPlayPath") + "') as FilePath",
352
+              + @" , replace(replace(CASE F_WORKORDERFROM WHEN '留言工单' THEN (SELECT top 1 F_RecFileUrl FROM dbo.T_Call_LeaveRecord  WHERE F_CallId=F_KSHADDRESSCODE) WHEN '语音工单' THEN (SELECT top 1 FilePath FROM dbo.T_Call_CallRecords WHERE CallId=F_KSHADDRESSCODE AND FilePath!='') ELSE NULL END,'\','/'),'" + GetSysconfig("newFilePath") + "','" + GetSysconfig("newPlayPath") + "') as FilePath",
353 353
                 //+ " ,(CASE F_WORKORDERFROM WHEN '留言工单' THEN (SELECT F_RecFileUrl FROM dbo.T_Call_LeaveRecord  WHERE F_CallId=F_KSHADDRESSCODE) WHEN '语音工单' THEN (SELECT FilePath FROM dbo.T_Call_CallRecords WHERE CallId=F_KSHADDRESSCODE AND FilePath!='') ELSE NULL END ) as FilePath",
354 354
                 sql,
355 355
                 "ORDER BY F_CREATEDATE desc",
@@ -706,7 +706,7 @@ namespace YTSoft.BaseCallCenter.MVCWeb.Controllers
706 706
                 "T_Wo_WorkOrderBase",
707 707
                 "F_WORKORDERID",
708 708
               "*,CONVERT(varchar,F_CREATEDATE, 120 ) as F_CREATEDATENew"
709
-              + @" , replace(replace(CASE F_WORKORDERFROM WHEN '留言工单' THEN (SELECT F_RecFileUrl FROM dbo.T_Call_LeaveRecord  WHERE F_CallId=F_KSHADDRESSCODE) WHEN '语音工单' THEN (SELECT FilePath FROM dbo.T_Call_CallRecords WHERE CallId=F_KSHADDRESSCODE AND FilePath!='') ELSE NULL END,'\','/'),'" + GetSysconfig("newFilePath") + "','" + GetSysconfig("newPlayPath") + "') as FilePath",
709
+              + @" , replace(replace(CASE F_WORKORDERFROM WHEN '留言工单' THEN (SELECT top 1 F_RecFileUrl FROM dbo.T_Call_LeaveRecord  WHERE F_CallId=F_KSHADDRESSCODE) WHEN '语音工单' THEN (SELECT top 1 FilePath FROM dbo.T_Call_CallRecords WHERE CallId=F_KSHADDRESSCODE AND FilePath!='') ELSE NULL END,'\','/'),'" + GetSysconfig("newFilePath") + "','" + GetSysconfig("newPlayPath") + "') as FilePath",
710 710
                 //+ " ,(CASE F_WORKORDERFROM WHEN '留言工单' THEN (SELECT F_RecFileUrl FROM dbo.T_Call_LeaveRecord  WHERE F_CallId=F_KSHADDRESSCODE) WHEN '语音工单' THEN (SELECT FilePath FROM dbo.T_Call_CallRecords WHERE CallId=F_KSHADDRESSCODE AND FilePath!='') ELSE NULL END ) as FilePath",
711 711
                 sql,
712 712
                 "ORDER BY F_CREATEDATE desc",
@@ -937,7 +937,7 @@ namespace YTSoft.BaseCallCenter.MVCWeb.Controllers
937 937
                 "T_Wo_WorkOrderBase",
938 938
                 "F_WORKORDERID",
939 939
               "*,CONVERT(varchar,F_CREATEDATE, 120 ) as F_CREATEDATENew"
940
-              + @" , replace(replace(CASE F_WORKORDERFROM WHEN '留言工单' THEN (SELECT F_RecFileUrl FROM dbo.T_Call_LeaveRecord  WHERE F_CallId=F_KSHADDRESSCODE) WHEN '语音工单' THEN (SELECT FilePath FROM dbo.T_Call_CallRecords WHERE CallId=F_KSHADDRESSCODE AND FilePath!='') ELSE NULL END,'\','/'),'" + GetSysconfig("newFilePath") + "','" + GetSysconfig("newPlayPath") + "') as FilePath",
940
+              + @" , replace(replace(CASE F_WORKORDERFROM WHEN '留言工单' THEN (SELECT top 1 F_RecFileUrl FROM dbo.T_Call_LeaveRecord  WHERE F_CallId=F_KSHADDRESSCODE) WHEN '语音工单' THEN (SELECT top 1 FilePath FROM dbo.T_Call_CallRecords WHERE CallId=F_KSHADDRESSCODE AND FilePath!='') ELSE NULL END,'\','/'),'" + GetSysconfig("newFilePath") + "','" + GetSysconfig("newPlayPath") + "') as FilePath",
941 941
                 //+ " ,(CASE F_WORKORDERFROM WHEN '留言工单' THEN (SELECT F_RecFileUrl FROM dbo.T_Call_LeaveRecord  WHERE F_CallId=F_KSHADDRESSCODE) WHEN '语音工单' THEN (SELECT FilePath FROM dbo.T_Call_CallRecords WHERE CallId=F_KSHADDRESSCODE AND FilePath!='') ELSE NULL END ) as FilePath",
942 942
                 sql,
943 943
                 "ORDER BY F_CREATEDATE desc",
@@ -1265,7 +1265,7 @@ namespace YTSoft.BaseCallCenter.MVCWeb.Controllers
1265 1265
                 " T_Wo_WorkOrderBase T1 Inner join T_Wo_WorkOrderNotice T2 On T1.F_WORKORDERID=T2.OrderId  ",
1266 1266
                 "F_WORKORDERID",
1267 1267
               "T1.*,CONVERT(varchar,F_CREATEDATE, 120 ) as F_CREATEDATENew,NoticeDeptId,NoticeDeptName"
1268
-              + @" , replace(replace(CASE F_WORKORDERFROM WHEN '留言工单' THEN (SELECT F_RecFileUrl FROM dbo.T_Call_LeaveRecord  WHERE F_CallId=F_KSHADDRESSCODE) WHEN '语音工单' THEN (SELECT FilePath FROM dbo.T_Call_CallRecords WHERE CallId=F_KSHADDRESSCODE AND FilePath!='') ELSE NULL END,'\','/'),'" + GetSysconfig("newFilePath") + "','" + GetSysconfig("newPlayPath") + "') as FilePath",
1268
+              + @" , replace(replace(CASE F_WORKORDERFROM WHEN '留言工单' THEN (SELECT top 1 F_RecFileUrl FROM dbo.T_Call_LeaveRecord  WHERE F_CallId=F_KSHADDRESSCODE) WHEN '语音工单' THEN (SELECT top 1 FilePath FROM dbo.T_Call_CallRecords WHERE CallId=F_KSHADDRESSCODE AND FilePath!='') ELSE NULL END,'\','/'),'" + GetSysconfig("newFilePath") + "','" + GetSysconfig("newPlayPath") + "') as FilePath",
1269 1269
                 //+ " ,(CASE F_WORKORDERFROM WHEN '留言工单' THEN (SELECT F_RecFileUrl FROM dbo.T_Call_LeaveRecord  WHERE F_CallId=F_KSHADDRESSCODE) WHEN '语音工单' THEN (SELECT FilePath FROM dbo.T_Call_CallRecords WHERE CallId=F_KSHADDRESSCODE AND FilePath!='') ELSE NULL END ) as FilePath",
1270 1270
                 sql,
1271 1271
                 " F_CREATEDATE desc",
@@ -2376,7 +2376,7 @@ namespace YTSoft.BaseCallCenter.MVCWeb.Controllers
2376 2376
             string tableNew = "(select DISTINCT  t.*  ";
2377 2377
             tableNew += ", case WHEN F_SENTORDERTIME IS NULL AND DATEDIFF(minute, DATEADD(day,1,F_CREATEDATE),  GETDATE())> 0  THEN 0 WHEN F_SENTORDERTIME IS NULL  THEN 1 WHEN DATEDIFF(minute, DATEADD(day,1,F_CREATEDATE), F_SENTORDERTIME)> 0 THEN 0 ELSE 1 END AS turntime ";
2378 2378
             tableNew += " from T_Wo_WorkOrderBase t LEFT JOIN T_Wo_WorkOrderHistory h ON t.F_WORKORDERID=h.F_INSTANCEID LEFT JOIN T_Sys_UserAccount u ON  t.F_USERID= u.F_UserId";
2379
-            tableNew += string.Format(" where(u.F_DeptId ={0}     OR h.F_OPTBTNID ={0}) and h.NeedReplayTime is not null and  (h.ReplayTime IS NULL AND DATEDIFF(second,  GETDATE(), h.NeedReplayTime)<0) OR (h.ReplayTime IS NOT NULL AND DATEDIFF(second,  h.ReplayTime, h.NeedReplayTime)<0)) as t", F_DeptId);
2379
+            tableNew += " where  h.NeedReplayTime is not null and  (h.ReplayTime IS NULL AND DATEDIFF(second,  GETDATE(), h.NeedReplayTime)<0) OR (h.ReplayTime IS NOT NULL AND DATEDIFF(second,  h.ReplayTime, h.NeedReplayTime)<0)) as t";
2380 2380
             DataTable dt = new DataTable();
2381 2381
             int recordCount = 0;
2382 2382
             Model.PageData<Model.T_Wo_WorkOrderBase> pageModel = new Model.PageData<Model.T_Wo_WorkOrderBase>();