1550076451 2 vuotta sitten
vanhempi
commit
145b309f00

+ 0 - 1
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/SMSController.cs

@@ -153,7 +153,6 @@ namespace CallCenterApi.Interface.Controllers
153 153
         {
154 154
             try
155 155
             {
156
-                return true;
157 156
                 SmsSingleSenderResult result = SMSSingleshot(templateId, mag, mobiles);
158 157
                 if (result != null)
159 158
                 {

+ 79 - 16
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/WorkOrderReportController.cs

@@ -263,7 +263,7 @@ namespace CallCenterApi.Interface.Controllers.report
263 263
             return Success("成功", obj);
264 264
         }
265 265
         public ActionResult GetDeptEfficiency(DateTime? start, DateTime? end, bool isExport = false,
266
-            string source="")
266
+            string source="",int type=0)
267 267
         {
268 268
             if (start == null)
269 269
             {
@@ -280,9 +280,14 @@ namespace CallCenterApi.Interface.Controllers.report
280 280
             paras.Add("@source", source);
281 281
             var obj = DbHelperSQL.RunProcedure("P_DeptEfficiencyReport_1", paras, "DeptEfficiencyReport");
282 282
             var newSet = new DataSet();
283
-            var newSet1 = new DataSet();
283
+          
284 284
             DataTable exceldt = new DataTable();
285
-            
285
+            DataSet  newSet1 = new DataSet();
286
+
287
+            if (type > 0)
288
+            {
289
+                exceldt.Columns.Add("ranking", typeof(string));//
290
+            }
286 291
             exceldt.Columns.Add("deptname", typeof(string));//单位名称
287 292
             exceldt.Columns.Add("slcount", typeof(int));//受理量
288 293
             exceldt.Columns.Add("bjcount", typeof(int));//办结量
@@ -293,7 +298,13 @@ namespace CallCenterApi.Interface.Controllers.report
293 298
             exceldt.Columns.Add("bdreloadcount", typeof(string));//本地重办量
294 299
             exceldt.Columns.Add("bjlyrate", typeof(string));//办结率
295 300
             exceldt.Columns.Add("yqlyrate", typeof(string));//延期率
296
-            
301
+            if (type>0)
302
+            {
303
+                exceldt.Columns.Add("timelyrate", typeof(string));//及时率
304
+                exceldt.Columns.Add("timely", typeof(string));//及时
305
+            }
306
+           
307
+
297 308
             if (obj != null && obj.Tables[0] != null && obj.Tables[0].Rows.Count > 0)
298 309
             {
299 310
 
@@ -310,6 +321,7 @@ namespace CallCenterApi.Interface.Controllers.report
310 321
                     int bdreloadcount = 0;//本地重办量
311 322
                     double bjlyrate = 0;//办结率
312 323
                     double yqlyrate = 0;// 延期率
324
+                    
313 325
                     #region 赋值
314 326
                     int.TryParse(obj.Tables[0].Rows[i]["slcount"].ToString(), out slcount);
315 327
                     int.TryParse(obj.Tables[0].Rows[i]["bjcount"].ToString(), out bjcount);
@@ -328,6 +340,15 @@ namespace CallCenterApi.Interface.Controllers.report
328 340
 
329 341
                         yqlyrate = (double)timeoutcount / (double)slcount;
330 342
                         obj.Tables[0].Rows[i]["yqlyrate"] = yqlyrate.ToString("0.00%");//办结率
343
+
344
+                        if (type > 0)
345
+                        {
346
+                            timelyrate = (double)timelycount / (double)slcount;
347
+                            obj.Tables[0].Rows[i]["timely"] = timelyrate;
348
+                            obj.Tables[0].Rows[i]["timelyrate"] = timelyrate.ToString("0.00%");//及时率
349
+
350
+                        }
351
+                          
331 352
                     }
332 353
                     //if (completedcount > 0)
333 354
                     //{
@@ -353,30 +374,72 @@ namespace CallCenterApi.Interface.Controllers.report
353 374
 
354 375
                         yqlyrate = (double)timeoutcount / (double)slcount;
355 376
                         dr["yqlyrate"] = yqlyrate.ToString("0.00%");//办结率
377
+                        if (type > 0)
378
+                        {
379
+                            timelyrate = (double)timelycount / (double)slcount;
380
+                            obj.Tables[0].Rows[i]["timely"] = timelyrate;
381
+                            obj.Tables[0].Rows[i]["timelyrate"] = timelyrate.ToString("0.00%");//及时率
382
+                        }
356 383
                     }
357 384
                     exceldt.Rows.Add(dr);
358 385
                     #endregion
359 386
                 }
360
-                newSet1.Tables.Add(exceldt);
361
-                obj.Tables[0].DefaultView.Sort = "rate desc";
362
-                newSet.Tables.Add(obj.Tables[0].DefaultView.ToTable());
363
-                newSet.Tables[0].Columns.Remove("rate");
387
+            
388
+                if (type >0)
389
+                {
390
+                    exceldt.DefaultView.Sort = "timely desc";
391
+                    for (int i = 0; i < exceldt.Rows.Count; i++)
392
+                    {
393
+                        exceldt.Rows[i]["ranking"] = i + 1;
394
+                    }
395
+                    exceldt.Columns.Remove("timely");
396
+                }
397
+                else
398
+                {
399
+                    newSet1.Tables.Add(exceldt);
400
+                    obj.Tables[0].DefaultView.Sort = "rate desc";
401
+                    newSet.Tables.Add(obj.Tables[0].DefaultView.ToTable());
402
+                    newSet.Tables[0].Columns.Remove("rate");
403
+                }
404
+
405
+
364 406
                 //obj.Tables[0] = obj.Tables[0].DefaultView.ToTable();
365 407
             }
366
-            if (isExport)
408
+            if (type >0)
367 409
             {
368
-                string[] cols = new string[] { "单位名称", "受理量", "办结量", "及时量", "延期量", "催办量","郑州重办量","本地重办量" ,"办结率", "延期率" };
369
-                NPOIHelper npoi = new NPOIHelper();
370
-                if (npoi.ExportToExcel("处理效率统计报表", newSet1.Tables[0], cols) == "")
410
+                if (isExport)
371 411
                 {
372
-                    return Success("导出成功");
412
+                    string[] cols = new string[] {"排名", "单位名称", "受理量", "办结量", "及时量", "延期量", "催办量", "郑州重办量", "本地重办量", "办结率", "延期率","及时率" };
413
+                    NPOIHelper npoi = new NPOIHelper();
414
+                    if (npoi.ExportToExcel("处理效率统计报表", exceldt, cols) == "")
415
+                    {
416
+                        return Success("导出成功");
417
+                    }
418
+                    else
419
+                    {
420
+                        return Error("导出失败");
421
+                    }
373 422
                 }
374
-                else
423
+                return Success("成功", exceldt);
424
+            }
425
+            else
426
+            {
427
+                if (isExport)
375 428
                 {
376
-                    return Error("导出失败");
429
+                    string[] cols = new string[] { "单位名称", "受理量", "办结量", "及时量", "延期量", "催办量", "郑州重办量", "本地重办量", "办结率", "延期率" };
430
+                    NPOIHelper npoi = new NPOIHelper();
431
+                    if (npoi.ExportToExcel("处理效率统计报表", newSet1.Tables[0], cols) == "")
432
+                    {
433
+                        return Success("导出成功");
434
+                    }
435
+                    else
436
+                    {
437
+                        return Error("导出失败");
438
+                    }
377 439
                 }
440
+                return Success("成功", newSet);
378 441
             }
379
-            return Success("成功", newSet);
442
+          
380 443
         }
381 444
   
382 445
         /// <summary>