|
|
@@ -15,7 +15,7 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
15
|
15
|
public class YearContrastController : BaseController
|
|
16
|
16
|
{
|
|
17
|
17
|
//呼叫数据对比
|
|
18
|
|
- public ActionResult GetDataList(string beginyear,string endyear)
|
|
|
18
|
+ public ActionResult GetDataList(string beginyear,string endyear, string dpt)
|
|
19
|
19
|
{
|
|
20
|
20
|
ActionResult res = NoToken("未知错误,请重新登录");
|
|
21
|
21
|
|
|
|
@@ -26,7 +26,7 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
26
|
26
|
var data = new
|
|
27
|
27
|
{
|
|
28
|
28
|
key = beginyear + "客户呼叫数",
|
|
29
|
|
- value = GetKhCall(beginyear).TrimEnd(',').Split(','),
|
|
|
29
|
+ value = GetKhCall(beginyear, dpt).TrimEnd(',').Split(','),
|
|
30
|
30
|
type = 0
|
|
31
|
31
|
};
|
|
32
|
32
|
arrlist.Add(data);
|
|
|
@@ -34,7 +34,7 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
34
|
34
|
var data1 = new
|
|
35
|
35
|
{
|
|
36
|
36
|
key = beginyear + "坐席接听数",
|
|
37
|
|
- value = GetZxJt(beginyear).TrimEnd(',').Split(','),
|
|
|
37
|
+ value = GetZxJt(beginyear, dpt).TrimEnd(',').Split(','),
|
|
38
|
38
|
type = 0
|
|
39
|
39
|
};
|
|
40
|
40
|
arrlist.Add(data1);
|
|
|
@@ -42,7 +42,7 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
42
|
42
|
var data2 = new
|
|
43
|
43
|
{
|
|
44
|
44
|
key = beginyear + "接通率",
|
|
45
|
|
- value = GetJTL(beginyear).TrimEnd(',').Split(','),
|
|
|
45
|
+ value = GetJTL(beginyear, dpt).TrimEnd(',').Split(','),
|
|
46
|
46
|
type = 0
|
|
47
|
47
|
};
|
|
48
|
48
|
arrlist.Add(data2);
|
|
|
@@ -52,7 +52,7 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
52
|
52
|
var data = new
|
|
53
|
53
|
{
|
|
54
|
54
|
key = endyear + "客户呼叫数",
|
|
55
|
|
- value = GetKhCall(endyear).TrimEnd(',').Split(','),
|
|
|
55
|
+ value = GetKhCall(endyear, dpt).TrimEnd(',').Split(','),
|
|
56
|
56
|
type = 1
|
|
57
|
57
|
};
|
|
58
|
58
|
arrlist.Add(data);
|
|
|
@@ -60,7 +60,7 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
60
|
60
|
var data1 = new
|
|
61
|
61
|
{
|
|
62
|
62
|
key = endyear + "坐席接听数",
|
|
63
|
|
- value = GetZxJt(endyear).TrimEnd(',').Split(','),
|
|
|
63
|
+ value = GetZxJt(endyear, dpt).TrimEnd(',').Split(','),
|
|
64
|
64
|
type = 1
|
|
65
|
65
|
};
|
|
66
|
66
|
arrlist.Add(data1);
|
|
|
@@ -68,7 +68,7 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
68
|
68
|
var data2 = new
|
|
69
|
69
|
{
|
|
70
|
70
|
key = endyear + "接通率",
|
|
71
|
|
- value = GetJTL(endyear).TrimEnd(',').Split(','),
|
|
|
71
|
+ value = GetJTL(endyear, dpt).TrimEnd(',').Split(','),
|
|
72
|
72
|
type = 1
|
|
73
|
73
|
};
|
|
74
|
74
|
arrlist.Add(data2);
|
|
|
@@ -80,14 +80,14 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
80
|
80
|
}
|
|
81
|
81
|
|
|
82
|
82
|
//导出数据
|
|
83
|
|
- public ActionResult ExptList(string beginyear, string endyear)
|
|
|
83
|
+ public ActionResult ExptList(string beginyear, string endyear, string dpt)
|
|
84
|
84
|
{
|
|
85
|
85
|
ActionResult res = NoToken("未知错误,请重新登录");
|
|
86
|
86
|
//if (Request.IsAuthenticated)
|
|
87
|
87
|
if(1==1)
|
|
88
|
88
|
{
|
|
89
|
89
|
NPOIHelper npoi = new NPOIHelper();
|
|
90
|
|
- DataTable dt = GetData(beginyear, endyear);
|
|
|
90
|
+ DataTable dt = GetData(beginyear, endyear, dpt);
|
|
91
|
91
|
if (npoi.ExportToExcel("呼叫数据分析数据", dt) == "")
|
|
92
|
92
|
{
|
|
93
|
93
|
return Success("导出成功");
|
|
|
@@ -100,7 +100,7 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
100
|
100
|
return res;
|
|
101
|
101
|
}
|
|
102
|
102
|
|
|
103
|
|
- private DataTable GetData(string beginyear, string endyear)
|
|
|
103
|
+ private DataTable GetData(string beginyear, string endyear, string dpt)
|
|
104
|
104
|
{
|
|
105
|
105
|
DataTable dtNew = new DataTable();
|
|
106
|
106
|
if ((beginyear != null && beginyear.Trim() != "")&&(endyear != null && endyear.Trim() != ""))
|
|
|
@@ -122,13 +122,13 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
122
|
122
|
dtNew.Columns.Add(dc6);
|
|
123
|
123
|
dtNew.Columns.Add(dc7);
|
|
124
|
124
|
#endregion
|
|
125
|
|
- string[] bkhcall = GetKhCall(beginyear).Split(',');
|
|
126
|
|
- string[] bzxjt = GetZxJt(beginyear).Split(',');
|
|
127
|
|
- string[] bjtl = GetJTL(beginyear).Split(',');
|
|
|
125
|
+ string[] bkhcall = GetKhCall(beginyear,dpt).Split(',');
|
|
|
126
|
+ string[] bzxjt = GetZxJt(beginyear,dpt).Split(',');
|
|
|
127
|
+ string[] bjtl = GetJTL(beginyear, dpt).Split(',');
|
|
128
|
128
|
|
|
129
|
|
- string[] ekhcall = GetKhCall(endyear).Split(',');
|
|
130
|
|
- string[] ezxjt = GetZxJt(endyear).Split(',');
|
|
131
|
|
- string[] ejtl = GetJTL(endyear).Split(',');
|
|
|
129
|
+ string[] ekhcall = GetKhCall(endyear, dpt).Split(',');
|
|
|
130
|
+ string[] ezxjt = GetZxJt(endyear, dpt).Split(',');
|
|
|
131
|
+ string[] ejtl = GetJTL(endyear, dpt).Split(',');
|
|
132
|
132
|
|
|
133
|
133
|
for (int i = 0; i < 12; i++)
|
|
134
|
134
|
{
|
|
|
@@ -148,7 +148,7 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
148
|
148
|
}
|
|
149
|
149
|
|
|
150
|
150
|
//客户呼叫数
|
|
151
|
|
- private string GetKhCall(string strtime)
|
|
|
151
|
+ private string GetKhCall(string strtime, string dpt)
|
|
152
|
152
|
{
|
|
153
|
153
|
DataTable dt = new DataTable();
|
|
154
|
154
|
string str = "";
|
|
|
@@ -160,6 +160,11 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
160
|
160
|
{
|
|
161
|
161
|
strmm = "0" + i;
|
|
162
|
162
|
}
|
|
|
163
|
+ //2018-07-06 lihai 部门搜索条件
|
|
|
164
|
+ if (!string.IsNullOrEmpty(dpt))
|
|
|
165
|
+ {
|
|
|
166
|
+ sqltimeCallRecords += " and AgentID='" + dpt + "' ";
|
|
|
167
|
+ }
|
|
163
|
168
|
if (strtime != "")
|
|
164
|
169
|
{
|
|
165
|
170
|
sqltimeCallRecords += " and CONVERT(varchar , timecallin, 120)>=CONVERT(varchar , '" + strtime + "-" + strmm + "-01 00:00:01', 120) ";
|
|
|
@@ -191,7 +196,7 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
191
|
196
|
}
|
|
192
|
197
|
|
|
193
|
198
|
//坐席接听数
|
|
194
|
|
- private string GetZxJt(string strtime)
|
|
|
199
|
+ private string GetZxJt(string strtime, string dpt)
|
|
195
|
200
|
{
|
|
196
|
201
|
DataTable dt = new DataTable();
|
|
197
|
202
|
string str = "";
|
|
|
@@ -203,6 +208,11 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
203
|
208
|
{
|
|
204
|
209
|
strmm = "0" + i;
|
|
205
|
210
|
}
|
|
|
211
|
+ //2018-07-06 lihai 部门搜索条件
|
|
|
212
|
+ if (!string.IsNullOrEmpty(dpt))
|
|
|
213
|
+ {
|
|
|
214
|
+ sqltimeCallRecords += " and AgentID='" + dpt + "' ";
|
|
|
215
|
+ }
|
|
206
|
216
|
if (strtime != "")
|
|
207
|
217
|
{
|
|
208
|
218
|
sqltimeCallRecords += " and CONVERT(varchar , timecallin, 120)>=CONVERT(varchar , '" + strtime + "-" + strmm + "-01 00:00:01', 120) ";
|
|
|
@@ -234,7 +244,7 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
234
|
244
|
}
|
|
235
|
245
|
|
|
236
|
246
|
//坐席接听率
|
|
237
|
|
- private string GetJTL(string strtime)
|
|
|
247
|
+ private string GetJTL(string strtime, string dpt)
|
|
238
|
248
|
{
|
|
239
|
249
|
DataTable dt = new DataTable();
|
|
240
|
250
|
string str = "";
|
|
|
@@ -246,6 +256,11 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
246
|
256
|
{
|
|
247
|
257
|
strmm = "0" + i;
|
|
248
|
258
|
}
|
|
|
259
|
+ //2018-07-06 lihai 部门搜索条件
|
|
|
260
|
+ if (!string.IsNullOrEmpty(dpt))
|
|
|
261
|
+ {
|
|
|
262
|
+ sqltimeCallRecords += " and AgentID='" + dpt + "' ";
|
|
|
263
|
+ }
|
|
249
|
264
|
if (strtime != "")
|
|
250
|
265
|
{
|
|
251
|
266
|
sqltimeCallRecords += " and CONVERT(varchar , timecallin, 120)>=CONVERT(varchar , '" + strtime + "-" + strmm + "-01 00:00:01', 120) ";
|