Pārlūkot izejas kodu

月度绩效报表

1550076451 3 gadi atpakaļ
vecāks
revīzija
cc4c05cb33

+ 50 - 3
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/WorkOrderReportController.cs

1352
         public ActionResult GetEvaluation(string date, int deptid = 0,int isdc=0)
1352
         public ActionResult GetEvaluation(string date, int deptid = 0,int isdc=0)
1353
         {
1353
         {
1354
             string sql = "F_IsDelete=0";
1354
             string sql = "F_IsDelete=0";
1355
+            string message = "";string datemessage = "";
1355
             if (!string.IsNullOrEmpty(date))
1356
             if (!string.IsNullOrEmpty(date))
1356
             {
1357
             {
1358
+                message = "统计周期:" + DateTime.Parse(date).AddMonths(-1).ToString("yyyy年MM月") + "-25日--" + DateTime.Parse(date).ToString("yyyy年MM月") + "-24日";
1359
+
1360
+                datemessage = MonthtoUpper(DateTime.Parse(date).Month );
1357
                 date = DateTime.Parse(date).ToString("yyyyMM");
1361
                 date = DateTime.Parse(date).ToString("yyyyMM");
1362
+               
1358
             }
1363
             }
1359
             else
1364
             else
1360
             {
1365
             {
1366
+                message = "统计周期:" + DateTime.Now.AddMonths(-1).ToString("yyyy年MM月") + "-25日--" + DateTime.Now.ToString("yyyy年MM月") + "-24日";
1361
                 date = DateTime .Now.AddMonths (-1).ToString("yyyyMM");
1367
                 date = DateTime .Now.AddMonths (-1).ToString("yyyyMM");
1368
+                datemessage = MonthtoUpper(DateTime.Now .Month);
1362
             }
1369
             }
1363
            
1370
            
1364
             sql += "and F_Date='" + date + "'";
1371
             sql += "and F_Date='" + date + "'";
1368
             }
1375
             }
1369
             if (isdc>0)
1376
             if (isdc>0)
1370
             {
1377
             {
1371
-                var dtdc = DbHelperSQL.Query(" select  *  from T_Sys_Evaluation a WITH(NOLOCK) where " + sql ).Tables[0];
1372
-                var msg = new NPOIHelper().ExportEvaluation ( dtdc);
1378
+                
1379
+                var dtdc = DbHelperSQL.Query(" select  *  from T_Sys_Evaluation a WITH(NOLOCK) where " + sql+ "order by F_Total desc").Tables[0];
1380
+                var msg = new NPOIHelper().ExportEvaluation ( dtdc, message, datemessage);
1373
                 if (msg == "")
1381
                 if (msg == "")
1374
                 {
1382
                 {
1375
                     return Success("导出成功");
1383
                     return Success("导出成功");
1381
             }
1389
             }
1382
             else
1390
             else
1383
             {
1391
             {
1384
-                string Evaluation = "select * from T_Sys_Evaluation where " + sql;
1392
+                string Evaluation = "select * from T_Sys_Evaluation where " + sql + "order by F_Total desc ";
1385
                 DataTable obj = DbHelperSQL.Query(Evaluation).Tables[0];
1393
                 DataTable obj = DbHelperSQL.Query(Evaluation).Tables[0];
1386
                 return Content(obj.ToJson());
1394
                 return Content(obj.ToJson());
1387
             }
1395
             }
1388
            
1396
            
1389
 
1397
 
1390
         }
1398
         }
1399
+        private static string MonthtoUpper(int month)
1400
+        {
1401
+            if (month < 10)
1402
+            {
1403
+                return NumtoUpper(month) ;
1404
+            }
1405
+            else
1406
+                if (month == 10) { return "十" ; }
1407
+
1408
+            else
1409
+            {
1410
+                return "十" + NumtoUpper(month - 10) ;
1411
+            }
1412
+        }
1413
+        private static string NumtoUpper(int num)
1414
+        {
1415
+            String str = num.ToString();
1416
+            string rstr = "";
1417
+            int n;
1418
+            for (int i = 0; i < str.Length; i++)
1419
+            {
1420
+                n = Convert.ToInt16(str[i].ToString());//char转数字,转换为字符串,再转数字
1421
+                switch (n)
1422
+                {
1423
+                    case 0: rstr = rstr + "〇"; break;
1424
+                    case 1: rstr = rstr + "一"; break;
1425
+                    case 2: rstr = rstr + "二"; break;
1426
+                    case 3: rstr = rstr + "三"; break;
1427
+                    case 4: rstr = rstr + "四"; break;
1428
+                    case 5: rstr = rstr + "五"; break;
1429
+                    case 6: rstr = rstr + "六"; break;
1430
+                    case 7: rstr = rstr + "七"; break;
1431
+                    case 8: rstr = rstr + "八"; break;
1432
+                    default: rstr = rstr + "九"; break;
1433
+                }
1434
+
1435
+            }
1436
+            return rstr;
1437
+        }
1391
         /// <summary>
1438
         /// <summary>
1392
         /// 获取绩效
1439
         /// 获取绩效
1393
         /// </summary>
1440
         /// </summary>

+ 138 - 41
CallCenterCommon/CallCenter.Utility/NPOI/NPOIHelper.cs

760
         /// </summary>
760
         /// </summary>
761
         /// <param name="ds"></param>
761
         /// <param name="ds"></param>
762
         /// <returns></returns>
762
         /// <returns></returns>
763
-        public string ExportEvaluation(DataTable dt)
763
+        public string ExportEvaluation(DataTable dt,string message,string data)
764
         {
764
         {
765
             try
765
             try
766
             {
766
             {
776
                 cellStylebt.SetFont(cellfontbt);
776
                 cellStylebt.SetFont(cellfontbt);
777
                 cellStylebt.VerticalAlignment = VerticalAlignment.Center;
777
                 cellStylebt.VerticalAlignment = VerticalAlignment.Center;
778
                 cellStylebt.Alignment = HorizontalAlignment.Center;
778
                 cellStylebt.Alignment = HorizontalAlignment.Center;
779
-                IRow irow1 = sheet.CreateRow(0);
779
+
780
+                IRow irow0 = sheet.CreateRow(0);
781
+                ICell cell0 = irow0.CreateCell(0);
782
+                cell0.SetCellValue(data+"月份市长热线承办单位办理情况统计表");
783
+                cell0.CellStyle = cellStylebt;
784
+                irow0.Height = 50 * 20;
785
+                sheet.AddMergedRegion(new CellRangeAddress(0, 0, 0, 16));
786
+
787
+                IRow irow00 = sheet.CreateRow(1);
788
+                ICell cell00 = irow00.CreateCell(0);
789
+                cell00.SetCellValue(message);
790
+                cell00.CellStyle = cellStylebt;
791
+                irow00.Height = 40 * 20;
792
+                sheet.AddMergedRegion(new CellRangeAddress(1, 1, 0, 16));
793
+
794
+
795
+
796
+
797
+
798
+                IRow irow1 = sheet.CreateRow(2);
780
                 ICell cell1 = irow1.CreateCell(0);
799
                 ICell cell1 = irow1.CreateCell(0);
781
                 cell1.SetCellValue("序号");
800
                 cell1.SetCellValue("序号");
782
                 cell1.CellStyle = cellStylebt;
801
                 cell1.CellStyle = cellStylebt;
783
-                sheet.AddMergedRegion(new CellRangeAddress(0, 2, 0, 0));
802
+                sheet.AddMergedRegion(new CellRangeAddress(2, 3, 0, 0));
784
                 ICell cell2 = irow1.CreateCell(1);
803
                 ICell cell2 = irow1.CreateCell(1);
785
                 cell2.SetCellValue("部门名称");
804
                 cell2.SetCellValue("部门名称");
786
                 cell2.CellStyle = cellStylebt;
805
                 cell2.CellStyle = cellStylebt;
787
-                sheet.AddMergedRegion(new CellRangeAddress(0, 2, 1, 1));
806
+                sheet.AddMergedRegion(new CellRangeAddress(2, 3, 1, 1));
788
 
807
 
789
-                ICell cell3 = irow1.CreateCell(2);
790
-                cell3.SetCellValue("工单办理");
791
-                cell3.CellStyle = cellStylebt;
792
-                sheet.AddMergedRegion(new CellRangeAddress(0, 0, 2, 5));
793
 
808
 
794
-                ICell cell4 = irow1.CreateCell(6);
809
+              
810
+
811
+
812
+
813
+                ICell cell14 = irow1.CreateCell(10);
814
+                cell14.SetCellValue("回访量");
815
+                cell14.CellStyle = cellStylebt;
816
+                sheet.AddMergedRegion(new CellRangeAddress(2, 3, 10, 10));
817
+
818
+                ICell cell15 = irow1.CreateCell(11);
819
+                cell15.SetCellValue("满意量");
820
+                cell15.CellStyle = cellStylebt;
821
+                sheet.AddMergedRegion(new CellRangeAddress(2, 3, 11, 11));
822
+
823
+                ICell cell4 = irow1.CreateCell(12);
795
                 cell4.SetCellValue("回访满意度");
824
                 cell4.SetCellValue("回访满意度");
796
                 cell4.CellStyle = cellStylebt;
825
                 cell4.CellStyle = cellStylebt;
797
-                sheet.AddMergedRegion(new CellRangeAddress(0, 2, 6, 6));
826
+                sheet.AddMergedRegion(new CellRangeAddress(2, 3, 12, 12));
798
 
827
 
799
-                ICell cell5 = irow1.CreateCell(7);
828
+                ICell cell5 = irow1.CreateCell(13);
800
                 cell5.SetCellValue("知识库更新");
829
                 cell5.SetCellValue("知识库更新");
801
                 cell5.CellStyle = cellStylebt;
830
                 cell5.CellStyle = cellStylebt;
802
-                sheet.AddMergedRegion(new CellRangeAddress(0, 2, 7, 7));
831
+                sheet.AddMergedRegion(new CellRangeAddress(2, 3, 13, 13));
803
 
832
 
804
-                ICell cell8 = irow1.CreateCell(8);
833
+                ICell cell8 = irow1.CreateCell(14);
805
                 cell8.SetCellValue("热线整合");
834
                 cell8.SetCellValue("热线整合");
806
                 cell8.CellStyle = cellStylebt;
835
                 cell8.CellStyle = cellStylebt;
807
-                sheet.AddMergedRegion(new CellRangeAddress(0, 2, 8, 8));
836
+                sheet.AddMergedRegion(new CellRangeAddress(2, 3, 14, 14));
808
 
837
 
809
-                ICell cell6 = irow1.CreateCell(9);
838
+                ICell cell6 = irow1.CreateCell(15);
810
                 cell6.SetCellValue("加扣分项");
839
                 cell6.SetCellValue("加扣分项");
811
                 cell6.CellStyle = cellStylebt;
840
                 cell6.CellStyle = cellStylebt;
812
-                sheet.AddMergedRegion(new CellRangeAddress(0, 2, 9, 9));
841
+                sheet.AddMergedRegion(new CellRangeAddress(2, 3, 15, 15));
813
 
842
 
814
-                ICell cell7 = irow1.CreateCell(10);
843
+                ICell cell7 = irow1.CreateCell(16);
815
                 cell7.SetCellValue("总分");
844
                 cell7.SetCellValue("总分");
816
                 cell7.CellStyle = cellStylebt;
845
                 cell7.CellStyle = cellStylebt;
817
-                sheet.AddMergedRegion(new CellRangeAddress(0, 2, 10, 10));
846
+                sheet.AddMergedRegion(new CellRangeAddress(2, 3, 16, 16));
818
 
847
 
819
              
848
              
820
 
849
 
821
-                IRow irow2 = sheet.CreateRow(1);
822
-                ICell cell9 = irow2.CreateCell(2);
850
+              
851
+                ICell cell9 = irow1.CreateCell(2);
823
                 cell9.SetCellValue("事项报备");
852
                 cell9.SetCellValue("事项报备");
824
                 cell9.CellStyle = cellStylebt;
853
                 cell9.CellStyle = cellStylebt;
825
-                sheet.AddMergedRegion(new CellRangeAddress(1, 2, 2, 2));
854
+                sheet.AddMergedRegion(new CellRangeAddress(2, 2, 2, 3));
826
 
855
 
827
-                ICell cell10 = irow2.CreateCell(3);
856
+                ICell cell10 = irow1.CreateCell(4);
828
                 cell10.SetCellValue("事项办理");
857
                 cell10.SetCellValue("事项办理");
829
                 cell10.CellStyle = cellStylebt;
858
                 cell10.CellStyle = cellStylebt;
830
-                sheet.AddMergedRegion(new CellRangeAddress(1, 1, 3, 5));
859
+                sheet.AddMergedRegion(new CellRangeAddress(2, 2, 4, 5));
831
 
860
 
832
-                IRow irow3 = sheet.CreateRow(2);
833
-                ICell cell11 = irow3.CreateCell(3);
834
-                cell11.SetCellValue("办理量");
835
-                cell11.CellStyle = cellStylebt;
836
 
861
 
837
-                ICell cell12 = irow3.CreateCell(4);
862
+                ICell cell12 = irow1.CreateCell(6);
838
                 cell12.SetCellValue("办理时限");
863
                 cell12.SetCellValue("办理时限");
839
                 cell12.CellStyle = cellStylebt;
864
                 cell12.CellStyle = cellStylebt;
865
+                sheet.AddMergedRegion(new CellRangeAddress(2, 2, 6, 7));
840
 
866
 
841
 
867
 
842
-                ICell cell13 = irow3.CreateCell(5);
868
+                ICell cell13 = irow1.CreateCell(8);
843
                 cell13.SetCellValue("重办事项");
869
                 cell13.SetCellValue("重办事项");
844
                 cell13.CellStyle = cellStylebt;
870
                 cell13.CellStyle = cellStylebt;
871
+                sheet.AddMergedRegion(new CellRangeAddress(2, 2, 8, 9));
872
+
873
+
874
+
875
+
876
+                IRow irow3 = sheet.CreateRow(3);
877
+                ICell cell11 = irow3.CreateCell(2);
878
+                cell11.SetCellValue("数量");
879
+                cell11.CellStyle = cellStylebt;
880
+                ICell cell16 = irow3.CreateCell(3);
881
+                cell16.SetCellValue("得分");
882
+                cell16.CellStyle = cellStylebt;
883
+
884
+
885
+
886
+               
887
+                ICell cell17 = irow3.CreateCell(4);
888
+                cell17.SetCellValue("承办量");
889
+                cell17.CellStyle = cellStylebt;
890
+                ICell cell18 = irow3.CreateCell(5);
891
+                cell18.SetCellValue("得分");
892
+                cell18.CellStyle = cellStylebt;
893
+
894
+
895
+                ICell cell19 = irow3.CreateCell(6);
896
+                cell19.SetCellValue("逾期量");
897
+                cell19.CellStyle = cellStylebt;
898
+                ICell cell20 = irow3.CreateCell(7);
899
+                cell20.SetCellValue("得分");
900
+                cell20.CellStyle = cellStylebt;
901
+
902
+
903
+                ICell cell21 = irow3.CreateCell(8);
904
+                cell21.SetCellValue("重办量");
905
+                cell21.CellStyle = cellStylebt;
906
+                ICell cell22 = irow3.CreateCell(9);
907
+                cell22.SetCellValue("得分");
908
+                cell22.CellStyle = cellStylebt;
909
+
910
+
911
+
845
 
912
 
846
                 ICellStyle cellStylebt1 = workbook.CreateCellStyle();
913
                 ICellStyle cellStylebt1 = workbook.CreateCellStyle();
847
                 NPOI.SS.UserModel.IFont cellfontbt1 = workbook.CreateFont();
914
                 NPOI.SS.UserModel.IFont cellfontbt1 = workbook.CreateFont();
850
                 cellStylebt1.VerticalAlignment = VerticalAlignment.Center;
917
                 cellStylebt1.VerticalAlignment = VerticalAlignment.Center;
851
                 cellStylebt1.Alignment = HorizontalAlignment.Center;
918
                 cellStylebt1.Alignment = HorizontalAlignment.Center;
852
 
919
 
853
-                int index = 3;
920
+                int index = 4;
854
                 if (dt != null && dt.Rows.Count >0)
921
                 if (dt != null && dt.Rows.Count >0)
855
                 {
922
                 {
856
                     int iCellIndex = 0;
923
                     int iCellIndex = 0;
859
                         IRow irow4 = sheet.CreateRow(index);
926
                         IRow irow4 = sheet.CreateRow(index);
860
                         index++;
927
                         index++;
861
                         iCellIndex++;
928
                         iCellIndex++;
862
-                        for (int i = 0; i < 11; i++)
929
+                        for (int i = 0; i < 17; i++)
863
                         {
930
                         {
864
                             switch (i )
931
                             switch (i )
865
                             {
932
                             {
875
                                     break;
942
                                     break;
876
                                 case 2:
943
                                 case 2:
877
                                     ICell cel2 = irow4.CreateCell(i);
944
                                     ICell cel2 = irow4.CreateCell(i);
878
-                                    cel2.SetCellValue(dr["F_Matter"].ToString());
945
+                                    cel2.SetCellValue(dr["F_Reporting"].ToString());
879
                                     cel2.CellStyle = cellStylebt1;
946
                                     cel2.CellStyle = cellStylebt1;
880
                                     break;
947
                                     break;
881
                                 case 3:
948
                                 case 3:
949
+                                    ICell cel12 = irow4.CreateCell(i);
950
+                                    cel12.SetCellValue(dr["F_Matter"].ToString());
951
+                                    cel12.CellStyle = cellStylebt1;
952
+                                    break;
953
+                                case 4:
882
                                     ICell cel3 = irow4.CreateCell(i);
954
                                     ICell cel3 = irow4.CreateCell(i);
883
-                                    cel3.SetCellValue(dr["F_Handling"].ToString());
955
+                                    cel3.SetCellValue(dr["F_Undertake"].ToString());
884
                                     cel3.CellStyle = cellStylebt1;
956
                                     cel3.CellStyle = cellStylebt1;
885
                                     break;
957
                                     break;
886
-                                case 4:
958
+                                case 5:
959
+                                    ICell cel13 = irow4.CreateCell(i);
960
+                                    cel13.SetCellValue(dr["F_Handling"].ToString());
961
+                                    cel13.CellStyle = cellStylebt1;
962
+                                    break;
963
+                                case 6:
887
                                     ICell cel4 = irow4.CreateCell(i);
964
                                     ICell cel4 = irow4.CreateCell(i);
888
-                                    cel4.SetCellValue(dr["F_Timelimit"].ToString());
965
+                                    cel4.SetCellValue(dr["F_Boverdue"].ToString());
889
                                     cel4.CellStyle = cellStylebt1;
966
                                     cel4.CellStyle = cellStylebt1;
890
                                     break;
967
                                     break;
891
-                                case 5:
968
+                                case 7:
969
+                                    ICell cel14 = irow4.CreateCell(i);
970
+                                    cel14.SetCellValue(dr["F_Timelimit"].ToString());
971
+                                    cel14.CellStyle = cellStylebt1;
972
+                                    break;
973
+                                case 8:
974
+                                    ICell cel15 = irow4.CreateCell(i);
975
+                                    cel15.SetCellValue(dr["F_Redovolume"].ToString());
976
+                                    cel15.CellStyle = cellStylebt1;
977
+                                    break;
978
+                                case 9:
892
                                     ICell cel5 = irow4.CreateCell(i);
979
                                     ICell cel5 = irow4.CreateCell(i);
893
                                     cel5.SetCellValue(dr["F_Redo"].ToString());
980
                                     cel5.SetCellValue(dr["F_Redo"].ToString());
894
                                     cel5.CellStyle = cellStylebt1;
981
                                     cel5.CellStyle = cellStylebt1;
895
                                     break;
982
                                     break;
896
-                                case 6:
983
+                                case 10:
984
+                                    ICell cel16 = irow4.CreateCell(i);
985
+                                    cel16.SetCellValue(dr["F_Returnvisit"].ToString());
986
+                                    cel16.CellStyle = cellStylebt1;
987
+                                    break;
988
+                                case 11:
989
+                                    ICell cel17 = irow4.CreateCell(i);
990
+                                    cel17.SetCellValue(dr["F_Satisfaction"].ToString());
991
+                                    cel17.CellStyle = cellStylebt1;
992
+                                    break;
993
+                                case 12:
897
                                     ICell cel6 = irow4.CreateCell(i);
994
                                     ICell cel6 = irow4.CreateCell(i);
898
                                     cel6.SetCellValue(dr["F_Satisfied"].ToString());
995
                                     cel6.SetCellValue(dr["F_Satisfied"].ToString());
899
                                     cel6.CellStyle = cellStylebt1;
996
                                     cel6.CellStyle = cellStylebt1;
900
                                     break;
997
                                     break;
901
-                                case 7:
998
+                                case 13:
902
                                     ICell cel7 = irow4.CreateCell(i);
999
                                     ICell cel7 = irow4.CreateCell(i);
903
                                     cel7.SetCellValue(dr["F_knowledge"].ToString());
1000
                                     cel7.SetCellValue(dr["F_knowledge"].ToString());
904
                                     cel7.CellStyle = cellStylebt1;
1001
                                     cel7.CellStyle = cellStylebt1;
905
                                     break;
1002
                                     break;
906
-                                case 8:
1003
+                                case 14:
907
                                     ICell cel10 = irow4.CreateCell(i);
1004
                                     ICell cel10 = irow4.CreateCell(i);
908
                                     cel10.SetCellValue(dr["F_Integration"].ToString());
1005
                                     cel10.SetCellValue(dr["F_Integration"].ToString());
909
                                     cel10.CellStyle = cellStylebt1;
1006
                                     cel10.CellStyle = cellStylebt1;
910
                                     break;
1007
                                     break;
911
                                     
1008
                                     
912
-                                case 9:
1009
+                                case 15:
913
                                     ICell cel8= irow4.CreateCell(i);
1010
                                     ICell cel8= irow4.CreateCell(i);
914
                                     cel8.SetCellValue(dr["F_Buckle"].ToString());
1011
                                     cel8.SetCellValue(dr["F_Buckle"].ToString());
915
                                     cel8.CellStyle = cellStylebt1;
1012
                                     cel8.CellStyle = cellStylebt1;
916
                                     break;
1013
                                     break;
917
-                                case 10:
1014
+                                case 16:
918
                                     ICell cel9 = irow4.CreateCell(i);
1015
                                     ICell cel9 = irow4.CreateCell(i);
919
                                     cel9.SetCellValue(dr["F_Total"].ToString());
1016
                                     cel9.SetCellValue(dr["F_Total"].ToString());
920
                                     cel9.CellStyle = cellStylebt1;
1017
                                     cel9.CellStyle = cellStylebt1;