duhongyu %!s(int64=6) %!d(string=hace) años
padre
commit
8d2094b321

+ 5 - 2
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/ConversationController.cs

@@ -56,7 +56,7 @@ namespace CallCenterApi.Interface.Controllers
56 56
                 }
57 57
                 if (strtel.Trim() != "" && strtel != "undefined")
58 58
                 {
59
-                    sql += " and F_Telephone=" + strtel;
59
+                    sql += " and F_Telephone like'%" + strtel+"%'";
60 60
                 }
61 61
                 if (department > 0)
62 62
                 {
@@ -180,7 +180,7 @@ namespace CallCenterApi.Interface.Controllers
180 180
             if (string.IsNullOrEmpty(input.F_Telephone))
181 181
                 return Error("电话不能为空!");
182 182
             if (getunphone(0, input.F_Telephone))
183
-                return Error("已存在该客户请勿重复添加");
183
+                return Error("电话重复请勿重复添加");
184 184
             if (input.F_Type<=0)
185 185
                 return Error("请选择电话类别");
186 186
             #endregion
@@ -218,10 +218,13 @@ namespace CallCenterApi.Interface.Controllers
218 218
                 return Error("参数错误!");
219 219
             if (string.IsNullOrEmpty(input.F_Telephone))
220 220
                 return Error("电话不能为空!");
221
+           
221 222
             if (input.F_Type <= 0)
222 223
                 return Error("请选择电话类别");
223 224
             #endregion
224 225
             var model = bll.GetModel(input.ID);
226
+            if (getunphone(0, input.F_Telephone) && input.F_Telephone != model.F_Telephone)
227
+                return Error("电话重复请勿重复添加");
225 228
             model.F_Type = input.F_Type;    //1内线2外线
226 229
             model.F_Department = model_Dep != null ? model_Dep.F_ParentId : input.F_Department;    //部门id
227 230
             model.F_Section = input.F_Section;    // 科室id

+ 15 - 95
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/IndexController.cs

@@ -460,110 +460,30 @@ namespace CallCenterApi.Interface.Controllers
460 460
                     if (ua != null)
461 461
                     {
462 462
                         #region 权限限制    
463
-                        string sql = " and IsDel=0 ";
464
-                        ////部门信息
465
-                        //var modelDep = new BLL.T_Sys_Department().GetModel(deptid);
466
-                        //int depType = 0, depRegion = 0;
467
-                        //if (modelDep != null)
468
-                        //{
469
-                        //    depType = modelDep.F_Type ?? 0;  //部门操作权限:1接待部,2办理人员,3区域客服,4监管
470
-                        //    depRegion = modelDep.F_Header ?? 0; //部门权限范围:9全部,1区域,2项目,3期
471
-                        //}
472
-                        //if (ua.F_RoleId != 17)
473
-                        //{
474
-                        //    if (depType == 2)
475
-                        //    {
476
-                        //        if (depRegion == 1)
477
-                        //        {
478
-                        //            // 查看该区域工单
479
-                        //            //sql += $" and IsUserSend = (SELECT TOP 1 F_ParentId FROM dbo.T_Cus_RegionCategory WHERE F_RegionId = {userRegionId}) ";
480
-                        //            sql += $" and IsUserSend = {userRegionId} ";
481
-                        //        }
482
-                        //        else if (depRegion == 2)
483
-                        //        {
484
-                        //            // 查看该项目工单
485
-                        //            sql += $" and IsAdminSend = {userRegionId} ";
486
-                        //        }
487
-                        //    }
488
-                        //    else if (depType == 3)
489
-                        //    {
490
-                        //        if (depRegion == 1)
491
-                        //        {
492
-                        //            // 查看该区域工单
493
-                        //            //sql += $" and IsUserSend = (SELECT TOP 1 F_ParentId FROM dbo.T_Cus_RegionCategory WHERE F_RegionId = {userRegionId}) ";
494
-                        //            sql += $" and IsUserSend = {userRegionId} ";
495
-                        //        }
496
-                        //    }
497
-                        //    else if (depType == 4)
498
-                        //    {
499
-                        //        if (depRegion == 2)
500
-                        //        {
501
-                        //            // 查看该项目工单
502
-                        //            sql += $" and IsAdminSend = {userRegionId} ";
503
-                        //        }
504
-                        //        else if (depRegion == 9)
505
-                        //        {
506
-                        //            // 查看该部门工单(包括一级,二级)
507
-                        //            string deptCodeNew = String.Empty;
508
-                        //            int deptCodeIndex = 0;                                  //变量声明
509
-                        //            string deptCodeN = deptCode.TrimEnd('|');      //去掉最后一个|
510
-                        //            deptCodeIndex = deptCodeN.LastIndexOf("|");             //获得|的索引
511
-                        //            deptCodeNew = deptCodeN.Substring(0, deptCodeIndex + 1);    //获得目标字符串(//去掉最后一个|后面的字符串)
512
-                        //            //============== 部门权限条件 - 部门 ================
513
-                        //            string arrUser = " select F_UserCode from T_Sys_UserAccount where F_DeptCode LIKE '" + deptCodeNew + "%' ";
514
-                        //            sql += $" and WorkOrderID in (SELECT DISTINCT WorkOrderID FROM dbo.T_Wo_WorkOrderItem WHERE ToUser IN ({arrUser})) ";
515
-                        //        }
516
-                        //    }
517
-                        //}
463
+                        string sql = "  IsDelete=0 ";
464
+                      
518 465
                         #endregion
519 466
                         #region 工单各状态下数量
520
-                        BLL.T_Wo_WorkOrder bll = new BLL.T_Wo_WorkOrder();
521
-                        WorkOrderController woController = new WorkOrderController();
467
+                        BLL.T_Wo_WorkOrderNew bll = new BLL.T_Wo_WorkOrderNew();
468
+                       
522 469
                         string uwhere = " 1=1  ";
523
-                        //1、待指派的
524
-                        if (ua.F_RoleId != 17)
470
+                        var modellist = bll.GetModelList(sql);
471
+                        int dcl=0, ycl = 0, zhcx = 0;
472
+                        foreach (var it in modellist)
525 473
                         {
526
-                            uwhere += " and CreateUser='" + ua.F_UserCode + "' ";
527
-                            uwhere += " and State =" + (int)EnumWorkOrderState.neworder + " ";
528
-                            //uwhere += " and State =0 ";
474
+                            zhcx++;
475
+                            if (it.F_State == 10)
476
+                                ycl++;
477
+                            else
478
+                                dcl++;
529 479
                         }
530
-                        //2、待接单的
531
-                        string djdwhere = $" 1=1 and State =" + (int)EnumWorkOrderState.assign + " and T_Wo_WorkOrder.ID in ( " + woController.GetDJDWorkOrderID(ua.F_UserCode) + ") ";//" 1=1 and State =1 and WorkOrderID in ( " + woController.GetDJDWorkOrderID(ua.F_UserCode) + ") ";
532
-                        //3、待完成(处理)的
533
-                        string dclwhere = $" 1=1 and State in(" + (int)EnumWorkOrderState.dealing + "," + (int)EnumWorkOrderState.receive + "," + (int)EnumWorkOrderState.reback + "," + (int)EnumWorkOrderState.abreback + ") and T_Wo_WorkOrder.ID in ( " + woController.GetDWCWorkOrderID(ua.F_UserCode) + ") ";//" 1=1 and State =1 and WorkOrderID in ( " + woController.GetDWCWorkOrderID(ua.F_UserCode) + ") ";
534
-                        //4、已处理的
535
-                        string yclwhere = $" 1=1 and State =" + (int)EnumWorkOrderState.finish + " and LastDealUser = '" + ua.F_UserCode + "' ";//" 1=1 and State =2 and LastDealUser = '" + ua.F_UserCode + "' ";
536
-                        //5、我参与的
537
-                        string wcywhere = $" 1=1 and (CreateUser= '" + ua.F_UserCode + "' or T_Wo_WorkOrder.ID in ( " + woController.GetCYWorkOrderID(ua.F_UserCode) + ")) ";//" 1=1 and  (CreateUser= '" + ua.F_UserCode + "' or WorkOrderID in ( " + woController.GetCYWorkOrderID(ua.F_UserCode) + ")) ";
538
-                        //5、超期工单
539
-                        string cqwhere = $" 1=1 and DATEADD(DAY,{days},CreateTime) < GETDATE() AND State < " + (int)EnumWorkOrderState.finish + " ";//$" 1=1 and DATEADD(DAY,{days},CreateTime) < GETDATE() AND State < 2  ";
540
-                        //5、未审核微信工单
541
-                        string wxwhere = $" 1=1 ";  // ANd Type = (SELECT F_DictionaryValueId FROM dbo.T_Sys_DictionaryValue (NOLOCK) WHERE F_DictionaryFlag = 'GDLY' AND F_Name = '微信')
542
-                        #endregion
543
-
544
-                        #region 未处理开票数量
545
-                        var billcount = new BLL.T_Wo_Bill().GetRecordCount("F_IsDel=0 and F_DealBy='" + ua.F_UserCode+ "' and F_IsDeal="+ (int)EnumBillState.Received);
546 480
                         #endregion
547 481
 
548 482
                         var obj = new
549 483
                         {
550
-                            dpd = bll.GetList(uwhere + sql + " and State=" + (int)EnumWorkOrderState.neworder + " and IsAudit = 1 ").Tables[0].Rows.Count,                    //待指派的统计
551
-                            djd = bll.GetList(djdwhere + sql + " and State =" + (int)EnumWorkOrderState.assign + " and IsAudit = 1 ").Tables[0].Rows.Count,    //待接单的统计
552
-                            dcl = bll.GetList(dclwhere + sql + " and State in(" + (int)EnumWorkOrderState.dealing + "," + (int)EnumWorkOrderState.receive + "," + (int)EnumWorkOrderState.reback + "," + (int)EnumWorkOrderState.abreback + ") and IsAudit = 1 ").Tables[0].Rows.Count,    //待处理的统计
553
-                            ycl = bll.GetList(yclwhere + sql + " and State =" + (int)EnumWorkOrderState.finish + " and IsAudit = 1 ").Tables[0].Rows.Count,    //已处理的统计
554
-                            wyc = bll.GetList(wcywhere + sql + " and IsAudit = 1 ").Tables[0].Rows.Count,    //我参与的的统计
555
-                            cq = bll.GetList(cqwhere + sql + " AND State < " + (int)EnumWorkOrderState.finish + " and IsAudit = 1 ").Tables[0].Rows.Count,    //超期工单的统计
556
-                            wx = bll.GetList(wxwhere + sql + " and IsAudit = 0 ").Tables[0].Rows.Count,    //微信工单的统计
557
-                            billcount = billcount,//开票管理未处理数量
558
-                            //dpd = bll.GetList(uwhere + sql+ " and State=0 and IsAudit = 1 ").Tables[0].Rows.Count,                    //待指派的统计
559
-                            //djd = bll.GetList(djdwhere + sql + " and State =1 and IsAudit = 1 ").Tables[0].Rows.Count,    //待接单的统计
560
-                            //dcl = bll.GetList(dclwhere + sql + " and State =1 and IsAudit = 1 ").Tables[0].Rows.Count,    //待处理的统计
561
-                            //ycl = bll.GetList(yclwhere + sql + " and State =2 and IsAudit = 1 ").Tables[0].Rows.Count,    //已处理的统计
562
-                            //wyc = bll.GetList(wcywhere + sql + " and IsAudit = 1 ").Tables[0].Rows.Count,    //我参与的的统计
563
-                            //cq = bll.GetList(cqwhere + sql + " AND State < 2 and IsAudit = 1 ").Tables[0].Rows.Count,    //超期工单的统计
564
-                            //wx = bll.GetList(wxwhere + sql + " and IsAudit = 0 ").Tables[0].Rows.Count,    //微信工单的统计
565
-                            //djd = new BLL.T_Wo_WorkOrderItem().GetModelList(" IsDel=0 and Type=1 and (state='0' and ','+ToUser+',' like '%," + ua.F_UserCode + ",%')  ").Select(p => p.WorkOrderID).Distinct().Count(),
566
-                            //dcl = new BLL.T_Wo_WorkOrderItem().GetModelList(" IsDel=0 and Type=1 and (state='1' and SureUser='" + ua.F_UserCode + "')  ").Select(p => p.WorkOrderID).Distinct().Count()
484
+                            dcl,
485
+                            ycl,
486
+                            zhcx
567 487
                         };
568 488
                         res = Success("成功", obj);
569 489
                     }

+ 25 - 8
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/SMSController.cs

@@ -315,22 +315,38 @@ namespace CallCenterApi.Interface.Controllers
315 315
         /// 获取短信模板列表
316 316
         /// </summary>
317 317
         /// <returns></returns>
318
-        public ActionResult GetTemplateList(string name, string keywords)
318
+        public ActionResult GetTemplateList(string name, string keywords,int page=1,int pagesize=5)
319 319
         {
320 320
             int userId = CurrentUser.UserData.F_UserId;
321 321
             if (userId != 0)
322 322
             {
323
-                string sql = $"  IsEnable=0";
323
+                DataTable dt = new DataTable();
324
+                string sql = $" and IsEnable=0";
324 325
                 if (!string.IsNullOrWhiteSpace(keywords))//关键字搜索
325 326
                     sql += $"  and ( Detail like '%" + keywords.Trim() + "%'or Name like '%" + keywords.Trim() + "%' or MName like '%" + keywords.Trim() + "%' ) ";
326 327
                 if (!string.IsNullOrWhiteSpace(name))//
327 328
                     sql += $" and Name like '%" + name.Trim() + "%'";
328
-                var modellist = new BLL.T_SMS_Template().GetModelList(sql);
329
+                // var modellist = new BLL.T_SMS_Template().GetModelList(sql);
330
+               
331
+                int recordCount = 0;
332
+                dt = BLL.PagerBLL.GetListPager(
333
+                        "T_SMS_Template",
334
+                        "T_SMS_Template.ID",
335
+                        "*",
336
+                        sql,
337
+                       "ORDER BY T_SMS_Template.ID desc",
338
+                        pagesize,
339
+                        page,
340
+                        true,
341
+                        out recordCount);
342
+                List<Model.T_SMS_Template> modlelist = new BLL.T_SMS_Template().DataTableToList(dt);
329 343
                 var obj = new
330 344
                 {
331 345
                     state = "success",
332 346
                     message = "成功",
333
-                    rows = modellist,
347
+                    rows = modlelist,
348
+                    total = recordCount
349
+
334 350
                 };
335 351
 
336 352
                 return Content(obj.ToJson());
@@ -537,7 +553,7 @@ namespace CallCenterApi.Interface.Controllers
537 553
         public ActionResult ExitTypelist(string name, string phone, string creatname, int SendWay=-1, int IsSend=-1)
538 554
         {
539 555
             DataTable dt = new DataTable();
540
-            string sql = $"  F_IsDelete=0";
556
+            string sql = $"   F_IsDelete=0";
541 557
             if (!string.IsNullOrEmpty(name))
542 558
             {
543 559
                 var model = new BLL.T_SMS_Template().GetModelList($"Name like '%" + name.Trim() + "%'").FirstOrDefault();
@@ -651,7 +667,7 @@ namespace CallCenterApi.Interface.Controllers
651 667
         /// 获取短信记录列表
652 668
         /// </summary>
653 669
         /// <returns></returns>
654
-        public ActionResult GetSMSList(string name, string phone, string creatname ,int SendWay=-1, int IsSend=-1, int pageindex = 1, int pagesize = 10)
670
+        public ActionResult GetSMSList(string name, string phone, string creatname ,int SendWay=-1, int IsSend=-1, int page = 1, int pagesize = 10)
655 671
         {
656 672
             DataTable dt = new DataTable();
657 673
             int userId = CurrentUser.UserData.F_UserId;
@@ -668,7 +684,7 @@ namespace CallCenterApi.Interface.Controllers
668 684
                     }
669 685
                 }
670 686
                 if (!string.IsNullOrEmpty(phone))
671
-                    sql += " and Telephone=" + phone;
687
+                    sql += " and Telephone like'%" + phone+"%'";
672 688
                 if (SendWay >= 0)
673 689
                     sql += " and SendWay=" + SendWay;
674 690
                 if (IsSend >= 0)
@@ -686,7 +702,7 @@ namespace CallCenterApi.Interface.Controllers
686 702
                         sql,
687 703
                         "ORDER BY T_SMS_List.ID desc",
688 704
                         pagesize,
689
-                        pageindex,
705
+                        page,
690 706
                         true,
691 707
                         out recordCount);
692 708
                 }
@@ -697,6 +713,7 @@ namespace CallCenterApi.Interface.Controllers
697 713
                     state = "success",
698 714
                     message = "成功",
699 715
                     rows = ModeltoSMSList( modlelist),
716
+                    total= recordCount
700 717
                 };
701 718
 
702 719
                 return Content(obj.ToJson());

+ 1 - 1
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/customer/CustomerController.cs

@@ -67,7 +67,7 @@ namespace CallCenterApi.Interface.Controllers.customer
67 67
                 }
68 68
                 if (strtel.Trim() != "" && strtel != "undefined")
69 69
                 {
70
-                    sql += "and  F_LegalTel=" + strtel;
70
+                    sql += "and  F_LegalTel like'%" + strtel+"%'";
71 71
                 }
72 72
                 if (strpageindex.Trim() != "")
73 73
                 {

+ 1 - 1
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/CallblackController.cs

@@ -31,7 +31,7 @@ namespace CallCenterApi.Interface.Controllers.tel
31 31
 
32 32
                     if (strtelnum != null && strtelnum.Trim() != "")
33 33
                     {
34
-                        sql += " and F_TelPhone= '" + strtelnum.Trim() + "' ";
34
+                        sql += " and F_TelPhone like '%" + strtelnum.Trim() + "%' ";
35 35
                     }
36 36
                     if (strsettime.Trim() != "" && strsettime != "undefined")
37 37
                     {

+ 7 - 4
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/CallleaveController.cs

@@ -13,7 +13,7 @@ namespace CallCenterApi.Interface.Controllers.tel
13 13
     public class CallleaveController : BaseController
14 14
     {
15 15
         //获取留言列表
16
-        public ActionResult GetList(string strtelnum)
16
+        public ActionResult GetList(string strtelnum,string  tel)
17 17
         {
18 18
             ActionResult res = NoToken("未知错误,请重新登录");
19 19
             if (Request.IsAuthenticated)
@@ -30,10 +30,13 @@ namespace CallCenterApi.Interface.Controllers.tel
30 30
                     int pageindex = 1;
31 31
                     string strpagesize = RequestString.GetQueryString("pagesize");
32 32
                     int pagesize = 10;
33
-
34
-                    if (strtelnum != null && strtelnum.Trim() != "")
33
+                if (tel != null && tel.Trim() != "")
34
+                {
35
+                    sql += " and F_Phone like '%" + tel.Trim() + "%' ";
36
+                }
37
+                if (strtelnum != null && strtelnum.Trim() != "")
35 38
                     {
36
-                        sql += " and F_Phone= '" + strtelnum.Trim() + "' ";
39
+                        sql += " and F_Phone like '%" + strtelnum.Trim() + "%' ";
37 40
                     }
38 41
                     if (strsettime.Trim() != "" && strsettime != "undefined")
39 42
                     {

+ 17 - 3
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderNewController.cs

@@ -37,6 +37,11 @@ namespace CallCenterApi.Interface.Controllers.workorder
37 37
                     string workOrderID = RequestString.GetQueryString("workOrderID");
38 38
                     //客户电话
39 39
                     string customerTel = RequestString.GetQueryString("customerTel");
40
+
41
+                    //开始时间
42
+                    string starttime = RequestString.GetQueryString("starttime");
43
+                    //结束时间
44
+                    string endtime = RequestString.GetQueryString("endtime");
40 45
                     //关键字
41 46
                     string keyword = RequestString.GetQueryString("keyword");
42 47
                     string strpageindex = RequestString.GetQueryString("pageindex");
@@ -63,8 +68,12 @@ namespace CallCenterApi.Interface.Controllers.workorder
63 68
                     }
64 69
                     if (customerTel.Trim() != "" && customerTel != "undefined")
65 70
                     {
66
-                        sql += "and  CustomerTel=" + customerTel;
71
+                        sql += "and  CustomerTel like'%" + customerTel+"%'";
67 72
                     }
73
+                    if (!string.IsNullOrEmpty(starttime))
74
+                        sql += " and datediff(day,CreateTime,'" + starttime + "')<=0 ";
75
+                    if (!string.IsNullOrEmpty(endtime))
76
+                        sql += " and datediff(day,CreateTime,'" + endtime + "')>=0   ";
68 77
                     if (strpageindex.Trim() != "")
69 78
                     {
70 79
                         pageindex = Convert.ToInt32(strpageindex);
@@ -330,13 +339,15 @@ namespace CallCenterApi.Interface.Controllers.workorder
330 339
         {
331 340
             #region 工单处理
332 341
             var opt = "处理";
333
-            model.F_State = (int)EnumWorkOrderState.finish;
342
+            model.F_State = 0;
343
+            model.IsOver = 0;
334 344
             if (isover == 1)
335 345
             {
336 346
                 opt = "处理";
337 347
                 model.DealBy = nowUser.F_UserCode;
338 348
                 model.DealTime = DateTime.Now;
339
-                model.F_State = 0;
349
+                model.IsOver = 1;
350
+                model.F_State = 10;
340 351
             }
341 352
             #region 读取当前登录人部门
342 353
             string deptname = "";
@@ -360,6 +371,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
360 371
                 if (!string.IsNullOrEmpty(cont))
361 372
                     model.DealContents += cont + ";";
362 373
                 model.DealTime = DateTime.Now;
374
+               
363 375
                 workOrder.Update(model);
364 376
                 #endregion
365 377
                 #region 推送消息
@@ -477,6 +489,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
477 489
                     }
478 490
                     model.Remarks = it.Remarks;
479 491
                     model.Problem = it.Problem;
492
+                    if (it.IsOver!=null )
493
+                    model.IsOver  = (int )it.IsOver;
480 494
                     model.DealContents = it.DealContents;
481 495
                     model.DealBy = it.DealBy;
482 496
                     model.DealTime = it.DealTime.ToString();