Browse Source

日志,归属地报表 代码提交

zhangkun 5 years ago
parent
commit
73149f5cff

web/BaseCallCenter.BLL/T_Sys_MobileData.cs → web/BaseCallCenter.BLL/HW/T_Sys_MobileData.cs


+ 12 - 0
web/BaseCallCenter.BLL/Report/ReportBLL.cs

@@ -113,6 +113,18 @@ namespace YTSoft.BaseCallCenter.BLL
113 113
         {
114 114
             return dal.GetOtherData9(startDate, endDate);
115 115
         }
116
+
117
+
118
+        /// <summary>
119
+        /// 首呼解决率
120
+        /// </summary>
121
+        /// <param name="StartDate">开始日期</param>
122
+        /// <param name="EndDate">结束日期</param>
123
+        /// <returns></returns>
124
+        public DataTable GetOtherData10(string startDate, string endDate)
125
+        {
126
+            return dal.GetOtherData10(startDate, endDate);
127
+        }
116 128
         #endregion
117 129
 
118 130
     }

+ 1 - 1
web/BaseCallCenter.BLL/YTSoft.BaseCallCenter.BLL.csproj

@@ -111,7 +111,7 @@
111 111
     <Compile Include="T_Sys_FunctionLogs.cs" />
112 112
     <Compile Include="T_Sys_IDCardInfo.cs" />
113 113
     <Compile Include="T_Sys_LoginLogs.cs" />
114
-    <Compile Include="T_Sys_MobileData.cs" />
114
+    <Compile Include="HW\T_Sys_MobileData.cs" />
115 115
     <Compile Include="T_Sys_ModuleFunctions.cs" />
116 116
     <Compile Include="T_Sys_ModuleFunctionsOpt.cs" />
117 117
     <Compile Include="T_Sys_ModuleInfo.cs" />

web/BaseCallCenter.DAL/T_Sys_MobileData.cs → web/BaseCallCenter.DAL/HW/T_Sys_MobileData.cs


+ 44 - 0
web/BaseCallCenter.DAL/Report/ReportDAL.cs

@@ -262,6 +262,50 @@ namespace YTSoft.BaseCallCenter.DAL
262 262
 
263 263
 
264 264
         }
265
+
266
+        /// <summary>
267
+        /// 首呼解决率
268
+        /// </summary>
269
+        /// <param name="startDate"></param>
270
+        /// <param name="endDate"></param>
271
+        /// <returns></returns>
272
+        public DataTable GetOtherData10(string startDate, string endDate)
273
+        {
274
+            StringBuilder strSql = new StringBuilder();
275
+            strSql.Append("SELECT COUNT(1) num,t.CallState FROM   ");
276
+            strSql.Append(" (SELECT CASE   ");
277
+            //首呼解决
278
+            strSql.Append("  WHEN F_FORMID =0 AND F_WORKORDERSTATEID IN(2, 4, 5)  THEN 1   ");
279
+            //转单
280
+            strSql.Append("  ELSE 0 END AS CallState FROM T_Wo_WorkOrderBase   ");
281
+
282
+            strSql.Append(" where 1=1 ");
283
+            if (!string.IsNullOrEmpty(startDate))
284
+            {
285
+                strSql.Append(" and F_CreateDate>='" + startDate + "  00:00:00' ");
286
+            }
287
+
288
+            if (!string.IsNullOrEmpty(endDate))
289
+            {
290
+                strSql.Append(" and F_CreateDate<='" + endDate + " 23:59:59' ");
291
+            }
292
+
293
+
294
+            strSql.Append(" ) t GROUP BY t.CallState");
295
+
296
+            DataSet ds = DbHelperSQL.Query(strSql.ToString());
297
+            if (ds.Tables[0].Rows.Count > 0)
298
+            {
299
+                return ds.Tables[0];
300
+            }
301
+            else
302
+            {
303
+                return null;
304
+            }
305
+
306
+
307
+        }
308
+
265 309
         #endregion
266 310
 
267 311
         #region 定责类型统计报表

+ 1 - 1
web/BaseCallCenter.DAL/YTSoft.BaseCallCenter.DAL.csproj

@@ -114,7 +114,7 @@
114 114
     <Compile Include="T_Sys_FunctionLogs.cs" />
115 115
     <Compile Include="T_Sys_IDCardInfo.cs" />
116 116
     <Compile Include="T_Sys_LoginLogs.cs" />
117
-    <Compile Include="T_Sys_MobileData.cs" />
117
+    <Compile Include="HW\T_Sys_MobileData.cs" />
118 118
     <Compile Include="T_Sys_ModuleFunctions.cs" />
119 119
     <Compile Include="T_Sys_ModuleFunctionsOpt.cs" />
120 120
     <Compile Include="T_Sys_ModuleInfo.cs" />

web/BaseCallCenter.Model/T_Sys_MobileData.cs → web/BaseCallCenter.Model/HW/T_Sys_MobileData.cs


+ 1 - 1
web/BaseCallCenter.Model/YTSoft.BaseCallCenter.Model.csproj

@@ -115,7 +115,7 @@
115 115
     <Compile Include="T_Sys_FunctionLogs.cs" />
116 116
     <Compile Include="T_Sys_IDCardInfo.cs" />
117 117
     <Compile Include="T_Sys_LoginLogs.cs" />
118
-    <Compile Include="T_Sys_MobileData.cs" />
118
+    <Compile Include="HW\T_Sys_MobileData.cs" />
119 119
     <Compile Include="T_Sys_ModuleFunctions.cs" />
120 120
     <Compile Include="T_Sys_ModuleFunctionsOpt.cs" />
121 121
     <Compile Include="T_Sys_ModuleInfo.cs" />

+ 8 - 4
web/YTSoft.BaseCallCenter.MVCWeb/Controllers/Com/LogActionController.cs

@@ -34,16 +34,20 @@ namespace YTSoft.BaseCallCenter.MVCWeb.Controllers
34 34
 
35 35
         //操作记录  敏感信息 主要设置
36 36
         [ActionName("GetListData")]
37
-        public string GetListData(string Table = "", string id = "", int page = 0, int limit = 20,string action= "操作记录")
37
+        public string GetListData(string Table = "", string id = "", int page = 0, int limit = 20,string actionname= "")
38 38
         {
39 39
             string strWhere = "";
40 40
             if (Table == "kf_quick_msgs")
41 41
             {
42
-                strWhere = " 1=1 ";
42
+                strWhere += " 1=1 ";
43
+            }
44
+            else if (string.IsNullOrEmpty(actionname))
45
+            {
46
+                strWhere += "TableName!='kf_quick_msgs' ";
43 47
             }
44 48
             else
45 49
             {
46
-                strWhere += string.Format(" convert(nvarchar(1500),ContentNew)='{0}' ", action);
50
+                strWhere += string.Format(" convert(nvarchar(1500),ContentNew)='{0}' ", actionname);
47 51
             }
48 52
             if (!string.IsNullOrEmpty(Table))
49 53
             {
@@ -54,7 +58,7 @@ namespace YTSoft.BaseCallCenter.MVCWeb.Controllers
54 58
                 strWhere += string.Format(" and TableId ='{0}'", id);
55 59
             }
56 60
 
57
-            DataTable dt = busLogAction.GetListByPage(strWhere, " atime desc ", (page - 1) * limit, limit).Tables[0];
61
+            DataTable dt = busLogAction.GetListByPage(strWhere, " atime desc ", (page - 1) * limit, page*limit).Tables[0];
58 62
             int count = busLogAction.GetRecordCount(strWhere);
59 63
             return Success("成功", dt, count);
60 64
         }

+ 134 - 0
web/YTSoft.BaseCallCenter.MVCWeb/Controllers/HW/MobileDataController.cs

@@ -0,0 +1,134 @@
1
+using Newtonsoft.Json;
2
+using System;
3
+using System.Collections.Generic;
4
+using System.Data;
5
+using System.IO;
6
+using System.Linq;
7
+using System.Web;
8
+using System.Web.Mvc;
9
+using YTSoft.BaseCallCenter.Model;
10
+using YTSoft.BaseCallCenter.MVCWeb.Models;
11
+
12
+/// <summary>
13
+/// 话务-值班号码
14
+/// </summary>
15
+namespace YTSoft.BaseCallCenter.MVCWeb.Controllers
16
+{
17
+    public class MobileDataController : BaseController
18
+    {
19
+        BLL.T_Sys_MobileData busdutyNumber = new BLL.T_Sys_MobileData();
20
+
21
+        /// <summary>
22
+        /// 电话列表
23
+        /// </summary>
24
+        /// <returns></returns>
25
+        public ActionResult GetList()
26
+        {
27
+            return View();
28
+        }
29
+
30
+        /// <summary>
31
+        /// 添加 视图
32
+        /// </summary>
33
+        /// <returns></returns>
34
+        public ActionResult Add()
35
+        {
36
+            return View();
37
+        }
38
+
39
+
40
+        [ActionName("GetListData")]
41
+        public string GetListData(string phone="")
42
+        {
43
+            DataTable dt = null;
44
+            int count = 0;
45
+            if (string.IsNullOrEmpty(phone))
46
+            {
47
+                return Success("成功", dt, count);
48
+            }
49
+            AddAction("T_Sys_MobileData", "page", "查询列表", string.Format(" 获取前50条 phone={0}", phone));
50
+            string strWhere = " 1=1 ";
51
+            if (!string.IsNullOrEmpty(phone))
52
+            {
53
+                strWhere += string.Format(" and F_MobileNum like '%{0}%'", phone);
54
+            }
55
+
56
+            dt = busdutyNumber.GetList(50,strWhere, " F_MobileNum ASC").Tables[0];
57
+            if (dt != null && dt.Rows.Count > 0)
58
+            {
59
+                count = dt.Rows.Count;
60
+            }
61
+            return Success("成功", dt, count);
62
+        }
63
+
64
+        [ActionName("GetData")]
65
+        public string GettData(string id = "")
66
+        {
67
+            if(id.Length!=7)
68
+                return Error("请输入ID");
69
+
70
+            Model.T_Sys_MobileData model = busdutyNumber.GetModel(id);
71
+            return Success("成功", model, 1);
72
+        }
73
+
74
+        [ActionName("adddata")]
75
+        public string AddData(string phone = "", string ZipCode = "",string CityDes="未知",string CardDes="未知")
76
+        {
77
+            string strWhere = " 1=1 ";
78
+            if (string.IsNullOrEmpty(phone))
79
+            {
80
+                return Error("请输入号码前七位");
81
+            }
82
+            else if (string.IsNullOrEmpty(ZipCode))
83
+            {
84
+                return Error("请输入城市固话区号");
85
+            }
86
+            else if (phone.Length != 7)
87
+            {
88
+                return Error("请输入号码前七位");
89
+            }
90
+            else
91
+            {
92
+                strWhere += string.Format(" and F_MobileNum='{0}'", phone);
93
+            }
94
+
95
+            int count = busdutyNumber.GetRecordCount(strWhere);
96
+            if (count > 0)
97
+            {
98
+                return Error("号码已存在");
99
+            }
100
+
101
+            Model.T_Sys_MobileData model = new T_Sys_MobileData();
102
+            model.F_MobileNum = phone;
103
+            model.F_ZipCode = ZipCode;
104
+            model.F_CityDes = CityDes;
105
+            model.F_CardDes = CardDes;
106
+
107
+            if (busdutyNumber.Add(model))
108
+            {
109
+                AddAction("T_Sys_MobileData", phone, "新增电话库", phone);
110
+                return Success("成功", model);
111
+            }
112
+            else
113
+                return Error("失败");
114
+        }
115
+
116
+        [ActionName("deletedata")]
117
+        public string DeleteData( string phone)
118
+        {
119
+            if (string.IsNullOrEmpty(phone))
120
+            {
121
+                return Error("请输入ID");
122
+            }
123
+            Model.T_Sys_MobileData model = busdutyNumber.GetModel(phone);
124
+            if (busdutyNumber.Delete(phone))
125
+            {
126
+                AddAction("T_Sys_MobileData", phone.ToMyString(), "删除电话库",JsonConvert.SerializeObject(model),"敏感信息");
127
+                AddAction("T_Sys_MobileData", phone.ToMyString(), "删除电话库");
128
+                return Success("删除成功");
129
+            }
130
+            else
131
+                return Error("失败");
132
+        }
133
+    }
134
+}

+ 27 - 0
web/YTSoft.BaseCallCenter.MVCWeb/Controllers/Report/ReportOtherController.cs

@@ -144,6 +144,33 @@ namespace YTSoft.BaseCallCenter.MVCWeb.Controllers
144 144
                 }
145 145
                 #endregion
146 146
 
147
+                #region 首呼解决率
148
+                datas = busReport.GetOtherData10(startDate, endDate);
149
+                if (datas != null && datas.Rows.Count > 0)
150
+                {
151
+                    string data1 = "-";
152
+                    int tempTotal = 0;
153
+                    int tempint = 0;
154
+                    foreach (DataRow thisRow in datas.Rows)
155
+                    {
156
+                        if (thisRow["CallState"].ToInt32() == 1)
157
+                        {
158
+                            tempint = thisRow["num"].ToInt32();
159
+                        }
160
+                        tempTotal += thisRow["num"].ToInt32();
161
+
162
+                    }
163
+                    if (tempTotal != 0)
164
+                    {
165
+                        data1 = (tempint / (double)tempTotal).ToString("0.00%");
166
+                    }
167
+                    dataRow = newTable.NewRow();
168
+                    dataRow["指标名称"] = "首呼解决率";
169
+                    dataRow["指标值"] = data1;
170
+                    newTable.Rows.Add(dataRow);
171
+                }
172
+                #endregion
173
+
147 174
                 #region 按时办结率
148 175
                 datas = busReport.GetOtherData4(startDate, endDate);
149 176
                 if (datas != null && datas.Rows.Count > 0)

+ 1 - 0
web/YTSoft.BaseCallCenter.MVCWeb/YTSoft.BaseCallCenter.MVCWeb.csproj

@@ -122,6 +122,7 @@
122 122
     <Compile Include="Controllers\CustomerController.cs" />
123 123
     <Compile Include="Controllers\DefaultController.cs" />
124 124
     <Compile Include="Controllers\HrEmployeeBaseController.cs" />
125
+    <Compile Include="Controllers\HW\MobileDataController.cs" />
125 126
     <Compile Include="Controllers\HW\DutyNumberController.cs" />
126 127
     <Compile Include="Controllers\KF\QuickMsgsController.cs" />
127 128
     <Compile Include="Controllers\LostGoodsController.cs" />