duhongyu 2 kuukautta sitten
vanhempi
commit
ca0307ddf9

+ 2 - 2
codegit/CallCenterApi/CallCenterApi.DAL/T_Bus_WorkOrder.cs

894
                 " F_ProductDate,F_BatchNumber, F_Manufacturer,F_ProblemCode,F_QualityProblem," +
894
                 " F_ProductDate,F_BatchNumber, F_Manufacturer,F_ProblemCode,F_QualityProblem," +
895
                 "  Notifications = f.F_UserName + '(' + f.F_Mobile + ')', ReceivingPerson =g.F_UserName, F_DealResult = h.F_DealResult, " +
895
                 "  Notifications = f.F_UserName + '(' + f.F_Mobile + ')', ReceivingPerson =g.F_UserName, F_DealResult = h.F_DealResult, " +
896
                 " case c.F_State when 0 then '待提交'when 1 then '待分派' when 3 then '待处理' when 4 then '处理中' when 5 then '退回待分派'" +
896
                 " case c.F_State when 0 then '待提交'when 1 then '待分派' when 3 then '待处理' when 4 then '处理中' when 5 then '退回待分派'" +
897
-                " when 6 then '退回待提交' when 10 then '已处理' else '-' end F_State," +
897
+                " when 6 then '退回待提交' when 10 then '已处理' when 11 then '待审核' else '-' end F_State," +
898
                 " case c.F_Type when 1 then '咨询' when 2 " +
898
                 " case c.F_Type when 1 then '咨询' when 2 " +
899
                 " then '投诉' when 3 then '重复' when 4 then '抽检' when 5 then '生鲜品' when 6 then '禽产品' " +
899
                 " then '投诉' when 3 then '重复' when 4 then '抽检' when 5 then '生鲜品' when 6 then '禽产品' " +
900
                 " when 7 then '综合事业部' when 8 then '餐饮事业部' when 9 then '400热线接听' when 10 then '线上投诉' " +
900
                 " when 7 then '综合事业部' when 8 then '餐饮事业部' when 9 then '400热线接听' when 10 then '线上投诉' " +
950
                 " F_ProductDate,F_BatchNumber, F_Manufacturer,F_ProblemCode,F_QualityProblem,Notifications =f.F_UserName +'(' +f.F_Mobile + ')'  ," +
950
                 " F_ProductDate,F_BatchNumber, F_Manufacturer,F_ProblemCode,F_QualityProblem,Notifications =f.F_UserName +'(' +f.F_Mobile + ')'  ," +
951
                 " ReceivingPerson = g.F_UserName, F_DealResult = h.F_DealResult, case c.F_State when 0 then '待提交'when 1 then " +
951
                 " ReceivingPerson = g.F_UserName, F_DealResult = h.F_DealResult, case c.F_State when 0 then '待提交'when 1 then " +
952
                 " '待分派' when 3 then '待处理' when 4 then '处理中' when 5 then '退回待分派' when 6 then '退回待提交' when 10 then " +
952
                 " '待分派' when 3 then '待处理' when 4 then '处理中' when 5 then '退回待分派' when 6 then '退回待提交' when 10 then " +
953
-                " '已处理' else '-' end F_State , case c.F_Type when 1 then '咨询' when 2 then '投诉' " +
953
+                " '已处理' when 11 then '待审核' else '-' end F_State , case c.F_Type when 1 then '咨询' when 2 then '投诉' " +
954
                 "when 3 then '重复' when 4 then '抽检' when 5 then '生鲜品' when 6 then '禽产品' " +
954
                 "when 3 then '重复' when 4 then '抽检' when 5 then '生鲜品' when 6 then '禽产品' " +
955
                 " when 7 then '综合事业部' when 8 then '餐饮事业部' when 9 then '400热线接听' when 10 then '线上投诉' " +
955
                 " when 7 then '综合事业部' when 8 then '餐饮事业部' when 9 then '400热线接听' when 10 then '线上投诉' " +
956
                 "when 11 then '市场监管局投诉' when 12 then '电商投诉'" +
956
                 "when 11 then '市场监管局投诉' when 12 then '电商投诉'" +

+ 2 - 2
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/HomeController.cs

15
     public class HomeController : BaseController
15
     public class HomeController : BaseController
16
     {
16
     {
17
         // GET: Home
17
         // GET: Home
18
-        public ActionResult Index()
18
+        public string  Index()
19
         {
19
         {
20
-            return Success("成功");
20
+            return "";
21
         }
21
         }
22
         [Authorize]
22
         [Authorize]
23
         public JsonResult json1()
23
         public JsonResult json1()

+ 3 - 2
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/BusinessController.cs

2204
                     aftersale.area = Area[i].F_DeptName;//大区
2204
                     aftersale.area = Area[i].F_DeptName;//大区
2205
                     var group = workoeder.Where(p => p.F_Area == Area[i].F_DeptId.ToString());//投诉总量
2205
                     var group = workoeder.Where(p => p.F_Area == Area[i].F_DeptId.ToString());//投诉总量
2206
                     aftersale.total = group.Count();
2206
                     aftersale.total = group.Count();
2207
-                    aftersale.processingnumber = group.Where(p => p.F_State == 4).Count();//处理中投诉
2208
                     aftersale.processednumber = group.Where(p => p.F_State == 10).Count();//已处理投诉
2207
                     aftersale.processednumber = group.Where(p => p.F_State == 10).Count();//已处理投诉
2208
+                    aftersale.processingnumber = aftersale.total - aftersale.processednumber;//处理中投诉
2209
                     float d = 0;
2209
                     float d = 0;
2210
                     if (aftersale.total > 0)
2210
                     if (aftersale.total > 0)
2211
                     {
2211
                     {
2242
                     aftersalelist.Add(aftersale);
2242
                     aftersalelist.Add(aftersale);
2243
                 }
2243
                 }
2244
                 complaints.total = workoeder.Count();
2244
                 complaints.total = workoeder.Count();
2245
-                complaints.processingnumber = workoeder.Where(p => p.F_State == 4).Count();//处理中投诉
2245
+               
2246
                 complaints.processednumber = workoeder.Where(p => p.F_State == 10).Count();//已处理投诉
2246
                 complaints.processednumber = workoeder.Where(p => p.F_State == 10).Count();//已处理投诉
2247
+                complaints.processingnumber = complaints.total- complaints.processednumber;//处理中投诉
2247
                 if (complaints.total > 0)
2248
                 if (complaints.total > 0)
2248
                     complaints.processedrate = string.Format("{0:f2}%", (float)complaints.processednumber / complaints.total * 100);//完结率
2249
                     complaints.processedrate = string.Format("{0:f2}%", (float)complaints.processednumber / complaints.total * 100);//完结率
2249
                 else
2250
                 else

+ 140 - 17
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderController.cs

451
                             if (ro.F_RoleCode == "QTJS")
451
                             if (ro.F_RoleCode == "QTJS")
452
                                 return Error("无操作权限");
452
                                 return Error("无操作权限");
453
                             break;
453
                             break;
454
+                        case 12://已完结
455
+                            sql += "AND c.F_State=11";
456
+                            sql += RetuSql(ro, see, ua);
457
+                            if (ro.F_RoleCode == "YWY" || ro.F_RoleCode == "ZG")
458
+                            {
459
+                                sql += "AND F_Notifications ='" + ua.F_UserCode + "'";
460
+                            }
461
+
462
+                            if (ro.F_RoleCode == "QTJS")
463
+                                return Error("无操作权限");
464
+                            break;
454
                     }
465
                     }
455
                 }
466
                 }
456
                 else
467
                 else
1903
                     }
1914
                     }
1904
                 }
1915
                 }
1905
                 //      model.F_ImplementationSituation = it.F_ImplementationSituation;//落实情况
1916
                 //      model.F_ImplementationSituation = it.F_ImplementationSituation;//落实情况
1906
-                model.F_State = it.F_State;//处理进度0待提交、1待查收、2待分派、3待接收、4处理中、10已完成
1917
+                model.F_State = it.F_State;//处理进度0待提交、1待查收、2待分派、3待接收、4处理中、10已完成11已审核
1907
                 model.F_Duplicate = it.F_Duplicate;//重复工单0未重复1重复
1918
                 model.F_Duplicate = it.F_Duplicate;//重复工单0未重复1重复
1908
                 model.F_Content = it.F_Content;//备注
1919
                 model.F_Content = it.F_Content;//备注
1909
                  model . F_IsReduction= it.F_IsReduction;//是否减免
1920
                  model . F_IsReduction= it.F_IsReduction;//是否减免
3062
             return NoToken("未知错误,请重新登录");
3073
             return NoToken("未知错误,请重新登录");
3063
         }
3074
         }
3064
         /// <summary>
3075
         /// <summary>
3076
+        /// 审核工单
3077
+        /// </summary>
3078
+        /// <returns></returns>
3079
+        [Authority]
3080
+        public ActionResult ReviewWorkOrder(int id, string cont, int state = 0)
3081
+        {
3082
+            if (Request.IsAuthenticated)
3083
+            {
3084
+                if (state<1)
3085
+                {
3086
+                    return Error("请选择审核结果");
3087
+                }
3088
+                int userId = CurrentUser.UserData.F_UserId;
3089
+                if (userId != 0)
3090
+                {
3091
+                    Model.T_Sys_UserAccount ua = userBLL.GetModel(userId);
3092
+                    if (ua != null)
3093
+                    {
3094
+                        Model.T_Bus_WorkOrder model = workorderBLL.GetModel(id);
3095
+                        if (model != null)
3096
+                        {
3097
+                            var res = Review(ua, model, cont, state);
3098
+                            if (res)
3099
+                                return Success("审核成功");
3100
+                            else
3101
+                                return Error("审核失败!");
3102
+                        }
3103
+                        else
3104
+                            return Error("工单不存在!");
3105
+                    }
3106
+                }
3107
+                return Error("无操作权限!");
3108
+            }
3109
+            return NoToken("未知错误,请重新登录");
3110
+        }
3111
+        /// <summary>
3065
         /// 退回工单
3112
         /// 退回工单
3066
         /// </summary>
3113
         /// </summary>
3067
         /// <param name="orderid"></param>
3114
         /// <param name="orderid"></param>
3316
             #endregion
3363
             #endregion
3317
         }
3364
         }
3318
         /// <summary>
3365
         /// <summary>
3366
+        /// 审核工单
3367
+        /// </summary>
3368
+        public bool Review(Model.T_Sys_UserAccount nowUser, Model.T_Bus_WorkOrder model, string cont, int state = 0)
3369
+        {
3370
+            #region 工单处理
3371
+            string creatuser = "";
3372
+            var opt = "审核通过";
3373
+            int optbut = 10;
3374
+            int wostate = 10;
3375
+            string touser = "";
3376
+            int deptid = 0;
3377
+            if (state == 2)
3378
+            {
3379
+                opt = "审核拒绝";
3380
+                optbut = 5;
3381
+                wostate = 5;
3382
+                var itemlast = itembll.GetModelList(" F_ItemType=" + 1 + " and  F_WoID=" + model.F_Id + "and  F_WoState=3  order by F_ID desc ").FirstOrDefault(); ;
3383
+                if (itemlast != null)
3384
+                {
3385
+                     creatuser = itemlast.F_CreateUser;
3386
+                }
3387
+               
3388
+                touser = nowUser.F_UserCode;
3389
+                deptid = nowUser.F_DeptId;
3390
+            }
3391
+            int F_Largeareaid = 0, F_Officeid = 0;
3392
+            #region 读取当前登录人部门
3393
+            string deptname = "";
3394
+            var deptmodel = departmentBLL.GetModel(nowUser.F_DeptId);
3395
+            if (deptmodel != null)
3396
+            {
3397
+                deptname = deptmodel.F_DeptName + "-";
3398
+            }
3399
+            #endregion
3400
+            var optcont = "";
3401
+            if (!string.IsNullOrEmpty(cont))
3402
+                optcont = ",审核意见:" + cont;
3403
+            var content = deptname + nowUser.F_UserName + "(" + nowUser.F_UserCode + ")" + opt + "工单" + optcont;
3404
+            var itemid = AddLog(model.F_Id, wostate, content, 1, optbut, touser, deptid, nowUser);
3405
+            if (itemid > 0)
3406
+            {
3407
+                #region 处理工单
3408
+                if (state==2)
3409
+                {
3410
+                    model.F_Officeid = F_Officeid;
3411
+                    model.F_Largeareaid = F_Largeareaid;
3412
+                    model.F_Notifications = creatuser;//通知人
3413
+                    if (wostate == 5)
3414
+                    {
3415
+                        if (model.F_TobeallocatedTime == null)
3416
+                            model.F_TobeallocatedTime = DateTime.Now;
3417
+                    }
3418
+                    if (!string.IsNullOrEmpty(model.F_Returnnote))
3419
+                        model.F_Returnnote += "," + cont;
3420
+                    else
3421
+                        model.F_Returnnote += cont;
3422
+                }
3423
+                model.F_State = wostate;
3424
+                workorderBLL.Update(model);
3425
+                #endregion
3426
+                return true;
3427
+            }
3428
+            else
3429
+                return false;
3430
+            #endregion
3431
+        }
3432
+
3433
+
3434
+        /// <summary>
3319
         /// 减免工单
3435
         /// 减免工单
3320
         /// </summary>
3436
         /// </summary>
3321
         /// <param name="orderid"></param>
3437
         /// <param name="orderid"></param>
3748
         {
3864
         {
3749
 
3865
 
3750
             Model.T_Wo_WorkOrderItem_New itemModel = new Model.T_Wo_WorkOrderItem_New();
3866
             Model.T_Wo_WorkOrderItem_New itemModel = new Model.T_Wo_WorkOrderItem_New();
3751
-            #region 
3752
-            //处理当前工单的记录之前的记录过期
3753
-            var itemlast = itembll.GetModelList(" isnull(F_IsUsed,'0')='0' and F_ItemType=" + itemtype + " and  F_WoID=" + woid + " ");
3754
-            if (F_IsUsed == 0)
3755
-            {
3756
-
3757
-                if (itemlast.Count > 0)
3758
-                {
3759
-                    foreach (var it in itemlast)
3760
-                    {
3761
-                        it.F_IsUsed = 1;
3762
-                        itembll.Update(it);
3763
-                    }
3764
-                }
3765
-            }
3766
-            #endregion
3867
+          
3767
             itemModel.F_WoID = woid;
3868
             itemModel.F_WoID = woid;
3768
             itemModel.F_WoState = wostate;
3869
             itemModel.F_WoState = wostate;
3769
             itemModel.F_ItemType = itemtype;
3870
             itemModel.F_ItemType = itemtype;
3778
             itemModel.F_CreateUser = nowUser.F_UserCode;
3879
             itemModel.F_CreateUser = nowUser.F_UserCode;
3779
             
3880
             
3780
             var res = itembll.Add(itemModel);
3881
             var res = itembll.Add(itemModel);
3882
+            if (res>0)
3883
+            {
3884
+                #region 
3885
+                //处理当前工单的记录之前的记录过期
3886
+                var itemlast = itembll.GetModelList
3887
+                    (" isnull(F_IsUsed,'0')='0' and F_ItemType=" + itemtype 
3888
+                    + " and  F_WoID=" + woid + " and F_ID< '"+ res + "' ");
3889
+                if (F_IsUsed == 0)
3890
+                {
3891
+
3892
+                    if (itemlast.Count > 0)
3893
+                    {
3894
+                        foreach (var it in itemlast)
3895
+                        {
3896
+                            it.F_IsUsed = 1;
3897
+                            itembll.Update(it);
3898
+                        }
3899
+                    }
3900
+                }
3901
+                #endregion
3902
+            }
3903
+
3781
             return res;
3904
             return res;
3782
         }
3905
         }
3783
 
3906
 

+ 167 - 21
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkorderAppController.cs

154
                 DataTable dt = new DataTable();
154
                 DataTable dt = new DataTable();
155
                 Model.T_Sys_UserAccount ua = userBLL.GetModel(userId);
155
                 Model.T_Sys_UserAccount ua = userBLL.GetModel(userId);
156
                 Model.T_Sys_RoleInfo ro = rolebll.GetModel(ua.F_RoleId);
156
                 Model.T_Sys_RoleInfo ro = rolebll.GetModel(ua.F_RoleId);
157
-                int DTJ = 0, DFP = 0, DCL = 0, CLZ = 0, YWJ = 0, THDTJ = 0, THDFP = 0, YJGD = 0, EJGD = 0, SJGD = 0, CJSL=0,ZX=0;
157
+                int DTJ = 0, DFP = 0, DCL = 0, CLZ = 0, YWJ = 0, THDTJ = 0, THDFP = 0, YJGD = 0, EJGD = 0, SJGD = 0, CJSL=0,ZX=0,
158
+                    DSH=0;
158
                 string where = $" and (F_Type=" + 2 + "or (F_Duplicate!=1 and F_Duplicate!=4  and F_Type=3) or F_Type>4 )";
159
                 string where = $" and (F_Type=" + 2 + "or (F_Duplicate!=1 and F_Duplicate!=4  and F_Type=3) or F_Type>4 )";
159
                if (ro.F_RoleCode == "DS")//电商角色
160
                if (ro.F_RoleCode == "DS")//电商角色
160
                 {
161
                 {
358
                             }
359
                             }
359
                             ZX = int.Parse(DbHelperSQL.GetSingle($"select COUNT(1) from T_Bus_WorkOrder WITH(NOLOCK)  where {sql} ").ToString());//待处理
360
                             ZX = int.Parse(DbHelperSQL.GetSingle($"select COUNT(1) from T_Bus_WorkOrder WITH(NOLOCK)  where {sql} ").ToString());//待处理
360
                             break;
361
                             break;
362
+                        case 12://待审核
363
+                            sql = "";
364
+                            sql += $"  F_IsDelete=0";
365
+                            sql += "AND F_Duplicate !=5" + where;
366
+                            sql += "AND F_State=11";
367
+                            sql += RetuSql(ro, 0, ua);
368
+                            if (ro.F_RoleCode == "YWY" || ro.F_RoleCode == "ZG")
369
+                            {
370
+                                sql += "AND F_Notifications ='" + ua.F_UserCode + "'";
371
+                            }
372
+
373
+                            if (ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "JDYBTZX")
374
+                                sql += "AND F_CreateUser=" + ua.F_UserCode;
375
+                            if (ro.F_RoleCode == "QTJS")
376
+                            {
377
+                                YWJ = 0;
378
+                                break;
379
+                            }
380
+                            DSH = int.Parse(DbHelperSQL.GetSingle($"select COUNT(1) from T_Bus_WorkOrder WITH(NOLOCK) where {sql} ").ToString());//待处理
381
+                            break;
361
 
382
 
362
                     }
383
                     }
363
 
384
 
377
                     EJGD = EJGD,
398
                     EJGD = EJGD,
378
                     SJGD = SJGD,
399
                     SJGD = SJGD,
379
                     CJSL= CJSL,
400
                     CJSL= CJSL,
380
-                    ZX= ZX
401
+                    ZX= ZX,
402
+                    DSH= DSH
381
                 };
403
                 };
382
                 return Content(obj.ToJson()); ;
404
                 return Content(obj.ToJson()); ;
383
             }
405
             }
692
                             if (ro.F_RoleCode == "QTJS")
714
                             if (ro.F_RoleCode == "QTJS")
693
                                 return Error("无操作权限");
715
                                 return Error("无操作权限");
694
                             break;
716
                             break;
717
+                        case 12://已完结
718
+                            sql += "AND F_State=11";
719
+                            sql += RetuSql(ro, see, ua);
720
+
721
+                            if (ro.F_RoleCode == "YWY" || ro.F_RoleCode == "ZG")
722
+                            {
723
+                                sql += "AND F_Notifications ='" + ua.F_UserCode + "'";
724
+                            }
725
+                            //      if (ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "JDYBTZX")
726
+                            //    sql += "AND F_CreateUser=" + ua.F_UserCode;
727
+                            if (ro.F_RoleCode == "QTJS")
728
+                                return Error("无操作权限");
729
+                            break;
695
                     }
730
                     }
696
                 }
731
                 }
697
                 else
732
                 else
948
                 var buttons = ButtonGroup.GetButtons(model.F_State.ToString (), ro.F_RoleCode );
983
                 var buttons = ButtonGroup.GetButtons(model.F_State.ToString (), ro.F_RoleCode );
949
                  if (ro.F_RoleCode== "CLZY")
984
                  if (ro.F_RoleCode== "CLZY")
950
                 {
985
                 {
951
-                    if (model.F_State==1 || model.F_State == 10 || model.F_State == 3 || model.F_State == 5 || model.F_State == 4)
986
+                    if (model.F_State==1  || model.F_State == 3 || model.F_State == 5 || model.F_State == 4)
952
                     {
987
                     {
953
                         buttons.Add(ButtonGroup.goback());
988
                         buttons.Add(ButtonGroup.goback());
954
                     }
989
                     }
1598
             return NoToken("未知错误,请重新登录");
1633
             return NoToken("未知错误,请重新登录");
1599
         }
1634
         }
1600
         /// <summary>
1635
         /// <summary>
1636
+        /// 审核工单
1637
+        /// </summary>
1638
+        /// <returns></returns>
1639
+        [Authority]
1640
+        public ActionResult ReviewWorkOrder(int id, string cont, int state = 0)
1641
+        {
1642
+            if (Request.IsAuthenticated)
1643
+            {
1644
+                if (state < 1)
1645
+                {
1646
+                    return Error("请选择审核结果");
1647
+                }
1648
+                int userId = CurrentUser.UserData.F_UserId;
1649
+                if (userId != 0)
1650
+                {
1651
+                    Model.T_Sys_UserAccount ua = userBLL.GetModel(userId);
1652
+                    if (ua != null)
1653
+                    {
1654
+                        Model.T_Bus_WorkOrder model = workorderBLL.GetModel(id);
1655
+                        if (model != null)
1656
+                        {
1657
+                            var res = Review(ua, model, cont, state);
1658
+                            if (res)
1659
+                                return Success("审核成功");
1660
+                            else
1661
+                                return Error("审核失败!");
1662
+                        }
1663
+                        else
1664
+                            return Error("工单不存在!");
1665
+                    }
1666
+                }
1667
+                return Error("无操作权限!");
1668
+            }
1669
+            return NoToken("未知错误,请重新登录");
1670
+        }
1671
+        /// <summary>
1601
         /// 催单
1672
         /// 催单
1602
         /// </summary>
1673
         /// </summary>
1603
         /// <param name="orderid"></param>
1674
         /// <param name="orderid"></param>
1908
             {
1979
             {
1909
               
1980
               
1910
                 opt = "处理完结";
1981
                 opt = "处理完结";
1911
-                optbut = 10;
1912
-                wostate =10;
1982
+                optbut = 11;
1983
+                wostate =11;
1913
                 model.F_DealUser = nowUser.F_UserCode;
1984
                 model.F_DealUser = nowUser.F_UserCode;
1914
                 model.F_DealTime = DateTime.Now;
1985
                 model.F_DealTime = DateTime.Now;
1915
             }
1986
             }
1994
                 return false;
2065
                 return false;
1995
             #endregion
2066
             #endregion
1996
         }
2067
         }
2068
+        /// <summary>
2069
+        /// 审核工单
2070
+        /// </summary>
2071
+        public bool Review(Model.T_Sys_UserAccount nowUser, Model.T_Bus_WorkOrder model, string cont, int state = 0)
2072
+        {
2073
+            #region 工单处理
2074
+            string creatuser = "";
2075
+            var opt = "审核通过";
2076
+            int optbut = 10;
2077
+            int wostate = 10;
2078
+            string touser = "";
2079
+            int deptid = 0;
2080
+            if (state == 2)
2081
+            {
2082
+                opt = "审核拒绝";
2083
+                optbut = 5;
2084
+                wostate = 5;
2085
+                var itemlast = itembll.GetModelList(" F_ItemType=" + 1 + " and  F_WoID=" + model.F_Id + "and  F_WoState=3  order by F_ID desc ").FirstOrDefault(); ;
2086
+                if (itemlast != null)
2087
+                {
2088
+                    creatuser = itemlast.F_CreateUser;
2089
+                }
2090
+
2091
+                touser = nowUser.F_UserCode;
2092
+                deptid = nowUser.F_DeptId;
2093
+            }
2094
+            int F_Largeareaid = 0, F_Officeid = 0;
2095
+            #region 读取当前登录人部门
2096
+            string deptname = "";
2097
+            var deptmodel = departmentBLL.GetModel(nowUser.F_DeptId);
2098
+            if (deptmodel != null)
2099
+            {
2100
+                deptname = deptmodel.F_DeptName + "-";
2101
+            }
2102
+            #endregion
2103
+            var optcont = "";
2104
+            if (!string.IsNullOrEmpty(cont))
2105
+                optcont = ",审核意见:" + cont;
2106
+            var content = deptname + nowUser.F_UserName + "(" + nowUser.F_UserCode + ")" + opt + "工单" + optcont;
2107
+            var itemid = AddLog(model.F_Id, wostate, content, 1, optbut, touser, deptid, nowUser);
2108
+            if (itemid > 0)
2109
+            {
2110
+                #region 处理工单
2111
+                if (state == 2)
2112
+                {
2113
+                    model.F_Officeid = F_Officeid;
2114
+                    model.F_Largeareaid = F_Largeareaid;
2115
+                    model.F_Notifications = creatuser;//通知人
2116
+                    if (wostate == 5)
2117
+                    {
2118
+                        if (model.F_TobeallocatedTime == null)
2119
+                            model.F_TobeallocatedTime = DateTime.Now;
2120
+                    }
2121
+                    if (!string.IsNullOrEmpty(model.F_Returnnote))
2122
+                        model.F_Returnnote += "," + cont;
2123
+                    else
2124
+                        model.F_Returnnote += cont;
2125
+                }
2126
+                model.F_State = wostate;
2127
+                workorderBLL.Update(model);
2128
+                #endregion
2129
+                return true;
2130
+            }
2131
+            else
2132
+                return false;
2133
+            #endregion
2134
+        }
1997
 
2135
 
1998
         /// <summary>
2136
         /// <summary>
1999
         /// 转派工单
2137
         /// 转派工单
2099
         {
2237
         {
2100
           
2238
           
2101
             Model.T_Wo_WorkOrderItem_New itemModel = new Model.T_Wo_WorkOrderItem_New();
2239
             Model.T_Wo_WorkOrderItem_New itemModel = new Model.T_Wo_WorkOrderItem_New();
2102
-            #region 
2103
-            //处理当前工单的记录之前的记录过期
2104
-            var itemlast = itembll.GetModelList(" isnull(F_IsUsed,'0')='0' and F_ItemType=" + itemtype + " and  F_WoID=" + woid + " ");
2105
-            if (F_IsUsed==0)
2106
-            {
2107
-
2108
-                if (itemlast.Count > 0)
2109
-                {
2110
-                    foreach (var it in itemlast)
2111
-                    {
2112
-                        it.F_IsUsed = 1;
2113
-                        itembll.Update(it);
2114
-                    }
2115
-                }
2116
-            }
2117
-            #endregion
2240
+          
2118
             itemModel.F_WoID = woid;
2241
             itemModel.F_WoID = woid;
2119
             itemModel.F_WoState = wostate;
2242
             itemModel.F_WoState = wostate;
2120
             itemModel.F_ItemType = itemtype;
2243
             itemModel.F_ItemType = itemtype;
2129
             itemModel.F_CreateUser = nowUser.F_UserCode;
2252
             itemModel.F_CreateUser = nowUser.F_UserCode;
2130
            
2253
            
2131
             var res = itembll.Add(itemModel);
2254
             var res = itembll.Add(itemModel);
2255
+            if(res>0)
2256
+            {
2257
+                #region 
2258
+                //处理当前工单的记录之前的记录过期
2259
+                var itemlast = itembll.GetModelList(" " +
2260
+                    "isnull(F_IsUsed,'0')='0' and F_ItemType=" + itemtype + " and  F_WoID=" + woid + " " +
2261
+                    " and F_ID < '"+ res + "'");
2262
+                if (F_IsUsed == 0)
2263
+                {
2264
+
2265
+                    if (itemlast.Count > 0)
2266
+                    {
2267
+                        foreach (var it in itemlast)
2268
+                        {
2269
+                            it.F_IsUsed = 1;
2270
+                            itembll.Update(it);
2271
+                        }
2272
+                    }
2273
+                }
2274
+                #endregion
2275
+            }
2276
+
2277
+
2132
             return res;
2278
             return res;
2133
         }
2279
         }
2134
     }
2280
     }

+ 23 - 1
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Models/Common/ButtonGroup.cs

41
         {
41
         {
42
             return new button(10, "完善");
42
             return new button(10, "完善");
43
         }
43
         }
44
+        public static button review()
45
+        {
46
+            return new button(11, "审核");
47
+        }
44
         /// <summary>
48
         /// <summary>
45
         /// 按钮类
49
         /// 按钮类
46
         /// </summary>
50
         /// </summary>
154
                     else if (code == "YWY" || code == "XTGLY" || code == "ZG")
158
                     else if (code == "YWY" || code == "XTGLY" || code == "ZG")
155
                     {
159
                     {
156
                         buttons.Add(handle());
160
                         buttons.Add(handle());
157
-                        buttons.Add(goback());
161
+                        //buttons.Add(goback());
158
                         
162
                         
159
                     }
163
                     }
160
                     else if (code == "CLZY")
164
                     else if (code == "CLZY")
163
                         buttons.Add(Perfect());
167
                         buttons.Add(Perfect());
164
                     }
168
                     }
165
                     break;
169
                     break;
170
+                case "11":
171
+                    //坐席 坐席班长 管理员
172
+                    if (code == "BSCJL" || code == "XTGLY")
173
+                    {
174
+                        buttons.Add(assign());
175
+                    }
176
+                    else if (code == "YWY" || code == "XTGLY" || code == "ZG")
177
+                    {
178
+                        buttons.Add(handle());
179
+                        buttons.Add(review());
180
+
181
+                    }
182
+                    else if (code == "CLZY")
183
+                    {
184
+                        buttons.Add(review());
185
+                        buttons.Add(Perfect());
186
+                    }
187
+                    break;
166
             }
188
             }
167
             return buttons;
189
             return buttons;
168
         }
190
         }