machenyang 8 lat temu
rodzic
commit
f3a8c31528

+ 43 - 21
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderController.cs

@@ -255,19 +255,37 @@ namespace CallCenterApi.Interface.Controllers.workorder
255 255
                     Model.T_Sys_UserAccount ua = new BLL.T_Sys_UserAccount().GetModel(userId);
256 256
                     if (ua != null)
257 257
                     {
258
+                        //来电号码
259
+                        string strtel = HttpUtility.UrlDecode(RequestString.GetQueryString("tel"));
258 260
                         //工单状态
259
-                        string strltype = HttpUtility.UrlDecode(RequestString.GetFormString("ltype"));
261
+                        string strltype = HttpUtility.UrlDecode(RequestString.GetQueryString("ltype"));
260 262
                         //工单来源
261
-                        string strtype = HttpUtility.UrlDecode(RequestString.GetFormString("type"));
263
+                        string strtype = HttpUtility.UrlDecode(RequestString.GetQueryString("type"));
262 264
                         //工单类型
263
-                        string strtypeclass = HttpUtility.UrlDecode(RequestString.GetFormString("typeclass"));
265
+                        string strtypeclass = HttpUtility.UrlDecode(RequestString.GetQueryString("typeclass"));
264 266
                         //工单起止时间
265
-                        string strstarttime = HttpUtility.UrlDecode(RequestString.GetFormString("starttime"));
266
-                        string strendtime = HttpUtility.UrlDecode(RequestString.GetFormString("endtime"));
267
+                        string strstarttime = HttpUtility.UrlDecode(RequestString.GetQueryString("starttime"));
268
+                        string strendtime = HttpUtility.UrlDecode(RequestString.GetQueryString("endtime"));
267 269
                         //来电单位
268
-                        string lddep = HttpUtility.UrlDecode(RequestString.GetFormString("lddep"));
270
+                        string lddep = HttpUtility.UrlDecode(RequestString.GetQueryString("lddep"));
269 271
                         //坐席
270
-                        int uid = RequestString.GetFormInt("userid", 0);
272
+                        string uid = HttpUtility.UrlDecode(RequestString.GetQueryString("userid") == "" ? "0" : HttpUtility.UrlDecode(RequestString.GetFormString("userid")));
273
+                        if (uid == "0")//默认是当前登录坐席
274
+                        {
275
+                            if (ua.F_RoleId != 17)//管理员
276
+                            {
277
+                                sql += " and CreateUser = '" + ua.F_UserCode + "'";
278
+                            }
279
+                        }
280
+                        else
281
+                        {
282
+                            sql += " and CreateUser = '" + uid + "'";
283
+                        }
284
+                        //来电号码
285
+                        if (strtel.Trim() != "" && strtel != "undefined")
286
+                        {
287
+                            sql += " and CustomerTel like '%" + strtel + "%'  ";
288
+                        }
271 289
                         string strpageindex = RequestString.GetQueryString("page");
272 290
                         int pageindex = 1;
273 291
                         string strpagesize = RequestString.GetQueryString("pagesize");
@@ -306,7 +324,6 @@ namespace CallCenterApi.Interface.Controllers.workorder
306 324
                         int gdstate = 0;
307 325
                         if (strltype.Trim() != "" && strltype != "undefined")
308 326
                         {
309
-                            sql += " and State = " + strltype.Trim() + " ";
310 327
                             Model.T_Sys_DictionaryValue gdstatemodel = new BLL.T_Sys_DictionaryValue().GetModel(int.Parse(strltype));
311 328
                             if (gdstatemodel != null)
312 329
                             {
@@ -314,6 +331,11 @@ namespace CallCenterApi.Interface.Controllers.workorder
314 331
                                 if (gdname == "已处理")
315 332
                                     gdstate = 1;
316 333
                             }
334
+                            sql += " and State = " + gdstate + " ";
335
+                        }
336
+                        else//初始没有状态时为综合查询
337
+                        {
338
+                            gdstate = 2;
317 339
                         }
318 340
                         if (strtype.Trim() != "" && strtype != "undefined")
319 341
                         {
@@ -321,7 +343,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
321 343
                         }
322 344
                         if (strtypeclass.Trim() != "" && strtypeclass != "undefined")
323 345
                         {
324
-                            sql += " and TypeClass = '" + strtype.Trim() + "' ";
346
+                            sql += " and TypeClass = '" + strtypeclass.Trim() + "' ";
325 347
                         }
326 348
                         if (lddep.Trim() != "" && lddep != "undefined")
327 349
                         {
@@ -339,14 +361,16 @@ namespace CallCenterApi.Interface.Controllers.workorder
339 361
                         {
340 362
                             if (gdstate == 0)//未处理
341 363
                             {
342
-                                string dep = DbHelperSQL.GetSingle("select F_ZXZName from [dbo].[T_Sys_SeatGroup],T_Sys_UserAccount where T_Sys_UserAccount.F_SeartGroupID =[dbo].[T_Sys_SeatGroup].F_ZXZID and F_UserCode ='" + ua.F_UserCode + "' ").ToString();
343
-                                if (dep == "客服组")
344
-                                    sql += " and CreateUserID = '" + uid + "'";
345
-                                else
346
-                                    sql += " and CreateUserID = '" + uid + "' and (Detail<>'' or Province<>'' or City<>'')";
364
+                                sql += " and CreateUser='" + ua.F_UserCode + "' ";
365
+                                //string dep = DbHelperSQL.GetSingle("select F_ZXZName from [dbo].[T_Sys_SeatGroup],T_Sys_UserAccount where T_Sys_UserAccount.F_SeartGroupID =[dbo].[T_Sys_SeatGroup].F_ZXZID and F_UserCode ='" + ua.F_UserCode + "' ").ToString();
366
+                                //if (dep == "客服组") { }
367
+                                //else
368
+                                //    sql += " and (Detail<>'' or Province<>'' or City<>'')";
347 369
                             }
348
-                            else
349
-                                sql += " and LastDealUser = '" + uid + "'";
370
+                            else if (gdstate == 1)
371
+                                sql += " and LastDealUser = '" + ua.F_UserCode + "'";
372
+                            else //综合查询时
373
+                                sql += " and (LastDealUser = '" + ua.F_UserCode + "' or CreateUser='" + ua.F_UserCode + "') ";
350 374
                         }
351 375
 
352 376
                         if (strpageindex.Trim() != "")
@@ -1455,11 +1479,9 @@ namespace CallCenterApi.Interface.Controllers.workorder
1455 1479
 
1456 1480
                                 strmsg = ua.F_UserName + "完结了工单,单号:" + model.WorkOrderID;
1457 1481
                                 //工单完结要更新工单的状态
1458
-                                new BLL.T_Wo_WorkOrder().Update(new Model.T_Wo_WorkOrder()
1459
-                                {
1460
-                                    ID = model.ID,
1461
-                                    State = 1
1462
-                                });
1482
+                                model.State = 1;
1483
+                                model.LastDealUser = ua.F_UserCode;
1484
+                                new BLL.T_Wo_WorkOrder().Update(model);
1463 1485
 
1464 1486
                                 #region 消息表
1465 1487
                                 Model.T_Msg_List msg = new Model.T_Msg_List();