Browse Source

增加大屏展示接口

mengjie 6 years ago
parent
commit
78e71f2f31

+ 7 - 1
CallCenterApi.Interface/CallCenterApi.Interface.csproj

@@ -45,6 +45,9 @@
45 45
     <Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
46 46
       <HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
47 47
     </Reference>
48
+    <Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
49
+      <HintPath>..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
50
+    </Reference>
48 51
     <Reference Include="System.Configuration">
49 52
       <HintPath>C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Configuration.dll</HintPath>
50 53
     </Reference>
@@ -105,6 +108,7 @@
105 108
     <Compile Include="Controllers\County\CountyTelController.cs" />
106 109
     <Compile Include="Controllers\DepartmentController.cs" />
107 110
     <Compile Include="Controllers\HomeController.cs" />
111
+    <Compile Include="Controllers\InfoController.cs" />
108 112
     <Compile Include="Controllers\Login\LoginController.cs" />
109 113
     <Compile Include="Controllers\FunctionController.cs" />
110 114
     <Compile Include="Controllers\RoleFunctionController.cs" />
@@ -134,7 +138,9 @@
134 138
       <DependentUpon>Web.config</DependentUpon>
135 139
     </None>
136 140
   </ItemGroup>
137
-  <ItemGroup />
141
+  <ItemGroup>
142
+    <Folder Include="Views\Info\" />
143
+  </ItemGroup>
138 144
   <ItemGroup>
139 145
     <ProjectReference Include="..\CallCenterApi.BLL\CallCenterApi.BLL.csproj">
140 146
       <Project>{d99011c9-0a57-4706-b073-091681effad7}</Project>

+ 786 - 0
CallCenterApi.Interface/Controllers/InfoController.cs

@@ -0,0 +1,786 @@
1
+using CallCenterApi.Common;
2
+using CallCenterApi.Interface.Controllers.Base;
3
+using Newtonsoft.Json;
4
+using Newtonsoft.Json.Linq;
5
+using System;
6
+using System.Collections;
7
+using System.Collections.Generic;
8
+using System.Linq;
9
+using System.Web;
10
+using System.Web.Mvc;
11
+
12
+namespace CallCenterApi.Interface.Controllers
13
+{
14
+    /// <summary>
15
+    /// 大屏公示系统
16
+    /// </summary>
17
+    //[Authority]
18
+    public class InfoController : BaseController
19
+    {
20
+        // GET: Info
21
+        public ActionResult Index()
22
+        {
23
+            return View();
24
+        }
25
+
26
+        #region 来源渠道
27
+        /// <summary>
28
+        /// 获取受理区域数量
29
+        /// </summary>
30
+        /// <param name="branchcode"></param>
31
+        /// <param name="date"></param>
32
+        /// <returns></returns>
33
+        public ActionResult GetAreaCount24ByDate(string branchcode, DateTime? date,string areaid)
34
+        {
35
+
36
+            if (date == null)
37
+            {               
38
+                date = DateTime.Now;
39
+            }
40
+            
41
+            //string sqlwhere = " F_IsDelete=0 ";
42
+            string sqlwhere = " F_IsDP=0 ";//大屏展示用到的
43
+            if (!string.IsNullOrEmpty(branchcode))
44
+            {
45
+                sqlwhere += " and F_Code='" + branchcode + "'";
46
+            }
47
+
48
+            ArrayList result = new ArrayList();
49
+            var list = new BLL.T_Branch_List().GetModelList(sqlwhere);
50
+            string controllername = RouteData.Values["controller"].ToString();
51
+            string actionname = RouteData.Values["action"].ToString();
52
+            foreach (var l in list)
53
+            {
54
+                if (!string.IsNullOrEmpty(l.F_Sign) && !string.IsNullOrEmpty(l.F_Url))
55
+                {
56
+                    string signcode = CommonHelper.getsigncode(controllername, actionname, l.F_Sign);
57
+                    string strparams = "?date=" + date.Value.ToString("yyyy-MM-dd") + "&areaid=" + areaid + "&signcode=" + signcode ;
58
+
59
+                    //AjaxResult ar = HttpMethods.HttpGet(l.F_Url + "/" + controllername + "/" + actionname + strparams).ToObject<AjaxResult>();
60
+                    string ar = HttpMethods.HttpGet(l.F_Url + "/" + controllername + "/" + actionname + strparams);
61
+                    //return Content(ar);//查询单个时直接返回
62
+                    JObject jo0 = (JObject)JsonConvert.DeserializeObject(ar);
63
+                    if (jo0 != null && jo0["state"].ToString() == ResultTypes.success.ToString())
64
+                    {
65
+                        
66
+                        string x = jo0["data"].ToString();
67
+                        string y = System.Text.RegularExpressions.Regex.Replace(jo0["data"]["hours"].ToString(), "[\r\n\t  ]", "");
68
+                        y = y.Replace("[","");
69
+                        y = y.Replace("]", "");
70
+                        string[] z = y.Split(',');
71
+                        var rtlist = jo0["data"]["hours"].ToJson ().ToList<Dictionary<string, object>>();
72
+                    }
73
+
74
+                    //    if (ar.state.ToString() == ResultTypes.success.ToString())
75
+                    //{
76
+                        
77
+                    //    //return Success("成功", ar.data );
78
+                    //    var  x = ar.data.ToJson();//Newtonsoft.Json.Linq.JObject
79
+                    //    var jObj = Newtonsoft.Json.Linq.JObject.Parse(x);
80
+                    //    var rtlist = jObj[0].ToList<Dictionary<string, object>>();
81
+                    //    //var rtlist = ar.data.ToJson().ToList<Dictionary<string, object>>();
82
+                    //    result.AddRange(rtlist);
83
+                    //}
84
+                }
85
+            }          
86
+            return Success("成功", result);
87
+        }
88
+
89
+        /// <summary>
90
+        /// 获取来源百分比
91
+        /// </summary>
92
+        /// <param name="branchcode"></param>
93
+        /// <param name="start"></param>
94
+        /// <param name="end"></param>
95
+        /// <returns></returns>
96
+        public ActionResult GetSourcePercentByDate(string branchcode, DateTime? start, DateTime? end)
97
+        {
98
+
99
+            if (start == null && end == null)
100
+            {
101
+                start = DateTime.Now;
102
+                end = DateTime.Now;
103
+            }
104
+            else
105
+            {
106
+                if (start == null) { start = DateTime.Now; }
107
+                if (end == null) { end = DateTime.Now; }
108
+                
109
+            }
110
+
111
+            string sqlwhere = " F_IsDelete=0 ";
112
+            if (!string.IsNullOrEmpty(branchcode))
113
+            {
114
+                sqlwhere += " and F_Code='" + branchcode + "'";
115
+            }
116
+
117
+            ArrayList result = new ArrayList();
118
+            var list = new BLL.T_Branch_List().GetModelList(sqlwhere);
119
+            string controllername = RouteData.Values["controller"].ToString();
120
+            string actionname = RouteData.Values["action"].ToString();
121
+            foreach (var l in list)
122
+            {
123
+                if (!string.IsNullOrEmpty(l.F_Sign) && !string.IsNullOrEmpty(l.F_Url))
124
+                {
125
+                    string signcode = CommonHelper.getsigncode(controllername, actionname, l.F_Sign);
126
+                    string strparams = "?start=" + start.Value.ToString("yyyy-MM-dd") + "&end=" + end.Value.ToString("yyyy-MM-dd") + "&signcode=" + signcode;
127
+
128
+                    AjaxResult ar = HttpMethods.HttpGet(l.F_Url + "/" + controllername + "/" + actionname + strparams).ToObject<AjaxResult>();
129
+
130
+                    if (ar.state.ToString() == ResultTypes.success.ToString())
131
+                    {
132
+                        var rtlist = ar.data.ToJson().ToList<Dictionary<string, object>>();
133
+                        result.AddRange(rtlist);
134
+                    }
135
+                }
136
+            }
137
+            return Success("成功", result);
138
+        }
139
+
140
+        /// <summary>
141
+        /// 获取受理区域数量
142
+        /// </summary>
143
+        /// <param name="branchcode"></param>
144
+        /// <param name="start"></param>
145
+        /// <param name="end"></param>
146
+        /// <returns></returns>
147
+        public ActionResult GetAreaCountByDate(string branchcode, DateTime? start, DateTime? end)
148
+        {
149
+
150
+            if (start == null && end == null)
151
+            {
152
+                start = DateTime.Now;
153
+                end = DateTime.Now;
154
+            }
155
+            else
156
+            {
157
+                if (start == null) { start = DateTime.Now; }
158
+                if (end == null) { end = DateTime.Now; }
159
+
160
+            }
161
+
162
+            string sqlwhere = " F_IsDelete=0 ";
163
+            if (!string.IsNullOrEmpty(branchcode))
164
+            {
165
+                sqlwhere += " and F_Code='" + branchcode + "'";
166
+            }
167
+
168
+            ArrayList result = new ArrayList();
169
+            var list = new BLL.T_Branch_List().GetModelList(sqlwhere);
170
+            string controllername = RouteData.Values["controller"].ToString();
171
+            string actionname = RouteData.Values["action"].ToString();
172
+            foreach (var l in list)
173
+            {
174
+                if (!string.IsNullOrEmpty(l.F_Sign) && !string.IsNullOrEmpty(l.F_Url))
175
+                {
176
+                    string signcode = CommonHelper.getsigncode(controllername, actionname, l.F_Sign);
177
+                    string strparams = "?start=" + start.Value.ToString("yyyy-MM-dd") + "&end=" + end.Value.ToString("yyyy-MM-dd") + "&signcode=" + signcode;
178
+
179
+                    AjaxResult ar = HttpMethods.HttpGet(l.F_Url + "/" + controllername + "/" + actionname + strparams).ToObject<AjaxResult>();
180
+
181
+                    if (ar.state.ToString() == ResultTypes.success.ToString())
182
+                    {
183
+                        var rtlist = ar.data.ToJson().ToList<Dictionary<string, object>>();
184
+                        result.AddRange(rtlist);
185
+                    }
186
+                }
187
+            }
188
+            return Success("成功", result);
189
+        }
190
+
191
+        /// <summary>
192
+        /// 获取来源数量百分比
193
+        /// </summary>
194
+        /// <param name="branchcode"></param>
195
+        /// <param name="start"></param>
196
+        /// <param name="end"></param>
197
+        /// <returns></returns>
198
+        public ActionResult GetSourceByDate(string branchcode, DateTime? start, DateTime? end)
199
+        {
200
+
201
+            if (start == null && end == null)
202
+            {
203
+                start = DateTime.Now;
204
+                end = DateTime.Now;
205
+            }
206
+            else
207
+            {
208
+                if (start == null) { start = DateTime.Now; }
209
+                if (end == null) { end = DateTime.Now; }
210
+
211
+            }
212
+
213
+            string sqlwhere = " F_IsDelete=0 ";
214
+            if (!string.IsNullOrEmpty(branchcode))
215
+            {
216
+                sqlwhere += " and F_Code='" + branchcode + "'";
217
+            }
218
+
219
+            ArrayList result = new ArrayList();
220
+            var list = new BLL.T_Branch_List().GetModelList(sqlwhere);
221
+            string controllername = RouteData.Values["controller"].ToString();
222
+            string actionname = RouteData.Values["action"].ToString();
223
+            foreach (var l in list)
224
+            {
225
+                if (!string.IsNullOrEmpty(l.F_Sign) && !string.IsNullOrEmpty(l.F_Url))
226
+                {
227
+                    string signcode = CommonHelper.getsigncode(controllername, actionname, l.F_Sign);
228
+                    string strparams = "?start=" + start.Value.ToString("yyyy-MM-dd") + "&end=" + end.Value.ToString("yyyy-MM-dd") + "&signcode=" + signcode;
229
+
230
+                    AjaxResult ar = HttpMethods.HttpGet(l.F_Url + "/" + controllername + "/" + actionname + strparams).ToObject<AjaxResult>();
231
+
232
+                    if (ar.state.ToString() == ResultTypes.success.ToString())
233
+                    {
234
+                        var rtlist = ar.data.ToJson().ToList<Dictionary<string, object>>();
235
+                        result.AddRange(rtlist);
236
+                    }
237
+                }
238
+            }
239
+            return Success("成功", result);
240
+        }
241
+        #endregion
242
+
243
+        #region 接单部门
244
+        /// <summary>
245
+        /// 接单情况汇总(月份)
246
+        /// </summary>
247
+        /// <param name="branchcode"></param>
248
+        /// <returns></returns>
249
+        public ActionResult GetStateCountMonthByDate(string branchcode)
250
+        {
251
+
252
+            string sqlwhere = " F_IsDelete=0 ";
253
+            if (!string.IsNullOrEmpty(branchcode))
254
+            {
255
+                sqlwhere += " and F_Code='" + branchcode + "'";
256
+            }
257
+
258
+            ArrayList result = new ArrayList();
259
+            var list = new BLL.T_Branch_List().GetModelList(sqlwhere);
260
+            string controllername = RouteData.Values["controller"].ToString();
261
+            string actionname = RouteData.Values["action"].ToString();
262
+            foreach (var l in list)
263
+            {
264
+                if (!string.IsNullOrEmpty(l.F_Sign) && !string.IsNullOrEmpty(l.F_Url))
265
+                {
266
+                    string signcode = CommonHelper.getsigncode(controllername, actionname, l.F_Sign);
267
+                    string strparams = "?signcode=" + signcode;
268
+
269
+                    AjaxResult ar = HttpMethods.HttpGet(l.F_Url + "/" + controllername + "/" + actionname + strparams).ToObject<AjaxResult>();
270
+
271
+                    if (ar.state.ToString() == ResultTypes.success.ToString())
272
+                    {
273
+                        var rtlist = ar.data.ToJson().ToList<Dictionary<string, object>>();
274
+                        result.AddRange(rtlist);
275
+                    }
276
+                }
277
+            }
278
+            return Success("成功", result);
279
+        }
280
+
281
+        /// <summary>
282
+        /// 获取承办单位数量
283
+        /// </summary>
284
+        /// <param name="branchcode"></param>
285
+        /// <param name="start"></param>
286
+        /// <param name="end"></param>
287
+        /// <param name="deptid"></param>
288
+        /// <returns></returns>
289
+        public ActionResult GetDeptCountByDateNew(string branchcode, DateTime? start, DateTime? end, int deptid = 0)
290
+        {
291
+
292
+            if (start == null && end == null)
293
+            {
294
+                start = DateTime.Now;
295
+                end = DateTime.Now;
296
+            }
297
+            else
298
+            {
299
+                if (start == null) { start = DateTime.Now; }
300
+                if (end == null) { end = DateTime.Now; }
301
+
302
+            }
303
+
304
+            string sqlwhere = " F_IsDelete=0 ";
305
+            if (!string.IsNullOrEmpty(branchcode))
306
+            {
307
+                sqlwhere += " and F_Code='" + branchcode + "'";
308
+            }
309
+
310
+            ArrayList result = new ArrayList();
311
+            var list = new BLL.T_Branch_List().GetModelList(sqlwhere);
312
+            string controllername = RouteData.Values["controller"].ToString();
313
+            string actionname = RouteData.Values["action"].ToString();
314
+            foreach (var l in list)
315
+            {
316
+                if (!string.IsNullOrEmpty(l.F_Sign) && !string.IsNullOrEmpty(l.F_Url))
317
+                {
318
+                    string signcode = CommonHelper.getsigncode(controllername, actionname, l.F_Sign);
319
+                    string strparams = "?start=" + start.Value.ToString("yyyy-MM-dd") + "&end=" + end.Value.ToString("yyyy-MM-dd") + "&deptid=" + deptid .ToString() + "&signcode=" + signcode;
320
+
321
+                    AjaxResult ar = HttpMethods.HttpGet(l.F_Url + "/" + controllername + "/" + actionname + strparams).ToObject<AjaxResult>();
322
+
323
+                    if (ar.state.ToString() == ResultTypes.success.ToString())
324
+                    {
325
+                        var rtlist = ar.data.ToJson().ToList<Dictionary<string, object>>();
326
+                        result.AddRange(rtlist);
327
+                    }
328
+                }
329
+            }
330
+            return Success("成功", result);
331
+        }
332
+
333
+        /// <summary>
334
+        /// 单位受理处理时间分布
335
+        /// </summary>
336
+        /// <param name="branchcode"></param>
337
+        /// <param name="date"></param>
338
+        /// <returns></returns>
339
+        public ActionResult GetDealCount24ByDate(string branchcode, DateTime? date)
340
+        {
341
+
342
+            if (date == null)
343
+            {
344
+                date = DateTime.Now;
345
+            }
346
+
347
+            string sqlwhere = " F_IsDelete=0 ";
348
+            if (!string.IsNullOrEmpty(branchcode))
349
+            {
350
+                sqlwhere += " and F_Code='" + branchcode + "'";
351
+            }
352
+
353
+            ArrayList result = new ArrayList();
354
+            var list = new BLL.T_Branch_List().GetModelList(sqlwhere);
355
+            string controllername = RouteData.Values["controller"].ToString();
356
+            string actionname = RouteData.Values["action"].ToString();
357
+            foreach (var l in list)
358
+            {
359
+                if (!string.IsNullOrEmpty(l.F_Sign) && !string.IsNullOrEmpty(l.F_Url))
360
+                {
361
+                    string signcode = CommonHelper.getsigncode(controllername, actionname, l.F_Sign);
362
+                    string strparams = "?date=" + date.Value.ToString("yyyy-MM-dd") + "&signcode=" + signcode;
363
+
364
+                    AjaxResult ar = HttpMethods.HttpGet(l.F_Url + "/" + controllername + "/" + actionname + strparams).ToObject<AjaxResult>();
365
+
366
+                    if (ar.state.ToString() == ResultTypes.success.ToString())
367
+                    {
368
+                        var rtlist = ar.data.ToJson().ToList<Dictionary<string, object>>();
369
+                        result.AddRange(rtlist);
370
+                    }
371
+                }
372
+            }
373
+            return Success("成功", result);
374
+        }
375
+
376
+        /// <summary>
377
+        /// 接单情况汇总(月份)
378
+        /// </summary>
379
+        /// <param name="branchcode"></param>
380
+        /// <param name="month"></param>
381
+        /// <param name="day"></param>
382
+        /// <returns></returns>
383
+        public ActionResult GetStateCountByMonth(string branchcode, string month, string day)
384
+        {
385
+            if (string.IsNullOrEmpty(month))
386
+            {
387
+                month = DateTime.Now.ToString("yyyy-MM");
388
+            }
389
+            if (string.IsNullOrEmpty(day))
390
+            {
391
+                day = "";
392
+            }
393
+            string sqlwhere = " F_IsDelete=0 ";
394
+            if (!string.IsNullOrEmpty(branchcode))
395
+            {
396
+                sqlwhere += " and F_Code='" + branchcode + "'";
397
+            }
398
+            ArrayList result = new ArrayList();
399
+            var list = new BLL.T_Branch_List().GetModelList(sqlwhere);
400
+            string controllername = RouteData.Values["controller"].ToString();
401
+            string actionname = RouteData.Values["action"].ToString();
402
+            foreach (var l in list)
403
+            {
404
+                if (!string.IsNullOrEmpty(l.F_Sign) && !string.IsNullOrEmpty(l.F_Url))
405
+                {
406
+                    string signcode = CommonHelper.getsigncode(controllername, actionname, l.F_Sign);
407
+                    string strparams = "?month=" + month + "&day=" + day + "&signcode=" + signcode;
408
+
409
+                    AjaxResult ar = HttpMethods.HttpGet(l.F_Url + "/" + controllername + "/" + actionname + strparams).ToObject<AjaxResult>();
410
+
411
+                    if (ar.state.ToString() == ResultTypes.success.ToString())
412
+                    {
413
+                        var rtlist = ar.data.ToJson().ToList<Dictionary<string, object>>();
414
+                        result.AddRange(rtlist);
415
+                    }
416
+                }
417
+            }
418
+            return Success("成功", result);
419
+        }
420
+        #endregion
421
+
422
+        #region 投诉类型
423
+        /// <summary>
424
+        /// 接单情况汇总(月份)
425
+        /// </summary>
426
+        /// <param name="branchcode"></param>
427
+        /// <param name="start"></param>
428
+        /// <param name="end"></param>
429
+        /// <returns></returns>
430
+        public ActionResult GetTypeCountMonthByDate(string branchcode, string start, string end)
431
+        {
432
+
433
+            string sqlwhere = " F_IsDelete=0 ";
434
+            if (!string.IsNullOrEmpty(branchcode))
435
+            {
436
+                sqlwhere += " and F_Code='" + branchcode + "'";
437
+            }
438
+            ArrayList result = new ArrayList();
439
+            var list = new BLL.T_Branch_List().GetModelList(sqlwhere);
440
+            string controllername = RouteData.Values["controller"].ToString();
441
+            string actionname = RouteData.Values["action"].ToString();
442
+            foreach (var l in list)
443
+            {
444
+                if (!string.IsNullOrEmpty(l.F_Sign) && !string.IsNullOrEmpty(l.F_Url))
445
+                {
446
+                    string signcode = CommonHelper.getsigncode(controllername, actionname, l.F_Sign);
447
+                    string strparams = "?start=" + start + "&end=" + end + "&signcode=" + signcode;
448
+
449
+                    AjaxResult ar = HttpMethods.HttpGet(l.F_Url + "/" + controllername + "/" + actionname + strparams).ToObject<AjaxResult>();
450
+
451
+                    if (ar.state.ToString() == ResultTypes.success.ToString())
452
+                    {
453
+                        var rtlist = ar.data.ToJson().ToList<Dictionary<string, object>>();
454
+                        result.AddRange(rtlist);
455
+                    }
456
+                }
457
+            }
458
+            return Success("成功", result);
459
+        }
460
+
461
+        /// <summary>
462
+        /// 获取关键词数量
463
+        /// </summary>
464
+        /// <param name="branchcode"></param>
465
+        /// <param name="start"></param>
466
+        /// <param name="end"></param>
467
+        /// <param name="keyid"></param>
468
+        /// <returns></returns>
469
+        public ActionResult GetKeyCountByDateNew(string branchcode, DateTime? start, DateTime? end, int keyid = 0)
470
+        {
471
+
472
+            if (start == null && end == null)
473
+            {
474
+                start = DateTime.Now;
475
+                end = DateTime.Now;
476
+            }
477
+            else
478
+            {
479
+                if (start == null) { start = DateTime.Now; }
480
+                if (end == null) { end = DateTime.Now; }
481
+
482
+            }
483
+
484
+            string sqlwhere = " F_IsDelete=0 ";
485
+            if (!string.IsNullOrEmpty(branchcode))
486
+            {
487
+                sqlwhere += " and F_Code='" + branchcode + "'";
488
+            }
489
+
490
+            ArrayList result = new ArrayList();
491
+            var list = new BLL.T_Branch_List().GetModelList(sqlwhere);
492
+            string controllername = RouteData.Values["controller"].ToString();
493
+            string actionname = RouteData.Values["action"].ToString();
494
+            foreach (var l in list)
495
+            {
496
+                if (!string.IsNullOrEmpty(l.F_Sign) && !string.IsNullOrEmpty(l.F_Url))
497
+                {
498
+                    string signcode = CommonHelper.getsigncode(controllername, actionname, l.F_Sign);
499
+                    string strparams = "?start=" + start.Value.ToString("yyyy-MM-dd") + "&end=" + end.Value.ToString("yyyy-MM-dd")  + "&signcode=" + signcode;
500
+
501
+                    AjaxResult ar = HttpMethods.HttpGet(l.F_Url + "/" + controllername + "/" + actionname + strparams).ToObject<AjaxResult>();
502
+
503
+                    if (ar.state.ToString() == ResultTypes.success.ToString())
504
+                    {
505
+                        var rtlist = ar.data.ToJson().ToList<Dictionary<string, object>>();
506
+                        result.AddRange(rtlist);
507
+                    }
508
+                }
509
+            }
510
+            return Success("成功", result);
511
+        }
512
+
513
+        /// <summary>
514
+        /// 获取类型数量
515
+        /// </summary>
516
+        /// <param name="branchcode"></param>
517
+        /// <param name="start"></param>
518
+        /// <param name="end"></param>
519
+        /// <returns></returns>
520
+        public ActionResult GetTypeCountByDate(string branchcode, DateTime? start, DateTime? end)
521
+        {
522
+
523
+            if (start == null && end == null)
524
+            {
525
+                start = DateTime.Now;
526
+                end = DateTime.Now;
527
+            }
528
+            else
529
+            {
530
+                if (start == null) { start = DateTime.Now; }
531
+                if (end == null) { end = DateTime.Now; }
532
+
533
+            }
534
+
535
+            string sqlwhere = " F_IsDelete=0 ";
536
+            if (!string.IsNullOrEmpty(branchcode))
537
+            {
538
+                sqlwhere += " and F_Code='" + branchcode + "'";
539
+            }
540
+
541
+            ArrayList result = new ArrayList();
542
+            var list = new BLL.T_Branch_List().GetModelList(sqlwhere);
543
+            string controllername = RouteData.Values["controller"].ToString();
544
+            string actionname = RouteData.Values["action"].ToString();
545
+            foreach (var l in list)
546
+            {
547
+                if (!string.IsNullOrEmpty(l.F_Sign) && !string.IsNullOrEmpty(l.F_Url))
548
+                {
549
+                    string signcode = CommonHelper.getsigncode(controllername, actionname, l.F_Sign);
550
+                    string strparams = "?start=" + start.Value.ToString("yyyy-MM-dd") + "&end=" + end.Value.ToString("yyyy-MM-dd") + "&signcode=" + signcode;
551
+
552
+                    AjaxResult ar = HttpMethods.HttpGet(l.F_Url + "/" + controllername + "/" + actionname + strparams).ToObject<AjaxResult>();
553
+
554
+                    if (ar.state.ToString() == ResultTypes.success.ToString())
555
+                    {
556
+                        var rtlist = ar.data.ToJson().ToList<Dictionary<string, object>>();
557
+                        result.AddRange(rtlist);
558
+                    }
559
+                }
560
+            }
561
+            return Success("成功", result);
562
+        }
563
+        #endregion
564
+
565
+        #region 话务数量
566
+        /// <summary>
567
+        /// 坐席闲忙比例
568
+        /// </summary>
569
+        /// <param name="branchcode"></param>
570
+        /// <param name="start"></param>
571
+        /// <param name="end"></param>
572
+        /// <returns></returns>
573
+        public ActionResult GetUserStateCount24ByDate(string branchcode, DateTime? start, DateTime? end)
574
+        {
575
+
576
+            if (start == null && end == null)
577
+            {
578
+                start = DateTime.Now;
579
+                end = DateTime.Now;
580
+            }
581
+            else
582
+            {
583
+                if (start == null) { start = DateTime.Now; }
584
+                if (end == null) { end = DateTime.Now; }
585
+
586
+            }
587
+
588
+            string sqlwhere = " F_IsDelete=0 ";
589
+            if (!string.IsNullOrEmpty(branchcode))
590
+            {
591
+                sqlwhere += " and F_Code='" + branchcode + "'";
592
+            }
593
+
594
+            ArrayList result = new ArrayList();
595
+            var list = new BLL.T_Branch_List().GetModelList(sqlwhere);
596
+            string controllername = RouteData.Values["controller"].ToString();
597
+            string actionname = RouteData.Values["action"].ToString();
598
+            foreach (var l in list)
599
+            {
600
+                if (!string.IsNullOrEmpty(l.F_Sign) && !string.IsNullOrEmpty(l.F_Url))
601
+                {
602
+                    string signcode = CommonHelper.getsigncode(controllername, actionname, l.F_Sign);
603
+                    string strparams = "?start=" + start.Value.ToString("yyyy-MM-dd") + "&end=" + end.Value.ToString("yyyy-MM-dd") + "&signcode=" + signcode;
604
+
605
+                    AjaxResult ar = HttpMethods.HttpGet(l.F_Url + "/" + controllername + "/" + actionname + strparams).ToObject<AjaxResult>();
606
+
607
+                    if (ar.state.ToString() == ResultTypes.success.ToString())
608
+                    {
609
+                        var rtlist = ar.data.ToJson().ToList<Dictionary<string, object>>();
610
+                        result.AddRange(rtlist);
611
+                    }
612
+                }
613
+            }
614
+            return Success("成功", result);
615
+        }
616
+
617
+        /// <summary>
618
+        /// 话务量实时数据统计
619
+        /// </summary>
620
+        /// <param name="branchcode"></param>
621
+        /// <param name="date"></param>
622
+        /// <returns></returns>
623
+        public ActionResult GetTelCount24ByDate(string branchcode, DateTime? date)
624
+        {
625
+
626
+            if (date == null)
627
+            {
628
+                date = DateTime.Now;
629
+            }
630
+
631
+            string sqlwhere = " F_IsDelete=0 ";
632
+            if (!string.IsNullOrEmpty(branchcode))
633
+            {
634
+                sqlwhere += " and F_Code='" + branchcode + "'";
635
+            }
636
+
637
+            ArrayList result = new ArrayList();
638
+            var list = new BLL.T_Branch_List().GetModelList(sqlwhere);
639
+            string controllername = RouteData.Values["controller"].ToString();
640
+            string actionname = RouteData.Values["action"].ToString();
641
+            foreach (var l in list)
642
+            {
643
+                if (!string.IsNullOrEmpty(l.F_Sign) && !string.IsNullOrEmpty(l.F_Url))
644
+                {
645
+                    string signcode = CommonHelper.getsigncode(controllername, actionname, l.F_Sign);
646
+                    string strparams = "?date=" + date.Value.ToString("yyyy-MM-dd") + "&signcode=" + signcode;
647
+
648
+                    AjaxResult ar = HttpMethods.HttpGet(l.F_Url + "/" + controllername + "/" + actionname + strparams).ToObject<AjaxResult>();
649
+
650
+                    if (ar.state.ToString() == ResultTypes.success.ToString())
651
+                    {
652
+                        var rtlist = ar.data.ToJson().ToList<Dictionary<string, object>>();
653
+                        result.AddRange(rtlist);
654
+                    }
655
+                }
656
+            }
657
+            return Success("成功", result);
658
+        }
659
+
660
+        /// <summary>
661
+        /// 获取通话数量
662
+        /// </summary>
663
+        /// <param name="branchcode"></param>
664
+        /// <param name="date"></param>
665
+        /// <returns></returns>
666
+        public ActionResult GetTelCountByDate(string branchcode, DateTime? date)
667
+        {
668
+
669
+            if (date == null)
670
+            {
671
+                date = DateTime.Now;
672
+            }
673
+
674
+            string sqlwhere = " F_IsDelete=0 ";
675
+            if (!string.IsNullOrEmpty(branchcode))
676
+            {
677
+                sqlwhere += " and F_Code='" + branchcode + "'";
678
+            }
679
+
680
+            ArrayList result = new ArrayList();
681
+            var list = new BLL.T_Branch_List().GetModelList(sqlwhere);
682
+            string controllername = RouteData.Values["controller"].ToString();
683
+            string actionname = RouteData.Values["action"].ToString();
684
+            foreach (var l in list)
685
+            {
686
+                if (!string.IsNullOrEmpty(l.F_Sign) && !string.IsNullOrEmpty(l.F_Url))
687
+                {
688
+                    string signcode = CommonHelper.getsigncode(controllername, actionname, l.F_Sign);
689
+                    string strparams = "?date=" + date.Value.ToString("yyyy-MM-dd") + "&signcode=" + signcode;
690
+
691
+                    AjaxResult ar = HttpMethods.HttpGet(l.F_Url + "/" + controllername + "/" + actionname + strparams).ToObject<AjaxResult>();
692
+
693
+                    if (ar.state.ToString() == ResultTypes.success.ToString())
694
+                    {
695
+                        var rtlist = ar.data.ToJson().ToList<Dictionary<string, object>>();
696
+                        result.AddRange(rtlist);
697
+                    }
698
+                }
699
+            }
700
+            return Success("成功", result);
701
+        }
702
+        #endregion
703
+
704
+        #region 中心大数据
705
+        /// <summary>
706
+        /// 工单类型各数量
707
+        /// </summary>
708
+        /// <param name="branchcode"></param>
709
+        /// <returns></returns>
710
+        public ActionResult GetTypeCountNew(string branchcode)
711
+        {
712
+
713
+            string sqlwhere = " F_IsDelete=0 ";
714
+            if (!string.IsNullOrEmpty(branchcode))
715
+            {
716
+                sqlwhere += " and F_Code='" + branchcode + "'";
717
+            }
718
+
719
+            ArrayList result = new ArrayList();
720
+            var list = new BLL.T_Branch_List().GetModelList(sqlwhere);
721
+            string controllername = RouteData.Values["controller"].ToString();
722
+            string actionname = RouteData.Values["action"].ToString();
723
+            foreach (var l in list)
724
+            {
725
+                if (!string.IsNullOrEmpty(l.F_Sign) && !string.IsNullOrEmpty(l.F_Url))
726
+                {
727
+                    string signcode = CommonHelper.getsigncode(controllername, actionname, l.F_Sign);
728
+                    string strparams = "?signcode=" + signcode;
729
+
730
+                    AjaxResult ar = HttpMethods.HttpGet(l.F_Url + "/" + controllername + "/" + actionname + strparams).ToObject<AjaxResult>();
731
+
732
+                    if (ar.state.ToString() == ResultTypes.success.ToString())
733
+                    {
734
+                        var rtlist = ar.data.ToJson().ToList<Dictionary<string, object>>();
735
+                        result.AddRange(rtlist);
736
+                    }
737
+                }
738
+            }
739
+            return Success("成功", result);
740
+        }
741
+
742
+        /// <summary>
743
+        /// 接通率统计
744
+        /// </summary>
745
+        /// <param name="branchcode"></param>
746
+        /// <param name="date"></param>
747
+        /// <returns></returns>
748
+        public ActionResult GetTelRate24ByDate(string branchcode, DateTime? date)
749
+        {
750
+
751
+            if (date == null)
752
+            {
753
+                date = DateTime.Now;
754
+            }
755
+
756
+            string sqlwhere = " F_IsDelete=0 ";
757
+            if (!string.IsNullOrEmpty(branchcode))
758
+            {
759
+                sqlwhere += " and F_Code='" + branchcode + "'";
760
+            }
761
+
762
+            ArrayList result = new ArrayList();
763
+            var list = new BLL.T_Branch_List().GetModelList(sqlwhere);
764
+            string controllername = RouteData.Values["controller"].ToString();
765
+            string actionname = RouteData.Values["action"].ToString();
766
+            foreach (var l in list)
767
+            {
768
+                if (!string.IsNullOrEmpty(l.F_Sign) && !string.IsNullOrEmpty(l.F_Url))
769
+                {
770
+                    string signcode = CommonHelper.getsigncode(controllername, actionname, l.F_Sign);
771
+                    string strparams = "?date=" + date.Value.ToString("yyyy-MM-dd") + "&signcode=" + signcode;
772
+
773
+                    AjaxResult ar = HttpMethods.HttpGet(l.F_Url + "/" + controllername + "/" + actionname + strparams).ToObject<AjaxResult>();
774
+
775
+                    if (ar.state.ToString() == ResultTypes.success.ToString())
776
+                    {
777
+                        var rtlist = ar.data.ToJson().ToList<Dictionary<string, object>>();
778
+                        result.AddRange(rtlist);
779
+                    }
780
+                }
781
+            }
782
+            return Success("成功", result);
783
+        }
784
+        #endregion
785
+    }
786
+}

+ 1 - 0
CallCenterApi.Interface/packages.config

@@ -4,4 +4,5 @@
4 4
   <package id="Microsoft.AspNet.Razor" version="3.2.6" targetFramework="net45" />
5 5
   <package id="Microsoft.AspNet.WebPages" version="3.2.6" targetFramework="net45" />
6 6
   <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
7
+  <package id="Newtonsoft.Json" version="11.0.2" targetFramework="net45" />
7 8
 </packages>