zhoufan 7 vuotta sitten
vanhempi
commit
db0d61090e

+ 9 - 14
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/YearContrastController.cs

@@ -82,22 +82,17 @@ namespace CallCenterApi.Interface.Controllers.report
82 82
         //导出数据
83 83
         public ActionResult ExptList(string beginyear, string endyear, string dpt)
84 84
         {
85
-            ActionResult res = NoToken("未知错误,请重新登录");
86
-            //if (Request.IsAuthenticated)
87
-            if(1==1)
85
+            NPOIHelper npoi = new NPOIHelper();
86
+            DataTable dt = GetData(beginyear, endyear, dpt);
87
+            if (npoi.ExportToExcel("呼叫数据分析数据", dt) == "")
88 88
             {
89
-                NPOIHelper npoi = new NPOIHelper();
90
-                DataTable dt = GetData(beginyear, endyear, dpt);
91
-                if (npoi.ExportToExcel("呼叫数据分析数据", dt) == "")
92
-                {
93
-                    return Success("导出成功");
94
-                }
95
-                else
96
-                {
97
-                    return Error("导出失败");
98
-                }
89
+                return Success("导出成功");
99 90
             }
100
-            return res;
91
+            else
92
+            {
93
+                return Error("导出失败");
94
+            }
95
+
101 96
         }
102 97
 
103 98
         private DataTable GetData(string beginyear, string endyear, string dpt)

+ 40 - 55
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/MobiledataController.cs

@@ -16,7 +16,6 @@ namespace CallCenterApi.Interface.Controllers.tel
16 16
         //获取号码归属地列表
17 17
         public ActionResult GetList(string strtelnum)
18 18
         {
19
-            ActionResult res = NoToken("未知错误,请重新登录");
20 19
             if (Request.IsAuthenticated)
21 20
             {
22 21
                 string sql = " and F_IsDelete=0";
@@ -62,27 +61,25 @@ namespace CallCenterApi.Interface.Controllers.tel
62 61
                     total = recordCount
63 62
                 };
64 63
 
65
-                res = Content(obj.ToJson());
64
+                return Content(obj.ToJson());
66 65
 
67 66
             }
68
-            return res;
67
+            return NoToken("未知错误,请重新登录");
69 68
         }
70 69
         public ActionResult GetMobiledata(int id)
71 70
         {
72
-            ActionResult res = NoToken("未知错误,请重新登录");
73 71
             if (Request.IsAuthenticated)
74 72
             {
75 73
                 BLL.T_Sys_MobileData dBLL = new BLL.T_Sys_MobileData();
76 74
                 Model.T_Sys_MobileData dModel = dBLL.GetModel(id);
77
-                res = Success("获取号码归属地成功", dModel);
75
+                return Success("获取号码归属地成功", dModel);
78 76
             }
79
-            return res;
77
+            return NoToken("未知错误,请重新登录");
80 78
         }
81 79
 
82 80
         //获取号码归属地
83 81
         public ActionResult GetMobiledataByNum(string mobileNum)
84 82
         {
85
-            ActionResult res = NoToken("未知错误,请重新登录");
86 83
             if (Request.IsAuthenticated)
87 84
             {
88 85
 
@@ -92,26 +89,25 @@ namespace CallCenterApi.Interface.Controllers.tel
92 89
                     Model.T_Sys_MobileData dModel = dBLL.GetModelList(" F_MobileNum='" + mobileNum.Trim() + "' ").FirstOrDefault();
93 90
                     if (dModel != null)
94 91
                     {
95
-                        res = Success("获取号码归属地成功", dModel);
92
+                        return Success("获取号码归属地成功", dModel);
96 93
                     }
97 94
                     else
98 95
                     {
99
-                        res = Error("获取号码归属地失败");
96
+                        return Error("获取号码归属地失败");
100 97
                     }
101 98
                 }
102 99
                 else
103 100
                 {
104
-                    res = Error("获取参数失败");
101
+                    return Error("获取参数失败");
105 102
                 }
106 103
 
107 104
             }
108
-            return res;
105
+            return NoToken("未知错误,请重新登录");
109 106
         }
110 107
 
111 108
         //添加/编辑号码归属地
112 109
         public ActionResult AddMobiledata(string mobileNum, string zipCode, string cityDes, string cardDes, int id = 0)
113 110
         {
114
-            ActionResult res = NoToken("未知错误,请重新登录");
115 111
             if (Request.IsAuthenticated)
116 112
             {
117 113
                 int userId = CurrentUser.UserData.F_UserId;
@@ -145,16 +141,16 @@ namespace CallCenterApi.Interface.Controllers.tel
145 141
                         bool b = dBLL.Update(dModel);
146 142
                         if (b)
147 143
                         {
148
-                            res = Success("编辑成功");
144
+                            return Success("编辑成功");
149 145
                         }
150 146
                         else
151 147
                         {
152
-                            res = Error("编辑失败");
148
+                            return Error("编辑失败");
153 149
                         }
154 150
                     }
155 151
                     else
156 152
                     {
157
-                        res = Error("编辑失败");
153
+                        return Error("编辑失败");
158 154
                     }
159 155
                 }
160 156
                 else
@@ -183,22 +179,21 @@ namespace CallCenterApi.Interface.Controllers.tel
183 179
                     int n = new BLL.T_Sys_MobileData().Add(dModel);
184 180
                     if (n > 0)
185 181
                     {
186
-                        res = Success("添加成功", n);
182
+                        return Success("添加成功", n);
187 183
                     }
188 184
                     else
189 185
                     {
190
-                        res = Error("添加失败");
186
+                        return Error("添加失败");
191 187
                     }
192 188
                 }
193 189
 
194 190
             }
195
-            return res;
191
+            return NoToken("未知错误,请重新登录");
196 192
         }
197 193
 
198 194
         //删除号码归属地记录
199 195
         public ActionResult DelMobiledata(string[] nums)
200 196
         {
201
-            ActionResult res = NoToken("未知错误,请重新登录");
202 197
             if (Request.IsAuthenticated)
203 198
             {
204 199
                 int userId = CurrentUser.UserData.F_UserId;
@@ -212,24 +207,23 @@ namespace CallCenterApi.Interface.Controllers.tel
212 207
                     }
213 208
                     if (new BLL.T_Sys_MobileData().DeleteList(idd.TrimEnd(','), ua.F_UserCode))
214 209
                     {
215
-                        res = Success("删除成功");
210
+                        return Success("删除成功");
216 211
                     }
217 212
                     else
218
-                        res = Error("删除失败");
213
+                        return Error("删除失败");
219 214
                 }
220 215
                 else
221 216
                 {
222
-                    res = Error("请选择要删除的记录");
217
+                    return Error("请选择要删除的记录");
223 218
                 }
224 219
 
225 220
             }
226
-            return res;
221
+            return NoToken("未知错误,请重新登录");
227 222
         }
228 223
 
229 224
         //IVR获取号码归属地
230 225
         public ActionResult IVRGetList(string strtelnum)
231 226
         {
232
-            ActionResult res = NoToken("未知错误,请重新登录");
233 227
             if (Request.IsAuthenticated)
234 228
             {
235 229
                 string sql = " and isDelete=0";
@@ -274,10 +268,10 @@ namespace CallCenterApi.Interface.Controllers.tel
274 268
                     total = recordCount
275 269
                 };
276 270
 
277
-                res = Content(obj.ToJson());
271
+                return Content(obj.ToJson());
278 272
 
279 273
             }
280
-            return res;
274
+            return NoToken("未知错误,请重新登录");
281 275
         }
282 276
         public ActionResult GetMobileUsersData(int id)
283 277
         {
@@ -286,14 +280,13 @@ namespace CallCenterApi.Interface.Controllers.tel
286 280
             {
287 281
                 BLL.telloc_users dBLL = new BLL.telloc_users();
288 282
                 Model.telloc_users dModel = dBLL.GetModel(id);
289
-                res = Success("获取号码归属地成功", dModel);
283
+                return Success("获取号码归属地成功", dModel);
290 284
             }
291
-            return res;
285
+            return NoToken("未知错误,请重新登录");
292 286
         }
293 287
         //获取IVR号码归属地坐席关联
294 288
         public ActionResult GetMobileUsersList()
295 289
         {
296
-            ActionResult res = NoToken("未知错误,请重新登录");
297 290
             if (Request.IsAuthenticated)
298 291
             {
299 292
                 string sql = " and isDelete=0";
@@ -382,14 +375,13 @@ namespace CallCenterApi.Interface.Controllers.tel
382 375
                     total = recordCount
383 376
                 };
384 377
 
385
-                res = Content(obj.ToJson());
378
+                return Content(obj.ToJson());
386 379
             }
387
-            return res;
380
+            return NoToken("未知错误,请重新登录");
388 381
         }
389 382
         //添加/修改IVR号码归属地坐席关联
390 383
         public ActionResult AddMobileUsers(int tellocid, int userid, int type)
391 384
         {
392
-            ActionResult res = NoToken("未知错误,请重新登录");
393 385
             if (Request.IsAuthenticated)
394 386
             {
395 387
                 int userId = CurrentUser.UserData.F_UserId;
@@ -442,15 +434,7 @@ namespace CallCenterApi.Interface.Controllers.tel
442 434
                 //}
443 435
 
444 436
 
445
-                dModel = new Model.telloc_users();
446
-                if (!string.IsNullOrWhiteSpace(tellocid.ToString()))
447
-                {
448
-                    dModel.tellocid = tellocid;
449
-                }
450
-                if (!string.IsNullOrWhiteSpace(userid.ToString()))
451
-                {
452
-                    dModel.userid = userid;
453
-                }
437
+
454 438
                 dModel = dBLL.GetModel(userid, tellocid);
455 439
                 if (dModel != null)
456 440
                 {
@@ -459,33 +443,35 @@ namespace CallCenterApi.Interface.Controllers.tel
459 443
                     var str = type == 1 ? "解除" : "添加";
460 444
                     if (b)
461 445
                     {
462
-                        res = Success(str + "成功");
446
+                        return Success(str + "成功");
463 447
                     }
464 448
                     else
465 449
                     {
466
-                        res = Error(str + "失败");
450
+                        return Error(str + "失败");
467 451
                     }
468 452
                 }
469 453
                 else
470 454
                 {
455
+                    dModel = new Model.telloc_users();
456
+                    dModel.tellocid = tellocid;
457
+                    dModel.userid = userid;
471 458
                     dModel.isdelete = 0;
472 459
                     int n = new BLL.telloc_users().Add(dModel);
473 460
                     if (n > 0)
474 461
                     {
475
-                        res = Success("添加成功", n);
462
+                        return Success("添加成功", n);
476 463
                     }
477 464
                     else
478 465
                     {
479
-                        res = Error("添加失败");
466
+                        return Error("添加失败");
480 467
                     }
481 468
                 }
482 469
             }
483
-            return res;
470
+            return NoToken("未知错误,请重新登录");
484 471
         }
485 472
         //删除IVR号码归属地坐席关联
486 473
         public ActionResult DeleteMobileUsers(int id)
487 474
         {
488
-            ActionResult res = NoToken("未知错误,请重新登录");
489 475
             if (Request.IsAuthenticated)
490 476
             {
491 477
                 BLL.telloc_users dBLL = new BLL.telloc_users();
@@ -500,37 +486,36 @@ namespace CallCenterApi.Interface.Controllers.tel
500 486
                         bool b = dBLL.Update(dModel);
501 487
                         if (b)
502 488
                         {
503
-                            res = Success("删除成功");
489
+                            return Success("删除成功");
504 490
                         }
505 491
                         else
506 492
                         {
507
-                            res = Error("删除失败");
493
+                            return Error("删除失败");
508 494
                         }
509 495
                     }
510 496
                     else
511 497
                     {
512
-                        res = Error("删除失败");
498
+                        return Error("删除失败");
513 499
                     }
514 500
                 }
515 501
                 else
516 502
                 {
517
-                    res = Error("传入参数错误");
503
+                    return Error("传入参数错误");
518 504
                 }
519 505
 
520 506
             }
521
-            return res;
507
+            return NoToken("未知错误,请重新登录");
522 508
         }
523 509
 
524 510
         public ActionResult GetSeatGroup()
525 511
         {
526
-            ActionResult res = NoToken("未知错误,请重新登录");
527 512
             if (Request.IsAuthenticated)
528 513
             {
529 514
                 BLL.T_Sys_SeatGroup dBLL = new BLL.T_Sys_SeatGroup();
530 515
                 var seatgroups = dBLL.GetModelList("1=1").Select(n => new { n.F_ZXZID, n.F_ZXZName });
531
-                res = Success("获取坐席组成功", seatgroups);
516
+                return Success("获取坐席组成功", seatgroups);
532 517
             }
533
-            return res;
518
+            return NoToken("未知错误,请重新登录");
534 519
         }
535 520
     }
536 521
 }