|
|
@@ -58,7 +58,7 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
58
|
58
|
}
|
|
59
|
59
|
|
|
60
|
60
|
/// <summary>
|
|
61
|
|
- /// 投诉原因报表
|
|
|
61
|
+ /// 工单类型报表
|
|
62
|
62
|
/// </summary>
|
|
63
|
63
|
/// <returns></returns>
|
|
64
|
64
|
public ActionResult GetTypeReport(string sdate, string edate, int isdc = 0)
|
|
|
@@ -95,7 +95,58 @@ namespace CallCenterApi.Interface.Controllers.report
|
|
95
|
95
|
if (isdc > 0)
|
|
96
|
96
|
{
|
|
97
|
97
|
NPOIHelper npoi = new NPOIHelper();
|
|
98
|
|
- if (npoi.ExportToExcel("投诉原因", dt,new string[] { "投诉类型", "数量"}) == "")
|
|
|
98
|
+ if (npoi.ExportToExcel("工单类型", dt,new string[] { "工单类型", "数量"}) == "")
|
|
|
99
|
+ {
|
|
|
100
|
+ return Success("导出成功");
|
|
|
101
|
+ }
|
|
|
102
|
+ else
|
|
|
103
|
+ {
|
|
|
104
|
+ return Error("导出失败");
|
|
|
105
|
+ }
|
|
|
106
|
+ }
|
|
|
107
|
+
|
|
|
108
|
+ return Success("成功", dt);
|
|
|
109
|
+ }
|
|
|
110
|
+
|
|
|
111
|
+ /// <summary>
|
|
|
112
|
+ /// 投诉类型报表
|
|
|
113
|
+ /// </summary>
|
|
|
114
|
+ /// <returns></returns>
|
|
|
115
|
+ public ActionResult GetSmallTypeReport(string sdate, string edate, int isdc = 0)
|
|
|
116
|
+ {
|
|
|
117
|
+ int userId = CurrentUser.UserData.F_UserId;
|
|
|
118
|
+ Model.T_Sys_UserAccount userModel = new BLL.T_Sys_UserAccount().GetModel(userId);
|
|
|
119
|
+
|
|
|
120
|
+ DateTime stime = DateTime.Now;
|
|
|
121
|
+ DateTime etime = DateTime.Now;
|
|
|
122
|
+
|
|
|
123
|
+ if (!string.IsNullOrEmpty(sdate))
|
|
|
124
|
+ {
|
|
|
125
|
+ stime = DateTime.Parse(sdate);
|
|
|
126
|
+ }
|
|
|
127
|
+ if (!string.IsNullOrEmpty(edate))
|
|
|
128
|
+ {
|
|
|
129
|
+ etime = DateTime.Parse(edate);
|
|
|
130
|
+ }
|
|
|
131
|
+ if (string.IsNullOrEmpty(sdate) && string.IsNullOrEmpty(edate))
|
|
|
132
|
+ {
|
|
|
133
|
+ stime = new DateTime(stime.Year, stime.Month, 1);
|
|
|
134
|
+ }
|
|
|
135
|
+ string where = " F_IsDelete=0 and datediff(day,F_CreateTime,'" + stime + "')<=0 "
|
|
|
136
|
+ + " and datediff(day,F_CreateTime,'" + etime + "')>=0 and F_SmallType=F_DictionaryValueId ";
|
|
|
137
|
+ if (!string.IsNullOrEmpty(userModel.groupcode))
|
|
|
138
|
+ {
|
|
|
139
|
+ where += " and F_GroupCode = '" + userModel.groupcode + "' ";
|
|
|
140
|
+ }
|
|
|
141
|
+ string sql = " select F_Name TypeName,(select COUNT(1) from T_Bus_WorkOrder where " + where
|
|
|
142
|
+ + " ) Count from dbo.T_Sys_DictionaryValue where F_DictionaryFlag='TSLX' and F_State=1 ";
|
|
|
143
|
+
|
|
|
144
|
+ DataTable dt = DbHelperSQL.Query(sql).Tables[0];
|
|
|
145
|
+
|
|
|
146
|
+ if (isdc > 0)
|
|
|
147
|
+ {
|
|
|
148
|
+ NPOIHelper npoi = new NPOIHelper();
|
|
|
149
|
+ if (npoi.ExportToExcel("投诉类型", dt, new string[] { "投诉类型", "数量" }) == "")
|
|
99
|
150
|
{
|
|
100
|
151
|
return Success("导出成功");
|
|
101
|
152
|
}
|