duhongyu 2 settimane fa
parent
commit
82d99302cc

+ 14 - 6
codegit/CallCenterApi/CallCenterApi.DAL/T_Bus_WorkOrder.cs

@@ -282,7 +282,8 @@ namespace CallCenterApi.DAL
282 282
             strSql.Append("F_RepeatCreateTime=@F_RepeatCreateTime,");
283 283
             strSql.Append("F_ReviewStatus=@F_ReviewStatus,");
284 284
             strSql.Append("F_ReviewNotes=@F_ReviewNotes,");
285
-            strSql.Append("F_AuditTime=@F_AuditTime");
285
+            strSql.Append("F_AuditTime=@F_AuditTime,");
286
+            strSql.Append("F_IsQuadratic=@F_IsQuadratic");
286 287
             strSql.Append(" where F_Id=@F_Id");
287 288
             SqlParameter[] parameters = {
288 289
                     new SqlParameter("@F_WorkOrderId", SqlDbType.VarChar,50),
@@ -358,6 +359,8 @@ namespace CallCenterApi.DAL
358 359
                      new SqlParameter("@F_ReviewStatus", SqlDbType.Int,4),
359 360
                      new SqlParameter("@F_ReviewNotes", SqlDbType.NVarChar,-1),
360 361
                       new SqlParameter("@F_AuditTime", SqlDbType.DateTime),
362
+                       new SqlParameter("@F_IsQuadratic", SqlDbType.Int,4),
363
+                      
361 364
                     new SqlParameter("@F_Id", SqlDbType.Int,4)};
362 365
             parameters[0].Value = model.F_WorkOrderId;
363 366
             parameters[1].Value = model.F_CusPhone;
@@ -432,8 +435,8 @@ namespace CallCenterApi.DAL
432 435
             parameters[67].Value = model.F_ReviewStatus;
433 436
             parameters[68].Value = model.F_ReviewNotes;
434 437
             parameters[69].Value = model.F_AuditTime;
435
-            
436
-            parameters[70].Value = model.F_Id;
438
+            parameters[70].Value = model.F_IsQuadratic;
439
+            parameters[71].Value = model.F_Id;
437 440
             
438 441
             int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
439 442
             if (rows > 0)
@@ -817,6 +820,11 @@ namespace CallCenterApi.DAL
817 820
                 {
818 821
                     model.F_ReviewNotes = row["F_ReviewNotes"].ToString();
819 822
                 }
823
+                if (row["F_IsQuadratic"] != null && row["F_IsQuadratic"].ToString() != "")
824
+                {
825
+                    model.F_IsQuadratic = int.Parse(row["F_IsQuadratic"].ToString());
826
+                }
827
+                
820 828
             }
821 829
             return model;
822 830
         }
@@ -915,7 +923,7 @@ namespace CallCenterApi.DAL
915 923
             StringBuilder strSql = new StringBuilder(); strSql.Append(" select F_WorkOrderId,d.F_DeptName  AreaName ,e.F_DeptName officName ," +
916 924
                 " [dbo].[GetTime](c.F_CreateTime),F_SerialNumber,F_CusName,F_AddRess,F_CusPhone ,F_ProductType,F_ProductName,F_Specifications," +
917 925
                 " F_ProductDate,F_BatchNumber, F_Manufacturer,F_ProblemCode,F_QualityProblem," +
918
-                "  Notifications = f.F_UserName + '(' + f.F_Mobile + ')', ReceivingPerson =g.F_UserName, F_DealResult = h.F_DealResult, " +
926
+                "  Notifications = f.F_UserName + '(' + f.F_Mobile + ')', ReceivingPerson =g.F_UserName, F_DealResult = c.F_DealResult, " +
919 927
                 " case c.F_State when 0 then '待提交'when 1 then '待分派' when 3 then '待处理' when 4 then '处理中' when 5 then '退回待分派'" +
920 928
                 " when 6 then '退回待提交' when 10 then '已处理'  else '-' end F_State," +
921 929
                 " case c.F_Type when 1 then '咨询' when 2 " +
@@ -946,7 +954,7 @@ namespace CallCenterApi.DAL
946 954
         {
947 955
             StringBuilder strSql = new StringBuilder();strSql.Append(" select  F_SerialNumber, d.F_DeptName  AreaName ,e.F_DeptName officName ," +
948 956
                 "F_CusName,F_AddRess,F_ProductType,F_ProductName, F_Specifications,F_ProductDate, F_BatchNumber, F_Manufacturer, F_ProblemCode," +
949
-                " F_QualityProblem, Notifications =f.F_UserName +'(' +f.F_Mobile + ')' , ReceivingPerson =g.F_UserName  ,F_DealResult=h.F_DealResult," +
957
+                " F_QualityProblem, Notifications =f.F_UserName +'(' +f.F_Mobile + ')' , ReceivingPerson =g.F_UserName  ,F_DealResult=c.F_DealResult," +
950 958
                 "  [dbo].[GetTime](c.F_RepeatCreateTime) from dbo.T_Bus_WorkOrder c WITH(NOLOCK) " +
951 959
                 " left join T_Sys_Department d on c.F_Area = d.F_DeptId" +
952 960
                 " left join T_Sys_Department e on c.F_Office = e.F_DeptId " +
@@ -971,7 +979,7 @@ namespace CallCenterApi.DAL
971 979
             StringBuilder strSql = new StringBuilder(); strSql.Append("select F_WorkOrderId,d.F_DeptName  AreaName ,e.F_DeptName officName," +
972 980
                 "[dbo].[GetTime](c.F_CreateTime),F_SerialNumber,F_CusName,F_AddRess,F_CusPhone ,F_ProductType,F_ProductName,F_Specifications," +
973 981
                 " F_ProductDate,F_BatchNumber, F_Manufacturer,F_ProblemCode,F_QualityProblem,Notifications =f.F_UserName +'(' +f.F_Mobile + ')'  ," +
974
-                " ReceivingPerson = g.F_UserName, F_DealResult = h.F_DealResult, case c.F_State when 0 then '待提交'when 1 then " +
982
+                " ReceivingPerson = g.F_UserName, F_DealResult = c.F_DealResult, case c.F_State when 0 then '待提交'when 1 then " +
975 983
                 " '待分派' when 3 then '待处理' when 4 then '处理中' when 5 then '退回待分派' when 6 then '退回待提交' when 10 then " +
976 984
                 " '已处理'  else '-' end F_State , case c.F_Type when 1 then '咨询' when 2 then '投诉' " +
977 985
                 "when 3 then '重复' when 4 then '抽检' when 5 then '生鲜品' when 6 then '禽产品' " +

+ 65 - 25
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderController.cs

@@ -8,6 +8,7 @@ using System.Collections.Generic;
8 8
 using System.Data;
9 9
 using System.IO;
10 10
 using System.Linq;
11
+using System.Threading.Tasks;
11 12
 using System.Transactions;
12 13
 using System.Web;
13 14
 using System.Web.Mvc;
@@ -83,11 +84,11 @@ namespace CallCenterApi.Interface.Controllers.workorder
83 84
             string office,string officename, string endtime,string duplicatetime,string endduplicatetime, 
84 85
             string productType,string productDate, string batchNumber,string manufacturer,string problemCode, 
85 86
             string productName,string producttypes,string complaintType,string notifications,string keywords,
86
-            string auditStartTime, string auditEndTime,
87
+            string auditStartTime, string auditEndTime,string dealStartTime, string dealEndTime,
87 88
             string dealTimely,string ywy, string reviewNotes, string startdealtime, string enddealtime, int IsReduction=-1, 
88 89
             int CJ=0,int duplicate=-1, int see = 0, int source = 0, int type = 0, int state = -1, int pageindex = 1,
89 90
             int pagesize = 10,int isdc=0,int istime=-1 , int reminder=-1, int incomplete = -1,int isdealfile=-1,
90
-            int isreductions=0,int comprehensive=-1,int isManager=0, int reviewStatus = 0)
91
+            int isreductions=0,int comprehensive=-1,int isManager=0, int reviewStatus = 0,int isQuadratic=0)
91 92
         {
92 93
            int userId = CurrentUser.UserData.F_UserId; ;
93 94
             if (userId != 0)
@@ -231,6 +232,20 @@ namespace CallCenterApi.Interface.Controllers.workorder
231 232
                 {
232 233
                     sql += $" and  F_AuditTime <='" + auditEndTime + "'";
233 234
                 }
235
+
236
+                if (!string.IsNullOrEmpty(dealStartTime))
237
+                {
238
+                    sql += $" and  F_DealTime >='" + dealStartTime + "'";
239
+                }
240
+
241
+                if (!string.IsNullOrEmpty(dealEndTime))
242
+                {
243
+                    sql += $" and  F_DealTime <='" + dealEndTime + "'";
244
+                }
245
+                if (isQuadratic > 0)
246
+                {
247
+                    sql += $" and F_IsQuadratic ='1' ";
248
+                }
234 249
                 if (reminder==0)
235 250
                 {
236 251
                     sql += $" and c.F_DealType ='1' ";
@@ -268,6 +283,9 @@ namespace CallCenterApi.Interface.Controllers.workorder
268 283
                 {
269 284
                     sql += $" and c.F_DealFile is not null and c.F_DealFile != '' ";
270 285
                 }
286
+               
287
+
288
+
271 289
                 if (!string.IsNullOrEmpty(manufacturer))//生产厂家
272 290
                 {
273 291
                     string msg = "";
@@ -2363,8 +2381,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
2363 2381
         {
2364 2382
             if (Request.IsAuthenticated)
2365 2383
             {
2366
-                lock (_MyLock)
2367
-                {
2384
+              
2368 2385
                     #region 
2369 2386
                     int userId = CurrentUser.UserData.F_UserId;
2370 2387
                     Model.T_Sys_UserAccount userModel = userBLL.GetModel(userId);
@@ -2481,11 +2498,9 @@ namespace CallCenterApi.Interface.Controllers.workorder
2481 2498
                     {
2482 2499
                         Model.T_Bus_WorkOrder modlelist = new BLL.T_Bus_WorkOrder().GetModel(n);
2483 2500
                        
2484
-                     var deptmodel = departmentBLL.GetModel(userModel.F_DeptId);
2485
-                        string deptname = "";
2486
-                        if (deptmodel != null)
2487
-                            deptname = deptmodel.F_DeptName;
2488
-                        AddLog(modlelist.F_Id, 0, deptname + userModel.F_UserName + "创建工单", 0, 0, "", 0, userModel);
2501
+               
2502
+                      
2503
+                      //  AddLog(modlelist.F_Id, 0, deptname + userModel.F_UserName + "创建工单", 0, 0, "", 0, userModel);
2489 2504
                         if (isover > 0)
2490 2505
                         {
2491 2506
 
@@ -2494,7 +2509,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
2494 2509
 
2495 2510
                                 if (model != null)
2496 2511
                                 {
2497
-                                    var res = DealWO(userModel, modlelist, cont, "", isover);
2512
+                                    var res = DealWO(userModel, modlelist, cont, "", isover,1);
2498 2513
                                     if (res)
2499 2514
                                         return Success("处理成功");
2500 2515
                                     else
@@ -2508,7 +2523,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
2508 2523
                         {
2509 2524
                             if (clid == 0)
2510 2525
                                 return Error("请选择提交人!");
2511
-                            bool t = AssignWO(userModel, modlelist, cont, 1, clid);
2526
+                            bool t = AssignWO(userModel, modlelist, cont, 1, clid,1);
2512 2527
                             if (t)
2513 2528
                             {
2514 2529
 
@@ -2518,12 +2533,20 @@ namespace CallCenterApi.Interface.Controllers.workorder
2518 2533
                             else
2519 2534
                                 return Error("提交失败!");
2520 2535
                         }
2536
+                        else
2537
+                        {
2538
+                        var deptmodel = departmentBLL.GetModel(userModel.F_DeptId);
2539
+                        string deptname = "";
2540
+                        if (deptmodel != null)
2541
+                            deptname = deptmodel.F_DeptName;
2542
+                        AddLog(modlelist.F_Id, 0, deptname + userModel.F_UserName + "创建工单", 0, 0, "", 0, userModel);
2543
+                         }
2521 2544
                         return Success("添加成功!");
2522 2545
 
2523 2546
                     }
2524 2547
                     else
2525 2548
                         return Error("添加失败!");
2526
-                }
2549
+                
2527 2550
                 #endregion
2528 2551
             }
2529 2552
 
@@ -3304,7 +3327,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
3304 3327
         /// <summary>
3305 3328
         /// 处理工单
3306 3329
         /// </summary>
3307
-        public bool DealWO(Model.T_Sys_UserAccount nowUser, Model.T_Bus_WorkOrder model, string cont, string F_Files, int isover = 0)
3330
+        public bool DealWO(Model.T_Sys_UserAccount nowUser, Model.T_Bus_WorkOrder model, string cont, string F_Files
3331
+            , int isover = 0,int isCreate=0)
3308 3332
         {
3309 3333
             #region 工单处理
3310 3334
             var opt = "处理";
@@ -3338,7 +3362,12 @@ namespace CallCenterApi.Interface.Controllers.workorder
3338 3362
             var optcont = "";
3339 3363
             if (!string.IsNullOrEmpty(cont))
3340 3364
                 optcont = ",处理内容:" + cont;
3365
+            if (isCreate==1)
3366
+            {
3367
+                opt = "创建并" + opt;
3368
+            }
3341 3369
             var content = deptname + nowUser.F_UserName + "(" + nowUser.F_UserCode  + ")" + opt + "工单" + optcont;
3370
+            
3342 3371
             var itemid = AddLog(model.F_Id, wostate, content, 1, optbut, touser, deptid, nowUser);
3343 3372
             if (itemid > 0)
3344 3373
             {
@@ -3361,30 +3390,37 @@ namespace CallCenterApi.Interface.Controllers.workorder
3361 3390
                 }
3362 3391
                 else
3363 3392
                 {
3364
-                    if(!string .IsNullOrEmpty(model.F_Manufacturer))
3393
+                    Task task = Task.Run(() =>
3365 3394
                     {
3366
-                        var eqipment = new BLL.T_Sys_EquipmentNumber().GetModelList($"F_Production='{model.F_Manufacturer}' and F_IsDelete=0 ");
3367
-                        if (eqipment!=null&& eqipment.Count>0)
3395
+                        if (!string.IsNullOrEmpty(model.F_Manufacturer))
3368 3396
                         {
3369
-                            if (!string.IsNullOrEmpty(eqipment.FirstOrDefault().F_Manager))
3397
+                            var eqipment = new BLL.T_Sys_EquipmentNumber().GetModelList($"F_Production='{model.F_Manufacturer}' and F_IsDelete=0 ");
3398
+                            if (eqipment != null && eqipment.Count > 0)
3370 3399
                             {
3371
-                                foreach (var it in eqipment.FirstOrDefault().F_Manager.Split(','))
3400
+                                if (!string.IsNullOrEmpty(eqipment.FirstOrDefault().F_Manager))
3372 3401
                                 {
3373
-                                    new PushMessageController().
3374
-                               PushFeiShui(model, "工单处理提醒", "您负责的工厂工单已处理",
3375
-                              it, model.F_Id);
3402
+                                    foreach (var it in eqipment.FirstOrDefault().F_Manager.Split(','))
3403
+                                    {
3404
+                                        new PushMessageController().
3405
+                                   PushFeiShui(model, "工单处理提醒", "您负责的工厂工单已处理",
3406
+                                  it, model.F_Id);
3407
+                                    }
3376 3408
                                 }
3377 3409
                             }
3410
+
3378 3411
                         }
3379
-                     
3380
-                    }
3381
-                    
3412
+                    });
3413
+                   
3382 3414
                 }
3383 3415
                 //处理内容
3384 3416
                 if (!string.IsNullOrEmpty(model.F_DealResult))
3385 3417
                     model.F_DealResult +=";" +cont ;
3386 3418
                 else
3387 3419
                     model.F_DealResult += cont ;
3420
+                if(model.F_ReviewStatus!=null&& model.F_ReviewStatus==2)
3421
+                {
3422
+                    model.F_IsQuadratic = 1;
3423
+                }
3388 3424
                 model.F_DealTime = DateTime.Now;
3389 3425
                 workorderBLL.Update(model);
3390 3426
                 #endregion
@@ -3759,7 +3795,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
3759 3795
         /// <summary>
3760 3796
         /// 转派工单
3761 3797
         /// </summary>
3762
-        public bool AssignWO(Model.T_Sys_UserAccount nowUser, Model.T_Bus_WorkOrder model, string cont, int wostate, int clid = 0)
3798
+        public bool AssignWO(Model.T_Sys_UserAccount nowUser, Model.T_Bus_WorkOrder model, string cont, int wostate, int clid = 0,int isCreate=0)
3763 3799
         {
3764 3800
             string touser = ""; string tousername = "";
3765 3801
             int deptid = 0;
@@ -3812,6 +3848,10 @@ namespace CallCenterApi.Interface.Controllers.workorder
3812 3848
             var optcont = "";
3813 3849
             if (!string.IsNullOrEmpty(cont))
3814 3850
                 optcont = ",说明:" + cont;
3851
+            if (isCreate == 1)
3852
+            {
3853
+                opt = "创建并" + opt;
3854
+            }
3815 3855
             var content = nowUser.F_UserName + "(" + nowUser.F_UserCode + ")" + opt + "工单给 "+deptname + tousername + optcont;
3816 3856
             var itemid = AddLog(model.F_Id, wostate, content, 1, optbut, touser, deptid, nowUser);
3817 3857
             if (itemid > 0)

+ 16 - 3
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkorderAppController.cs

@@ -395,9 +395,9 @@ namespace CallCenterApi.Interface.Controllers.workorder
395 395
         /// <returns></returns>
396 396
         /// F_Duplicate  1咨询2投诉6抽检
397 397
         [Authority]
398
-        public ActionResult GetList(string starttime, string endtime, string keywords,string reviewNotes, string area, 
398
+        public ActionResult GetList(string starttime, string endtime, string keywords,string reviewNotes, string area, string dealStartTime, string dealEndTime,
399 399
             string offce, string dealTimely,int CJ=0, int see=0, int state = -1, int pageindex = 1,
400
-            int pagesize = 10,int Processing=0,int isdc=0,int reviewStatus=0, int comprehensive = -1, int isManager = 0)
400
+            int pagesize = 10,int Processing=0,int isdc=0,int reviewStatus=0, int comprehensive = -1, int isManager = 0, int isQuadratic = 0)
401 401
         {
402 402
             int userId = CurrentUser.UserData.F_UserId;
403 403
             if (userId != 0)
@@ -621,7 +621,20 @@ namespace CallCenterApi.Interface.Controllers.workorder
621 621
                         sql += "AND F_CreateUser=" + ua.F_UserCode;
622 622
                     sql += "AND F_State in(10)";
623 623
                 }
624
-             
624
+                if (!string.IsNullOrEmpty(dealStartTime))
625
+                {
626
+                    sql += $" and  F_DealTime >='" + dealStartTime + "'";
627
+                }
628
+
629
+                if (!string.IsNullOrEmpty(dealEndTime))
630
+                {
631
+                    sql += $" and  F_DealTime <='" + dealEndTime + "'";
632
+                }
633
+                if (isQuadratic > 0)
634
+                {
635
+                    sql += $" and F_IsQuadratic ='1' ";
636
+                }
637
+
625 638
                 // string uwhere = " ";
626 639
                 if (state>-1)
627 640
                 {

+ 5 - 0
codegit/CallCenterApi/CallCenterApi.Model/T_Bus_WorkOrder.cs

@@ -622,6 +622,11 @@ namespace CallCenterApi.Model
622 622
 
623 623
         public DateTime? F_AuditTime { set; get; }
624 624
 
625
+        /// <summary>
626
+        /// 是否二次处理
627
+        /// </summary>
628
+        public int? F_IsQuadratic { set; get; }
629
+
625 630
         #endregion Model
626 631
 
627 632
     }