mengjie лет назад: 6
Родитель
Сommit
0786138988

+ 13 - 1
CallCenterApi.DAL/T_Branch_List.cs

@@ -322,6 +322,18 @@ namespace CallCenterApi.DAL
322 322
                 {
323 323
                     model.F_DeleteTime = DateTime.Parse(row["F_DeleteTime"].ToString());
324 324
                 }
325
+                if (row["F_IsDP"] != null && row["F_IsDP"].ToString() != "")
326
+                {
327
+                    model.F_IsDP = int.Parse(row["F_IsDP"].ToString());
328
+                }
329
+                if (row["F_IsSQ"] != null && row["F_IsSQ"].ToString() != "")
330
+                {
331
+                    model.F_IsSQ = int.Parse(row["F_IsSQ"].ToString());
332
+                }
333
+                if (row["F_AreaId"] != null)
334
+                {
335
+                    model.F_AreaId = row["F_AreaId"].ToString();
336
+                }
325 337
             }
326 338
             return model;
327 339
         }
@@ -332,7 +344,7 @@ namespace CallCenterApi.DAL
332 344
         public DataSet GetList(string strWhere)
333 345
         {
334 346
             StringBuilder strSql = new StringBuilder();
335
-            strSql.Append("select F_ID,F_Code,F_Name,F_Password,F_Address,F_ConName,F_ConPhone,F_ConTel,F_ConEmail,F_Url,F_Sign,F_WebSocketUrl,F_Phone,F_State,F_CreateTime,F_CreateUser,F_IsDelete,F_DeleteUser,F_DeleteTime ");
347
+            strSql.Append("select F_ID,F_Code,F_Name,F_Password,F_Address,F_ConName,F_ConPhone,F_ConTel,F_ConEmail,F_Url,F_Sign,F_WebSocketUrl,F_Phone,F_State,F_CreateTime,F_CreateUser,F_IsDelete,F_DeleteUser,F_DeleteTime,F_IsDP,F_IsSQ,F_AreaId ");
336 348
             strSql.Append(" FROM T_Branch_List ");
337 349
             if (strWhere.Trim() != "")
338 350
             {

+ 284 - 91
CallCenterApi.Interface/Controllers/InfoController.cs

@@ -39,18 +39,32 @@ namespace CallCenterApi.Interface.Controllers
39 39
             {               
40 40
                 date = DateTime.Now;
41 41
             }
42
-            
42
+            int backtotal = 0;
43 43
             //string sqlwhere = " F_IsDelete=0 ";
44 44
             string sqlwhere = " F_IsDP=1 ";//大屏展示用到的
45
+            if (branchcode == "sqs12345")
46
+            {
47
+                branchcode = "";
48
+                sqlwhere += " and F_IsSQS='0";
49
+            }
45 50
             if (!string.IsNullOrEmpty(branchcode))
46 51
             {
47 52
                 sqlwhere += " and F_Code='" + branchcode + "'";
48 53
             }
49
-
54
+            else
55
+            {
56
+                backtotal = 1;
57
+              
58
+                    sqlwhere += " and F_IsSQ!=1";
59
+                
60
+            }
61
+            int first = 1;
50 62
             int[] hours = Enumerable.Range(0, 24).ToArray<int>();
51 63
             decimal[,] countstotal=new decimal [10,24];//用于计算累计值//固定了10个市县区
52 64
             decimal[] tcountstotal = new decimal[10];
53 65
             string[] cols=new string [10];
66
+            string[] colsx = new string[1];//用于县数据相加
67
+
54 68
             //List<object> items;
55 69
             List<List<Dictionary<string, object>>> items = new List<List<Dictionary<string, object>>>();
56 70
             //IEnumerable<List<Dictionary<string, object>>> items;
@@ -80,45 +94,90 @@ namespace CallCenterApi.Interface.Controllers
80 94
                     JObject jo0 = (JObject)JsonConvert.DeserializeObject(ar);
81 95
                     if (jo0 != null && jo0["state"].ToString() == ResultTypes.success.ToString())
82 96
                     {
83
-
97
+                        if (first == 1)
98
+                        {
99
+                            string a = System.Text.RegularExpressions.Regex.Replace(jo0["data"]["cols"].ToString(), "[\r\n\t  ]", "");
100
+                            a = a.Replace("[", "");
101
+                            a = a.Replace("]", "");
102
+                            a = a.Replace("\"", "");
103
+                            cols = a.Split(',');
104
+                        }
105
+                        else
106
+                        {
107
+                            string a = System.Text.RegularExpressions.Regex.Replace(jo0["data"]["cols"].ToString(), "[\r\n\t  ]", "");
108
+                            a = a.Replace("[", "");
109
+                            a = a.Replace("]", "");
110
+                            a = a.Replace("\"", "");
111
+                            colsx = a.Split(',');
112
+                        }
84 113
                         //string x = jo0["data"].ToString();
85 114
                         for (int i = 0; i < 10;i++)
86 115
                         {
116
+                            
87 117
                             string y = System.Text.RegularExpressions.Regex.Replace(jo0["data"]["counts"][i].ToString(), "[\r\n\t  ]", "");
88 118
                             y = y.Replace("[", "");
89 119
                             y = y.Replace("]", "");
90 120
                             string[] z = y.Split(',');
121
+
91 122
                             for (int m = 0; m < z.Length; m++)
92 123
                             {
93
-                                countstotal[i,m] += decimal.Parse(z[m]);
124
+                                if (first == 1)
125
+                                {
126
+                                    countstotal[i, m] = decimal.Parse(z[m]);
127
+                                }
128
+                                else if (backtotal == 1)
129
+                                {
130
+                                    if (cols[i] == colsx[0])
131
+                                    {
132
+                                        countstotal[i, m] += decimal.Parse(z[m]);
133
+                                    }
134
+                                }
135
+                            }
136
+                            
137
+                                string p = System.Text.RegularExpressions.Regex.Replace(jo0["data"]["tcounts"].ToString(), "[\r\n\t  ]", "");
138
+                                p = p.Replace("[", "");
139
+                                p = p.Replace("]", "");
140
+                                string[] q = p.Split(',');
141
+                            if (backtotal == 1)
142
+                            {
143
+                                if (cols[i] == colsx[0])
144
+                                {
145
+                                    tcountstotal[i] += decimal.Parse(q[0]);
146
+                                }
147
+                            }
148
+                            else
149
+                            {
150
+                                tcountstotal[i] += decimal.Parse(q[i]);
94 151
                             }
95 152
 
96
-                            string p = System.Text.RegularExpressions.Regex.Replace(jo0["data"]["tcounts"].ToString(), "[\r\n\t  ]", "");
97
-                            p = p.Replace("[", "");
98
-                            p = p.Replace("]", "");
99
-                            string[] q = p.Split(',');
100
-                            tcountstotal[i] += decimal.Parse(q[i]);
101 153
 
102 154
                             //item计算
103
-                            var rtlist = jo0["data"]["items"][0].ToJson().ToList<Dictionary<string, object>>();
104
-                            for(int r=0;r<rtlist .Count;r++)
155
+                            if (backtotal == 1)
105 156
                             {
106
-                                decimal zh = 0;
107
-                                if (items.Count > i)
157
+                                if (cols[i] == colsx[0])
108 158
                                 {
109
-                                    zh = decimal.Parse(items[i][r]["Count"].ToString());
159
+                                    var rtlist = jo0["data"]["items"][0].ToJson().ToList<Dictionary<string, object>>();
160
+                                    for (int r = 0; r < rtlist.Count; r++)
161
+                                    {
162
+                                        decimal zh = 0;
163
+                                        if (items.Count > i)
164
+                                        {
165
+                                            zh = decimal.Parse(items[i][r]["Count"].ToString());
166
+                                        }
167
+                                        rtlist[r]["Count"] = zh + decimal.Parse(rtlist[r]["Count"].ToString());
168
+                                    }
169
+                                    //List<Dictionary<string, object>> li = new List<Dictionary<string, object>>();
170
+                                    //li.AddRange(rtlist );
171
+                                    items.Add(rtlist);
110 172
                                 }
111
-                                rtlist[r]["Count"] = zh+decimal.Parse(rtlist[r]["Count"].ToString ());
112 173
                             }
113
-                            //List<Dictionary<string, object>> li = new List<Dictionary<string, object>>();
114
-                            //li.AddRange(rtlist );
115
-                            items.Add(rtlist );
174
+                            else
175
+                            {
176
+                                var rtlist = jo0["data"]["items"][i].ToJson().ToList<Dictionary<string, object>>();
177
+                                items.Add(rtlist);
178
+                            }
116 179
                         }
117
-                        string a = System.Text.RegularExpressions.Regex.Replace(jo0["data"]["cols"].ToString(), "[\r\n\t  ]", "");
118
-                        a = a.Replace("[", "");
119
-                        a = a.Replace("]", "");
120
-                        a = a.Replace("\"", "");
121
-                        cols = a.Split(',');
180
+                        first = 0;
122 181
                       
123 182
                         
124 183
                     }
@@ -137,13 +196,13 @@ namespace CallCenterApi.Interface.Controllers
137 196
         }
138 197
 
139 198
         /// <summary>
140
-        /// 获取来源百分比
199
+        /// 获取受理区域数量
141 200
         /// </summary>
142 201
         /// <param name="branchcode"></param>
143 202
         /// <param name="start"></param>
144 203
         /// <param name="end"></param>
145 204
         /// <returns></returns>
146
-        public ActionResult GetSourcePercentByDate(string branchcode, DateTime? start, DateTime? end, string areaid)
205
+        public ActionResult GetAreaCountByDate(string branchcode, DateTime? start, DateTime? end, string areaid)
147 206
         {
148 207
 
149 208
             if (start == null && end == null)
@@ -155,23 +214,33 @@ namespace CallCenterApi.Interface.Controllers
155 214
             {
156 215
                 if (start == null) { start = DateTime.Now; }
157 216
                 if (end == null) { end = DateTime.Now; }
158
-                
159
-            }
160 217
 
218
+            }
219
+            int backtotal = 0;
161 220
             string sqlwhere = " F_IsDP=1 ";
221
+            if (branchcode == "sqs12345")
222
+            {
223
+                branchcode = "";
224
+            }
162 225
             if (!string.IsNullOrEmpty(branchcode))
163 226
             {
164 227
                 sqlwhere += " and F_Code='" + branchcode + "'";
165 228
             }
229
+            else
230
+            {
231
+                backtotal = 1;
232
+               
233
+                    sqlwhere += " and F_IsSQ!=1";
234
+               
235
+            }
236
+
166 237
             #region 定义新表
167 238
             DataTable dtnew = new DataTable();
168
-            dtnew.Columns.Add("Id");
169
-            dtnew.Columns.Add("Source");
239
+            dtnew.Columns.Add("F_AreaId");
240
+            dtnew.Columns.Add("AreaName");
170 241
             dtnew.Columns.Add("Count");
171
-            dtnew.Columns.Add("Percent");
172
-            
242
+
173 243
             int first = 1;
174
-            decimal totalcount = 0;//用于计算百分比
175 244
             #endregion
176 245
 
177 246
             ArrayList result = new ArrayList();
@@ -187,7 +256,7 @@ namespace CallCenterApi.Interface.Controllers
187 256
                         areaid = l.F_AreaId;
188 257
                     }
189 258
                     string signcode = CommonHelper.getsigncode(controllername, actionname, l.F_Sign);
190
-                    string strparams = "?start=" + start.Value.ToString("yyyy-MM-dd") + "&end=" + end.Value.ToString("yyyy-MM-dd") + "&areaid=" + areaid + "&isdpjk=1" + "&signcode=" + signcode;
259
+                    string strparams = "?start=" + start.Value.ToString("yyyy-MM-dd") + "&end=" + end.Value.ToString("yyyy-MM-dd") + "&areaid=" + areaid + "&backtotal=" + backtotal + "&isdpjk=1" + "&signcode=" + signcode;
191 260
 
192 261
                     string ar = HttpMethods.HttpGet(l.F_Url + "/" + controllername + "/" + actionname + strparams);//.ToObject<AjaxResult>();
193 262
                     if (!string.IsNullOrEmpty(branchcode))
@@ -197,7 +266,6 @@ namespace CallCenterApi.Interface.Controllers
197 266
                     JObject jo0 = (JObject)JsonConvert.DeserializeObject(ar);
198 267
                     if (jo0 != null && jo0["state"].ToString() == ResultTypes.success.ToString())
199 268
                     {
200
-                        
201 269
                         if (first == 1)
202 270
                         {
203 271
                             DataTable dt = HeadToDataTable(jo0["data"].ToString(), "Item");
@@ -211,54 +279,49 @@ namespace CallCenterApi.Interface.Controllers
211 279
                         }
212 280
                         else
213 281
                         {
214
-                            //前部分相加
215
-                            DataTable dt1 = HeadToDataTable(jo0["data"].ToString(), "Item");
216
-                            for (int i = 0; i < dt1.Rows.Count; i++)
282
+                            for (int m = 0; m < dtnew.Rows.Count; m++)
217 283
                             {
218
-                                decimal t = decimal.Parse(dtnew.Rows[i][2].ToString()) + decimal.Parse(dt1.Rows[i][2].ToString());
219
-                                totalcount += t;
220
-                                 dtnew.Rows[i][2] = t;                               
221
-                            }
222
-                            //后半部分两个datatable相加    
223
-                            
224
-                            for (int i = 0; i < dtnew.Rows.Count; i++)
225
-                            {
226
-                                DataTable dtitem = new DataTable();
227
-                                string c = jo0["data"][i]["Item"].ToString();
228
-                                DataTable dt = HeadToDataTable(jo0["data"][i]["Item"].ToString(), "Item");
229
-                                dtitem = dt;
230
-                                DataTable dtold = HeadToDataTable(dtnew.Rows[i]["Item"].ToString(), "Item");
231
-                                for (int j = 0; j < dtold.Rows.Count; j++)
284
+                                
285
+                                //前部分相加
286
+                                DataTable dt1 = HeadToDataTable(jo0["data"].ToString(), "Item");
287
+                                for (int i = 0; i < dt1.Rows.Count; i++)
232 288
                                 {
233
-                                    dtitem.Rows[j][1] = decimal.Parse(dtold.Rows[j][1].ToString()) + decimal.Parse(dt.Rows[j][1].ToString());
289
+                                    if (dtnew.Rows[m][1].ToString() == dt1.Rows[i][1].ToString())
290
+                                    {
291
+                                        decimal t = decimal.Parse(dtnew.Rows[i][2].ToString()) + decimal.Parse(dt1.Rows[i][2].ToString());
292
+                                        dtnew.Rows[i][2] = t;
293
+
294
+                                        //后半部分两个datatable相加    
295
+
296
+
297
+                                        DataTable dtitem = new DataTable();
298
+                                        string c = jo0["data"][i]["Item"].ToString();
299
+                                        DataTable dt = HeadToDataTable(jo0["data"][i]["Item"].ToString(), "Item");
300
+                                        dtitem = dt;
301
+                                        DataTable dtold = HeadToDataTable(dtnew.Rows[i]["Item"].ToString(), "Item");
302
+                                        for (int j = 0; j < dtold.Rows.Count; j++)
303
+                                        {
304
+                                            dtitem.Rows[j][1] = decimal.Parse(dtold.Rows[j][1].ToString()) + decimal.Parse(dt.Rows[j][1].ToString());
305
+                                        }
306
+                                        dtnew.Rows[i]["Item"] = dtitem;
307
+                                    }
234 308
                                 }
235
-                                dtnew.Rows[i]["Item"] = dtitem;                       
236 309
                             }
237 310
                         }
238
-                        //var rtlist = ar.data.ToJson().ToList<Dictionary<string, object>>();
239
-                        //result.AddRange(rtlist);
240 311
                     }
241 312
                 }
242 313
             }
243
-            //计算百分比
244
-            if (totalcount > 0)
245
-            {
246
-                for (int m = 0; m < dtnew.Rows.Count; m++)
247
-                {
248
-                    dtnew.Rows[m]["Percent"] = Math.Round(decimal.Parse(dtnew.Rows[m]["Count"].ToString()) / totalcount * 100, 2);
249
-                }
250
-            }
251
-            return Success("成功", dtnew );
314
+            return Success("成功", dtnew);
252 315
         }
253 316
 
254 317
         /// <summary>
255
-        /// 获取受理区域数量
318
+        /// 获取来源百分比
256 319
         /// </summary>
257 320
         /// <param name="branchcode"></param>
258 321
         /// <param name="start"></param>
259 322
         /// <param name="end"></param>
260 323
         /// <returns></returns>
261
-        public ActionResult GetAreaCountByDate(string branchcode, DateTime? start, DateTime? end, string areaid)
324
+        public ActionResult GetSourcePercentByDate(string branchcode, DateTime? start, DateTime? end, string areaid)
262 325
         {
263 326
 
264 327
             if (start == null && end == null)
@@ -270,22 +333,31 @@ namespace CallCenterApi.Interface.Controllers
270 333
             {
271 334
                 if (start == null) { start = DateTime.Now; }
272 335
                 if (end == null) { end = DateTime.Now; }
273
-
336
+                
274 337
             }
275 338
 
276 339
             string sqlwhere = " F_IsDP=1 ";
340
+            if (branchcode == "sqs12345")
341
+            {
342
+                branchcode = "";
343
+            }
277 344
             if (!string.IsNullOrEmpty(branchcode))
278 345
             {
279 346
                 sqlwhere += " and F_Code='" + branchcode + "'";
280 347
             }
281
-
348
+            else
349
+            {
350
+                sqlwhere += " and F_IsSQ!=1";
351
+            }
282 352
             #region 定义新表
283 353
             DataTable dtnew = new DataTable();
284
-            dtnew.Columns.Add("F_AreaId");
285
-            dtnew.Columns.Add("AreaName");
354
+            dtnew.Columns.Add("Id");
355
+            dtnew.Columns.Add("Source");
286 356
             dtnew.Columns.Add("Count");
357
+            dtnew.Columns.Add("Percent");
287 358
             
288 359
             int first = 1;
360
+            decimal totalcount = 0;//用于计算百分比
289 361
             #endregion
290 362
 
291 363
             ArrayList result = new ArrayList();
@@ -311,6 +383,7 @@ namespace CallCenterApi.Interface.Controllers
311 383
                     JObject jo0 = (JObject)JsonConvert.DeserializeObject(ar);
312 384
                     if (jo0 != null && jo0["state"].ToString() == ResultTypes.success.ToString())
313 385
                     {
386
+                        
314 387
                         if (first == 1)
315 388
                         {
316 389
                             DataTable dt = HeadToDataTable(jo0["data"].ToString(), "Item");
@@ -329,10 +402,11 @@ namespace CallCenterApi.Interface.Controllers
329 402
                             for (int i = 0; i < dt1.Rows.Count; i++)
330 403
                             {
331 404
                                 decimal t = decimal.Parse(dtnew.Rows[i][2].ToString()) + decimal.Parse(dt1.Rows[i][2].ToString());
332
-                                dtnew.Rows[i][2] = t;
405
+                                totalcount += t;
406
+                                 dtnew.Rows[i][2] = t;                               
333 407
                             }
334 408
                             //后半部分两个datatable相加    
335
-
409
+                            
336 410
                             for (int i = 0; i < dtnew.Rows.Count; i++)
337 411
                             {
338 412
                                 DataTable dtitem = new DataTable();
@@ -344,15 +418,27 @@ namespace CallCenterApi.Interface.Controllers
344 418
                                 {
345 419
                                     dtitem.Rows[j][1] = decimal.Parse(dtold.Rows[j][1].ToString()) + decimal.Parse(dt.Rows[j][1].ToString());
346 420
                                 }
347
-                                dtnew.Rows[i]["Item"] = dtitem;
421
+                                dtnew.Rows[i]["Item"] = dtitem;                       
348 422
                             }
349 423
                         }
424
+                        //var rtlist = ar.data.ToJson().ToList<Dictionary<string, object>>();
425
+                        //result.AddRange(rtlist);
350 426
                     }
351 427
                 }
352 428
             }
429
+            //计算百分比
430
+            if (totalcount > 0)
431
+            {
432
+                for (int m = 0; m < dtnew.Rows.Count; m++)
433
+                {
434
+                    dtnew.Rows[m]["Percent"] = Math.Round(decimal.Parse(dtnew.Rows[m]["Count"].ToString()) / totalcount * 100, 2);
435
+                }
436
+            }
353 437
             return Success("成功", dtnew );
354 438
         }
355 439
 
440
+        
441
+
356 442
         /// <summary>
357 443
         /// 获取来源数量百分比
358 444
         /// </summary>
@@ -376,10 +462,18 @@ namespace CallCenterApi.Interface.Controllers
376 462
             }
377 463
 
378 464
             string sqlwhere = " F_IsDP=1 ";
465
+            if (branchcode == "sqs12345")
466
+            {
467
+                branchcode = "";
468
+            }
379 469
             if (!string.IsNullOrEmpty(branchcode))
380 470
             {
381 471
                 sqlwhere += " and F_Code='" + branchcode + "'";
382 472
             }
473
+            else
474
+            {
475
+                sqlwhere += " and F_IsSQ!=1";
476
+            }
383 477
 
384 478
             #region 定义新表
385 479
             DataTable dtnew = new DataTable();
@@ -442,7 +536,7 @@ namespace CallCenterApi.Interface.Controllers
442 536
                 }
443 537
             }
444 538
             //计算百分比
445
-            dtnew.Columns.Add("Percent", typeof(object));
539
+            //dtnew.Columns.Add("Percent", typeof(object));
446 540
             if (totalcount > 0)
447 541
             {
448 542
                 for (int m = 0; m < dtnew.Rows.Count; m++)
@@ -450,7 +544,7 @@ namespace CallCenterApi.Interface.Controllers
450 544
                     dtnew.Rows[m]["Percent"] = Math.Round(decimal.Parse(dtnew.Rows[m]["Count"].ToString()) / totalcount * 100, 2).ToString ()+"%";
451 545
                 }
452 546
             }
453
-            return Success("成功", result);
547
+            return Success("成功", dtnew);
454 548
         }
455 549
         #endregion
456 550
 
@@ -462,12 +556,19 @@ namespace CallCenterApi.Interface.Controllers
462 556
         /// <returns></returns>
463 557
         public ActionResult GetStateCountMonthByDate(string branchcode, string areaid)
464 558
         {
465
-
559
+            if (branchcode == "sqs12345")
560
+            {
561
+                branchcode = "";
562
+            }
466 563
             string sqlwhere = " F_IsDP=1 ";
467 564
             if (!string.IsNullOrEmpty(branchcode))
468 565
             {
469 566
                 sqlwhere += " and F_Code='" + branchcode + "'";
470 567
             }
568
+            else
569
+            {
570
+                sqlwhere += " and F_IsSQ!=1";
571
+            }
471 572
             decimal[,] countstotal = new decimal[10, 12];//用于计算累计值
472 573
             string[] cols = new string[10];
473 574
             string[] months = new string[12];
@@ -542,7 +643,10 @@ namespace CallCenterApi.Interface.Controllers
542 643
         /// <returns></returns>
543 644
         public ActionResult GetDeptCountByDateNew(string branchcode, DateTime? start, DateTime? end, string areaid, int deptid = 0)
544 645
         {
545
-
646
+            if (branchcode == "sqs12345")
647
+            {
648
+                branchcode = "";
649
+            }
546 650
             if (start == null && end == null)
547 651
             {
548 652
                 start = DateTime.Now;
@@ -560,6 +664,10 @@ namespace CallCenterApi.Interface.Controllers
560 664
             {
561 665
                 sqlwhere += " and F_Code='" + branchcode + "'";
562 666
             }
667
+            else
668
+            {
669
+                sqlwhere += " and F_IsSQ!=1";
670
+            }
563 671
 
564 672
             ArrayList result = new ArrayList();
565 673
             var list = new BLL.T_Branch_List().GetModelList(sqlwhere);
@@ -596,7 +704,10 @@ namespace CallCenterApi.Interface.Controllers
596 704
         /// <returns></returns>
597 705
         public ActionResult GetDealCount24ByDate(string branchcode, DateTime? date, string areaid)
598 706
         {
599
-
707
+            if (branchcode == "sqs12345")
708
+            {
709
+                branchcode = "";
710
+            }
600 711
             if (date == null)
601 712
             {
602 713
                 date = DateTime.Now;
@@ -607,6 +718,10 @@ namespace CallCenterApi.Interface.Controllers
607 718
             {
608 719
                 sqlwhere += " and F_Code='" + branchcode + "'";
609 720
             }
721
+            else
722
+            {
723
+                sqlwhere += " and F_IsSQ!=1";
724
+            }
610 725
 
611 726
             int[] hours = Enumerable.Range(7, 12).ToArray<int>();
612 727
             int[] acounts = new int[12];
@@ -671,6 +786,10 @@ namespace CallCenterApi.Interface.Controllers
671 786
         /// <returns></returns>
672 787
         public ActionResult GetStateCountByMonth(string branchcode, string month, string day, string areaid)
673 788
         {
789
+            if (branchcode == "sqs12345")
790
+            {
791
+                branchcode = "";
792
+            }
674 793
             if (string.IsNullOrEmpty(month))
675 794
             {
676 795
                 month = DateTime.Now.ToString("yyyy-MM");
@@ -684,6 +803,10 @@ namespace CallCenterApi.Interface.Controllers
684 803
             {
685 804
                 sqlwhere += " and F_Code='" + branchcode + "'";
686 805
             }
806
+            else
807
+            {
808
+                sqlwhere += " and F_IsSQ!=1";
809
+            }
687 810
             #region 定义新表
688 811
             DataTable dtnew = new DataTable();
689 812
             dtnew.Columns.Add("State");
@@ -752,12 +875,19 @@ namespace CallCenterApi.Interface.Controllers
752 875
         /// <returns></returns>
753 876
         public ActionResult GetTypeCountMonthByDate(string branchcode, string start, string end, string areaid)
754 877
         {
755
-
878
+            if (branchcode == "sqs12345")
879
+            {
880
+                branchcode = "";
881
+            }
756 882
             string sqlwhere = " F_IsDP=1 ";
757 883
             if (!string.IsNullOrEmpty(branchcode))
758 884
             {
759 885
                 sqlwhere += " and F_Code='" + branchcode + "'";
760 886
             }
887
+            else
888
+            {
889
+                sqlwhere += " and F_IsSQ!=1";
890
+            }
761 891
             #region 变量定义
762 892
             DateTime startdate = DateTime.Now.AddMonths(-12);
763 893
             DateTime enddate = DateTime.Now;
@@ -847,7 +977,10 @@ namespace CallCenterApi.Interface.Controllers
847 977
         /// <returns></returns>
848 978
         public ActionResult GetKeyCountByDateNew(string branchcode, DateTime? start, DateTime? end, string areaid, int keyid = 0)
849 979
         {
850
-
980
+            if (branchcode == "sqs12345")
981
+            {
982
+                branchcode = "";
983
+            }
851 984
             if (start == null && end == null)
852 985
             {
853 986
                 start = DateTime.Now;
@@ -865,6 +998,10 @@ namespace CallCenterApi.Interface.Controllers
865 998
             {
866 999
                 sqlwhere += " and F_Code='" + branchcode + "'";
867 1000
             }
1001
+            else
1002
+            {
1003
+                sqlwhere += " and F_IsSQ!=1";
1004
+            }
868 1005
 
869 1006
             #region 定义新表
870 1007
             DataTable dtnew = new DataTable();
@@ -948,11 +1085,11 @@ namespace CallCenterApi.Interface.Controllers
948 1085
 
949 1086
                 //dtTemp.Columns.Add(autoColumn);
950 1087
 
951
-                dtTemp.Columns["排名"].SetOrdinal(0);
1088
+                //dtTemp.Columns["排名"].SetOrdinal(0);
952 1089
 
953 1090
                 for (int i = 0; i < dtTemp.Rows.Count; i++)
954 1091
                 {
955
-                    dtTemp.Rows[i][0] = i + 1;
1092
+                    dtTemp.Rows[i]["排名"] = i + 1;
956 1093
                 }
957 1094
 
958 1095
             }
@@ -969,7 +1106,10 @@ namespace CallCenterApi.Interface.Controllers
969 1106
         /// <returns></returns>
970 1107
         public ActionResult GetTypeCountByDate(string branchcode, DateTime? start, DateTime? end, string areaid)
971 1108
         {
972
-
1109
+            if (branchcode == "sqs12345")
1110
+            {
1111
+                branchcode = "";
1112
+            }
973 1113
             if (start == null && end == null)
974 1114
             {
975 1115
                 start = DateTime.Now;
@@ -987,6 +1127,10 @@ namespace CallCenterApi.Interface.Controllers
987 1127
             {
988 1128
                 sqlwhere += " and F_Code='" + branchcode + "'";
989 1129
             }
1130
+            else
1131
+            {
1132
+                sqlwhere += " and F_IsSQ!=1";
1133
+            }
990 1134
 
991 1135
             #region 定义新表
992 1136
             DataTable dtnew = new DataTable();
@@ -1058,7 +1202,10 @@ namespace CallCenterApi.Interface.Controllers
1058 1202
         /// <returns></returns>
1059 1203
         public ActionResult GetUserStateCount24ByDate(string branchcode, DateTime? start, DateTime? end, string areaid)
1060 1204
         {
1061
-
1205
+            if (branchcode == "sqs12345")
1206
+            {
1207
+                branchcode = "";
1208
+            }
1062 1209
             if (start == null && end == null)
1063 1210
             {
1064 1211
                 start = DateTime.Now;
@@ -1076,6 +1223,10 @@ namespace CallCenterApi.Interface.Controllers
1076 1223
             {
1077 1224
                 sqlwhere += " and F_Code='" + branchcode + "'";
1078 1225
             }
1226
+            else
1227
+            {
1228
+                sqlwhere += " and F_IsSQ!=1";
1229
+            }
1079 1230
 
1080 1231
             int[] hours = Enumerable.Range(0, 24).ToArray<int>();
1081 1232
             double[] kxpercents = new double[24];
@@ -1191,7 +1342,10 @@ namespace CallCenterApi.Interface.Controllers
1191 1342
         /// <returns></returns>
1192 1343
         public ActionResult GetTelCount24ByDate(string branchcode, DateTime? date, string areaid)
1193 1344
         {
1194
-
1345
+            if (branchcode == "sqs12345")
1346
+            {
1347
+                branchcode = "";
1348
+            }
1195 1349
             if (date == null)
1196 1350
             {
1197 1351
                 date = DateTime.Now;
@@ -1202,6 +1356,10 @@ namespace CallCenterApi.Interface.Controllers
1202 1356
             {
1203 1357
                 sqlwhere += " and F_Code='" + branchcode + "'";
1204 1358
             }
1359
+            else
1360
+            {
1361
+                sqlwhere += " and F_IsSQ!=1";
1362
+            }
1205 1363
 
1206 1364
             int[] hours = Enumerable.Range(0, 24).ToArray<int>();
1207 1365
             int[] rcounts = new int[24];//来电数量
@@ -1290,7 +1448,10 @@ namespace CallCenterApi.Interface.Controllers
1290 1448
         /// <returns></returns>
1291 1449
         public ActionResult GetTelCountByDate(string branchcode, DateTime? date, string areaid)
1292 1450
         {
1293
-
1451
+            if (branchcode == "sqs12345")
1452
+            {
1453
+                branchcode = "";
1454
+            }
1294 1455
             if (date == null)
1295 1456
             {
1296 1457
                 date = DateTime.Now;
@@ -1301,6 +1462,10 @@ namespace CallCenterApi.Interface.Controllers
1301 1462
             {
1302 1463
                 sqlwhere += " and F_Code='" + branchcode + "'";
1303 1464
             }
1465
+            else
1466
+            {
1467
+                sqlwhere += " and F_IsSQ!=1";
1468
+            }
1304 1469
 
1305 1470
             decimal hwcon=0;
1306 1471
             decimal lhcon = 0;
@@ -1373,12 +1538,19 @@ namespace CallCenterApi.Interface.Controllers
1373 1538
         /// <returns></returns>
1374 1539
         public ActionResult GetTypeCountNew(string branchcode, string areaid)
1375 1540
         {
1376
-
1541
+            if (branchcode == "sqs12345")
1542
+            {
1543
+                branchcode = "";
1544
+            }
1377 1545
             string sqlwhere = " F_IsDP=1 ";
1378 1546
             if (!string.IsNullOrEmpty(branchcode))
1379 1547
             {
1380 1548
                 sqlwhere += " and F_Code='" + branchcode + "'";
1381 1549
             }
1550
+            else
1551
+            {
1552
+                sqlwhere += " and F_IsSQ!=1";
1553
+            }
1382 1554
 
1383 1555
             #region 定义新表
1384 1556
             DataTable dtnew = new DataTable();
@@ -1466,7 +1638,10 @@ namespace CallCenterApi.Interface.Controllers
1466 1638
         /// <returns></returns>
1467 1639
         public ActionResult GetTelRate24ByDate(string branchcode, DateTime? date, string areaid)
1468 1640
         {
1469
-
1641
+            if (branchcode == "sqs12345")
1642
+            {
1643
+                branchcode = "";
1644
+            }
1470 1645
             if (date == null)
1471 1646
             {
1472 1647
                 date = DateTime.Now;
@@ -1477,6 +1652,10 @@ namespace CallCenterApi.Interface.Controllers
1477 1652
             {
1478 1653
                 sqlwhere += " and F_Code='" + branchcode + "'";
1479 1654
             }
1655
+            else
1656
+            {
1657
+                sqlwhere += " and F_IsSQ!=1";
1658
+            }
1480 1659
 
1481 1660
             int[] hours = Enumerable.Range(0, 24).ToArray<int>();
1482 1661
             int[] jt = new int[24];
@@ -1613,7 +1792,15 @@ namespace CallCenterApi.Interface.Controllers
1613 1792
                                     DataRow dataRow = dataTable.NewRow();
1614 1793
                                     foreach (var li in cname )
1615 1794
                                     {
1616
-                                        dataRow[li] = dictionary[li];
1795
+                                        if (dictionary[li] == null)
1796
+                                        {
1797
+                                            dataRow[li] = -1;
1798
+                                        }
1799
+                                        else
1800
+                                        {
1801
+                                            dataRow[li] = dictionary[li];
1802
+                                        }
1803
+                                        
1617 1804
                                     }
1618 1805
                                     //dataRow[root] = dictionary[root];
1619 1806
                                     foreach (string key in dic.Keys)
@@ -1692,8 +1879,14 @@ namespace CallCenterApi.Interface.Controllers
1692 1879
                             
1693 1880
                             foreach (var li in cname)
1694 1881
                             {
1695
-
1696
-                                dataRow[li] = dictionary[li];
1882
+                                if (dictionary[li] == null)
1883
+                                {
1884
+                                    dataRow[li] = -1;
1885
+                                }
1886
+                                else
1887
+                                {
1888
+                                    dataRow[li] = dictionary[li];
1889
+                                }
1697 1890
                             }
1698 1891
                             //dataRow[root] = dictionary[root];                          
1699 1892
                             

+ 22 - 2
CallCenterApi.Model/T_Branch_List.cs

@@ -29,7 +29,9 @@ namespace CallCenterApi.Model
29 29
         private int? _f_isdelete;
30 30
         private string _f_deleteuser;
31 31
         private DateTime? _f_deletetime;
32
-        private string  _f_areaid;
32
+        private string    _f_areaid;
33
+        private int _f_isdp;
34
+        private int _f_issq;
33 35
         /// <summary>
34 36
         /// 
35 37
         /// </summary>
@@ -186,11 +188,29 @@ namespace CallCenterApi.Model
186 188
         /// <summary>
187 189
         /// 
188 190
         /// </summary>
189
-        public string F_AreaId
191
+        public string  F_AreaId
190 192
         {
191 193
             set { _f_areaid = value; }
192 194
             get { return _f_areaid; }
193 195
         }
196
+
197
+        /// <summary>
198
+        /// 
199
+        /// </summary>
200
+        public int F_IsDP
201
+        {
202
+            set { _f_isdp = value; }
203
+            get { return _f_isdp; }
204
+        }
205
+
206
+        /// <summary>
207
+        /// 
208
+        /// </summary>
209
+        public int F_IsSQ
210
+        {
211
+            set { _f_issq = value; }
212
+            get { return _f_issq; }
213
+        }
194 214
         #endregion Model
195 215
 
196 216
     }