zhoufan лет назад: 4
Родитель
Сommit
d230985a43

+ 7 - 86
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/CallCenterApi.Interface.csproj

@@ -181,6 +181,7 @@
181 181
     <Compile Include="Controllers\callout\CallPlanController.cs" />
182 182
     <Compile Include="Controllers\customer\CustomerNewController.cs" />
183 183
     <Compile Include="Controllers\customer\RegionCategoryController.cs" />
184
+    <Compile Include="Controllers\customer\XLXCustomerController.cs" />
184 185
     <Compile Include="Controllers\DepartmentController.cs" />
185 186
     <Compile Include="Controllers\DictionaryController.cs" />
186 187
     <Compile Include="Controllers\HomeController.cs" />
@@ -215,6 +216,12 @@
215 216
     <Compile Include="Controllers\report\TalkTimeController.cs" />
216 217
     <Compile Include="Controllers\report\TotalCallController.cs" />
217 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" />
218 225
     <Compile Include="Controllers\report\YearContrastController.cs" />
219 226
     <Compile Include="Controllers\report\ZuoXiManYiDuController.cs" />
220 227
     <Compile Include="Controllers\report\ZuoXiTongHuaController.cs" />
@@ -298,7 +305,6 @@
298 305
     <Compile Include="Properties\AssemblyInfo.cs" />
299 306
   </ItemGroup>
300 307
   <ItemGroup>
301
-    <Content Include="Views\web.config" />
302 308
     <Content Include="packages.config">
303 309
       <SubType>Designer</SubType>
304 310
     </Content>
@@ -332,91 +338,6 @@
332 338
   </ItemGroup>
333 339
   <ItemGroup>
334 340
     <Folder Include="App_Data\" />
335
-    <Folder Include="Views\Base\" />
336
-    <Folder Include="Views\Business\" />
337
-    <Folder Include="Views\Callblack\" />
338
-    <Folder Include="Views\CallIn\" />
339
-    <Folder Include="Views\Callleave\" />
340
-    <Folder Include="Views\CallOutOpt\" />
341
-    <Folder Include="Views\CallOutScreen\" />
342
-    <Folder Include="Views\CallOut\" />
343
-    <Folder Include="Views\CallPlan\" />
344
-    <Folder Include="Views\Callrecords\" />
345
-    <Folder Include="Views\CeShi\" />
346
-    <Folder Include="Views\CustomerNew\" />
347
-    <Folder Include="Views\Customer\" />
348
-    <Folder Include="Views\DaysTalkTime\" />
349
-    <Folder Include="Views\Default\" />
350
-    <Folder Include="Views\Department\" />
351
-    <Folder Include="Views\Dictionary\" />
352
-    <Folder Include="Views\DutyPhone\" />
353
-    <Folder Include="Views\DXRecords\" />
354
-    <Folder Include="Views\DXReports\" />
355
-    <Folder Include="Views\DXTel\" />
356
-    <Folder Include="Views\FilterOrder\" />
357
-    <Folder Include="Views\hfOpt\" />
358
-    <Folder Include="Views\Home\" />
359
-    <Folder Include="Views\HourCallTotal\" />
360
-    <Folder Include="Views\IndexBase\" />
361
-    <Folder Include="Views\IndexCategory\" />
362
-    <Folder Include="Views\Index\" />
363
-    <Folder Include="Views\Info\" />
364
-    <Folder Include="Views\InputDXTel\" />
365
-    <Folder Include="Views\KnowledgeClass\" />
366
-    <Folder Include="Views\Knowledge\" />
367
-    <Folder Include="Views\Login\" />
368
-    <Folder Include="Views\Log\" />
369
-    <Folder Include="Views\Market\" />
370
-    <Folder Include="Views\MaterialManage\" />
371
-    <Folder Include="Views\Mobiledata\" />
372
-    <Folder Include="Views\Module\" />
373
-    <Folder Include="Views\Msg\" />
374
-    <Folder Include="Views\Notice\" />
375
-    <Folder Include="Views\Order\" />
376
-    <Folder Include="Views\Product\" />
377
-    <Folder Include="Views\QCManage\" />
378
-    <Folder Include="Views\QCResult\" />
379
-    <Folder Include="Views\QuestionAnswer\" />
380
-    <Folder Include="Views\Questionnaire\" />
381
-    <Folder Include="Views\RegionCategory\" />
382
-    <Folder Include="Views\RoleF\" />
383
-    <Folder Include="Views\RoleInfo\" />
384
-    <Folder Include="Views\SeatGroup\" />
385
-    <Folder Include="Views\SeatMonitoring\" />
386
-    <Folder Include="Views\SMSZXZB\" />
387
-    <Folder Include="Views\SMS\" />
388
-    <Folder Include="Views\SwitchedlossCall\" />
389
-    <Folder Include="Views\SysConfig\" />
390
-    <Folder Include="Views\TalkTime\" />
391
-    <Folder Include="Views\TotalCall\" />
392
-    <Folder Include="Views\UserAccount\" />
393
-    <Folder Include="Views\Validate\" />
394
-    <Folder Include="Views\VisFile\" />
395
-    <Folder Include="Views\visitfpset\" />
396
-    <Folder Include="Views\VisithfOpt\" />
397
-    <Folder Include="Views\VisitInput\" />
398
-    <Folder Include="Views\VisitRecords\" />
399
-    <Folder Include="Views\VisitReport\" />
400
-    <Folder Include="Views\VisitTelphone\" />
401
-    <Folder Include="Views\Web\" />
402
-    <Folder Include="Views\WoBill\" />
403
-    <Folder Include="Views\WOReport\" />
404
-    <Folder Include="Views\Workcalendar\" />
405
-    <Folder Include="Views\WorkOffDays\" />
406
-    <Folder Include="Views\WorkOrderLogs\" />
407
-    <Folder Include="Views\WorkOrderNew\" />
408
-    <Folder Include="Views\WorkOrdersComplaintType\" />
409
-    <Folder Include="Views\WorkOrdersHandledRate\" />
410
-    <Folder Include="Views\WorkOrdersType\" />
411
-    <Folder Include="Views\WorkOrdersVisiSatisfactiont\" />
412
-    <Folder Include="Views\WorkOrders\" />
413
-    <Folder Include="Views\WorkOrder\" />
414
-    <Folder Include="Views\WxCustom\" />
415
-    <Folder Include="Views\WxReceive\" />
416
-    <Folder Include="Views\WxReport\" />
417
-    <Folder Include="Views\YearContrast\" />
418
-    <Folder Include="Views\ZuoXiTongHua\" />
419
-    <Folder Include="Views\ZuoXiWorkTotal\" />
420 341
   </ItemGroup>
421 342
   <ItemGroup>
422 343
     <ProjectReference Include="..\..\..\CallCenterCommon\CallCenter.Utility\CallCenter.Utility.csproj">

+ 0 - 385
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/customer/RegionCategoryController_BACKUP_232.cs

@@ -1,385 +0,0 @@
1
-using CallCenter.Utility;
2
-using CallCenterApi.Common;
3
-using CallCenterApi.Interface.Controllers.Base;
4
-using CallCenterApi.Interface.Models.Input;
5
-using CallCenterApi.Model;
6
-using System;
7
-using System.Collections.Generic;
8
-using System.Data;
9
-using System.IO;
10
-using System.Linq;
11
-using System.Web;
12
-using System.Web.Mvc;
13
-
14
-namespace CallCenterApi.Interface.Controllers.customer
15
-{
16
-    public class RegionCategoryController : BaseController
17
-    {
18
-        private BLL.T_RegionCategory regionBLL = new BLL.T_RegionCategory();
19
-
20
-        /// <summary>
21
-        /// 获取省市县乡镇
22
-        /// </summary>
23
-        /// <returns></returns>
24
-        public ActionResult GetAllList(int F_Layer, string F_RegionName = "")
25
-        {
26
-            int F_RegionId = 0;
27
-            if (F_RegionName!= "")
28
-            {
29
-                Model.T_RegionCategory userModel = regionBLL.GetModel(F_RegionName);
30
-                if (userModel !=null )
31
-                {
32
-                    F_RegionId = userModel.F_RegionId;
33
-                }
34
-                else
35
-                {
36
-                    return Success("获取失败,内容为空");
37
-                }
38
-            }
39
-            var entityJson = new BLL.T_RegionCategory().GetModelList("F_Layer = " + F_Layer + "AND F_ParentId=" + F_RegionId + "order by F_Sort" );
40
-         
41
-            if (entityJson.Count > 0)
42
-            {
43
-                return Success("加载成功", entityJson);
44
-            }
45
-            else
46
-            {
47
-                return Success("获取失败,内容为空");
48
-            }
49
-        }
50
-        /// <summary>
51
-        /// 导入excel
52
-        /// </summary>
53
-        /// <returns></returns>
54
-        public ActionResult ImportExcel(int F_Layer, string F_RegionName="")
55
-        {
56
-            string userscode = CurrentUser.UserData.F_UserCode;
57
-            HttpPostedFile _upFile = RequestString.GetFile("upFile");
58
-            if (_upFile != null)
59
-            {
60
-                int headrow = 0;
61
-                #region 上传文件
62
-                string filepath = "";
63
-                string datepath = DateTime.Now.ToString("yyyyMMddHHMMss");
64
-                string aLastName = Path.GetExtension(_upFile.FileName);
65
-                string oriname = Path.GetFileNameWithoutExtension(_upFile.FileName);
66
-                if (aLastName != ".xls" && aLastName != ".xlsx")
67
-                {
68
-                    return Error("文件类型错误,请选择Excel文件");
69
-                }
70
-                string newpath = datepath + "_" + _upFile.FileName;
71
-                if (!Directory.Exists(Server.MapPath(this.Request.ApplicationPath + "\\ExcelData")))
72
-                {
73
-                    Directory.CreateDirectory(Server.MapPath(this.Request.ApplicationPath + "\\ExcelData"));
74
-                }
75
-                filepath = this.Request.ApplicationPath + "/ExcelData/" + newpath;
76
-                string PhysicalPath = Server.MapPath(filepath);
77
-                _upFile.SaveAs(PhysicalPath);
78
-                #endregion
79
-                #region 添加附件日志
80
-                Model.T_Sys_Accessories model_T_Sys_Accessories = new Model.T_Sys_Accessories();
81
-                model_T_Sys_Accessories.F_AddTime = DateTime.Now;//上传时间
82
-                model_T_Sys_Accessories.F_FileName = newpath;//附件名称
83
-                model_T_Sys_Accessories.F_FileType = aLastName;//附件类型
84
-                model_T_Sys_Accessories.F_FileUrl = filepath;//附件地址
85
-                model_T_Sys_Accessories.F_UserCode = userscode;//上传人  
86
-                model_T_Sys_Accessories.F_OriName = oriname;
87
-                int fid = new BLL.T_Sys_Accessories().Add(model_T_Sys_Accessories);
88
-                #endregion
89
-                NPOIHelper np = new NPOIHelper();
90
-                DataTable dt = np.ExcelToTable(_upFile, headrow);
91
-                string msg = string.Empty;
92
-                if (dt == null || dt.Rows.Count == 0)
93
-                    return Error("文件没有数据");
94
-                else
95
-                {
96
-                    foreach (DataRow dr in dt.Rows)
97
-                    {
98
-                        #region 数据入库
99
-                        headrow = headrow + 1;
100
-
101
-                        if (dr["地区名称"].ToString() != "" )
102
-                        {
103
-                           
104
-                            Model.T_RegionCategory dModel = new Model.T_RegionCategory();
105
-                            dModel.F_RegionName = dr["地区名称"].ToString();//地区名称
106
-                            dModel.F_Layer = F_Layer;
107
-                            if (F_RegionName != "")
108
-                            {
109
-                                Model.T_RegionCategory userModel = regionBLL.GetModel(F_RegionName);
110
-                                if (userModel != null)
111
-                                {
112
-                                    dModel.F_ParentId = userModel.F_RegionId;
113
-                                }
114
-                                else
115
-                                {
116
-                                    dModel.F_ParentId = 0;
117
-                                }
118
-                            }
119
-                            dModel.F_CreateBy = int .Parse (userscode);
120
-                            dModel.F_CreateOn = DateTime.Now;
121
-                            dModel.F_DeleteFlag = 0;
122
-                            dModel.F_Sort = 0;
123
-                            var res = regionBLL.Add(dModel);
124
-                            if (res > 0)
125
-                            {
126
-                                addoptlog(userscode, DTRequest.GetIP(), EnumOpt.import.ToString(), res.ToString(), "导入成功,导入的文件为:" + newpath + ",当前为第" + headrow + "行");
127
-                            }
128
-                            else
129
-                            {
130
-
131
-                                msg = msg + "第" + headrow + "行,导入失败<br>";
132
-                            }
133
-                        }
134
-                        else
135
-                            msg = msg + "第" + headrow + "行,地区名称为空或格式不正确,未导入<br>";
136
-                        #endregion
137
-                    }
138
-                    if (string.IsNullOrEmpty(msg))
139
-                        return Success("导入成功 ");
140
-                    else
141
-                        return Error(msg);
142
-                }
143
-
144
-            }
145
-            return Error("文件不能为空");
146
-        }
147
-        /// <summary>
148
-        /// 操作日志
149
-        /// </summary>
150
-        /// <param name="usercode">操作人工号</param>
151
-        /// <param name="ip">操作人IP</param>
152
-        /// <param name="optcode">操作编号</param>
153
-        /// <param name="optid">操作id</param>
154
-        /// <param name="des">操作描述</param>
155
-        private void addoptlog(string usercode, string ip, string optcode, string optid, string des)
156
-        {
157
-            new BLL.T_Sys_OperateLogs().AddOptLog("地区管理", usercode, ip, des, optcode, "T_RegionCategory", optid);
158
-        }
159
-
160
-        /// <summary>
161
-        /// 获取地市
162
-        /// </summary>
163
-        /// <param name="deptId"></param>
164
-        /// <returns></returns>
165
-        public ActionResult GetRegion(int deptId = 0)
166
-        {
167
-            if (Request.IsAuthenticated)
168
-            {
169
-                BLL.T_RegionCategory dBLL = new BLL.T_RegionCategory();
170
-                Model.T_RegionCategory dModel = dBLL.GetModel(deptId);
171
-                if (dModel != null)
172
-                    return Success("获取地市信息成功", dModel);
173
-                return Error("获取地市信息失败");
174
-            }
175
-            return NoToken("未知错误,请重新登录");
176
-        }
177
-
178
-        /// <summary>
179
-        /// 添加地市
180
-        /// </summary>
181
-        /// <param name="input"></param>
182
-        /// <returns></returns>
183
-        [HttpPost]
184
-        public ActionResult AddRegion(RegionCategoryInput input)
185
-        {
186
-          
187
-                Model.T_RegionCategory dModel = new Model.T_RegionCategory();
188
-                dModel.F_ParentId = input.F_ParentId;
189
-                dModel.F_Sort = input.F_Sort;
190
-                dModel.F_RegionName = input.F_RegionName;
191
-                dModel.F_DeleteFlag = 0;
192
-                dModel.F_Layer = input.F_Layer;
193
-                dModel.F_CreateBy = CurrentUser.UserData.F_UserId;
194
-                dModel.F_CreateOn = DateTime.Now;
195
-                if (regionBLL.Add(dModel) > 0)
196
-                    return Success("添加成功");
197
-                else
198
-                    return Success("添加失败");
199
-           
200
-        }
201
-
202
-        /// <summary>
203
-        /// 编辑地市
204
-        /// </summary>
205
-        /// <param name="input"></param>
206
-        /// <returns></returns>
207
-        [HttpPost]
208
-        public ActionResult EditRegion(RegionCategoryInput input)
209
-        {
210
-          
211
-                if (input.F_RegionId <= 0)
212
-                    return Error("请选择要编辑的地市");
213
-                BLL.T_RegionCategory dBLL = new BLL.T_RegionCategory();
214
-                Model.T_RegionCategory dModel = dBLL.GetModel(input.F_RegionId);
215
-                if (dModel == null)
216
-                    return Error("获取信息失败");
217
-                dModel.F_ParentId = input.F_ParentId;
218
-                dModel.F_Sort = input.F_Sort;
219
-                dModel.F_RegionName = input.F_RegionName;
220
-                dModel.F_Layer = input.F_Layer;
221
-                dModel.F_ModifyBy = CurrentUser.UserData.F_UserId;
222
-                dModel.F_ModifyOn = DateTime.Now;
223
-                if (dBLL.Update(dModel))
224
-                    return Success("编辑成功");
225
-                return Error("编辑失败");
226
-         
227
-        }
228
-
229
-        /// <summary>
230
-        /// 删除地市
231
-        /// </summary>
232
-        /// <param name="ids"></param>
233
-        /// <returns></returns>
234
-        public ActionResult DelRegion(string[] ids)
235
-        {
236
-          
237
-                if (ids == null || ids.Length <= 0)
238
-                    return Error("请选择要删除的地市");
239
-
240
-                var idStr = string.Join(",", ids);
241
-                if (string.IsNullOrEmpty(idStr.Trim()))
242
-                    return Error("请选择要删除的地市");
243
-
244
-                if (regionBLL.DeleteList(idStr))
245
-                    return Success("删除成功");
246
-                return Error("删除失败");
247
-        
248
-        }
249
-
250
-        #region 获取地市列表 - 优化前的
251
-        ///// <summary>
252
-        ///// 获取地市列表
253
-        ///// </summary>
254
-        ///// <returns></returns>
255
-        //public ActionResult GetRegionList(int pId = 0)
256
-        //{
257
-        //    if (Request.IsAuthenticated)
258
-        //    {
259
-        //        DataTable dt = new DataTable();
260
-        //        dt = new BLL.T_RegionCategory().GetList(" F_DeleteFlag=0 and F_ParentId=" + pId).Tables[0];
261
-        //        List<Model.TreeModel> modelList = BindTree(dt, "0");
262
-
263
-        //        if (modelList != null)
264
-        //        {
265
-        //            if (modelList.Count > 0)
266
-        //                return Success("加载成功", modelList);
267
-        //        }
268
-        //        return Error("加载失败");
269
-        //    }
270
-        //    return NoToken("未知错误,请重新登录");
271
-        //}
272
-        ///// <summary>
273
-        ///// tree  树形地市
274
-        ///// </summary>
275
-        ///// <param name="tab"></param>
276
-        ///// <param name="parentid"></param>
277
-        ///// <returns></returns>
278
-        //private List<Model.TreeModel> BindTree(DataTable tab, string parentid)
279
-        //{
280
-        //    DataTable tab2 = new DataTable();
281
-
282
-        //    if (tab != null && tab.Rows.Count > 0)
283
-        //    {
284
-        //        List<Model.T_RegionCategory> categorylist = new BLL.T_RegionCategory().DataTableToList(tab);
285
-        //        List<Model.TreeModel> modelList = new List<Model.TreeModel>(categorylist.Count);
286
-        //        for (int i = 0; i < categorylist.Count; i++)
287
-        //        {
288
-        //            Model.TreeModel model = new Model.TreeModel();
289
-        //            string currentID = categorylist[i].F_RegionId.ToString();//当前功能ID
290
-        //            model.id = currentID;
291
-        //            model.IconCls = "";//图标
292
-        //            model.headerid =int .Parse ( categorylist[i].F_Layer.ToString ());
293
-        //            model.text = categorylist[i].F_RegionName;
294
-        //            tab2 = new BLL.T_RegionCategory().GetList("F_ParentId=" + currentID + " and F_DeleteFlag=0 order by f_sort").Tables[0];
295
-        //            if (tab2 != null && tab2.Rows.Count > 0)
296
-        //            {
297
-        //                model.children = BindTree(tab2, currentID);
298
-        //            }
299
-        //            modelList.Add(model);
300
-        //        }
301
-        //        return modelList;
302
-
303
-        //    }
304
-        //    else
305
-        //    {
306
-        //        return null;
307
-        //    }
308
-
309
-        //}
310
-
311
-        #endregion
312
-
313
-
314
-        public List<T_RegionCategory> list = null;
315
-        #region 获取地市列表 - 优化后的
316
-        /// <summary>
317
-        /// 获取地市列表
318
-        /// </summary>
319
-        /// <returns></returns>
320
-        public ActionResult GetRegionList(int pId = 0)
321
-        {
322
-            if (Request.IsAuthenticated)
323
-            {
324
-                list = new BLL.T_RegionCategory().GetModelList(" F_DeleteFlag=0 ");
325
-                var list_p = list.Where(x => x.F_ParentId == pId).ToList();
326
-                List<Model.TreeModel> modelList = BindTree(list_p, "0");
327
-
328
-                if (modelList != null)
329
-                {
330
-                    if (modelList.Count > 0)
331
-                        return Success("加载成功", modelList);
332
-                }
333
-                return Error("加载失败");
334
-            }
335
-            return NoToken("未知错误,请重新登录");
336
-        }
337
-        /// <summary>
338
-        /// tree  树形地市
339
-        /// </summary>
340
-        /// <param name="tab"></param>
341
-        /// <param name="parentid"></param>
342
-        /// <returns></returns>
343
-        private List<Model.TreeModel> BindTree(List<T_RegionCategory> tab, string parentid)
344
-        {
345
-            if (tab.Count > 0)
346
-            {
347
-                List<Model.TreeModel> modelList = new List<Model.TreeModel>(tab.Count);
348
-                for (int i = 0; i < tab.Count; i++)
349
-                {
350
-                    Model.TreeModel model = new Model.TreeModel();
351
-                    int F_RegionId = tab[i].F_RegionId;
352
-                    string currentID = tab[i].F_RegionId.ToString();//当前功能ID
353
-                    model.id = currentID;
354
-                    model.IconCls = "";//图标
355
-<<<<<<< HEAD
356
-                    if (categorylist[i].F_Layer != null)
357
-                    {
358
-                        model.headerid = int.Parse(categorylist[i].F_Layer.ToString());
359
-                    }
360
-                    model.text = categorylist[i].F_RegionName;
361
-                    tab2 = new BLL.T_RegionCategory().GetList("F_ParentId=" + currentID + " and F_DeleteFlag=0 order by f_sort").Tables[0];
362
-                    if (tab2 != null && tab2.Rows.Count > 0)
363
-=======
364
-                    model.headerid = int.Parse(tab[i].F_Layer.ToString());
365
-                    model.text = tab[i].F_RegionName;
366
-                    var tab2 = list.Where(x => x.F_ParentId == F_RegionId).OrderByDescending(x=>x.F_Sort).ToList();
367
-                    if (tab2.Count > 0)
368
->>>>>>> 0725543ed68fafd0d18fd9f6dd818d53fc7716a8
369
-                    {
370
-                        model.children = BindTree(tab2, currentID);
371
-                    }
372
-                    modelList.Add(model);
373
-                }
374
-                return modelList;
375
-
376
-            }
377
-            else
378
-            {
379
-                return null;
380
-            }
381
-
382
-        }
383
-        #endregion
384
-    }
385
-}

+ 0 - 310
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/customer/RegionCategoryController_BASE_232.cs

@@ -1,310 +0,0 @@
1
-using CallCenter.Utility;
2
-using CallCenterApi.Common;
3
-using CallCenterApi.Interface.Controllers.Base;
4
-using CallCenterApi.Interface.Models.Input;
5
-using CallCenterApi.Model;
6
-using System;
7
-using System.Collections.Generic;
8
-using System.Data;
9
-using System.IO;
10
-using System.Linq;
11
-using System.Web;
12
-using System.Web.Mvc;
13
-
14
-namespace CallCenterApi.Interface.Controllers.customer
15
-{
16
-    public class RegionCategoryController : BaseController
17
-    {
18
-        private BLL.T_RegionCategory regionBLL = new BLL.T_RegionCategory();
19
-
20
-        /// <summary>
21
-        /// 获取省市县乡镇
22
-        /// </summary>
23
-        /// <returns></returns>
24
-        public ActionResult GetAllList(int F_Layer, string F_RegionName = "")
25
-        {
26
-            int F_RegionId = 0;
27
-            if (F_RegionName!= "")
28
-            {
29
-                Model.T_RegionCategory userModel = regionBLL.GetModel(F_RegionName);
30
-                if (userModel !=null )
31
-                {
32
-                    F_RegionId = userModel.F_RegionId;
33
-                }
34
-                else
35
-                {
36
-                    return Success("获取失败,内容为空");
37
-                }
38
-            }
39
-            var entityJson = new BLL.T_RegionCategory().GetModelList("F_Layer = " + F_Layer + "AND F_ParentId=" + F_RegionId + "order by F_Sort" );
40
-         
41
-            if (entityJson.Count > 0)
42
-            {
43
-                return Success("加载成功", entityJson);
44
-            }
45
-            else
46
-            {
47
-                return Success("获取失败,内容为空");
48
-            }
49
-        }
50
-        /// <summary>
51
-        /// 导入excel
52
-        /// </summary>
53
-        /// <returns></returns>
54
-        public ActionResult ImportExcel(int F_Layer, string F_RegionName="")
55
-        {
56
-            string userscode = CurrentUser.UserData.F_UserCode;
57
-            HttpPostedFile _upFile = RequestString.GetFile("upFile");
58
-            if (_upFile != null)
59
-            {
60
-                int headrow = 0;
61
-                #region 上传文件
62
-                string filepath = "";
63
-                string datepath = DateTime.Now.ToString("yyyyMMddHHMMss");
64
-                string aLastName = Path.GetExtension(_upFile.FileName);
65
-                string oriname = Path.GetFileNameWithoutExtension(_upFile.FileName);
66
-                if (aLastName != ".xls" && aLastName != ".xlsx")
67
-                {
68
-                    return Error("文件类型错误,请选择Excel文件");
69
-                }
70
-                string newpath = datepath + "_" + _upFile.FileName;
71
-                if (!Directory.Exists(Server.MapPath(this.Request.ApplicationPath + "\\ExcelData")))
72
-                {
73
-                    Directory.CreateDirectory(Server.MapPath(this.Request.ApplicationPath + "\\ExcelData"));
74
-                }
75
-                filepath = this.Request.ApplicationPath + "/ExcelData/" + newpath;
76
-                string PhysicalPath = Server.MapPath(filepath);
77
-                _upFile.SaveAs(PhysicalPath);
78
-                #endregion
79
-                #region 添加附件日志
80
-                Model.T_Sys_Accessories model_T_Sys_Accessories = new Model.T_Sys_Accessories();
81
-                model_T_Sys_Accessories.F_AddTime = DateTime.Now;//上传时间
82
-                model_T_Sys_Accessories.F_FileName = newpath;//附件名称
83
-                model_T_Sys_Accessories.F_FileType = aLastName;//附件类型
84
-                model_T_Sys_Accessories.F_FileUrl = filepath;//附件地址
85
-                model_T_Sys_Accessories.F_UserCode = userscode;//上传人  
86
-                model_T_Sys_Accessories.F_OriName = oriname;
87
-                int fid = new BLL.T_Sys_Accessories().Add(model_T_Sys_Accessories);
88
-                #endregion
89
-                NPOIHelper np = new NPOIHelper();
90
-                DataTable dt = np.ExcelToTable(_upFile, headrow);
91
-                string msg = string.Empty;
92
-                if (dt == null || dt.Rows.Count == 0)
93
-                    return Error("文件没有数据");
94
-                else
95
-                {
96
-                    foreach (DataRow dr in dt.Rows)
97
-                    {
98
-                        #region 数据入库
99
-                        headrow = headrow + 1;
100
-
101
-                        if (dr["地区名称"].ToString() != "" )
102
-                        {
103
-                           
104
-                            Model.T_RegionCategory dModel = new Model.T_RegionCategory();
105
-                            dModel.F_RegionName = dr["地区名称"].ToString();//地区名称
106
-                            dModel.F_Layer = F_Layer;
107
-                            if (F_RegionName != "")
108
-                            {
109
-                                Model.T_RegionCategory userModel = regionBLL.GetModel(F_RegionName);
110
-                                if (userModel != null)
111
-                                {
112
-                                    dModel.F_ParentId = userModel.F_RegionId;
113
-                                }
114
-                                else
115
-                                {
116
-                                    dModel.F_ParentId = 0;
117
-                                }
118
-                            }
119
-                            dModel.F_CreateBy = int .Parse (userscode);
120
-                            dModel.F_CreateOn = DateTime.Now;
121
-                            dModel.F_DeleteFlag = 0;
122
-                            dModel.F_Sort = 0;
123
-                            var res = regionBLL.Add(dModel);
124
-                            if (res > 0)
125
-                            {
126
-                                addoptlog(userscode, DTRequest.GetIP(), EnumOpt.import.ToString(), res.ToString(), "导入成功,导入的文件为:" + newpath + ",当前为第" + headrow + "行");
127
-                            }
128
-                            else
129
-                            {
130
-
131
-                                msg = msg + "第" + headrow + "行,导入失败<br>";
132
-                            }
133
-                        }
134
-                        else
135
-                            msg = msg + "第" + headrow + "行,地区名称为空或格式不正确,未导入<br>";
136
-                        #endregion
137
-                    }
138
-                    if (string.IsNullOrEmpty(msg))
139
-                        return Success("导入成功 ");
140
-                    else
141
-                        return Error(msg);
142
-                }
143
-
144
-            }
145
-            return Error("文件不能为空");
146
-        }
147
-        /// <summary>
148
-        /// 操作日志
149
-        /// </summary>
150
-        /// <param name="usercode">操作人工号</param>
151
-        /// <param name="ip">操作人IP</param>
152
-        /// <param name="optcode">操作编号</param>
153
-        /// <param name="optid">操作id</param>
154
-        /// <param name="des">操作描述</param>
155
-        private void addoptlog(string usercode, string ip, string optcode, string optid, string des)
156
-        {
157
-            new BLL.T_Sys_OperateLogs().AddOptLog("地区管理", usercode, ip, des, optcode, "T_RegionCategory", optid);
158
-        }
159
-
160
-        /// <summary>
161
-        /// 获取地市
162
-        /// </summary>
163
-        /// <param name="deptId"></param>
164
-        /// <returns></returns>
165
-        public ActionResult GetRegion(int deptId = 0)
166
-        {
167
-            if (Request.IsAuthenticated)
168
-            {
169
-                BLL.T_RegionCategory dBLL = new BLL.T_RegionCategory();
170
-                Model.T_RegionCategory dModel = dBLL.GetModel(deptId);
171
-                if (dModel != null)
172
-                    return Success("获取地市信息成功", dModel);
173
-                return Error("获取地市信息失败");
174
-            }
175
-            return NoToken("未知错误,请重新登录");
176
-        }
177
-
178
-        /// <summary>
179
-        /// 添加地市
180
-        /// </summary>
181
-        /// <param name="input"></param>
182
-        /// <returns></returns>
183
-        [HttpPost]
184
-        public ActionResult AddRegion(RegionCategoryInput input)
185
-        {
186
-          
187
-                Model.T_RegionCategory dModel = new Model.T_RegionCategory();
188
-                dModel.F_ParentId = input.F_ParentId;
189
-                dModel.F_Sort = input.F_Sort;
190
-                dModel.F_RegionName = input.F_RegionName;
191
-                dModel.F_DeleteFlag = 0;
192
-                dModel.F_Layer = input.F_Layer;
193
-                dModel.F_CreateBy = CurrentUser.UserData.F_UserId;
194
-                dModel.F_CreateOn = DateTime.Now;
195
-                if (regionBLL.Add(dModel) > 0)
196
-                    return Success("添加成功");
197
-                else
198
-                    return Success("添加失败");
199
-           
200
-        }
201
-
202
-        /// <summary>
203
-        /// 编辑地市
204
-        /// </summary>
205
-        /// <param name="input"></param>
206
-        /// <returns></returns>
207
-        [HttpPost]
208
-        public ActionResult EditRegion(RegionCategoryInput input)
209
-        {
210
-          
211
-                if (input.F_RegionId <= 0)
212
-                    return Error("请选择要编辑的地市");
213
-                BLL.T_RegionCategory dBLL = new BLL.T_RegionCategory();
214
-                Model.T_RegionCategory dModel = dBLL.GetModel(input.F_RegionId);
215
-                if (dModel == null)
216
-                    return Error("获取信息失败");
217
-                dModel.F_ParentId = input.F_ParentId;
218
-                dModel.F_Sort = input.F_Sort;
219
-                dModel.F_RegionName = input.F_RegionName;
220
-                dModel.F_Layer = input.F_Layer;
221
-                dModel.F_ModifyBy = CurrentUser.UserData.F_UserId;
222
-                dModel.F_ModifyOn = DateTime.Now;
223
-                if (dBLL.Update(dModel))
224
-                    return Success("编辑成功");
225
-                return Error("编辑失败");
226
-         
227
-        }
228
-
229
-        /// <summary>
230
-        /// 删除地市
231
-        /// </summary>
232
-        /// <param name="ids"></param>
233
-        /// <returns></returns>
234
-        public ActionResult DelRegion(string[] ids)
235
-        {
236
-          
237
-                if (ids == null || ids.Length <= 0)
238
-                    return Error("请选择要删除的地市");
239
-
240
-                var idStr = string.Join(",", ids);
241
-                if (string.IsNullOrEmpty(idStr.Trim()))
242
-                    return Error("请选择要删除的地市");
243
-
244
-                if (regionBLL.DeleteList(idStr))
245
-                    return Success("删除成功");
246
-                return Error("删除失败");
247
-        
248
-        }
249
-
250
-        /// <summary>
251
-        /// 获取地市列表
252
-        /// </summary>
253
-        /// <returns></returns>
254
-        public ActionResult GetRegionList(int pId = 0)
255
-        {
256
-            if (Request.IsAuthenticated)
257
-            {
258
-                DataTable dt = new DataTable();
259
-                dt = new BLL.T_RegionCategory().GetList(" F_DeleteFlag=0 and F_ParentId=" + pId).Tables[0];
260
-                List<Model.TreeModel> modelList = BindTree(dt, "0");
261
-
262
-                if (modelList != null)
263
-                {
264
-                    if (modelList.Count > 0)
265
-                        return Success("加载成功", modelList);
266
-                }
267
-                return Error("加载失败");
268
-            }
269
-            return NoToken("未知错误,请重新登录");
270
-        }
271
-        /// <summary>
272
-        /// tree  树形地市
273
-        /// </summary>
274
-        /// <param name="tab"></param>
275
-        /// <param name="parentid"></param>
276
-        /// <returns></returns>
277
-        private List<Model.TreeModel> BindTree(DataTable tab, string parentid)
278
-        {
279
-            DataTable tab2 = new DataTable();
280
-
281
-            if (tab != null && tab.Rows.Count > 0)
282
-            {
283
-                List<Model.T_RegionCategory> categorylist = new BLL.T_RegionCategory().DataTableToList(tab);
284
-                List<Model.TreeModel> modelList = new List<Model.TreeModel>(categorylist.Count);
285
-                for (int i = 0; i < categorylist.Count; i++)
286
-                {
287
-                    Model.TreeModel model = new Model.TreeModel();
288
-                    string currentID = categorylist[i].F_RegionId.ToString();//当前功能ID
289
-                    model.id = currentID;
290
-                    model.IconCls = "";//图标
291
-                    model.headerid =int .Parse ( categorylist[i].F_Layer.ToString ());
292
-                    model.text = categorylist[i].F_RegionName;
293
-                    tab2 = new BLL.T_RegionCategory().GetList("F_ParentId=" + currentID + " and F_DeleteFlag=0 order by f_sort").Tables[0];
294
-                    if (tab2 != null && tab2.Rows.Count > 0)
295
-                    {
296
-                        model.children = BindTree(tab2, currentID);
297
-                    }
298
-                    modelList.Add(model);
299
-                }
300
-                return modelList;
301
-
302
-            }
303
-            else
304
-            {
305
-                return null;
306
-            }
307
-
308
-        }
309
-    }
310
-}

+ 0 - 313
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/customer/RegionCategoryController_LOCAL_232.cs

@@ -1,313 +0,0 @@
1
-using CallCenter.Utility;
2
-using CallCenterApi.Common;
3
-using CallCenterApi.Interface.Controllers.Base;
4
-using CallCenterApi.Interface.Models.Input;
5
-using CallCenterApi.Model;
6
-using System;
7
-using System.Collections.Generic;
8
-using System.Data;
9
-using System.IO;
10
-using System.Linq;
11
-using System.Web;
12
-using System.Web.Mvc;
13
-
14
-namespace CallCenterApi.Interface.Controllers.customer
15
-{
16
-    public class RegionCategoryController : BaseController
17
-    {
18
-        private BLL.T_RegionCategory regionBLL = new BLL.T_RegionCategory();
19
-
20
-        /// <summary>
21
-        /// 获取省市县乡镇
22
-        /// </summary>
23
-        /// <returns></returns>
24
-        public ActionResult GetAllList(int F_Layer, string F_RegionName = "")
25
-        {
26
-            int F_RegionId = 0;
27
-            if (F_RegionName!= "")
28
-            {
29
-                Model.T_RegionCategory userModel = regionBLL.GetModel(F_RegionName);
30
-                if (userModel !=null )
31
-                {
32
-                    F_RegionId = userModel.F_RegionId;
33
-                }
34
-                else
35
-                {
36
-                    return Success("获取失败,内容为空");
37
-                }
38
-            }
39
-            var entityJson = new BLL.T_RegionCategory().GetModelList("F_Layer = " + F_Layer + "AND F_ParentId=" + F_RegionId + "order by F_Sort" );
40
-         
41
-            if (entityJson.Count > 0)
42
-            {
43
-                return Success("加载成功", entityJson);
44
-            }
45
-            else
46
-            {
47
-                return Success("获取失败,内容为空");
48
-            }
49
-        }
50
-        /// <summary>
51
-        /// 导入excel
52
-        /// </summary>
53
-        /// <returns></returns>
54
-        public ActionResult ImportExcel(int F_Layer, string F_RegionName="")
55
-        {
56
-            string userscode = CurrentUser.UserData.F_UserCode;
57
-            HttpPostedFile _upFile = RequestString.GetFile("upFile");
58
-            if (_upFile != null)
59
-            {
60
-                int headrow = 0;
61
-                #region 上传文件
62
-                string filepath = "";
63
-                string datepath = DateTime.Now.ToString("yyyyMMddHHMMss");
64
-                string aLastName = Path.GetExtension(_upFile.FileName);
65
-                string oriname = Path.GetFileNameWithoutExtension(_upFile.FileName);
66
-                if (aLastName != ".xls" && aLastName != ".xlsx")
67
-                {
68
-                    return Error("文件类型错误,请选择Excel文件");
69
-                }
70
-                string newpath = datepath + "_" + _upFile.FileName;
71
-                if (!Directory.Exists(Server.MapPath(this.Request.ApplicationPath + "\\ExcelData")))
72
-                {
73
-                    Directory.CreateDirectory(Server.MapPath(this.Request.ApplicationPath + "\\ExcelData"));
74
-                }
75
-                filepath = this.Request.ApplicationPath + "/ExcelData/" + newpath;
76
-                string PhysicalPath = Server.MapPath(filepath);
77
-                _upFile.SaveAs(PhysicalPath);
78
-                #endregion
79
-                #region 添加附件日志
80
-                Model.T_Sys_Accessories model_T_Sys_Accessories = new Model.T_Sys_Accessories();
81
-                model_T_Sys_Accessories.F_AddTime = DateTime.Now;//上传时间
82
-                model_T_Sys_Accessories.F_FileName = newpath;//附件名称
83
-                model_T_Sys_Accessories.F_FileType = aLastName;//附件类型
84
-                model_T_Sys_Accessories.F_FileUrl = filepath;//附件地址
85
-                model_T_Sys_Accessories.F_UserCode = userscode;//上传人  
86
-                model_T_Sys_Accessories.F_OriName = oriname;
87
-                int fid = new BLL.T_Sys_Accessories().Add(model_T_Sys_Accessories);
88
-                #endregion
89
-                NPOIHelper np = new NPOIHelper();
90
-                DataTable dt = np.ExcelToTable(_upFile, headrow);
91
-                string msg = string.Empty;
92
-                if (dt == null || dt.Rows.Count == 0)
93
-                    return Error("文件没有数据");
94
-                else
95
-                {
96
-                    foreach (DataRow dr in dt.Rows)
97
-                    {
98
-                        #region 数据入库
99
-                        headrow = headrow + 1;
100
-
101
-                        if (dr["地区名称"].ToString() != "" )
102
-                        {
103
-                           
104
-                            Model.T_RegionCategory dModel = new Model.T_RegionCategory();
105
-                            dModel.F_RegionName = dr["地区名称"].ToString();//地区名称
106
-                            dModel.F_Layer = F_Layer;
107
-                            if (F_RegionName != "")
108
-                            {
109
-                                Model.T_RegionCategory userModel = regionBLL.GetModel(F_RegionName);
110
-                                if (userModel != null)
111
-                                {
112
-                                    dModel.F_ParentId = userModel.F_RegionId;
113
-                                }
114
-                                else
115
-                                {
116
-                                    dModel.F_ParentId = 0;
117
-                                }
118
-                            }
119
-                            dModel.F_CreateBy = int .Parse (userscode);
120
-                            dModel.F_CreateOn = DateTime.Now;
121
-                            dModel.F_DeleteFlag = 0;
122
-                            dModel.F_Sort = 0;
123
-                            var res = regionBLL.Add(dModel);
124
-                            if (res > 0)
125
-                            {
126
-                                addoptlog(userscode, DTRequest.GetIP(), EnumOpt.import.ToString(), res.ToString(), "导入成功,导入的文件为:" + newpath + ",当前为第" + headrow + "行");
127
-                            }
128
-                            else
129
-                            {
130
-
131
-                                msg = msg + "第" + headrow + "行,导入失败<br>";
132
-                            }
133
-                        }
134
-                        else
135
-                            msg = msg + "第" + headrow + "行,地区名称为空或格式不正确,未导入<br>";
136
-                        #endregion
137
-                    }
138
-                    if (string.IsNullOrEmpty(msg))
139
-                        return Success("导入成功 ");
140
-                    else
141
-                        return Error(msg);
142
-                }
143
-
144
-            }
145
-            return Error("文件不能为空");
146
-        }
147
-        /// <summary>
148
-        /// 操作日志
149
-        /// </summary>
150
-        /// <param name="usercode">操作人工号</param>
151
-        /// <param name="ip">操作人IP</param>
152
-        /// <param name="optcode">操作编号</param>
153
-        /// <param name="optid">操作id</param>
154
-        /// <param name="des">操作描述</param>
155
-        private void addoptlog(string usercode, string ip, string optcode, string optid, string des)
156
-        {
157
-            new BLL.T_Sys_OperateLogs().AddOptLog("地区管理", usercode, ip, des, optcode, "T_RegionCategory", optid);
158
-        }
159
-
160
-        /// <summary>
161
-        /// 获取地市
162
-        /// </summary>
163
-        /// <param name="deptId"></param>
164
-        /// <returns></returns>
165
-        public ActionResult GetRegion(int deptId = 0)
166
-        {
167
-            if (Request.IsAuthenticated)
168
-            {
169
-                BLL.T_RegionCategory dBLL = new BLL.T_RegionCategory();
170
-                Model.T_RegionCategory dModel = dBLL.GetModel(deptId);
171
-                if (dModel != null)
172
-                    return Success("获取地市信息成功", dModel);
173
-                return Error("获取地市信息失败");
174
-            }
175
-            return NoToken("未知错误,请重新登录");
176
-        }
177
-
178
-        /// <summary>
179
-        /// 添加地市
180
-        /// </summary>
181
-        /// <param name="input"></param>
182
-        /// <returns></returns>
183
-        [HttpPost]
184
-        public ActionResult AddRegion(RegionCategoryInput input)
185
-        {
186
-          
187
-                Model.T_RegionCategory dModel = new Model.T_RegionCategory();
188
-                dModel.F_ParentId = input.F_ParentId;
189
-                dModel.F_Sort = input.F_Sort;
190
-                dModel.F_RegionName = input.F_RegionName;
191
-                dModel.F_DeleteFlag = 0;
192
-                dModel.F_Layer = input.F_Layer;
193
-                dModel.F_CreateBy = CurrentUser.UserData.F_UserId;
194
-                dModel.F_CreateOn = DateTime.Now;
195
-                if (regionBLL.Add(dModel) > 0)
196
-                    return Success("添加成功");
197
-                else
198
-                    return Success("添加失败");
199
-           
200
-        }
201
-
202
-        /// <summary>
203
-        /// 编辑地市
204
-        /// </summary>
205
-        /// <param name="input"></param>
206
-        /// <returns></returns>
207
-        [HttpPost]
208
-        public ActionResult EditRegion(RegionCategoryInput input)
209
-        {
210
-          
211
-                if (input.F_RegionId <= 0)
212
-                    return Error("请选择要编辑的地市");
213
-                BLL.T_RegionCategory dBLL = new BLL.T_RegionCategory();
214
-                Model.T_RegionCategory dModel = dBLL.GetModel(input.F_RegionId);
215
-                if (dModel == null)
216
-                    return Error("获取信息失败");
217
-                dModel.F_ParentId = input.F_ParentId;
218
-                dModel.F_Sort = input.F_Sort;
219
-                dModel.F_RegionName = input.F_RegionName;
220
-                dModel.F_Layer = input.F_Layer;
221
-                dModel.F_ModifyBy = CurrentUser.UserData.F_UserId;
222
-                dModel.F_ModifyOn = DateTime.Now;
223
-                if (dBLL.Update(dModel))
224
-                    return Success("编辑成功");
225
-                return Error("编辑失败");
226
-         
227
-        }
228
-
229
-        /// <summary>
230
-        /// 删除地市
231
-        /// </summary>
232
-        /// <param name="ids"></param>
233
-        /// <returns></returns>
234
-        public ActionResult DelRegion(string[] ids)
235
-        {
236
-          
237
-                if (ids == null || ids.Length <= 0)
238
-                    return Error("请选择要删除的地市");
239
-
240
-                var idStr = string.Join(",", ids);
241
-                if (string.IsNullOrEmpty(idStr.Trim()))
242
-                    return Error("请选择要删除的地市");
243
-
244
-                if (regionBLL.DeleteList(idStr))
245
-                    return Success("删除成功");
246
-                return Error("删除失败");
247
-        
248
-        }
249
-
250
-        /// <summary>
251
-        /// 获取地市列表
252
-        /// </summary>
253
-        /// <returns></returns>
254
-        public ActionResult GetRegionList(int pId = 0)
255
-        {
256
-            if (Request.IsAuthenticated)
257
-            {
258
-                DataTable dt = new DataTable();
259
-                dt = new BLL.T_RegionCategory().GetList(" F_DeleteFlag=0 and F_ParentId=" + pId).Tables[0];
260
-                List<Model.TreeModel> modelList = BindTree(dt, "0");
261
-
262
-                if (modelList != null)
263
-                {
264
-                    if (modelList.Count > 0)
265
-                        return Success("加载成功", modelList);
266
-                }
267
-                return Error("加载失败");
268
-            }
269
-            return NoToken("未知错误,请重新登录");
270
-        }
271
-        /// <summary>
272
-        /// tree  树形地市
273
-        /// </summary>
274
-        /// <param name="tab"></param>
275
-        /// <param name="parentid"></param>
276
-        /// <returns></returns>
277
-        private List<Model.TreeModel> BindTree(DataTable tab, string parentid)
278
-        {
279
-            DataTable tab2 = new DataTable();
280
-
281
-            if (tab != null && tab.Rows.Count > 0)
282
-            {
283
-                List<Model.T_RegionCategory> categorylist = new BLL.T_RegionCategory().DataTableToList(tab);
284
-                List<Model.TreeModel> modelList = new List<Model.TreeModel>(categorylist.Count);
285
-                for (int i = 0; i < categorylist.Count; i++)
286
-                {
287
-                    Model.TreeModel model = new Model.TreeModel();
288
-                    string currentID = categorylist[i].F_RegionId.ToString();//当前功能ID
289
-                    model.id = currentID;
290
-                    model.IconCls = "";//图标
291
-                    if (categorylist[i].F_Layer != null)
292
-                    {
293
-                        model.headerid = int.Parse(categorylist[i].F_Layer.ToString());
294
-                    }
295
-                    model.text = categorylist[i].F_RegionName;
296
-                    tab2 = new BLL.T_RegionCategory().GetList("F_ParentId=" + currentID + " and F_DeleteFlag=0 order by f_sort").Tables[0];
297
-                    if (tab2 != null && tab2.Rows.Count > 0)
298
-                    {
299
-                        model.children = BindTree(tab2, currentID);
300
-                    }
301
-                    modelList.Add(model);
302
-                }
303
-                return modelList;
304
-
305
-            }
306
-            else
307
-            {
308
-                return null;
309
-            }
310
-
311
-        }
312
-    }
313
-}

+ 0 - 375
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/customer/RegionCategoryController_REMOTE_232.cs

@@ -1,375 +0,0 @@
1
-using CallCenter.Utility;
2
-using CallCenterApi.Common;
3
-using CallCenterApi.Interface.Controllers.Base;
4
-using CallCenterApi.Interface.Models.Input;
5
-using CallCenterApi.Model;
6
-using System;
7
-using System.Collections.Generic;
8
-using System.Data;
9
-using System.IO;
10
-using System.Linq;
11
-using System.Web;
12
-using System.Web.Mvc;
13
-
14
-namespace CallCenterApi.Interface.Controllers.customer
15
-{
16
-    public class RegionCategoryController : BaseController
17
-    {
18
-        private BLL.T_RegionCategory regionBLL = new BLL.T_RegionCategory();
19
-
20
-        /// <summary>
21
-        /// 获取省市县乡镇
22
-        /// </summary>
23
-        /// <returns></returns>
24
-        public ActionResult GetAllList(int F_Layer, string F_RegionName = "")
25
-        {
26
-            int F_RegionId = 0;
27
-            if (F_RegionName!= "")
28
-            {
29
-                Model.T_RegionCategory userModel = regionBLL.GetModel(F_RegionName);
30
-                if (userModel !=null )
31
-                {
32
-                    F_RegionId = userModel.F_RegionId;
33
-                }
34
-                else
35
-                {
36
-                    return Success("获取失败,内容为空");
37
-                }
38
-            }
39
-            var entityJson = new BLL.T_RegionCategory().GetModelList("F_Layer = " + F_Layer + "AND F_ParentId=" + F_RegionId + "order by F_Sort" );
40
-         
41
-            if (entityJson.Count > 0)
42
-            {
43
-                return Success("加载成功", entityJson);
44
-            }
45
-            else
46
-            {
47
-                return Success("获取失败,内容为空");
48
-            }
49
-        }
50
-        /// <summary>
51
-        /// 导入excel
52
-        /// </summary>
53
-        /// <returns></returns>
54
-        public ActionResult ImportExcel(int F_Layer, string F_RegionName="")
55
-        {
56
-            string userscode = CurrentUser.UserData.F_UserCode;
57
-            HttpPostedFile _upFile = RequestString.GetFile("upFile");
58
-            if (_upFile != null)
59
-            {
60
-                int headrow = 0;
61
-                #region 上传文件
62
-                string filepath = "";
63
-                string datepath = DateTime.Now.ToString("yyyyMMddHHMMss");
64
-                string aLastName = Path.GetExtension(_upFile.FileName);
65
-                string oriname = Path.GetFileNameWithoutExtension(_upFile.FileName);
66
-                if (aLastName != ".xls" && aLastName != ".xlsx")
67
-                {
68
-                    return Error("文件类型错误,请选择Excel文件");
69
-                }
70
-                string newpath = datepath + "_" + _upFile.FileName;
71
-                if (!Directory.Exists(Server.MapPath(this.Request.ApplicationPath + "\\ExcelData")))
72
-                {
73
-                    Directory.CreateDirectory(Server.MapPath(this.Request.ApplicationPath + "\\ExcelData"));
74
-                }
75
-                filepath = this.Request.ApplicationPath + "/ExcelData/" + newpath;
76
-                string PhysicalPath = Server.MapPath(filepath);
77
-                _upFile.SaveAs(PhysicalPath);
78
-                #endregion
79
-                #region 添加附件日志
80
-                Model.T_Sys_Accessories model_T_Sys_Accessories = new Model.T_Sys_Accessories();
81
-                model_T_Sys_Accessories.F_AddTime = DateTime.Now;//上传时间
82
-                model_T_Sys_Accessories.F_FileName = newpath;//附件名称
83
-                model_T_Sys_Accessories.F_FileType = aLastName;//附件类型
84
-                model_T_Sys_Accessories.F_FileUrl = filepath;//附件地址
85
-                model_T_Sys_Accessories.F_UserCode = userscode;//上传人  
86
-                model_T_Sys_Accessories.F_OriName = oriname;
87
-                int fid = new BLL.T_Sys_Accessories().Add(model_T_Sys_Accessories);
88
-                #endregion
89
-                NPOIHelper np = new NPOIHelper();
90
-                DataTable dt = np.ExcelToTable(_upFile, headrow);
91
-                string msg = string.Empty;
92
-                if (dt == null || dt.Rows.Count == 0)
93
-                    return Error("文件没有数据");
94
-                else
95
-                {
96
-                    foreach (DataRow dr in dt.Rows)
97
-                    {
98
-                        #region 数据入库
99
-                        headrow = headrow + 1;
100
-
101
-                        if (dr["地区名称"].ToString() != "" )
102
-                        {
103
-                           
104
-                            Model.T_RegionCategory dModel = new Model.T_RegionCategory();
105
-                            dModel.F_RegionName = dr["地区名称"].ToString();//地区名称
106
-                            dModel.F_Layer = F_Layer;
107
-                            if (F_RegionName != "")
108
-                            {
109
-                                Model.T_RegionCategory userModel = regionBLL.GetModel(F_RegionName);
110
-                                if (userModel != null)
111
-                                {
112
-                                    dModel.F_ParentId = userModel.F_RegionId;
113
-                                }
114
-                                else
115
-                                {
116
-                                    dModel.F_ParentId = 0;
117
-                                }
118
-                            }
119
-                            dModel.F_CreateBy = int .Parse (userscode);
120
-                            dModel.F_CreateOn = DateTime.Now;
121
-                            dModel.F_DeleteFlag = 0;
122
-                            dModel.F_Sort = 0;
123
-                            var res = regionBLL.Add(dModel);
124
-                            if (res > 0)
125
-                            {
126
-                                addoptlog(userscode, DTRequest.GetIP(), EnumOpt.import.ToString(), res.ToString(), "导入成功,导入的文件为:" + newpath + ",当前为第" + headrow + "行");
127
-                            }
128
-                            else
129
-                            {
130
-
131
-                                msg = msg + "第" + headrow + "行,导入失败<br>";
132
-                            }
133
-                        }
134
-                        else
135
-                            msg = msg + "第" + headrow + "行,地区名称为空或格式不正确,未导入<br>";
136
-                        #endregion
137
-                    }
138
-                    if (string.IsNullOrEmpty(msg))
139
-                        return Success("导入成功 ");
140
-                    else
141
-                        return Error(msg);
142
-                }
143
-
144
-            }
145
-            return Error("文件不能为空");
146
-        }
147
-        /// <summary>
148
-        /// 操作日志
149
-        /// </summary>
150
-        /// <param name="usercode">操作人工号</param>
151
-        /// <param name="ip">操作人IP</param>
152
-        /// <param name="optcode">操作编号</param>
153
-        /// <param name="optid">操作id</param>
154
-        /// <param name="des">操作描述</param>
155
-        private void addoptlog(string usercode, string ip, string optcode, string optid, string des)
156
-        {
157
-            new BLL.T_Sys_OperateLogs().AddOptLog("地区管理", usercode, ip, des, optcode, "T_RegionCategory", optid);
158
-        }
159
-
160
-        /// <summary>
161
-        /// 获取地市
162
-        /// </summary>
163
-        /// <param name="deptId"></param>
164
-        /// <returns></returns>
165
-        public ActionResult GetRegion(int deptId = 0)
166
-        {
167
-            if (Request.IsAuthenticated)
168
-            {
169
-                BLL.T_RegionCategory dBLL = new BLL.T_RegionCategory();
170
-                Model.T_RegionCategory dModel = dBLL.GetModel(deptId);
171
-                if (dModel != null)
172
-                    return Success("获取地市信息成功", dModel);
173
-                return Error("获取地市信息失败");
174
-            }
175
-            return NoToken("未知错误,请重新登录");
176
-        }
177
-
178
-        /// <summary>
179
-        /// 添加地市
180
-        /// </summary>
181
-        /// <param name="input"></param>
182
-        /// <returns></returns>
183
-        [HttpPost]
184
-        public ActionResult AddRegion(RegionCategoryInput input)
185
-        {
186
-          
187
-                Model.T_RegionCategory dModel = new Model.T_RegionCategory();
188
-                dModel.F_ParentId = input.F_ParentId;
189
-                dModel.F_Sort = input.F_Sort;
190
-                dModel.F_RegionName = input.F_RegionName;
191
-                dModel.F_DeleteFlag = 0;
192
-                dModel.F_Layer = input.F_Layer;
193
-                dModel.F_CreateBy = CurrentUser.UserData.F_UserId;
194
-                dModel.F_CreateOn = DateTime.Now;
195
-                if (regionBLL.Add(dModel) > 0)
196
-                    return Success("添加成功");
197
-                else
198
-                    return Success("添加失败");
199
-           
200
-        }
201
-
202
-        /// <summary>
203
-        /// 编辑地市
204
-        /// </summary>
205
-        /// <param name="input"></param>
206
-        /// <returns></returns>
207
-        [HttpPost]
208
-        public ActionResult EditRegion(RegionCategoryInput input)
209
-        {
210
-          
211
-                if (input.F_RegionId <= 0)
212
-                    return Error("请选择要编辑的地市");
213
-                BLL.T_RegionCategory dBLL = new BLL.T_RegionCategory();
214
-                Model.T_RegionCategory dModel = dBLL.GetModel(input.F_RegionId);
215
-                if (dModel == null)
216
-                    return Error("获取信息失败");
217
-                dModel.F_ParentId = input.F_ParentId;
218
-                dModel.F_Sort = input.F_Sort;
219
-                dModel.F_RegionName = input.F_RegionName;
220
-                dModel.F_Layer = input.F_Layer;
221
-                dModel.F_ModifyBy = CurrentUser.UserData.F_UserId;
222
-                dModel.F_ModifyOn = DateTime.Now;
223
-                if (dBLL.Update(dModel))
224
-                    return Success("编辑成功");
225
-                return Error("编辑失败");
226
-         
227
-        }
228
-
229
-        /// <summary>
230
-        /// 删除地市
231
-        /// </summary>
232
-        /// <param name="ids"></param>
233
-        /// <returns></returns>
234
-        public ActionResult DelRegion(string[] ids)
235
-        {
236
-          
237
-                if (ids == null || ids.Length <= 0)
238
-                    return Error("请选择要删除的地市");
239
-
240
-                var idStr = string.Join(",", ids);
241
-                if (string.IsNullOrEmpty(idStr.Trim()))
242
-                    return Error("请选择要删除的地市");
243
-
244
-                if (regionBLL.DeleteList(idStr))
245
-                    return Success("删除成功");
246
-                return Error("删除失败");
247
-        
248
-        }
249
-
250
-        #region 获取地市列表 - 优化前的
251
-        ///// <summary>
252
-        ///// 获取地市列表
253
-        ///// </summary>
254
-        ///// <returns></returns>
255
-        //public ActionResult GetRegionList(int pId = 0)
256
-        //{
257
-        //    if (Request.IsAuthenticated)
258
-        //    {
259
-        //        DataTable dt = new DataTable();
260
-        //        dt = new BLL.T_RegionCategory().GetList(" F_DeleteFlag=0 and F_ParentId=" + pId).Tables[0];
261
-        //        List<Model.TreeModel> modelList = BindTree(dt, "0");
262
-
263
-        //        if (modelList != null)
264
-        //        {
265
-        //            if (modelList.Count > 0)
266
-        //                return Success("加载成功", modelList);
267
-        //        }
268
-        //        return Error("加载失败");
269
-        //    }
270
-        //    return NoToken("未知错误,请重新登录");
271
-        //}
272
-        ///// <summary>
273
-        ///// tree  树形地市
274
-        ///// </summary>
275
-        ///// <param name="tab"></param>
276
-        ///// <param name="parentid"></param>
277
-        ///// <returns></returns>
278
-        //private List<Model.TreeModel> BindTree(DataTable tab, string parentid)
279
-        //{
280
-        //    DataTable tab2 = new DataTable();
281
-
282
-        //    if (tab != null && tab.Rows.Count > 0)
283
-        //    {
284
-        //        List<Model.T_RegionCategory> categorylist = new BLL.T_RegionCategory().DataTableToList(tab);
285
-        //        List<Model.TreeModel> modelList = new List<Model.TreeModel>(categorylist.Count);
286
-        //        for (int i = 0; i < categorylist.Count; i++)
287
-        //        {
288
-        //            Model.TreeModel model = new Model.TreeModel();
289
-        //            string currentID = categorylist[i].F_RegionId.ToString();//当前功能ID
290
-        //            model.id = currentID;
291
-        //            model.IconCls = "";//图标
292
-        //            model.headerid =int .Parse ( categorylist[i].F_Layer.ToString ());
293
-        //            model.text = categorylist[i].F_RegionName;
294
-        //            tab2 = new BLL.T_RegionCategory().GetList("F_ParentId=" + currentID + " and F_DeleteFlag=0 order by f_sort").Tables[0];
295
-        //            if (tab2 != null && tab2.Rows.Count > 0)
296
-        //            {
297
-        //                model.children = BindTree(tab2, currentID);
298
-        //            }
299
-        //            modelList.Add(model);
300
-        //        }
301
-        //        return modelList;
302
-
303
-        //    }
304
-        //    else
305
-        //    {
306
-        //        return null;
307
-        //    }
308
-
309
-        //}
310
-
311
-        #endregion
312
-
313
-
314
-        public List<T_RegionCategory> list = null;
315
-        #region 获取地市列表 - 优化后的
316
-        /// <summary>
317
-        /// 获取地市列表
318
-        /// </summary>
319
-        /// <returns></returns>
320
-        public ActionResult GetRegionList(int pId = 0)
321
-        {
322
-            if (Request.IsAuthenticated)
323
-            {
324
-                list = new BLL.T_RegionCategory().GetModelList(" F_DeleteFlag=0 ");
325
-                var list_p = list.Where(x => x.F_ParentId == pId).ToList();
326
-                List<Model.TreeModel> modelList = BindTree(list_p, "0");
327
-
328
-                if (modelList != null)
329
-                {
330
-                    if (modelList.Count > 0)
331
-                        return Success("加载成功", modelList);
332
-                }
333
-                return Error("加载失败");
334
-            }
335
-            return NoToken("未知错误,请重新登录");
336
-        }
337
-        /// <summary>
338
-        /// tree  树形地市
339
-        /// </summary>
340
-        /// <param name="tab"></param>
341
-        /// <param name="parentid"></param>
342
-        /// <returns></returns>
343
-        private List<Model.TreeModel> BindTree(List<T_RegionCategory> tab, string parentid)
344
-        {
345
-            if (tab.Count > 0)
346
-            {
347
-                List<Model.TreeModel> modelList = new List<Model.TreeModel>(tab.Count);
348
-                for (int i = 0; i < tab.Count; i++)
349
-                {
350
-                    Model.TreeModel model = new Model.TreeModel();
351
-                    int F_RegionId = tab[i].F_RegionId;
352
-                    string currentID = tab[i].F_RegionId.ToString();//当前功能ID
353
-                    model.id = currentID;
354
-                    model.IconCls = "";//图标
355
-                    model.headerid = int.Parse(tab[i].F_Layer.ToString());
356
-                    model.text = tab[i].F_RegionName;
357
-                    var tab2 = list.Where(x => x.F_ParentId == F_RegionId).OrderByDescending(x=>x.F_Sort).ToList();
358
-                    if (tab2.Count > 0)
359
-                    {
360
-                        model.children = BindTree(tab2, currentID);
361
-                    }
362
-                    modelList.Add(model);
363
-                }
364
-                return modelList;
365
-
366
-            }
367
-            else
368
-            {
369
-                return null;
370
-            }
371
-
372
-        }
373
-        #endregion
374
-    }
375
-}

+ 0 - 28
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Models/Dto/Order.cs

@@ -1,28 +0,0 @@
1
-using System;
2
-using System.Collections.Generic;
3
-using System.Linq;
4
-using System.Web;
5
-
6
-namespace CallCenterApi.Interface.Models.Dto
7
-{
8
-    public class OrderDto
9
-    {
10
-        public int id { get; set; }
11
-        public string orderno { get; set; }
12
-        public int? userid { get; set; }
13
-        public string username { get; set; }
14
-        public string express { get; set; }
15
-        public string expressno { get; set; }
16
-        public string acceptname { get; set; }
17
-        public string postcode { get; set; }
18
-        public string telphone { get; set; }
19
-        public string mobile { get; set; }
20
-        public string address { get; set; }
21
-        public string remark { get; set; }
22
-        public decimal orderamount { get; set; }
23
-        public string status { get; set; }
24
-        public DateTime addtime { get; set; }
25
-
26
-
27
-    }
28
-}

+ 0 - 42
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Views/web.config

@@ -1,42 +0,0 @@
1
-<?xml version="1.0"?>
2
-
3
-<configuration>
4
-  <configSections>
5
-    <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
6
-      <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
7
-      <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
8
-    </sectionGroup>
9
-  </configSections>
10
-
11
-  <system.web.webPages.razor>
12
-    <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
13
-    <pages pageBaseType="System.Web.Mvc.WebViewPage">
14
-      <namespaces>
15
-        <add namespace="System.Web.Mvc" />
16
-        <add namespace="System.Web.Mvc.Ajax" />
17
-        <add namespace="System.Web.Mvc.Html" />
18
-        <add namespace="System.Web.Routing" />
19
-        <add namespace="CallCenterApi.Interface" />
20
-      </namespaces>
21
-    </pages>
22
-  </system.web.webPages.razor>
23
-
24
-  <appSettings>
25
-    <add key="webpages:Enabled" value="false" />
26
-  </appSettings>
27
-
28
-  <system.webServer>
29
-    <handlers>
30
-      <remove name="BlockViewHandler"/>
31
-      <add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
32
-    </handlers>
33
-  </system.webServer>
34
-
35
-  <system.web>
36
-    <compilation>
37
-      <assemblies>
38
-        <add assembly="System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
39
-      </assemblies>
40
-    </compilation>
41
-  </system.web>
42
-</configuration>