|
|
@@ -78,24 +78,35 @@ 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 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 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
|
86
|
string sql = $" F_IsDelete=0";
|
|
|
87
|
+ sql += "and F_Duplicate!=5";
|
|
|
88
|
+ string where = "";
|
|
|
89
|
+ bool duplica = false;
|
|
87
|
90
|
DataTable dt = new DataTable();
|
|
88
|
91
|
#region 筛选条件
|
|
89
|
|
- if (type > 0 && type < 5)//工单类型
|
|
90
|
|
- sql += $" and F_Type=" + type;
|
|
|
92
|
+ if (type > 0 && type < 4)//工单类型
|
|
|
93
|
+ {
|
|
|
94
|
+ if (type == 1)
|
|
|
95
|
+ sql += $" and (F_Type=" + type + "or F_Duplicate in(1))";
|
|
|
96
|
+ else if (type == 2)
|
|
|
97
|
+ sql += $" and (F_Type=" + type + "or (F_Duplicate in(2,0)and F_Type=3))";
|
|
|
98
|
+ else
|
|
|
99
|
+ sql += $" and F_Type=" + type;
|
|
|
100
|
+ }
|
|
|
101
|
+
|
|
91
|
102
|
if (source > 0)//工单来源
|
|
92
|
103
|
sql += $" and F_Source=" + source;
|
|
93
|
104
|
if (area > 0)//大区
|
|
94
|
105
|
sql += $" and F_Area=" + area;
|
|
95
|
106
|
if (office > 0)//办事处
|
|
96
|
107
|
sql += $" and F_Office=" + office;
|
|
97
|
|
- if (duplicate >= 0)//办事处
|
|
98
|
|
- sql += $" and F_Duplicate=" + duplicate;
|
|
|
108
|
+ if (duplicate >= 0)
|
|
|
109
|
+ sql += $" and F_Type=" + 3;
|
|
99
|
110
|
if (!string.IsNullOrWhiteSpace(productType))//产品代码
|
|
100
|
111
|
sql += $" and F_ProductType = '" + productType.Trim() + "'";
|
|
101
|
112
|
if (!string.IsNullOrWhiteSpace(productDate))//生产日期
|
|
|
@@ -114,6 +125,23 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
114
|
125
|
sql += " and datediff(day,F_CreateTime,'" + starttime + "')<=0 ";
|
|
115
|
126
|
if (!string.IsNullOrEmpty(endtime))
|
|
116
|
127
|
sql += " and datediff(day,F_CreateTime,'" + endtime + "')>=0 ";
|
|
|
128
|
+
|
|
|
129
|
+
|
|
|
130
|
+ if (!string.IsNullOrEmpty(duplicatetime))
|
|
|
131
|
+ {
|
|
|
132
|
+
|
|
|
133
|
+ duplica = true;
|
|
|
134
|
+ sql += $" and F_Type=" + 3;
|
|
|
135
|
+ where += " and datediff(day,F_CreateTime,'" + duplicatetime + "')<=0 ";
|
|
|
136
|
+ }
|
|
|
137
|
+ if (!string.IsNullOrEmpty(endduplicatetime))
|
|
|
138
|
+ {
|
|
|
139
|
+ duplica = true;
|
|
|
140
|
+ sql += $" and F_Type=" + 3;
|
|
|
141
|
+ where += " and datediff(day,F_CreateTime,'" + endduplicatetime + "')>=0 ";
|
|
|
142
|
+ }
|
|
|
143
|
+
|
|
|
144
|
+
|
|
117
|
145
|
if (!string.IsNullOrWhiteSpace(keywords))//关键字搜索
|
|
118
|
146
|
sql += $" and ( F_CusName like '%" + keywords.Trim() + "%'or F_CusPhone like '%" + keywords.Trim() + "%' ) ";
|
|
119
|
147
|
if (!string.IsNullOrWhiteSpace(code))//工单编号
|
|
|
@@ -191,6 +219,13 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
191
|
219
|
break;
|
|
192
|
220
|
}
|
|
193
|
221
|
}
|
|
|
222
|
+ if (duplica)
|
|
|
223
|
+ {
|
|
|
224
|
+ if (GetDuplica(where) != null)
|
|
|
225
|
+ sql += "AND F_Id in(" + GetDuplica(where) + ")";
|
|
|
226
|
+ else
|
|
|
227
|
+ return Success("暂无工单");
|
|
|
228
|
+ }
|
|
194
|
229
|
#endregion
|
|
195
|
230
|
string str = "";
|
|
196
|
231
|
string sql1 = "";
|
|
|
@@ -253,7 +288,9 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
253
|
288
|
drNew["通知人"] = it.F_Notifications;
|
|
254
|
289
|
drNew["接听人"] = it.F_ReceivingPerson;
|
|
255
|
290
|
drNew["落实情况"] = it.F_ImplementationSituation;
|
|
256
|
|
- drNew["重复投诉日期"] = it.F_CreateTime;
|
|
|
291
|
+ var itemlast = itembll.GetModelList(" isnull(F_IsUsed,'0')='1' and F_ItemType=" + 11 + " and F_WoID=" + it.F_Id + " ").FirstOrDefault ();
|
|
|
292
|
+ if (itemlast!=null )
|
|
|
293
|
+ drNew["重复投诉日期"] = itemlast.F_CreateTime ;
|
|
257
|
294
|
dt.Rows.Add(drNew);
|
|
258
|
295
|
#endregion
|
|
259
|
296
|
}
|
|
|
@@ -293,7 +330,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
293
|
330
|
dt.Columns.Add("落实情况");
|
|
294
|
331
|
dt.Columns.Add("处理进度");
|
|
295
|
332
|
dt.Columns.Add("工单类别");
|
|
296
|
|
- dt.Columns.Add("重复工单");
|
|
|
333
|
+
|
|
297
|
334
|
#endregion
|
|
298
|
335
|
foreach (var it in depts)
|
|
299
|
336
|
{
|
|
|
@@ -326,7 +363,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
326
|
363
|
drNew["办事处"] = "";
|
|
327
|
364
|
}
|
|
328
|
365
|
}
|
|
329
|
|
- drNew["投诉时间"] = DateTime.Parse(it.F_CreateTime.ToString()).ToString("dd日HH时mm分");//
|
|
|
366
|
+ drNew["投诉时间"] = DateTime.Parse(it.F_CreateTime.ToString()).ToString("yyyy年MM月dd日HH时mm分");//
|
|
330
|
367
|
drNew["序号"] = it.F_SerialNumber;//
|
|
331
|
368
|
drNew["姓名"] = it.F_CusName;//姓名
|
|
332
|
369
|
drNew["地址"] = it.F_AddRess;//地址
|
|
|
@@ -375,12 +412,10 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
375
|
412
|
drNew["处理进度"] = "已完结";
|
|
376
|
413
|
if (it .F_Type==1)
|
|
377
|
414
|
drNew["工单类别"] = "咨询";
|
|
378
|
|
- else
|
|
|
415
|
+ else if(it.F_Type == 2)
|
|
379
|
416
|
drNew["工单类别"] = "投诉";
|
|
380
|
|
- if (it .F_Duplicate==0)
|
|
381
|
|
- drNew["重复工单"] = "未重复";
|
|
382
|
|
- else
|
|
383
|
|
- drNew["重复工单"] = "重复";
|
|
|
417
|
+ else
|
|
|
418
|
+ drNew["工单类别"] = "重复";
|
|
384
|
419
|
dt.Rows.Add(drNew);
|
|
385
|
420
|
#endregion
|
|
386
|
421
|
}
|
|
|
@@ -407,7 +442,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
407
|
442
|
"F_Id",
|
|
408
|
443
|
"*",
|
|
409
|
444
|
sql,
|
|
410
|
|
- "ORDER BY T_Bus_WorkOrder.F_Id desc",
|
|
|
445
|
+ "ORDER BY T_Bus_WorkOrder.F_CreateTime desc",
|
|
411
|
446
|
pagesize,
|
|
412
|
447
|
pageindex,
|
|
413
|
448
|
true,
|
|
|
@@ -529,7 +564,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
529
|
564
|
model.F_OfficName = it.F_Office;
|
|
530
|
565
|
}
|
|
531
|
566
|
}
|
|
532
|
|
- model.F_CreateTime = DateTime .Parse (it.F_CreateTime.ToString ()).ToString ("dd日HH时mm分") ;//投诉时间
|
|
|
567
|
+ model.F_CreateTime = DateTime .Parse (it.F_CreateTime.ToString ()).ToString ("yyyy年MM月dd日HH时mm分") ;//投诉时间
|
|
533
|
568
|
model.F_DealTimely = it.F_DealTimely;//重要级别
|
|
534
|
569
|
model.F_Reason = it.F_Reason;//重要级别原因
|
|
535
|
570
|
model.F_SerialNumber = it.F_SerialNumber;//序号
|
|
|
@@ -577,6 +612,17 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
577
|
612
|
return Input;
|
|
578
|
613
|
}
|
|
579
|
614
|
/// <summary>
|
|
|
615
|
+ /// 获取高层审批
|
|
|
616
|
+ /// </summary>
|
|
|
617
|
+ /// <param name="user"></param>
|
|
|
618
|
+ /// <returns></returns>
|
|
|
619
|
+ public string GetDuplica(string time)
|
|
|
620
|
+ {
|
|
|
621
|
+ string str = string.Empty;
|
|
|
622
|
+ str = "select F_WoID from T_Wo_WorkOrderItem_New where F_ItemType=" + 11 + time;
|
|
|
623
|
+ return str;
|
|
|
624
|
+ }
|
|
|
625
|
+ /// <summary>
|
|
580
|
626
|
/// 注解
|
|
581
|
627
|
/// </summary>
|
|
582
|
628
|
/// <param name="orderid"></param>
|
|
|
@@ -614,7 +660,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
614
|
660
|
return Error("无操作权限");
|
|
615
|
661
|
}
|
|
616
|
662
|
/// <summary>
|
|
617
|
|
- /// 注解
|
|
|
663
|
+ /// 标记重复工单
|
|
618
|
664
|
/// </summary>
|
|
619
|
665
|
/// <param name="orderid"></param>
|
|
620
|
666
|
/// <param name="cont"></param>
|
|
|
@@ -639,12 +685,13 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
639
|
685
|
{
|
|
640
|
686
|
if (isbj==1)
|
|
641
|
687
|
{
|
|
642
|
|
- model.F_Duplicate = 1;
|
|
|
688
|
+ model.F_Duplicate = model.F_Type;
|
|
|
689
|
+ model.F_Type = 3;
|
|
643
|
690
|
}
|
|
644
|
691
|
var res = workorderBLL.Update(model);
|
|
645
|
692
|
if (res)
|
|
646
|
693
|
{
|
|
647
|
|
- AddLog(model.F_Id, (int)model.F_State , deptname + ua.F_UserName + "标记重复工单", 0, 0, "",0 ,ua,1);
|
|
|
694
|
+ AddLog(model.F_Id, (int)model.F_State , deptname + ua.F_UserName + "标记重复工单", 11, 11, "",0 ,ua,1);
|
|
648
|
695
|
return Success("标记重复成功");
|
|
649
|
696
|
}
|
|
650
|
697
|
|
|
|
@@ -737,7 +784,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
737
|
784
|
{
|
|
738
|
785
|
int userId = CurrentUser.UserData.F_UserId;
|
|
739
|
786
|
Model.T_Sys_UserAccount userModel = userBLL.GetModel(userId);
|
|
740
|
|
- if (!(input.F_Type > 0 && input.F_Type < 3))
|
|
|
787
|
+ if (!(input.F_Type > 0 && input.F_Type < 4))
|
|
741
|
788
|
return Error("工单类型错误!");
|
|
742
|
789
|
if (string.IsNullOrEmpty(input.F_CusName))
|
|
743
|
790
|
return Error("请输入来电人姓名!");
|
|
|
@@ -802,7 +849,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
802
|
849
|
Model.T_Sys_UserAccount userModel = userBLL.GetModel(userId);
|
|
803
|
850
|
if (input.F_Id <= 0)
|
|
804
|
851
|
return Error("参数错误!");
|
|
805
|
|
- if (!(input.F_Type > 0 && input.F_Type < 3))
|
|
|
852
|
+ if (!(input.F_Type > 0 && input.F_Type < 4))
|
|
806
|
853
|
return Error("工单类型错误!");
|
|
807
|
854
|
if (string.IsNullOrEmpty(input.F_CusName))
|
|
808
|
855
|
return Error("请输入来电人姓名!");
|
|
|
@@ -869,8 +916,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
869
|
916
|
|
|
870
|
917
|
if (!string.IsNullOrEmpty(idd.Trim()))
|
|
871
|
918
|
{
|
|
872
|
|
- if (itembll.DeleteList(idd.TrimEnd(',')))
|
|
873
|
|
- {
|
|
|
919
|
+
|
|
874
|
920
|
if (workorderBLL.DeleteList(idd.TrimEnd(',')))
|
|
875
|
921
|
{
|
|
876
|
922
|
|
|
|
@@ -881,11 +927,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
881
|
927
|
{
|
|
882
|
928
|
return Error("设置失败");
|
|
883
|
929
|
}
|
|
884
|
|
- }
|
|
885
|
|
- else
|
|
886
|
|
- {
|
|
887
|
|
- return Error("设置失败");
|
|
888
|
|
- }
|
|
|
930
|
+
|
|
889
|
931
|
|
|
890
|
932
|
}
|
|
891
|
933
|
else
|
|
|
@@ -1288,7 +1330,10 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
1288
|
1330
|
model.F_Type = input.F_Type;//工单类型1咨询2投诉
|
|
1289
|
1331
|
model.F_Area = input.F_Area;//大区
|
|
1290
|
1332
|
model.F_Office = input.F_Office;//办事处
|
|
1291
|
|
- model.F_DealTimely = input.F_DealTimely;// 重要级别1红色2绿色3普通工单
|
|
|
1333
|
+ if (!string.IsNullOrEmpty(input.F_DealTimely))
|
|
|
1334
|
+ model.F_DealTimely = input.F_DealTimely;// 重要级别1红色2绿色3普通工单
|
|
|
1335
|
+ else
|
|
|
1336
|
+ model.F_DealTimely = "普通工单";
|
|
1292
|
1337
|
model.F_Reason = input.F_Reason;// 重要级别原因
|
|
1293
|
1338
|
model.F_CusName = input.F_CusName;//来电人姓名
|
|
1294
|
1339
|
model.F_CusPhone = input.F_CusPhone;//来电人电话
|
|
|
@@ -1302,7 +1347,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
1302
|
1347
|
model.F_ProblemCode = input.F_ProblemCode;//问题代码
|
|
1303
|
1348
|
model.F_QualityProblem = input.F_QualityProblem;//质量问题
|
|
1304
|
1349
|
// model.F_ImplementationSituation = input.F_ImplementationSituation;//落实情况
|
|
1305
|
|
- model.F_Duplicate = input.F_Duplicate;//是否重复工单0否1是
|
|
|
1350
|
+ model.F_Duplicate = 0;//是否重复工单0否1是
|
|
1306
|
1351
|
model.F_Content = input.F_Content;//备注
|
|
1307
|
1352
|
#endregion
|
|
1308
|
1353
|
if (type == 1)
|