|
|
@@ -8,6 +8,7 @@ using System.Collections.Generic;
|
|
8
|
8
|
using System.Data;
|
|
9
|
9
|
using System.IO;
|
|
10
|
10
|
using System.Linq;
|
|
|
11
|
+using System.Threading.Tasks;
|
|
11
|
12
|
using System.Transactions;
|
|
12
|
13
|
using System.Web;
|
|
13
|
14
|
using System.Web.Mvc;
|
|
|
@@ -83,11 +84,11 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
83
|
84
|
string office,string officename, string endtime,string duplicatetime,string endduplicatetime,
|
|
84
|
85
|
string productType,string productDate, string batchNumber,string manufacturer,string problemCode,
|
|
85
|
86
|
string productName,string producttypes,string complaintType,string notifications,string keywords,
|
|
86
|
|
- string auditStartTime, string auditEndTime,
|
|
|
87
|
+ string auditStartTime, string auditEndTime,string dealStartTime, string dealEndTime,
|
|
87
|
88
|
string dealTimely,string ywy, string reviewNotes, string startdealtime, string enddealtime, int IsReduction=-1,
|
|
88
|
89
|
int CJ=0,int duplicate=-1, int see = 0, int source = 0, int type = 0, int state = -1, int pageindex = 1,
|
|
89
|
90
|
int pagesize = 10,int isdc=0,int istime=-1 , int reminder=-1, int incomplete = -1,int isdealfile=-1,
|
|
90
|
|
- int isreductions=0,int comprehensive=-1,int isManager=0, int reviewStatus = 0)
|
|
|
91
|
+ int isreductions=0,int comprehensive=-1,int isManager=0, int reviewStatus = 0,int isQuadratic=0)
|
|
91
|
92
|
{
|
|
92
|
93
|
int userId = CurrentUser.UserData.F_UserId; ;
|
|
93
|
94
|
if (userId != 0)
|
|
|
@@ -231,6 +232,20 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
231
|
232
|
{
|
|
232
|
233
|
sql += $" and F_AuditTime <='" + auditEndTime + "'";
|
|
233
|
234
|
}
|
|
|
235
|
+
|
|
|
236
|
+ if (!string.IsNullOrEmpty(dealStartTime))
|
|
|
237
|
+ {
|
|
|
238
|
+ sql += $" and F_DealTime >='" + dealStartTime + "'";
|
|
|
239
|
+ }
|
|
|
240
|
+
|
|
|
241
|
+ if (!string.IsNullOrEmpty(dealEndTime))
|
|
|
242
|
+ {
|
|
|
243
|
+ sql += $" and F_DealTime <='" + dealEndTime + "'";
|
|
|
244
|
+ }
|
|
|
245
|
+ if (isQuadratic > 0)
|
|
|
246
|
+ {
|
|
|
247
|
+ sql += $" and F_IsQuadratic ='1' ";
|
|
|
248
|
+ }
|
|
234
|
249
|
if (reminder==0)
|
|
235
|
250
|
{
|
|
236
|
251
|
sql += $" and c.F_DealType ='1' ";
|
|
|
@@ -268,6 +283,9 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
268
|
283
|
{
|
|
269
|
284
|
sql += $" and c.F_DealFile is not null and c.F_DealFile != '' ";
|
|
270
|
285
|
}
|
|
|
286
|
+
|
|
|
287
|
+
|
|
|
288
|
+
|
|
271
|
289
|
if (!string.IsNullOrEmpty(manufacturer))//生产厂家
|
|
272
|
290
|
{
|
|
273
|
291
|
string msg = "";
|
|
|
@@ -2363,8 +2381,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
2363
|
2381
|
{
|
|
2364
|
2382
|
if (Request.IsAuthenticated)
|
|
2365
|
2383
|
{
|
|
2366
|
|
- lock (_MyLock)
|
|
2367
|
|
- {
|
|
|
2384
|
+
|
|
2368
|
2385
|
#region
|
|
2369
|
2386
|
int userId = CurrentUser.UserData.F_UserId;
|
|
2370
|
2387
|
Model.T_Sys_UserAccount userModel = userBLL.GetModel(userId);
|
|
|
@@ -2481,11 +2498,9 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
2481
|
2498
|
{
|
|
2482
|
2499
|
Model.T_Bus_WorkOrder modlelist = new BLL.T_Bus_WorkOrder().GetModel(n);
|
|
2483
|
2500
|
|
|
2484
|
|
- var deptmodel = departmentBLL.GetModel(userModel.F_DeptId);
|
|
2485
|
|
- string deptname = "";
|
|
2486
|
|
- if (deptmodel != null)
|
|
2487
|
|
- deptname = deptmodel.F_DeptName;
|
|
2488
|
|
- AddLog(modlelist.F_Id, 0, deptname + userModel.F_UserName + "创建工单", 0, 0, "", 0, userModel);
|
|
|
2501
|
+
|
|
|
2502
|
+
|
|
|
2503
|
+ // AddLog(modlelist.F_Id, 0, deptname + userModel.F_UserName + "创建工单", 0, 0, "", 0, userModel);
|
|
2489
|
2504
|
if (isover > 0)
|
|
2490
|
2505
|
{
|
|
2491
|
2506
|
|
|
|
@@ -2494,7 +2509,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
2494
|
2509
|
|
|
2495
|
2510
|
if (model != null)
|
|
2496
|
2511
|
{
|
|
2497
|
|
- var res = DealWO(userModel, modlelist, cont, "", isover);
|
|
|
2512
|
+ var res = DealWO(userModel, modlelist, cont, "", isover,1);
|
|
2498
|
2513
|
if (res)
|
|
2499
|
2514
|
return Success("处理成功");
|
|
2500
|
2515
|
else
|
|
|
@@ -2508,7 +2523,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
2508
|
2523
|
{
|
|
2509
|
2524
|
if (clid == 0)
|
|
2510
|
2525
|
return Error("请选择提交人!");
|
|
2511
|
|
- bool t = AssignWO(userModel, modlelist, cont, 1, clid);
|
|
|
2526
|
+ bool t = AssignWO(userModel, modlelist, cont, 1, clid,1);
|
|
2512
|
2527
|
if (t)
|
|
2513
|
2528
|
{
|
|
2514
|
2529
|
|
|
|
@@ -2518,12 +2533,20 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
2518
|
2533
|
else
|
|
2519
|
2534
|
return Error("提交失败!");
|
|
2520
|
2535
|
}
|
|
|
2536
|
+ else
|
|
|
2537
|
+ {
|
|
|
2538
|
+ var deptmodel = departmentBLL.GetModel(userModel.F_DeptId);
|
|
|
2539
|
+ string deptname = "";
|
|
|
2540
|
+ if (deptmodel != null)
|
|
|
2541
|
+ deptname = deptmodel.F_DeptName;
|
|
|
2542
|
+ AddLog(modlelist.F_Id, 0, deptname + userModel.F_UserName + "创建工单", 0, 0, "", 0, userModel);
|
|
|
2543
|
+ }
|
|
2521
|
2544
|
return Success("添加成功!");
|
|
2522
|
2545
|
|
|
2523
|
2546
|
}
|
|
2524
|
2547
|
else
|
|
2525
|
2548
|
return Error("添加失败!");
|
|
2526
|
|
- }
|
|
|
2549
|
+
|
|
2527
|
2550
|
#endregion
|
|
2528
|
2551
|
}
|
|
2529
|
2552
|
|
|
|
@@ -3304,7 +3327,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
3304
|
3327
|
/// <summary>
|
|
3305
|
3328
|
/// 处理工单
|
|
3306
|
3329
|
/// </summary>
|
|
3307
|
|
- public bool DealWO(Model.T_Sys_UserAccount nowUser, Model.T_Bus_WorkOrder model, string cont, string F_Files, int isover = 0)
|
|
|
3330
|
+ public bool DealWO(Model.T_Sys_UserAccount nowUser, Model.T_Bus_WorkOrder model, string cont, string F_Files
|
|
|
3331
|
+ , int isover = 0,int isCreate=0)
|
|
3308
|
3332
|
{
|
|
3309
|
3333
|
#region 工单处理
|
|
3310
|
3334
|
var opt = "处理";
|
|
|
@@ -3338,7 +3362,12 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
3338
|
3362
|
var optcont = "";
|
|
3339
|
3363
|
if (!string.IsNullOrEmpty(cont))
|
|
3340
|
3364
|
optcont = ",处理内容:" + cont;
|
|
|
3365
|
+ if (isCreate==1)
|
|
|
3366
|
+ {
|
|
|
3367
|
+ opt = "创建并" + opt;
|
|
|
3368
|
+ }
|
|
3341
|
3369
|
var content = deptname + nowUser.F_UserName + "(" + nowUser.F_UserCode + ")" + opt + "工单" + optcont;
|
|
|
3370
|
+
|
|
3342
|
3371
|
var itemid = AddLog(model.F_Id, wostate, content, 1, optbut, touser, deptid, nowUser);
|
|
3343
|
3372
|
if (itemid > 0)
|
|
3344
|
3373
|
{
|
|
|
@@ -3361,30 +3390,37 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
3361
|
3390
|
}
|
|
3362
|
3391
|
else
|
|
3363
|
3392
|
{
|
|
3364
|
|
- if(!string .IsNullOrEmpty(model.F_Manufacturer))
|
|
|
3393
|
+ Task task = Task.Run(() =>
|
|
3365
|
3394
|
{
|
|
3366
|
|
- var eqipment = new BLL.T_Sys_EquipmentNumber().GetModelList($"F_Production='{model.F_Manufacturer}' and F_IsDelete=0 ");
|
|
3367
|
|
- if (eqipment!=null&& eqipment.Count>0)
|
|
|
3395
|
+ if (!string.IsNullOrEmpty(model.F_Manufacturer))
|
|
3368
|
3396
|
{
|
|
3369
|
|
- if (!string.IsNullOrEmpty(eqipment.FirstOrDefault().F_Manager))
|
|
|
3397
|
+ var eqipment = new BLL.T_Sys_EquipmentNumber().GetModelList($"F_Production='{model.F_Manufacturer}' and F_IsDelete=0 ");
|
|
|
3398
|
+ if (eqipment != null && eqipment.Count > 0)
|
|
3370
|
3399
|
{
|
|
3371
|
|
- foreach (var it in eqipment.FirstOrDefault().F_Manager.Split(','))
|
|
|
3400
|
+ if (!string.IsNullOrEmpty(eqipment.FirstOrDefault().F_Manager))
|
|
3372
|
3401
|
{
|
|
3373
|
|
- new PushMessageController().
|
|
3374
|
|
- PushFeiShui(model, "工单处理提醒", "您负责的工厂工单已处理",
|
|
3375
|
|
- it, model.F_Id);
|
|
|
3402
|
+ foreach (var it in eqipment.FirstOrDefault().F_Manager.Split(','))
|
|
|
3403
|
+ {
|
|
|
3404
|
+ new PushMessageController().
|
|
|
3405
|
+ PushFeiShui(model, "工单处理提醒", "您负责的工厂工单已处理",
|
|
|
3406
|
+ it, model.F_Id);
|
|
|
3407
|
+ }
|
|
3376
|
3408
|
}
|
|
3377
|
3409
|
}
|
|
|
3410
|
+
|
|
3378
|
3411
|
}
|
|
3379
|
|
-
|
|
3380
|
|
- }
|
|
3381
|
|
-
|
|
|
3412
|
+ });
|
|
|
3413
|
+
|
|
3382
|
3414
|
}
|
|
3383
|
3415
|
//处理内容
|
|
3384
|
3416
|
if (!string.IsNullOrEmpty(model.F_DealResult))
|
|
3385
|
3417
|
model.F_DealResult +=";" +cont ;
|
|
3386
|
3418
|
else
|
|
3387
|
3419
|
model.F_DealResult += cont ;
|
|
|
3420
|
+ if(model.F_ReviewStatus!=null&& model.F_ReviewStatus==2)
|
|
|
3421
|
+ {
|
|
|
3422
|
+ model.F_IsQuadratic = 1;
|
|
|
3423
|
+ }
|
|
3388
|
3424
|
model.F_DealTime = DateTime.Now;
|
|
3389
|
3425
|
workorderBLL.Update(model);
|
|
3390
|
3426
|
#endregion
|
|
|
@@ -3759,7 +3795,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
3759
|
3795
|
/// <summary>
|
|
3760
|
3796
|
/// 转派工单
|
|
3761
|
3797
|
/// </summary>
|
|
3762
|
|
- public bool AssignWO(Model.T_Sys_UserAccount nowUser, Model.T_Bus_WorkOrder model, string cont, int wostate, int clid = 0)
|
|
|
3798
|
+ public bool AssignWO(Model.T_Sys_UserAccount nowUser, Model.T_Bus_WorkOrder model, string cont, int wostate, int clid = 0,int isCreate=0)
|
|
3763
|
3799
|
{
|
|
3764
|
3800
|
string touser = ""; string tousername = "";
|
|
3765
|
3801
|
int deptid = 0;
|
|
|
@@ -3812,6 +3848,10 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
3812
|
3848
|
var optcont = "";
|
|
3813
|
3849
|
if (!string.IsNullOrEmpty(cont))
|
|
3814
|
3850
|
optcont = ",说明:" + cont;
|
|
|
3851
|
+ if (isCreate == 1)
|
|
|
3852
|
+ {
|
|
|
3853
|
+ opt = "创建并" + opt;
|
|
|
3854
|
+ }
|
|
3815
|
3855
|
var content = nowUser.F_UserName + "(" + nowUser.F_UserCode + ")" + opt + "工单给 "+deptname + tousername + optcont;
|
|
3816
|
3856
|
var itemid = AddLog(model.F_Id, wostate, content, 1, optbut, touser, deptid, nowUser);
|
|
3817
|
3857
|
if (itemid > 0)
|