|
|
@@ -107,7 +107,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
107
|
107
|
dt = BLL.PagerBLL.GetListPager(
|
|
108
|
108
|
"T_Wo_WorkOrder",
|
|
109
|
109
|
"F_ID",
|
|
110
|
|
- "*,dbo.GetUserName(F_CreateBy) as F_CreateByName",
|
|
|
110
|
+ "*",
|
|
111
|
111
|
sql,
|
|
112
|
112
|
"ORDER BY T_Wo_WorkOrder.F_ID desc",
|
|
113
|
113
|
pagesize,
|
|
|
@@ -264,6 +264,23 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
264
|
264
|
return str;
|
|
265
|
265
|
}
|
|
266
|
266
|
/// <summary>
|
|
|
267
|
+ /// 根据部门获取工单号
|
|
|
268
|
+ /// </summary>
|
|
|
269
|
+ /// <returns></returns>
|
|
|
270
|
+ public string GetDeptWorkOrderID(string user)
|
|
|
271
|
+ {
|
|
|
272
|
+ string str = string.Empty;
|
|
|
273
|
+
|
|
|
274
|
+ str = "select F_WoID from T_Wo_WorkOrderItem_New where F_ItemType in(" + (int)EnumItemType.deal + "," + (int)EnumItemType.urge +")"
|
|
|
275
|
+ + " and ("
|
|
|
276
|
+ + "(F_WoState in(" + (int)EnumWorkOrderState.dealing + "," + (int)EnumWorkOrderState.receive + "," +
|
|
|
277
|
+ (int)EnumWorkOrderState.assign + "," + (int)EnumWorkOrderState.reback + "," + (int)EnumWorkOrderState.abreback + ")"
|
|
|
278
|
+ + "(F_NextDept in(" + user+ ")"
|
|
|
279
|
+ + " and isnull(F_IsUsed,'0')='0' ";
|
|
|
280
|
+
|
|
|
281
|
+ return str;
|
|
|
282
|
+ }
|
|
|
283
|
+ /// <summary>
|
|
267
|
284
|
/// 获取待接单的工单编号
|
|
268
|
285
|
/// </summary>
|
|
269
|
286
|
/// <returns></returns>
|
|
|
@@ -352,7 +369,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
352
|
369
|
///综合查询列表
|
|
353
|
370
|
/// </summary>
|
|
354
|
371
|
public ActionResult GetComprehensive(string code, string cusname, string cusphone, string companyname, string province, string city,
|
|
355
|
|
- string country, string township, string touser, int source = 0, int type = 0, int state = 0, int pageindex = 1, int pagesize = 10)
|
|
|
372
|
+ string country, string township, string touser, int source = 0, int type = 0, int pageindex = 1, int pagesize = 10)
|
|
356
|
373
|
{
|
|
357
|
374
|
int userId = CurrentUser.UserData.F_UserId;
|
|
358
|
375
|
if (userId != 0)
|
|
|
@@ -362,8 +379,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
362
|
379
|
#region 筛选条件
|
|
363
|
380
|
if (type > 0 && type < 4)//工单类型
|
|
364
|
381
|
sql += $" and F_Type=" + type;
|
|
365
|
|
- if (state >= 0)//工单状态
|
|
366
|
|
- sql += $" and F_State=" + state;
|
|
|
382
|
+ // if (state >= 0)//工单状态
|
|
|
383
|
+ // sql += $" and F_State=" + state;
|
|
367
|
384
|
if (source > 0)//工单来源
|
|
368
|
385
|
sql += $" and F_Source=" + source;
|
|
369
|
386
|
if (!string.IsNullOrWhiteSpace(touser))//参与人
|
|
|
@@ -384,6 +401,14 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
384
|
401
|
sql += $" and F_IncidentCountry like '%" + country.Trim() + "%'";
|
|
385
|
402
|
if (!string.IsNullOrWhiteSpace(province))//乡
|
|
386
|
403
|
sql += $" and F_IncidentTownship like '%" + township.Trim() + "%'";
|
|
|
404
|
+ Model.T_Sys_UserAccount ua = sysUserAccountBll.GetModel(userId);
|
|
|
405
|
+ Model.T_Sys_RoleInfo ro = rolebll.GetModel(ua.F_RoleId);
|
|
|
406
|
+ if (ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "YWY")
|
|
|
407
|
+ {
|
|
|
408
|
+ sql += " and F_DealBy = '" + ua.F_UserCode + "' ";
|
|
|
409
|
+ }
|
|
|
410
|
+ sql += " and F_State in(" + (int)EnumWorkOrderState.dealing + "," + (int)EnumWorkOrderState.receive + "," + (int)EnumWorkOrderState.assign + "," + (int)EnumWorkOrderState.reback + "," + (int)EnumWorkOrderState.abreback + ")";
|
|
|
411
|
+ sql += $" and F_IsOver=" + 1;
|
|
387
|
412
|
#endregion
|
|
388
|
413
|
int recordCount = 0;
|
|
389
|
414
|
if (!string.IsNullOrWhiteSpace(sql))
|
|
|
@@ -392,9 +417,9 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
392
|
417
|
dt = BLL.PagerBLL.GetListPager(
|
|
393
|
418
|
"T_Wo_WorkOrder",
|
|
394
|
419
|
"F_ID",
|
|
395
|
|
- "*,dbo.GetUserName(F_CreateBy) as F_CreateByName",
|
|
|
420
|
+ "*",
|
|
396
|
421
|
sql,
|
|
397
|
|
- "ORDER BY F_CustomerId desc",
|
|
|
422
|
+ "ORDER BY T_Wo_WorkOrder.F_ID desc",
|
|
398
|
423
|
pagesize,
|
|
399
|
424
|
pageindex,
|
|
400
|
425
|
true,
|
|
|
@@ -404,8 +429,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
404
|
429
|
List<long> woid = new List<long>();
|
|
405
|
430
|
List<Model.T_Wo_WorkOrder> modlelist = new BLL.T_Wo_WorkOrder().DataTableToList(dt);
|
|
406
|
431
|
List<Model.T_Wo_WorkOrder> list = new List<Model.T_Wo_WorkOrder>();
|
|
407
|
|
- Model.T_Sys_UserAccount ua = sysUserAccountBll.GetModel(userId);
|
|
408
|
|
- Model.T_Sys_RoleInfo ro = rolebll.GetModel(ua.F_RoleId);
|
|
|
432
|
+
|
|
409
|
433
|
if (ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "YWY" )
|
|
410
|
434
|
{
|
|
411
|
435
|
if (modlelist.Count > 0)
|
|
|
@@ -522,18 +546,20 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
522
|
546
|
/// 查询超时工单列表
|
|
523
|
547
|
/// </summary>
|
|
524
|
548
|
public ActionResult GetOvertime(string code, string cusname, string cusphone, string companyname, string province, string city,
|
|
525
|
|
- string country, string township, string touser, int source = 0, int type = 0, int state = 0, int pageindex = 1, int pagesize = 10)
|
|
|
549
|
+ string country, string township, string touser, int source = 0, int type = 0,int pageindex = 1, int pagesize = 10)
|
|
526
|
550
|
{
|
|
527
|
551
|
int userId = CurrentUser.UserData.F_UserId;
|
|
528
|
552
|
if (userId != 0)
|
|
529
|
553
|
{
|
|
|
554
|
+ if (!Refresh())
|
|
|
555
|
+ {
|
|
|
556
|
+ return Error("查询失败");
|
|
|
557
|
+ }
|
|
530
|
558
|
string sql = $" and F_IsDelete=0";
|
|
531
|
559
|
DataTable dt = new DataTable();
|
|
532
|
560
|
#region 筛选条件
|
|
533
|
561
|
if (type > 0 && type < 4)//工单类型
|
|
534
|
562
|
sql += $" and F_Type=" + type;
|
|
535
|
|
- if (state >= 0)//工单状态
|
|
536
|
|
- sql += $" and F_State=" + state;
|
|
537
|
563
|
if (source > 0)//工单来源
|
|
538
|
564
|
sql += $" and F_Source=" + source;
|
|
539
|
565
|
if (!string.IsNullOrWhiteSpace(touser))//参与人
|
|
|
@@ -554,54 +580,22 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
554
|
580
|
sql += $" and F_IncidentCountry like '%" + country.Trim() + "%'";
|
|
555
|
581
|
if (!string.IsNullOrWhiteSpace(province))//乡
|
|
556
|
582
|
sql += $" and F_IncidentTownship like '%" + township.Trim() + "%'";
|
|
557
|
|
- #endregion
|
|
558
|
|
- int recordCount = 0;
|
|
559
|
|
- if (!string.IsNullOrWhiteSpace(sql))
|
|
560
|
|
- {
|
|
561
|
|
-
|
|
562
|
|
- dt = BLL.PagerBLL.GetListPager(
|
|
563
|
|
- "T_Wo_WorkOrder",
|
|
564
|
|
- "F_ID",
|
|
565
|
|
- "*,dbo.GetUserName(F_CreateBy) as F_CreateByName",
|
|
566
|
|
- sql,
|
|
567
|
|
- "ORDER BY F_CustomerId desc",
|
|
568
|
|
- pagesize,
|
|
569
|
|
- pageindex,
|
|
570
|
|
- true,
|
|
571
|
|
- out recordCount);
|
|
572
|
|
- }
|
|
573
|
|
- int total = 0;
|
|
574
|
|
- List<long> woid = new List<long>();
|
|
575
|
|
- List<Model.T_Wo_WorkOrder> modlelist = new BLL.T_Wo_WorkOrder().DataTableToList(dt);
|
|
576
|
|
- List<Model.T_Wo_WorkOrder> list = new List<Model.T_Wo_WorkOrder>();
|
|
|
583
|
+ sql += $" and F_State in(" + (int)EnumWorkOrderState.dealing + "," + (int)EnumWorkOrderState.receive + "," +
|
|
|
584
|
+ (int)EnumWorkOrderState.assign + "," + (int)EnumWorkOrderState.reback + "," + (int)EnumWorkOrderState.abreback + ")";
|
|
|
585
|
+ sql += $" and F_IsOver=" + 1;
|
|
577
|
586
|
Model.T_Sys_UserAccount ua = sysUserAccountBll.GetModel(userId);
|
|
578
|
587
|
Model.T_Sys_RoleInfo ro = rolebll.GetModel(ua.F_RoleId);
|
|
579
|
588
|
if (ro.F_RoleCode == "JDYPTZX" || ro.F_RoleCode == "YWY" || ro.F_RoleCode == "BLRY")
|
|
580
|
589
|
{
|
|
581
|
|
- if (modlelist.Count > 0)
|
|
582
|
|
- {
|
|
583
|
|
- foreach (var it in modlelist)
|
|
584
|
|
- {
|
|
585
|
|
- if (it.F_DealBy == ua.F_UserCode)
|
|
586
|
|
- {
|
|
587
|
|
- if (it.F_IsOver == 1)
|
|
588
|
|
- {
|
|
589
|
|
- list.Add(it);
|
|
590
|
|
- total++;
|
|
591
|
|
- }
|
|
592
|
|
- }
|
|
593
|
|
- }
|
|
594
|
|
- }
|
|
595
|
|
-
|
|
|
590
|
+ sql += " and F_DealBy = '" + ua.F_UserCode;
|
|
596
|
591
|
}
|
|
597
|
592
|
else if (ro.F_RoleCode == "DQJL" || ro.F_RoleCode == "FGSJL" || ro.F_RoleCode == "ZG")
|
|
598
|
593
|
{
|
|
599
|
|
- List<int> detpid = new List<int>();
|
|
|
594
|
+ string detpid = "";
|
|
600
|
595
|
var deparmentlist = new List<Model.T_Sys_Department>();
|
|
601
|
596
|
Model.T_Sys_Department dModel = departmentBLL.GetModel(ua.F_DeptId);
|
|
602
|
597
|
if (dModel != null)
|
|
603
|
598
|
{
|
|
604
|
|
-
|
|
605
|
599
|
if (dModel.F_Layer == 1)
|
|
606
|
600
|
{
|
|
607
|
601
|
deparmentlist = new BLL.T_Sys_Department().GetModelList(" F_State=1 and F_Layer=" + 2 + " and F_ParentId=" + dModel.F_DeptId);
|
|
|
@@ -609,44 +603,18 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
609
|
603
|
{
|
|
610
|
604
|
foreach (var it in deparmentlist)
|
|
611
|
605
|
{
|
|
612
|
|
- detpid.Add(it.F_DeptId);
|
|
613
|
|
-
|
|
614
|
|
- }
|
|
615
|
|
- }
|
|
616
|
|
- }
|
|
617
|
|
- detpid.Add(dModel.F_DeptId);
|
|
618
|
|
- var itemlast = itembll.GetModelList(" isnull(F_IsUsed,'0')='0' " + " ");
|
|
619
|
|
- if (itemlast.Count > 0)
|
|
620
|
|
- {
|
|
621
|
|
- foreach (var it in itemlast)
|
|
622
|
|
- {
|
|
623
|
|
- for (int i = 0; i < detpid.Count; i++)
|
|
624
|
|
- {
|
|
625
|
|
- if (it.F_NextDept == detpid[i])
|
|
|
606
|
+ if (detpid!="")
|
|
626
|
607
|
{
|
|
627
|
|
- woid.Add(it.F_WoID);
|
|
|
608
|
+ detpid += "," + it.F_DeptId;
|
|
628
|
609
|
}
|
|
629
|
610
|
}
|
|
630
|
611
|
}
|
|
631
|
612
|
}
|
|
632
|
|
- if (modlelist.Count > 0 && woid.Count > 0)
|
|
|
613
|
+ else
|
|
633
|
614
|
{
|
|
634
|
|
- foreach (var it in modlelist)
|
|
635
|
|
- {
|
|
636
|
|
- for (int i = 0; i < woid.Count; i++)
|
|
637
|
|
- {
|
|
638
|
|
- if (it.F_ID == woid[i])
|
|
639
|
|
- {
|
|
640
|
|
- if (it.F_IsOver == 1)
|
|
641
|
|
- {
|
|
642
|
|
- list.Add(it);
|
|
643
|
|
- total++;
|
|
644
|
|
- }
|
|
645
|
|
- }
|
|
646
|
|
- }
|
|
647
|
|
- }
|
|
|
615
|
+ detpid = ua.F_DeptId.ToString ();
|
|
648
|
616
|
}
|
|
649
|
|
-
|
|
|
617
|
+ sql += $" and T_Wo_WorkOrder.F_ID in ( " + GetDeptWorkOrderID(detpid) + ") ";
|
|
650
|
618
|
}
|
|
651
|
619
|
else
|
|
652
|
620
|
{
|
|
|
@@ -654,66 +622,90 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
654
|
622
|
}
|
|
655
|
623
|
}
|
|
656
|
624
|
else if (ro.F_RoleCode == "JDYBZZX")
|
|
657
|
|
- {
|
|
658
|
|
- if (modlelist.Count>0 )
|
|
659
|
|
- {
|
|
660
|
|
- foreach (var it in modlelist)
|
|
661
|
|
- {
|
|
662
|
|
-
|
|
663
|
|
- if (it.F_CreateBy ==ua .F_UserCode )
|
|
664
|
|
- {
|
|
665
|
|
- if (it.F_IsOver == 1)
|
|
666
|
|
- {
|
|
667
|
|
- list.Add(it);
|
|
668
|
|
- total++;
|
|
669
|
|
- }
|
|
670
|
|
- }
|
|
671
|
|
- }
|
|
672
|
|
- }
|
|
|
625
|
+ {
|
|
|
626
|
+ sql += $" and F_CreateBy like '%" + ua.F_UserCode.Trim() + "%'";
|
|
673
|
627
|
}
|
|
674
|
628
|
else if (ro.F_RoleCode == "QTJS")
|
|
675
|
629
|
{
|
|
676
|
630
|
return Error("无操作权限!");
|
|
677
|
631
|
}
|
|
678
|
|
- else
|
|
|
632
|
+ #endregion
|
|
|
633
|
+ int recordCount = 0;
|
|
|
634
|
+ if (!string.IsNullOrWhiteSpace(sql))
|
|
679
|
635
|
{
|
|
680
|
|
- if (modlelist.Count > 0)
|
|
681
|
|
- {
|
|
682
|
|
- foreach (var it in modlelist)
|
|
683
|
|
- {
|
|
684
|
|
- if (it.F_IsOver == 1)
|
|
685
|
|
- {
|
|
686
|
|
- list.Add(it);
|
|
687
|
|
- total++;
|
|
688
|
|
- }
|
|
689
|
|
- }
|
|
690
|
|
- }
|
|
|
636
|
+
|
|
|
637
|
+ dt = BLL.PagerBLL.GetListPager(
|
|
|
638
|
+ "T_Wo_WorkOrder",
|
|
|
639
|
+ "F_ID",
|
|
|
640
|
+ "*",
|
|
|
641
|
+ sql,
|
|
|
642
|
+ "ORDER BY T_Wo_WorkOrder.F_ID desc",
|
|
|
643
|
+ pagesize,
|
|
|
644
|
+ pageindex,
|
|
|
645
|
+ true,
|
|
|
646
|
+ out recordCount);
|
|
691
|
647
|
}
|
|
692
|
|
- if (list.Count > 0)
|
|
693
|
|
- {
|
|
694
|
|
- List<WorkOrderNewInput> Input = modeltooip(list);
|
|
695
|
|
- var obj = new
|
|
|
648
|
+ List<long> woid = new List<long>();
|
|
|
649
|
+ List<Model.T_Wo_WorkOrder> modlelist = new BLL.T_Wo_WorkOrder().DataTableToList(dt);
|
|
|
650
|
+ List<WorkOrderNewInput> Input = modeltooip(modlelist);
|
|
|
651
|
+ var obj = new
|
|
696
|
652
|
{
|
|
697
|
653
|
state = "success",
|
|
698
|
654
|
message = "成功",
|
|
699
|
655
|
rows = Input,
|
|
700
|
|
- total = total
|
|
|
656
|
+ total = recordCount
|
|
701
|
657
|
};
|
|
702
|
|
-
|
|
703
|
658
|
return Content(obj.ToJson()); ;
|
|
704
|
|
- }
|
|
705
|
|
- else
|
|
706
|
|
- {
|
|
707
|
|
-
|
|
708
|
|
- return Success("暂无工单"); ;
|
|
709
|
|
- }
|
|
710
|
659
|
}
|
|
711
|
660
|
else
|
|
712
|
661
|
{
|
|
713
|
662
|
return Error("无操作权限!");
|
|
714
|
663
|
}
|
|
715
|
664
|
}
|
|
716
|
|
-
|
|
|
665
|
+ /// <summary>
|
|
|
666
|
+ /// 工单导入
|
|
|
667
|
+ /// 导入excel
|
|
|
668
|
+ /// </summary>
|
|
|
669
|
+ public ActionResult ImportExcel()
|
|
|
670
|
+ {
|
|
|
671
|
+ return null;
|
|
|
672
|
+ }
|
|
|
673
|
+ /// <summary>
|
|
|
674
|
+ /// 更新工单
|
|
|
675
|
+ /// </summary>
|
|
|
676
|
+ private bool Refresh()
|
|
|
677
|
+ {
|
|
|
678
|
+ int type = 0;
|
|
|
679
|
+ var modlelist = workOrder .GetModelList(" F_IsDelete=0" + " and F_State in(" + (int)EnumWorkOrderState.dealing + "," + (int)EnumWorkOrderState.receive + "," +
|
|
|
680
|
+ (int)EnumWorkOrderState.assign + "," + (int)EnumWorkOrderState.reback + "," + (int)EnumWorkOrderState.abreback + ")");
|
|
|
681
|
+ if (modlelist.Count >0)
|
|
|
682
|
+ {
|
|
|
683
|
+ foreach (var it in modlelist )
|
|
|
684
|
+ {
|
|
|
685
|
+
|
|
|
686
|
+ if (TimeforOver(it.F_ID))
|
|
|
687
|
+ {
|
|
|
688
|
+ type = 0;
|
|
|
689
|
+ }
|
|
|
690
|
+ else
|
|
|
691
|
+ {
|
|
|
692
|
+ type = 1;
|
|
|
693
|
+ }
|
|
|
694
|
+ if (type != it .F_IsOver)
|
|
|
695
|
+ {
|
|
|
696
|
+ it.F_IsOver = type;
|
|
|
697
|
+ bool n = workOrder.Update(it);
|
|
|
698
|
+ if (!n )
|
|
|
699
|
+ {
|
|
|
700
|
+ return false;
|
|
|
701
|
+ }
|
|
|
702
|
+ }
|
|
|
703
|
+ }
|
|
|
704
|
+
|
|
|
705
|
+ }
|
|
|
706
|
+ return true;
|
|
|
707
|
+
|
|
|
708
|
+ }
|
|
717
|
709
|
/// <summary>
|
|
718
|
710
|
/// 获取催办工单列表
|
|
719
|
711
|
/// </summary>
|
|
|
@@ -725,7 +717,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
725
|
717
|
int userId = CurrentUser.UserData.F_UserId;
|
|
726
|
718
|
if (userId != 0)
|
|
727
|
719
|
{
|
|
728
|
|
- string sql = $" and F_IsDelete=0";
|
|
|
720
|
+ string sql = " and F_IsDelete=0 and F_State != " + (int)EnumWorkOrderState.finish;
|
|
|
721
|
+
|
|
729
|
722
|
DataTable dt = new DataTable();
|
|
730
|
723
|
#region 筛选条件
|
|
731
|
724
|
if (type > 0 && type < 4)//工单类型
|
|
|
@@ -760,7 +753,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
760
|
753
|
dt = BLL.PagerBLL.GetListPager(
|
|
761
|
754
|
"T_Wo_WorkOrder",
|
|
762
|
755
|
"F_ID",
|
|
763
|
|
- "*,dbo.GetUserName(F_CreateBy) as F_CreateByName",
|
|
|
756
|
+ "*",
|
|
764
|
757
|
sql,
|
|
765
|
758
|
"ORDER BY T_Wo_WorkOrder.F_ID desc",
|
|
766
|
759
|
pagesize,
|
|
|
@@ -1095,21 +1088,7 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
1095
|
1088
|
model.F_ZL_CApprovalNo = model1[i].F_ZL_CApprovalNo;//质量管理科-对应审批工作流单号
|
|
1096
|
1089
|
model.F_ZL_CJ_IsRecord = model1[i].F_ZL_CJ_IsRecord;//质量管理科-抽检-未备案、已备案
|
|
1097
|
1090
|
model.F_IsVisit = model1[i].F_IsVisit;//质量管理科-抽检-未备案、已备案
|
|
1098
|
|
- int type = 0;
|
|
1099
|
|
- if (TimeforOver(model1[i].F_ID))
|
|
1100
|
|
- {
|
|
1101
|
|
- type = 0;
|
|
1102
|
|
- }
|
|
1103
|
|
- else
|
|
1104
|
|
- {
|
|
1105
|
|
- type = 1;
|
|
1106
|
|
- }
|
|
1107
|
1091
|
model.RemainingTime = TimeToOver(model1[i].F_ID);
|
|
1108
|
|
- if (type != model1[i].F_IsOver)
|
|
1109
|
|
- {
|
|
1110
|
|
- model1[i].F_IsOver = type;
|
|
1111
|
|
- bool n = workOrder.Update(model1[i]);
|
|
1112
|
|
- }
|
|
1113
|
1092
|
model.F_IsOver = model1[i].F_IsOver;
|
|
1114
|
1093
|
#endregion
|
|
1115
|
1094
|
Input.Add(model);
|
|
|
@@ -1152,17 +1131,24 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
1152
|
1131
|
}
|
|
1153
|
1132
|
if (time2 != "")
|
|
1154
|
1133
|
{
|
|
1155
|
|
- if (x > y)
|
|
|
1134
|
+ if(time1 != "")
|
|
1156
|
1135
|
{
|
|
1157
|
|
- int a = (DateTime.Parse(time2) - DateTime.Parse(time1)).Hours;
|
|
1158
|
|
- int b = time - a;
|
|
|
1136
|
+ if (x > y)
|
|
|
1137
|
+ {
|
|
|
1138
|
+ int a = (DateTime.Parse(time2) - DateTime.Parse(time1)).Hours;
|
|
|
1139
|
+ int b = time - a;
|
|
|
1140
|
+ return b;
|
|
|
1141
|
+ }
|
|
|
1142
|
+ else
|
|
|
1143
|
+ {
|
|
|
1144
|
+ int a = (DateTime.Now - DateTime.Parse(time1)).Hours;
|
|
|
1145
|
+ int b = time - a;
|
|
1159
|
1146
|
return b;
|
|
|
1147
|
+ }
|
|
1160
|
1148
|
}
|
|
1161
|
1149
|
else
|
|
1162
|
1150
|
{
|
|
1163
|
|
- int a = (DateTime.Now - DateTime.Parse(time1)).Hours;
|
|
1164
|
|
- int b = time - a;
|
|
1165
|
|
- return b;
|
|
|
1151
|
+ return 0;
|
|
1166
|
1152
|
}
|
|
1167
|
1153
|
}
|
|
1168
|
1154
|
else if (time1 != "")
|
|
|
@@ -1213,21 +1199,28 @@ namespace CallCenterApi.Interface.Controllers.workorder
|
|
1213
|
1199
|
}
|
|
1214
|
1200
|
if (time2 != "")
|
|
1215
|
1201
|
{
|
|
1216
|
|
- if (x > y)
|
|
|
1202
|
+ if (time1 != "")
|
|
1217
|
1203
|
{
|
|
1218
|
|
- int a = (DateTime.Parse(time2) - DateTime.Parse(time1)).Hours;
|
|
1219
|
|
- if (a > time)
|
|
|
1204
|
+ if (x > y)
|
|
1220
|
1205
|
{
|
|
1221
|
|
- return false;
|
|
|
1206
|
+ int a = (DateTime.Parse(time2) - DateTime.Parse(time1)).Hours;
|
|
|
1207
|
+ if (a > time)
|
|
|
1208
|
+ {
|
|
|
1209
|
+ return false;
|
|
|
1210
|
+ }
|
|
|
1211
|
+ }
|
|
|
1212
|
+ else
|
|
|
1213
|
+ {
|
|
|
1214
|
+ int a = (DateTime.Now - DateTime.Parse(time1)).Hours;
|
|
|
1215
|
+ if (a > time)
|
|
|
1216
|
+ {
|
|
|
1217
|
+ return false;
|
|
|
1218
|
+ }
|
|
1222
|
1219
|
}
|
|
1223
|
1220
|
}
|
|
1224
|
1221
|
else
|
|
1225
|
1222
|
{
|
|
1226
|
|
- int a = (DateTime.Now - DateTime.Parse(time1)).Hours;
|
|
1227
|
|
- if (a > time)
|
|
1228
|
|
- {
|
|
1229
|
|
- return false;
|
|
1230
|
|
- }
|
|
|
1223
|
+ return true;
|
|
1231
|
1224
|
}
|
|
1232
|
1225
|
}
|
|
1233
|
1226
|
else if (time1 != "")
|