Przeglądaj źródła

添加品牌,回访备注修改

duhongyu 6 lat temu
rodzic
commit
89a453fe48

+ 9 - 7
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/weixin/WxLoginController.cs

@@ -1814,7 +1814,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
1814 1814
                     model.F_CJ_Tonnage = model1[i].F_CJ_Tonnage;//抽检-抽检吨数
1815 1815
                     model.F_CJ_BagNo = model1[i].F_CJ_BagNo;//抽检-抽检袋数
1816 1816
                     model.F_CJ_Outlay = model1[i].F_CJ_Outlay;//抽检-公关费用金额:单位元
1817
-
1817
+                    model.F_WorkerBrand = model1[i].F_Brand;//工单品牌
1818 1818
                     model.F_DealBy = model1[i].F_DealBy;//处理人
1819 1819
                     model.F_DealTime = model1[i].F_DealTime;//处理时间
1820 1820
                     model.F_DealContent = model1[i].F_DealContent;//处理内容
@@ -2453,12 +2453,14 @@ namespace CallCenterApi.Interface.Controllers.weixin
2453 2453
             model.F_ZX_Area = input.F_ZX_Area;// 大区
2454 2454
             model.F_ZX_Branch = input.F_ZX_Branch;//分公司
2455 2455
             model.F_Files =model .F_Files;//附件上传ids
2456
-            model.F_DealType = input.F_DealType;//处理方式:当即办理、电话转接、网络转办(点选)
2456
+            model.F_Brand = input.F_WorkerBrand;//分公司
2457
+            model.F_DealType = model.F_DealType;//处理方式:当即办理、电话转接、网络转办(点选)
2457 2458
             model.F_Canal = input.F_Canal;//处理方式:当即办理、电话转接、网络转办(点选)
2458 2459
             #endregion
2459 2460
             model.F_QuestionType = input.F_QuestionType;//问题类别(投诉抽捡和咨询类别不一样)
2460 2461
                 model.F_CustomerID = input.F_CustomerID;//客户编号为10为纯数字
2461 2462
                 model.F_MaterialID = input.F_MaterialID;//物料编码为11为纯数字
2463
+
2462 2464
             #region 投诉类
2463 2465
             model.F_BatchNumber = input.F_BatchNumber;//生产批次号
2464 2466
             model.F_TS_Formula = input.F_TS_Formula;// 投诉-配方
@@ -2479,7 +2481,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
2479 2481
             model.F_CJ_Tonnage = input.F_CJ_Tonnage;//抽检-抽检吨数
2480 2482
             model.F_CJ_BagNo = input.F_CJ_BagNo;//抽检-抽检袋数
2481 2483
             model.F_CJ_Outlay = input.F_CJ_Outlay;//抽检-公关费用金额:单位元】
2482
-            model.F_VisitRemarks = input.F_VisitRemarks;//回访备注
2484
+     //     model.F_VisitRemarks = input.F_VisitRemarks;//回访备注
2483 2485
             if (!string.IsNullOrEmpty(input.F_BatchNumber))
2484 2486
             {
2485 2487
                 if (type == 1)
@@ -3424,7 +3426,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
3424 3426
         /// <returns></returns>
3425 3427
        
3426 3428
         [WechatActionFilter]
3427
-        public ActionResult DealWorkOrder(string OpenId,long orderid, string cont, WorkOrdeDeptment deptment, string dealType,
3429
+        public ActionResult DealWorkOrder(string OpenId,long orderid, string cont, WorkOrdeDeptment deptment,
3428 3430
          string uncont = "",
3429 3431
         int isvisit = 1, int isover = 0)
3430 3432
         {
@@ -3497,7 +3499,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
3497 3499
                     }
3498 3500
                     if (model != null)
3499 3501
                     {
3500
-                        var res = DealWO(ua, model, input, cont, isover, dealType, uncont);
3502
+                        var res = DealWO(ua, model, input, cont, isover, uncont);
3501 3503
                         if (res)
3502 3504
                             return Success("处理成功");
3503 3505
                         else
@@ -3735,7 +3737,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
3735 3737
         /// <summary>
3736 3738
         /// 处理工单
3737 3739
         /// </summary>
3738
-        public bool DealWO(Model.T_Sys_UserAccount nowUser, Model.T_Wo_WorkOrder model, WorkOrderNewInput input, string cont, int isover = 0, string dealType = "", string uncont = "")
3740
+        public bool DealWO(Model.T_Sys_UserAccount nowUser, Model.T_Wo_WorkOrder model, WorkOrderNewInput input, string cont, int isover = 0,  string uncont = "")
3739 3741
         {
3740 3742
             #region 工单处理
3741 3743
             int sms = 0;
@@ -3785,7 +3787,6 @@ namespace CallCenterApi.Interface.Controllers.weixin
3785 3787
             {
3786 3788
                 #region 处理工单
3787 3789
                 model.F_State = wostate;
3788
-                model.F_DealType = dealType;
3789 3790
                 //处理内容
3790 3791
                 if (!string.IsNullOrEmpty(cont))
3791 3792
                     model.F_DealContent += cont + ";";
@@ -3936,6 +3937,7 @@ namespace CallCenterApi.Interface.Controllers.weixin
3936 3937
                 var model = woBLL.GetModel(input.F_ID);
3937 3938
                 if (model ==null )
3938 3939
                     return Error("查询不到此工单!");
3940
+               
3939 3941
                 if(model .F_State !=3&& model.F_State != 12)
3940 3942
                 {
3941 3943
                     var itemlast = itembll.GetModelList(" F_WoID=" + input.F_ID + " ");

+ 108 - 21
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderNewController.cs

@@ -173,15 +173,24 @@ namespace CallCenterApi.Interface.Controllers.workorder
173 173
                         sql += " and F_State =" + (int)EnumWorkOrderState.finish + " and F_DealBy = '" + ua.F_UserCode + "' ";
174 174
                         break;
175 175
                     case 3://我参与的
176
-                        if (GetParticipateID(ua.F_UserCode) != "")
176
+                        if (ro.F_RoleCode == "XTGLY")
177 177
                         {
178
-                            sql += " and  T_Wo_WorkOrder.F_ID in ( " + GetParticipateID(ua.F_UserCode) + ") ";
178
+                            if (GetParticipateID() != "")
179
+                            {
180
+                                sql += " and  T_Wo_WorkOrder.F_ID in ( " + GetParticipateID() + ") ";
181
+                            }
179 182
                         }
180 183
                         else
181 184
                         {
182
-                            return Error("暂无工单");
185
+                            if (GetParticipateID(ua.F_UserCode) != "")
186
+                            {
187
+                                sql += " and  T_Wo_WorkOrder.F_ID in ( " + GetParticipateID(ua.F_UserCode) + ") ";
188
+                            }
189
+                            else
190
+                            {
191
+                                return Error("暂无工单");
192
+                            }
183 193
                         }
184
-
185 194
                         break;
186 195
                     case 4://待回访
187 196
                         if (ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "JDYBZZX" || ro.F_RoleCode == "XTGLY")
@@ -195,11 +204,15 @@ namespace CallCenterApi.Interface.Controllers.workorder
195 204
                         sql += $" and F_State=" + (int)EnumWorkOrderState.finish + " and F_IsVisit = '" +"1" +"' "+ uwhere; ;
196 205
                         break;
197 206
                     case 6://已回访
198
-                        if (ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "JDYBZZX" || ro.F_RoleCode == "XTGLY")
207
+                        if (ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "JDYBZZX" )
199 208
                         {
200 209
                             sql += " and (F_CreateBy= '" + ua.F_UserCode + "' or T_Wo_WorkOrder.F_ID in ( " + GetCYWorkOrderID(ua.F_UserCode) + ") or F_State =13)";
201 210
                             sql += $" and F_State=" + (int)EnumWorkOrderState.evaluate; ;
202 211
                         }
212
+                        else if (ro.F_RoleCode == "XTGLY")
213
+                        {
214
+                            uwhere = ""; ;
215
+                        }
203 216
                         else if (ro.F_RoleCode == "DQJL" || ro.F_RoleCode == "FGSJL" || ro.F_RoleCode == "ZG")
204 217
                         {
205 218
                             string detpid = "";
@@ -561,15 +574,31 @@ namespace CallCenterApi.Interface.Controllers.workorder
561 574
                         case 3://客服已分配
562 575
                             sql = "";
563 576
                             sql += $"  F_IsDelete=0";
564
-                            if (GetParticipateID(ua.F_UserCode) != "")
577
+                            if (ro.F_RoleCode == "XTGLY")
565 578
                             {
566
-                                sql += " and  T_Wo_WorkOrder.F_ID in ( " + GetParticipateID(ua.F_UserCode) + ") ";
579
+                                if (GetParticipateID() != "")
580
+                                {
581
+                                    sql += " and  T_Wo_WorkOrder.F_ID in ( " + GetParticipateID() + ") ";
582
+                                }
583
+                                else
584
+                                {
585
+                                    Allocated = 0;
586
+                                    break;
587
+                                }
567 588
                             }
568 589
                             else
569 590
                             {
570
-                                Allocated = 0;
571
-                                break;
591
+                                if (GetParticipateID(ua.F_UserCode) != "")
592
+                                {
593
+                                    sql += " and  T_Wo_WorkOrder.F_ID in ( " + GetParticipateID(ua.F_UserCode) + ") ";
594
+                                }
595
+                                else
596
+                                {
597
+                                    Allocated = 0;
598
+                                    break;
599
+                                }
572 600
                             }
601
+                            
573 602
                              Allocated = new BLL.T_Wo_WorkOrder().GetModelList(sql).Count;//客服已分配
574 603
                        
575 604
                             break;
@@ -592,11 +621,15 @@ namespace CallCenterApi.Interface.Controllers.workorder
592 621
                         case 6://已回访
593 622
                             sql = "";
594 623
                             sql += $"  F_IsDelete=0";
595
-                            if (ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "JDYBZZX" || ro.F_RoleCode == "XTGLY")
624
+                            if (ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "JDYBZZX" )
596 625
                             {
597 626
                                 sql += " and (F_CreateBy= '" + ua.F_UserCode + "' or T_Wo_WorkOrder.F_ID in ( " + GetCYWorkOrderID(ua.F_UserCode) + ") or F_State =13)";
598 627
                                 sql += $" and F_State=" + (int)EnumWorkOrderState.evaluate; ;
599 628
                             }
629
+                            else if (ro.F_RoleCode == "XTGLY")
630
+                            {
631
+                                uwhere = ""; ;
632
+                            }
600 633
                             else if (ro.F_RoleCode == "DQJL" || ro.F_RoleCode == "FGSJL" || ro.F_RoleCode == "ZG")
601 634
                             {
602 635
                                 string detpid = "";
@@ -1816,6 +1849,14 @@ namespace CallCenterApi.Interface.Controllers.workorder
1816 1849
              ;
1817 1850
             return str;
1818 1851
         }
1852
+        public string GetParticipateID()
1853
+        {
1854
+            string str = string.Empty;
1855
+            str = "select F_WoID from T_Wo_WorkOrderItem_New where  F_OptType in( 1,7)";
1856
+
1857
+            ;
1858
+            return str;
1859
+        }
1819 1860
         /// <summary>
1820 1861
         /// 获取我参与的工单编号
1821 1862
         /// </summary>
@@ -3293,7 +3334,39 @@ namespace CallCenterApi.Interface.Controllers.workorder
3293 3334
             #endregion
3294 3335
             return model;
3295 3336
         }
3296
-   
3337
+      public ActionResult DeleteWorkOrder(int  id)
3338
+        {
3339
+            int userId = CurrentUser.UserData.F_UserId;
3340
+            if (userId != 0)
3341
+            {
3342
+                if (id <= 0)
3343
+                    return Error("参数错误!");
3344
+                var model = workOrder.GetModel(id);
3345
+                if (model == null)
3346
+                    return Error("查询不到此工单!");
3347
+                Model.T_Sys_UserAccount ua = sysUserAccountBll.GetModel(userId);
3348
+                if (ua ==null )
3349
+                {
3350
+                    return Error("无操作权限!");
3351
+                }
3352
+                if (model.F_CreateBy != ua.F_UserCode)
3353
+                {
3354
+                    return Error("非创建人不能删除工单!");
3355
+                }
3356
+                if (workOrder.DeleteList(id.ToString ()))
3357
+                {
3358
+                    return Success("设置成功");
3359
+                }
3360
+                else
3361
+                {
3362
+                    return Error("设置失败");
3363
+                }
3364
+            }
3365
+            else
3366
+            {
3367
+                return Error("无操作权限!");
3368
+            }
3369
+        }
3297 3370
         /// <summary>
3298 3371
         /// 删除工单
3299 3372
         /// </summary>
@@ -3304,6 +3377,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
3304 3377
             int userId = CurrentUser.UserData.F_UserId;
3305 3378
             if (userId != 0)
3306 3379
             {
3380
+               
3307 3381
                 if (ids != null && ids.Length > 0)
3308 3382
                 {
3309 3383
                       bool res = true;
@@ -3360,6 +3434,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
3360 3434
             {
3361 3435
                 string usercode = CurrentUser.UserData.F_UserCode;
3362 3436
                 Model.T_Sys_UserAccount ua = sysUserAccountBll.GetModel(userId);
3437
+                Model.T_Sys_RoleInfo ro = rolebll.GetModel(ua.F_RoleId);
3363 3438
                 #region 添加验证判断
3364 3439
                 if (input.F_ID <= 0)
3365 3440
                     return Error("参数错误!");
@@ -3402,6 +3477,17 @@ namespace CallCenterApi.Interface.Controllers.workorder
3402 3477
                 var model = workOrder.GetModel(input.F_ID);
3403 3478
                 if (model == null)
3404 3479
                     return Error("查询不到此工单!");
3480
+                if(ro !=null )
3481
+                {
3482
+                    if (ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "JDYBZZX" )
3483
+                    {
3484
+                        if (model .F_CreateBy !=ua.F_UserCode )
3485
+                        {
3486
+                            return Error("非创建人不能修改工单!");
3487
+                        }
3488
+                           
3489
+                    }
3490
+                }
3405 3491
                 if (model.F_State != 3 && model.F_State != 12)
3406 3492
                 {
3407 3493
                     var itemlast = itembll.GetModelList(" F_WoID=" + input.F_ID + " ");
@@ -3432,7 +3518,6 @@ namespace CallCenterApi.Interface.Controllers.workorder
3432 3518
                     }
3433 3519
                     #endregion
3434 3520
                     AddLog(input.F_ID, model.F_State.Value, deptname + ua.F_UserName + "(" + ua.F_WorkNumber + ")" + "修改工单", (int)EnumItemType.update, (int)EnumItemOpt.update, "", 0, ua,0,0);
3435
-                    Model.T_Sys_RoleInfo ro = rolebll.GetModel(ua.F_RoleId);
3436 3521
                     if (ro !=null )
3437 3522
                     {
3438 3523
                       if (ro.F_RoleCode == "DQJL" || ro.F_RoleCode == "FGSJL"|| ro.F_RoleCode == "YWY")
@@ -3710,6 +3795,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
3710 3795
                     model.F_Description = model1[i].F_Description;//问题描述
3711 3796
                     model.F_Files = "0";//附件上传ids
3712 3797
                     model.F_DealType = model1[i].F_DealType;//处理方式:当即办理、电话转接、网络转办(点选)
3798
+                    model.F_WorkerBrand = model1[i].F_Brand;//工单品牌
3713 3799
                     model.SuperiorOpinion = AssCont(model1[i].F_ID );//上级处理意见
3714 3800
                     #endregion
3715 3801
                     if (!string .IsNullOrEmpty (model1[i].F_QuestionType) )
@@ -4222,7 +4308,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
4222 4308
             model.F_ZX_Area = input.F_ZX_Area;// 大区
4223 4309
             model.F_ZX_Branch = input.F_ZX_Branch;//分公司
4224 4310
             model.F_Files = model.F_Files;//附件上传ids
4225
-            model.F_DealType = input.F_DealType;//处理方式:当即办理、电话转接、网络转办(点选)
4311
+            model.F_Brand = input.F_WorkerBrand;//工单品牌
4312
+            model.F_DealType = model.F_DealType;//处理方式:当即办理、电话转接、网络转办(点选)
4226 4313
             #endregion
4227 4314
             model.F_QuestionType = input.F_QuestionType;//问题类别(投诉抽捡和咨询类别不一样)
4228 4315
             model.F_CustomerID = input.F_CustomerID;//客户编号为10为纯数字
@@ -4249,7 +4336,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
4249 4336
             model.F_CJ_TestUnit = input.F_CJ_TestUnit;//抽检-化验单位
4250 4337
             model.F_CJ_Tonnage = input.F_CJ_Tonnage;//抽检-抽检吨数
4251 4338
             model.F_CJ_BagNo = input.F_CJ_BagNo;//抽检-抽检袋数
4252
-            model.F_VisitRemarks = input.F_VisitRemarks;//回访备注
4339
+           // model.F_VisitRemarks = input.F_VisitRemarks;//回访备注
4253 4340
             if (!string .IsNullOrEmpty (input.F_BatchNumber))
4254 4341
             {
4255 4342
                 if (type == 1)
@@ -4831,7 +4918,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
4831 4918
         /// </summary>
4832 4919
         /// <returns></returns>
4833 4920
         [Authority]
4834
-        public ActionResult DealWorkOrder(long orderid, string cont, WorkOrdeDeptment deptment,string dealType,
4921
+        public ActionResult DealWorkOrder(long orderid, string cont, WorkOrdeDeptment deptment,
4835 4922
             string uncont="",
4836 4923
           int isvisit=1,  int isover = 0)
4837 4924
         {
@@ -4905,7 +4992,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
4905 4992
                     }
4906 4993
                     if (model != null)
4907 4994
                     {
4908
-                        var res = DealWO(ua, model, input, cont, isover, dealType, uncont);
4995
+                        var res = DealWO(ua, model, input, cont, isover, uncont);
4909 4996
                         if (res)
4910 4997
                             return Success("处理成功");
4911 4998
                         else
@@ -5029,7 +5116,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
5029 5116
         /// <param name="input"></param>
5030 5117
         /// <returns></returns>
5031 5118
         [Authority]
5032
-        public ActionResult ReturnvisitOrder(long orderid, string cont, string reason, string call ,int  isOver=0)
5119
+        public ActionResult ReturnvisitOrder(long orderid, string cont, string reason, string call ,string F_VisitRemarks,int  isOver=0)
5033 5120
         {
5034 5121
             int userId = CurrentUser.UserData.F_UserId;
5035 5122
             if (userId != 0)
@@ -5041,7 +5128,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
5041 5128
                     //验证信息
5042 5129
                     if (model != null)
5043 5130
                     {
5044
-                        var res = Retu(ua, model, cont, reason, call, isOver);
5131
+                        var res = Retu(ua, model, cont, reason, F_VisitRemarks, call, isOver);
5045 5132
                         if (res)
5046 5133
                             return Success("回访成功");
5047 5134
                         else
@@ -5319,7 +5406,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
5319 5406
         /// <summary>
5320 5407
         /// 回访工单
5321 5408
         /// </summary>
5322
-        public bool Retu(Model.T_Sys_UserAccount nowUser, Model.T_Wo_WorkOrder model, string cont,string reason, string call, int isOver = 0)
5409
+        public bool Retu(Model.T_Sys_UserAccount nowUser, Model.T_Wo_WorkOrder model, string cont,string reason,string F_VisitRemarks, string call, int isOver = 0)
5323 5410
         {
5324 5411
             #region 工单处理
5325 5412
             int  sms = 0;
@@ -5379,6 +5466,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
5379 5466
                 model.F_VisitReason = reason;
5380 5467
                 model.F_Callresults = call ;
5381 5468
                 model.F_Sid  = sid;
5469
+                model.F_VisitRemarks = F_VisitRemarks;
5382 5470
                 workOrder.Update(model);
5383 5471
                 #endregion
5384 5472
                 #region 推送消息
@@ -5466,7 +5554,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
5466 5554
         /// <summary>
5467 5555
         /// 处理工单
5468 5556
         /// </summary>
5469
-        public bool DealWO(Model.T_Sys_UserAccount nowUser, Model.T_Wo_WorkOrder model, WorkOrderNewInput input,string cont,int isover = 0,string dealType="",string uncont="")
5557
+        public bool DealWO(Model.T_Sys_UserAccount nowUser, Model.T_Wo_WorkOrder model, WorkOrderNewInput input,string cont,int isover = 0,string uncont="")
5470 5558
         {
5471 5559
             #region 工单处理
5472 5560
            int   sms = 0;
@@ -5517,7 +5605,6 @@ namespace CallCenterApi.Interface.Controllers.workorder
5517 5605
             {
5518 5606
                 #region 处理工单
5519 5607
                 model.F_State  = wostate;
5520
-                model.F_DealType  = dealType;
5521 5608
                 //处理内容
5522 5609
                 if (!string.IsNullOrEmpty(cont))
5523 5610
                     model.F_DealContent += cont + ";";

+ 4 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Models/Input/WorkOrderNewInput.cs

@@ -279,6 +279,10 @@ namespace CallCenterApi.Interface.Models.Input
279 279
         /// </summary>
280 280
         public string F_Brand { get; set; }
281 281
         /// <summary>
282
+        /// 品牌
283
+        /// </summary>
284
+        public string F_WorkerBrand { get; set; }
285
+        /// <summary>
282 286
         /// 复合肥肥效
283 287
         /// </summary>
284 288
         public string F_MaterialEffect { get; set; }

+ 6 - 0
codegit/CallCenterApi/CallCenterApi.Model/T_Wo_WorkOrder.cs

@@ -101,6 +101,12 @@ namespace CallCenterApi.Model
101 101
         private int  _f_smsreply;
102 102
         private string  _f_sid;
103 103
         private string _f_visitremarks;
104
+        private string _f_brand;
105
+        public string F_Brand
106
+        {
107
+            set { _f_brand = value; }
108
+            get { return _f_brand; }
109
+        }
104 110
         /// <summary>
105 111
         /// 回访备注
106 112
         /// </summary>