duhongyu лет назад: 4
Родитель
Сommit
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,9 +37,9 @@ namespace CallCenterApi.DAL
37 37
         {
38 38
             StringBuilder strSql = new StringBuilder();
39 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 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 43
             strSql.Append(";select @@IDENTITY");
44 44
             SqlParameter[] parameters = {
45 45
                     new SqlParameter("@F_WorkOrderId", SqlDbType.NVarChar,50),
@@ -56,8 +56,10 @@ namespace CallCenterApi.DAL
56 56
                     new SqlParameter("@F_DeleteTime", SqlDbType.DateTime),
57 57
                     new SqlParameter("@F_File", SqlDbType.VarChar,500),
58 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 64
             parameters[0].Value = model.F_WorkOrderId;
63 65
             parameters[1].Value = model.F_AssignedId;
@@ -74,6 +76,8 @@ namespace CallCenterApi.DAL
74 76
             parameters[12].Value = model.F_File;
75 77
             parameters[13].Value = model.Supervisor;
76 78
             parameters[14].Value = model.F_IsExamine;
79
+            parameters[15].Value = model.F_Mode;
80
+            
77 81
             object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
78 82
             if (obj == null)
79 83
             {
@@ -106,6 +110,7 @@ namespace CallCenterApi.DAL
106 110
             strSql.Append("Supervisor=@Supervisor,");
107 111
             strSql.Append("F_IsExamine=@F_IsExamine,");
108 112
             strSql.Append("SupervisorTime=@SupervisorTime,");
113
+            strSql.Append("F_Mode=@F_Mode,");
109 114
             strSql.Append("F_File=@F_File");
110 115
             strSql.Append(" where F_Id=@F_Id");
111 116
             SqlParameter[] parameters = {
@@ -124,6 +129,8 @@ namespace CallCenterApi.DAL
124 129
                      new SqlParameter("@Supervisor", SqlDbType.VarChar,50),
125 130
                       new SqlParameter("@F_IsExamine", SqlDbType.Int,4),
126 131
                       new SqlParameter("@SupervisorTime", SqlDbType.DateTime),
132
+                     new SqlParameter("@F_Mode", SqlDbType.Int,4),
133
+                      
127 134
                     new SqlParameter("@F_File", SqlDbType.VarChar,500),
128 135
                     new SqlParameter("@F_Id", SqlDbType.Int,4)};
129 136
             parameters[0].Value = model.F_WorkOrderId;
@@ -141,8 +148,9 @@ namespace CallCenterApi.DAL
141 148
             parameters[12].Value = model.Supervisor;
142 149
             parameters[13].Value = model.F_IsExamine;
143 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 155
             int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
148 156
             if (rows > 0)
@@ -230,7 +238,7 @@ namespace CallCenterApi.DAL
230 238
         {
231 239
 
232 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 242
             strSql.Append(" where F_Id=@F_Id");
235 243
             SqlParameter[] parameters = {
236 244
                     new SqlParameter("@F_Id", SqlDbType.Int,4)
@@ -326,6 +334,10 @@ namespace CallCenterApi.DAL
326 334
                 {
327 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 343
             return model;
@@ -337,7 +349,7 @@ namespace CallCenterApi.DAL
337 349
         public DataSet GetList(string strWhere)
338 350
         {
339 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 353
             strSql.Append(" FROM T_Bus_RemindRecord WITH(NOLOCK) ");
342 354
             if (strWhere.Trim() != "")
343 355
             {
@@ -357,7 +369,7 @@ namespace CallCenterApi.DAL
357 369
             {
358 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 373
             strSql.Append(" FROM T_Bus_RemindRecord WITH(NOLOCK) ");
362 374
             if (strWhere.Trim() != "")
363 375
             {

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

@@ -3,6 +3,7 @@ using CallCenterApi.Common;
3 3
 using CallCenterApi.DB;
4 4
 using CallCenterApi.Interface.App_Start;
5 5
 using CallCenterApi.Interface.Controllers.Base;
6
+using CallCenterApi.Interface.Controllers.Sms;
6 7
 using CallCenterApi.Interface.Controllers.workorder;
7 8
 using CallCenterApi.Interface.Models.Common;
8 9
 using CallCenterApi.Model;
@@ -461,8 +462,12 @@ namespace CallCenterApi.Interface.Controllers
461 462
                         oper.F_IsDelete = 0;
462 463
                         operBLL.Add(oper);
463 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 471
                         #endregion
467 472
                     }).ContinueWith(p => {
468 473
                         System.Diagnostics.Debug.WriteLine(DateTime.Now);
@@ -1129,7 +1134,7 @@ namespace CallCenterApi.Interface.Controllers
1129 1134
                             var obj = new
1130 1135
                             {
1131 1136
                                 data = dt,
1132
-                                pysql= pysql
1137
+                                 pydt
1133 1138
                             };
1134 1139
                             return Success("获取成功", obj);
1135 1140
                         }

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

@@ -268,6 +268,7 @@ namespace CallCenterApi.Interface.Controllers
268 268
             string strendtime = HttpUtility.UrlDecode(RequestString.GetQueryString("endtime"));
269 269
             int  type = RequestString.GetInt("type", 0);
270 270
             int State = RequestString.GetInt ("state", 0);
271
+            int acceptance = RequestString.GetInt("acceptance", 0);
271 272
             string strpageindex = RequestString.GetQueryString("page");
272 273
             int pageindex = 1;
273 274
             string strpagesize = RequestString.GetQueryString("pagesize");
@@ -294,8 +295,10 @@ namespace CallCenterApi.Interface.Controllers
294 295
                 else
295 296
                 {
296 297
                     sql += " and F_CustomerID is null ";
298
+
297 299
                 }
298 300
             }
301
+
299 302
             if (strpageindex.Trim() != "")
300 303
             {
301 304
                 pageindex = Convert.ToInt32(strpageindex);
@@ -305,6 +308,17 @@ namespace CallCenterApi.Interface.Controllers
305 308
             {
306 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 322
             int recordCount = 0;
309 323
             dt = BLL.PagerBLL.GetListPager(
310 324
                 "T_SMS_RecvSMS",
@@ -325,6 +339,7 @@ namespace CallCenterApi.Interface.Controllers
325 339
                     x.Content,
326 340
                     x.SMSID ,
327 341
                     x.F_Name,
342
+                    type=x.F_CustomerID,
328 343
                     usercode ="",
329 344
                     x.RecvTime
330 345
                 }),

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

@@ -2,6 +2,7 @@
2 2
 using CallCenterApi.Common;
3 3
 using CallCenterApi.DB;
4 4
 using CallCenterApi.Interface.Controllers.Base;
5
+using CallCenterApi.Interface.Controllers.Sms;
5 6
 using CallCenterApi.Interface.Models.Input;
6 7
 using System;
7 8
 using System.Collections.Generic;
@@ -521,9 +522,13 @@ namespace CallCenterApi.Interface.Controllers
521 522
                 return Error("请输入将要发送的号码");
522 523
             }
523 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 533
                     return Success("发送成功");
529 534
             }

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

@@ -83,7 +83,7 @@ namespace CallCenterApi.Interface.Controllers.Wiki
83 83
             }
84 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,7 +83,7 @@ namespace CallCenterApi.Interface.Controllers.Wiki
83 83
             }
84 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,7 +101,7 @@ namespace CallCenterApi.Interface.Controllers.report
101 101
                 beginTime = DateTime.Parse(DateTime.Now.AddDays(-days).ToShortDateString());
102 102
 
103 103
             if (etime != null && etime != "")
104
-                endTime = DateTime.Parse(etime + " 23:59:59");
104
+                endTime = DateTime.Parse(etime );
105 105
             else
106 106
                 endTime = DateTime.Parse(DateTime.Now.ToShortDateString() + " 23:59:59");
107 107
 

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

@@ -14,6 +14,7 @@ using System.Linq;
14 14
 using System.Text;
15 15
 using System.Web;
16 16
 using System.Web.Mvc;
17
+using static CallCenter.Utility.NPOIHelper;
17 18
 
18 19
 namespace CallCenterApi.Interface.Controllers.report
19 20
 {
@@ -385,7 +386,7 @@ namespace CallCenterApi.Interface.Controllers.report
385 386
             var obj = DbHelperSQL.RunProcedure("P_UserAssessmentReport_1", paras, "UserAssessmentReport");
386 387
             if (isExport)
387 388
             {
388
-                string[] cols = new string[] { "姓名", "接听量", "通话成单量", "手动录单量", "当即办理量", "网络转办量", "回访量","呼出量" };
389
+                string[] cols = new string[] { "姓名", "接听量", "通话成单量", "手动录单量", "当即办理量", "网络转办量", "回访量","呼出量" ,"回拨量"};
389 390
                 NPOIHelper npoi = new NPOIHelper();
390 391
                 if (npoi.ExportToExcel("坐席工作统计报表", obj.Tables[0], cols) == "")
391 392
                 {
@@ -431,8 +432,8 @@ namespace CallCenterApi.Interface.Controllers.report
431 432
             }
432 433
             return Success("成功", obj);
433 434
         }
434
-
435
-        public ActionResult WorkOrdrList()
435
+     
436
+        public ActionResult WorkOrdrList(int isdc=0)
436 437
         {
437 438
             DataTable dt = new DataTable();
438 439
             string sql = " and F_IsDelete=0 ";
@@ -458,6 +459,7 @@ namespace CallCenterApi.Interface.Controllers.report
458 459
             string strendtime = HttpUtility.UrlDecode(RequestString.GetQueryString("endtime"));
459 460
             int isRelease = RequestString.GetInt("isRelease", 0);
460 461
             int name= RequestString.GetInt("name", 0);
462
+            int handling = RequestString.GetInt("handling", 0);
461 463
             int pageindex = 1;
462 464
             int pagesize = 10;
463 465
             if (strpageindex.Trim() != "")
@@ -644,6 +646,23 @@ namespace CallCenterApi.Interface.Controllers.report
644 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 666
             string cols = "";
648 667
             string order = "ORDER BY a.F_CreateTime DESC";
649 668
             if (name >0)
@@ -659,30 +678,179 @@ namespace CallCenterApi.Interface.Controllers.report
659 678
             {
660 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 854
         /// <summary>
687 855
         /// 逾期未回复统计
688 856
         /// </summary>
@@ -1727,20 +1895,20 @@ namespace CallCenterApi.Interface.Controllers.report
1727 1895
                         if (source[i].F_Value=="12345")
1728 1896
                         {
1729 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 1900
                         else
1740 1901
                         {
1741 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 1912
                         mergerHotSources.MergerHot.Add(mergerHot);
1745 1913
 
1746 1914
                     }

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

@@ -29,7 +29,7 @@ namespace CallCenterApi.Interface.Controllers.report
29 29
                         ,"平均接听通话秒数","平均振铃秒数","呼入占有率","用户评价","坐席登录次数"
30 30
                         ,"登录时长分钟数","工作时长分钟数","平均每天工作时长(小时)"
31 31
                         ,"置忙次数","休息时长分钟数","平均每天休息时长(小时)"
32
-                        ,"置忙平均休息分钟数","回拨量"//,"质检平均成绩"
32
+                        ,"置忙平均休息分钟数"//,"质检平均成绩"
33 33
                 };
34 34
             return Success("获取坐席工作统计表头成功", str);
35 35
         }
@@ -87,7 +87,7 @@ namespace CallCenterApi.Interface.Controllers.report
87 87
             DataColumn dc23 = new DataColumn("休息时长分钟数");
88 88
             DataColumn dc24 = new DataColumn("平均每天休息时长");
89 89
             DataColumn dc25 = new DataColumn("置忙平均休息分钟数");
90
-            DataColumn dc26 = new DataColumn("回拨量");
90
+           
91 91
             //DataColumn dc26 = new DataColumn("质检平均成绩");
92 92
 
93 93
             dtNew.Columns.Add(dc1);
@@ -115,7 +115,7 @@ namespace CallCenterApi.Interface.Controllers.report
115 115
             dtNew.Columns.Add(dc23);
116 116
             dtNew.Columns.Add(dc24);
117 117
             dtNew.Columns.Add(dc25);
118
-            dtNew.Columns.Add(dc26);
118
+           
119 119
             #endregion
120 120
             int days = 30;
121 121
             string sqltimeCallRecords = "";
@@ -164,7 +164,7 @@ namespace CallCenterApi.Interface.Controllers.report
164 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 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 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,11 +242,7 @@ namespace CallCenterApi.Interface.Controllers.report
242 242
                         drNew["接通率"] = (itrunkjtl * 100).ToString("0.00") + "%";
243 243
                         drNew["呼损率"] = (itrunkhsl * 100).ToString("0.00") + "%";
244 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 247
                             #endregion
252 248
                             #region 坐席接听数据

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

@@ -31,6 +31,8 @@ namespace CallCenterApi.Interface.Controllers.tel
31 31
             string PhoneType = HttpUtility.UrlDecode(RequestString.GetQueryString("phoneType"));
32 32
             string group = HttpUtility.UrlDecode(RequestString.GetQueryString("group"));
33 33
             int callback = RequestString.GetInt("callback", 0);
34
+            int waitTime = RequestString.GetInt("waitTime", -1);
35
+            
34 36
             int type = RequestString.GetInt("type", 0);
35 37
             int islike = RequestString.GetInt("islike", 1);
36 38
             int notconnected = RequestString.GetInt("notconnected", 0);
@@ -76,18 +78,18 @@ namespace CallCenterApi.Interface.Controllers.tel
76 78
             {
77 79
                 if (phone != null && phone.Trim() != "")
78 80
                 {
79
-                    sql += " and CallNumber = '" + phone + "'";
81
+                    sql += " and CallNumber = '" + phone + "' ";
80 82
                 }
81 83
             }
82 84
             if (callback>0)
83 85
             {
84 86
                 if (callback==1)
85 87
                 {
86
-                    sql += " and CallbackCallid is not null ";
88
+                    sql += " and Callback is not null ";
87 89
                 }
88 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 95
             if (!string .IsNullOrEmpty (CallbackCallid))
@@ -98,6 +100,10 @@ namespace CallCenterApi.Interface.Controllers.tel
98 100
             {
99 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 107
             if (callstate.Trim() != "")
102 108
             {
103 109
                 if (callstate.Trim() == "0")
@@ -184,20 +190,41 @@ namespace CallCenterApi.Interface.Controllers.tel
184 190
             }
185 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 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 229
             else
203 230
             {
@@ -253,14 +280,14 @@ namespace CallCenterApi.Interface.Controllers.tel
253 280
                             && dr["BeginTime"].ToString() != "")
254 281
                         {
255 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 284
                             double tss = double.Parse(Math.Round(ts.TotalSeconds, 0).ToString());
258 285
                             dr["WaitTime"] = DateTimeConvert.parseTimeSeconds(tss, 1);
259 286
                         }
260 287
                         else if (dr["EndTime"] != null && dr["EndTime"].ToString() != "" && dr["BeginTime"] != null && dr["BeginTime"].ToString() != "")
261 288
                         {
262 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 291
                             double tss = double.Parse(Math.Round(ts.TotalSeconds, 0).ToString());
265 292
                             dr["WaitTime"] = DateTimeConvert.parseTimeSeconds(tss, 1);
266 293
                         }

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

@@ -22,6 +22,7 @@ using System.Text;
22 22
 using System.Net;
23 23
 using System.Threading.Tasks;
24 24
 using System.Security.Cryptography;
25
+using CallCenterApi.Interface.Controllers.Sms;
25 26
 
26 27
 namespace CallCenterApi.Interface.Controllers.workorder
27 28
 {
@@ -1992,7 +1993,11 @@ namespace CallCenterApi.Interface.Controllers.workorder
1992 1993
                 msg.AddInternalMessagesInfo("工单消息", oper.F_Message + ",工单编号:" + oper.F_WorkOrderId, "jianhang", "", (int)EnumSmsType.workorder);
1993 1994
 
1994 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 2001
                 Task.Run(() =>
1997 2002
                 {
1998 2003
                     case_info(modelT_Bus_WorkOrder.F_WorkOrderId, "case_info");
@@ -2862,7 +2867,25 @@ namespace CallCenterApi.Interface.Controllers.workorder
2862 2867
                     if (orderlist[i].F_WorkState.ToString() == "9")
2863 2868
                         newRow["strWrkOrdr_Pcsg_StnCm"] = orderlist[i].F_Result.ToString();
2864 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 2886
                         newRow["strWrkOrdr_Pcsg_StnCm"] = "";
2887
+                    }
2888
+                       
2866 2889
 
2867 2890
                 }
2868 2891
                
@@ -3000,15 +3023,17 @@ namespace CallCenterApi.Interface.Controllers.workorder
3000 3023
             //string count = "您反映的事项已受理并转交相关部门处理,感谢您拨打市长热线!";
3001 3024
 
3002 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 3030
             //     string count1 = "您反映的事项已受理并转交相关部门处理,感谢您拨打市长热线!";
3008 3031
 
3009 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 3038
                 var obj = new
3014 3039
                 {

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

@@ -2,6 +2,7 @@
2 2
 using CallCenterApi.BLL;
3 3
 using CallCenterApi.DB;
4 4
 using CallCenterApi.Interface.Controllers.Base;
5
+using CallCenterApi.Interface.Controllers.Sms;
5 6
 using CallCenterApi.Interface.Models.Common;
6 7
 using CallCenterApi.Model;
7 8
 using Newtonsoft.Json;
@@ -4730,8 +4731,11 @@ namespace CallCenterApi.Interface.Controllers.workorder
4730 4731
                             if (!string.IsNullOrEmpty(iv.F_Mobile))
4731 4732
                             {
4732 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,8 +4753,12 @@ namespace CallCenterApi.Interface.Controllers.workorder
4749 4753
                             if (!string.IsNullOrEmpty(iv.F_Mobile))
4750 4754
                             {
4751 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,7 +5401,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
5393 5401
                     size = responseStream.Read(bArr, 0, bArr.Length);
5394 5402
                 }
5395 5403
                 stream.Close();
5396
-                responseStream.Close();
5404
+               responseStream.Close();
5397 5405
 
5398 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,6 +1,7 @@
1 1
 using CallCenter.Utility;
2 2
 using CallCenterApi.DB;
3 3
 using CallCenterApi.Interface.Controllers.Base;
4
+using CallCenterApi.Interface.Controllers.Sms;
4 5
 using CallCenterApi.Interface.Models.Common;
5 6
 using CallCenterApi.Model;
6 7
 using System;
@@ -234,8 +235,12 @@ namespace CallCenterApi.Interface.Controllers.workorder
234 235
                     if (modelT_Bus_WorkOrder.F_WorkState != (int)EnumWorkState.finish)
235 236
                     {
236 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 245
                     oper.F_CreateUser = curuser.F_UserCode;
241 246
                     oper.F_CreateTime = DateTime.Now;
@@ -331,10 +336,14 @@ namespace CallCenterApi.Interface.Controllers.workorder
331 336
                                 {
332 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,9 +861,9 @@ namespace CallCenterApi.Interface.Controllers.workorder
852 861
                                                 {
853 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 869
                                         #endregion
@@ -992,9 +1001,9 @@ namespace CallCenterApi.Interface.Controllers.workorder
992 1001
                                     {
993 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 1009
                             #endregion

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

@@ -23,9 +23,9 @@ namespace CallCenterApi.Interface
23 23
             //clq 增加异常日志记录 自定义 HandleErrorAttribute
24 24
             FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
25 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 29
            var ZhengWuDuiJie = new ZhengWuDuiJie();
30 30
            _worker.AddWork(ZhengWuDuiJie);
31 31
            _worker.Start();

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

@@ -156,6 +156,8 @@ namespace CallCenterApi.Model
156 156
         public DateTime? SupervisorTime
157 157
         { set; get; }
158 158
 
159
+        public int ? F_Mode { set; get; }
160
+
159 161
         #endregion Model
160 162
 
161 163
     }

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

@@ -23,28 +23,27 @@ namespace CallCenter.QuartzService
23 23
       
24 24
         public void GetLY(object sender, EventArgs e)
25 25
         {
26
-         if (Configs .GetValue ("APP_CODE")== "314f185e71e74dd8879ab154746f7681")
27
-            {
26
+    
28 27
                //  WebClient web = new WebClient();
29 28
                //  web.Encoding = Encoding.UTF8;
30 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 31
                 LogFactory.GetLogger("33333").Warn(Dataurl);
33 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 35
                   // string Dataur2 = web.DownloadString("http://localhost/APPS/GetLY" + "?display=2&searchState=wait_to_first_explain");
37 36
 
38 37
                     LogFactory.GetLogger("444444").Warn(Dataur2);
39 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 42
                        // string Dataur3 = web.DownloadString("http://localhost/APPS/GetLY" + "?display=2&searchState=wait_to_second_explain");
44 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,6 +596,131 @@ namespace CallCenter.Utility
596 596
         {
597 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 724
         /// <summary>
600 725
         /// 督办数据报表导出
601 726
         /// </summary>
@@ -1214,7 +1339,7 @@ namespace CallCenter.Utility
1214 1339
                         cell.CellStyle = cellStylebt2;
1215 1340
                         if (i ==1 )
1216 1341
                         {
1217
-                            indexsource = 5;
1342
+                            indexsource = 6;
1218 1343
                             for (int z = 2; z <= indexsource - 1; z++)
1219 1344
                             {
1220 1345
                                 ICell cell4 = irow2.CreateCell(z);
@@ -1224,13 +1349,13 @@ namespace CallCenter.Utility
1224 1349
                         }
1225 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 1354
                                 ICell cell4 = irow2.CreateCell(z);
1230 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,7 +1402,7 @@ namespace CallCenter.Utility
1277 1402
                     }
1278 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 1407
                             indexsource += 1;
1283 1408
                             ICell cell = irow3.CreateCell(indexsource);
@@ -1312,6 +1437,13 @@ namespace CallCenter.Utility
1312 1437
                                     sheet.AutoSizeColumn(indexsource);
1313 1438
                                     // sheet.SetColumnWidth(indexsource, 12 * 150);
1314 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,7 +1636,7 @@ namespace CallCenter.Utility
1504 1636
                             {
1505 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 1641
                                         indexsource += 1;
1510 1642
                                         ICell cell = irow4.CreateCell(indexsource);
@@ -1530,7 +1662,11 @@ namespace CallCenter.Utility
1530 1662
                                                 cell.SetCellValue(MergerHotSource[i]
1531 1663
                                                     .MergerHot[j - 1].voluntarily);
1532 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 1671
                                                 break;
1536 1672
 
@@ -1683,7 +1819,7 @@ namespace CallCenter.Utility
1683 1819
                                     }
1684 1820
                                     else
1685 1821
                                     {
1686
-                                        for (int z = 0; z < 4; z++)
1822
+                                        for (int z = 0; z < 5; z++)
1687 1823
                                         {
1688 1824
                                             indexsource += 1;
1689 1825
                                             ICell cell = irow4.CreateCell(indexsource);
@@ -1716,6 +1852,12 @@ namespace CallCenter.Utility
1716 1852
                                                     cell.CellStyle = cellStylebt8;
1717 1853
 
1718 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,7 +1869,7 @@ namespace CallCenter.Utility
1727 1869
                             {
1728 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 1874
                                         indexsource += 1;
1733 1875
                                         ICell cell = irow4.CreateCell(indexsource);
@@ -1756,7 +1898,13 @@ namespace CallCenter.Utility
1756 1898
 
1757 1899
 
1758 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 1910
                                     indexsource += 1;
@@ -1905,7 +2053,7 @@ namespace CallCenter.Utility
1905 2053
                                     }
1906 2054
                                     else
1907 2055
                                     {
1908
-                                        for (int z = 0; z < 4; z++)
2056
+                                        for (int z = 0; z < 5; z++)
1909 2057
                                         {
1910 2058
                                             indexsource += 1;
1911 2059
                                             ICell cell = irow4.CreateCell(indexsource);
@@ -1938,7 +2086,12 @@ namespace CallCenter.Utility
1938 2086
                                                     cell.CellStyle = cellStylebt11;
1939 2087
 
1940 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 2097
                                         indexsource += 1;