|
|
@@ -78,11 +78,13 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
78
|
78
|
/// 获取工单列表
|
|
79
|
79
|
/// </summary>
|
|
80
|
80
|
/// <returns></returns>
|
|
81
|
|
- public ActionResult GetList(string code, string starttime, string endtime,string duplicatetime,string endduplicatetime, string productType,string productDate, string batchNumber,string manufacturer,string problemCode,string notifications,string keywords, string dealTimely,int area = 0,int office=0,int duplicate=-1, int see = 0, int source = 0, int type = 0, int state = -1, int pageindex = 1, int pagesize = 10,int isdc=0,int istime=0 )
|
|
|
81
|
+ public ActionResult GetList(string code, string starttime, string endtime,string duplicatetime,string endduplicatetime, string productType,string productDate, string batchNumber,string manufacturer,string problemCode,string notifications,string keywords, string dealTimely,int CJ=0,int area = 0,int office=0,int duplicate=-1, int see = 0, int source = 0, int type = 0, int state = -1, int pageindex = 1, int pagesize = 10,int isdc=0,int istime=0 )
|
|
82
|
82
|
{
|
|
83
|
83
|
int userId = CurrentUser.UserData.F_UserId;
|
|
84
|
84
|
if (userId != 0)
|
|
85
|
85
|
{
|
|
|
86
|
+ Model.T_Sys_UserAccount ua = userBLL.GetModel(userId);
|
|
|
87
|
+ Model.T_Sys_RoleInfo ro = rolebll.GetModel(ua.F_RoleId);
|
|
86
|
88
|
string sql = $" F_IsDelete=0";
|
|
87
|
89
|
sql += "and F_Duplicate!=5";
|
|
88
|
90
|
string where = "";
|
|
|
@@ -98,7 +100,19 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
98
|
100
|
else
|
|
99
|
101
|
sql += $" and F_Type=" + type;
|
|
100
|
102
|
}
|
|
101
|
|
-
|
|
|
103
|
+ if (CJ == 1)
|
|
|
104
|
+ {
|
|
|
105
|
+ sql += "AND F_Duplicate=6";
|
|
|
106
|
+ if (ro.F_RoleCode == "BSCJL" || ro.F_RoleCode == "YWY")
|
|
|
107
|
+ {
|
|
|
108
|
+ sql += "AND F_Notifications =" + ua.F_UserCode;
|
|
|
109
|
+ }
|
|
|
110
|
+ else if (ro.F_RoleCode == "ZR" || ro.F_RoleCode == "BBZY" || ro.F_RoleCode == "CJZY" || ro.F_RoleCode == "XTGLY")
|
|
|
111
|
+ {
|
|
|
112
|
+ }
|
|
|
113
|
+ else
|
|
|
114
|
+ return Error("无操作权限");
|
|
|
115
|
+ }
|
|
102
|
116
|
if (source > 0)//工单来源
|
|
103
|
117
|
sql += $" and F_Source=" + source;
|
|
104
|
118
|
if (area > 0)//大区
|
|
|
@@ -146,8 +160,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
146
|
160
|
sql += $" and ( F_CusName like '%" + keywords.Trim() + "%'or F_CusPhone like '%" + keywords.Trim() + "%' ) ";
|
|
147
|
161
|
if (!string.IsNullOrWhiteSpace(code))//工单编号
|
|
148
|
162
|
sql += $" and F_WorkOrderId like '%" + code.Trim() + "%'";
|
|
149
|
|
- Model.T_Sys_UserAccount ua = userBLL.GetModel(userId);
|
|
150
|
|
- Model.T_Sys_RoleInfo ro = rolebll.GetModel(ua.F_RoleId);
|
|
|
163
|
+
|
|
151
|
164
|
string uwhere = " ";
|
|
152
|
165
|
if (state > -1)
|
|
153
|
166
|
{
|
|
|
@@ -207,6 +220,18 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
207
|
220
|
if (ro.F_RoleCode == "YWY" || ro.F_RoleCode == "QTJS")
|
|
208
|
221
|
return Error("无操作权限");
|
|
209
|
222
|
break;
|
|
|
223
|
+ case 7://抽检列表
|
|
|
224
|
+ sql += "AND F_Duplicate=6";
|
|
|
225
|
+ if (ro.F_RoleCode == "BSCJL" || ro.F_RoleCode == "YWY")
|
|
|
226
|
+ {
|
|
|
227
|
+ sql += "AND F_Notifications =" + ua.F_UserCode;
|
|
|
228
|
+ }
|
|
|
229
|
+ else if (ro.F_RoleCode == "ZR" || ro.F_RoleCode == "BBZY" || ro.F_RoleCode == "CJZY")
|
|
|
230
|
+ {
|
|
|
231
|
+ }
|
|
|
232
|
+ else
|
|
|
233
|
+ return Error("无操作权限");
|
|
|
234
|
+ break;
|
|
210
|
235
|
case 10://已完结
|
|
211
|
236
|
sql += "AND F_State=10";
|
|
212
|
237
|
sql += RetuSql(ro, see, ua);
|
|
|
@@ -305,7 +330,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
305
|
330
|
|
|
306
|
331
|
}
|
|
307
|
332
|
}
|
|
308
|
|
- else if (isdc == 2)
|
|
|
333
|
+ else if (isdc == 2|| isdc == 3)
|
|
309
|
334
|
{
|
|
310
|
335
|
var depts = new BLL.T_Bus_WorkOrder().GetModelList(sql+ "order by F_Id desc");
|
|
311
|
336
|
#region
|
|
|
@@ -325,7 +350,10 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
325
|
350
|
dt.Columns.Add("生产厂家");
|
|
326
|
351
|
dt.Columns.Add("问题代码");
|
|
327
|
352
|
dt.Columns.Add("质量问题");
|
|
|
353
|
+ if (isdc == 2)
|
|
328
|
354
|
dt.Columns.Add("通知人");
|
|
|
355
|
+ else
|
|
|
356
|
+ dt.Columns.Add("处理人");
|
|
329
|
357
|
dt.Columns.Add("接听人");
|
|
330
|
358
|
dt.Columns.Add("落实情况");
|
|
331
|
359
|
dt.Columns.Add("处理进度");
|
|
|
@@ -376,15 +404,30 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
376
|
404
|
drNew["生产厂家"] = it.F_Manufacturer;
|
|
377
|
405
|
drNew["问题代码"] = it.F_ProblemCode;
|
|
378
|
406
|
drNew["质量问题"] = it.F_QualityProblem;
|
|
379
|
|
- drNew["通知人"] = it.F_Notifications;
|
|
380
|
|
- if (!string .IsNullOrEmpty (it.F_Notifications))
|
|
|
407
|
+ if (isdc == 2)
|
|
381
|
408
|
{
|
|
382
|
|
- var user = new BLL.T_Sys_UserAccount().GetModel(it.F_Notifications);
|
|
383
|
|
- if (user!=null )
|
|
|
409
|
+ drNew["通知人"] = it.F_Notifications;
|
|
|
410
|
+ if (!string.IsNullOrEmpty(it.F_Notifications))
|
|
384
|
411
|
{
|
|
385
|
|
- drNew["通知人"] = user.F_UserName ;
|
|
|
412
|
+ var user = new BLL.T_Sys_UserAccount().GetModel(it.F_Notifications);
|
|
|
413
|
+ if (user != null)
|
|
|
414
|
+ {
|
|
|
415
|
+ drNew["通知人"] = user.F_UserName;
|
|
|
416
|
+ }
|
|
|
417
|
+
|
|
|
418
|
+ }
|
|
|
419
|
+ }
|
|
|
420
|
+ else
|
|
|
421
|
+ {
|
|
|
422
|
+ drNew["处理人"] = it.F_DealUser;
|
|
|
423
|
+ if (!string.IsNullOrEmpty(it.F_DealUser))
|
|
|
424
|
+ {
|
|
|
425
|
+ var user = new BLL.T_Sys_UserAccount().GetModel(it.F_DealUser);
|
|
|
426
|
+ if (user != null)
|
|
|
427
|
+ {
|
|
|
428
|
+ drNew["处理人"] = user.F_UserName;
|
|
|
429
|
+ }
|
|
386
|
430
|
}
|
|
387
|
|
-
|
|
388
|
431
|
}
|
|
389
|
432
|
drNew["接听人"] = it.F_ReceivingPerson;
|
|
390
|
433
|
if (!string.IsNullOrEmpty(it.F_ReceivingPerson))
|
|
|
@@ -478,7 +521,110 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
478
|
521
|
#endregion
|
|
479
|
522
|
|
|
480
|
523
|
}
|
|
481
|
|
-
|
|
|
524
|
+
|
|
|
525
|
+ public DataTable GetFileData(string ids, string prefix)
|
|
|
526
|
+ {
|
|
|
527
|
+ DataTable dt = new DataTable();
|
|
|
528
|
+ if (!string.IsNullOrEmpty(ids))
|
|
|
529
|
+ {
|
|
|
530
|
+ dt = DbHelperSQL.Query("select * from T_Sys_Accessories where F_Id in (" + ids + ")").Tables[0];
|
|
|
531
|
+ foreach (DataRow dr in dt.Rows)
|
|
|
532
|
+ {
|
|
|
533
|
+ dr["F_Url"] = prefix + dr["F_Url"].ToString();
|
|
|
534
|
+ }
|
|
|
535
|
+ }
|
|
|
536
|
+ return dt;
|
|
|
537
|
+ }
|
|
|
538
|
+ public ActionResult GetRepeatWorker(string tel)
|
|
|
539
|
+ {
|
|
|
540
|
+ var model = new BLL.T_Bus_WorkOrder().GetModelList("F_IsDelete=0 and F_CusPhone='" + tel + "' order by F_CreateTime desc").FirstOrDefault();
|
|
|
541
|
+ var list = new List<Model.T_Bus_WorkOrder>();
|
|
|
542
|
+ if (model != null)
|
|
|
543
|
+ {
|
|
|
544
|
+ list.Add(model);
|
|
|
545
|
+ var itemlasts = itembll.GetModelList(" F_WoID=" + +model.F_Id + " ");
|
|
|
546
|
+ var configfj = new BLL.T_Sys_SystemConfig().GetModelList(" F_ParamCode='FileUrlPath' ").FirstOrDefault();
|
|
|
547
|
+ var FileUrl = GetFileData(model.F_DealFile.ToString(), configfj.F_ParamValue);
|
|
|
548
|
+ if (list.Count > 0)
|
|
|
549
|
+ {
|
|
|
550
|
+ List<WorkOrderInput> Input = modeltooip(list);
|
|
|
551
|
+ if (Input != null)
|
|
|
552
|
+ {
|
|
|
553
|
+ var obj = new
|
|
|
554
|
+ {
|
|
|
555
|
+ state = "success",
|
|
|
556
|
+ message = "成功",
|
|
|
557
|
+ rows = Input,
|
|
|
558
|
+ FileUrl = FileUrl,
|
|
|
559
|
+ itemlasts,
|
|
|
560
|
+ };
|
|
|
561
|
+ return Content(obj.ToJson());
|
|
|
562
|
+ }
|
|
|
563
|
+ else
|
|
|
564
|
+ {
|
|
|
565
|
+ return Error("没有查询到此工单");
|
|
|
566
|
+ }
|
|
|
567
|
+ }
|
|
|
568
|
+ else
|
|
|
569
|
+ return Error("没有查询到此工单");
|
|
|
570
|
+ }
|
|
|
571
|
+ return null;
|
|
|
572
|
+ }
|
|
|
573
|
+ /// <summary>
|
|
|
574
|
+ /// 查询工单详情
|
|
|
575
|
+ /// </summary>
|
|
|
576
|
+ public ActionResult GetCallidDetails(string callid)
|
|
|
577
|
+ {
|
|
|
578
|
+ int userId = CurrentUser.UserData.F_UserId;
|
|
|
579
|
+ if (userId != 0)
|
|
|
580
|
+ {
|
|
|
581
|
+ Model.T_Sys_UserAccount ua = userBLL.GetModel(userId);
|
|
|
582
|
+
|
|
|
583
|
+ if (string .IsNullOrEmpty (callid))
|
|
|
584
|
+ {
|
|
|
585
|
+ return Error("请输入正确的id");
|
|
|
586
|
+ }
|
|
|
587
|
+ var list = new List<Model.T_Bus_WorkOrder>();
|
|
|
588
|
+ var model = new BLL.T_Bus_WorkOrder().GetModelList("F_IsDelete=0 and F_CallId='" + callid + "'").FirstOrDefault();
|
|
|
589
|
+ if (model != null)
|
|
|
590
|
+ {
|
|
|
591
|
+ list.Add(model);
|
|
|
592
|
+ var itemlasts = itembll.GetModelList(" F_WoID=" + +model.F_Id + "and F_OptType !=12 ");
|
|
|
593
|
+ var configfj = new BLL.T_Sys_SystemConfig().GetModelList(" F_ParamCode='FileUrlPath' ").FirstOrDefault();
|
|
|
594
|
+ var FileUrl = GetFileData(model.F_DealFile.ToString(), configfj.F_ParamValue);
|
|
|
595
|
+ if (list.Count > 0)
|
|
|
596
|
+ {
|
|
|
597
|
+ List<WorkOrderInput> Input = modeltooip(list);
|
|
|
598
|
+ if (Input != null)
|
|
|
599
|
+ {
|
|
|
600
|
+ var obj = new
|
|
|
601
|
+ {
|
|
|
602
|
+ state = "success",
|
|
|
603
|
+ message = "成功",
|
|
|
604
|
+ rows = Input,
|
|
|
605
|
+ FileUrl = FileUrl,
|
|
|
606
|
+ itemlasts,
|
|
|
607
|
+ };
|
|
|
608
|
+ return Content(obj.ToJson());
|
|
|
609
|
+ }
|
|
|
610
|
+ else
|
|
|
611
|
+ {
|
|
|
612
|
+ return Error("没有查询到此工单");
|
|
|
613
|
+ }
|
|
|
614
|
+ }
|
|
|
615
|
+ else
|
|
|
616
|
+ return Error("没有查询到此工单");
|
|
|
617
|
+ }
|
|
|
618
|
+ else
|
|
|
619
|
+ return Error("没有查询到此工单");
|
|
|
620
|
+
|
|
|
621
|
+ }
|
|
|
622
|
+ else
|
|
|
623
|
+ {
|
|
|
624
|
+ return Error("无操作权限!");
|
|
|
625
|
+ }
|
|
|
626
|
+ }
|
|
|
627
|
+
|
|
482
|
628
|
/// <summary>
|
|
483
|
629
|
/// 查询工单详情
|
|
484
|
630
|
/// </summary>
|
|
|
@@ -487,7 +633,6 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
487
|
633
|
int userId = CurrentUser.UserData.F_UserId;
|
|
488
|
634
|
if (userId != 0)
|
|
489
|
635
|
{
|
|
490
|
|
- DataTable FileUrl = new DataTable();
|
|
491
|
636
|
Model.T_Sys_UserAccount ua = userBLL.GetModel(userId);
|
|
492
|
637
|
|
|
493
|
638
|
if (id <= 0)
|
|
|
@@ -498,7 +643,9 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
498
|
643
|
var model = workorderBLL.GetModel(id);
|
|
499
|
644
|
if (model != null)
|
|
500
|
645
|
list.Add(model);
|
|
501
|
|
- var itemlasts = itembll.GetModelList(" F_WoID=" + +id + " ");
|
|
|
646
|
+ var itemlasts = itembll.GetModelList(" F_WoID=" + +id + "and F_OptType !=12 ");
|
|
|
647
|
+ var configfj = new BLL.T_Sys_SystemConfig().GetModelList(" F_ParamCode='FileUrlPath' ").FirstOrDefault();
|
|
|
648
|
+ var FileUrl = GetFileData(model.F_DealFile.ToString(), configfj.F_ParamValue);
|
|
502
|
649
|
if (list.Count > 0)
|
|
503
|
650
|
{
|
|
504
|
651
|
List<WorkOrderInput> Input = modeltooip(list);
|
|
|
@@ -509,6 +656,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
509
|
656
|
state = "success",
|
|
510
|
657
|
message = "成功",
|
|
511
|
658
|
rows = Input,
|
|
|
659
|
+ FileUrl = FileUrl,
|
|
512
|
660
|
itemlasts,
|
|
513
|
661
|
};
|
|
514
|
662
|
return Content(obj.ToJson());
|
|
|
@@ -532,6 +680,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
532
|
680
|
List<WorkOrderInput> Input = new List<WorkOrderInput>();
|
|
533
|
681
|
foreach (var it in modlelist)
|
|
534
|
682
|
{
|
|
|
683
|
+
|
|
535
|
684
|
WorkOrderInput model = new WorkOrderInput();
|
|
536
|
685
|
model.F_Id = it.F_Id;//id
|
|
537
|
686
|
model.F_WorkOrderId = it.F_WorkOrderId;//工单编号
|
|
|
@@ -580,7 +729,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
580
|
729
|
model.F_Manufacturer = it.F_Manufacturer;//生产厂家
|
|
581
|
730
|
model.F_ProblemCode = it.F_ProblemCode;//问题代码
|
|
582
|
731
|
model.F_QualityProblem = it.F_QualityProblem;//质量问题
|
|
583
|
|
-
|
|
|
732
|
+ model.F_IsReduction = it.F_IsReduction;
|
|
|
733
|
+ model.F_CallId = it.F_CallId;//通话记录id
|
|
584
|
734
|
model.F_Notifications = it.F_Notifications;//通知人
|
|
585
|
735
|
if (!string .IsNullOrEmpty (it.F_Notifications))
|
|
586
|
736
|
{
|
|
|
@@ -604,7 +754,14 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
604
|
754
|
model.F_Duplicate = it.F_Duplicate;//重复工单0未重复1重复
|
|
605
|
755
|
model.F_Content = it.F_Content;//备注
|
|
606
|
756
|
model.F_DealResult = it.F_DealResult;//处理结果
|
|
607
|
|
- model.F_DealUser = it.F_DealUser;//处理人
|
|
|
757
|
+ if (!string.IsNullOrEmpty(it.F_DealUser))
|
|
|
758
|
+ {
|
|
|
759
|
+ var user = new BLL.T_Sys_UserAccount().GetModel(it.F_DealUser);
|
|
|
760
|
+ if (user != null)
|
|
|
761
|
+ {
|
|
|
762
|
+ model.F_DealUser = user.F_UserName; ;//处理人
|
|
|
763
|
+ }
|
|
|
764
|
+ }
|
|
608
|
765
|
model.F_DealTime = it.F_DealTime;//处理时间
|
|
609
|
766
|
model.F_Returnnote = it.F_Returnnote;//退回说明
|
|
610
|
767
|
Input.Add(model);
|
|
|
@@ -711,8 +868,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
711
|
868
|
{
|
|
712
|
869
|
if (see != 0)
|
|
713
|
870
|
{
|
|
714
|
|
- if (HandleUser(ua)!="")
|
|
715
|
|
- sql += "AND F_Largeareaid in (" + HandleUser(ua) + ")";
|
|
|
871
|
+ if (HandleUser(ua) != "")
|
|
|
872
|
+ sql += "AND F_Largeareaid in (" + HandleUser(ua) + ")";
|
|
716
|
873
|
}
|
|
717
|
874
|
|
|
718
|
875
|
}
|
|
|
@@ -730,6 +887,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
730
|
887
|
}
|
|
731
|
888
|
return sql;
|
|
732
|
889
|
}
|
|
|
890
|
+
|
|
733
|
891
|
/// <summary>
|
|
734
|
892
|
/// 获取处理专员下的大区人员
|
|
735
|
893
|
/// </summary>
|
|
|
@@ -791,7 +949,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
791
|
949
|
string msg = "";
|
|
792
|
950
|
if (id <= 0)
|
|
793
|
951
|
return Error("请输入正确的id");
|
|
794
|
|
- sql += " and F_WoID=" + id ;
|
|
|
952
|
+ sql += " and F_WoID=" + id+ "and F_OptType !=12";
|
|
795
|
953
|
int recordCount = 0;
|
|
796
|
954
|
if (!string.IsNullOrWhiteSpace(sql))
|
|
797
|
955
|
{
|
|
|
@@ -840,6 +998,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
840
|
998
|
{
|
|
841
|
999
|
int userId = CurrentUser.UserData.F_UserId;
|
|
842
|
1000
|
Model.T_Sys_UserAccount userModel = userBLL.GetModel(userId);
|
|
|
1001
|
+ Model.T_Sys_RoleInfo ro = rolebll.GetModel(userModel.F_RoleId);
|
|
843
|
1002
|
if (!(input.F_Type > 0 && input.F_Type < 4))
|
|
844
|
1003
|
return Error("工单类型错误!");
|
|
845
|
1004
|
if (string.IsNullOrEmpty(input.F_CusName))
|
|
|
@@ -869,6 +1028,14 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
869
|
1028
|
}
|
|
870
|
1029
|
}
|
|
871
|
1030
|
var model = new Model.T_Bus_WorkOrder();
|
|
|
1031
|
+ if (ro .F_RoleCode == "CJZY")
|
|
|
1032
|
+ {
|
|
|
1033
|
+ input.F_Duplicate = 6;
|
|
|
1034
|
+ }
|
|
|
1035
|
+ else
|
|
|
1036
|
+ {
|
|
|
1037
|
+ input.F_Duplicate = 0;
|
|
|
1038
|
+ }
|
|
872
|
1039
|
model = inputtoobj(model, input, 0);
|
|
873
|
1040
|
|
|
874
|
1041
|
int n = workorderBLL.Add(model);
|
|
|
@@ -899,6 +1066,144 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
899
|
1066
|
return NoToken("未知错误,请重新登录");
|
|
900
|
1067
|
}
|
|
901
|
1068
|
/// <summary>
|
|
|
1069
|
+ /// 修改提交工单
|
|
|
1070
|
+ /// </summary>
|
|
|
1071
|
+ /// <param name="input"></param>
|
|
|
1072
|
+ /// <returns></returns>
|
|
|
1073
|
+ public ActionResult Update(WorkOrderInput input)
|
|
|
1074
|
+ {
|
|
|
1075
|
+ if (Request.IsAuthenticated)
|
|
|
1076
|
+ {
|
|
|
1077
|
+
|
|
|
1078
|
+ int userId = CurrentUser.UserData.F_UserId;
|
|
|
1079
|
+ Model.T_Sys_UserAccount userModel = userBLL.GetModel(userId);
|
|
|
1080
|
+ if (input.F_Id <= 0)
|
|
|
1081
|
+ return Error("参数错误!");
|
|
|
1082
|
+ if (!(input.F_Type > 0 && input.F_Type < 4))
|
|
|
1083
|
+ return Error("工单类型错误!");
|
|
|
1084
|
+ if (string.IsNullOrEmpty(input.F_CusName))
|
|
|
1085
|
+ return Error("请输入来电人姓名!");
|
|
|
1086
|
+ if (string.IsNullOrEmpty(input.F_CusPhone))
|
|
|
1087
|
+ return Error("请输入来电人电话!");
|
|
|
1088
|
+ if (!string.IsNullOrEmpty(input.F_ProductDate))
|
|
|
1089
|
+ {
|
|
|
1090
|
+ try
|
|
|
1091
|
+ {
|
|
|
1092
|
+ string result = input.F_ProductDate.Replace(".", "");
|
|
|
1093
|
+ var pronos = DateTime.ParseExact(result, "yyyyMMdd", null).ToString("yyyy-MM-dd");
|
|
|
1094
|
+ var protime = Convert.ToDateTime(pronos);
|
|
|
1095
|
+ if (DateTime.Parse(pronos) > DateTime.Now)
|
|
|
1096
|
+ {
|
|
|
1097
|
+ return Error("生产日期不能大于当前时间!");
|
|
|
1098
|
+ }
|
|
|
1099
|
+ }
|
|
|
1100
|
+ catch
|
|
|
1101
|
+ {
|
|
|
1102
|
+ return Error("生产日期格式错误!");
|
|
|
1103
|
+ }
|
|
|
1104
|
+ }
|
|
|
1105
|
+ var model = workorderBLL.GetModel(input.F_Id);
|
|
|
1106
|
+ if (model == null)
|
|
|
1107
|
+ return Error("查询不到此工单!");
|
|
|
1108
|
+ input .F_Duplicate= model.F_Type;
|
|
|
1109
|
+ input.F_Type = 3;
|
|
|
1110
|
+ model = inputtoobj(model, input, 1);
|
|
|
1111
|
+ bool n = workorderBLL.Update(model);
|
|
|
1112
|
+ if (n)
|
|
|
1113
|
+ {
|
|
|
1114
|
+ var deptmodel = departmentBLL.GetModel(userModel.F_DeptId);
|
|
|
1115
|
+ string deptname = "";
|
|
|
1116
|
+ if (deptmodel != null)
|
|
|
1117
|
+ deptname = deptmodel.F_DeptName;
|
|
|
1118
|
+
|
|
|
1119
|
+ AddLog(model.F_Id, int.Parse(model.F_State.ToString()), deptname + userModel.F_UserName + "修改工单", 0, 0, "", 0, userModel, 1);
|
|
|
1120
|
+ AddLog(model.F_Id, int.Parse(model.F_State.ToString()), input .F_Content, 0, 12, input .F_CallId , 0, userModel, 1);
|
|
|
1121
|
+
|
|
|
1122
|
+ return Success("修改成功!");
|
|
|
1123
|
+
|
|
|
1124
|
+ }
|
|
|
1125
|
+ else
|
|
|
1126
|
+ return Error("修改失败!");
|
|
|
1127
|
+ }
|
|
|
1128
|
+ return NoToken("未知错误,请重新登录");
|
|
|
1129
|
+ }
|
|
|
1130
|
+ private class workordercall
|
|
|
1131
|
+ {
|
|
|
1132
|
+
|
|
|
1133
|
+ public Model.T_Call_CallRecords CallRecords;
|
|
|
1134
|
+ public string F_Remark;
|
|
|
1135
|
+ public string CusDepName;
|
|
|
1136
|
+ }
|
|
|
1137
|
+ public ActionResult GetCallRecords(int id)
|
|
|
1138
|
+ {
|
|
|
1139
|
+ int userId = CurrentUser.UserData.F_UserId;
|
|
|
1140
|
+ if (userId != 0)
|
|
|
1141
|
+ {
|
|
|
1142
|
+ DataTable dt = new DataTable();
|
|
|
1143
|
+ string sql = "";
|
|
|
1144
|
+ string msg = "";
|
|
|
1145
|
+ if (id <= 0)
|
|
|
1146
|
+ return Error("请输入正确的id");
|
|
|
1147
|
+ sql += " and F_WoID=" + id + "and F_OptType =12";
|
|
|
1148
|
+ int recordCount = 0;
|
|
|
1149
|
+
|
|
|
1150
|
+ var modellist = new BLL.T_Wo_WorkOrderItem_New().GetModelList("F_WoID=" + id + "and F_OptType =12");
|
|
|
1151
|
+ List<workordercall> calls = new List<workordercall>();
|
|
|
1152
|
+ if (modellist != null)
|
|
|
1153
|
+ {
|
|
|
1154
|
+ foreach (var it in modellist)
|
|
|
1155
|
+ {
|
|
|
1156
|
+ workordercall workordercalls = new workordercall();
|
|
|
1157
|
+ if (!string.IsNullOrEmpty(it.F_NextUser))
|
|
|
1158
|
+ {
|
|
|
1159
|
+ var callrecords = new BLL.T_Call_CallRecords().GetModel(it.F_NextUser);
|
|
|
1160
|
+ if (callrecords != null)
|
|
|
1161
|
+ {
|
|
|
1162
|
+ workordercalls.CallRecords = callrecords;
|
|
|
1163
|
+ }
|
|
|
1164
|
+
|
|
|
1165
|
+ }
|
|
|
1166
|
+ workordercalls.F_Remark = it.F_OptContent;
|
|
|
1167
|
+ calls.Add(workordercalls);
|
|
|
1168
|
+ }
|
|
|
1169
|
+ }
|
|
|
1170
|
+ else
|
|
|
1171
|
+ {
|
|
|
1172
|
+ return Success("暂无工单记录"); ;
|
|
|
1173
|
+ }
|
|
|
1174
|
+ var obj = new
|
|
|
1175
|
+ {
|
|
|
1176
|
+ rows = calls.Select(x => new
|
|
|
1177
|
+ {
|
|
|
1178
|
+ CallNumber = x.CallRecords.CallNumber,
|
|
|
1179
|
+ FilePath = x.CallRecords.FilePath,
|
|
|
1180
|
+ CallType = x.CallRecords.CallType,
|
|
|
1181
|
+ DealType = x.CallRecords.DealType,
|
|
|
1182
|
+
|
|
|
1183
|
+ CallState = x.CallRecords.CallState,
|
|
|
1184
|
+ UserCode = x.CallRecords.UserCode,
|
|
|
1185
|
+ UserName = x.CallRecords.UserName,
|
|
|
1186
|
+ BeginTime = x.CallRecords.BeginTime,
|
|
|
1187
|
+ TalkStartTime = x.CallRecords.TalkStartTime,
|
|
|
1188
|
+ TalkEndTime = x.CallRecords.TalkEndTime,
|
|
|
1189
|
+ TalkLongTime = x.CallRecords.TalkLongTime,
|
|
|
1190
|
+ F_OptContent = x.F_Remark
|
|
|
1191
|
+
|
|
|
1192
|
+ }),
|
|
|
1193
|
+ total = calls.Count
|
|
|
1194
|
+ };
|
|
|
1195
|
+
|
|
|
1196
|
+ return Content(obj.ToJson());
|
|
|
1197
|
+ }
|
|
|
1198
|
+
|
|
|
1199
|
+
|
|
|
1200
|
+ {
|
|
|
1201
|
+ return Error("无操作权限!");
|
|
|
1202
|
+ }
|
|
|
1203
|
+
|
|
|
1204
|
+ }
|
|
|
1205
|
+
|
|
|
1206
|
+ /// <summary>
|
|
902
|
1207
|
/// 修改工单
|
|
903
|
1208
|
/// </summary>
|
|
904
|
1209
|
/// <param name="input"></param>
|
|
|
@@ -937,6 +1242,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
937
|
1242
|
var model = workorderBLL.GetModel(input.F_Id);
|
|
938
|
1243
|
if (model == null)
|
|
939
|
1244
|
return Error("查询不到此工单!");
|
|
|
1245
|
+ input.F_Duplicate = model .F_Duplicate;
|
|
940
|
1246
|
model = inputtoobj(model, input, 1);
|
|
941
|
1247
|
bool n = workorderBLL.Update(model);
|
|
942
|
1248
|
if (n)
|
|
|
@@ -1127,7 +1433,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
1127
|
1433
|
/// </summary>
|
|
1128
|
1434
|
/// <returns></returns>
|
|
1129
|
1435
|
[Authority]
|
|
1130
|
|
- public ActionResult DealWorkOrder(int id, string cont, int isover = 0)
|
|
|
1436
|
+ public ActionResult DealWorkOrder(int id, string F_Files, string cont, int isover = 0)
|
|
1131
|
1437
|
{
|
|
1132
|
1438
|
if (Request.IsAuthenticated)
|
|
1133
|
1439
|
{
|
|
|
@@ -1140,7 +1446,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
1140
|
1446
|
Model.T_Bus_WorkOrder model = workorderBLL.GetModel(id);
|
|
1141
|
1447
|
if (model != null)
|
|
1142
|
1448
|
{
|
|
1143
|
|
- var res = DealWO(ua, model, cont, isover);
|
|
|
1449
|
+ var res = DealWO(ua, model, cont, F_Files, isover);
|
|
1144
|
1450
|
if (res)
|
|
1145
|
1451
|
return Success("处理成功");
|
|
1146
|
1452
|
else
|
|
|
@@ -1258,6 +1564,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
1258
|
1564
|
{
|
|
1259
|
1565
|
model.F_Officeid = F_Officeid;
|
|
1260
|
1566
|
model.F_Largeareaid = F_Largeareaid;
|
|
|
1567
|
+ model.F_Notifications = creatuser;//通知人
|
|
1261
|
1568
|
model.F_State = wostate;
|
|
1262
|
1569
|
if (!string.IsNullOrEmpty(model.F_Returnnote))
|
|
1263
|
1570
|
model.F_Returnnote += "," + cont;
|
|
|
@@ -1274,7 +1581,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
1274
|
1581
|
/// <summary>
|
|
1275
|
1582
|
/// 处理工单
|
|
1276
|
1583
|
/// </summary>
|
|
1277
|
|
- public bool DealWO(Model.T_Sys_UserAccount nowUser, Model.T_Bus_WorkOrder model, string cont, int isover = 0)
|
|
|
1584
|
+ public bool DealWO(Model.T_Sys_UserAccount nowUser, Model.T_Bus_WorkOrder model, string cont, string F_Files, int isover = 0)
|
|
1278
|
1585
|
{
|
|
1279
|
1586
|
#region 工单处理
|
|
1280
|
1587
|
var opt = "处理";
|
|
|
@@ -1314,6 +1621,13 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
1314
|
1621
|
{
|
|
1315
|
1622
|
#region 处理工单
|
|
1316
|
1623
|
model.F_State = wostate;
|
|
|
1624
|
+ if (!string.IsNullOrEmpty(F_Files))
|
|
|
1625
|
+ {
|
|
|
1626
|
+ if (!string.IsNullOrEmpty(model.F_DealFile))
|
|
|
1627
|
+ model.F_DealFile = model.F_DealFile + "," + F_Files;
|
|
|
1628
|
+ else
|
|
|
1629
|
+ model.F_DealFile = F_Files;
|
|
|
1630
|
+ }
|
|
1317
|
1631
|
//处理内容
|
|
1318
|
1632
|
if (!string.IsNullOrEmpty(model.F_DealResult))
|
|
1319
|
1633
|
model.F_DealResult +=";" +cont ;
|
|
|
@@ -1329,6 +1643,41 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
1329
|
1643
|
#endregion
|
|
1330
|
1644
|
}
|
|
1331
|
1645
|
/// <summary>
|
|
|
1646
|
+ /// 减免工单
|
|
|
1647
|
+ /// </summary>
|
|
|
1648
|
+ /// <param name="orderid"></param>
|
|
|
1649
|
+ /// <param name="cont"></param>
|
|
|
1650
|
+ /// <returns></returns>
|
|
|
1651
|
+ public ActionResult Reduction(int id, int IsReduction=0)
|
|
|
1652
|
+ {
|
|
|
1653
|
+ if (Request.IsAuthenticated)
|
|
|
1654
|
+ {
|
|
|
1655
|
+ int userId = CurrentUser.UserData.F_UserId;
|
|
|
1656
|
+ if (userId != 0)
|
|
|
1657
|
+ {
|
|
|
1658
|
+ Model.T_Sys_UserAccount ua = userBLL.GetModel(userId);
|
|
|
1659
|
+ if (ua != null)
|
|
|
1660
|
+ {
|
|
|
1661
|
+ Model.T_Bus_WorkOrder model = workorderBLL.GetModel(id);
|
|
|
1662
|
+ //验证信息
|
|
|
1663
|
+ if (model != null)
|
|
|
1664
|
+ {
|
|
|
1665
|
+ if (IsReduction > 0)
|
|
|
1666
|
+ model.F_IsReduction = 1;
|
|
|
1667
|
+ var res = new BLL.T_Bus_WorkOrder().Update(model);
|
|
|
1668
|
+ if (res)
|
|
|
1669
|
+ return Success("减免成功");
|
|
|
1670
|
+ else
|
|
|
1671
|
+ return Error("减免失败!");
|
|
|
1672
|
+ }
|
|
|
1673
|
+ return Error("工单不存在");
|
|
|
1674
|
+ }
|
|
|
1675
|
+ }
|
|
|
1676
|
+ return Error("无操作权限");
|
|
|
1677
|
+ }
|
|
|
1678
|
+ return NoToken("未知错误,请重新登录");
|
|
|
1679
|
+ }
|
|
|
1680
|
+ /// <summary>
|
|
1332
|
1681
|
/// 标记工单
|
|
1333
|
1682
|
/// </summary>
|
|
1334
|
1683
|
/// <param name="orderid"></param>
|
|
|
@@ -1406,9 +1755,20 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
1406
|
1755
|
model.F_BatchNumber = input.F_BatchNumber;//产品编码
|
|
1407
|
1756
|
model.F_Manufacturer = input.F_Manufacturer;//生产厂家
|
|
1408
|
1757
|
model.F_ProblemCode = input.F_ProblemCode;//问题代码
|
|
|
1758
|
+
|
|
|
1759
|
+ if (!string .IsNullOrEmpty (input.F_CallId ))
|
|
|
1760
|
+ {
|
|
|
1761
|
+ model.F_CallId = input.F_CallId;//通话记录id
|
|
|
1762
|
+ //var modelRecord = new BLL.T_Call_CallRecords().GetModel(input.F_CallId);
|
|
|
1763
|
+ //if (modelRecord != null)
|
|
|
1764
|
+ // modelRecord.IsExitWorkOrder = true;
|
|
|
1765
|
+ //new BLL.T_Call_CallRecords().Update(modelRecord);
|
|
|
1766
|
+ }
|
|
|
1767
|
+ else
|
|
|
1768
|
+ model.F_CallId = model.F_CallId;//通话记录id
|
|
1409
|
1769
|
model.F_QualityProblem = input.F_QualityProblem;//质量问题
|
|
1410
|
1770
|
// model.F_ImplementationSituation = input.F_ImplementationSituation;//落实情况
|
|
1411
|
|
- model.F_Duplicate = 0;//是否重复工单0否1是
|
|
|
1771
|
+ model.F_Duplicate = input.F_Duplicate;//是否重复工单0否1是
|
|
1412
|
1772
|
model.F_Content = input.F_Content;//备注
|
|
1413
|
1773
|
#endregion
|
|
1414
|
1774
|
if (type == 1)
|
|
|
@@ -1422,6 +1782,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
1422
|
1782
|
model.F_ReceivingPerson = model.F_ReceivingPerson;//接听人
|
|
1423
|
1783
|
model.F_Notifications = model.F_Notifications;//通知人
|
|
1424
|
1784
|
model.F_Returnnote = model.F_Returnnote;//通知人
|
|
|
1785
|
+ model.F_IsReduction = model.F_IsReduction;
|
|
1425
|
1786
|
}
|
|
1426
|
1787
|
else
|
|
1427
|
1788
|
{
|
|
|
@@ -1429,6 +1790,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
1429
|
1790
|
model.F_Office = input.F_Office;//办事处
|
|
1430
|
1791
|
model.F_ReceivingPerson = usercode;//接听人
|
|
1431
|
1792
|
model.F_State = 0;//0
|
|
|
1793
|
+ model.F_IsReduction =0;
|
|
1432
|
1794
|
model.F_CreateUser = usercode;
|
|
1433
|
1795
|
model.F_CreateTime = DateTime.Now;//投诉时间
|
|
1434
|
1796
|
string strendtime = DateTime.Now.ToString("yyyy-MM") + "-01 00:00:00";
|