zhoufan %!s(int64=4) %!d(string=hace) años
padre
commit
c87bb2c006

+ 0 - 6
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/CallCenterApi.Interface.csproj

@@ -216,12 +216,6 @@
216 216
     <Compile Include="Controllers\report\TalkTimeController.cs" />
217 217
     <Compile Include="Controllers\report\TotalCallController.cs" />
218 218
     <Compile Include="Controllers\report\WOReportController.cs" />
219
-    <Compile Include="Controllers\report\WorkOrdersCloseRateController.cs" />
220
-    <Compile Include="Controllers\report\WorkOrdersComplaintTypeController.cs" />
221
-    <Compile Include="Controllers\report\WorkOrdersSourceController.cs" />
222
-    <Compile Include="Controllers\report\WorkOrdersTypeController.cs" />
223
-    <Compile Include="Controllers\report\WorkOrdersVisiSatisfactiontController.cs" />
224
-    <Compile Include="Controllers\report\WxReportController.cs" />
225 219
     <Compile Include="Controllers\report\YearContrastController.cs" />
226 220
     <Compile Include="Controllers\report\ZuoXiManYiDuController.cs" />
227 221
     <Compile Include="Controllers\report\ZuoXiTongHuaController.cs" />

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 247
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/WorkOrdersCloseRateController.cs


+ 0 - 228
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/WorkOrdersComplaintTypeController.cs

@@ -1,228 +0,0 @@
1
-using CallCenter.Utility;
2
-using CallCenterApi.DB;
3
-using CallCenterApi.Interface.Controllers.Base;
4
-using System;
5
-using System.Collections.Generic;
6
-using System.Data;
7
-using System.Linq;
8
-using System.Web;
9
-using System.Web.Mvc;
10
-
11
-namespace CallCenterApi.Interface.Controllers.report
12
-{
13
-    /// <summary>
14
-    /// 工单投诉类型报表
15
-    /// </summary>
16
-    public class WorkOrdersComplaintTypeController : BaseController
17
-    {
18
-        BLL.T_Sys_DictionaryValue bllDic = new BLL.T_Sys_DictionaryValue();
19
-        BLL.T_Wo_WorkOrder bllWo = new BLL.T_Wo_WorkOrder();
20
-
21
-        /// <summary>
22
-        /// 获取表头
23
-        /// </summary>
24
-        /// <returns></returns>
25
-        public ActionResult GetColumnList()
26
-        {
27
-            #region 添加表格标题
28
-            var columns = new List<string>();
29
-            columns.Add("投诉类型");
30
-            columns.Add("结案");
31
-            columns.Add("未结案");
32
-            columns.Add("未结案率");
33
-            #endregion
34
-            return Success("获取投诉类型标题成功", columns);
35
-        }
36
-
37
-        /// <summary>
38
-        /// 获取投诉类型报表
39
-        /// </summary>
40
-        /// <param name="areaid">区域</param>
41
-        /// <param name="regionid">项目</param>
42
-        /// <param name="stageid">期</param>
43
-        /// <param name="iseffective">是否有效</param>
44
-        /// <param name="gdly">工单类型</param>
45
-        /// <param name="stime"></param>
46
-        /// <param name="endtime"></param>
47
-        /// <returns></returns>
48
-        public ActionResult GetDataList(string years, int season = 0, int areaid = 0, int regionid = 0, int stageid = 0, int iseffective = -1, int gdly = 0, string stime = "", string endtime = "")
49
-        {
50
-            ActionResult res = NoToken("未知错误,请重新登录");
51
-            DataTable dtNew = new DataTable();
52
-            dtNew = getData(years, season, areaid, regionid, stageid, iseffective, gdly, stime, endtime);
53
-            res = Success("获取投诉类型数据成功", dtNew);
54
-
55
-            return res;
56
-        }
57
-
58
-        /// <summary>
59
-        /// 获取数据
60
-        /// </summary>
61
-        /// <param name="areaid">年份</param>
62
-        /// <param name="areaid">季度(1234数字)</param>
63
-        /// <param name="areaid">区域</param>
64
-        /// <param name="regionid">项目</param>
65
-        /// <param name="stageid">期</param>
66
-        /// <param name="iseffective">是否有效</param>
67
-        /// <param name="gdly">工单类型</param>
68
-        /// <param name="stime"></param>
69
-        /// <param name="endtime"></param>
70
-        /// <returns></returns>
71
-        private DataTable getData(string years, int season, int areaid, int regionid, int stageid, int iseffective, int gdly, string stime, string endtime)
72
-        {
73
-            DataTable dtNew = new DataTable();
74
-            #region 添加表格标题
75
-            DataColumn dc1 = new DataColumn("投诉类型", Type.GetType("System.String"));
76
-            DataColumn dc2 = new DataColumn("结案", Type.GetType("System.String"));
77
-            DataColumn dc3 = new DataColumn("未结案", Type.GetType("System.String"));
78
-            DataColumn dc4 = new DataColumn("结案率", Type.GetType("System.String"));
79
-            DataColumn dc5 = new DataColumn("总计", Type.GetType("System.String"));
80
-            dtNew.Columns.Add(dc1);
81
-            dtNew.Columns.Add(dc2);
82
-            dtNew.Columns.Add(dc3);
83
-            dtNew.Columns.Add(dc4);
84
-            dtNew.Columns.Add(dc5);
85
-            #endregion
86
-
87
-            #region 查询条件
88
-            string sqlWorkOrder = "";
89
-            string sqlRegion = "";
90
-
91
-            //年份参数存在
92
-            if (!string.IsNullOrEmpty(years))
93
-            {
94
-                //season = 0;
95
-                DateTime beginTime;
96
-                beginTime = Convert.ToDateTime(years + "-1-01 00:00:00");
97
-                sqlWorkOrder += $" AND CreateTime >='" + beginTime.ToString() + "' and  CreateTime<'" + beginTime.AddYears(1).AddSeconds(-1) + "'";
98
-
99
-                //季度参数存在
100
-                if (season > 0)
101
-                {
102
-                    //第一季度:1月-3月
103
-                    //第二季度:4月-6月
104
-                    //第三季度:7月-9月
105
-                    //第四季度:10月-12月
106
-                    bool isSeason = false;
107
-                    DateTime beginTimeSeason = DateTime.Now;
108
-                    if (season == 1)
109
-                    {
110
-                        isSeason = true;
111
-                        beginTimeSeason = Convert.ToDateTime(years + "-1-01 00:00:00");
112
-                    }
113
-                    else if (season == 2)
114
-                    {
115
-                        isSeason = true;
116
-                        beginTimeSeason = Convert.ToDateTime(years + "-4-01 00:00:00");
117
-                    }
118
-                    else if (season == 3)
119
-                    {
120
-                        isSeason = true;
121
-                        beginTimeSeason = Convert.ToDateTime(years + "-7-01 00:00:00");
122
-                    }
123
-                    else if (season == 4)
124
-                    {
125
-                        isSeason = true;
126
-                        beginTimeSeason = Convert.ToDateTime(years + "-10-01 00:00:00");
127
-                    }
128
-                    if (isSeason)
129
-                    {
130
-                        sqlWorkOrder += $" AND CreateTime >='" + beginTimeSeason.ToString() + "' and  CreateTime<'" + beginTimeSeason.AddMonths(3).AddSeconds(-1) + "'";
131
-                    }
132
-                }
133
-            }
134
-            if (areaid > 0)
135
-            {
136
-                sqlWorkOrder += " and IsUserSend = " + areaid + " ";
137
-                sqlRegion += $" AND (SELECT F_ParentId FROM dbo.T_Cus_RegionCategory WHERE F_RegionId = c.F_ParentId) = {areaid}";
138
-            }
139
-            if (regionid > 0)
140
-            {
141
-                sqlWorkOrder += " and IsAdminSend = " + regionid + " ";
142
-                sqlRegion += $" AND c.F_ParentId = {regionid}";
143
-            }
144
-            if (iseffective > -1)
145
-                sqlWorkOrder += " and IsTimeOut = " + iseffective + " ";
146
-            if (gdly>0)
147
-                sqlWorkOrder += " and Type = " + Convert.ToInt32(gdly) + " ";
148
-            if (stime != null && stime.Trim() != "")
149
-            {
150
-                sqlWorkOrder += " and CONVERT(varchar , CreateTime, 120)>=CONVERT(varchar , '" + stime.Trim() + " 00:00:01', 120) ";
151
-            }
152
-            if (endtime != null && endtime.Trim() != "")
153
-            {
154
-                sqlWorkOrder += " and CONVERT(varchar , CreateTime, 120)<=CONVERT(varchar , '" + endtime.Trim() + " 23:59:59', 120) ";
155
-            }
156
-            #endregion
157
-
158
-            //获取坐席数据
159
-            DataTable dt = new DataTable();
160
-            //可在添加工单时,查看投诉类型的项,目前通过表查询获取(名称不一样使用备注的字段信息)
161
-            string sql = " SELECT * FROM dbo.T_Sys_Department WHERE F_ParentCode = '|0|339|' AND F_DeptId != 553 ORDER BY F_Sort ASC ";
162
-            dt = DbHelperSQL.Query(sql).Tables[0];
163
-            //获取工单缓存
164
-            var listWo = bllWo.DataTableToList(bllWo.GetList($" IsDel=0 {sqlWorkOrder} ").Tables[0]);
165
-            int yesCount = 0, notCount = 0;
166
-            for (int i = 0; i < dt.Rows.Count; i++)
167
-            {
168
-                DataRow drNew = dtNew.NewRow();
169
-                drNew["投诉类型"] = dt.Rows[i]["F_DeptName"].ToString();
170
-                //State工单状态 0待指派,1待处理 2已处理   Source投诉类型(投诉部门)
171
-                var listYesCount = listWo.Where(x => x.State == 2 && x.Source == dt.Rows[i]["F_DeptId"].ToString()).Count();
172
-                var listNotCount = listWo.Where(x => (x.State == 0 || x.State == 1) && x.Source == dt.Rows[i]["F_DeptId"].ToString()).Count();
173
-                drNew["结案"] = listYesCount.ToString();
174
-                drNew["未结案"] = listNotCount.ToString();
175
-                //计算结案率
176
-                int totalCount = listYesCount + listNotCount;
177
-                drNew["总计"] = totalCount.ToString();
178
-                Double notRate = 0.00;
179
-                if (totalCount > 0)
180
-                    notRate = (double)listYesCount / (double)totalCount;
181
-                drNew["结案率"] = (notRate * 100).ToString("0.00") + "%";
182
-                //统计结案,未结案数
183
-                yesCount += listYesCount;
184
-                notCount += listNotCount;
185
-                dtNew.Rows.Add(drNew);
186
-            }
187
-            #region 获取一条统计信息
188
-            DataRow drzj = dtNew.NewRow();
189
-            drzj["投诉类型"] = "总计";
190
-            drzj["结案"] = yesCount.ToString();
191
-            drzj["未结案"] = notCount.ToString();
192
-            //计算结案率
193
-            int totalAllCount = yesCount + notCount;
194
-            drzj["总计"] = totalAllCount.ToString();
195
-            Double yesAllRate = 0.00;
196
-            if (totalAllCount > 0)
197
-                yesAllRate = (double)yesCount / (double)totalAllCount;
198
-            drzj["结案率"] = (yesAllRate * 100).ToString("0.00") + "%";
199
-            dtNew.Rows.Add(drzj);
200
-            #endregion
201
-            return dtNew;
202
-        }
203
-
204
-        /// <summary>
205
-        /// 导出投诉类型报表excel
206
-        /// </summary>
207
-        /// <returns></returns>
208
-        public ActionResult ExportExcel(string years, int season = 0, int areaid = 0, int regionid = 0, int stageid = 0, int iseffective = -1, int gdly = 0, string stime = "", string endtime = "")
209
-        {
210
-            ActionResult res = NoToken("未知错误,请重新登录");
211
-            if (Request.IsAuthenticated)
212
-            {
213
-                //导出dtnew
214
-                NPOIHelper npoi = new NPOIHelper();
215
-                DataTable dt = getData(years, season, areaid, regionid, stageid, iseffective, gdly, stime, endtime);
216
-                if (npoi.ExportToExcel("投诉类型数据报表", dt, null) == "")
217
-                {
218
-                    return Success("导出成功");
219
-                }
220
-                else
221
-                {
222
-                    return Error("导出失败");
223
-                }
224
-            }
225
-            return res;
226
-        }
227
-    }
228
-}

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 221
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/WorkOrdersSourceController.cs


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 222
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/WorkOrdersTypeController.cs


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 196
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/WorkOrdersVisiSatisfactiontController.cs


+ 0 - 225
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/WxReportController.cs

@@ -1,225 +0,0 @@
1
-using CallCenterApi.DB;
2
-using CallCenterApi.Interface.App_Start;
3
-using CallCenterApi.Interface.Controllers.Base;
4
-using System;
5
-using System.Collections.Generic;
6
-using System.Data;
7
-using System.Linq;
8
-using System.Web;
9
-using System.Web.Mvc;
10
-
11
-namespace CallCenterApi.Interface.Controllers.report
12
-{
13
-    /// <summary>
14
-    /// 微信报表
15
-    /// </summary>
16
-    public class WxReportController : BaseController
17
-    {
18
-        BLL.T_Sys_DictionaryValue bllDic = new BLL.T_Sys_DictionaryValue();
19
-        BLL.T_Wo_WorkOrder bllWo = new BLL.T_Wo_WorkOrder();
20
-        BLL.T_Cus_RegionCategory bllCus = new BLL.T_Cus_RegionCategory();
21
-
22
-        /// <summary>
23
-        /// 获取已完成工单报表
24
-        /// </summary>
25
-        /// <param name="daytype">今天today,昨天yesterday,本月month,今年year</param>
26
-        /// <returns></returns>
27
-        [WechatActionFilter]
28
-        public ActionResult GetWordOrderFinishReport(string daytype)
29
-        {
30
-            DataTable dtNew = new DataTable();
31
-            #region 添加表格标题
32
-            var modelList = bllDic.DataTableToList(bllDic.GetList(" F_State=1 and F_DictionaryFlag='GDLX' ").Tables[0]);
33
-            for (int i = 0; i < modelList.Count; i++)
34
-            {
35
-                string colname = modelList[i].F_Name;
36
-                dtNew.Columns.Add(new DataColumn(colname));
37
-            }
38
-            DataColumn dc4 = new DataColumn("合计", Type.GetType("System.String"));
39
-            dtNew.Columns.Add(dc4);
40
-            #endregion
41
-
42
-            #region 查询条件
43
-            string sql = " and State =2 ";  //完成工单
44
-            switch (daytype)
45
-            {
46
-                case "today":
47
-                    sql += " and DateDiff(dd,CreateTime,getdate())=0 ";
48
-                    break;
49
-                case "yesterday":
50
-                    sql += " and DateDiff(dd,CreateTime,getdate())=1 ";
51
-                    break;
52
-                case "month":
53
-                    sql += " and DateDiff(mm,CreateTime,getdate())=0 ";
54
-                    break;
55
-                case "year":
56
-                    sql += " and DateDiff(yy,CreateTime,getdate())=0 ";
57
-                    break;
58
-                default:
59
-                    break;
60
-            }
61
-            #endregion            
62
-            //从几开始
63
-            int n = 0;
64
-            //获取工单缓存
65
-            var listWo = bllWo.DataTableToList(bllWo.GetList($" IsDel=0 {sql} ").Tables[0]);
66
-            int sumAll = 0;
67
-            DataRow drNew = dtNew.NewRow();
68
-            for (int j = 0; j < modelList.Count; j++)
69
-            {
70
-                var listCount = listWo.Where(x => x.TypeClass == Convert.ToInt32(modelList[j].F_DictionaryValueId.ToString())).Count();
71
-                sumAll += listCount;
72
-                drNew[j + n] = listCount.ToString();
73
-            }
74
-            drNew["合计"] = sumAll;
75
-            dtNew.Rows.Add(drNew);
76
-
77
-            return Success("获取已完成工单数据成功", dtNew);
78
-        }
79
-
80
-        /// <summary>
81
-        /// 获取类型工单报表
82
-        /// </summary>
83
-        /// <param name="daytype">今天today,昨天yesterday,本月month,今年year</param>
84
-        /// <returns></returns>
85
-        [WechatActionFilter]
86
-        public ActionResult GetWordOrderTypeReport(string daytype)
87
-        {
88
-            DataTable dtNew = new DataTable();
89
-            var config = new BLL.T_Sys_SystemConfig().GetModelList(" F_ParamCode='TimeLimitDays' ").FirstOrDefault();
90
-            int days = config != null ? Convert.ToInt32(config.F_ParamValue) : 60;  //默认60天
91
-            #region 查询条件
92
-            string sql = " and IsDel=0 ";
93
-            switch (daytype)
94
-            {
95
-                case "today":
96
-                    sql += " and DateDiff(dd,CreateTime,getdate())=0 ";
97
-                    break;
98
-                case "yesterday":
99
-                    sql += " and DateDiff(dd,CreateTime,getdate())=1 ";
100
-                    break;
101
-                case "month":
102
-                    sql += " and DateDiff(mm,CreateTime,getdate())=0 ";
103
-                    break;
104
-                case "year":
105
-                    sql += " and DateDiff(yy,CreateTime,getdate())=0 ";
106
-                    break;
107
-                default:
108
-                    break;
109
-            }
110
-            #endregion            
111
-            //1、待指派的
112
-            string uwhere = " 1=1 and IsAudit = 1 ";
113
-            //2、待接单的
114
-            string djdwhere = " 1=1 and IsAudit = 1 and WorkOrderID in (SELECT WorkOrderID FROM dbo.T_Wo_WorkOrderItem WHERE  IsDel=0 and Type=1 and state='0') ";
115
-            //3、待完成(处理)的
116
-            string dclwhere = " 1=1 and IsAudit = 1 and WorkOrderID in (SELECT WorkOrderID FROM dbo.T_Wo_WorkOrderItem WHERE IsDel=0 and Type=1 and state='1') ";
117
-            //4、已处理的
118
-            string yclwhere = " 1=1 and IsAudit = 1 ";
119
-            ////5、我参与的
120
-            //string wcywhere = " 1=1 and IsAudit = 1 and  (WorkOrderID in ( '" + woController.GetCYWorkOrderID(ua.F_UserCode) + "')) ";
121
-            //5、超期工单
122
-            string cqwhere = $" 1=1 and IsAudit = 1 and DATEADD(DAY,{days},CreateTime) < GETDATE() ";
123
-           //获取工单缓存
124
-            int dpd = bllWo.GetList(uwhere + sql + " and State=0 ").Tables[0].Rows.Count;       //待指派的统计
125
-            int djd = bllWo.GetList(djdwhere + sql + " and State =1 ").Tables[0].Rows.Count;    //待接单的统计
126
-            int dcl = bllWo.GetList(dclwhere + sql + " and State =1 ").Tables[0].Rows.Count;    //待处理的统计
127
-            int ycl = bllWo.GetList(yclwhere + sql + " and State =2 ").Tables[0].Rows.Count;    //已处理的统计
128
-            //int wyc = bllWo.GetList(wcywhere + sql + " ").Tables[0].Rows.Count;    //我参与的的统计
129
-            int cq = bllWo.GetList(cqwhere + sql + " AND State < 2 ").Tables[0].Rows.Count;    //超期工单的统计     
130
-            double dpd_rate = 0, djd_rate = 0, dcl_rate = 0,ycl_rate = 0,cq_rate = 0;
131
-            int total = dpd + djd + dcl + ycl + cq;
132
-            if (total > 0)
133
-            {
134
-                dpd_rate = dpd * 100 / (double)total;
135
-                djd_rate = djd * 100 / (double)total;
136
-                dcl_rate = dcl * 100 / (double)total;
137
-                ycl_rate = ycl * 100 / (double)total;
138
-                cq_rate = cq * 100 / (double)total;
139
-            }
140
-            var obj = new
141
-            {
142
-                dpd_rates = (dpd_rate).ToString("0.00") + "%",     //待派单
143
-                dpds = dpd,
144
-                djd_rates = (djd_rate).ToString("0.00") + "%",    //待接单
145
-                djds = djd,
146
-                dcl_rates = (dcl_rate).ToString("0.00") + "%",    //待完成
147
-                dcls = dcl,
148
-                ycl_rates = (ycl_rate).ToString("0.00") + "%",    //已完成
149
-                ycls = ycl,
150
-                cq_rates = (cq_rate).ToString("0.00") + "%",      //超期工单
151
-                cqs = cq,
152
-            };
153
-            return Success("获取工单类型数据成功", obj);
154
-        }
155
-
156
-        /// <summary>
157
-        /// 获取区域工单报表
158
-        /// </summary>
159
-        /// <param name="daytype">今天today,昨天yesterday,本月month,今年year</param>
160
-        /// <returns></returns>
161
-        [WechatActionFilter]
162
-        public ActionResult GetWordOrderAreaReport(string daytype)
163
-        {
164
-            DataTable dtNew = new DataTable();
165
-            #region 添加表格标题
166
-            var modelList = bllCus.DataTableToList(bllCus.GetList(" F_ParentId = 0 AND F_DeleteFlag = 0 ").Tables[0]);
167
-            for (int i = 0; i < modelList.Count; i++)
168
-            {
169
-                string colname = modelList[i].F_RegionName;
170
-                dtNew.Columns.Add(new DataColumn(colname));
171
-            }
172
-            DataColumn dc4 = new DataColumn("合计", Type.GetType("System.String"));
173
-            dtNew.Columns.Add(dc4);
174
-            #endregion
175
-
176
-            #region 查询条件
177
-            string sql = " and State =2 ";  //完成工单
178
-            switch (daytype)
179
-            {
180
-                case "today":
181
-                    sql += " and DateDiff(dd,CreateTime,getdate())=0 ";
182
-                    break;
183
-                case "yesterday":
184
-                    sql += " and DateDiff(dd,CreateTime,getdate())=1 ";
185
-                    break;
186
-                case "month":
187
-                    sql += " and DateDiff(mm,CreateTime,getdate())=0 ";
188
-                    break;
189
-                case "year":
190
-                    sql += " and DateDiff(yy,CreateTime,getdate())=0 ";
191
-                    break;
192
-                default:
193
-                    break;
194
-            }
195
-            #endregion            
196
-            //从几开始
197
-            int n = 0;
198
-            //获取工单缓存
199
-            var listWo = bllWo.DataTableToList(bllWo.GetList($" IsDel=0 {sql} ").Tables[0]);
200
-            int sumAll = 0;
201
-            DataRow drNew = dtNew.NewRow();
202
-            for (int j = 0; j < modelList.Count; j++)
203
-            {
204
-                var listCount = listWo.Where(x => x.IsUserSend == Convert.ToInt32(modelList[j].F_RegionId.ToString())).Count();
205
-                sumAll += listCount;
206
-            }
207
-            for (int j = 0; j < modelList.Count; j++)
208
-            {
209
-                var listCount = listWo.Where(x => x.IsUserSend == Convert.ToInt32(modelList[j].F_RegionId.ToString())).Count();
210
-                double sumOne = 0;
211
-                if (sumAll > 0)
212
-                {
213
-                    sumOne = listCount * 100 / (double)sumAll;
214
-                }
215
-                drNew[j + n] = listCount.ToString();    // + " (" + (sumOne).ToString("0.00") + "%)"
216
-            }
217
-            drNew["合计"] = sumAll;
218
-            dtNew.Rows.Add(drNew);
219
-
220
-            return Success("获取工单区域数据成功", dtNew);
221
-        }
222
-
223
-
224
-    }
225
-}