duhongyu 4 年之前
父节点
当前提交
d8b5d1613c
共有 18 个文件被更改,包括 1096 次插入472 次删除
  1. 21 9
      CallCenterApi/CallCenterApi.DAL/T_Bus_RemindRecord.cs
  2. 8 3
      CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/APPController.cs
  3. 15 0
      CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/Sms/SMSController.cs
  4. 8 3
      CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/UserAccountController.cs
  5. 1 1
      CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/Wiki/HotspotGlossaryController.cs
  6. 1 1
      CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/Wiki/NounInterpretationController.cs
  7. 1 1
      CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/TotalTelController.cs
  8. 200 32
      CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/WorkOrderReportController.cs
  9. 5 9
      CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/ZuoXiWorkTotalController.cs
  10. 41 14
      CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/CallrecordsController.cs
  11. 31 6
      CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/APPSController.cs
  12. 13 5
      CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/AffairsController.cs
  13. 557 357
      CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderController.cs
  14. 21 12
      CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderNewController.cs
  15. 3 3
      CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Global.asax.cs
  16. 2 0
      CallCenterApi/CallCenterApi.Model/T_Bus_RemindRecord.cs
  17. 5 6
      CallCenterCommon/CallCenter.QuartzService/Peoplewebsite.cs
  18. 163 10
      CallCenterCommon/CallCenter.Utility/NPOI/NPOIHelper.cs

+ 21 - 9
CallCenterApi/CallCenterApi.DAL/T_Bus_RemindRecord.cs

37
         {
37
         {
38
             StringBuilder strSql = new StringBuilder();
38
             StringBuilder strSql = new StringBuilder();
39
             strSql.Append("insert into T_Bus_RemindRecord(");
39
             strSql.Append("insert into T_Bus_RemindRecord(");
40
-            strSql.Append("F_WorkOrderId,F_AssignedId,F_Type,F_Content,F_DeptId,F_State,F_Remark,F_CreateUser,F_CreateTime,F_IsDelete,F_DeleteUser,F_DeleteTime,F_File,Supervisor,F_IsExamine)");
40
+            strSql.Append("F_WorkOrderId,F_AssignedId,F_Type,F_Content,F_DeptId,F_State,F_Remark,F_CreateUser,F_CreateTime,F_IsDelete,F_DeleteUser,F_DeleteTime,F_File,Supervisor,F_IsExamine,F_Mode)");
41
             strSql.Append(" values (");
41
             strSql.Append(" values (");
42
-            strSql.Append("@F_WorkOrderId,@F_AssignedId,@F_Type,@F_Content,@F_DeptId,@F_State,@F_Remark,@F_CreateUser,@F_CreateTime,@F_IsDelete,@F_DeleteUser,@F_DeleteTime,@F_File,@Supervisor,@F_IsExamine)");
42
+            strSql.Append("@F_WorkOrderId,@F_AssignedId,@F_Type,@F_Content,@F_DeptId,@F_State,@F_Remark,@F_CreateUser,@F_CreateTime,@F_IsDelete,@F_DeleteUser,@F_DeleteTime,@F_File,@Supervisor,@F_IsExamine,@F_Mode)");
43
             strSql.Append(";select @@IDENTITY");
43
             strSql.Append(";select @@IDENTITY");
44
             SqlParameter[] parameters = {
44
             SqlParameter[] parameters = {
45
                     new SqlParameter("@F_WorkOrderId", SqlDbType.NVarChar,50),
45
                     new SqlParameter("@F_WorkOrderId", SqlDbType.NVarChar,50),
56
                     new SqlParameter("@F_DeleteTime", SqlDbType.DateTime),
56
                     new SqlParameter("@F_DeleteTime", SqlDbType.DateTime),
57
                     new SqlParameter("@F_File", SqlDbType.VarChar,500),
57
                     new SqlParameter("@F_File", SqlDbType.VarChar,500),
58
                     new SqlParameter("@Supervisor", SqlDbType.VarChar,50),
58
                     new SqlParameter("@Supervisor", SqlDbType.VarChar,50),
59
-                     new SqlParameter("@F_IsExamine", SqlDbType.Int,4)
60
-                    
59
+                     new SqlParameter("@F_IsExamine", SqlDbType.Int,4),
60
+                     new SqlParameter("@F_Mode", SqlDbType.Int,4),
61
+                     
62
+
61
             };
63
             };
62
             parameters[0].Value = model.F_WorkOrderId;
64
             parameters[0].Value = model.F_WorkOrderId;
63
             parameters[1].Value = model.F_AssignedId;
65
             parameters[1].Value = model.F_AssignedId;
74
             parameters[12].Value = model.F_File;
76
             parameters[12].Value = model.F_File;
75
             parameters[13].Value = model.Supervisor;
77
             parameters[13].Value = model.Supervisor;
76
             parameters[14].Value = model.F_IsExamine;
78
             parameters[14].Value = model.F_IsExamine;
79
+            parameters[15].Value = model.F_Mode;
80
+            
77
             object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
81
             object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
78
             if (obj == null)
82
             if (obj == null)
79
             {
83
             {
106
             strSql.Append("Supervisor=@Supervisor,");
110
             strSql.Append("Supervisor=@Supervisor,");
107
             strSql.Append("F_IsExamine=@F_IsExamine,");
111
             strSql.Append("F_IsExamine=@F_IsExamine,");
108
             strSql.Append("SupervisorTime=@SupervisorTime,");
112
             strSql.Append("SupervisorTime=@SupervisorTime,");
113
+            strSql.Append("F_Mode=@F_Mode,");
109
             strSql.Append("F_File=@F_File");
114
             strSql.Append("F_File=@F_File");
110
             strSql.Append(" where F_Id=@F_Id");
115
             strSql.Append(" where F_Id=@F_Id");
111
             SqlParameter[] parameters = {
116
             SqlParameter[] parameters = {
124
                      new SqlParameter("@Supervisor", SqlDbType.VarChar,50),
129
                      new SqlParameter("@Supervisor", SqlDbType.VarChar,50),
125
                       new SqlParameter("@F_IsExamine", SqlDbType.Int,4),
130
                       new SqlParameter("@F_IsExamine", SqlDbType.Int,4),
126
                       new SqlParameter("@SupervisorTime", SqlDbType.DateTime),
131
                       new SqlParameter("@SupervisorTime", SqlDbType.DateTime),
132
+                     new SqlParameter("@F_Mode", SqlDbType.Int,4),
133
+                      
127
                     new SqlParameter("@F_File", SqlDbType.VarChar,500),
134
                     new SqlParameter("@F_File", SqlDbType.VarChar,500),
128
                     new SqlParameter("@F_Id", SqlDbType.Int,4)};
135
                     new SqlParameter("@F_Id", SqlDbType.Int,4)};
129
             parameters[0].Value = model.F_WorkOrderId;
136
             parameters[0].Value = model.F_WorkOrderId;
141
             parameters[12].Value = model.Supervisor;
148
             parameters[12].Value = model.Supervisor;
142
             parameters[13].Value = model.F_IsExamine;
149
             parameters[13].Value = model.F_IsExamine;
143
             parameters[14].Value = model.SupervisorTime;
150
             parameters[14].Value = model.SupervisorTime;
144
-            parameters[15].Value = model.F_File;
145
-            parameters[16].Value = model.F_Id;
151
+            parameters[15].Value = model.F_Mode;
152
+            parameters[16].Value = model.F_File;
153
+            parameters[17].Value = model.F_Id;
146
 
154
 
147
             int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
155
             int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
148
             if (rows > 0)
156
             if (rows > 0)
230
         {
238
         {
231
 
239
 
232
             StringBuilder strSql = new StringBuilder();
240
             StringBuilder strSql = new StringBuilder();
233
-            strSql.Append("select  top 1 F_Id,F_WorkOrderId,F_AssignedId,F_Type,F_Content,F_DeptId,F_State,F_Remark,F_CreateUser,F_CreateTime,F_IsDelete,F_DeleteUser,F_DeleteTime,F_File,Supervisor,F_IsExamine from T_Bus_RemindRecord WITH(NOLOCK) ");
241
+            strSql.Append("select  top 1 F_Id,F_WorkOrderId,F_AssignedId,F_Type,F_Content,F_DeptId,F_State,F_Remark,F_CreateUser,F_CreateTime,F_IsDelete,F_DeleteUser,F_DeleteTime,F_File,Supervisor,F_IsExamine,F_Mode from T_Bus_RemindRecord WITH(NOLOCK) ");
234
             strSql.Append(" where F_Id=@F_Id");
242
             strSql.Append(" where F_Id=@F_Id");
235
             SqlParameter[] parameters = {
243
             SqlParameter[] parameters = {
236
                     new SqlParameter("@F_Id", SqlDbType.Int,4)
244
                     new SqlParameter("@F_Id", SqlDbType.Int,4)
326
                 {
334
                 {
327
                     model.F_IsExamine = int.Parse(row["F_IsExamine"].ToString());
335
                     model.F_IsExamine = int.Parse(row["F_IsExamine"].ToString());
328
                 }
336
                 }
337
+                if (row["F_Mode"] != null && row["F_Mode"].ToString() != "")
338
+                {
339
+                    model.F_Mode = int.Parse(row["F_Mode"].ToString());
340
+                }
329
                 
341
                 
330
             }
342
             }
331
             return model;
343
             return model;
337
         public DataSet GetList(string strWhere)
349
         public DataSet GetList(string strWhere)
338
         {
350
         {
339
             StringBuilder strSql = new StringBuilder();
351
             StringBuilder strSql = new StringBuilder();
340
-            strSql.Append("select F_Id,F_WorkOrderId,F_AssignedId,F_Type,F_Content,F_DeptId,F_State,F_Remark,F_CreateUser,F_CreateTime,F_IsDelete,F_DeleteUser,F_DeleteTime,F_File,Supervisor,F_IsExamine,SupervisorTime ");
352
+            strSql.Append("select F_Id,F_WorkOrderId,F_AssignedId,F_Type,F_Content,F_DeptId,F_State,F_Remark,F_CreateUser,F_CreateTime,F_IsDelete,F_DeleteUser,F_DeleteTime,F_File,Supervisor,F_IsExamine,SupervisorTime,F_Mode ");
341
             strSql.Append(" FROM T_Bus_RemindRecord WITH(NOLOCK) ");
353
             strSql.Append(" FROM T_Bus_RemindRecord WITH(NOLOCK) ");
342
             if (strWhere.Trim() != "")
354
             if (strWhere.Trim() != "")
343
             {
355
             {
357
             {
369
             {
358
                 strSql.Append(" top " + Top.ToString());
370
                 strSql.Append(" top " + Top.ToString());
359
             }
371
             }
360
-            strSql.Append(" F_Id,F_WorkOrderId,F_AssignedId,F_Type,F_Content,F_DeptId,F_State,F_Remark,F_CreateUser,F_CreateTime,F_IsDelete,F_DeleteUser,F_DeleteTime,F_File,Supervisor,F_IsExamine,SupervisorTime ");
372
+            strSql.Append(" F_Id,F_WorkOrderId,F_AssignedId,F_Type,F_Content,F_DeptId,F_State,F_Remark,F_CreateUser,F_CreateTime,F_IsDelete,F_DeleteUser,F_DeleteTime,F_File,Supervisor,F_IsExamine,SupervisorTime,F_Mode ");
361
             strSql.Append(" FROM T_Bus_RemindRecord WITH(NOLOCK) ");
373
             strSql.Append(" FROM T_Bus_RemindRecord WITH(NOLOCK) ");
362
             if (strWhere.Trim() != "")
374
             if (strWhere.Trim() != "")
363
             {
375
             {

+ 8 - 3
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/APPController.cs

3
 using CallCenterApi.DB;
3
 using CallCenterApi.DB;
4
 using CallCenterApi.Interface.App_Start;
4
 using CallCenterApi.Interface.App_Start;
5
 using CallCenterApi.Interface.Controllers.Base;
5
 using CallCenterApi.Interface.Controllers.Base;
6
+using CallCenterApi.Interface.Controllers.Sms;
6
 using CallCenterApi.Interface.Controllers.workorder;
7
 using CallCenterApi.Interface.Controllers.workorder;
7
 using CallCenterApi.Interface.Models.Common;
8
 using CallCenterApi.Interface.Models.Common;
8
 using CallCenterApi.Model;
9
 using CallCenterApi.Model;
461
                         oper.F_IsDelete = 0;
462
                         oper.F_IsDelete = 0;
462
                         operBLL.Add(oper);
463
                         operBLL.Add(oper);
463
                         string count = "您反映的事项已受理并转交相关部门处理,感谢您拨打市长热线!";
464
                         string count = "您反映的事项已受理并转交相关部门处理,感谢您拨打市长热线!";
464
-                        string msg = "";
465
-                        bool n = SMSController.AddSmS(0, msg, count, modelT_Bus_WorkOrder.F_CusPhone, "197387", "", modelT_Bus_WorkOrder.F_WorkOrderId);
465
+                        //  string msg = "";
466
+                        //   bool n = SMSController.AddSmS(0, msg, count, modelT_Bus_WorkOrder.F_CusPhone, "197387", "", modelT_Bus_WorkOrder.F_WorkOrderId);
467
+                        string phone = modelT_Bus_WorkOrder.F_CusPhone;
468
+                        if (phone.Length > 11)
469
+                            phone = phone.Substring(1, 11);
470
+                           string n = SmsNewController.AddSmS(0, count, phone, "681240256766803968", "", modelT_Bus_WorkOrder.F_WorkOrderId);
466
                         #endregion
471
                         #endregion
467
                     }).ContinueWith(p => {
472
                     }).ContinueWith(p => {
468
                         System.Diagnostics.Debug.WriteLine(DateTime.Now);
473
                         System.Diagnostics.Debug.WriteLine(DateTime.Now);
1129
                             var obj = new
1134
                             var obj = new
1130
                             {
1135
                             {
1131
                                 data = dt,
1136
                                 data = dt,
1132
-                                pysql= pysql
1137
+                                 pydt
1133
                             };
1138
                             };
1134
                             return Success("获取成功", obj);
1139
                             return Success("获取成功", obj);
1135
                         }
1140
                         }

+ 15 - 0
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/Sms/SMSController.cs

268
             string strendtime = HttpUtility.UrlDecode(RequestString.GetQueryString("endtime"));
268
             string strendtime = HttpUtility.UrlDecode(RequestString.GetQueryString("endtime"));
269
             int  type = RequestString.GetInt("type", 0);
269
             int  type = RequestString.GetInt("type", 0);
270
             int State = RequestString.GetInt ("state", 0);
270
             int State = RequestString.GetInt ("state", 0);
271
+            int acceptance = RequestString.GetInt("acceptance", 0);
271
             string strpageindex = RequestString.GetQueryString("page");
272
             string strpageindex = RequestString.GetQueryString("page");
272
             int pageindex = 1;
273
             int pageindex = 1;
273
             string strpagesize = RequestString.GetQueryString("pagesize");
274
             string strpagesize = RequestString.GetQueryString("pagesize");
294
                 else
295
                 else
295
                 {
296
                 {
296
                     sql += " and F_CustomerID is null ";
297
                     sql += " and F_CustomerID is null ";
298
+
297
                 }
299
                 }
298
             }
300
             }
301
+
299
             if (strpageindex.Trim() != "")
302
             if (strpageindex.Trim() != "")
300
             {
303
             {
301
                 pageindex = Convert.ToInt32(strpageindex);
304
                 pageindex = Convert.ToInt32(strpageindex);
305
             {
308
             {
306
                 pagesize = Convert.ToInt32(strpagesize);
309
                 pagesize = Convert.ToInt32(strpagesize);
307
             }
310
             }
311
+            if (acceptance>0)
312
+            {
313
+                if (acceptance==1)
314
+                {
315
+                    sql += " and F_Name   !=''";
316
+                }
317
+                else
318
+                {
319
+                    sql += " and (F_Name ='' or F_Name is null )";
320
+                }
321
+            }
308
             int recordCount = 0;
322
             int recordCount = 0;
309
             dt = BLL.PagerBLL.GetListPager(
323
             dt = BLL.PagerBLL.GetListPager(
310
                 "T_SMS_RecvSMS",
324
                 "T_SMS_RecvSMS",
325
                     x.Content,
339
                     x.Content,
326
                     x.SMSID ,
340
                     x.SMSID ,
327
                     x.F_Name,
341
                     x.F_Name,
342
+                    type=x.F_CustomerID,
328
                     usercode ="",
343
                     usercode ="",
329
                     x.RecvTime
344
                     x.RecvTime
330
                 }),
345
                 }),

+ 8 - 3
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/UserAccountController.cs

2
 using CallCenterApi.Common;
2
 using CallCenterApi.Common;
3
 using CallCenterApi.DB;
3
 using CallCenterApi.DB;
4
 using CallCenterApi.Interface.Controllers.Base;
4
 using CallCenterApi.Interface.Controllers.Base;
5
+using CallCenterApi.Interface.Controllers.Sms;
5
 using CallCenterApi.Interface.Models.Input;
6
 using CallCenterApi.Interface.Models.Input;
6
 using System;
7
 using System;
7
 using System.Collections.Generic;
8
 using System.Collections.Generic;
521
                 return Error("请输入将要发送的号码");
522
                 return Error("请输入将要发送的号码");
522
             }
523
             }
523
             int codes = new Random().Next(1000, 9999);
524
             int codes = new Random().Next(1000, 9999);
524
-            string msg = codes.ToString ();
525
-            bool n = SMSController.AddSmS(0, msg, "你的验证码是"+ codes+".十分钟有效.", mobile, "168411", "");
526
-            if (n)
525
+           // string msg = codes.ToString ();
526
+           // bool n = SMSController.AddSmS(0, msg, "你的验证码是"+ codes+".十分钟有效.", mobile, "168411", "");
527
+
528
+            string mag = "[\"" + codes.ToString() + "\"]";
529
+            string v = SmsNewController.AddSmS(0, "你的验证码是" + codes + ".十分钟有效.", mobile, "681240638956277760", mag,
530
+          "");
531
+            if (v=="")
527
             {
532
             {
528
                     return Success("发送成功");
533
                     return Success("发送成功");
529
             }
534
             }

+ 1 - 1
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/Wiki/HotspotGlossaryController.cs

83
             }
83
             }
84
             if (!string.IsNullOrEmpty(keyvalue))
84
             if (!string.IsNullOrEmpty(keyvalue))
85
             {
85
             {
86
-                sql += " and (F_ZhengCeMingCi like '%" + keyvalue + "%' or F_QiTaShuoMing like '%" + keyvalue + "%' or F_BanLiLiuCheng like '%" + keyvalue + "%' or F_BeiZhu like '%" + keyvalue + "%')";
86
+                sql += " and (F_ZhengCeMingCi like '%" + keyvalue + "%' or F_FaWenWenHao like '%" + keyvalue + "%' or F_ReDianWenTi like '%" + keyvalue + "%' or F_WenTiJieDa like '%" + keyvalue + "%')";
87
             }
87
             }
88
 
88
 
89
           
89
           

+ 1 - 1
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/Wiki/NounInterpretationController.cs

83
             }
83
             }
84
             if (!string.IsNullOrEmpty(keyvalue))
84
             if (!string.IsNullOrEmpty(keyvalue))
85
             {
85
             {
86
-                sql += " and (F_ZhengCeMingCi like '%" + keyvalue + "%' or F_QiTaShuoMing like '%" + keyvalue + "%' or F_BanLiLiuCheng like '%" + keyvalue + "%' or F_BeiZhu like '%" + keyvalue + "%')";
86
+                sql += " and (F_WenTiJieDa like '%" + keyvalue + "%' or F_ReDianWenTi like '%" + keyvalue + "%' or F_ZhengCeMingCi like '%" + keyvalue + "%' or F_FaWenWenHao like '%" + keyvalue + "%')";
87
             }
87
             }
88
 
88
 
89
           
89
           

+ 1 - 1
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/TotalTelController.cs

101
                 beginTime = DateTime.Parse(DateTime.Now.AddDays(-days).ToShortDateString());
101
                 beginTime = DateTime.Parse(DateTime.Now.AddDays(-days).ToShortDateString());
102
 
102
 
103
             if (etime != null && etime != "")
103
             if (etime != null && etime != "")
104
-                endTime = DateTime.Parse(etime + " 23:59:59");
104
+                endTime = DateTime.Parse(etime );
105
             else
105
             else
106
                 endTime = DateTime.Parse(DateTime.Now.ToShortDateString() + " 23:59:59");
106
                 endTime = DateTime.Parse(DateTime.Now.ToShortDateString() + " 23:59:59");
107
 
107
 

+ 200 - 32
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/WorkOrderReportController.cs

14
 using System.Text;
14
 using System.Text;
15
 using System.Web;
15
 using System.Web;
16
 using System.Web.Mvc;
16
 using System.Web.Mvc;
17
+using static CallCenter.Utility.NPOIHelper;
17
 
18
 
18
 namespace CallCenterApi.Interface.Controllers.report
19
 namespace CallCenterApi.Interface.Controllers.report
19
 {
20
 {
385
             var obj = DbHelperSQL.RunProcedure("P_UserAssessmentReport_1", paras, "UserAssessmentReport");
386
             var obj = DbHelperSQL.RunProcedure("P_UserAssessmentReport_1", paras, "UserAssessmentReport");
386
             if (isExport)
387
             if (isExport)
387
             {
388
             {
388
-                string[] cols = new string[] { "姓名", "接听量", "通话成单量", "手动录单量", "当即办理量", "网络转办量", "回访量","呼出量" };
389
+                string[] cols = new string[] { "姓名", "接听量", "通话成单量", "手动录单量", "当即办理量", "网络转办量", "回访量","呼出量" ,"回拨量"};
389
                 NPOIHelper npoi = new NPOIHelper();
390
                 NPOIHelper npoi = new NPOIHelper();
390
                 if (npoi.ExportToExcel("坐席工作统计报表", obj.Tables[0], cols) == "")
391
                 if (npoi.ExportToExcel("坐席工作统计报表", obj.Tables[0], cols) == "")
391
                 {
392
                 {
431
             }
432
             }
432
             return Success("成功", obj);
433
             return Success("成功", obj);
433
         }
434
         }
434
-
435
-        public ActionResult WorkOrdrList()
435
+     
436
+        public ActionResult WorkOrdrList(int isdc=0)
436
         {
437
         {
437
             DataTable dt = new DataTable();
438
             DataTable dt = new DataTable();
438
             string sql = " and F_IsDelete=0 ";
439
             string sql = " and F_IsDelete=0 ";
458
             string strendtime = HttpUtility.UrlDecode(RequestString.GetQueryString("endtime"));
459
             string strendtime = HttpUtility.UrlDecode(RequestString.GetQueryString("endtime"));
459
             int isRelease = RequestString.GetInt("isRelease", 0);
460
             int isRelease = RequestString.GetInt("isRelease", 0);
460
             int name= RequestString.GetInt("name", 0);
461
             int name= RequestString.GetInt("name", 0);
462
+            int handling = RequestString.GetInt("handling", 0);
461
             int pageindex = 1;
463
             int pageindex = 1;
462
             int pagesize = 10;
464
             int pagesize = 10;
463
             if (strpageindex.Trim() != "")
465
             if (strpageindex.Trim() != "")
644
                            "and  F_IsDelete =0 " + value + "  and F_IsSms !=1  )   ";
646
                            "and  F_IsDelete =0 " + value + "  and F_IsSms !=1  )   ";
645
                 }
647
                 }
646
             }
648
             }
649
+            if (handling>0)
650
+            {
651
+                if (deptid <= 0)
652
+                    return Error("请选择部门");
653
+                if (string.IsNullOrEmpty(strstarttime) && string.IsNullOrEmpty(strendtime))
654
+                {
655
+                    sql += " and datediff(MONTH ,a.F_CreateTime ,getdate())=0 ";
656
+                }
657
+                sql += "F_MainDeptId='" + deptid + "' and F_IsResult=0";
658
+                switch (handling)
659
+                {
660
+                    case 2:
661
+                        break;
662
+                }
663
+                   
664
+
665
+            }
647
             string cols = "";
666
             string cols = "";
648
             string order = "ORDER BY a.F_CreateTime DESC";
667
             string order = "ORDER BY a.F_CreateTime DESC";
649
             if (name >0)
668
             if (name >0)
659
             {
678
             {
660
                 cols = "  a.F_WorkOrderId,F_ComTitle,F_WorkState,F_MainDeptId,F_IsResult,a.F_CreateTime,dbo.GetUserName(a.F_CreateUser) as UserName,dbo.GetDictionaryName(F_InfoType) as TypeName,dbo.GetDictionaryName(F_InfoSource) as SourceName,dbo.GetDictionaryName(F_Key) KeyName,dbo.GetDeptNames(F_MainDeptId) as DeptName,F_CloseTime,F_LimitTime as LimitTime,F_ComContent";
679
                 cols = "  a.F_WorkOrderId,F_ComTitle,F_WorkState,F_MainDeptId,F_IsResult,a.F_CreateTime,dbo.GetUserName(a.F_CreateUser) as UserName,dbo.GetDictionaryName(F_InfoType) as TypeName,dbo.GetDictionaryName(F_InfoSource) as SourceName,dbo.GetDictionaryName(F_Key) KeyName,dbo.GetDeptNames(F_MainDeptId) as DeptName,F_CloseTime,F_LimitTime as LimitTime,F_ComContent";
661
             }
680
             }
662
-            
663
-            int recordCount = 0;
664
-            dt = BLL.PagerBLL.GetListPager(
665
-                "T_Bus_WorkOrder a WITH(NOLOCK)" ,
666
-                "a.F_WorkOrderId",
667
-                cols,
668
-                sql,
669
-                order,
670
-                pagesize,
671
-                pageindex,
672
-                true,
673
-                out recordCount);
674
-            var obj = new
681
+            if (isdc > 0)
675
             {
682
             {
676
-                state = "success",
677
-                message = "成功",
678
-                rows = dt,
679
-                total = recordCount
680
-            };
681
-            return Content(obj.ToJson());
682
-        }
683
+                var top = " "; var orderby = " order by F_CreateTime";
684
+                if (sql == " and F_IsDelete=0 ")
685
+                {
686
+                    top = " top 1000 "; orderby += " desc ";
687
+                }
688
+                if (db == 1)
689
+                {
690
+                    var dtdc = DbHelperSQL.Query(" select  ROW_NUMBER() OVER(ORDER BY F_CreateTime desc)  编号, F_WorkOrderId 事项单号,  dbo.GetDeptNames(F_MainDeptId ) 承办单位, "
691
+                       + "(case F_WorkState when 9 then '已完结' when 7 then '已办理' when 6 then  '已办理'   else '办理中' end)  督办情况,(case (select top 1 F_Mode  from T_Bus_RemindRecord  where  F_WorkOrderId = a.F_WorkOrderId order by F_Id desc) when 1 then '现场' when 0 then '电话'else '未知' end  ) 督办方式"
692
+                      + " from T_Bus_WorkOrder a WITH(NOLOCK) where 1=1 " + sql + orderby).Tables[0];
683
 
693
 
694
+                    var msg = new NPOIHelper().ExportToExcel("工单列表", dtdc);
695
+                    if (msg == "")
696
+                    {
697
+                        return Success("导出成功");
698
+                    }
699
+                    else
700
+                    {
701
+                        return Error("导出失败");
702
+                    }
684
 
703
 
704
+                }
705
+                else
706
+                {
707
+                    var dtdc = DbHelperSQL.Query(" select  ROW_NUMBER() OVER(ORDER BY F_CreateTime desc)  序号,F_CreateTime 日期, F_WorkOrderId 工单号,F_ComTitle 诉求标题,F_ComContent 诉求内容,dbo.GetDictionaryName(F_Key) 反映类别, "
708
+                   + "  dbo.GetDeptNames(F_MainDeptId ) 主办单位, "
709
+                   + " (select top 1 F_Result from T_Bus_Feedback WITH(NOLOCK) where F_State=1 and F_Type!=3 and F_IsDelete=0 and  F_WorkOrderId =a.F_WorkOrderId order by F_Id desc) 办理结果, "
710
+                   + " F_CusName 来电人姓名 ,F_CusPhone  来电人手机号 "
711
+                   + " from T_Bus_WorkOrder a WITH(NOLOCK) where 1=1 " + sql + orderby).Tables[0];
712
+
713
+                    var msg = new NPOIHelper().ExportToExcel("工单列表", dtdc);
714
+                    if (msg == "")
715
+                    {
716
+                        return Success("导出成功");
717
+                    }
718
+                    else
719
+                    {
720
+                        return Error("导出失败");
721
+                    }
722
+                }
723
+               
724
+            }
725
+            else
726
+            {
727
+                int recordCount = 0;
728
+                dt = BLL.PagerBLL.GetListPager(
729
+                    "T_Bus_WorkOrder a WITH(NOLOCK)",
730
+                    "a.F_WorkOrderId",
731
+                    cols,
732
+                    sql,
733
+                    order,
734
+                    pagesize,
735
+                    pageindex,
736
+                    true,
737
+                    out recordCount);
738
+                var obj = new
739
+                {
740
+                    state = "success",
741
+                    message = "成功",
742
+                    rows = dt,
743
+                    total = recordCount
744
+                };
745
+                return Content(obj.ToJson());
746
+            }
747
+           
748
+        }
685
        
749
        
750
+        public ActionResult IncomingCalls (string date,int isdc=0)
751
+        {
752
+            if (string.IsNullOrEmpty(date))
753
+                date = DateTime.Now.ToString("yyyy-MM-dd");
754
+            var modelcalllist = new BLL
755
+                 .T_Call_CallRecords().GetModelList(" CallType =0 and PhoneType = '12345' and DATEDIFF(DAY, BeginTime, '"+ date + "') = 0");
756
+            var userlist = new BLL.T_Sys_UserAccount().GetModelList(" F_SeatFlag =1");
757
+
758
+
759
+
760
+            int ldcount = 0;int jtcount = 0;
761
+            List<Incoming> incomings = new List<Incoming>();
762
+            Incoming incoming = new Incoming();
763
+            incoming.time = "00:00-8:00";
764
+            incoming.IncomingCount = modelcalllist.Where(x => x.BeginTime.Value.Hour >= 0 && x.BeginTime.Value.Hour <= 8
765
+            ).Count();
766
+            ldcount += incoming.IncomingCount;
767
+            incoming.Oncapacity = modelcalllist.Where(x => x.BeginTime.Value.Hour >= 0 && x.BeginTime.Value.Hour <= 8
768
+            &&x.CallState ==1 ).Count();
769
+            jtcount += incoming.Oncapacity;
770
+            var modelcalllists = modelcalllist.Where(x => x.UserCode != null && x.UserCode != "" && x.BeginTime.Value.Hour >= 0 && x.BeginTime.Value.Hour <=8).Select(x => x.UserCode).Distinct
771
+                ();
772
+          
773
+            if (modelcalllists!=null&& modelcalllists.Count() >0)
774
+            {
775
+                incoming.seatsCount = modelcalllists.Count();
776
+                foreach (var it in modelcalllists)
777
+                {
778
+                    var  user = userlist.Where(x => x.F_UserCode == it);
779
+                    if (user != null && user.Count() > 0)
780
+                        incoming.seats += "," + user.FirstOrDefault().F_UserName;
781
+                    else
782
+                        incoming.seats += "," + it;
783
+                }
784
+                if (!string .IsNullOrEmpty(incoming.seats))
785
+                    incoming.seats = incoming.seats.TrimStart(',');
786
+            }
787
+            else
788
+            {
789
+                incoming.seatsCount =0;
790
+                incoming.seats = "";
791
+            }
792
+            incomings.Add(incoming);
793
+            int v = 24;
794
+            if (DateTime .Parse (date ).Year ==DateTime .Now .Year &&
795
+                DateTime.Parse(date).Month  == DateTime.Now.Month && DateTime.Parse(date).Day  == DateTime.Now.Day)
796
+            {
797
+                v = DateTime.Now.Hour;
798
+            }
799
+            for (int i=8;i < v;    i ++)
800
+            {
801
+                Incoming incomin = new Incoming();
802
+                int t = i + 1;
803
+                string iss=i.ToString () ,tss=t .ToString ();
804
+                if (i < 10)
805
+                    iss = "0" + i;
806
+                if (t < 10)
807
+                    tss = "0" + t;
808
+
809
+                incomin.time = iss + ":00" + "-" + tss + ":00";
810
+                incomin.IncomingCount = modelcalllist.Where(x => x.BeginTime.Value.Hour ==i 
811
+                ).Count();
812
+                ldcount += incomin.IncomingCount;
813
+                incomin.Oncapacity = modelcalllist.Where(x => x.BeginTime.Value.Hour ==i
814
+                && x.CallState == 1).Count();
815
+                jtcount  += incomin.Oncapacity;
816
+                var modelcalllistss = modelcalllist.Where(x => x.UserCode != null&& x.UserCode != "" && x.BeginTime.Value.Hour==i).Select(x => x.UserCode).Distinct
817
+                    ();
818
+
819
+                if (modelcalllistss != null && modelcalllistss.Count() > 0)
820
+                {
821
+                    incomin.seatsCount = modelcalllistss.Count();
822
+                    foreach (var it in modelcalllistss)
823
+                    {
824
+                        var user = userlist.Where(x => x.F_UserCode == it);
825
+                        if (user != null && user.Count() > 0)
826
+                            incomin.seats += "," + user.FirstOrDefault().F_UserName;
827
+                        else
828
+                            incoming.seats += "," + it;
829
+                    }
830
+                    if (!string.IsNullOrEmpty(incomin.seats))
831
+                        incomin.seats= incomin.seats.TrimStart(',');
832
+                }
833
+                else
834
+                {
835
+                    incomin.seatsCount = 0;
836
+                    incomin.seats = "";
837
+                }
838
+                incomings.Add(incomin);
839
+            }
840
+            Incoming incomint = new Incoming();
841
+           
842
+            incomint.time = "共计";
843
+            incomint.IncomingCount = ldcount;
844
+            incomint.Oncapacity = jtcount;
845
+            incomings.Add(incomint);
846
+            if (isdc >0)
847
+            {
848
+                new NPOIHelper().IncomingCalls(incomings);
849
+                return Success("导出excel");
850
+            }
851
+            return Success("获取成功", incomings);
852
+        }
853
+
686
         /// <summary>
854
         /// <summary>
687
         /// 逾期未回复统计
855
         /// 逾期未回复统计
688
         /// </summary>
856
         /// </summary>
1727
                         if (source[i].F_Value=="12345")
1895
                         if (source[i].F_Value=="12345")
1728
                         {
1896
                         {
1729
                             mergerHot.sort = source.Count ;
1897
                             mergerHot.sort = source.Count ;
1730
-                            if (mergerHot.Call > 0)
1731
-                            {
1732
-                                mergerHot.rate = string.Format("{0:f2}%", (float)mergerHot.Connect / (float)mergerHot.Call * 100);
1733
-                            }
1734
-                            else
1735
-                            {
1736
-                                mergerHot.rate = "100%";
1737
-                            }
1898
+
1738
                         }
1899
                         }
1739
                         else
1900
                         else
1740
                         {
1901
                         {
1741
                             mergerHot.sort =i -1;
1902
                             mergerHot.sort =i -1;
1742
                         }
1903
                         }
1743
-                       
1904
+                        if (mergerHot.Call > 0)
1905
+                        {
1906
+                            mergerHot.rate = string.Format("{0:f2}%", (float)mergerHot.Connect / (float)mergerHot.Call * 100);
1907
+                        }
1908
+                        else
1909
+                        {
1910
+                            mergerHot.rate = "100%";
1911
+                        }
1744
                         mergerHotSources.MergerHot.Add(mergerHot);
1912
                         mergerHotSources.MergerHot.Add(mergerHot);
1745
 
1913
 
1746
                     }
1914
                     }

+ 5 - 9
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/ZuoXiWorkTotalController.cs

29
                         ,"平均接听通话秒数","平均振铃秒数","呼入占有率","用户评价","坐席登录次数"
29
                         ,"平均接听通话秒数","平均振铃秒数","呼入占有率","用户评价","坐席登录次数"
30
                         ,"登录时长分钟数","工作时长分钟数","平均每天工作时长(小时)"
30
                         ,"登录时长分钟数","工作时长分钟数","平均每天工作时长(小时)"
31
                         ,"置忙次数","休息时长分钟数","平均每天休息时长(小时)"
31
                         ,"置忙次数","休息时长分钟数","平均每天休息时长(小时)"
32
-                        ,"置忙平均休息分钟数","回拨量"//,"质检平均成绩"
32
+                        ,"置忙平均休息分钟数"//,"质检平均成绩"
33
                 };
33
                 };
34
             return Success("获取坐席工作统计表头成功", str);
34
             return Success("获取坐席工作统计表头成功", str);
35
         }
35
         }
87
             DataColumn dc23 = new DataColumn("休息时长分钟数");
87
             DataColumn dc23 = new DataColumn("休息时长分钟数");
88
             DataColumn dc24 = new DataColumn("平均每天休息时长");
88
             DataColumn dc24 = new DataColumn("平均每天休息时长");
89
             DataColumn dc25 = new DataColumn("置忙平均休息分钟数");
89
             DataColumn dc25 = new DataColumn("置忙平均休息分钟数");
90
-            DataColumn dc26 = new DataColumn("回拨量");
90
+           
91
             //DataColumn dc26 = new DataColumn("质检平均成绩");
91
             //DataColumn dc26 = new DataColumn("质检平均成绩");
92
 
92
 
93
             dtNew.Columns.Add(dc1);
93
             dtNew.Columns.Add(dc1);
115
             dtNew.Columns.Add(dc23);
115
             dtNew.Columns.Add(dc23);
116
             dtNew.Columns.Add(dc24);
116
             dtNew.Columns.Add(dc24);
117
             dtNew.Columns.Add(dc25);
117
             dtNew.Columns.Add(dc25);
118
-            dtNew.Columns.Add(dc26);
118
+           
119
             #endregion
119
             #endregion
120
             int days = 30;
120
             int days = 30;
121
             string sqltimeCallRecords = "";
121
             string sqltimeCallRecords = "";
164
             DataTable dtCallEvey = DbHelperSQL.Query("select usercode,COUNT(*) as ct,SUM(TalkLongTime) as sc from T_Call_CallRecords WITH(NOLOCK) where CallState=1 " + strsqlcall + " group by usercode ").Tables[0];
164
             DataTable dtCallEvey = DbHelperSQL.Query("select usercode,COUNT(*) as ct,SUM(TalkLongTime) as sc from T_Call_CallRecords WITH(NOLOCK) where CallState=1 " + strsqlcall + " group by usercode ").Tables[0];
165
             DataTable dtAgent = DbHelperSQL.Query("select AgentId,COUNT(*) as dl,SUM(LoginTimes) as dlsc,SUM(reposenum) as zm,SUM(ReposeTimes) as xx from rep_agent_detail WITH(NOLOCK) where 1=1 " + strsqlAgent + " group by AgentId ").Tables[0];
165
             DataTable dtAgent = DbHelperSQL.Query("select AgentId,COUNT(*) as dl,SUM(LoginTimes) as dlsc,SUM(reposenum) as zm,SUM(ReposeTimes) as xx from rep_agent_detail WITH(NOLOCK) where 1=1 " + strsqlAgent + " group by AgentId ").Tables[0];
166
             DataTable dtzj = DbHelperSQL.Query("select usercode,convert(int,SUM(f_qcscore)) as fs,COUNT(*) as fsct from T_Call_CallRecords WITH(NOLOCK) where F_QCState=1 " + strsqlcall + " group by usercode ").Tables[0];
166
             DataTable dtzj = DbHelperSQL.Query("select usercode,convert(int,SUM(f_qcscore)) as fs,COUNT(*) as fsct from T_Call_CallRecords WITH(NOLOCK) where F_QCState=1 " + strsqlcall + " group by usercode ").Tables[0];
167
-            DataTable hb = DbHelperSQL.Query(" select UserCode, COUNT(1) count from T_Call_CallRecords WITH(NOLOCK) where  CallId in(select CallbackCallid    from T_Call_CallRecords WITH(NOLOCK)  where CallbackCallid is not null" + strsqlcall + ")  group by   UserCode").Tables[0];
167
+          
168
 
168
 
169
 
169
 
170
 
170
 
242
                         drNew["接通率"] = (itrunkjtl * 100).ToString("0.00") + "%";
242
                         drNew["接通率"] = (itrunkjtl * 100).ToString("0.00") + "%";
243
                         drNew["呼损率"] = (itrunkhsl * 100).ToString("0.00") + "%";
243
                         drNew["呼损率"] = (itrunkhsl * 100).ToString("0.00") + "%";
244
                         drNew["平均排队时间"] = itrunkpjpd.ToString("0.00");
244
                         drNew["平均排队时间"] = itrunkpjpd.ToString("0.00");
245
-                        DataRow[] hbext = hb.Select("UserCode='" + dtUser.Rows[i]["F_UserCode"].ToString() + "'");
246
-                        if (hbext != null && hbext.Count() > 0)
247
-                            drNew["回拨量"] = hbext[0]["count"].ToString();
248
-                        else
249
-                            drNew["回拨量"] = 0;
245
+                     
250
 
246
 
251
                             #endregion
247
                             #endregion
252
                             #region 坐席接听数据
248
                             #region 坐席接听数据

+ 41 - 14
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/CallrecordsController.cs

31
             string PhoneType = HttpUtility.UrlDecode(RequestString.GetQueryString("phoneType"));
31
             string PhoneType = HttpUtility.UrlDecode(RequestString.GetQueryString("phoneType"));
32
             string group = HttpUtility.UrlDecode(RequestString.GetQueryString("group"));
32
             string group = HttpUtility.UrlDecode(RequestString.GetQueryString("group"));
33
             int callback = RequestString.GetInt("callback", 0);
33
             int callback = RequestString.GetInt("callback", 0);
34
+            int waitTime = RequestString.GetInt("waitTime", -1);
35
+            
34
             int type = RequestString.GetInt("type", 0);
36
             int type = RequestString.GetInt("type", 0);
35
             int islike = RequestString.GetInt("islike", 1);
37
             int islike = RequestString.GetInt("islike", 1);
36
             int notconnected = RequestString.GetInt("notconnected", 0);
38
             int notconnected = RequestString.GetInt("notconnected", 0);
76
             {
78
             {
77
                 if (phone != null && phone.Trim() != "")
79
                 if (phone != null && phone.Trim() != "")
78
                 {
80
                 {
79
-                    sql += " and CallNumber = '" + phone + "'";
81
+                    sql += " and CallNumber = '" + phone + "' ";
80
                 }
82
                 }
81
             }
83
             }
82
             if (callback>0)
84
             if (callback>0)
83
             {
85
             {
84
                 if (callback==1)
86
                 if (callback==1)
85
                 {
87
                 {
86
-                    sql += " and CallbackCallid is not null ";
88
+                    sql += " and Callback is not null ";
87
                 }
89
                 }
88
                else
90
                else
89
                 {
91
                 {
90
-                    sql += " and CallbackCallid is null";
92
+                    sql += " and Callback is null and  CallType=0 and CallState=0";
91
                 }
93
                 }
92
             }
94
             }
93
             if (!string .IsNullOrEmpty (CallbackCallid))
95
             if (!string .IsNullOrEmpty (CallbackCallid))
98
             {
100
             {
99
                 sql += " and UserCode in(select F_UserCode from T_Sys_UserAccount where F_UserName like '%"+ group + "%' )";
101
                 sql += " and UserCode in(select F_UserCode from T_Sys_UserAccount where F_UserName like '%"+ group + "%' )";
100
             }
102
             }
103
+            if (waitTime>-1)
104
+            {
105
+                sql += "and  (DATEDIFF (SECOND ,TalkStartTime,BeginTime)='"+ waitTime + "'  or ((DATEDIFF (SECOND ,TalkStartTime,EndTime)='"+ waitTime + "' and TalkStartTime is null )    ))";
106
+            }
101
             if (callstate.Trim() != "")
107
             if (callstate.Trim() != "")
102
             {
108
             {
103
                 if (callstate.Trim() == "0")
109
                 if (callstate.Trim() == "0")
184
             }
190
             }
185
             if (isdc > 0)
191
             if (isdc > 0)
186
             {
192
             {
187
-                var dtdc = DbHelperSQL.Query(" select   ROW_NUMBER()  OVER(ORDER BY CallRecordsId desc) 编号, CallNumber 电话号码,(case CallType when 0 then '呼入' else '呼出' end ) 呼叫方向,(case CallState when 0 then ( case  when CallType=0 and isnull(UserCode,'')='' then  '主动放弃' else '未接通'   end    ) else '已接通' end ) 呼叫状态,UserCode 坐席工号,dbo.GetUserName(UserCode) as 坐席姓名, "
188
-                    + "BeginTime 开始时间,TalkStartTime 通话开始时间 ,TalkEndTime " +
189
-                    " 通话结束时间 ,EndTime 结束时间 ,LongTime 通话时长 ,PhoneType " +
190
-                    "电话类别"
191
-                   + " from T_Call_CallRecords  a WITH(NOLOCK)  where 1=1 " + sql+ "ORDER BY CallRecordsId desc").Tables[0];
192
-                var msg = new NPOIHelper().ExportToExcel("通话记录", dtdc);
193
-                if (msg == "")
193
+                if (notconnected>0)
194
                 {
194
                 {
195
-                    return Success("导出成功");
195
+                    var dtdc = DbHelperSQL.Query(" select   ROW_NUMBER()  OVER(ORDER BY CallRecordsId desc) 编号, CallNumber 电话号码,(case CallType when 0 then '呼入' else '呼出' end ) 呼叫方向,(case CallState when 0 then ( case  when CallType=0 and isnull(UserCode,'')='' then  '主动放弃' else '未接通'   end    ) else '已接通' end ) 呼叫状态,UserCode 坐席工号, "
196
+                   + "BeginTime 开始时间,TalkStartTime 通话开始时间 ,TalkEndTime " +
197
+                   " 通话结束时间 ,EndTime 结束时间 ,LongTime 通话时长 ,PhoneType " +
198
+                   "电话类别"
199
+                  + " from T_Call_CallRecords  a WITH(NOLOCK)  where 1=1 " + sql + "ORDER BY CallRecordsId desc").Tables[0];
200
+                    var msg = new NPOIHelper().ExportToExcel("通话记录", dtdc);
201
+                    if (msg == "")
202
+                    {
203
+                        return Success("导出成功");
204
+                    }
205
+                    else
206
+                    {
207
+                        return Error("导出失败");
208
+                    }
196
                 }
209
                 }
197
                 else
210
                 else
198
                 {
211
                 {
199
-                    return Error("导出失败");
212
+                    var dtdc = DbHelperSQL.Query(" select   ROW_NUMBER()  OVER(ORDER BY CallRecordsId desc) 编号, CallNumber 电话号码,(case CallType when 0 then '呼入' else '呼出' end ) 呼叫方向,(case CallState when 0 then ( case  when CallType=0 and isnull(UserCode,'')='' then  '主动放弃' else '未接通'   end    ) else '已接通' end ) 呼叫状态,UserCode 坐席工号,dbo.GetUserName(UserCode) as 坐席姓名, "
213
+                   + "BeginTime 开始时间,TalkStartTime 通话开始时间 ,TalkEndTime " +
214
+                   " 通话结束时间 ,EndTime 结束时间 ,LongTime 通话时长 ,PhoneType " +
215
+                   "电话类别"
216
+                  + " from T_Call_CallRecords  a WITH(NOLOCK)  where 1=1 " + sql + "ORDER BY CallRecordsId desc").Tables[0];
217
+                    var msg = new NPOIHelper().ExportToExcel("通话记录", dtdc);
218
+                    if (msg == "")
219
+                    {
220
+                        return Success("导出成功");
221
+                    }
222
+                    else
223
+                    {
224
+                        return Error("导出失败");
225
+                    }
200
                 }
226
                 }
227
+               
201
             }
228
             }
202
             else
229
             else
203
             {
230
             {
253
                             && dr["BeginTime"].ToString() != "")
280
                             && dr["BeginTime"].ToString() != "")
254
                         {
281
                         {
255
                             var ltime = DateTime.Parse(dr["TalkStartTime"].ToString ());
282
                             var ltime = DateTime.Parse(dr["TalkStartTime"].ToString ());
256
-                            TimeSpan ts = ltime.Subtract(DateTime.Parse(dr["BeginTime"].ToString()));
283
+                            TimeSpan ts = ltime - DateTime.Parse(dr["BeginTime"].ToString());
257
                             double tss = double.Parse(Math.Round(ts.TotalSeconds, 0).ToString());
284
                             double tss = double.Parse(Math.Round(ts.TotalSeconds, 0).ToString());
258
                             dr["WaitTime"] = DateTimeConvert.parseTimeSeconds(tss, 1);
285
                             dr["WaitTime"] = DateTimeConvert.parseTimeSeconds(tss, 1);
259
                         }
286
                         }
260
                         else if (dr["EndTime"] != null && dr["EndTime"].ToString() != "" && dr["BeginTime"] != null && dr["BeginTime"].ToString() != "")
287
                         else if (dr["EndTime"] != null && dr["EndTime"].ToString() != "" && dr["BeginTime"] != null && dr["BeginTime"].ToString() != "")
261
                         {
288
                         {
262
                             var ltime = DateTime.Parse(dr["EndTime"].ToString());
289
                             var ltime = DateTime.Parse(dr["EndTime"].ToString());
263
-                            TimeSpan ts = ltime.Subtract(DateTime.Parse(dr["BeginTime"].ToString()));
290
+                            TimeSpan ts = ltime - DateTime.Parse(dr["BeginTime"].ToString());
264
                             double tss = double.Parse(Math.Round(ts.TotalSeconds, 0).ToString());
291
                             double tss = double.Parse(Math.Round(ts.TotalSeconds, 0).ToString());
265
                             dr["WaitTime"] = DateTimeConvert.parseTimeSeconds(tss, 1);
292
                             dr["WaitTime"] = DateTimeConvert.parseTimeSeconds(tss, 1);
266
                         }
293
                         }

+ 31 - 6
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/APPSController.cs

22
 using System.Net;
22
 using System.Net;
23
 using System.Threading.Tasks;
23
 using System.Threading.Tasks;
24
 using System.Security.Cryptography;
24
 using System.Security.Cryptography;
25
+using CallCenterApi.Interface.Controllers.Sms;
25
 
26
 
26
 namespace CallCenterApi.Interface.Controllers.workorder
27
 namespace CallCenterApi.Interface.Controllers.workorder
27
 {
28
 {
1992
                 msg.AddInternalMessagesInfo("工单消息", oper.F_Message + ",工单编号:" + oper.F_WorkOrderId, "jianhang", "", (int)EnumSmsType.workorder);
1993
                 msg.AddInternalMessagesInfo("工单消息", oper.F_Message + ",工单编号:" + oper.F_WorkOrderId, "jianhang", "", (int)EnumSmsType.workorder);
1993
 
1994
 
1994
                 string count = "您反映的事项已受理并转交相关部门处理,感谢您拨打市长热线!";
1995
                 string count = "您反映的事项已受理并转交相关部门处理,感谢您拨打市长热线!";
1995
-                bool n = SMSController.AddSmS(133, "", count, modelT_Bus_WorkOrder.F_CusPhone, "197387", "");
1996
+                // bool n = SMSController.AddSmS(133, "", count, modelT_Bus_WorkOrder.F_CusPhone, "197387", "");
1997
+                string phone = modelT_Bus_WorkOrder.F_CusPhone;
1998
+                if (phone.Length > 11)
1999
+                    phone = phone.Substring(1, 11);
2000
+                string n = SmsNewController.AddSmS(0, count, phone, "681240256766803968", "", modelT_Bus_WorkOrder.F_WorkOrderId);
1996
                 Task.Run(() =>
2001
                 Task.Run(() =>
1997
                 {
2002
                 {
1998
                     case_info(modelT_Bus_WorkOrder.F_WorkOrderId, "case_info");
2003
                     case_info(modelT_Bus_WorkOrder.F_WorkOrderId, "case_info");
2862
                     if (orderlist[i].F_WorkState.ToString() == "9")
2867
                     if (orderlist[i].F_WorkState.ToString() == "9")
2863
                         newRow["strWrkOrdr_Pcsg_StnCm"] = orderlist[i].F_Result.ToString();
2868
                         newRow["strWrkOrdr_Pcsg_StnCm"] = orderlist[i].F_Result.ToString();
2864
                     else
2869
                     else
2870
+                    {
2871
+                        if (orderlist[i].F_WorkState.ToString() == "6"|| orderlist[i].F_WorkState.ToString() == "7")
2872
+                        {
2873
+                            if (orderlist[i].F_IsProResult == 2 || orderlist[i].F_IsProResult == 3)
2874
+                            {
2875
+                                if (orderlist[i].F_InfoSource  != 1)
2876
+                                   {
2877
+                                    newRow["strWrkOrdr_StCd"] = "3";
2878
+                                    newRow["strHpCnt"] = 3;
2879
+                                    newRow["strWrkOrdr_Pcsg_StnCm"] = orderlist[i].F_Result.ToString();
2880
+                                }
2881
+                            }
2882
+                            else
2883
+                                newRow["strWrkOrdr_Pcsg_StnCm"] = "";
2884
+                        }
2885
+                       else 
2865
                         newRow["strWrkOrdr_Pcsg_StnCm"] = "";
2886
                         newRow["strWrkOrdr_Pcsg_StnCm"] = "";
2887
+                    }
2888
+                       
2866
 
2889
 
2867
                 }
2890
                 }
2868
                
2891
                
3000
             //string count = "您反映的事项已受理并转交相关部门处理,感谢您拨打市长热线!";
3023
             //string count = "您反映的事项已受理并转交相关部门处理,感谢您拨打市长热线!";
3001
 
3024
 
3002
             int codes = new Random().Next(1000, 9999);
3025
             int codes = new Random().Next(1000, 9999);
3003
-            string msg = codes.ToString();
3004
-            string count = "您的验证码是" + "#123456#" + ",10分钟内有效。";
3005
-            bool n = SMSController.AddSmS(0, msg, "您的验证码是" + codes + ",10分钟内有效。", mobile, "168411", "");
3026
+           // string msg = codes.ToString();
3027
+           // string count = "您的验证码是" + "#123456#" + ",10分钟内有效。";
3028
+           // bool n = SMSController.AddSmS(0, msg, "您的验证码是" + codes + ",10分钟内有效。", mobile, "168411", "");
3006
 
3029
 
3007
             //     string count1 = "您反映的事项已受理并转交相关部门处理,感谢您拨打市长热线!";
3030
             //     string count1 = "您反映的事项已受理并转交相关部门处理,感谢您拨打市长热线!";
3008
 
3031
 
3009
             //    bool n1 = SMSController.AddSmS(133, "", count1, "18937188307", "146926", "");
3032
             //    bool n1 = SMSController.AddSmS(133, "", count1, "18937188307", "146926", "");
3010
-
3011
-            if (n)
3033
+            string mag = "[\"" + codes.ToString() + "\"]";
3034
+            string v = SmsNewController.AddSmS(0, "你的验证码是" + codes + ".十分钟有效.", mobile, "681240638956277760", mag,
3035
+          "");
3036
+            if (v=="")
3012
             {
3037
             {
3013
                 var obj = new
3038
                 var obj = new
3014
                 {
3039
                 {

+ 13 - 5
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/AffairsController.cs

2
 using CallCenterApi.BLL;
2
 using CallCenterApi.BLL;
3
 using CallCenterApi.DB;
3
 using CallCenterApi.DB;
4
 using CallCenterApi.Interface.Controllers.Base;
4
 using CallCenterApi.Interface.Controllers.Base;
5
+using CallCenterApi.Interface.Controllers.Sms;
5
 using CallCenterApi.Interface.Models.Common;
6
 using CallCenterApi.Interface.Models.Common;
6
 using CallCenterApi.Model;
7
 using CallCenterApi.Model;
7
 using Newtonsoft.Json;
8
 using Newtonsoft.Json;
4730
                             if (!string.IsNullOrEmpty(iv.F_Mobile))
4731
                             if (!string.IsNullOrEmpty(iv.F_Mobile))
4731
                             {
4732
                             {
4732
                                 string count = "您的工单" + workorderid + "收到催办,请及时处理!";
4733
                                 string count = "您的工单" + workorderid + "收到催办,请及时处理!";
4733
-                                string msg = workorderid;
4734
-                                bool n = SMSController.AddSmS(0, msg, count, iv.F_Mobile, "165151", "", workorderid);
4734
+                              //  string msg = workorderid;
4735
+                              //  bool n = SMSController.AddSmS(0, msg, count, iv.F_Mobile, "165151", "", workorderid);
4736
+                                string mag = "[\"" + workorderid + "\"]";
4737
+                                string v = SmsNewController.AddSmS(0, count, iv.F_Mobile, "681240804383522816", mag,
4738
+                                workorderid);
4735
                             }
4739
                             }
4736
                         }
4740
                         }
4737
                     }
4741
                     }
4749
                             if (!string.IsNullOrEmpty(iv.F_Mobile))
4753
                             if (!string.IsNullOrEmpty(iv.F_Mobile))
4750
                             {
4754
                             {
4751
                                 string count = "您的工单" + workorderid + "收到催办,请及时处理!";
4755
                                 string count = "您的工单" + workorderid + "收到催办,请及时处理!";
4752
-                                string msg = workorderid;
4753
-                                bool n = SMSController.AddSmS(0, msg, count, iv.F_Mobile, "165151", "", workorderid);
4756
+                              //  string msg = workorderid;
4757
+                               // bool n = SMSController.AddSmS(0, msg, count, iv.F_Mobile, "165151", "", workorderid);
4758
+
4759
+                                string mag = "[\"" + workorderid + "\"]";
4760
+                                string v = SmsNewController.AddSmS(0, count, iv.F_Mobile, "681240804383522816", mag,
4761
+                                workorderid);
4754
                             }
4762
                             }
4755
                         }
4763
                         }
4756
                     }
4764
                     }
5393
                     size = responseStream.Read(bArr, 0, bArr.Length);
5401
                     size = responseStream.Read(bArr, 0, bArr.Length);
5394
                 }
5402
                 }
5395
                 stream.Close();
5403
                 stream.Close();
5396
-                responseStream.Close();
5404
+               responseStream.Close();
5397
 
5405
 
5398
                 return "1";
5406
                 return "1";
5399
             }
5407
             }

文件差异内容过多而无法显示
+ 557 - 357
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderController.cs


+ 21 - 12
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderNewController.cs

1
 using CallCenter.Utility;
1
 using CallCenter.Utility;
2
 using CallCenterApi.DB;
2
 using CallCenterApi.DB;
3
 using CallCenterApi.Interface.Controllers.Base;
3
 using CallCenterApi.Interface.Controllers.Base;
4
+using CallCenterApi.Interface.Controllers.Sms;
4
 using CallCenterApi.Interface.Models.Common;
5
 using CallCenterApi.Interface.Models.Common;
5
 using CallCenterApi.Model;
6
 using CallCenterApi.Model;
6
 using System;
7
 using System;
234
                     if (modelT_Bus_WorkOrder.F_WorkState != (int)EnumWorkState.finish)
235
                     if (modelT_Bus_WorkOrder.F_WorkState != (int)EnumWorkState.finish)
235
                     {
236
                     {
236
                         string count = "您反映的事项已受理并转交相关部门处理,感谢您拨打市长热线!";
237
                         string count = "您反映的事项已受理并转交相关部门处理,感谢您拨打市长热线!";
237
-                        string msg = "";
238
-                        bool n = SMSController.AddSmS(0, msg, count, modelT_Bus_WorkOrder.F_CusPhone, "197387", "", modelT_Bus_WorkOrder.F_WorkOrderId);
238
+                        //string msg = "";
239
+                        // bool n = SMSController.AddSmS(0, msg, count, modelT_Bus_WorkOrder.F_CusPhone, "197387", "", modelT_Bus_WorkOrder.F_WorkOrderId);
240
+                        string phone = modelT_Bus_WorkOrder.F_CusPhone;
241
+                        if (phone.Length > 11)
242
+                            phone = phone.Substring(1, 11);
243
+                        string n = SmsNewController.AddSmS(0, count, phone, "681240256766803968", "", modelT_Bus_WorkOrder.F_WorkOrderId);
239
                     }
244
                     }
240
                     oper.F_CreateUser = curuser.F_UserCode;
245
                     oper.F_CreateUser = curuser.F_UserCode;
241
                     oper.F_CreateTime = DateTime.Now;
246
                     oper.F_CreateTime = DateTime.Now;
331
                                 {
336
                                 {
332
                                     continue;
337
                                     continue;
333
                                 }
338
                                 }
334
-                                msg.AddInternalMessagesInfo("工单消息", msgss + ",工单编号:" + modelT_Bus_WorkOrder.F_WorkOrderId, u.F_UserCode, curuser.F_UserCode, (int)EnumSmsType.workorder);
335
-                                string count = "你有新工单:" + modelT_Bus_WorkOrder.F_WorkOrderId + ",请及时查收处理。";
336
-                                string mag = modelT_Bus_WorkOrder.F_WorkOrderId;
337
-                                bool n = SMSController.AddSmS(0, mag, count, u.F_Mobile, "153305", "");
339
+                                //msg.AddInternalMessagesInfo("工单消息", msgss + ",工单编号:" + modelT_Bus_WorkOrder.F_WorkOrderId, u.F_UserCode, curuser.F_UserCode, (int)EnumSmsType.workorder);
340
+                                //string count = "你有新工单:" + modelT_Bus_WorkOrder.F_WorkOrderId + ",请及时查收处理。";
341
+                                //string mag = modelT_Bus_WorkOrder.F_WorkOrderId;
342
+                                //bool n = SMSController.AddSmS(0, mag, count, u.F_Mobile, "153305", "");
343
+
344
+
345
+                             
346
+
338
                             }
347
                             }
339
                         });
348
                         });
340
                     }
349
                     }
852
                                                 {
861
                                                 {
853
                                                     continue;
862
                                                     continue;
854
                                                 }
863
                                                 }
855
-                                                string count = "你有新工单:" + modelT_Bus_WorkOrder1.F_WorkOrderId + ",请及时查收处理。";
856
-                                                string msg = modelT_Bus_WorkOrder1.F_WorkOrderId;
857
-                                                bool n = SMSController.AddSmS(0, msg, count, it.F_Mobile, "153305", "");
864
+                                                //string count = "你有新工单:" + modelT_Bus_WorkOrder1.F_WorkOrderId + ",请及时查收处理。";
865
+                                                //string msg = modelT_Bus_WorkOrder1.F_WorkOrderId;
866
+                                                //bool n = SMSController.AddSmS(0, msg, count, it.F_Mobile, "153305", "");
858
                                             }
867
                                             }
859
                                         } 
868
                                         } 
860
                                         #endregion
869
                                         #endregion
992
                                     {
1001
                                     {
993
                                         continue;
1002
                                         continue;
994
                                     }
1003
                                     }
995
-                                    string count = "你有新工单:" + modelT_Bus_WorkOrder.F_WorkOrderId + ",请及时查收处理。";
996
-                                    string msg = modelT_Bus_WorkOrder.F_WorkOrderId;
997
-                                    bool n = SMSController.AddSmS(0, msg, count, it.F_Mobile, "153305", "");
1004
+                                    //string count = "你有新工单:" + modelT_Bus_WorkOrder.F_WorkOrderId + ",请及时查收处理。";
1005
+                                    //string msg = modelT_Bus_WorkOrder.F_WorkOrderId;
1006
+                                    //bool n = SMSController.AddSmS(0, msg, count, it.F_Mobile, "153305", "");
998
                                 }
1007
                                 }
999
                             }
1008
                             }
1000
                             #endregion
1009
                             #endregion

+ 3 - 3
CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Global.asax.cs

23
             //clq 增加异常日志记录 自定义 HandleErrorAttribute
23
             //clq 增加异常日志记录 自定义 HandleErrorAttribute
24
             FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
24
             FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
25
             _worker = new QuartzWorker();
25
             _worker = new QuartzWorker();
26
-         // var satisfactionClose = new SatisfactionClose();
27
-         //  _worker.AddWork(satisfactionClose);
28
-        //   _worker.Start();
26
+          var satisfactionClose = new SatisfactionClose();
27
+           _worker.AddWork(satisfactionClose);
28
+          _worker.Start();
29
            var ZhengWuDuiJie = new ZhengWuDuiJie();
29
            var ZhengWuDuiJie = new ZhengWuDuiJie();
30
            _worker.AddWork(ZhengWuDuiJie);
30
            _worker.AddWork(ZhengWuDuiJie);
31
            _worker.Start();
31
            _worker.Start();

+ 2 - 0
CallCenterApi/CallCenterApi.Model/T_Bus_RemindRecord.cs

156
         public DateTime? SupervisorTime
156
         public DateTime? SupervisorTime
157
         { set; get; }
157
         { set; get; }
158
 
158
 
159
+        public int ? F_Mode { set; get; }
160
+
159
         #endregion Model
161
         #endregion Model
160
 
162
 
161
     }
163
     }

+ 5 - 6
CallCenterCommon/CallCenter.QuartzService/Peoplewebsite.cs

23
       
23
       
24
         public void GetLY(object sender, EventArgs e)
24
         public void GetLY(object sender, EventArgs e)
25
         {
25
         {
26
-         if (Configs .GetValue ("APP_CODE")== "314f185e71e74dd8879ab154746f7681")
27
-            {
26
+    
28
                //  WebClient web = new WebClient();
27
                //  WebClient web = new WebClient();
29
                //  web.Encoding = Encoding.UTF8;
28
                //  web.Encoding = Encoding.UTF8;
30
                  // string Dataurl = web.DownloadString("http://localhost/APPS/GetLY" + "?display=1&searchState=wait_to_answer");
29
                  // string Dataurl = web.DownloadString("http://localhost/APPS/GetLY" + "?display=1&searchState=wait_to_answer");
31
-                var Dataurl = HttpMethods.HttpPost("http://localhost/APPS/GetLY" + "?display=1&searchState=wait_to_answer");
30
+                var Dataurl = HttpMethods.HttpPost("http://localhost/APPS/GetLY" ,"display=1&searchState=wait_to_answer");
32
                 LogFactory.GetLogger("33333").Warn(Dataurl);
31
                 LogFactory.GetLogger("33333").Warn(Dataurl);
33
                 if (!string.IsNullOrEmpty(Dataurl))
32
                 if (!string.IsNullOrEmpty(Dataurl))
34
                 {
33
                 {
35
-                    var Dataur2 = HttpMethods.HttpPost("http://localhost/APPS/GetLY" + "?display=2&searchState=wait_to_first_explain");
34
+                    var Dataur2 = HttpMethods.HttpPost("http://localhost/APPS/GetLY" ,"display=2&searchState=wait_to_first_explain");
36
                   // string Dataur2 = web.DownloadString("http://localhost/APPS/GetLY" + "?display=2&searchState=wait_to_first_explain");
35
                   // string Dataur2 = web.DownloadString("http://localhost/APPS/GetLY" + "?display=2&searchState=wait_to_first_explain");
37
 
36
 
38
                     LogFactory.GetLogger("444444").Warn(Dataur2);
37
                     LogFactory.GetLogger("444444").Warn(Dataur2);
39
                     if (!string.IsNullOrEmpty(Dataur2))
38
                     if (!string.IsNullOrEmpty(Dataur2))
40
                     {
39
                     {
41
-                         var Dataur3 = HttpMethods.HttpPost("http://localhost/APPS/GetLY" + "?display=2&searchState=wait_to_second_explain");
40
+                         var Dataur3 = HttpMethods.HttpPost("http://localhost/APPS/GetLY" , "display=2&searchState=wait_to_second_explain");
42
 
41
 
43
                        // string Dataur3 = web.DownloadString("http://localhost/APPS/GetLY" + "?display=2&searchState=wait_to_second_explain");
42
                        // string Dataur3 = web.DownloadString("http://localhost/APPS/GetLY" + "?display=2&searchState=wait_to_second_explain");
44
                         LogFactory.GetLogger("55555").Warn(Dataur3);
43
                         LogFactory.GetLogger("55555").Warn(Dataur3);
45
                     }
44
                     }
46
                 }
45
                 }
47
-            }
46
+            
48
            
47
            
49
         }
48
         }
50
        
49
        

+ 163 - 10
CallCenterCommon/CallCenter.Utility/NPOI/NPOIHelper.cs

596
         {
596
         {
597
             return "";
597
             return "";
598
         }
598
         }
599
+        public class Incoming
600
+        {
601
+            public string time { set; get; }
602
+            public int IncomingCount { set; get; }//呼入量
603
+            public int Oncapacity { set; get; }//接通量
604
+            public int seatsCount { set; get; }
605
+            public string seats { set; get; }
606
+        }
607
+        /// <summary>
608
+        /// 督办数据报表导出
609
+        /// </summary>
610
+        /// <param name="ds"></param>
611
+        /// <returns></returns>
612
+        public string IncomingCalls(List <Incoming> incomings )
613
+        {
614
+            try
615
+            {
616
+                HSSFWorkbook workbook = new HSSFWorkbook();
617
+                ISheet sheet = workbook.CreateSheet("12345来电情况统计表");
618
+                ICellStyle cellStyle = workbook.CreateCellStyle();
619
+                NPOI.SS.UserModel.IFont cellfont = workbook.CreateFont();
620
+                cellfont.Boldweight = (short)FontBoldWeight.Normal;
621
+                cellStyle.SetFont(cellfont);
622
+                ICellStyle cellStylebt = workbook.CreateCellStyle();
623
+                NPOI.SS.UserModel.IFont cellfontbt = workbook.CreateFont();
624
+                cellfontbt.Boldweight = (short)FontBoldWeight.Normal;
625
+                cellStylebt.SetFont(cellfontbt);
626
+                cellfontbt.FontHeightInPoints = 10;
627
+                cellStylebt.VerticalAlignment = VerticalAlignment.Center;
628
+                cellStylebt.Alignment = HorizontalAlignment.Center;
629
+                cellStylebt.WrapText = true;
630
+                IRow irow1 = sheet.CreateRow(0);
631
+                ICell cell1 = irow1.CreateCell(0);
632
+                cell1.SetCellValue("12345来电情况统计表");
633
+                
634
+                cell1.CellStyle = cellStylebt;
635
+                irow1.Height = 50 * 20;
636
+                sheet.AddMergedRegion(new CellRangeAddress(0, 0, 0, 4));
637
+                
638
+                
639
+                string[] cols = {"时间段","来电量","接听量(呼入已接通)",
640
+                "坐席个数","坐席姓名" };
641
+                IRow irow4 = sheet.CreateRow(1);
642
+                int icolIndex = 0;
643
+                foreach (string dc in cols)
644
+                {
645
+                    ICell cell = irow4.CreateCell(icolIndex);
646
+                    cell.SetCellValue(dc);
647
+                    cell.CellStyle = cellStylebt;
648
+                    irow4.Height = 50*15;
649
+                    icolIndex++;
650
+                }
651
+                int iRowIndex = 2;
652
+              
653
+                int index = 0;
654
+                foreach (var  dr in incomings)
655
+                {
656
+                    index++;
657
+                   
658
+                    IRow irow = sheet.CreateRow(iRowIndex);
659
+                    ICell cell = irow.CreateCell(0);
660
+                    cell.SetCellValue(dr.time );
661
+                    cell.CellStyle = cellStylebt;
662
+                    ICell cel2 = irow.CreateCell(1);
663
+                    cel2.SetCellValue(dr.IncomingCount );
664
+                    cel2.CellStyle = cellStylebt;
665
+                    ICell cel3 = irow.CreateCell(2);
666
+                    cel3.SetCellValue(dr.Oncapacity );
667
+                    cel3.CellStyle = cellStylebt;
668
+                    if (dr.time=="共计")
669
+                    {
670
+                        ICell cel4 = irow.CreateCell(3);
671
+                        cel4.SetCellValue("");
672
+                        cel4.CellStyle = cellStylebt;
673
+                    }
674
+                    else
675
+                    {
676
+                        ICell cel4 = irow.CreateCell(3);
677
+                        cel4.SetCellValue(dr.seatsCount);
678
+                        cel4.CellStyle = cellStylebt;
679
+                    }
680
+                    ICell cel5 = irow.CreateCell(4);
681
+                    cel5.SetCellValue(dr.seats );
682
+                    cel5.CellStyle = cellStylebt;
683
+                    irow.Height = 50*15;
684
+                    iRowIndex++;
685
+                }
686
+
687
+                //自适应列宽度
688
+                for (int i = 0; i < 5; i++)
689
+                {
690
+                    sheet.AutoSizeColumn(i);
691
+                    // sheet.SetColumnWidth(i, 20 * 256);
692
+                }
693
+
694
+                using (MemoryStream ms = new MemoryStream())
695
+                {
696
+                    workbook.Write(ms);
697
+
698
+                    HttpContext curContext = HttpContext.Current;
699
+
700
+
701
+                    // 设置编码和附件格式
702
+                    curContext.Response.ContentType = "application/vnd.ms-excel";
703
+                    curContext.Response.ContentEncoding = Encoding.UTF8;
704
+                    curContext.Response.Charset = "";
705
+                    curContext.Response.AppendHeader("Access-Control-Expose-Headers", "Content-Disposition");
706
+                    curContext.Response.AppendHeader("Content-Disposition",
707
+                        "attachment;filename=" + HttpUtility.UrlEncode("12345来电情况统计表" + ".xls", Encoding.UTF8));
708
+
709
+                    curContext.Response.BinaryWrite(ms.GetBuffer());
710
+
711
+                    workbook = null;
712
+                    ms.Close();
713
+                    ms.Dispose();
714
+
715
+                    curContext.Response.End();
716
+                }
717
+                return "";
718
+            }
719
+            catch
720
+            {
721
+                return "导出失败!";
722
+            }
723
+        }
599
         /// <summary>
724
         /// <summary>
600
         /// 督办数据报表导出
725
         /// 督办数据报表导出
601
         /// </summary>
726
         /// </summary>
1214
                         cell.CellStyle = cellStylebt2;
1339
                         cell.CellStyle = cellStylebt2;
1215
                         if (i ==1 )
1340
                         if (i ==1 )
1216
                         {
1341
                         {
1217
-                            indexsource = 5;
1342
+                            indexsource = 6;
1218
                             for (int z = 2; z <= indexsource - 1; z++)
1343
                             for (int z = 2; z <= indexsource - 1; z++)
1219
                             {
1344
                             {
1220
                                 ICell cell4 = irow2.CreateCell(z);
1345
                                 ICell cell4 = irow2.CreateCell(z);
1224
                         }
1349
                         }
1225
                         else
1350
                         else
1226
                         {
1351
                         {
1227
-                            for (int z = indexsource + 2; z <= indexsource + 4; z++)
1352
+                            for (int z = indexsource + 2; z <= indexsource + 5; z++)
1228
                             {
1353
                             {
1229
                                 ICell cell4 = irow2.CreateCell(z);
1354
                                 ICell cell4 = irow2.CreateCell(z);
1230
                                 cell4.CellStyle = cellStylebt2;
1355
                                 cell4.CellStyle = cellStylebt2;
1231
                             }
1356
                             }
1232
-                            sheet.AddMergedRegion(new CellRangeAddress(3, 3, indexsource + 1, indexsource + 4));
1233
-                            indexsource += 5;
1357
+                            sheet.AddMergedRegion(new CellRangeAddress(3, 3, indexsource + 1, indexsource + 5));
1358
+                            indexsource += 6;
1234
                         }
1359
                         }
1235
                        
1360
                        
1236
                        
1361
                        
1277
                     }
1402
                     }
1278
                     else if (i > 0 && i <= MergerHotSource[0].MergerHot.Count - 4)
1403
                     else if (i > 0 && i <= MergerHotSource[0].MergerHot.Count - 4)
1279
                     {
1404
                     {
1280
-                        for (int j = 0; j < 4; j++)
1405
+                        for (int j = 0; j < 5; j++)
1281
                         {
1406
                         {
1282
                             indexsource += 1;
1407
                             indexsource += 1;
1283
                             ICell cell = irow3.CreateCell(indexsource);
1408
                             ICell cell = irow3.CreateCell(indexsource);
1312
                                     sheet.AutoSizeColumn(indexsource);
1437
                                     sheet.AutoSizeColumn(indexsource);
1313
                                     // sheet.SetColumnWidth(indexsource, 12 * 150);
1438
                                     // sheet.SetColumnWidth(indexsource, 12 * 150);
1314
                                     break;
1439
                                     break;
1440
+                                case 4:
1441
+                                    cell.SetCellValue("接\n通\n率");
1442
+
1443
+                                    cell.CellStyle = cellStylebt4;
1444
+                                    sheet.AutoSizeColumn(indexsource);
1445
+                                  
1446
+                                    break;
1315
 
1447
 
1316
                             }
1448
                             }
1317
 
1449
 
1504
                             {
1636
                             {
1505
                                 if (j == 1)
1637
                                 if (j == 1)
1506
                                 {
1638
                                 {
1507
-                                    for (int z = 0; z < 4; z++)
1639
+                                    for (int z = 0; z < 5; z++)
1508
                                     {
1640
                                     {
1509
                                         indexsource += 1;
1641
                                         indexsource += 1;
1510
                                         ICell cell = irow4.CreateCell(indexsource);
1642
                                         ICell cell = irow4.CreateCell(indexsource);
1530
                                                 cell.SetCellValue(MergerHotSource[i]
1662
                                                 cell.SetCellValue(MergerHotSource[i]
1531
                                                     .MergerHot[j - 1].voluntarily);
1663
                                                     .MergerHot[j - 1].voluntarily);
1532
                                                 cell.CellStyle = cellStylebt8;
1664
                                                 cell.CellStyle = cellStylebt8;
1533
-
1665
+                                                break;
1666
+                                            case 4:
1667
+                                                cell.SetCellValue(MergerHotSource[i]
1668
+                                                    .MergerHot[j - 1].rate );
1669
+                                                cell.CellStyle = cellStylebt8;
1534
 
1670
 
1535
                                                 break;
1671
                                                 break;
1536
 
1672
 
1683
                                     }
1819
                                     }
1684
                                     else
1820
                                     else
1685
                                     {
1821
                                     {
1686
-                                        for (int z = 0; z < 4; z++)
1822
+                                        for (int z = 0; z < 5; z++)
1687
                                         {
1823
                                         {
1688
                                             indexsource += 1;
1824
                                             indexsource += 1;
1689
                                             ICell cell = irow4.CreateCell(indexsource);
1825
                                             ICell cell = irow4.CreateCell(indexsource);
1716
                                                     cell.CellStyle = cellStylebt8;
1852
                                                     cell.CellStyle = cellStylebt8;
1717
 
1853
 
1718
                                                     break;
1854
                                                     break;
1855
+                                                case 4:
1856
+                                                    cell.SetCellValue(MergerHotSource[i]
1857
+                                                        .MergerHot[j - 1].rate );
1858
+                                                    cell.CellStyle = cellStylebt8;
1859
+
1860
+                                                    break;
1719
 
1861
 
1720
                                             }
1862
                                             }
1721
                                         }
1863
                                         }
1727
                             {
1869
                             {
1728
                                 if (j == 1)
1870
                                 if (j == 1)
1729
                                 {
1871
                                 {
1730
-                                    for (int z = 0; z < 4; z++)
1872
+                                    for (int z = 0; z < 5; z++)
1731
                                     {
1873
                                     {
1732
                                         indexsource += 1;
1874
                                         indexsource += 1;
1733
                                         ICell cell = irow4.CreateCell(indexsource);
1875
                                         ICell cell = irow4.CreateCell(indexsource);
1756
 
1898
 
1757
 
1899
 
1758
                                                 break;
1900
                                                 break;
1901
+                                            case 4:
1902
+                                                cell.SetCellValue(MergerHotSource[i]
1903
+                                                    .MergerHot[j - 1].rate );
1904
+                                                cell.CellStyle = cellStylebt11;
1905
+
1759
 
1906
 
1907
+                                                break;
1760
                                         }
1908
                                         }
1761
                                     }
1909
                                     }
1762
                                     indexsource += 1;
1910
                                     indexsource += 1;
1905
                                     }
2053
                                     }
1906
                                     else
2054
                                     else
1907
                                     {
2055
                                     {
1908
-                                        for (int z = 0; z < 4; z++)
2056
+                                        for (int z = 0; z < 5; z++)
1909
                                         {
2057
                                         {
1910
                                             indexsource += 1;
2058
                                             indexsource += 1;
1911
                                             ICell cell = irow4.CreateCell(indexsource);
2059
                                             ICell cell = irow4.CreateCell(indexsource);
1938
                                                     cell.CellStyle = cellStylebt11;
2086
                                                     cell.CellStyle = cellStylebt11;
1939
 
2087
 
1940
                                                     break;
2088
                                                     break;
2089
+                                                case 4:
2090
+                                                    cell.SetCellValue(MergerHotSource[i]
2091
+                                                        .MergerHot[j - 1].rate );
2092
+                                                    cell.CellStyle = cellStylebt11;
1941
 
2093
 
2094
+                                                    break;
1942
                                             }
2095
                                             }
1943
                                         }
2096
                                         }
1944
                                         indexsource += 1;
2097
                                         indexsource += 1;