Explorar el Código

自动回访,试听

yuqian %!s(int64=8) %!d(string=hace) años
padre
commit
2ead5fe0a8

+ 4 - 0
CallCenterApi/CallCenterApi.BLL/CallCenterApi.BLL.csproj

@@ -124,6 +124,10 @@
124 124
     <Compile Include="UserAccount.cs" />
125 125
   </ItemGroup>
126 126
   <ItemGroup>
127
+    <ProjectReference Include="..\..\CallCenterCommon\CallCenter.Utility\CallCenter.Utility.csproj">
128
+      <Project>{4DA219CC-911E-4C81-BB0B-DF5183FD50FF}</Project>
129
+      <Name>CallCenter.Utility</Name>
130
+    </ProjectReference>
127 131
     <ProjectReference Include="..\CallCenterApi.DAL\CallCenterApi.DAL.csproj">
128 132
       <Project>{f5b5967d-b96d-434d-b06d-d1f9d8a98ba1}</Project>
129 133
       <Name>CallCenterApi.DAL</Name>

+ 73 - 1
CallCenterApi/CallCenterApi.BLL/T_CTI_Task.cs

@@ -3,6 +3,7 @@ using System.Collections.Generic;
3 3
 using System.Linq;
4 4
 using System.Text;
5 5
 using System.Data;
6
+using CallCenter.Utility;
6 7
 
7 8
 namespace CallCenterApi.BLL
8 9
 {
@@ -356,12 +357,31 @@ namespace CallCenterApi.BLL
356 357
                 msg = "语音回访队列阻塞,请联系管理员";
357 358
                 return false;
358 359
             }
360
+
361
+
362
+            //string fix = ""; string bfix = ""; string wfix = "";
363
+            //string zipcode = Configs.GetValue("CallOutZipCode");
364
+            //bfix = Configs.GetValue("CallOutBPre");
365
+            //wfix = Configs.GetValue("CallOutWPre");
366
+            //int zip = GetZipCodeByPhone(phone, zipcode);
367
+            //if (zip == 1)
368
+            //{
369
+            //    fix = bfix;
370
+            //}
371
+            //else if (zip == 2)
372
+            //{
373
+            //    fix = wfix;
374
+            //}
375
+
376
+
377
+
359 378
             var i = telNumDal.Add(new Model.T_Call_TaskTelNum
360 379
             {
361 380
                 F_TaskId = -10002,
381
+                //F_Phone = fix + phone,
362 382
                 F_Phone = phone,
363 383
                 WorkOrderId = workOrderId,
364
-                AssignId = assignId
384
+                AssignedId = assignId
365 385
             });
366 386
             if (i > 0)
367 387
             {
@@ -378,6 +398,58 @@ namespace CallCenterApi.BLL
378 398
             return false;
379 399
         }
380 400
 
401
+        public int GetZipCodeByPhone(string phone, string zipcode)
402
+        {
403
+            int res = 0;
404
+            if (phone.Trim().Length >= 7)
405
+            {
406
+                //7位及7位以上是固定电话或手机
407
+                //判断是否手机
408
+                if (phone.Trim().Length == 11 && phone[0] == '1')
409
+                {//号码为11位,首位是1,为手机号
410
+                    BLL.T_Sys_MobileData mobile_Bll = new BLL.T_Sys_MobileData();
411
+                    Model.T_Sys_MobileData mobileModel = mobile_Bll.GetModelList(" F_MobileNum = '" + phone.Substring(0, 7) + "'").FirstOrDefault();
412
+                    if (mobileModel != null)
413
+                    {
414
+                        if (mobileModel.F_ZipCode.Equals(zipcode))
415
+                        {
416
+                            res = 1;
417
+                        }
418
+                        else
419
+                        {
420
+                            res = 2;
421
+                        }
422
+                    }
423
+                }
424
+                else
425
+                {
426
+                    if (phone.Trim().Length == 11 && phone.Substring(0, 3).Equals(zipcode))
427
+                    {//号码为11位
428
+                        //截取前三位区号判断是否本地
429
+                        bool resbd3 = phone.Substring(0, 3).Equals(zipcode);
430
+                        //截取前四位区号判断是否本地
431
+                        bool resbd4 = phone.Substring(0, 4).Equals(zipcode);
432
+                        if (resbd3 || resbd4)
433
+                        {
434
+                            res = 1;
435
+                        }
436
+                    }
437
+                    else if (phone.Trim().Length < 11)
438
+                    {//号码小于11位,为本地
439
+                        res = 1;
440
+                    }
441
+                    else if (phone.Trim().Length > 11 && phone.Substring(0, 4).Equals(zipcode))
442
+                    {//号码大于11位,截取前四位区号判断是否本地
443
+                        res = 1;
444
+                    }
445
+                    else
446
+                    {
447
+                        res = 2;
448
+                    }
449
+                }
450
+            }
451
+            return res;
452
+        }
381 453
 
382 454
         #endregion  Method
383 455
     }

+ 4 - 4
CallCenterApi/CallCenterApi.DAL/T_Call_TaskTelNum.cs

@@ -41,9 +41,9 @@ namespace CallCenterApi.DAL
41 41
         {
42 42
             StringBuilder strSql = new StringBuilder();
43 43
             strSql.Append("insert into T_Call_TaskTelNum(");
44
-            strSql.Append("F_TaskId,F_Phone,F_YJState,F_HCState,F_HCCount,DTMF,WorkOrderId,AssignId)");
44
+            strSql.Append("F_TaskId,F_Phone,F_YJState,F_HCState,F_HCCount,DTMF,WorkOrderId,AssignedId)");
45 45
             strSql.Append(" values (");
46
-            strSql.Append("@F_TaskId,@F_Phone,@F_YJState,@F_HCState,@F_HCCount,@DTMF,@WorkOrderId,@AssignId)");
46
+            strSql.Append("@F_TaskId,@F_Phone,@F_YJState,@F_HCState,@F_HCCount,@DTMF,@WorkOrderId,@AssignedId)");
47 47
             strSql.Append(";select @@IDENTITY");
48 48
             SqlParameter[] parameters = {
49 49
                     new SqlParameter("@F_TaskId", SqlDbType.Int,4),
@@ -53,7 +53,7 @@ namespace CallCenterApi.DAL
53 53
                     new SqlParameter("@F_HCCount", SqlDbType.Int,4),
54 54
                     new SqlParameter("@DTMF", SqlDbType.Int,4),
55 55
                     new SqlParameter("@WorkOrderId",SqlDbType.VarChar,200),
56
-                    new SqlParameter("@AssignId",SqlDbType.Int)
56
+                    new SqlParameter("@AssignedId",SqlDbType.Int)
57 57
             };
58 58
 
59 59
 
@@ -64,7 +64,7 @@ namespace CallCenterApi.DAL
64 64
             parameters[4].Value = model.F_HCCount;
65 65
             parameters[5].Value = model.DTMF;
66 66
             parameters[6].Value = model.WorkOrderId;
67
-            parameters[7].Value = model.AssignId;
67
+            parameters[7].Value = model.AssignedId;
68 68
             object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
69 69
             if (obj == null)
70 70
             {

+ 15 - 12
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/callout/CallPlanController.cs

@@ -377,7 +377,7 @@ namespace CallCenterApi.Interface.Controllers.callout
377 377
         #endregion
378 378
 
379 379
         #region 语音试听 //taskid=-10001 是语音试听任务,固定不可修改
380
-        public ActionResult TryListen(string phone = "", string text = "")
380
+        public ActionResult TryListen(string phone = "", string text = "", string fix = "")
381 381
         {
382 382
             string phone1 = RequestString.ToDBC(RequestString.RemoveNotNumber(WebHelper.NoHtml(phone)));
383 383
             if (string.IsNullOrWhiteSpace(text))
@@ -386,18 +386,21 @@ namespace CallCenterApi.Interface.Controllers.callout
386 386
             var model = taskBLL.GetModel(-10001);
387 387
             if (model == null)
388 388
                 return Error("试听队列阻塞,请联系管理员");
389
-            var i = taskTellNumBLL.Add(new T_Call_TaskTelNum
390
-            {
391
-                F_TaskId = -10001,
392
-                F_Phone = phone1
393
-            });
394
-            if (i > 0)
389
+
390
+            model.y_HMCount = model.y_HMCount + 1;
391
+            model.State = 1;
392
+            model.TaskContent = text;
393
+            var flag = taskBLL.Update(model);
394
+
395
+            if (flag)
395 396
             {
396
-                model.y_HMCount = model.y_HMCount + 1;
397
-                model.State = 1;
398
-                model.TaskContent = text;
399
-                var flag = taskBLL.Update(model);
400
-                if (flag)
397
+                var i = taskTellNumBLL.Add(new T_Call_TaskTelNum
398
+                {
399
+                    F_TaskId = -10001,
400
+                    // F_Phone = fix + phone1
401
+                    F_Phone = phone1
402
+                });
403
+                if (i > 0)
401 404
                     return Success("号码已加入试听队列,请注意接听");
402 405
                 return Error("");
403 406
             }

+ 1 - 1
CallCenterApi/CallCenterApi.Model/T_Call_TaskTelNum.cs

@@ -23,7 +23,7 @@ namespace CallCenterApi.Model
23 23
         public int DTMF { get; set; }
24 24
         public int F_HCCount { get; set; }
25 25
         public string WorkOrderId { get; set; }
26
-        public int? AssignId { get; set; }
26
+        public int? AssignedId { get; set; }
27 27
 
28 28
         #endregion Model
29 29