Parcourir la Source

报表搜索bug调整

zhengbingbing il y a 7 ans
Parent
commit
693096daf2

+ 5 - 5
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/LogController.cs

33
                     sql += " and F_LoginName like '%" + filter.Name + "%' ";
33
                     sql += " and F_LoginName like '%" + filter.Name + "%' ";
34
                 }
34
                 }
35
                 //登录时间
35
                 //登录时间
36
-                if (!string.IsNullOrEmpty(filter.SDate))
36
+                if (!string.IsNullOrWhiteSpace(filter.SDate))
37
                 {
37
                 {
38
                     sql += " and CONVERT(varchar , F_LoginDate, 120)>=CONVERT(varchar , '" + filter.SDate.ToString() + " 00:00:01', 120) ";
38
                     sql += " and CONVERT(varchar , F_LoginDate, 120)>=CONVERT(varchar , '" + filter.SDate.ToString() + " 00:00:01', 120) ";
39
                 }
39
                 }
42
                     sql+= "and CONVERT(varchar , F_LoginDate, 120)<=CONVERT(varchar , '" + filter.EDate.ToString() + " 23:59:59', 120) ";
42
                     sql+= "and CONVERT(varchar , F_LoginDate, 120)<=CONVERT(varchar , '" + filter.EDate.ToString() + " 23:59:59', 120) ";
43
                 }
43
                 }
44
                 //条件查询--登录结果
44
                 //条件查询--登录结果
45
-                if (!string.IsNullOrEmpty(filter.Results))
45
+                if (!string.IsNullOrWhiteSpace(filter.Results))
46
                 {
46
                 {
47
                     sql += " and F_Result like '%" + filter.Results + "%'";
47
                     sql += " and F_Result like '%" + filter.Results + "%'";
48
                 }
48
                 }
49
                 //条件查询--登录IP
49
                 //条件查询--登录IP
50
-                if (!string.IsNullOrEmpty(filter.LoginIP))
50
+                if (!string.IsNullOrWhiteSpace(filter.LoginIP))
51
                 {
51
                 {
52
                     sql += " and F_LoginIP like '%" + filter.LoginIP + "%'";
52
                     sql += " and F_LoginIP like '%" + filter.LoginIP + "%'";
53
                 }
53
                 }
120
                     sql += " and F_OptName like '%" + filter.Name + "%' ";
120
                     sql += " and F_OptName like '%" + filter.Name + "%' ";
121
                 }
121
                 }
122
                 //操作时间
122
                 //操作时间
123
-                if (!string.IsNullOrEmpty(filter.SDate))
123
+                if (!string.IsNullOrWhiteSpace(filter.SDate))
124
                 {
124
                 {
125
                     sql += " and CONVERT(varchar , F_OptOn, 120)>=CONVERT(varchar , '" + filter.SDate.ToString() + " 00:00:01', 120) ";
125
                     sql += " and CONVERT(varchar , F_OptOn, 120)>=CONVERT(varchar , '" + filter.SDate.ToString() + " 00:00:01', 120) ";
126
                 }
126
                 }
129
                     sql += "and CONVERT(varchar , F_OptOn, 120)<=CONVERT(varchar , '" + filter.EDate.ToString() + " 23:59:59', 120) ";
129
                     sql += "and CONVERT(varchar , F_OptOn, 120)<=CONVERT(varchar , '" + filter.EDate.ToString() + " 23:59:59', 120) ";
130
                 }
130
                 }
131
                 //条件查询--操作结果
131
                 //条件查询--操作结果
132
-                if (!string.IsNullOrEmpty(filter.Results))
132
+                if (!string.IsNullOrWhiteSpace(filter.Results))
133
                 {
133
                 {
134
                     sql += " and F_Descript like '%" + filter.Results + "%'";
134
                     sql += " and F_Descript like '%" + filter.Results + "%'";
135
                 }
135
                 }

+ 4 - 4
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/CallBusyController.cs

72
             int CallNoTotalSummaryTime = 0;
72
             int CallNoTotalSummaryTime = 0;
73
             #region 时间搜索
73
             #region 时间搜索
74
             string sqllog = "", sqlzm = "";
74
             string sqllog = "", sqlzm = "";
75
-            if (stime != "")
75
+            if (!string.IsNullOrWhiteSpace(stime))
76
             {
76
             {
77
                 sqlzm += " and DATEDIFF(d,F_OptOn,'" + stime + "')<=0";
77
                 sqlzm += " and DATEDIFF(d,F_OptOn,'" + stime + "')<=0";
78
                 sqllog += " and datediff(d,F_LoginOutDate,'" + stime + "')<=0";
78
                 sqllog += " and datediff(d,F_LoginOutDate,'" + stime + "')<=0";
79
             }
79
             }
80
-            if (endtime != "")
80
+            if (!string.IsNullOrWhiteSpace(endtime))
81
             {
81
             {
82
                 sqlzm += " and DATEDIFF(d,F_OptOn,'" + endtime + "')>=0";
82
                 sqlzm += " and DATEDIFF(d,F_OptOn,'" + endtime + "')>=0";
83
                 sqllog += " and datediff(d,F_LoginOutDate,'" + endtime + "')>=0";
83
                 sqllog += " and datediff(d,F_LoginOutDate,'" + endtime + "')>=0";
86
 
86
 
87
             #region 根据条件获取所需数据
87
             #region 根据条件获取所需数据
88
             var userAccountList = new BLL.T_Sys_UserAccount().GetModelList("F_DeleteFlag=0 AND F_SeatRight=0");
88
             var userAccountList = new BLL.T_Sys_UserAccount().GetModelList("F_DeleteFlag=0 AND F_SeatRight=0");
89
-            DataTable dtno = DbHelperSQL.Query("select F_OptTime as TalkNoTotalTime,* from T_Sys_CallOptLogs where F_State=2 and F_OptBy in (select F_UserId from T_Sys_UserAccount where F_StateFlag=1 AND F_SeatRight=0)" + sqlzm).Tables[0];
89
+            DataTable dtno = DbHelperSQL.Query("select F_OptTime as TalkNoTotalTime,* from T_Sys_CallOptLogs where F_State=2 and F_OptBy in (select F_UserId from T_Sys_UserAccount where F_DeleteFlag=0 AND F_SeatRight=0)" + sqlzm).Tables[0];
90
 
90
 
91
-            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];
91
+            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];
92
             #endregion
92
             #endregion
93
             foreach (Model.T_Sys_UserAccount item in userAccountList)
93
             foreach (Model.T_Sys_UserAccount item in userAccountList)
94
             {
94
             {

+ 2 - 2
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/CallByMonthController.cs

29
             if (type>=1)
29
             if (type>=1)
30
             {
30
             {
31
                 begintime = DateTime.Now.ToString("yyyy-MM-dd 00:00:01");
31
                 begintime = DateTime.Now.ToString("yyyy-MM-dd 00:00:01");
32
-                if (!string.IsNullOrEmpty(sdate))
32
+                if (!string.IsNullOrWhiteSpace(sdate))
33
                 {
33
                 {
34
                     begintime = sdate + " 00:00:01";
34
                     begintime = sdate + " 00:00:01";
35
                 }
35
                 }
36
 
36
 
37
-                if (!string.IsNullOrEmpty(edate))
37
+                if (!string.IsNullOrWhiteSpace(edate))
38
                 {
38
                 {
39
                     endtime = edate + " 23:59:59";
39
                     endtime = edate + " 23:59:59";
40
                 }
40
                 }

+ 8 - 8
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/CallQueuingController.cs

81
             DateTime beginTime;
81
             DateTime beginTime;
82
             DateTime endTime;
82
             DateTime endTime;
83
             string sql = "", sqllog = "";
83
             string sql = "", sqllog = "";
84
-            if (stime != "")
84
+            if (!string.IsNullOrWhiteSpace(stime))
85
                 beginTime = DateTime.Parse(stime);
85
                 beginTime = DateTime.Parse(stime);
86
             else
86
             else
87
                 beginTime = DateTime.Parse(DateTime.Now.AddDays(-days).ToShortDateString());
87
                 beginTime = DateTime.Parse(DateTime.Now.AddDays(-days).ToShortDateString());
88
 
88
 
89
-            if (endtime != "")
89
+            if (!string.IsNullOrWhiteSpace(endtime))
90
                 endTime = DateTime.Parse(endtime + " 23:59:59");
90
                 endTime = DateTime.Parse(endtime + " 23:59:59");
91
             else
91
             else
92
                 endTime = DateTime.Parse(DateTime.Now.ToShortDateString() + " 23:59:59");
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
             #endregion
98
             #endregion
99
 
99
 
100
             #region 根据条件获取所需数据
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
             #endregion
104
             #endregion
105
             for (DateTime t = beginTime; t <= endTime; t = t.AddDays(1))
105
             for (DateTime t = beginTime; t <= endTime; t = t.AddDays(1))
106
             {
106
             {

+ 5 - 5
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/CallZuoXiController.cs

79
             string sql = ""; // 呼入
79
             string sql = ""; // 呼入
80
             string sqlzm = ""; // 置忙
80
             string sqlzm = ""; // 置忙
81
             string sqlzx = "";//在线
81
             string sqlzx = "";//在线
82
-            if (stime != "")
82
+            if (!string.IsNullOrWhiteSpace(stime))
83
             {
83
             {
84
                 sql += " and DATEDIFF(d,BeginTime,'" + stime + "')<=0";
84
                 sql += " and DATEDIFF(d,BeginTime,'" + stime + "')<=0";
85
                 sqlzm += " and DATEDIFF(d,F_OptOn,'" + stime + "')<=0";
85
                 sqlzm += " and DATEDIFF(d,F_OptOn,'" + stime + "')<=0";
86
                 sqlzx += " and DATEDIFF(d,F_LoginOutDate,'" + stime + "')<=0";
86
                 sqlzx += " and DATEDIFF(d,F_LoginOutDate,'" + stime + "')<=0";
87
             }
87
             }
88
-            if (endtime != "")
88
+            if (!string.IsNullOrWhiteSpace(endtime))
89
             {
89
             {
90
                 sql += " and DATEDIFF(d,BeginTime,'" + endtime + "')>=0";
90
                 sql += " and DATEDIFF(d,BeginTime,'" + endtime + "')>=0";
91
                 sqlzm += " and DATEDIFF(d,F_OptOn,'" + endtime + "')>=0";
91
                 sqlzm += " and DATEDIFF(d,F_OptOn,'" + endtime + "')>=0";
94
             #endregion
94
             #endregion
95
 
95
 
96
             #region 根据条件获取所需数据
96
             #region 根据条件获取所需数据
97
-            DataTable dt = DbHelperSQL.Query("select ISNULL(DATEDIFF(s,TalkStartTime,TalkEndTime),0) as TalkTotalTime,* from View_CallRecordList where  userid in (select F_UserId from T_Sys_UserAccount where F_StateFlag=1 AND F_SeatRight=0) and CallState=1" + sql).Tables[0];
97
+            DataTable dt = DbHelperSQL.Query("select ISNULL(DATEDIFF(s,TalkStartTime,TalkEndTime),0) as TalkTotalTime,* from View_CallRecordList where  userid in (select F_UserId from T_Sys_UserAccount where F_DeleteFlag=0 AND F_SeatRight=0) and CallState=1" + sql).Tables[0];
98
 
98
 
99
-            DataTable dtno = DbHelperSQL.Query("select F_OptTime as TalkNoTotalTime,* from T_Sys_CallOptLogs where F_State=2 and F_OptBy in (select F_UserId from T_Sys_UserAccount where F_StateFlag=1 AND F_SeatRight=0)" + sqlzm).Tables[0];
99
+            DataTable dtno = DbHelperSQL.Query("select F_OptTime as TalkNoTotalTime,* from T_Sys_CallOptLogs where F_State=2 and F_OptBy in (select F_UserId from T_Sys_UserAccount where F_DeleteFlag=0 AND F_SeatRight=0)" + sqlzm).Tables[0];
100
 
100
 
101
-            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) " + sqlzx + "  ORDER BY F_LoginDate DESC ").Tables[0];
101
+            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) " + sqlzx + "  ORDER BY F_LoginDate DESC ").Tables[0];
102
             #endregion
102
             #endregion
103
             foreach (Model.T_Sys_UserAccount item in userAccountList)
103
             foreach (Model.T_Sys_UserAccount item in userAccountList)
104
             {
104
             {

+ 2 - 2
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/ZuoXiManYiDuController.cs

68
             #endregion
68
             #endregion
69
 
69
 
70
             string time = "";
70
             string time = "";
71
-            if (stime != null && stime.Trim() != "")
71
+            if (!string.IsNullOrWhiteSpace(stime))
72
             {
72
             {
73
                 time += " and CONVERT(varchar , BeginTime, 120)>=CONVERT(varchar , '" + stime.Trim() + " 00:00:01', 120) ";
73
                 time += " and CONVERT(varchar , BeginTime, 120)>=CONVERT(varchar , '" + stime.Trim() + " 00:00:01', 120) ";
74
             }
74
             }
75
-            if (endtime != null && endtime.Trim() != "")
75
+            if (!string.IsNullOrWhiteSpace(endtime))
76
             {
76
             {
77
                 time += " and CONVERT(varchar , BeginTime, 120)<=CONVERT(varchar , '" + endtime.Trim() + " 23:59:59', 120) ";
77
                 time += " and CONVERT(varchar , BeginTime, 120)<=CONVERT(varchar , '" + endtime.Trim() + " 23:59:59', 120) ";
78
             }
78
             }