|
|
@@ -81,26 +81,26 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
81
|
81
|
DateTime beginTime;
|
|
82
|
82
|
DateTime endTime;
|
|
83
|
83
|
string sql = "", sqllog = "";
|
|
84
|
|
- if (stime != "")
|
|
|
84
|
+ if (!string.IsNullOrWhiteSpace(stime))
|
|
85
|
85
|
beginTime = DateTime.Parse(stime);
|
|
86
|
86
|
else
|
|
87
|
87
|
beginTime = DateTime.Parse(DateTime.Now.AddDays(-days).ToShortDateString());
|
|
88
|
88
|
|
|
89
|
|
- if (endtime != "")
|
|
|
89
|
+ if (!string.IsNullOrWhiteSpace(endtime))
|
|
90
|
90
|
endTime = DateTime.Parse(endtime + " 23:59:59");
|
|
91
|
91
|
else
|
|
92
|
92
|
endTime = DateTime.Parse(DateTime.Now.ToShortDateString() + " 23:59:59");
|
|
93
|
93
|
|
|
94
|
|
- sql += " and DATEDIFF(d,BeginTime,'" + beginTime + "')<=0";
|
|
95
|
|
- sql += " and DATEDIFF(d,BeginTime,'" + endTime + "')>=0";
|
|
96
|
|
- sqllog += " and datediff(d,F_LoginOutDate,'" + beginTime + "')<=0";
|
|
97
|
|
- sqllog += " and datediff(d,F_LoginOutDate,'" + endTime + "')>=0";
|
|
|
94
|
+ sql += " and DATEDIFF(d,BeginTime,'" + beginTime.ToString("yyyy-MM-dd") + "')<=0";
|
|
|
95
|
+ sql += " and DATEDIFF(d,BeginTime,'" + endTime.ToString("yyyy-MM-dd") + "')>=0";
|
|
|
96
|
+ sqllog += " and datediff(d,F_LoginOutDate,'" + beginTime.ToString("yyyy-MM-dd") + "')<=0";
|
|
|
97
|
+ sqllog += " and datediff(d,F_LoginOutDate,'" + endTime.ToString("yyyy-MM-dd") + "')>=0";
|
|
98
|
98
|
#endregion
|
|
99
|
99
|
|
|
100
|
100
|
#region 根据条件获取所需数据
|
|
101
|
|
- DataTable dt = DbHelperSQL.Query("select ISNULL(DATEDIFF(s,TalkStartTime,TalkEndTime),0) as TalkTotalTime,* from T_Call_CallRecords where userid in (select F_UserId from T_Sys_UserAccount where F_StateFlag=1 AND F_SeatRight=0) and calltype=0" + sql).Tables[0];//BusinessType=0代表ivr中选择了转人工,calltype=0代表呼入
|
|
|
101
|
+ DataTable dt = DbHelperSQL.Query("select ISNULL(DATEDIFF(s,TalkStartTime,TalkEndTime),0) as TalkTotalTime,* from T_Call_CallRecords where userid in (select F_UserId from T_Sys_UserAccount where F_DeleteFlag=0 AND F_SeatRight=0) and calltype=0" + sql).Tables[0];//BusinessType=0代表ivr中选择了转人工,calltype=0代表呼入
|
|
102
|
102
|
|
|
103
|
|
- DataTable dtLoginLog = DbHelperSQL.Query("SELECT ISNULL(DATEDIFF(s,F_LoginDate,F_LoginOutDate),0) as SummaryOnLine,* FROM dbo.T_Sys_LoginLogs where F_LoginId in (select F_UserId from T_Sys_UserAccount where F_StateFlag=1 and F_SeatRight=0) " + sqllog + " ORDER BY F_LoginDate DESC ").Tables[0];
|
|
|
103
|
+ DataTable dtLoginLog = DbHelperSQL.Query("SELECT ISNULL(DATEDIFF(s,F_LoginDate,F_LoginOutDate),0) as SummaryOnLine,* FROM dbo.T_Sys_LoginLogs where F_LoginId in (select F_UserId from T_Sys_UserAccount where F_DeleteFlag=0 and F_SeatRight=0) " + sqllog + " ORDER BY F_LoginDate DESC ").Tables[0];
|
|
104
|
104
|
#endregion
|
|
105
|
105
|
for (DateTime t = beginTime; t <= endTime; t = t.AddDays(1))
|
|
106
|
106
|
{
|