Просмотр исходного кода

工单号生成规则修改,投诉类型报表

zhoufan лет назад: 7
Родитель
Сommit
ea49eaf3a9

+ 4 - 8
codegit/CallCenterApi/CallCenterApi.BLL/T_Bus_WorkOrder.cs

@@ -146,15 +146,11 @@ namespace CallCenterApi.BLL
146 146
         #endregion  BasicMethod
147 147
         #region  ExtensionMethod
148 148
 
149
-        /// <summary>
150
-        /// 根据坐席号获取新的工单号
151
-        /// </summary>
152
-        /// <param name="p_UserCode"></param>
153
-        /// <returns></returns>
154
-        public string GetNewWorkOrderID(string p_UserCode)
149
+        //根据坐席号获取新的工单号
150
+        
151
+        public string GetNewWorkOrderID(string Code,string UserCode)
155 152
         {
156
-            return dal.GetNewWorkOrderID(p_UserCode);
157
-
153
+            return dal.GetNewWorkOrderID(Code,UserCode);
158 154
         }
159 155
 
160 156
         #endregion  ExtensionMethod

+ 12 - 3
codegit/CallCenterApi/CallCenterApi.DAL/T_Bus_WorkOrder.cs

@@ -3,6 +3,7 @@ using System.Data;
3 3
 using System.Text;
4 4
 using System.Data.SqlClient;
5 5
 using CallCenterApi.DB;
6
+using System.Collections.Generic;
6 7
 
7 8
 namespace CallCenterApi.DAL
8 9
 {
@@ -687,14 +688,22 @@ namespace CallCenterApi.DAL
687 688
         #region  ExtensionMethod
688 689
 
689 690
         /// <summary>
690
-        /// 根据坐席号获取新的工单号
691
+        /// 获取新的工单号
691 692
         /// </summary>
693
+        /// <param name="Code"></param>
692 694
         /// <param name="p_UserCode"></param>
693 695
         /// <returns></returns>
694
-        public string GetNewWorkOrderID(string p_UserCode)
696
+        public string GetNewWorkOrderID(string Code,string UserCode)
695 697
         {
696 698
             string newWorkOrderID = string.Empty;//新工单号
697
-            newWorkOrderID = DbHelperSQL.GetSingle("select dbo.GetNewWorkOrderId('" + p_UserCode + "')").ToString();
699
+            //newWorkOrderID = DbHelperSQL.GetSingle("select dbo.GetNewWorkOrderId('" + p_UserCode + "')").ToString();
700
+
701
+            Dictionary<string, string> paras = new Dictionary<string, string>();
702
+            paras.Add("@sdate", Code);
703
+            paras.Add("@edate", UserCode);
704
+            var dt = DbHelperSQL.RunProcedure("P_GetNewWorkOrderId", paras, "GetNewWorkOrderId").Tables[0];
705
+            newWorkOrderID = dt.Rows[0]["WorkOrderId"].ToString();
706
+
698 707
             return newWorkOrderID;
699 708
         }
700 709
 

+ 53 - 2
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/BusinessController.cs

@@ -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
                 }

+ 5 - 2
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderController.cs

@@ -199,7 +199,8 @@ namespace CallCenterApi.Interface.Controllers.workorder
199 199
                     pagesize = Convert.ToInt32(strpagesize);
200 200
                 }
201 201
 
202
-                string cols = "*,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDictionaryName(F_Type) as TypeName,dbo.GetDictionaryName(F_SmallType) as SmallTypeName,dbo.GetDictionaryName(F_Source) as SourceName";
202
+                string cols = "*,dbo.GetUserName(F_CreateUser) as UserName,dbo.GetDictionaryName(F_Type) as TypeName,dbo.GetDictionaryName(F_SmallType) as SmallTypeName,"
203
+                    + "dbo.GetDictionaryName(F_ProductType) as ProductTypeName,dbo.GetDictionaryName(F_Source) as SourceName";
203 204
 
204 205
                 if (isdc > 0)
205 206
                 {
@@ -440,11 +441,13 @@ namespace CallCenterApi.Interface.Controllers.workorder
440 441
             if (source == 0)
441 442
                 return Error("请选择来源");
442 443
 
444
+            var valuecode = new BLL.T_Sys_DictionaryValue().GetModel(type).F_ValueCode;
445
+
443 446
             using (TransactionScope trans = new TransactionScope())
444 447
             {
445 448
                 #region 保存工单信息
446 449
                 Model.T_Bus_WorkOrder modelT_Bus_WorkOrder = new Model.T_Bus_WorkOrder();
447
-                modelT_Bus_WorkOrder.F_WorkOrderId = workorderBLL.GetNewWorkOrderID(userModel.F_UserCode);
450
+                modelT_Bus_WorkOrder.F_WorkOrderId = workorderBLL.GetNewWorkOrderID(valuecode,userModel.F_UserCode);
448 451
 
449 452
                 modelT_Bus_WorkOrder.F_Source = source;//信息来源
450 453
                 modelT_Bus_WorkOrder.F_Type = type;//信息类别