|
|
@@ -10,7 +10,7 @@ using System.Web.Mvc;
|
|
10
|
10
|
|
|
11
|
11
|
namespace CallCenterApi.Interface.Controllers.report
|
|
12
|
12
|
{
|
|
13
|
|
- // [Authority]
|
|
|
13
|
+ // [Authority]
|
|
14
|
14
|
public class SwitchedlossCallController : BaseController
|
|
15
|
15
|
{
|
|
16
|
16
|
//接通呼损统计
|
|
|
@@ -18,10 +18,10 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
18
|
18
|
public ActionResult GetColumnList()
|
|
19
|
19
|
{
|
|
20
|
20
|
ActionResult res = NoToken("未知错误,请重新登录");
|
|
21
|
|
-
|
|
22
|
|
- String[] str = { "日期", "接通次数", "呼损次数", "接通率", "呼损率" };
|
|
23
|
|
- res = Success("获取接通呼损统计表头成功", str);
|
|
24
|
|
-
|
|
|
21
|
+
|
|
|
22
|
+ String[] str = { "日期", "接通次数", "呼损次数", "接通率", "呼损率" };
|
|
|
23
|
+ res = Success("获取接通呼损统计表头成功", str);
|
|
|
24
|
+
|
|
25
|
25
|
return res;
|
|
26
|
26
|
}
|
|
27
|
27
|
|
|
|
@@ -29,45 +29,45 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
29
|
29
|
public ActionResult GetDataList(string stime, string endtime)
|
|
30
|
30
|
{
|
|
31
|
31
|
ActionResult res = NoToken("未知错误,请重新登录");
|
|
32
|
|
-
|
|
33
|
|
- DataTable dtNew = new DataTable();
|
|
34
|
|
- dtNew = GetData(stime, endtime);
|
|
35
|
|
- #region
|
|
36
|
|
-
|
|
37
|
|
- //#region 编辑表头
|
|
38
|
|
- //DataColumn dc1 = new DataColumn("日期", Type.GetType("System.String"));
|
|
39
|
|
- //DataColumn dc2 = new DataColumn("接通次数", Type.GetType("System.String"));
|
|
40
|
|
- //DataColumn dc3 = new DataColumn("呼损次数", Type.GetType("System.String"));
|
|
41
|
|
- //DataColumn dc4 = new DataColumn("接通率", Type.GetType("System.String"));
|
|
42
|
|
- //DataColumn dc5 = new DataColumn("呼损率", Type.GetType("System.String"));
|
|
43
|
|
-
|
|
44
|
|
- //dtNew.Columns.Add(dc1);
|
|
45
|
|
- //dtNew.Columns.Add(dc2);
|
|
46
|
|
- //dtNew.Columns.Add(dc3);
|
|
47
|
|
- //dtNew.Columns.Add(dc4);
|
|
48
|
|
- //dtNew.Columns.Add(dc5);
|
|
49
|
|
- //#endregion
|
|
50
|
|
- //string[] DataArr = GetStatisticalTime(stime, endtime).TrimStart('[').TrimEnd(']').Split(',');
|
|
51
|
|
- //string[] CallConnectData = GetStatisticalCallConnectData(stime, endtime).TrimStart('[').TrimEnd(']').Split(',');
|
|
52
|
|
- //string[] CallLossData = GetStatisticalCallLossData(stime, endtime).TrimStart('[').TrimEnd(']').Split(',');
|
|
53
|
|
- //string[] CallConnectDataRate = GetStatisticalCallConnectDataRate(stime, endtime).TrimStart('[').TrimEnd(']').Split(',');
|
|
54
|
|
- //string[] CallLossDataRate = GetStatisticalCallLossDataRate(stime, endtime).TrimStart('[').TrimEnd(']').Split(',');
|
|
55
|
|
-
|
|
56
|
|
- //for (int i = 0; i < DataArr.Length; i++)
|
|
57
|
|
- //{
|
|
58
|
|
- // DataRow drNew = dtNew.NewRow();
|
|
59
|
|
-
|
|
60
|
|
- // drNew["日期"] = DataArr[i];
|
|
61
|
|
- // drNew["接通次数"] = CallConnectData[i];
|
|
62
|
|
- // drNew["呼损次数"] = CallLossData[i];
|
|
63
|
|
- // drNew["接通率"] = CallConnectDataRate[i];
|
|
64
|
|
- // drNew["呼损率"] = CallLossDataRate[i];
|
|
65
|
|
-
|
|
66
|
|
- // dtNew.Rows.Add(drNew);
|
|
67
|
|
- //}
|
|
68
|
|
- #endregion
|
|
69
|
|
- res = Success("获取接通呼损统计数据成功", dtNew);
|
|
70
|
|
-
|
|
|
32
|
+
|
|
|
33
|
+ DataTable dtNew = new DataTable();
|
|
|
34
|
+ dtNew = GetData(stime, endtime);
|
|
|
35
|
+ #region
|
|
|
36
|
+
|
|
|
37
|
+ //#region 编辑表头
|
|
|
38
|
+ //DataColumn dc1 = new DataColumn("日期", Type.GetType("System.String"));
|
|
|
39
|
+ //DataColumn dc2 = new DataColumn("接通次数", Type.GetType("System.String"));
|
|
|
40
|
+ //DataColumn dc3 = new DataColumn("呼损次数", Type.GetType("System.String"));
|
|
|
41
|
+ //DataColumn dc4 = new DataColumn("接通率", Type.GetType("System.String"));
|
|
|
42
|
+ //DataColumn dc5 = new DataColumn("呼损率", Type.GetType("System.String"));
|
|
|
43
|
+
|
|
|
44
|
+ //dtNew.Columns.Add(dc1);
|
|
|
45
|
+ //dtNew.Columns.Add(dc2);
|
|
|
46
|
+ //dtNew.Columns.Add(dc3);
|
|
|
47
|
+ //dtNew.Columns.Add(dc4);
|
|
|
48
|
+ //dtNew.Columns.Add(dc5);
|
|
|
49
|
+ //#endregion
|
|
|
50
|
+ //string[] DataArr = GetStatisticalTime(stime, endtime).TrimStart('[').TrimEnd(']').Split(',');
|
|
|
51
|
+ //string[] CallConnectData = GetStatisticalCallConnectData(stime, endtime).TrimStart('[').TrimEnd(']').Split(',');
|
|
|
52
|
+ //string[] CallLossData = GetStatisticalCallLossData(stime, endtime).TrimStart('[').TrimEnd(']').Split(',');
|
|
|
53
|
+ //string[] CallConnectDataRate = GetStatisticalCallConnectDataRate(stime, endtime).TrimStart('[').TrimEnd(']').Split(',');
|
|
|
54
|
+ //string[] CallLossDataRate = GetStatisticalCallLossDataRate(stime, endtime).TrimStart('[').TrimEnd(']').Split(',');
|
|
|
55
|
+
|
|
|
56
|
+ //for (int i = 0; i < DataArr.Length; i++)
|
|
|
57
|
+ //{
|
|
|
58
|
+ // DataRow drNew = dtNew.NewRow();
|
|
|
59
|
+
|
|
|
60
|
+ // drNew["日期"] = DataArr[i];
|
|
|
61
|
+ // drNew["接通次数"] = CallConnectData[i];
|
|
|
62
|
+ // drNew["呼损次数"] = CallLossData[i];
|
|
|
63
|
+ // drNew["接通率"] = CallConnectDataRate[i];
|
|
|
64
|
+ // drNew["呼损率"] = CallLossDataRate[i];
|
|
|
65
|
+
|
|
|
66
|
+ // dtNew.Rows.Add(drNew);
|
|
|
67
|
+ //}
|
|
|
68
|
+ #endregion
|
|
|
69
|
+ res = Success("获取接通呼损统计数据成功", dtNew);
|
|
|
70
|
+
|
|
71
|
71
|
return res;
|
|
72
|
72
|
}
|
|
73
|
73
|
|
|
|
@@ -140,10 +140,17 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
140
|
140
|
{
|
|
141
|
141
|
string result = "[";
|
|
142
|
142
|
|
|
143
|
|
- foreach (DictionaryEntry item in GetStatistical(BeginTime, EndTime))
|
|
|
143
|
+ //foreach (DictionaryEntry item in GetStatistical(BeginTime, EndTime))
|
|
|
144
|
+ //{
|
|
|
145
|
+ // //result = (JTHS)item.Value.ToString();
|
|
|
146
|
+ // result += item.Key.ToString().TrimStart('{').TrimEnd('}') + ",";
|
|
|
147
|
+ //}
|
|
|
148
|
+ var datares = GetStatistical(BeginTime, EndTime);
|
|
|
149
|
+ ArrayList arrList = new ArrayList(datares.Keys);
|
|
|
150
|
+ arrList.Sort();
|
|
|
151
|
+ for (int i = 0; i < arrList.Count; i++)
|
|
144
|
152
|
{
|
|
145
|
|
- //result = (JTHS)item.Value.ToString();
|
|
146
|
|
- result += item.Key.ToString().TrimStart('{').TrimEnd('}') + ",";
|
|
|
153
|
+ result += arrList[i].ToString().TrimStart('{').TrimEnd('}') + ",";
|
|
147
|
154
|
}
|
|
148
|
155
|
|
|
149
|
156
|
result = result.TrimEnd(',');
|
|
|
@@ -159,9 +166,16 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
159
|
166
|
{
|
|
160
|
167
|
string result = "[";
|
|
161
|
168
|
|
|
162
|
|
- foreach (DictionaryEntry item in GetStatistical(BeginTime, EndTime))
|
|
|
169
|
+ //foreach (DictionaryEntry item in GetStatistical(BeginTime, EndTime))
|
|
|
170
|
+ //{
|
|
|
171
|
+ // result += ((JTHS)item.Value).CallConnectCount + ",";
|
|
|
172
|
+ //}
|
|
|
173
|
+ var datares = GetStatistical(BeginTime, EndTime);
|
|
|
174
|
+ ArrayList arrList = new ArrayList(datares.Keys);
|
|
|
175
|
+ arrList.Sort();
|
|
|
176
|
+ for (int i = 0; i < arrList.Count; i++)
|
|
163
|
177
|
{
|
|
164
|
|
- result += ((JTHS)item.Value).CallConnectCount + ",";
|
|
|
178
|
+ result += ((JTHS)datares[arrList[i]]).CallConnectCount.ToString("F2") + ",";
|
|
165
|
179
|
}
|
|
166
|
180
|
|
|
167
|
181
|
result = result.TrimEnd(',');
|
|
|
@@ -177,9 +191,16 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
177
|
191
|
{
|
|
178
|
192
|
string result = "[";
|
|
179
|
193
|
|
|
180
|
|
- foreach (DictionaryEntry item in GetStatistical(BeginTime, EndTime))
|
|
|
194
|
+ //foreach (DictionaryEntry item in GetStatistical(BeginTime, EndTime))
|
|
|
195
|
+ //{
|
|
|
196
|
+ // result += ((JTHS)item.Value).CallLossCount + ",";
|
|
|
197
|
+ //}
|
|
|
198
|
+ var datares = GetStatistical(BeginTime, EndTime);
|
|
|
199
|
+ ArrayList arrList = new ArrayList(datares.Keys);
|
|
|
200
|
+ arrList.Sort();
|
|
|
201
|
+ for (int i = 0; i < arrList.Count; i++)
|
|
181
|
202
|
{
|
|
182
|
|
- result += ((JTHS)item.Value).CallLossCount + ",";
|
|
|
203
|
+ result += ((JTHS)datares[arrList[i]]).CallLossCount.ToString("F2") + ",";
|
|
183
|
204
|
}
|
|
184
|
205
|
|
|
185
|
206
|
result = result.TrimEnd(',');
|
|
|
@@ -195,9 +216,16 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
195
|
216
|
{
|
|
196
|
217
|
string result = "[";
|
|
197
|
218
|
|
|
198
|
|
- foreach (DictionaryEntry item in GetStatistical(BeginTime, EndTime))
|
|
|
219
|
+ //foreach (DictionaryEntry item in GetStatistical(BeginTime, EndTime))
|
|
|
220
|
+ //{
|
|
|
221
|
+ // result += ((JTHS)item.Value).CallConnectRate.ToString("F2") + ",";
|
|
|
222
|
+ //}
|
|
|
223
|
+ var datares = GetStatistical(BeginTime, EndTime);
|
|
|
224
|
+ ArrayList arrList = new ArrayList(datares.Keys);
|
|
|
225
|
+ arrList.Sort();
|
|
|
226
|
+ for (int i = 0; i < arrList.Count; i++)
|
|
199
|
227
|
{
|
|
200
|
|
- result += ((JTHS)item.Value).CallConnectRate.ToString("F2") + ",";
|
|
|
228
|
+ result += ((JTHS)datares[arrList[i]]).CallConnectRate.ToString("F2") + ",";
|
|
201
|
229
|
}
|
|
202
|
230
|
|
|
203
|
231
|
result = result.TrimEnd(',');
|
|
|
@@ -214,9 +242,16 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
214
|
242
|
{
|
|
215
|
243
|
string result = "[";
|
|
216
|
244
|
|
|
217
|
|
- foreach (DictionaryEntry item in GetStatistical(BeginTime, EndTime))
|
|
|
245
|
+ var datares = GetStatistical(BeginTime, EndTime);
|
|
|
246
|
+ ArrayList arrList = new ArrayList(datares.Keys);
|
|
|
247
|
+ arrList.Sort();
|
|
|
248
|
+ //foreach (DictionaryEntry item in GetStatistical(BeginTime, EndTime))
|
|
|
249
|
+ //{
|
|
|
250
|
+ // result += ((JTHS)item.Value).CallLossRate.ToString("F2") + ",";
|
|
|
251
|
+ //}
|
|
|
252
|
+ for (int i = 0; i < arrList.Count; i++)
|
|
218
|
253
|
{
|
|
219
|
|
- result += ((JTHS)item.Value).CallLossRate.ToString("F2") + ",";
|
|
|
254
|
+ result += ((JTHS)datares[arrList[i]]).CallLossRate.ToString("F2") + ",";
|
|
220
|
255
|
}
|
|
221
|
256
|
|
|
222
|
257
|
result = result.TrimEnd(',');
|