瀏覽代碼

根据坐席工号搜索

MicroWin10-1604\Administrator 7 年之前
父節點
當前提交
b7ad1e0a04

+ 26 - 14
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderController.cs

@@ -288,11 +288,6 @@ namespace CallCenterApi.Interface.Controllers.workorder
288 288
                         {
289 289
                             sql += " and CustomerTel like '%" + strtel + "%'  ";
290 290
                         }
291
-                        //坐席
292
-                        if (uid.Trim() != "" && uid != "0")
293
-                        {
294
-                            sql += " and (LastDealUser = '" + uid + "' or CreateUser = '" + uid + "') ";
295
-                        }
296 291
                         string strpageindex = RequestString.GetQueryString("page");
297 292
                         int pageindex = 1;
298 293
                         string strpagesize = RequestString.GetQueryString("pagesize");
@@ -339,10 +334,22 @@ namespace CallCenterApi.Interface.Controllers.workorder
339 334
                                     gdstate = 1;
340 335
                             }
341 336
                             sql += " and State = " + gdstate + " ";
337
+                            //坐席工号
338
+                            if (uid.Trim() != "" && uid != "0")
339
+                            {
340
+                                if (gdstate == 0)
341
+                                    sql += " and CreateUser = '" + uid + "' ";
342
+                                else
343
+                                    sql += " and LastDealUser = '" + uid + "' ";
344
+                            }
342 345
                         }
343 346
                         else//初始没有状态时为综合查询
344 347
                         {
345 348
                             gdstate = 2;
349
+                            if (uid.Trim() != "" && uid != "0")
350
+                            {
351
+                                sql += " and (LastDealUser = '" + uid + "' or CreateUser = '" + uid + "') ";
352
+                            }
346 353
                         }
347 354
                         if (strtype.Trim() != "" && strtype != "undefined")
348 355
                         {
@@ -483,18 +490,18 @@ namespace CallCenterApi.Interface.Controllers.workorder
483 490
                     if (ua != null)
484 491
                     {
485 492
                         //工单状态
486
-                        string strltype = HttpUtility.UrlDecode(RequestString.GetFormString("ltype"));
493
+                        string strltype = HttpUtility.UrlDecode(RequestString.GetQueryString("ltype"));
487 494
                         //工单来源
488
-                        string strtype = HttpUtility.UrlDecode(RequestString.GetFormString("type"));
495
+                        string strtype = HttpUtility.UrlDecode(RequestString.GetQueryString("type"));
489 496
                         //工单类型
490
-                        string strtypeclass = HttpUtility.UrlDecode(RequestString.GetFormString("typeclass"));
497
+                        string strtypeclass = HttpUtility.UrlDecode(RequestString.GetQueryString("typeclass"));
491 498
                         //工单起止时间
492
-                        string strstarttime = HttpUtility.UrlDecode(RequestString.GetFormString("starttime"));
493
-                        string strendtime = HttpUtility.UrlDecode(RequestString.GetFormString("endtime"));
499
+                        string strstarttime = HttpUtility.UrlDecode(RequestString.GetQueryString("starttime"));
500
+                        string strendtime = HttpUtility.UrlDecode(RequestString.GetQueryString("endtime"));
494 501
                         //客户分类
495
-                        string lddep = HttpUtility.UrlDecode(RequestString.GetFormString("lddep"));
496
-                        //坐席
497
-                        int uid = RequestString.GetFormInt("userid", 0);
502
+                        string lddep = HttpUtility.UrlDecode(RequestString.GetQueryString("lddep"));
503
+                        //坐席工号
504
+                        string uid = HttpUtility.UrlDecode(RequestString.GetQueryString("userid") == "" ? "0" : HttpUtility.UrlDecode(RequestString.GetQueryString("userid")));
498 505
                         string strpageindex = RequestString.GetQueryString("page");
499 506
                         int pageindex = 1;
500 507
                         string strpagesize = RequestString.GetQueryString("pagesize");
@@ -512,6 +519,11 @@ namespace CallCenterApi.Interface.Controllers.workorder
512 519
                         //            gdstate = 1;
513 520
                         //    }
514 521
                         //}
522
+                        //坐席工号
523
+                        if (uid.Trim() != "" && uid != "0")
524
+                        {
525
+                            sql += " and CreateUser = '" + uid + "' ";
526
+                        }
515 527
                         if (strtype.Trim() != "" && strtype != "undefined")
516 528
                         {
517 529
                             sql += " and Type = '" + strtype.Trim() + "' ";
@@ -568,7 +580,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
568 580
                         //}
569 581
 
570 582
                         //dt = DbHelperSQL.Query("select * from T_Wo_WorkOrder where createuser in (select u.F_UserCode from[dbo].[T_Sys_UserAccount] u,[dbo].[T_Sys_Department] d where u.F_DeptId = d.F_DeptId and d.F_DeptName = '客服部') and State = 0 " + sql + "union all select* from T_Wo_WorkOrder where createuser in (select u.F_UserCode from[dbo].[T_Sys_UserAccount] u,[dbo].[T_Sys_Department] d where u.F_DeptId=d.F_DeptId and d.F_DeptName='市场部') and Detail<>null" + sql).Tables[0];
571
-                        dt = DbHelperSQL.Query("select * from T_Wo_WorkOrder where State <>1 and State <>472 " + sql).Tables[0];
583
+                        dt = DbHelperSQL.Query("select *,dbo.GetUserName(CreateUser) as CreateUserNameRel from T_Wo_WorkOrder where State <>1 and State <>472 " + sql).Tables[0];
572 584
                         //获取催办总数
573 585
                         dt.Columns.Add("CBCount", typeof(int));
574 586
                         foreach (DataRow dr in dt.Rows)