duhongyu 4 lat temu
rodzic
commit
4d220ebaab

+ 7 - 1
codegit/CallCenterApi/CallCenterApi.BLL/T_Call_CallRecords.cs

@@ -206,7 +206,13 @@ namespace CallCenterApi.BLL
206 206
         {
207 207
             return dal.UpdateCallInPathTelRecord(model);
208 208
         }
209
-
209
+        /// <summary>
210
+        /// 更新来电录音记录信息
211
+        /// </summary>
212
+        public bool UpdateWorkorder(Model.T_Call_CallRecords model)
213
+        {
214
+            return dal.UpdateWorkorder(model);
215
+        }
210 216
         #endregion
211 217
 
212 218
         #region 根据来电号码获取电话记录

+ 36 - 4
codegit/CallCenterApi/CallCenterApi.DAL/T_Call_CallRecords.cs

@@ -228,7 +228,8 @@ namespace CallCenterApi.DAL
228 228
             strSql.Append("F_QCAdvise=@F_QCAdvise,");
229 229
             strSql.Append("TaskType=@TaskType,");
230 230
             strSql.Append("TaskPhoneID=@TaskPhoneID,");
231
-            strSql.Append("TaskID=@TaskID");
231
+            strSql.Append("WorkOrder=@WorkOrder,");
232
+             strSql.Append("TaskID=@TaskID");
232 233
             strSql.Append(" where CallRecordsId=@CallRecordsId");
233 234
             SqlParameter[] parameters = {
234 235
                     new SqlParameter("@CallId", SqlDbType.VarChar,50),
@@ -282,6 +283,8 @@ namespace CallCenterApi.DAL
282 283
                     new SqlParameter("@F_QCAdvise", SqlDbType.NText),
283 284
                     new SqlParameter("@TaskType", SqlDbType.NVarChar,10),
284 285
                     new SqlParameter("@TaskPhoneID", SqlDbType.NVarChar,10),
286
+                    new SqlParameter("@WorkOrder", SqlDbType.NVarChar,-1),
287
+                    
285 288
                     new SqlParameter("@TaskID", SqlDbType.NVarChar,32),
286 289
                     new SqlParameter("@CallRecordsId", SqlDbType.Int,4)};
287 290
             parameters[0].Value = model.CallId;
@@ -335,8 +338,9 @@ namespace CallCenterApi.DAL
335 338
             parameters[48].Value = model.F_QCAdvise;
336 339
             parameters[49].Value = model.TaskType;
337 340
             parameters[50].Value = model.TaskPhoneID;
338
-            parameters[51].Value = model.TaskID;
339
-            parameters[52].Value = model.CallRecordsId;
341
+            parameters[51].Value = model.WorkOrder;
342
+            parameters[52].Value = model.TaskID;
343
+            parameters[53].Value = model.CallRecordsId;
340 344
 
341 345
             int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
342 346
             if (rows > 0)
@@ -671,6 +675,11 @@ namespace CallCenterApi.DAL
671 675
                 {
672 676
                     model.TaskID = row["TaskID"].ToString();
673 677
                 }
678
+                if (row["WorkOrder"] != null)
679
+                {
680
+                    model.WorkOrder = row["WorkOrder"].ToString();
681
+                }
682
+                
674 683
             }
675 684
             return model;
676 685
         }
@@ -893,7 +902,30 @@ namespace CallCenterApi.DAL
893 902
         }
894 903
 
895 904
         #endregion
896
-
905
+        /// <summary>
906
+        /// 
907
+        /// </summary>
908
+        public bool UpdateWorkorder(Model.T_Call_CallRecords model)
909
+        {
910
+            StringBuilder strSql = new StringBuilder();
911
+            strSql.Append("update T_Call_CallRecords set ");
912
+            strSql.Append("WorkOrder=@WorkOrder");
913
+            strSql.Append(" where CallId=@CallId");
914
+            SqlParameter[] parameters = {
915
+                    new SqlParameter("@CallId", SqlDbType.VarChar,50),
916
+                      new SqlParameter("@WorkOrder", SqlDbType.VarChar,-1)};
917
+            parameters[0].Value = model.CallId;
918
+            parameters[1].Value = model.WorkOrder ;
919
+            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
920
+            if (rows > 0)
921
+            {
922
+                return true;
923
+            }
924
+            else
925
+            {
926
+                return false;
927
+            }
928
+        }
897 929
         #region 更新来电录音开始信息
898 930
 
899 931
         /// <summary>

+ 4 - 16
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/CallOutOptController.cs

@@ -15,22 +15,11 @@ namespace CallCenterApi.Interface.Controllers
15 15
         public ActionResult GetCallOutprefix(string phone)
16 16
         {
17 17
 
18
-            if (Request.IsAuthenticated)
19
-            {
18
+          
20 19
                 string phone1 = RequestString.ToDBC(RequestString.RemoveNotNumber(WebHelper.NoHtml(phone)));
21 20
                 string tophone = phone1;
22
-                string zipcode = ""; string bfix = ""; string wfix = ""; string fix = "";
23
-                string userseatgroupid = CurrentUser.UserData.F_SeartGroupID.ToString();
24
-                if (userseatgroupid != "" && userseatgroupid != "0")
25
-                {
26
-                    Model.T_Sys_SeatGroup smodel = new BLL.T_Sys_SeatGroup().GetModel(int.Parse(userseatgroupid));
27
-                    if (smodel != null)
28
-                    {
29
-                        zipcode = smodel.F_ZXAtt.Trim();
30
-                        bfix = smodel.F_WHBDKey.Trim();
31
-                        wfix = smodel.F_WHWDKey.Trim();
32
-                    }
33
-                }
21
+                string zipcode = "0371"; string bfix = "9"; string wfix = "90        "; string fix = "";
22
+
34 23
                 int zip = GetZipCodeByPhone(phone1, zipcode);
35 24
                 #region 
36 25
                 if (zip == 1)
@@ -62,8 +51,7 @@ namespace CallCenterApi.Interface.Controllers
62 51
               
63 52
               
64 53
                 return Success("外呼号码加前缀"+ phone, obj);
65
-            }
66
-            return NoToken("未知错误,请重新登录");
54
+            
67 55
         }
68 56
 
69 57
         /// <summary>

+ 2 - 2
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/CallInScreenController.cs

@@ -390,8 +390,8 @@ namespace CallCenterApi.Interface.Controllers.tel
390 390
         /// <returns></returns>
391 391
         public ActionResult UpdateGJ()
392 392
         {
393
-            if (!Request.IsAuthenticated)
394
-                return NoToken("未知错误,请重新登录");
393
+          //  if (!Request.IsAuthenticated)
394
+             //   return NoToken("未知错误,请重新登录");
395 395
 
396 396
             string strid = RequestString.GetFormString("callid");
397 397
             bool bl = new BLL.T_Call_CallRecords().UpdateCallInHookTelRecord(strid);

+ 53 - 10
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/CallrecordsController.cs

@@ -18,10 +18,10 @@ namespace CallCenterApi.Interface.Controllers.tel
18 18
     {
19 19
         BLL.T_Call_CallRecords bll = new BLL.T_Call_CallRecords();
20 20
         //获取通话记录列表
21
-        public ActionResult GetList(string phone, string usercode,string workordercode,string BusinessDockCode = "")
21
+        public ActionResult GetList(string phone, string usercode,string workordercode,string BusinessDockCode = "",string workorder="")
22 22
         {
23
-            int userId = CurrentUser.UserData.F_UserId;
24
-            Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
23
+           // int userId = CurrentUser.UserData.F_UserId;
24
+          //  Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
25 25
 
26 26
             string sql = "";
27 27
             
@@ -31,13 +31,16 @@ namespace CallCenterApi.Interface.Controllers.tel
31 31
             string endtime = HttpUtility.UrlDecode(RequestString.GetQueryString("endtime"));
32 32
             string dept = HttpUtility.UrlDecode(RequestString.GetQueryString("dept"));
33 33
             string dealtype = HttpUtility.UrlDecode(RequestString.GetQueryString("dealtype"));
34
-
34
+            string callid = HttpUtility.UrlDecode(RequestString.GetQueryString("callid"));
35 35
             string strpageindex = RequestString.GetQueryString("page");
36 36
             int pageindex = 1;
37 37
             string strpagesize = RequestString.GetQueryString("pagesize");
38 38
             int pagesize = 10;
39
-          
40
-        
39
+
40
+            if (callid != null && callid.Trim() != "")
41
+            {
42
+                sql += " and CallId='" + callid + "'";
43
+            }
41 44
             if (usercode != null && usercode.Trim() != "")
42 45
             {
43 46
                 sql += " and UserCode='" + usercode + "'";
@@ -51,6 +54,10 @@ namespace CallCenterApi.Interface.Controllers.tel
51 54
                 //处理方式
52 55
                 sql += " and DealType = " + dealtype + " ";
53 56
             }
57
+            if (!string .IsNullOrEmpty (workorder))
58
+            {
59
+                sql += " and WorkOrder like '%" + workorder + "%'";
60
+            }
54 61
             if (phone != null && phone.Trim() != "")
55 62
             {
56 63
                 sql += " and CallNumber like '%" + phone + "%'";
@@ -71,9 +78,9 @@ namespace CallCenterApi.Interface.Controllers.tel
71 78
             {
72 79
                 sql += " and datediff(day,BeginTime,'" + endtime + "')>=0 ";
73 80
             }
74
-            if (workordercode!="") {
75
-                sql += " and (select F_RecCode from T_Rec_RegRecords where T_Rec_RegRecords.F_CallId=T_Call_CallRecords.CallId) like '"+ workordercode + "'";
76
-            }
81
+            //if (workordercode!="") {
82
+            //    sql += " and (select F_RecCode from T_Rec_RegRecords where T_Rec_RegRecords.F_CallId=T_Call_CallRecords.CallId) like '"+ workordercode + "'";
83
+            //}
77 84
                 
78 85
 
79 86
             if (strpageindex.Trim() != "")
@@ -312,7 +319,43 @@ namespace CallCenterApi.Interface.Controllers.tel
312 319
                 throw;
313 320
             }
314 321
         }
315
-
322
+        /// <summary>
323
+        /// 更新工单id
324
+        /// </summary>
325
+        /// <returns></returns>
326
+        public ActionResult UpdateOrder(string callid="",string WorkOrder="",
327
+            string callType="")
328
+        {
329
+            if (string.IsNullOrEmpty(callid))
330
+                return Error("请选择通话记录");
331
+            if (string.IsNullOrEmpty(WorkOrder))
332
+                return Error("请选择案件");
333
+            if (string.IsNullOrEmpty( callType))
334
+                return Error("请选择通话类别");
335
+            var model = new BLL.T_Call_CallRecords().GetModelList ("CallId='"+ callid + "' and " +
336
+                " CallType='"+ callType + "'");
337
+            if (model != null&& model.Count >0)
338
+            {
339
+                if (!string.IsNullOrEmpty(model[0].WorkOrder))
340
+                    model[0].WorkOrder = model[0].WorkOrder + "," + WorkOrder;
341
+                else
342
+                    model[0].WorkOrder = WorkOrder;
343
+            }
344
+            else
345
+            {
346
+                return Error("该通话记录不存在");
347
+            }
348
+                
349
+            bool bl = new BLL.T_Call_CallRecords().UpdateWorkorder(model[0]);
350
+            if (bl)
351
+            {
352
+                return Success("更新成功");
353
+            }
354
+            else
355
+            {
356
+                return Error("更新失败");
357
+            }
358
+        }
316 359
         /// <summary>
317 360
         /// 获取实体
318 361
         /// </summary>

+ 39 - 37
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/WorkcalendarController.cs

@@ -16,8 +16,8 @@ namespace CallCenterApi.Interface.Controllers.tel
16 16
         public ActionResult GetCalendarList(string strdate)
17 17
         {
18 18
             
19
-            if (Request.IsAuthenticated)
20
-            {
19
+           // if (Request.IsAuthenticated)
20
+           // {
21 21
                 string sql = "";
22 22
                 try
23 23
                 {
@@ -44,16 +44,16 @@ namespace CallCenterApi.Interface.Controllers.tel
44 44
                 {
45 45
                     return Error("获取日历失败,错误:" + ex.Message);
46 46
                 }
47
-            }
48
-            return NoToken("未知错误,请重新登录");
47
+           // }
48
+          //  return NoToken("未知错误,请重新登录");
49 49
         }
50 50
 
51 51
         //设置(非)工作日
52 52
         public ActionResult Setworkingday(string date)
53 53
         {
54 54
             
55
-            if (Request.IsAuthenticated)
56
-            {
55
+           // if (Request.IsAuthenticated)
56
+           // {
57 57
                 
58 58
                     if (date != null && date != "")
59 59
                     {
@@ -112,18 +112,19 @@ namespace CallCenterApi.Interface.Controllers.tel
112 112
                         return Error("获取参数失败");
113 113
                     }
114 114
             
115
-            }
116
-            return NoToken("未知错误,请重新登录");
115
+           // }
116
+           // }
117
+          //  return NoToken("未知错误,请重新登录");
117 118
         }
118 119
 
119 120
         //获取上班时间段
120 121
         public ActionResult GetTimesList()
121 122
         {
122 123
             
123
-            if (Request.IsAuthenticated)
124
-            {
125
-                int userId = CurrentUser.UserData.F_UserId;
126
-                Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
124
+           // if (Request.IsAuthenticated)
125
+          //  {
126
+              //  int userId = CurrentUser.UserData.F_UserId;
127
+              //  Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
127 128
 
128 129
                 string sql = "";
129 130
                 DataTable dt = new DataTable();
@@ -176,16 +177,16 @@ namespace CallCenterApi.Interface.Controllers.tel
176 177
 
177 178
                 return Content(obj.ToJson());
178 179
 
179
-            }
180
-            return NoToken("未知错误,请重新登录");
180
+           // }
181
+           // return NoToken("未知错误,请重新登录");
181 182
         }
182 183
 
183 184
         //获取某一条时间段信息
184 185
         public ActionResult GetTimes(string id)
185 186
         {
186 187
             
187
-            if (Request.IsAuthenticated)
188
-            {
188
+           // if (Request.IsAuthenticated)
189
+           // {
189 190
 
190 191
                 if (id != null && id.Trim() != "")
191 192
                 {
@@ -204,24 +205,24 @@ namespace CallCenterApi.Interface.Controllers.tel
204 205
                 {
205 206
                     return Error("获取参数失败");
206 207
                 }
207
-            }
208
-            return NoToken("未知错误,请重新登录");
208
+          //  }
209
+          //  return NoToken("未知错误,请重新登录");
209 210
         }
210 211
 
211 212
         //添加/修改上班时间段
212 213
         public ActionResult AddTimes(string workid, string workstart, string workend, string timename, string remark)
213 214
         {
214 215
             
215
-            if (Request.IsAuthenticated)
216
-            {
216
+          //  if (Request.IsAuthenticated)
217
+          //  {
217 218
 
218
-                int userId = CurrentUser.UserData.F_UserId;
219
-                Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
220
-                if (userId != 0)
221
-                {
222
-                    Model.T_Sys_UserAccount ua = new BLL.T_Sys_UserAccount().GetModel(userId);
223
-                    if (ua != null)
224
-                    {
219
+              //  int userId = CurrentUser.UserData.F_UserId;
220
+             //   Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
221
+              //  if (userId != 0)
222
+             //   {
223
+                  //  Model.T_Sys_UserAccount ua = new BLL.T_Sys_UserAccount().GetModel(userId);
224
+                   // if (ua != null)
225
+                   // {
225 226
                         if (workid != null && workid != "")
226 227
                         {
227 228
                             int id = 0;
@@ -255,8 +256,8 @@ namespace CallCenterApi.Interface.Controllers.tel
255 256
                             _model.F_EndDate = workend;
256 257
                             _model.F_Name = timename.Trim();
257 258
                             _model.F_Remark = remark.Trim();
258
-                            _model.F_GroupCode = ua.groupcode;
259
-                            _model.F_CreateUser = ua.F_UserCode;
259
+                         //   _model.F_GroupCode = ua.groupcode;
260
+                         //   _model.F_CreateUser = ua.F_UserCode;
260 261
                             _model.F_CreateTime = DateTime.Now;
261 262
 
262 263
                             int b = new BLL.T_Sys_WorkTimes().Add(_model);
@@ -269,19 +270,20 @@ namespace CallCenterApi.Interface.Controllers.tel
269 270
                                 return Error("添加失败");
270 271
                             }
271 272
                         }
272
-                    }
273
-                }
273
+            return Error("编辑失败");
274
+            // }
275
+            // }
274 276
 
275
-            }
276
-            return NoToken("未知错误,请重新登录");
277
+            //  }
278
+            //  return NoToken("未知错误,请重新登录");
277 279
         }
278 280
 
279 281
         //删除上班时间段
280 282
         public ActionResult DelTimes(string[] ids)
281 283
         {
282 284
             
283
-            if (Request.IsAuthenticated)
284
-            {
285
+         //   if (Request.IsAuthenticated)
286
+          //  {
285 287
                 
286 288
                     if (ids != null && ids.Length > 0)
287 289
                     {
@@ -302,8 +304,8 @@ namespace CallCenterApi.Interface.Controllers.tel
302 304
                         return Error("请选择要删除的记录");
303 305
                     }
304 306
             
305
-            }
306
-            return NoToken("未知错误,请重新登录");
307
+          //  }
308
+           // return NoToken("未知错误,请重新登录");
307 309
         }
308 310
     }
309 311
 }

+ 6 - 0
codegit/CallCenterApi/CallCenterApi.Model/T_Call_CallRecords.cs

@@ -68,6 +68,7 @@ namespace CallCenterApi.Model
68 68
         private string _tasktype;
69 69
         private string _taskphoneid;
70 70
         private string _taskid;
71
+        private string _workorder;
71 72
         /// <summary>
72 73
         /// 呼叫编号
73 74
         /// </summary>
@@ -492,6 +493,11 @@ namespace CallCenterApi.Model
492 493
             set { _taskid = value; }
493 494
             get { return _taskid; }
494 495
         }
496
+        public string WorkOrder
497
+        {
498
+            set { _workorder = value; }
499
+            get { return _workorder; }
500
+        }
495 501
         #endregion Model
496 502
     }
497 503
 }