machenyang %!s(int64=8) %!d(string=před) roky
rodič
revize
f3a8c31528

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

255
                     Model.T_Sys_UserAccount ua = new BLL.T_Sys_UserAccount().GetModel(userId);
255
                     Model.T_Sys_UserAccount ua = new BLL.T_Sys_UserAccount().GetModel(userId);
256
                     if (ua != null)
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
                         string strpageindex = RequestString.GetQueryString("page");
289
                         string strpageindex = RequestString.GetQueryString("page");
272
                         int pageindex = 1;
290
                         int pageindex = 1;
273
                         string strpagesize = RequestString.GetQueryString("pagesize");
291
                         string strpagesize = RequestString.GetQueryString("pagesize");
306
                         int gdstate = 0;
324
                         int gdstate = 0;
307
                         if (strltype.Trim() != "" && strltype != "undefined")
325
                         if (strltype.Trim() != "" && strltype != "undefined")
308
                         {
326
                         {
309
-                            sql += " and State = " + strltype.Trim() + " ";
310
                             Model.T_Sys_DictionaryValue gdstatemodel = new BLL.T_Sys_DictionaryValue().GetModel(int.Parse(strltype));
327
                             Model.T_Sys_DictionaryValue gdstatemodel = new BLL.T_Sys_DictionaryValue().GetModel(int.Parse(strltype));
311
                             if (gdstatemodel != null)
328
                             if (gdstatemodel != null)
312
                             {
329
                             {
314
                                 if (gdname == "已处理")
331
                                 if (gdname == "已处理")
315
                                     gdstate = 1;
332
                                     gdstate = 1;
316
                             }
333
                             }
334
+                            sql += " and State = " + gdstate + " ";
335
+                        }
336
+                        else//初始没有状态时为综合查询
337
+                        {
338
+                            gdstate = 2;
317
                         }
339
                         }
318
                         if (strtype.Trim() != "" && strtype != "undefined")
340
                         if (strtype.Trim() != "" && strtype != "undefined")
319
                         {
341
                         {
321
                         }
343
                         }
322
                         if (strtypeclass.Trim() != "" && strtypeclass != "undefined")
344
                         if (strtypeclass.Trim() != "" && strtypeclass != "undefined")
323
                         {
345
                         {
324
-                            sql += " and TypeClass = '" + strtype.Trim() + "' ";
346
+                            sql += " and TypeClass = '" + strtypeclass.Trim() + "' ";
325
                         }
347
                         }
326
                         if (lddep.Trim() != "" && lddep != "undefined")
348
                         if (lddep.Trim() != "" && lddep != "undefined")
327
                         {
349
                         {
339
                         {
361
                         {
340
                             if (gdstate == 0)//未处理
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
                         if (strpageindex.Trim() != "")
376
                         if (strpageindex.Trim() != "")
1455
 
1479
 
1456
                                 strmsg = ua.F_UserName + "完结了工单,单号:" + model.WorkOrderID;
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
                                 #region 消息表
1486
                                 #region 消息表
1465
                                 Model.T_Msg_List msg = new Model.T_Msg_List();
1487
                                 Model.T_Msg_List msg = new Model.T_Msg_List();