Parcourir la Source

外呼分配页面 搜索框bug

yuqian il y a 8 ans
Parent
commit
2b45b7e261

+ 52 - 49
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/callout/CallOutPlanController.cs

@@ -28,7 +28,7 @@ namespace CallCenterApi.Interface.Controllers.callout
28 28
         public ActionResult GetTaskList(string key, int pagesize = 10, int pageindex = 1)
29 29
         {
30 30
             StringBuilder sb = new StringBuilder();
31
-            
31
+
32 32
             if (!string.IsNullOrWhiteSpace(key))
33 33
             {
34 34
                 sb.Append(" and (F_TaskName like '%" + key + "%' or F_TaskRemark like '%" + key + "%') ");
@@ -67,9 +67,10 @@ namespace CallCenterApi.Interface.Controllers.callout
67 67
                 return Error("当前数据不存在");
68 68
 
69 69
             var papermodel = pagerInfoBLL.GetModel(model.F_PagerID.Value);
70
-            var newmodel = new {
71
-                taskmodel=model,
72
-                pagermodel=papermodel
70
+            var newmodel = new
71
+            {
72
+                taskmodel = model,
73
+                pagermodel = papermodel
73 74
             };
74 75
             return Success("获取成功", newmodel);
75 76
         }
@@ -113,7 +114,7 @@ namespace CallCenterApi.Interface.Controllers.callout
113 114
         }
114 115
 
115 116
         //计划启动并关联客户档案、生成任务
116
-        public ActionResult EditTaskNum(int taskid = 0,int state=0)
117
+        public ActionResult EditTaskNum(int taskid = 0, int state = 0)
117 118
         {
118 119
             if (state == 1)
119 120
             {
@@ -141,16 +142,16 @@ namespace CallCenterApi.Interface.Controllers.callout
141 142
 
142 143
                     //if (cc == cuslist.Count)
143 144
                     //{
144
-                        if (otBLL.UpdateStart(taskid, 1, DateTime.Now, DateTime.MaxValue))
145
-                        {
146
-                            return Success("计划启动成功!taskid=" + taskid + ",操作人:" + CurrentUser.UserData.F_UserCode);
147
-                        }
148
-                        else
149
-                        {
150
-                            //otnBLL.DeleteByTask(taskid);
151
-                            return Error("计划启动失败!taskid=" + taskid + ",操作人:" + CurrentUser.UserData.F_UserCode);
152
-                        }
153
-                   // }
145
+                    if (otBLL.UpdateStart(taskid, 1, DateTime.Now, DateTime.MaxValue))
146
+                    {
147
+                        return Success("计划启动成功!taskid=" + taskid + ",操作人:" + CurrentUser.UserData.F_UserCode);
148
+                    }
149
+                    else
150
+                    {
151
+                        //otnBLL.DeleteByTask(taskid);
152
+                        return Error("计划启动失败!taskid=" + taskid + ",操作人:" + CurrentUser.UserData.F_UserCode);
153
+                    }
154
+                    // }
154 155
                 }
155 156
             }
156 157
             else
@@ -227,10 +228,10 @@ namespace CallCenterApi.Interface.Controllers.callout
227 228
                                     modelPhoneImport.F_YJState = 0;
228 229
                                     modelPhoneImport.F_DeleteFlag = 0;
229 230
                                     modelPhoneImport.F_HCState = 0;
230
-                                    modelPhoneImport.ExpandVchField15= System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:fff");//导入时间
231
-                                    modelPhoneImport.ExpandVchField14= CurrentUser.UserData.F_UserId.ToString();//导入坐席ID
232
-                                    modelPhoneImport.ExpandVchField13= CurrentUser.UserData.F_UserName;
233
-                                    
231
+                                    modelPhoneImport.ExpandVchField15 = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:fff");//导入时间
232
+                                    modelPhoneImport.ExpandVchField14 = CurrentUser.UserData.F_UserId.ToString();//导入坐席ID
233
+                                    modelPhoneImport.ExpandVchField13 = CurrentUser.UserData.F_UserName;
234
+
234 235
                                     modelPhoneImport.F_TaskId = taskid;
235 236
                                     modelPhoneImport.ExpandIntField6 = vfileid;//导入文件id
236 237
                                     #endregion
@@ -374,7 +375,7 @@ namespace CallCenterApi.Interface.Controllers.callout
374 375
         }
375 376
 
376 377
         //导入后获取
377
-        public ActionResult GetList(int? fileid,int? taskid)
378
+        public ActionResult GetList(int? fileid, int? taskid)
378 379
         {
379 380
             ActionResult res = Error("未知错误,请重新登录");
380 381
             if (Request.IsAuthenticated)
@@ -384,15 +385,15 @@ namespace CallCenterApi.Interface.Controllers.callout
384 385
                 string userid = CurrentUser.UserData.F_UserId.ToString();
385 386
                 if (userid.Trim() != "")
386 387
                 {
387
-                    sql += " and cast(ExpandVchField14 as varchar(max))='" + userid.Trim()+"' ";
388
+                    sql += " and cast(ExpandVchField14 as varchar(max))='" + userid.Trim() + "' ";
388 389
                 }
389 390
                 if (fileid != null)
390 391
                 {
391
-                    sql += " and ExpandIntField6='" + fileid+"' ";
392
+                    sql += " and ExpandIntField6='" + fileid + "' ";
392 393
                 }
393 394
                 if (taskid != null)
394 395
                 {
395
-                    sql += " and F_TaskId="+ taskid;
396
+                    sql += " and F_TaskId=" + taskid;
396 397
                 }
397 398
                 //sql += " and F_InputDate=(select MAX(F_InputDate)from T_Vis_Telphone)";
398 399
                 string strpageindex = RequestString.GetQueryString("page");
@@ -447,7 +448,7 @@ namespace CallCenterApi.Interface.Controllers.callout
447 448
                     return Success("删除成功");
448 449
                 }
449 450
                 else
450
-                   return Error("删除失败");
451
+                    return Error("删除失败");
451 452
             }
452 453
             else
453 454
             {
@@ -553,7 +554,7 @@ namespace CallCenterApi.Interface.Controllers.callout
553 554
             int userid = CurrentUser.UserData.F_UserId;
554 555
             string username = CurrentUser.UserData.F_UserName;
555 556
             #region 按数量平均分配
556
-            DataTable dt = DbHelperSQL.Query("select *,NEWID() from T_Call_OutTaskTelNum where 1=1 "+ sb.ToString()+ "  order by NEWID()").Tables[0];
557
+            DataTable dt = DbHelperSQL.Query("select *,NEWID() from T_Call_OutTaskTelNum where 1=1 " + sb.ToString() + "  order by NEWID()").Tables[0];
557 558
             //otnBLL.GetList(" F_FPState=0 ").Tables[0];
558 559
             List<Model.T_Sys_UserAccount> userlist = new BLL.T_Sys_UserAccount().GetModelList(" F_SeatFlag=1 ");
559 560
             if (dt != null)
@@ -609,7 +610,7 @@ namespace CallCenterApi.Interface.Controllers.callout
609 610
             sb.Append(" and F_FPState=0 and F_DeleteFlag=0 ");
610 611
             if (!string.IsNullOrWhiteSpace(key))
611 612
             {
612
-                sb.Append(" and F_Taskid in (select F_TaskID from T_Call_OutTask where F_TaskName like '%" + key + "%' or F_TaskRemark like '%" + key + "%' and F_IsStart=1 and F_DeleteFlag=0 ) ");
613
+                sb.Append(" and F_Taskid in (select F_TaskID from T_Call_OutTask where F_Phone='" + key + "' or  F_TaskName like '%" + key + "%' or F_TaskRemark like '%" + key + "%' and F_IsStart=1 and F_DeleteFlag=0 ) ");
613 614
             }
614 615
 
615 616
             var recordCount = 0;
@@ -688,9 +689,10 @@ namespace CallCenterApi.Interface.Controllers.callout
688 689
             if (model == null)
689 690
                 return Error("当前数据不存在");
690 691
 
691
-            var obj = new {
692
+            var obj = new
693
+            {
692 694
                 taskModel = model,
693
-                paperid= paperid
695
+                paperid = paperid
694 696
             };
695 697
             return Success("获取成功", obj);
696 698
         }
@@ -699,22 +701,22 @@ namespace CallCenterApi.Interface.Controllers.callout
699 701
         {
700 702
             StringBuilder sb = new StringBuilder();
701 703
             int userid = CurrentUser.UserData.F_UserId;
702
-            sb.Append(" and F_UserId="+ userid);
704
+            sb.Append(" and F_UserId=" + userid);
703 705
             sb.Append(" and F_DeleteFlag=0 ");
704 706
             //sb.Append(" and isnull(F_HJJGName,'')!='正常接通' and isnull(F_YHFKName,'')!='已同意'");
705 707
             sb.Append(" and isnull(F_HJJGName,'')=''");
706 708
             sb.Append(" and F_Taskid in (select F_TaskID from T_Call_OutTask where F_IsStart=1 and F_DeleteFlag=0)");
707 709
             if (!string.IsNullOrWhiteSpace(key))
708 710
             {
709
-                sb.Append(" and F_Phone like '%"+key.Trim()+"%'");
711
+                sb.Append(" and F_Phone like '%" + key.Trim() + "%'");
710 712
             }
711
-                //string sqlwhere = "";
712
-                //if (!string.IsNullOrWhiteSpace(key))
713
-                //{
714
-                //    sqlwhere = " and F_TaskName like '%" + key + "%' or F_TaskRemark like '%" + key + "%' ";
715
-                //}
716
-                //sb.Append(" and F_TaskID in (select F_TaskID from T_Call_OutTask where F_IsStart=1 and F_DeleteFlag=0 " + sqlwhere + ") ");
717
-                var recordCount = 0;
713
+            //string sqlwhere = "";
714
+            //if (!string.IsNullOrWhiteSpace(key))
715
+            //{
716
+            //    sqlwhere = " and F_TaskName like '%" + key + "%' or F_TaskRemark like '%" + key + "%' ";
717
+            //}
718
+            //sb.Append(" and F_TaskID in (select F_TaskID from T_Call_OutTask where F_IsStart=1 and F_DeleteFlag=0 " + sqlwhere + ") ");
719
+            var recordCount = 0;
718 720
             var dt = BLL.PagerBLL.GetListPager(
719 721
                     "T_Call_OutTaskTelNum",
720 722
                     "F_Id",
@@ -734,7 +736,7 @@ namespace CallCenterApi.Interface.Controllers.callout
734 736
             return Content(obj.ToJson());
735 737
         }
736 738
         //获取我的任务结果
737
-        public ActionResult GetMyResultList(string key,int hjjgid=0,int yhfkid=0, int pagesize = 10, int pageindex = 1)
739
+        public ActionResult GetMyResultList(string key, int hjjgid = 0, int yhfkid = 0, int pagesize = 10, int pageindex = 1)
738 740
         {
739 741
             StringBuilder sb = new StringBuilder();
740 742
             int userid = CurrentUser.UserData.F_UserId;
@@ -746,7 +748,7 @@ namespace CallCenterApi.Interface.Controllers.callout
746 748
             }
747 749
             if (yhfkid != 0)
748 750
             {
749
-                sb.Append(" and F_YHFKId="+ yhfkid);
751
+                sb.Append(" and F_YHFKId=" + yhfkid);
750 752
             }
751 753
             if (!string.IsNullOrWhiteSpace(key))
752 754
             {
@@ -778,7 +780,7 @@ namespace CallCenterApi.Interface.Controllers.callout
778 780
             return Content(obj.ToJson());
779 781
         }
780 782
         //获取总体任务结果
781
-        public ActionResult GetResultList(string key,int userid=0, int hjjgid = 0, int yhfkid = 0, int pagesize = 10, int pageindex = 1)
783
+        public ActionResult GetResultList(string key, int userid = 0, int hjjgid = 0, int yhfkid = 0, int pagesize = 10, int pageindex = 1)
782 784
         {
783 785
             StringBuilder sb = new StringBuilder();
784 786
             sb.Append(" and F_DeleteFlag=0 ");
@@ -830,7 +832,7 @@ namespace CallCenterApi.Interface.Controllers.callout
830 832
             if (id <= 0)
831 833
                 return Error("参数不正确");
832 834
             var model = otnBLL.GetModel(id);
833
-            
835
+
834 836
             var paperid = 0;
835 837
             if (model != null)
836 838
             {
@@ -847,7 +849,8 @@ namespace CallCenterApi.Interface.Controllers.callout
847 849
                     {
848 850
                         F_Title = pmodel.F_Title,
849 851
                         F_Remark = pmodel.F_Remark,
850
-                        F_Questions = qlist.Select(q => {
852
+                        F_Questions = qlist.Select(q =>
853
+                        {
851 854
                             var answers = "";
852 855
                             var qalist = anslist.Where(al => al.F_QID.Value == q.F_QuestionId).ToList<Model.T_Call_OutAnswers>();
853 856
                             if (qalist.Count > 0)
@@ -908,13 +911,13 @@ namespace CallCenterApi.Interface.Controllers.callout
908 911
         /// <param name="hjjgid">呼叫结果</param>
909 912
         /// <param name="yhfkid">用户反馈</param>
910 913
         /// <returns></returns>
911
-        public ActionResult Answers(int taskid,int custelid,string[] ans,int hjjgid,int yhfkid, int cusid = 0)
914
+        public ActionResult Answers(int taskid, int custelid, string[] ans, int hjjgid, int yhfkid, int cusid = 0)
912 915
         {
913
-            
914
-                int cc = 0;
915
-                var ansModel = new Model.T_Call_OutAnswers();
916
-                string askqids = "";
917
-                string ansids = "";
916
+
917
+            int cc = 0;
918
+            var ansModel = new Model.T_Call_OutAnswers();
919
+            string askqids = "";
920
+            string ansids = "";
918 921
             if (ans != null)
919 922
             {
920 923
                 //先删除 后添加
@@ -958,7 +961,7 @@ namespace CallCenterApi.Interface.Controllers.callout
958 961
                     }
959 962
                 }
960 963
 
961
-                
964
+
962 965
             }
963 966
             if (custelid > 0)
964 967
             {