|
|
@@ -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 + ";";
|