zhoufan il y a 7 ans
Parent
commit
db0d61090e

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

82
         //导出数据
82
         //导出数据
83
         public ActionResult ExptList(string beginyear, string endyear, string dpt)
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
         private DataTable GetData(string beginyear, string endyear, string dpt)
98
         private DataTable GetData(string beginyear, string endyear, string dpt)

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

16
         //获取号码归属地列表
16
         //获取号码归属地列表
17
         public ActionResult GetList(string strtelnum)
17
         public ActionResult GetList(string strtelnum)
18
         {
18
         {
19
-            ActionResult res = NoToken("未知错误,请重新登录");
20
             if (Request.IsAuthenticated)
19
             if (Request.IsAuthenticated)
21
             {
20
             {
22
                 string sql = " and F_IsDelete=0";
21
                 string sql = " and F_IsDelete=0";
62
                     total = recordCount
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
         public ActionResult GetMobiledata(int id)
69
         public ActionResult GetMobiledata(int id)
71
         {
70
         {
72
-            ActionResult res = NoToken("未知错误,请重新登录");
73
             if (Request.IsAuthenticated)
71
             if (Request.IsAuthenticated)
74
             {
72
             {
75
                 BLL.T_Sys_MobileData dBLL = new BLL.T_Sys_MobileData();
73
                 BLL.T_Sys_MobileData dBLL = new BLL.T_Sys_MobileData();
76
                 Model.T_Sys_MobileData dModel = dBLL.GetModel(id);
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
         public ActionResult GetMobiledataByNum(string mobileNum)
81
         public ActionResult GetMobiledataByNum(string mobileNum)
84
         {
82
         {
85
-            ActionResult res = NoToken("未知错误,请重新登录");
86
             if (Request.IsAuthenticated)
83
             if (Request.IsAuthenticated)
87
             {
84
             {
88
 
85
 
92
                     Model.T_Sys_MobileData dModel = dBLL.GetModelList(" F_MobileNum='" + mobileNum.Trim() + "' ").FirstOrDefault();
89
                     Model.T_Sys_MobileData dModel = dBLL.GetModelList(" F_MobileNum='" + mobileNum.Trim() + "' ").FirstOrDefault();
93
                     if (dModel != null)
90
                     if (dModel != null)
94
                     {
91
                     {
95
-                        res = Success("获取号码归属地成功", dModel);
92
+                        return Success("获取号码归属地成功", dModel);
96
                     }
93
                     }
97
                     else
94
                     else
98
                     {
95
                     {
99
-                        res = Error("获取号码归属地失败");
96
+                        return Error("获取号码归属地失败");
100
                     }
97
                     }
101
                 }
98
                 }
102
                 else
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
         public ActionResult AddMobiledata(string mobileNum, string zipCode, string cityDes, string cardDes, int id = 0)
109
         public ActionResult AddMobiledata(string mobileNum, string zipCode, string cityDes, string cardDes, int id = 0)
113
         {
110
         {
114
-            ActionResult res = NoToken("未知错误,请重新登录");
115
             if (Request.IsAuthenticated)
111
             if (Request.IsAuthenticated)
116
             {
112
             {
117
                 int userId = CurrentUser.UserData.F_UserId;
113
                 int userId = CurrentUser.UserData.F_UserId;
145
                         bool b = dBLL.Update(dModel);
141
                         bool b = dBLL.Update(dModel);
146
                         if (b)
142
                         if (b)
147
                         {
143
                         {
148
-                            res = Success("编辑成功");
144
+                            return Success("编辑成功");
149
                         }
145
                         }
150
                         else
146
                         else
151
                         {
147
                         {
152
-                            res = Error("编辑失败");
148
+                            return Error("编辑失败");
153
                         }
149
                         }
154
                     }
150
                     }
155
                     else
151
                     else
156
                     {
152
                     {
157
-                        res = Error("编辑失败");
153
+                        return Error("编辑失败");
158
                     }
154
                     }
159
                 }
155
                 }
160
                 else
156
                 else
183
                     int n = new BLL.T_Sys_MobileData().Add(dModel);
179
                     int n = new BLL.T_Sys_MobileData().Add(dModel);
184
                     if (n > 0)
180
                     if (n > 0)
185
                     {
181
                     {
186
-                        res = Success("添加成功", n);
182
+                        return Success("添加成功", n);
187
                     }
183
                     }
188
                     else
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
         public ActionResult DelMobiledata(string[] nums)
195
         public ActionResult DelMobiledata(string[] nums)
200
         {
196
         {
201
-            ActionResult res = NoToken("未知错误,请重新登录");
202
             if (Request.IsAuthenticated)
197
             if (Request.IsAuthenticated)
203
             {
198
             {
204
                 int userId = CurrentUser.UserData.F_UserId;
199
                 int userId = CurrentUser.UserData.F_UserId;
212
                     }
207
                     }
213
                     if (new BLL.T_Sys_MobileData().DeleteList(idd.TrimEnd(','), ua.F_UserCode))
208
                     if (new BLL.T_Sys_MobileData().DeleteList(idd.TrimEnd(','), ua.F_UserCode))
214
                     {
209
                     {
215
-                        res = Success("删除成功");
210
+                        return Success("删除成功");
216
                     }
211
                     }
217
                     else
212
                     else
218
-                        res = Error("删除失败");
213
+                        return Error("删除失败");
219
                 }
214
                 }
220
                 else
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
         //IVR获取号码归属地
224
         //IVR获取号码归属地
230
         public ActionResult IVRGetList(string strtelnum)
225
         public ActionResult IVRGetList(string strtelnum)
231
         {
226
         {
232
-            ActionResult res = NoToken("未知错误,请重新登录");
233
             if (Request.IsAuthenticated)
227
             if (Request.IsAuthenticated)
234
             {
228
             {
235
                 string sql = " and isDelete=0";
229
                 string sql = " and isDelete=0";
274
                     total = recordCount
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
         public ActionResult GetMobileUsersData(int id)
276
         public ActionResult GetMobileUsersData(int id)
283
         {
277
         {
286
             {
280
             {
287
                 BLL.telloc_users dBLL = new BLL.telloc_users();
281
                 BLL.telloc_users dBLL = new BLL.telloc_users();
288
                 Model.telloc_users dModel = dBLL.GetModel(id);
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
         //获取IVR号码归属地坐席关联
287
         //获取IVR号码归属地坐席关联
294
         public ActionResult GetMobileUsersList()
288
         public ActionResult GetMobileUsersList()
295
         {
289
         {
296
-            ActionResult res = NoToken("未知错误,请重新登录");
297
             if (Request.IsAuthenticated)
290
             if (Request.IsAuthenticated)
298
             {
291
             {
299
                 string sql = " and isDelete=0";
292
                 string sql = " and isDelete=0";
382
                     total = recordCount
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
         //添加/修改IVR号码归属地坐席关联
382
         //添加/修改IVR号码归属地坐席关联
390
         public ActionResult AddMobileUsers(int tellocid, int userid, int type)
383
         public ActionResult AddMobileUsers(int tellocid, int userid, int type)
391
         {
384
         {
392
-            ActionResult res = NoToken("未知错误,请重新登录");
393
             if (Request.IsAuthenticated)
385
             if (Request.IsAuthenticated)
394
             {
386
             {
395
                 int userId = CurrentUser.UserData.F_UserId;
387
                 int userId = CurrentUser.UserData.F_UserId;
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
                 dModel = dBLL.GetModel(userid, tellocid);
438
                 dModel = dBLL.GetModel(userid, tellocid);
455
                 if (dModel != null)
439
                 if (dModel != null)
456
                 {
440
                 {
459
                     var str = type == 1 ? "解除" : "添加";
443
                     var str = type == 1 ? "解除" : "添加";
460
                     if (b)
444
                     if (b)
461
                     {
445
                     {
462
-                        res = Success(str + "成功");
446
+                        return Success(str + "成功");
463
                     }
447
                     }
464
                     else
448
                     else
465
                     {
449
                     {
466
-                        res = Error(str + "失败");
450
+                        return Error(str + "失败");
467
                     }
451
                     }
468
                 }
452
                 }
469
                 else
453
                 else
470
                 {
454
                 {
455
+                    dModel = new Model.telloc_users();
456
+                    dModel.tellocid = tellocid;
457
+                    dModel.userid = userid;
471
                     dModel.isdelete = 0;
458
                     dModel.isdelete = 0;
472
                     int n = new BLL.telloc_users().Add(dModel);
459
                     int n = new BLL.telloc_users().Add(dModel);
473
                     if (n > 0)
460
                     if (n > 0)
474
                     {
461
                     {
475
-                        res = Success("添加成功", n);
462
+                        return Success("添加成功", n);
476
                     }
463
                     }
477
                     else
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
         //删除IVR号码归属地坐席关联
472
         //删除IVR号码归属地坐席关联
486
         public ActionResult DeleteMobileUsers(int id)
473
         public ActionResult DeleteMobileUsers(int id)
487
         {
474
         {
488
-            ActionResult res = NoToken("未知错误,请重新登录");
489
             if (Request.IsAuthenticated)
475
             if (Request.IsAuthenticated)
490
             {
476
             {
491
                 BLL.telloc_users dBLL = new BLL.telloc_users();
477
                 BLL.telloc_users dBLL = new BLL.telloc_users();
500
                         bool b = dBLL.Update(dModel);
486
                         bool b = dBLL.Update(dModel);
501
                         if (b)
487
                         if (b)
502
                         {
488
                         {
503
-                            res = Success("删除成功");
489
+                            return Success("删除成功");
504
                         }
490
                         }
505
                         else
491
                         else
506
                         {
492
                         {
507
-                            res = Error("删除失败");
493
+                            return Error("删除失败");
508
                         }
494
                         }
509
                     }
495
                     }
510
                     else
496
                     else
511
                     {
497
                     {
512
-                        res = Error("删除失败");
498
+                        return Error("删除失败");
513
                     }
499
                     }
514
                 }
500
                 }
515
                 else
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
         public ActionResult GetSeatGroup()
510
         public ActionResult GetSeatGroup()
525
         {
511
         {
526
-            ActionResult res = NoToken("未知错误,请重新登录");
527
             if (Request.IsAuthenticated)
512
             if (Request.IsAuthenticated)
528
             {
513
             {
529
                 BLL.T_Sys_SeatGroup dBLL = new BLL.T_Sys_SeatGroup();
514
                 BLL.T_Sys_SeatGroup dBLL = new BLL.T_Sys_SeatGroup();
530
                 var seatgroups = dBLL.GetModelList("1=1").Select(n => new { n.F_ZXZID, n.F_ZXZName });
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
 }