|
|
@@ -59,7 +59,7 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
59
|
59
|
/// <param name="stime"></param>
|
|
60
|
60
|
/// <param name="endtime"></param>
|
|
61
|
61
|
/// <returns></returns>
|
|
62
|
|
- public ActionResult GetDataList(string stime, string endtime)
|
|
|
62
|
+ public ActionResult GetDataList(string stime, string endtime, string dpt)
|
|
63
|
63
|
{
|
|
64
|
64
|
ActionResult res = NoToken("未知错误,请重新登录");
|
|
65
|
65
|
DataTable dtNew = new DataTable();
|
|
|
@@ -85,7 +85,7 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
85
|
85
|
}
|
|
86
|
86
|
dtGDLY1_name[dtGDLY1rowcount + 1] = "总计";
|
|
87
|
87
|
dtGDLY1_count[dtGDLY1rowcount + 1] = 1;
|
|
88
|
|
- dtNew = getData(stime, endtime);
|
|
|
88
|
+ dtNew = getData(stime, endtime, dpt);
|
|
89
|
89
|
|
|
90
|
90
|
#region 获取第二行标题
|
|
91
|
91
|
//DataColumn dc = new DataColumn("姓名");
|
|
|
@@ -143,7 +143,7 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
143
|
143
|
return res;
|
|
144
|
144
|
}
|
|
145
|
145
|
|
|
146
|
|
- private DataTable getData(string stime, string endtime)
|
|
|
146
|
+ private DataTable getData(string stime, string endtime, string dpt)
|
|
147
|
147
|
{
|
|
148
|
148
|
DataTable dtNew = new DataTable();
|
|
149
|
149
|
#region 添加表格标题
|
|
|
@@ -178,6 +178,11 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
178
|
178
|
#endregion
|
|
179
|
179
|
|
|
180
|
180
|
string sqltimeCallRecords = "";
|
|
|
181
|
+ //部门搜索
|
|
|
182
|
+ if (dpt != null && dpt.Trim() != "")
|
|
|
183
|
+ {
|
|
|
184
|
+ sqltimeCallRecords += $" AND CreateUser IN (SELECT F_UserCode FROM dbo.T_Sys_UserAccount WHERE F_DeptId = {dpt}) ";
|
|
|
185
|
+ }
|
|
181
|
186
|
if (stime != null && stime.Trim() != "")
|
|
182
|
187
|
{
|
|
183
|
188
|
sqltimeCallRecords += " and CONVERT(varchar , CreateTime, 120)>=CONVERT(varchar , '" + stime.Trim() + " 00:00:01', 120) ";
|
|
|
@@ -236,7 +241,7 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
236
|
241
|
}
|
|
237
|
242
|
|
|
238
|
243
|
//导出数据
|
|
239
|
|
- public ActionResult ExptList(string stime, string endtime)
|
|
|
244
|
+ public ActionResult ExptList(string stime, string endtime, string dpt)
|
|
240
|
245
|
{
|
|
241
|
246
|
ActionResult res = NoToken("未知错误,请重新登录");
|
|
242
|
247
|
if (Request.IsAuthenticated)
|
|
|
@@ -309,7 +314,7 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
309
|
314
|
|
|
310
|
315
|
|
|
311
|
316
|
NPOIHelper npoi = new NPOIHelper();
|
|
312
|
|
- DataTable dt = getData(stime, endtime);
|
|
|
317
|
+ DataTable dt = getData(stime, endtime, dpt);
|
|
313
|
318
|
#region 处理第二行标题
|
|
314
|
319
|
List<string> colnames = new List<string>();
|
|
315
|
320
|
colnames.Add("姓名");
|