|
|
@@ -10,11 +10,271 @@ using System.Web.Mvc;
|
|
10
|
10
|
|
|
11
|
11
|
namespace CallCenterApi.Interface.Controllers.report
|
|
12
|
12
|
{
|
|
13
|
|
- [Authority]
|
|
|
13
|
+ // [Authority]
|
|
14
|
14
|
public class BusinessController : BaseController
|
|
15
|
15
|
{
|
|
|
16
|
+ public class Telephone
|
|
|
17
|
+ {
|
|
|
18
|
+ public List<Proportion> type;//诉求占比占比
|
|
|
19
|
+ public List<Conversation> conversations ;//24小时来电量,接通量统计
|
|
|
20
|
+ public List<TotalDate> dates ;//话务总体数据统计展示
|
|
|
21
|
+ }
|
|
|
22
|
+ public class TotalDate
|
|
|
23
|
+ {
|
|
|
24
|
+ public string average;
|
|
|
25
|
+ public int connection;
|
|
|
26
|
+ public int traffic;
|
|
|
27
|
+ }
|
|
|
28
|
+ public class Conversation
|
|
|
29
|
+ {
|
|
|
30
|
+ public int Incomingcall;//来电量
|
|
|
31
|
+ public int Connect;//接通量
|
|
|
32
|
+ }
|
|
|
33
|
+ public class Proportion
|
|
|
34
|
+ {
|
|
|
35
|
+ public string name;
|
|
|
36
|
+ public int total;
|
|
|
37
|
+ public string proportion;
|
|
|
38
|
+ }
|
|
|
39
|
+ public ActionResult GetTelephoneList(string stime, string endtime)
|
|
|
40
|
+ {
|
|
|
41
|
+ string sql = $" F_IsDelete=0";
|
|
|
42
|
+ string where = "";
|
|
|
43
|
+ DataTable dt = new DataTable();
|
|
|
44
|
+ if (stime == "")
|
|
|
45
|
+ {
|
|
|
46
|
+ sql += " and datediff(day,F_CreateTime,'" + DateTime.Now.ToString("yyyy-MM-dd") + "')<=0 ";
|
|
|
47
|
+ where += " and datediff(day,BeginTime,'" + DateTime.Now.ToString("yyyy-MM-dd") + "')<=0 ";
|
|
|
48
|
+ }
|
|
|
49
|
+
|
|
|
50
|
+ else
|
|
|
51
|
+ {
|
|
|
52
|
+ sql += " and datediff(day,F_CreateTime,'" + stime + "')<=0 ";
|
|
|
53
|
+ where += " and datediff(day,BeginTime,'" + stime + "')<=0 ";
|
|
|
54
|
+ }
|
|
|
55
|
+
|
|
|
56
|
+ if (endtime == "")
|
|
|
57
|
+ {
|
|
|
58
|
+ sql += " and datediff(day,F_CreateTime,'" + DateTime.Now.ToString("yyyy-MM-dd") + "')>=0 ";
|
|
|
59
|
+ sql += " and datediff(day,BeginTime,'" + DateTime.Now.ToString("yyyy-MM-dd") + "')>=0 ";
|
|
|
60
|
+ }
|
|
|
61
|
+ else
|
|
|
62
|
+ {
|
|
|
63
|
+ sql += " and datediff(day,F_CreateTime,'" + endtime + "')>=0 ";
|
|
|
64
|
+ sql += " and datediff(day,BeginTime,'" + endtime + "')>=0 ";
|
|
|
65
|
+ }
|
|
|
66
|
+
|
|
|
67
|
+ var workorder = new BLL.T_Bus_WorkOrder().GetModelList(sql);
|
|
|
68
|
+ Telephone telephone = new Telephone();
|
|
|
69
|
+ telephone.type = new List<Proportion>();
|
|
|
70
|
+ for (int i=0;i <2;i++)
|
|
|
71
|
+ {
|
|
|
72
|
+ Proportion proportion = new Proportion();
|
|
|
73
|
+ if (i == 0)
|
|
|
74
|
+ proportion.name = "咨询";
|
|
|
75
|
+ else
|
|
|
76
|
+ proportion.name = "投诉";
|
|
|
77
|
+ proportion.total = 0;
|
|
|
78
|
+ proportion.proportion = "0.00%";
|
|
|
79
|
+ foreach (var it in workorder)
|
|
|
80
|
+ {
|
|
|
81
|
+ if (i == 0 && it.F_Type == 1)
|
|
|
82
|
+ proportion.total++;
|
|
|
83
|
+ else if (i == 1 && it.F_Type == 2)
|
|
|
84
|
+ proportion.total++;
|
|
|
85
|
+ }
|
|
|
86
|
+ telephone.type.Add(proportion);
|
|
|
87
|
+ }
|
|
|
88
|
+ Model.T_Call_CallRecords t_Call_CallRecords = new Model.T_Call_CallRecords();
|
|
|
89
|
+ var CallRecords = new BLL.T_Call_CallRecords().GetModelList(where);
|
|
|
90
|
+ telephone.conversations = new List<Conversation>();
|
|
|
91
|
+ for (int i=0;i<24;i++)
|
|
|
92
|
+ {
|
|
|
93
|
+ Conversation conversation = new Conversation();
|
|
|
94
|
+ conversation.Connect = 0;
|
|
|
95
|
+ conversation.Incomingcall = 0;
|
|
|
96
|
+ foreach (var it in CallRecords)
|
|
|
97
|
+ {
|
|
|
98
|
+ var time = DateTime.Parse(it.BeginTime.ToString()).Hour;
|
|
|
99
|
+ if ( time ==i )
|
|
|
100
|
+ {
|
|
|
101
|
+ conversation.Incomingcall++;
|
|
|
102
|
+ if (it.CallState == 1)
|
|
|
103
|
+ conversation.Connect++;
|
|
|
104
|
+ }
|
|
|
105
|
+ }
|
|
|
106
|
+ telephone.conversations.Add(conversation);
|
|
|
107
|
+ }
|
|
|
108
|
+ int t = 0;
|
|
|
109
|
+ telephone.dates = new List<TotalDate>();
|
|
|
110
|
+ TotalDate totalDate = new TotalDate();
|
|
|
111
|
+ totalDate.connection = 0;
|
|
|
112
|
+ totalDate.traffic = 0;
|
|
|
113
|
+ foreach (var it in CallRecords)
|
|
|
114
|
+ {
|
|
|
115
|
+ t +=(int ) it.LongTime;
|
|
|
116
|
+ if (it.CallState == 1)
|
|
|
117
|
+ totalDate.connection++;
|
|
|
118
|
+ totalDate.traffic++;
|
|
|
119
|
+ }
|
|
|
120
|
+ if (CallRecords.Count > 0)
|
|
|
121
|
+ totalDate.average = string.Format("{0:f2}",
|
|
|
122
|
+ (double ) t / CallRecords.Count);
|
|
|
123
|
+ telephone.dates.Add(totalDate);
|
|
|
124
|
+ return Success("获取成功", telephone);
|
|
|
125
|
+ }
|
|
|
126
|
+ public class BigDate
|
|
|
127
|
+ {
|
|
|
128
|
+ public List<Realtime> realtime;//当日工单数量实时
|
|
|
129
|
+ public List<Acceptancetime> acceptancetimes ;//24小时时段受理量/处理量分布图
|
|
|
130
|
+ public List<Quantity> states ;//工单各状态数量分布
|
|
|
131
|
+ public List<Quantity> region;//受理区域饼图
|
|
|
132
|
+ }
|
|
|
133
|
+ public class Quantity
|
|
|
134
|
+ {
|
|
|
135
|
+ public string name;
|
|
|
136
|
+ public int total;
|
|
|
137
|
+ }
|
|
|
138
|
+ public class Acceptancetime
|
|
|
139
|
+ {
|
|
|
140
|
+ public int time;
|
|
|
141
|
+ public int accept;
|
|
|
142
|
+ public int handle;
|
|
|
143
|
+ }
|
|
|
144
|
+ public class Realtime
|
|
|
145
|
+ {
|
|
|
146
|
+ public int time;
|
|
|
147
|
+ public int total;
|
|
|
148
|
+ }
|
|
|
149
|
+ /// <summary>
|
|
|
150
|
+ /// 工单分布情况表
|
|
|
151
|
+ /// </summary>
|
|
|
152
|
+ /// <param name="stime"></param>
|
|
|
153
|
+ /// <param name="endtime"></param>
|
|
|
154
|
+ /// <returns></returns>
|
|
|
155
|
+ public ActionResult GetBigdataList(string stime, string endtime)
|
|
|
156
|
+ {
|
|
|
157
|
+ string sql = $" F_IsDelete=0";
|
|
|
158
|
+ DataTable dt = new DataTable();
|
|
|
159
|
+ if (stime=="")
|
|
|
160
|
+ sql += " and datediff(day,F_CreateTime,'" + DateTime.Now.ToString("yyyy-MM-dd") + "')<=0 ";
|
|
|
161
|
+ else
|
|
|
162
|
+ sql += " and datediff(day,F_CreateTime,'" + stime + "')<=0 ";
|
|
|
163
|
+ if (endtime == "")
|
|
|
164
|
+ sql += " and datediff(day,F_CreateTime,'" + DateTime.Now.ToString("yyyy-MM-dd") + "')>=0 ";
|
|
|
165
|
+ else
|
|
|
166
|
+ sql += " and datediff(day,F_CreateTime,'" + endtime + "')>=0 ";
|
|
|
167
|
+ var workorder = new BLL.T_Bus_WorkOrder().GetModelList(sql);
|
|
|
168
|
+ BigDate bigDate = new BigDate();
|
|
|
169
|
+ bigDate.realtime = new List<Realtime>();
|
|
|
170
|
+ bigDate.acceptancetimes = new List<Acceptancetime>();
|
|
|
171
|
+ for (int i = 0; i < 24; i++)
|
|
|
172
|
+ {
|
|
|
173
|
+ Realtime realtime = new Realtime();
|
|
|
174
|
+ Acceptancetime acceptancetime = new Acceptancetime();
|
|
|
175
|
+ realtime.time = i;
|
|
|
176
|
+ realtime.total = 0;
|
|
|
177
|
+ acceptancetime.time = i;
|
|
|
178
|
+ acceptancetime.accept = 0;
|
|
|
179
|
+ acceptancetime.handle = 0;
|
|
|
180
|
+ foreach (var it in workorder)
|
|
|
181
|
+ {
|
|
|
182
|
+ var time = DateTime.Parse(it.F_CreateTime.ToString()).Hour;
|
|
|
183
|
+ if (time == i)
|
|
|
184
|
+ {
|
|
|
185
|
+ realtime.total++;
|
|
|
186
|
+ acceptancetime.accept++;
|
|
|
187
|
+ }
|
|
|
188
|
+ if(it .F_State ==4|| it.F_State == 10)
|
|
|
189
|
+ {
|
|
|
190
|
+ var handletime = DateTime.Parse(it.F_DealTime.ToString()).Hour;
|
|
|
191
|
+ if (handletime == i)
|
|
|
192
|
+ {
|
|
|
193
|
+ acceptancetime.handle++;
|
|
|
194
|
+ }
|
|
|
195
|
+ }
|
|
|
196
|
+ }
|
|
|
197
|
+ bigDate.realtime.Add(realtime);
|
|
|
198
|
+ bigDate.acceptancetimes.Add(acceptancetime);
|
|
|
199
|
+ }
|
|
|
200
|
+ bigDate.states = new List<Quantity>();
|
|
|
201
|
+ bigDate.region = new List<Quantity>();
|
|
|
202
|
+ for (int i=0;i<7;i ++)
|
|
|
203
|
+ {
|
|
|
204
|
+ Quantity state = new Quantity();
|
|
|
205
|
+ state.total = 0;
|
|
|
206
|
+ foreach (var it in workorder)
|
|
|
207
|
+ {
|
|
|
208
|
+ switch (i)
|
|
|
209
|
+ {
|
|
|
210
|
+ case 0:
|
|
|
211
|
+ state.name = "待提交";
|
|
|
212
|
+ if (it.F_State == 0)
|
|
|
213
|
+ state.total++;
|
|
|
214
|
+ break;
|
|
|
215
|
+ case 1:
|
|
|
216
|
+ state.name = "待指派";
|
|
|
217
|
+ if (it.F_State == 1)
|
|
|
218
|
+ state.total++;
|
|
|
219
|
+ break;
|
|
|
220
|
+ case 2:
|
|
|
221
|
+ state.name = "待处理";
|
|
|
222
|
+ if (it.F_State == 3)
|
|
|
223
|
+ state.total++;
|
|
|
224
|
+ break;
|
|
|
225
|
+ case 3:
|
|
|
226
|
+ state.name = "处理中";
|
|
|
227
|
+ if (it.F_State == 4)
|
|
|
228
|
+ state.total++;
|
|
|
229
|
+ break;
|
|
|
230
|
+ case 4:
|
|
|
231
|
+ state.name = "退回待提交";
|
|
|
232
|
+ if (it.F_State == 6)
|
|
|
233
|
+ state.total++;
|
|
|
234
|
+ break;
|
|
|
235
|
+ case 5:
|
|
|
236
|
+ state.name = "退回待指派";
|
|
|
237
|
+ if (it.F_State == 5)
|
|
|
238
|
+ state.total++;
|
|
|
239
|
+ break;
|
|
|
240
|
+ case 6:
|
|
|
241
|
+ state.name = "已处理";
|
|
|
242
|
+ if (it.F_State == 10)
|
|
|
243
|
+ state.total++;
|
|
|
244
|
+ break;
|
|
|
245
|
+ }
|
|
|
246
|
+ }
|
|
|
247
|
+ bigDate.states.Add(state);
|
|
|
248
|
+ }
|
|
|
249
|
+ var datement = new BLL.T_Sys_Department().GetModelList("isnull(F_ParentId, 1) = '1' and F_State = 1 and F_Layer = 1 order by F_Sort asc");
|
|
|
250
|
+ if (datement!=null )
|
|
|
251
|
+ {
|
|
|
252
|
+ foreach (var it in datement)
|
|
|
253
|
+ {
|
|
|
254
|
+ Quantity quantity = new Quantity();
|
|
|
255
|
+ quantity.name = it.F_DeptName;
|
|
|
256
|
+ quantity.total = 0;
|
|
|
257
|
+ foreach (var iv in workorder)
|
|
|
258
|
+ {
|
|
|
259
|
+ if (iv .F_State >0 && !string .IsNullOrEmpty (iv.F_Area))
|
|
|
260
|
+ {
|
|
|
261
|
+ try
|
|
|
262
|
+ {
|
|
|
263
|
+ if (int.Parse(iv.F_Area) == it.F_DeptId)
|
|
|
264
|
+ quantity.total++;
|
|
|
265
|
+ }
|
|
|
266
|
+ catch
|
|
|
267
|
+ {
|
|
|
268
|
+ }
|
|
|
269
|
+
|
|
|
270
|
+ }
|
|
|
271
|
+ }
|
|
|
272
|
+ bigDate.region.Add(quantity);
|
|
|
273
|
+ }
|
|
|
274
|
+ }
|
|
16
|
275
|
|
|
17
|
|
-
|
|
|
276
|
+ return Success("获取成功", bigDate);
|
|
|
277
|
+ }
|
|
18
|
278
|
/// <summary>
|
|
19
|
279
|
/// 市场信息简报
|
|
20
|
280
|
/// </summary>
|
|
|
@@ -273,6 +533,21 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
273
|
533
|
Date date = new Date();
|
|
274
|
534
|
date.total = modelList.Count;
|
|
275
|
535
|
date.name = "合计";
|
|
|
536
|
+ date.MonthCount1 = 0;
|
|
|
537
|
+ date.MonthCount1name = timeslot.stime + "-" + timeslot.etime + "月份日期";
|
|
|
538
|
+ date.MonthCountmix1 = "0.00%";
|
|
|
539
|
+ date.MonthCount2 = 0;
|
|
|
540
|
+ date.MonthCount2name = timeslot.onetime + "月份日期";
|
|
|
541
|
+ date.MonthCountmix2 = "0.00%";
|
|
|
542
|
+ date.MonthCount3 = 0;
|
|
|
543
|
+ date.MonthCount3name = timeslot.twotime + "月份日期";
|
|
|
544
|
+ date.MonthCountmix3 = "0.00%";
|
|
|
545
|
+ date.MonthCount4 = 0;
|
|
|
546
|
+ date.MonthCount4name = timeslot.threetime + "月份日期";
|
|
|
547
|
+ date.MonthCountmix4 = "0.00%";
|
|
|
548
|
+ date.MonthCount5 = 0;
|
|
|
549
|
+ date.MonthCount5name = "不清楚日期";
|
|
|
550
|
+ date.MonthCountmix5 = "0.00%";
|
|
276
|
551
|
for (int j = 0; j < modelList.Count; j++)
|
|
277
|
552
|
{
|
|
278
|
553
|
if (!string.IsNullOrEmpty(modelList[j].F_ProductDate))
|
|
|
@@ -328,7 +603,7 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
328
|
603
|
product.factory = new List<Factory>();
|
|
329
|
604
|
var EquipmentNumber = new BLL.T_Sys_EquipmentNumber().GetModelList("F_IsDelete=0");
|
|
330
|
605
|
|
|
331
|
|
- if (EquipmentNumber!=null && modelList.Count>0)
|
|
|
606
|
+ if (EquipmentNumber!=null )
|
|
332
|
607
|
{
|
|
333
|
608
|
int total = 0;
|
|
334
|
609
|
foreach (var it in EquipmentNumber)
|
|
|
@@ -346,7 +621,8 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
346
|
621
|
factory.number++;
|
|
347
|
622
|
}
|
|
348
|
623
|
}
|
|
349
|
|
- factory.proportion = string.Format("{0:f2}%", (float)factory.number / modelList.Count*100);
|
|
|
624
|
+ if (modelList.Count > 0)
|
|
|
625
|
+ factory.proportion = string.Format("{0:f2}%", (float)factory.number / modelList.Count*100);
|
|
350
|
626
|
product.factory.Add(factory);
|
|
351
|
627
|
}
|
|
352
|
628
|
product.factory.Sort((a, b) => b.number.CompareTo(a.number));
|
|
|
@@ -354,12 +630,13 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
354
|
630
|
factor.name = "合计";
|
|
355
|
631
|
factor.number = total;
|
|
356
|
632
|
factor.proportion = "0.00%";
|
|
357
|
|
- factor.proportion = string.Format("{0:f2}%", (float)total / modelList.Count * 100);
|
|
|
633
|
+ if (modelList.Count > 0)
|
|
|
634
|
+ factor.proportion = string.Format("{0:f2}%", (float)total / modelList.Count * 100);
|
|
358
|
635
|
product.factory.Add(factor);
|
|
359
|
636
|
}
|
|
360
|
637
|
var problem = new BLL.T_Sys_DictionaryValue().GetModelList("F_DictionaryFlag='WTDM'");
|
|
361
|
638
|
product.problem = new List<Factory>();
|
|
362
|
|
- if (problem != null && modelList.Count > 0)
|
|
|
639
|
+ if (problem != null)
|
|
363
|
640
|
{
|
|
364
|
641
|
int total = 0;
|
|
365
|
642
|
foreach (var it in problem)
|
|
|
@@ -376,6 +653,7 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
376
|
653
|
factory.number++;
|
|
377
|
654
|
}
|
|
378
|
655
|
}
|
|
|
656
|
+ if (modelList.Count>0)
|
|
379
|
657
|
factory.proportion = string.Format("{0:f2}%", (float)factory.number / modelList.Count * 100);
|
|
380
|
658
|
product.problem.Add(factory);
|
|
381
|
659
|
}
|
|
|
@@ -384,13 +662,14 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
384
|
662
|
factor.name = "合计";
|
|
385
|
663
|
factor.number = total;
|
|
386
|
664
|
factor.proportion = "0.00%";
|
|
387
|
|
- factor.proportion = string.Format("{0:f2}%", (float)total / modelList.Count * 100);
|
|
|
665
|
+ if (modelList.Count > 0)
|
|
|
666
|
+ factor.proportion = string.Format("{0:f2}%", (float)total / modelList.Count * 100);
|
|
388
|
667
|
product.problem.Add(factor);
|
|
389
|
668
|
}
|
|
390
|
669
|
|
|
391
|
670
|
var productcode = new BLL.T_Sys_DictionaryValue().GetModelList("F_DictionaryFlag='CPDM'");
|
|
392
|
671
|
product.product = new List<Factory>();
|
|
393
|
|
- if (productcode != null && modelList.Count > 0)
|
|
|
672
|
+ if (productcode != null )
|
|
394
|
673
|
{
|
|
395
|
674
|
int total = 0;
|
|
396
|
675
|
foreach (var it in productcode)
|
|
|
@@ -407,7 +686,8 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
407
|
686
|
factory.number++;
|
|
408
|
687
|
}
|
|
409
|
688
|
}
|
|
410
|
|
- factory.proportion = string.Format("{0:f2}%", (float)factory.number / modelList.Count * 100);
|
|
|
689
|
+ if (modelList.Count > 0)
|
|
|
690
|
+ factory.proportion = string.Format("{0:f2}%", (float)factory.number / modelList.Count * 100);
|
|
411
|
691
|
product.product.Add(factory);
|
|
412
|
692
|
}
|
|
413
|
693
|
product.product.Sort((a, b) => b.number.CompareTo(a.number));
|
|
|
@@ -415,7 +695,8 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
415
|
695
|
factor.name = "合计";
|
|
416
|
696
|
factor.number = total;
|
|
417
|
697
|
factor.proportion = "0.00%";
|
|
418
|
|
- factor.proportion = string.Format("{0:f2}%", (float)total / modelList.Count * 100);
|
|
|
698
|
+ if (modelList.Count > 0)
|
|
|
699
|
+ factor.proportion = string.Format("{0:f2}%", (float)total / modelList.Count * 100);
|
|
419
|
700
|
product.product.Add(factor);
|
|
420
|
701
|
}
|
|
421
|
702
|
|
|
|
@@ -431,7 +712,15 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
431
|
712
|
return Error("导出失败");
|
|
432
|
713
|
}
|
|
433
|
714
|
}
|
|
434
|
|
- return Success("获取成功", product);
|
|
|
715
|
+ var msg = time.Year + "年" + time.Month + "月份投诉产品日期分布情况表";
|
|
|
716
|
+ var obj = new
|
|
|
717
|
+ {
|
|
|
718
|
+ state = "success",
|
|
|
719
|
+ message = "成功",
|
|
|
720
|
+ rows = product,
|
|
|
721
|
+ msg= msg,
|
|
|
722
|
+ };
|
|
|
723
|
+ return Success("获取成功", obj);
|
|
435
|
724
|
#endregion
|
|
436
|
725
|
|
|
437
|
726
|
}
|
|
|
@@ -478,7 +767,82 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
478
|
767
|
}
|
|
479
|
768
|
return Success("成功", obj);
|
|
480
|
769
|
}
|
|
|
770
|
+ public class Feedback
|
|
|
771
|
+ {
|
|
|
772
|
+ public string name;
|
|
|
773
|
+ public int daynumber;
|
|
|
774
|
+ public int mounthnumber;
|
|
|
775
|
+ public int Totalnumber;
|
|
|
776
|
+ public string Proportion;
|
|
|
777
|
+ }
|
|
|
778
|
+ BLL.T_Bus_WorkOrder workOrder = new BLL.T_Bus_WorkOrder();
|
|
|
779
|
+ /// <summary>
|
|
|
780
|
+ /// 市场反馈一览表
|
|
|
781
|
+ /// </summary>
|
|
|
782
|
+ /// <returns></returns>
|
|
|
783
|
+ public ActionResult GetFeedbacklList(string stime, string endtime)
|
|
|
784
|
+ {
|
|
|
785
|
+ string sql = $" F_IsDelete=0";
|
|
|
786
|
+ DataTable dt = new DataTable();
|
|
|
787
|
+ #region 筛选条件
|
|
|
788
|
+ List<Feedback> modelList = new List<Feedback>(5);
|
|
|
789
|
+ string smonthtime = "";
|
|
|
790
|
+ if (!string.IsNullOrEmpty(stime))
|
|
|
791
|
+ {
|
|
|
792
|
+ smonthtime = stime.Trim() + " 00:00:01 "; ;
|
|
|
793
|
+ }
|
|
|
794
|
+ else
|
|
|
795
|
+ {
|
|
|
796
|
+ smonthtime = DateTime.Now.Date.ToString("yyyy-MM-01 00:00:00");
|
|
|
797
|
+ }
|
|
|
798
|
+ if (string.IsNullOrEmpty(endtime))
|
|
|
799
|
+ {
|
|
|
800
|
+ endtime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
801
|
+ }
|
|
|
802
|
+ else
|
|
|
803
|
+ {
|
|
|
804
|
+ endtime = endtime + " 23:59:59 "; ;
|
|
|
805
|
+ }
|
|
|
806
|
+ string sdaytime = DateTime.Now.Date.ToString("yy" +
|
|
|
807
|
+ "yy-MM-dd 00:00:00");
|
|
|
808
|
+ var WTDM = new BLL.T_Sys_DictionaryValue().GetModelList(" F_DictionaryFlag='" + "WTDM" + "' and F_State=1 ");
|
|
|
809
|
+ int daynumber = 0; int mounthnumber = 0;int Totalnumber = 0;
|
|
|
810
|
+ if (WTDM!=null )
|
|
|
811
|
+ {
|
|
|
812
|
+ foreach (var it in WTDM)
|
|
|
813
|
+ {
|
|
|
814
|
+ Feedback model = new Feedback();
|
|
|
815
|
+ model.name = it.F_Name ;
|
|
|
816
|
+ float a = workOrder.GetModelList(sql).Count;
|
|
|
817
|
+ model.daynumber = workOrder.GetModelList(sql + $" and datediff(day,F_CreateTime,'{sdaytime}')<=0 and datediff(day,F_CreateTime,'{endtime}')>=0 " + "and F_ProblemCode='" + it .F_Name +"'").Count;
|
|
|
818
|
+ daynumber += model.daynumber;
|
|
|
819
|
+ model.mounthnumber = workOrder.GetModelList(sql + $" and datediff(day,F_CreateTime,'{smonthtime}')<=0 and datediff(day,F_CreateTime,'{endtime}')>=0 " + "and F_ProblemCode='" + it.F_Name + "'").Count;
|
|
|
820
|
+ mounthnumber += model.mounthnumber;
|
|
|
821
|
+ model.Totalnumber = workOrder.GetModelList(sql + "and F_ProblemCode='"+it .F_Name + "'").Count;
|
|
|
822
|
+ Totalnumber += model.Totalnumber;
|
|
|
823
|
+ model.Proportion = string.Format("{0:f2}%", model.Totalnumber / a * 100);
|
|
|
824
|
+ modelList.Add(model);
|
|
|
825
|
+ }
|
|
|
826
|
+ }
|
|
|
827
|
+ Feedback modeltotal = new Feedback();
|
|
|
828
|
+ modeltotal.name = "合计";
|
|
|
829
|
+ float b = workOrder.GetModelList(sql).Count;
|
|
|
830
|
+ modeltotal.daynumber = daynumber;
|
|
|
831
|
+ modeltotal.mounthnumber = mounthnumber;
|
|
|
832
|
+ modeltotal.Totalnumber = Totalnumber ;
|
|
|
833
|
+ modeltotal.Proportion = string.Format("{0:f2}%", modeltotal.Totalnumber / b * 100);
|
|
|
834
|
+ modelList.Add(modeltotal);
|
|
|
835
|
+ #endregion
|
|
|
836
|
+ modelList.Sort((a, c) => c.Totalnumber .CompareTo(a.Totalnumber));
|
|
|
837
|
+ var obj = new
|
|
|
838
|
+ {
|
|
|
839
|
+ state = "success",
|
|
|
840
|
+ message = "成功",
|
|
|
841
|
+ rows = modelList
|
|
|
842
|
+ };
|
|
481
|
843
|
|
|
|
844
|
+ return Content(obj.ToJson()); ;
|
|
|
845
|
+ }
|
|
482
|
846
|
/// <summary>
|
|
483
|
847
|
/// 工单类型报表
|
|
484
|
848
|
/// </summary>
|