|
|
@@ -381,7 +381,7 @@ namespace CallCenterApi.Interface.Controllers
|
|
381
|
381
|
///// <returns></returns>
|
|
382
|
382
|
//public ActionResult GetTelRecordsTotal()
|
|
383
|
383
|
//{
|
|
384
|
|
-
|
|
|
384
|
+
|
|
385
|
385
|
// if (Request.IsAuthenticated)
|
|
386
|
386
|
// {
|
|
387
|
387
|
// int userId = CurrentUser.UserData.F_UserId;
|
|
|
@@ -397,7 +397,7 @@ namespace CallCenterApi.Interface.Controllers
|
|
397
|
397
|
// {
|
|
398
|
398
|
// uwhere += " and UserCode='" + userModel.F_UserCode + "' ";
|
|
399
|
399
|
// }
|
|
400
|
|
-
|
|
|
400
|
+
|
|
401
|
401
|
// if (!string.IsNullOrEmpty(userModel.groupcode))
|
|
402
|
402
|
// {
|
|
403
|
403
|
// uwhere += " and groupcode = '" + userModel.groupcode + "' ";
|
|
|
@@ -450,7 +450,7 @@ namespace CallCenterApi.Interface.Controllers
|
|
450
|
450
|
// daynocon = daynocon
|
|
451
|
451
|
// };
|
|
452
|
452
|
// return Success("成功", obj);
|
|
453
|
|
-
|
|
|
453
|
+
|
|
454
|
454
|
// }
|
|
455
|
455
|
// }
|
|
456
|
456
|
// return NoToken("未知错误,请重新登录");
|
|
|
@@ -462,95 +462,40 @@ namespace CallCenterApi.Interface.Controllers
|
|
462
|
462
|
/// <returns></returns>
|
|
463
|
463
|
public ActionResult GetWorkTotal()
|
|
464
|
464
|
{
|
|
465
|
|
-
|
|
466
|
|
- if (Request.IsAuthenticated)
|
|
467
|
|
- {
|
|
468
|
|
- int userId = CurrentUser.UserData.F_UserId;
|
|
469
|
|
- if (userId != 0)
|
|
470
|
|
- {
|
|
471
|
|
- Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
|
|
472
|
|
- if (userModel != null)
|
|
473
|
|
- {
|
|
474
|
|
- var date = DateTime.Now;//DateTime.Parse("2015-04-14"); //
|
|
475
|
|
- string strDate = date.ToString("yyyy-MM-dd");
|
|
476
|
|
- string strMonth = date.ToString("yyyy-MM");
|
|
477
|
|
-
|
|
478
|
|
- //BLL.T_Wo_WorkOrderBase bll = new BLL.T_Wo_WorkOrderBase();
|
|
479
|
|
- //var list1 = bll.GetList(" F_USERID='" + userId + "' and CONVERT(varchar(10),F_CREATEDATE, 23)='" + strDate + "' and F_WORKORDERSTATEID in (0,8) ").Tables[0];
|
|
480
|
|
- //var list2 = bll.GetList(" F_USERID='" + userId + "' and CONVERT(varchar(10),F_CREATEDATE, 23)='" + strDate + "' and F_WORKORDERSTATEID in (4,5,6,7,9,12,13) ").Tables[0];
|
|
481
|
|
- //var list3 = bll.GetList(" F_USERID='" + userId + "' and CONVERT(char(7),F_CREATEDATE,20)='" + strMonth + "' and F_WORKORDERSTATEID in (0,8) ").Tables[0];
|
|
482
|
|
- //var list4 = bll.GetList(" F_USERID='" + userId + "' and CONVERT(char(7),F_CREATEDATE,20)='" + strMonth + "' and F_WORKORDERSTATEID in (4,5,6,7,9,12,13) ").Tables[0];
|
|
483
|
|
-
|
|
484
|
|
- string uwhere = " 1=1 and F_State !=11 and F_Duplicate!=5 AND CONVERT(char(7),F_CreateTime,20) = '" + strMonth + "'"; ;
|
|
485
|
|
- if (userModel.rolecode != "XTGLY")
|
|
486
|
|
- {
|
|
487
|
|
- uwhere += " and F_CreateUser='" + userModel.F_UserCode + "' ";
|
|
488
|
|
- }
|
|
|
465
|
+ if (!Request.IsAuthenticated)
|
|
|
466
|
+ return NoToken("未知错误,请重新登录");
|
|
|
467
|
+ int userId = CurrentUser.UserData.F_UserId;
|
|
|
468
|
+ if (userId <= 0)
|
|
|
469
|
+ return Error("登陆信息失效");
|
|
|
470
|
+ Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
|
|
|
471
|
+ if (userModel == null)
|
|
|
472
|
+ return Error("当前用户信息不存在,请联系管理员!");
|
|
489
|
473
|
|
|
|
474
|
+ var date = DateTime.Now;
|
|
|
475
|
+ string strDate = date.ToString("yyyy-MM-dd");
|
|
|
476
|
+ string strMonth = date.ToString("yyyy-MM");
|
|
|
477
|
+ BLL.T_Rec_RegRecords bll = new BLL.T_Rec_RegRecords();
|
|
490
|
478
|
|
|
491
|
|
- //var list1 = bll.GetList(uwhere + " and CONVERT(varchar(10),CreateTime, 23)='" + strDate + "' and State =2 and IsDel=0 ").Tables[0];
|
|
492
|
|
- //var list2 = bll.GetList(uwhere + " and CONVERT(varchar(10),CreateTime, 23)='" + strDate + "' and State in (0,1) and IsDel=0 ").Tables[0];
|
|
493
|
|
- //var list3 = bll.GetList(uwhere + " and CONVERT(char(7),CreateTime,20)='" + strMonth + "' and State =2 and IsDel=0 ").Tables[0];
|
|
494
|
|
- //var list4 = bll.GetList(uwhere + " and CONVERT(char(7),CreateTime,20)='" + strMonth + "' and State in (0,1) and IsDel=0 ").Tables[0];
|
|
495
|
|
-
|
|
496
|
|
- //DataTable dtConnect = DbHelperSQL.Query("select CONVERT(varchar(10),F_CreateTime, 23) AS yearmonthdays,CONVERT(char(7),F_CreateTime,20) AS yearmonths,F_State,F_IsDelete,F_CreateTime,F_CreateUser FROM T_Bus_WorkOrder WITH(NOLOCK) where " + uwhere + "").Tables[0];
|
|
497
|
|
-
|
|
498
|
|
- //日已完成
|
|
499
|
|
- //int list1_count = dtConnect.Select(" yearmonthdays = '" + strDate + "' and F_State = 10 and F_IsDelete = 0").Count();
|
|
500
|
|
- ////日未完成
|
|
501
|
|
- //int list2_count = dtConnect.Select(" yearmonthdays = '" + strDate + "' and F_State<>10 and F_IsDelete=0 ").Count();
|
|
502
|
|
- ////月已完成
|
|
503
|
|
- //var list3_count = dtConnect.Select(" yearmonths = '" + strMonth + "' and F_State =10 and F_IsDelete=0 ").Count();
|
|
504
|
|
- ////月未完成
|
|
505
|
|
- //var list4_count = dtConnect.Select(" yearmonths = '" + strMonth + "' and F_State<>10 and F_IsDelete=0").Count();
|
|
506
|
|
-
|
|
507
|
|
- //BLL.T_Bus_WorkOrder bll = new BLL.T_Bus_WorkOrder();
|
|
508
|
|
- //var modellist = bll.GetModelList (uwhere + " and F_IsDelete = 0 and F_State !=11 and F_Duplicate!=5");
|
|
509
|
|
- //int list1 = 0, list2 = 0, list3 = 0, list4 = 0;
|
|
510
|
|
- //if (modellist!=null )
|
|
511
|
|
- //{
|
|
512
|
|
- // foreach (var it in modellist)
|
|
513
|
|
- // {
|
|
514
|
|
- // if (it .F_State ==10)
|
|
515
|
|
- // {
|
|
516
|
|
- // list3++;
|
|
517
|
|
- // if (DateTime .Parse (it.F_CreateTime.ToString ()).ToString("yyyy-MM-dd")== strDate)
|
|
518
|
|
- // {
|
|
519
|
|
- // list1++;
|
|
520
|
|
- // }
|
|
521
|
|
- // }
|
|
522
|
|
- // else
|
|
523
|
|
- // {
|
|
524
|
|
- // list4++;
|
|
525
|
|
- // if (DateTime.Parse(it.F_CreateTime.ToString()).ToString("yyyy-MM-dd") == strDate)
|
|
526
|
|
- // {
|
|
527
|
|
- // list2++;
|
|
528
|
|
- // }
|
|
529
|
|
- // }
|
|
530
|
|
- // }
|
|
531
|
|
- //}
|
|
532
|
|
-
|
|
533
|
|
- // var list1 = bll.GetList(uwhere + " and CONVERT(varchar(10),F_CreateTime, 23)='" + strDate + "' and F_State in(10) and F_IsDelete=0 ").Tables[0];
|
|
534
|
|
- // var list2 = bll.GetList(uwhere + " and CONVERT(varchar(10),F_CreateTime, 23)='" + strDate + "' and F_State in (1,3,4,5,6) and F_IsDelete=0 ").Tables[0];
|
|
535
|
|
- // var list3 = bll.GetList(uwhere + " and CONVERT(char(7),F_CreateTime,20)='" + strMonth + "' and F_State in(10) and F_IsDelete=0 ").Tables[0];
|
|
536
|
|
- // var list4 = bll.GetList(uwhere + " and CONVERT(char(7),F_CreateTime,20)='" + strMonth + "' and F_State in (1,3,4,5,6) and F_IsDelete=0 ").Tables[0];
|
|
537
|
|
-
|
|
538
|
|
- var obj = new
|
|
539
|
|
- {
|
|
540
|
|
- //daywc = list1,
|
|
541
|
|
- //daywwc = list2,
|
|
542
|
|
- //monwc = list3,
|
|
543
|
|
- //monwwc = list4
|
|
544
|
|
- //daywc = list1_count,
|
|
545
|
|
- //daywwc = list2_count,
|
|
546
|
|
- //monwc = list3_count,
|
|
547
|
|
- //monwwc = list4_count
|
|
548
|
|
- };
|
|
549
|
|
- return Success("成功", obj);
|
|
550
|
|
- }
|
|
551
|
|
- }
|
|
|
479
|
+ var daywhere = " and datediff(day,F_CreateOn,getdate())=0 ";
|
|
|
480
|
+ var monthwhere = " and datediff(month,F_CreateOn,getdate())=0 ";
|
|
|
481
|
+ if (userModel.rolecode != "XTGLY")
|
|
|
482
|
+ {
|
|
|
483
|
+ daywhere += " and F_CreateBy='" + userModel.F_UserCode + "' ";
|
|
|
484
|
+ monthwhere += " and F_CreateBy='" + userModel.F_UserCode + "' ";
|
|
552
|
485
|
}
|
|
553
|
|
- return NoToken("未知错误,请重新登录");
|
|
|
486
|
+
|
|
|
487
|
+ var ldCount = bll.GetRecordCount("F_Direction=0 " + daywhere);
|
|
|
488
|
+ var qdCount = bll.GetRecordCount("F_Direction=1 " + daywhere);
|
|
|
489
|
+ var count = bll.GetRecordCount("1=1 " + monthwhere);
|
|
|
490
|
+
|
|
|
491
|
+
|
|
|
492
|
+ var obj = new
|
|
|
493
|
+ {
|
|
|
494
|
+ ldCount,
|
|
|
495
|
+ qdCount,
|
|
|
496
|
+ count
|
|
|
497
|
+ };
|
|
|
498
|
+ return Success("成功", obj);
|
|
554
|
499
|
}
|
|
555
|
500
|
|
|
556
|
501
|
/// <summary>
|
|
|
@@ -617,7 +562,7 @@ namespace CallCenterApi.Interface.Controllers
|
|
617
|
562
|
Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
|
|
618
|
563
|
if (userModel != null)
|
|
619
|
564
|
{
|
|
620
|
|
- var date = DateTime.Now;//DateTime.Parse("2015-04-05"); //
|
|
|
565
|
+ var date = DateTime.Now;
|
|
621
|
566
|
string strDate = date.ToString("yyyy-MM");
|
|
622
|
567
|
|
|
623
|
568
|
int days = DateTime.DaysInMonth(date.Year, date.Month);
|
|
|
@@ -628,33 +573,28 @@ namespace CallCenterApi.Interface.Controllers
|
|
628
|
573
|
int newcount = 0;
|
|
629
|
574
|
List<string> cols = strcols.Take(days).ToList();
|
|
630
|
575
|
BLL.T_Call_CallRecords telbll = new BLL.T_Call_CallRecords();
|
|
631
|
|
- //BLL.T_Wo_WorkOrderBase workbll = new BLL.T_Wo_WorkOrderBase();
|
|
632
|
|
- //BLL.T_Bus_WorkOrder workbll = new BLL.T_Bus_WorkOrder();
|
|
|
576
|
+
|
|
633
|
577
|
int[] teltotal = new int[days];
|
|
634
|
578
|
int[] worktotal = new int[days];
|
|
635
|
|
- string uwhere = " 1=1 AND CONVERT(char(7),F_CreateTime,20) = '" + strDate + "' ";
|
|
|
579
|
+ string uwhere = " 1=1 AND CONVERT(char(7),F_CreateOn,20) = '" + strDate + "' ";
|
|
636
|
580
|
string u1where = " 1=1 and ISNULL(groupcode,'') != '' AND CONVERT(char(7),BeginTime,20) = '" + strDate + "' ";
|
|
637
|
581
|
if (userModel.rolecode != "XTGLY")
|
|
638
|
582
|
{
|
|
639
|
|
- uwhere += " and F_CreateUser='" + userModel.F_UserCode + "' ";
|
|
|
583
|
+ uwhere += " and F_CreateBy='" + userModel.F_UserCode + "' ";
|
|
640
|
584
|
u1where += " and UserCode='" + userModel.F_UserCode + "' ";
|
|
641
|
585
|
}
|
|
642
|
586
|
|
|
643
|
587
|
DataTable dtConnect = DbHelperSQL.Query("select CONVERT(varchar(10),BeginTime, 23) AS yearmonthdays,CONVERT(char(7),BeginTime,20) AS yearmonths,CallType,BeginTime,groupcode,UserCode FROM T_Call_CallRecords WITH(NOLOCK) where " + u1where + "").Tables[0];
|
|
644
|
|
- //DataTable dtConnect_Wo = DbHelperSQL.Query("select CONVERT(varchar(10),F_CreateTime, 23) AS yearmonthdays,CONVERT(char(7),F_CreateTime,20) AS yearmonths,F_State,F_IsDelete,F_CreateTime,F_CreateUser FROM T_Bus_WorkOrder WITH(NOLOCK) where " + uwhere + "").Tables[0];
|
|
|
588
|
+ DataTable dtConnect_Wo = DbHelperSQL.Query("select CONVERT(varchar(10),F_CreateOn, 23) AS yearmonthdays,CONVERT(char(7),F_CreateOn,20) AS yearmonths,F_CreateOn,F_CreateBy FROM T_Rec_RegRecords WITH(NOLOCK) where " + uwhere + "").Tables[0];
|
|
645
|
589
|
for (int i = 0; i < cols.Count; i++)
|
|
646
|
590
|
{
|
|
647
|
591
|
int tellist_Count = dtConnect.Select("yearmonthdays = '" + (strDate + "-" + cols[i]) + "'").Count();
|
|
648
|
592
|
teltotal[i] = tellist_Count;
|
|
649
|
593
|
newcount = newcount + tellist_Count;
|
|
650
|
594
|
|
|
651
|
|
- //var worklist = workbll.GetList(" F_USERID='" + userId + "' and CONVERT(varchar(10),F_CREATEDATE, 23)='" + (strDate + "-" + cols[i]) + "' ").Tables[0];
|
|
652
|
|
- //var worklist = workbll.GetList(uwhere + " and CONVERT(varchar(10),CreateTime, 23)='" + (strDate + "-" + cols[i]) + "' ").Tables[0];
|
|
653
|
|
- //int worklist_count = workbll.GetRecordCount(uwhere + " and CONVERT(varchar(10),CreateTime, 23)='" + (strDate + "-" + cols[i]) + "' ");
|
|
654
|
|
- //int worklist_count = dtConnect_Wo.Select("yearmonthdays = '" + (strDate + "-" + cols[i]) + "'").Count();
|
|
655
|
|
- //worktotal[i] = worklist.Rows.Count;
|
|
656
|
|
- //worktotal[i] = worklist_count;
|
|
657
|
|
- worktotal[i] = 0;
|
|
|
595
|
+
|
|
|
596
|
+ int worklist_count = dtConnect_Wo.Select("yearmonthdays = '" + (strDate + "-" + cols[i]) + "'").Count();
|
|
|
597
|
+ worktotal[i] = worklist_count;
|
|
658
|
598
|
}
|
|
659
|
599
|
|
|
660
|
600
|
var olddate = date.AddYears(-1);
|
|
|
@@ -707,18 +647,17 @@ namespace CallCenterApi.Interface.Controllers
|
|
707
|
647
|
/// <returns></returns>
|
|
708
|
648
|
public ActionResult GetWorkOrderCount()
|
|
709
|
649
|
{
|
|
710
|
|
- return Success("");
|
|
711
|
|
-
|
|
712
|
|
- //if (Request.IsAuthenticated)
|
|
713
|
|
- //{
|
|
|
650
|
+ if (!Request.IsAuthenticated)
|
|
|
651
|
+ return NoToken("未知错误,请重新登录");
|
|
|
652
|
+ int userId = CurrentUser.UserData.F_UserId;
|
|
|
653
|
+ if (userId <= 0)
|
|
|
654
|
+ return Error("登陆信息失效");
|
|
|
655
|
+ Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
|
|
|
656
|
+ if (userModel == null)
|
|
|
657
|
+ return Error("当前用户信息不存在,请联系管理员!");
|
|
714
|
658
|
|
|
715
|
|
- // int userId = CurrentUser.UserData.F_UserId;
|
|
716
|
|
- // if (userId != 0)
|
|
717
|
|
- // {
|
|
718
|
|
- // Model.T_Sys_UserAccount ua = new BLL.T_Sys_UserAccount().GetModel(userId);
|
|
|
659
|
+ return Success("");
|
|
719
|
660
|
|
|
720
|
|
- // if (ua != null)
|
|
721
|
|
- // {
|
|
722
|
661
|
// BLL.T_Bus_WorkOrder bll = new BLL.T_Bus_WorkOrder();
|
|
723
|
662
|
|
|
724
|
663
|
// string uwhere = " 1=1 ";
|
|
|
@@ -733,10 +672,6 @@ namespace CallCenterApi.Interface.Controllers
|
|
733
|
672
|
// thdtj = bll.GetList(uwhere + " AND F_State=6 ").Tables[0].Rows.Count,
|
|
734
|
673
|
// };
|
|
735
|
674
|
// return Success("成功", obj);
|
|
736
|
|
- // }
|
|
737
|
|
- // }
|
|
738
|
|
- //}
|
|
739
|
|
- //return NoToken("未知错误,请重新登录");
|
|
740
|
675
|
}
|
|
741
|
676
|
|
|
742
|
677
|
/// <summary>
|