zhoufan 7 yıl önce
ebeveyn
işleme
a4bff13e37

+ 94 - 67
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/CallInScreenController.cs

@@ -20,7 +20,7 @@ namespace CallCenterApi.Interface.Controllers.tel
20 20
         /// <returns></returns>
21 21
         public ActionResult AddBlack()
22 22
         {
23
-            ActionResult res = NoToken("未知错误,请重新登录");
23
+            
24 24
             if (Request.IsAuthenticated)
25 25
             {
26 26
 
@@ -57,11 +57,11 @@ namespace CallCenterApi.Interface.Controllers.tel
57 57
                             int b = new BLL.T_Call_Blacklist().Add(dModel);
58 58
                             if (b > 0)
59 59
                             {
60
-                                res = Success("添加成功", enddate.ToString("yyyy-MM-dd HH:mm:ss"));
60
+                                return Success("添加成功", enddate.ToString("yyyy-MM-dd HH:mm:ss"));
61 61
                             }
62 62
                             else
63 63
                             {
64
-                                res = Error("添加失败");
64
+                                return Error("添加失败");
65 65
                             }
66 66
                         }
67 67
                         else
@@ -70,18 +70,18 @@ namespace CallCenterApi.Interface.Controllers.tel
70 70
                             dModel.F_RemoveTime = enddate;
71 71
                             if (new BLL.T_Call_Blacklist().Update(dModel))
72 72
                             {
73
-                                res = Success("修改成功", enddate.ToString("yyyy-MM-dd HH:mm:ss"));
73
+                                return Success("修改成功", enddate.ToString("yyyy-MM-dd HH:mm:ss"));
74 74
                             }
75 75
                             else
76 76
                             {
77
-                                res = Error("修改失败");
77
+                                return Error("修改失败");
78 78
                             }
79 79
                         }
80 80
                     }
81 81
                 }
82 82
 
83 83
             }
84
-            return res;
84
+            return NoToken("未知错误,请重新登录");
85 85
         }
86 86
 
87 87
         /// <summary>
@@ -90,7 +90,7 @@ namespace CallCenterApi.Interface.Controllers.tel
90 90
         /// <returns></returns>
91 91
         public ActionResult DelBlack()
92 92
         {
93
-            ActionResult res = NoToken("未知错误,请重新登录");
93
+            
94 94
             if (Request.IsAuthenticated)
95 95
             {
96 96
 
@@ -102,12 +102,12 @@ namespace CallCenterApi.Interface.Controllers.tel
102 102
                     bool bl = new BLL.T_Call_Blacklist().Delete(dModel.F_BlackId);
103 103
                     if (bl)
104 104
                     {
105
-                        res = Success("取消成功");
105
+                        return Success("取消成功");
106 106
                     }
107 107
                 }
108 108
 
109 109
             }
110
-            return res;
110
+            return NoToken("未知错误,请重新登录");
111 111
         }
112 112
 
113 113
         /// <summary>
@@ -116,7 +116,7 @@ namespace CallCenterApi.Interface.Controllers.tel
116 116
         /// <returns></returns>
117 117
         public ActionResult GetCustomerByTel()
118 118
         {
119
-            ActionResult res = NoToken("未知错误,请重新登录");
119
+            
120 120
             if (Request.IsAuthenticated)
121 121
             {
122 122
                 //DataTable dt = new DataTable();
@@ -125,9 +125,9 @@ namespace CallCenterApi.Interface.Controllers.tel
125 125
                 //dt = bll.GetList(" F_Telephone like '%" + tel + "%' or F_Mobile like '%" + tel + "%' ").Tables[0];
126 126
                 //20180509 来电弹屏一个号码弹两个客户信息 machenyang
127 127
                 var cusmodel = bll.GetModelList(" F_Telephone like '%" + tel + "%' or F_Mobile like '%" + tel + "%' ").Count() == 0 ? null : bll.GetModelList(" F_Telephone like '%" + tel + "%' or F_Mobile like '%" + tel + "%' ").OrderByDescending(p => p.F_CustomerId).First();
128
-                res = Success("客户信息加载成功", cusmodel);
128
+                return Success("客户信息加载成功", cusmodel);
129 129
             }
130
-            return res;
130
+            return NoToken("未知错误,请重新登录");
131 131
         }
132 132
 
133 133
         /// <summary>
@@ -136,7 +136,7 @@ namespace CallCenterApi.Interface.Controllers.tel
136 136
         /// <returns></returns>
137 137
         public ActionResult GetCallIdByPhone()
138 138
         {
139
-            ActionResult res = NoToken("未知错误,请重新登录");
139
+            
140 140
             if (Request.IsAuthenticated)
141 141
             {
142 142
                 DataTable dt = new DataTable();
@@ -144,10 +144,10 @@ namespace CallCenterApi.Interface.Controllers.tel
144 144
                 string tel = HttpUtility.UrlDecode(RequestString.GetQueryString("tel"));
145 145
                 Model.T_Call_CallRecords model = new BLL.T_Call_CallRecords().GetModelByTelphone(tel);
146 146
 
147
-                res = Success("加载成功", model);
147
+                return Success("加载成功", model);
148 148
 
149 149
             }
150
-            return res;
150
+            return NoToken("未知错误,请重新登录");
151 151
         }
152 152
 
153 153
         /// <summary>
@@ -156,7 +156,7 @@ namespace CallCenterApi.Interface.Controllers.tel
156 156
         /// <returns></returns>
157 157
         public ActionResult GetTelRecordByCallid()
158 158
         {
159
-            ActionResult res = NoToken("未知错误,请重新登录");
159
+            
160 160
             if (Request.IsAuthenticated)
161 161
             {
162 162
                 DataTable dt = new DataTable();
@@ -164,10 +164,10 @@ namespace CallCenterApi.Interface.Controllers.tel
164 164
                 string callid = HttpUtility.UrlDecode(RequestString.GetQueryString("callid"));
165 165
                 Model.T_Call_CallRecords model = new BLL.T_Call_CallRecords().GetModelByCallId(callid);
166 166
 
167
-                res = Success("通话记录加载成功", model);
167
+                return Success("通话记录加载成功", model);
168 168
 
169 169
             }
170
-            return res;
170
+            return NoToken("未知错误,请重新登录");
171 171
         }
172 172
 
173 173
         /// <summary>
@@ -176,40 +176,67 @@ namespace CallCenterApi.Interface.Controllers.tel
176 176
         /// <returns></returns>
177 177
         public ActionResult GetPhoneLocation()
178 178
         {
179
-            ActionResult res = NoToken("未知错误,请重新登录");
179
+            
180 180
             if (Request.IsAuthenticated)
181 181
             {
182 182
                 string location = "未知";
183 183
 
184 184
                 string tel = HttpUtility.UrlDecode(RequestString.GetQueryString("tel"));
185
-                if (tel.Trim().Length == 11 && tel.Substring(0, 1) != "0")
185
+
186
+                if (tel.Trim().Length == 12)
186 187
                 {
187 188
                     BLL.T_Sys_MobileData mobile_Bll = new BLL.T_Sys_MobileData();
188
-                    Model.T_Sys_MobileData mobileModel = mobile_Bll.GetModelList(" F_MobileNum='" + tel.Substring(0, 7) + "' ").FirstOrDefault();
189
+                    Model.T_Sys_MobileData mobileModel = mobile_Bll.GetModelList(" F_MobileNum='" + tel.Substring(1, 7) + "' ").FirstOrDefault();
189 190
 
190 191
                     if (mobileModel != null)
191 192
                     {
192 193
                         location = mobileModel.F_CityDes + mobileModel.F_CardDes;
193 194
                     }
195
+                    else
196
+                    {
197
+                        BLL.T_Sys_TelTitleData numbBll = new BLL.T_Sys_TelTitleData();
198
+                        List<Model.T_Sys_TelTitleData> mobileModel1 = numbBll.GetModelList(" F_KeyPhoneNum='" + tel.Substring(0, 4) + "'");
199
+                        if (mobileModel1 == null || mobileModel1.Count <= 0)
200
+                        {
201
+                            mobileModel1 = numbBll.GetModelList(" F_KeyPhoneNum='" + tel.Substring(0, 3) + "'");
202
+                        }
203
+                        if (mobileModel1.Count > 0)
204
+                        {
205
+                            location = mobileModel1[0].F_TitleName;
206
+                        }
207
+                    }
194 208
                 }
195 209
                 else
196 210
                 {
197
-                    BLL.T_Sys_TelTitleData numbBll = new BLL.T_Sys_TelTitleData();
198
-                    List<Model.T_Sys_TelTitleData> mobileModel = numbBll.GetModelList(" 1=1 and F_KeyPhoneNum='" + tel.Substring(0, 4) + "'");
199
-                    if (mobileModel == null || mobileModel.Count <= 0)
211
+                    if (tel.Trim().Length == 11 && tel.Substring(0, 1) != "0")
200 212
                     {
201
-                        mobileModel = numbBll.GetModelList(" 1=1 and F_KeyPhoneNum='" + tel.Substring(0, 3) + "'");
213
+                        BLL.T_Sys_MobileData mobile_Bll = new BLL.T_Sys_MobileData();
214
+                        Model.T_Sys_MobileData mobileModel = mobile_Bll.GetModelList(" F_MobileNum='" + tel.Substring(0, 7) + "' ").FirstOrDefault();
215
+
216
+                        if (mobileModel != null)
217
+                        {
218
+                            location = mobileModel.F_CityDes + mobileModel.F_CardDes;
219
+                        }
202 220
                     }
203
-                    if (mobileModel.Count > 0)
221
+                    else
204 222
                     {
205
-                        location = mobileModel[0].F_TitleName;
223
+                        BLL.T_Sys_TelTitleData numbBll = new BLL.T_Sys_TelTitleData();
224
+                        List<Model.T_Sys_TelTitleData> mobileModel = numbBll.GetModelList(" F_KeyPhoneNum='" + tel.Substring(0, 4) + "'");
225
+                        if (mobileModel == null || mobileModel.Count <= 0)
226
+                        {
227
+                            mobileModel = numbBll.GetModelList(" F_KeyPhoneNum='" + tel.Substring(0, 3) + "'");
228
+                        }
229
+                        if (mobileModel.Count > 0)
230
+                        {
231
+                            location = mobileModel[0].F_TitleName;
232
+                        }
206 233
                     }
207 234
                 }
208 235
 
209
-                res = Success("归属地加载成功", location);
236
+                return Success("归属地加载成功", location);
210 237
 
211 238
             }
212
-            return res;
239
+            return NoToken("未知错误,请重新登录");
213 240
         }
214 241
 
215 242
         /// <summary>
@@ -218,7 +245,7 @@ namespace CallCenterApi.Interface.Controllers.tel
218 245
         /// <returns></returns>
219 246
         public ActionResult GetOldList()
220 247
         {
221
-            ActionResult res = NoToken("未知错误,请重新登录");
248
+            
222 249
             if (Request.IsAuthenticated)
223 250
             {
224 251
                 int userId = CurrentUser.UserData.F_UserId;
@@ -369,11 +396,11 @@ namespace CallCenterApi.Interface.Controllers.tel
369 396
                             hrcount = hrcount,
370 397
                             hccount = hccount,
371 398
                         };
372
-                        res = Content(obj.ToJson());
399
+                        return Content(obj.ToJson());
373 400
                     }
374 401
                 }
375 402
             }
376
-            return res;
403
+            return NoToken("未知错误,请重新登录");
377 404
         }
378 405
 
379 406
         /// <summary>
@@ -382,7 +409,7 @@ namespace CallCenterApi.Interface.Controllers.tel
382 409
         /// <returns></returns>
383 410
         public ActionResult GetZSKList()
384 411
         {
385
-            ActionResult res = NoToken("未知错误,请重新登录");
412
+            
386 413
             if (Request.IsAuthenticated)
387 414
             {
388 415
 
@@ -403,10 +430,10 @@ namespace CallCenterApi.Interface.Controllers.tel
403 430
 
404 431
                 dt = new BLL.T_RepositoryInformation().GetList(8, sql, " F_RepositoryId desc").Tables[0];
405 432
 
406
-                res = Success("加载成功", dt);
433
+                return Success("加载成功", dt);
407 434
 
408 435
             }
409
-            return res;
436
+            return NoToken("未知错误,请重新登录");
410 437
         }
411 438
 
412 439
         /// <summary>
@@ -415,7 +442,7 @@ namespace CallCenterApi.Interface.Controllers.tel
415 442
         /// <returns></returns>
416 443
         public ActionResult UpdateZL()
417 444
         {
418
-            ActionResult res = NoToken("未知错误,请重新登录");
445
+            
419 446
             if (Request.IsAuthenticated)
420 447
             {
421 448
 
@@ -437,18 +464,18 @@ namespace CallCenterApi.Interface.Controllers.tel
437 464
                         bool bl = new BLL.T_Call_CallRecords().UpdateCallInRingTelRecord(model);
438 465
                         if (bl)
439 466
                         {
440
-                            res = Success("更新振铃状态成功");
467
+                            return Success("更新振铃状态成功");
441 468
                         }
442 469
                         else
443 470
                         {
444
-                            // res = Error("更新振铃状态失败");
445
-                            res = Success("更新振铃状态失败");
471
+                            // return Error("更新振铃状态失败");
472
+                            return Success("更新振铃状态失败");
446 473
                         }
447 474
                     }
448 475
                 }
449 476
 
450 477
             }
451
-            return res;
478
+            return NoToken("未知错误,请重新登录");
452 479
         }
453 480
 
454 481
         /// <summary>
@@ -457,7 +484,7 @@ namespace CallCenterApi.Interface.Controllers.tel
457 484
         /// <returns></returns>
458 485
         public ActionResult UpdateZJ()
459 486
         {
460
-            ActionResult res = NoToken("未知错误,请重新登录");
487
+            
461 488
             if (Request.IsAuthenticated)
462 489
             {
463 490
 
@@ -475,16 +502,16 @@ namespace CallCenterApi.Interface.Controllers.tel
475 502
                         new BLL.T_Call_TaskTelNum().UpdateYJ(Convert.ToInt32(vmodel.OperateObject.ToString()), 1);
476 503
                     }
477 504
 
478
-                    res = Success("更新摘机状态成功");
505
+                    return Success("更新摘机状态成功");
479 506
                 }
480 507
                 else
481 508
                 {
482
-                    //res = Error("更新摘机状态失败");
483
-                    res = Success("更新摘机状态失败");
509
+                    //return Error("更新摘机状态失败");
510
+                    return Success("更新摘机状态失败");
484 511
                 }
485 512
 
486 513
             }
487
-            return res;
514
+            return NoToken("未知错误,请重新登录");
488 515
         }
489 516
 
490 517
         /// <summary>
@@ -493,7 +520,7 @@ namespace CallCenterApi.Interface.Controllers.tel
493 520
         /// <returns></returns>
494 521
         public ActionResult UpdateGJ()
495 522
         {
496
-            ActionResult res = NoToken("未知错误,请重新登录");
523
+            
497 524
             if (Request.IsAuthenticated)
498 525
             {
499 526
 
@@ -501,15 +528,15 @@ namespace CallCenterApi.Interface.Controllers.tel
501 528
                 bool bl = new BLL.T_Call_CallRecords().UpdateCallInHookTelRecord(strid);
502 529
                 if (bl)
503 530
                 {
504
-                    res = Success("更新挂机状态成功");
531
+                    return Success("更新挂机状态成功");
505 532
                 }
506 533
                 else
507 534
                 {
508
-                    res = Success("更新挂机状态失败");
535
+                    return Success("更新挂机状态失败");
509 536
                 }
510 537
 
511 538
             }
512
-            return res;
539
+            return NoToken("未知错误,请重新登录");
513 540
         }
514 541
 
515 542
         /// <summary>
@@ -518,7 +545,7 @@ namespace CallCenterApi.Interface.Controllers.tel
518 545
         /// <returns></returns>
519 546
         public ActionResult UpdateLY()
520 547
         {
521
-            ActionResult res = NoToken("未知错误,请重新登录");
548
+            
522 549
             if (Request.IsAuthenticated)
523 550
             {
524 551
 
@@ -537,15 +564,15 @@ namespace CallCenterApi.Interface.Controllers.tel
537 564
                         new BLL.T_Call_TaskTelNum().UpdateYJ(Convert.ToInt32(vmodel.OperateObject.ToString()), 1);
538 565
                     }
539 566
 
540
-                    res = Success("更新挂机状态成功");
567
+                    return Success("更新挂机状态成功");
541 568
                 }
542 569
                 else
543 570
                 {
544
-                    res = Success("更新挂机状态失败");
571
+                    return Success("更新挂机状态失败");
545 572
                 }
546 573
 
547 574
             }
548
-            return res;
575
+            return NoToken("未知错误,请重新登录");
549 576
         }
550 577
 
551 578
         /// <summary>
@@ -554,7 +581,7 @@ namespace CallCenterApi.Interface.Controllers.tel
554 581
         /// <returns></returns>
555 582
         public ActionResult AddWorkOrder()
556 583
         {
557
-            ActionResult res = NoToken("未知错误,请重新登录");
584
+            
558 585
             if (Request.IsAuthenticated)
559 586
             {
560 587
 
@@ -763,7 +790,7 @@ namespace CallCenterApi.Interface.Controllers.tel
763 790
                                     F_RelationShipClass = fkdep
764 791
                                 });
765 792
                                 //if (cusid > 0)
766
-                                //    res = Success("新增成功!");
793
+                                //    return Success("新增成功!");
767 794
                             }
768 795
                             else
769 796
                             {
@@ -812,14 +839,14 @@ namespace CallCenterApi.Interface.Controllers.tel
812 839
                                     CacheHelper.Insert("LDDep", lddep_cache);
813 840
                                 }
814 841
                                 else
815
-                                    res = Error("获取失败,没有对应数据");
842
+                                    return Error("获取失败,没有对应数据");
816 843
                             }
817 844
                             #endregion
818
-                            res = Success("新增成功!");
845
+                            return Success("新增成功!");
819 846
                         }
820 847
                         else
821 848
                         {
822
-                            res = Error("新增失败!");
849
+                            return Error("新增失败!");
823 850
                         }
824 851
 
825 852
                         #region no use
@@ -851,17 +878,17 @@ namespace CallCenterApi.Interface.Controllers.tel
851 878
 
852 879
                         //if (new BLL.T_Wo_WorkOrderBase().Add(model) > 0)
853 880
                         //{
854
-                        //    res = Success("新增成功!");
881
+                        //    return Success("新增成功!");
855 882
                         //}
856 883
                         //else
857 884
                         //{
858
-                        //    res = Error("新增失败!");
885
+                        //    return Error("新增失败!");
859 886
                         //} 
860 887
                         #endregion
861 888
                     }
862 889
                 }
863 890
             }
864
-            return res;
891
+            return NoToken("未知错误,请重新登录");
865 892
         }
866 893
 
867 894
         /// <summary>
@@ -870,7 +897,7 @@ namespace CallCenterApi.Interface.Controllers.tel
870 897
         /// <returns></returns>
871 898
         public ActionResult GetCurrUserDep()
872 899
         {
873
-            ActionResult res = NoToken("未知错误,请重新登录");
900
+            
874 901
             if (Request.IsAuthenticated)
875 902
             {
876 903
                 int? groid = CurrentUser.UserData.F_SeartGroupID;
@@ -899,9 +926,9 @@ namespace CallCenterApi.Interface.Controllers.tel
899 926
                     groid = groid,
900 927
                     groname = groname
901 928
                 };
902
-                res = Success("获取坐席部门成功!", obj);
929
+                return Success("获取坐席部门成功!", obj);
903 930
             }
904
-            return res;
931
+            return NoToken("未知错误,请重新登录");
905 932
         }
906 933
 
907 934
         /// <summary>
@@ -910,7 +937,7 @@ namespace CallCenterApi.Interface.Controllers.tel
910 937
         /// <returns></returns>
911 938
         public ActionResult GetUsers()
912 939
         {
913
-            ActionResult res = NoToken("未知错误,请重新登录");
940
+            
914 941
             if (Request.IsAuthenticated)
915 942
             {
916 943
                 int depid = CurrentUser.UserData.F_DeptId;
@@ -920,9 +947,9 @@ namespace CallCenterApi.Interface.Controllers.tel
920 947
                 {
921 948
                     user = list
922 949
                 };
923
-                res = Success("获取坐席成功!", obj);
950
+                return Success("获取坐席成功!", obj);
924 951
             }
925
-            return res;
952
+            return NoToken("未知错误,请重新登录");
926 953
         }
927 954
     }
928 955
 }