duhongyu 6 年 前
コミット
f4c7fce187
共有16 個のファイルを変更した1480 個の追加94 個の削除を含む
  1. 8 1
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/CallCenterApi.Interface.csproj
  2. 8 0
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/CallCenterApi.Interface.csproj.user
  3. 10 5
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Configs/system.config
  4. 385 0
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/customer/RegionCategoryController_BACKUP_232.cs
  5. 310 0
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/customer/RegionCategoryController_BASE_232.cs
  6. 313 0
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/customer/RegionCategoryController_LOCAL_232.cs
  7. 375 0
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/customer/RegionCategoryController_REMOTE_232.cs
  8. 40 75
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/WOReportController.cs
  9. 3 2
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Web.config
  10. 3 2
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/bin/CallCenterApi.Interface.dll.config
  11. 10 5
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/obj/Release/Package/PackageTmp/Configs/system.config
  12. 2 1
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/obj/Release/Package/PackageTmp/Web.config
  13. 4 0
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/obj/Release/Package/PackageTmp/packages.config
  14. 3 2
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/obj/Release/TransformWebConfig/original/Web.config
  15. 2 1
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/obj/Release/TransformWebConfig/transformed/Web.config
  16. 4 0
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/packages.config

+ 8 - 1
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/CallCenterApi.Interface.csproj

@@ -82,7 +82,7 @@
82 82
     </Reference>
83 83
     <Reference Include="Microsoft.CSharp" />
84 84
     <Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
85
-      <HintPath>..\..\..\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
85
+      <HintPath>..\..\..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
86 86
     </Reference>
87 87
     <Reference Include="NPOI, Version=2.3.0.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
88 88
       <SpecificVersion>False</SpecificVersion>
@@ -100,6 +100,9 @@
100 100
       <SpecificVersion>False</SpecificVersion>
101 101
       <HintPath>..\..\..\packages\NPOI.2.3.0\lib\net40\NPOI.OpenXmlFormats.dll</HintPath>
102 102
     </Reference>
103
+    <Reference Include="qcloudsms_csharp, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
104
+      <HintPath>..\..\..\packages\qcloud.qcloudsms_csharp.0.1.6\lib\net40\qcloudsms_csharp.dll</HintPath>
105
+    </Reference>
103 106
     <Reference Include="Senparc.Weixin, Version=4.12.3.31913, Culture=neutral, processorArchitecture=MSIL">
104 107
       <SpecificVersion>False</SpecificVersion>
105 108
       <HintPath>Lib\Senparc.Weixin.dll</HintPath>
@@ -109,6 +112,7 @@
109 112
       <HintPath>Lib\Senparc.Weixin.MP.dll</HintPath>
110 113
     </Reference>
111 114
     <Reference Include="System.Data.DataSetExtensions" />
115
+    <Reference Include="System.Net" />
112 116
     <Reference Include="System.Net.Http" />
113 117
     <Reference Include="System.Net.Http.WebRequest" />
114 118
     <Reference Include="System.Web.DynamicData" />
@@ -318,9 +322,11 @@
318 322
     <None Include="Properties\PublishProfiles\XiXianSZCG_API.pubxml" />
319 323
     <None Include="Web.Debug.config">
320 324
       <DependentUpon>Web.config</DependentUpon>
325
+      <SubType>Designer</SubType>
321 326
     </None>
322 327
     <None Include="Web.Release.config">
323 328
       <DependentUpon>Web.config</DependentUpon>
329
+      <SubType>Designer</SubType>
324 330
     </None>
325 331
   </ItemGroup>
326 332
   <ItemGroup>
@@ -391,6 +397,7 @@
391 397
     <Folder Include="Views\VisitRecords\" />
392 398
     <Folder Include="Views\VisitReport\" />
393 399
     <Folder Include="Views\VisitTelphone\" />
400
+    <Folder Include="Views\Web\" />
394 401
     <Folder Include="Views\WoBill\" />
395 402
     <Folder Include="Views\WOReport\" />
396 403
     <Folder Include="Views\Workcalendar\" />

+ 8 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/CallCenterApi.Interface.csproj.user

@@ -11,6 +11,14 @@
11 11
     <NameOfLastUsedPublishProfile>sycw</NameOfLastUsedPublishProfile>
12 12
     <ProjectView>ShowAllFiles</ProjectView>
13 13
     <LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
14
+    <Use64BitIISExpress />
15
+    <IISExpressSSLPort />
16
+    <IISExpressAnonymousAuthentication />
17
+    <IISExpressWindowsAuthentication />
18
+    <IISExpressUseClassicPipelineMode />
19
+    <UseGlobalApplicationHostFile />
20
+    <Controller_SelectedScaffolderID>MvcControllerEmptyScaffolder</Controller_SelectedScaffolderID>
21
+    <Controller_SelectedScaffolderCategoryPath>root/Controller</Controller_SelectedScaffolderCategoryPath>
14 22
   </PropertyGroup>
15 23
   <ProjectExtensions>
16 24
     <VisualStudio>

+ 10 - 5
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Configs/system.config

@@ -19,22 +19,27 @@
19 19
   <!-- 设置邮箱主机 -->
20 20
   <add key="MailHost" value="smtp.ym.163.com" />
21 21
   <!-- ================== 3:微信配置参数 ================== -->
22
+     <!--新乡心连心-->
23
+ <add key="WechatAppid" value="wxeb3e1e01c493e5be" />
24
+  <add key="WechatAppsecret" value="653b03c7845240cdb43b28385321d50f" />
22 25
   <!--加一测试-->
23
-  <add key="WechatAppid" value="wx0d67bbb5666ec226" />
24
-  <add key="WechatAppsecret" value="be4785fa9866f2b380cd18999785baa3" />
26
+ <!-- <add key="WechatAppid" value="wx0d67bbb5666ec226" />
27
+  <add key="WechatAppsecret" value="be4785fa9866f2b380cd18999785baa3" />-->
28
+  
25 29
   <!-- 设置微信TemplateId 	工单进度提醒 -->
26
-  <add key="TemplateId" value="cQ7F1ePjEsOl7ntBEV_BV4OQoFcoU5Zh69S2qmyZrW4" />
30
+<!-- <add key="TemplateId" value="cQ7F1ePjEsOl7ntBEV_BV4OQoFcoU5Zh69S2qmyZrW4" /> --> 
27 31
   <!-- 设置微信 消息跳转url MessageUrl -->
28
-  <add key="MessageUrl" value="http://jiayi.800100.net/sycw/index.html?menucode=GDXQ" />
32
+<!-- <add key="MessageUrl" value="http://jiayi.800100.net/sycw/index.html?menucode=GDXQ" /> --> 
29 33
   <!-- ================== 4:公司名称中需截取掉的字符串 ================== -->
30 34
   <add key="keystring" value="有限公司,公司,科技,网络,信息,河南,河南省,洛阳,洛阳市,郑州,郑州市,南阳,南阳市,新乡,新乡市,有限、商贸、市"/>
31 35
   <!-- ================== 5:IVR文件上传FTP配置参数 ================== -->
32 36
   <!-- 设置FTP -->
33
-  <add key="ftp" value="192.168.4.18" />
37
+  <add key="ftp" value="10.11.202.223" />
34 38
   <!-- 设置账户名 -->
35 39
   <add key="account" value="bingbing" />
36 40
   <!-- 设置密码 -->
37 41
   <add key="password" value="Bing123456" />
38 42
   <!-- 文件保存位置 -->
39 43
   <add key="saveloc" value="\upload_wav\" />
44
+  
40 45
 </appSettings>

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

@@ -0,0 +1,385 @@
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
+}

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

@@ -0,0 +1,310 @@
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
+}

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

@@ -0,0 +1,313 @@
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
+}

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

@@ -0,0 +1,375 @@
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
+}

+ 40 - 75
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/WOReportController.cs

@@ -3003,8 +3003,8 @@ question, int page = 1, int limit = 10)
3003 3003
             }
3004 3004
             else
3005 3005
             {
3006
-                stime = DateTime.Now.AddDays(1 - DateTime.Now.Day).Date.ToString("yyyy-MM-dd");
3007
-                sql += " and CONVERT(varchar , F_CreateOn, 120)>=CONVERT(varchar , '" + stime.Trim() + " 00:00:01', 120) ";
3006
+              //  stime = DateTime.Now.AddDays(1 - DateTime.Now.Day).Date.ToString("yyyy-MM-dd");
3007
+              //  sql += " and CONVERT(varchar , F_CreateOn, 120)>=CONVERT(varchar , '" + stime.Trim() + " 00:00:01', 120) ";
3008 3008
             }
3009 3009
             if (endtime != null && endtime.Trim() != "")
3010 3010
             {
@@ -3012,8 +3012,8 @@ question, int page = 1, int limit = 10)
3012 3012
             }
3013 3013
             else
3014 3014
             {
3015
-                endtime = DateTime.Now.ToString("yyyy-MM-dd");
3016
-                sql += " and CONVERT(varchar , F_CreateOn, 120)<=CONVERT(varchar , '" + endtime.Trim() + " 23:59:59', 120) ";
3015
+              //  endtime = DateTime.Now.ToString("yyyy-MM-dd");
3016
+              //  sql += " and CONVERT(varchar , F_CreateOn, 120)<=CONVERT(varchar , '" + endtime.Trim() + " 23:59:59', 120) ";
3017 3017
             }
3018 3018
           
3019 3019
             var modellist = workOrder.GetModelList(sql);
@@ -3100,9 +3100,10 @@ question, int page = 1, int limit = 10)
3100 3100
                                         worker.F_Responsibility = deptmodel.F_DeptName;
3101 3101
                                     }
3102 3102
                                 }
3103
+
3103 3104
                                 int limit = it.F_limit ;
3104
-                                    if (itemList != null)
3105
-                                  {
3105
+                                if (itemList != null)
3106
+                                {
3106 3107
                                     for (int z = 0; z < itemList.Count; z++)
3107 3108
                                     {
3108 3109
                                         if (itemList[z].F_WoState >= 1)
@@ -3110,86 +3111,50 @@ question, int page = 1, int limit = 10)
3110 3111
                                             if (itemList[z].F_WoState == 1)
3111 3112
                                             {
3112 3113
                                                 x = z;
3113
-                                                timeover = itemList[z ].F_CreateTime.ToString();
3114
-                                             //   limit = int.Parse(itemList[z].F_LimitTime);
3114
+                                                timeover = itemList[z].F_CreateTime.ToString();
3115
+                                                //   limit = int.Parse(itemList[z].F_LimitTime);
3115 3116
                                                 continue;
3116 3117
                                             }
3117 3118
                                         }
3118 3119
                                     }
3119
-                                  for (int z = 0; z < itemList.Count; z++)
3120
-                                    {
3121
-                                        if (itemList[z].F_WoState >= 1)
3122
-                                        {
3123
-                                            if (itemList[z].F_WoState == 10)
3124
-                                            {
3125
-                                                y = z;
3126
-                                                timeover2 = itemList[z].F_CreateTime.ToString();
3127
-                                          //      limit = int.Parse(itemList[z].F_LimitTime);
3128
-                                            }
3129
-                                        }
3130
-                                        if (timeover2 != "")
3131
-                                        {
3132
-                                            if (timeover != "")
3133
-                                            {
3134
-                                                if (x > y)
3135
-                                                {
3136
-                                                    System.TimeSpan id = DateTime.Parse(timeover2) - DateTime.Parse(timeover);
3137
-                                                    double a = id.TotalHours;
3138
-                                                    worker.time = a - limit;
3139
-                                                    timehource.Add((float)worker.time);
3140
-                                                    if (worker.time > 24)
3141
-                                                    {
3142
-                                                        double t = worker.time / 24;
3143
-                                                        double v = worker.time % 24;
3144
-                                                        worker.overtime = string.Format("{0:f0}天{1:f2}h", t, v);
3145
-                                                       
3146
-                                                    }
3147
-                                                    else
3148
-                                                    {
3149
-                                                        worker.overtime = string.Format("{0:f2}h", a - limit);
3150
-                                                    }
3151
-                                                }
3152
-                                                else
3153
-                                                {
3154
-                                                    System.TimeSpan id = DateTime.Now - DateTime.Parse(timeover);
3155
-                                                    double a = id.TotalHours;
3120
+                                 if (it .F_State ==10|| it.F_State == 11)
3121
+                                {
3156 3122
 
3157
-                                                    worker.time = a - limit;
3158
-                                                    timehource.Add((float)worker.time);
3159
-                                                    if (worker.time > 24)
3160
-                                                    {
3161
-                                                        double t = worker.time / 24;
3162
-                                                        double v = worker.time % 24;
3163
-                                                        worker.overtime = string.Format("{0:f0}天{1:f2}h", t, v);
3164
-                                                    }
3165
-                                                    else
3166
-                                                    {
3167
-                                                        worker.overtime = string.Format("{0:f2}h", a - limit);
3168
-                                                    }
3123
+                                    System.TimeSpan id = DateTime.Parse(it .F_DealTime .ToString ()) - DateTime.Parse(timeover);
3124
+                                    double a = id.TotalHours;
3125
+                                    worker.time = a - limit;
3126
+                                    timehource.Add((float)worker.time);
3127
+                                    if (worker.time > 24)
3128
+                                    {
3129
+                                        double t = worker.time / 24;
3130
+                                        double v = worker.time % 24;
3131
+                                        worker.overtime = string.Format("{0:f0}天{1:f2}h", t, v);
3169 3132
 
3170
-                                                }
3171
-                                            }
3133
+                                    }
3134
+                                    else
3135
+                                    {
3136
+                                        worker.overtime = string.Format("{0:f2}h", a - limit);
3137
+                                    }
3138
+                                  }
3139
+                                 else
3140
+                                    {
3141
+                                        System.TimeSpan id = DateTime.Now - DateTime.Parse(timeover);
3142
+                                        double a = id.TotalHours;
3172 3143
 
3144
+                                        worker.time = a - limit;
3145
+                                        timehource.Add((float)worker.time);
3146
+                                        if (worker.time > 24)
3147
+                                        {
3148
+                                            double t = worker.time / 24;
3149
+                                            double v = worker.time % 24;
3150
+                                            worker.overtime = string.Format("{0:f0}天{1:f2}h", t, v);
3173 3151
                                         }
3174
-                                        else if (timeover != "")
3152
+                                        else
3175 3153
                                         {
3176
-                                            System.TimeSpan id = DateTime.Now - DateTime.Parse(timeover);
3177
-                                            double a = id.TotalHours;
3178
-
3179
-                                            worker.time = a - limit;
3180
-                                            timehource.Add((float)worker.time);
3181
-                                            if (worker.time > 24)
3182
-                                            {
3183
-                                                double t = worker.time / 24;
3184
-                                                double v = worker.time % 24;
3185
-                                                worker.overtime = string.Format("{0:f0}天{1:f2}h", t, v);
3186
-                                            }
3187
-                                            else
3188
-                                            {
3189
-                                                worker.overtime = string.Format("{0:f2}h", a - limit);
3190
-                                            }
3154
+                                            worker.overtime = string.Format("{0:f2}h", a - limit);
3191 3155
                                         }
3192 3156
                                     }
3157
+                                 
3193 3158
                                 }
3194 3159
                                 if (it.F_State != 11)
3195 3160
                                     Overdue++;

+ 3 - 2
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Web.config

@@ -17,11 +17,12 @@
17 17
     <add key="smssign" value=""/>
18 18
   </appSettings>
19 19
   <connectionStrings>
20
-    <add name="ConnectionString" connectionString="Data Source=192.168.4.18;User ID=sa;pwd=800100;Initial Catalog=CallCenter_XinXiangXLX;"/>
20
+    <!--<add name="ConnectionString" connectionString="Data Source=192.168.4.18;User ID=sa;pwd=800100;Initial Catalog=CallCenter_XinXiangXLX;"/>-->
21
+  <add name="ConnectionString" connectionString="Data Source=192.168.4.18;User ID=sa;pwd=800100;Initial Catalog=CallCenter_XinXiangXLX;" />
21 22
   </connectionStrings>
22 23
   <system.web>
23 24
     <compilation debug="true" targetFramework="4.5"/>
24
-    <httpRuntime targetFramework="4.5"/>
25
+    <httpRuntime targetFramework="4.5" maxRequestLength="20971520" executionTimeout="360000"/>
25 26
     <httpModules>
26 27
       <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web"/>
27 28
     </httpModules>

+ 3 - 2
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/bin/CallCenterApi.Interface.dll.config

@@ -17,11 +17,12 @@
17 17
     <add key="smssign" value=""/>
18 18
   </appSettings>
19 19
   <connectionStrings>
20
-    <add name="ConnectionString" connectionString="Data Source=192.168.4.18;User ID=sa;pwd=800100;Initial Catalog=CallCenter_XinXiangXLX;"/>
20
+    <!--<add name="ConnectionString" connectionString="Data Source=192.168.4.18;User ID=sa;pwd=800100;Initial Catalog=CallCenter_XinXiangXLX;"/>-->
21
+  <add name="ConnectionString" connectionString="Data Source=192.168.4.18;User ID=sa;pwd=800100;Initial Catalog=CallCenter_XinXiangXLX;" />
21 22
   </connectionStrings>
22 23
   <system.web>
23 24
     <compilation debug="true" targetFramework="4.5"/>
24
-    <httpRuntime targetFramework="4.5"/>
25
+    <httpRuntime targetFramework="4.5" maxRequestLength="20971520" executionTimeout="360000"/>
25 26
     <httpModules>
26 27
       <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web"/>
27 28
     </httpModules>

+ 10 - 5
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/obj/Release/Package/PackageTmp/Configs/system.config

@@ -19,22 +19,27 @@
19 19
   <!-- 设置邮箱主机 -->
20 20
   <add key="MailHost" value="smtp.ym.163.com" />
21 21
   <!-- ================== 3:微信配置参数 ================== -->
22
+     <!--新乡心连心-->
23
+ <add key="WechatAppid" value="wxeb3e1e01c493e5be" />
24
+  <add key="WechatAppsecret" value="653b03c7845240cdb43b28385321d50f" />
22 25
   <!--加一测试-->
23
-  <add key="WechatAppid" value="wx0d67bbb5666ec226" />
24
-  <add key="WechatAppsecret" value="be4785fa9866f2b380cd18999785baa3" />
26
+ <!-- <add key="WechatAppid" value="wx0d67bbb5666ec226" />
27
+  <add key="WechatAppsecret" value="be4785fa9866f2b380cd18999785baa3" />-->
28
+  
25 29
   <!-- 设置微信TemplateId 	工单进度提醒 -->
26
-  <add key="TemplateId" value="cQ7F1ePjEsOl7ntBEV_BV4OQoFcoU5Zh69S2qmyZrW4" />
30
+<!-- <add key="TemplateId" value="cQ7F1ePjEsOl7ntBEV_BV4OQoFcoU5Zh69S2qmyZrW4" /> --> 
27 31
   <!-- 设置微信 消息跳转url MessageUrl -->
28
-  <add key="MessageUrl" value="http://jiayi.800100.net/sycw/index.html?menucode=GDXQ" />
32
+<!-- <add key="MessageUrl" value="http://jiayi.800100.net/sycw/index.html?menucode=GDXQ" /> --> 
29 33
   <!-- ================== 4:公司名称中需截取掉的字符串 ================== -->
30 34
   <add key="keystring" value="有限公司,公司,科技,网络,信息,河南,河南省,洛阳,洛阳市,郑州,郑州市,南阳,南阳市,新乡,新乡市,有限、商贸、市"/>
31 35
   <!-- ================== 5:IVR文件上传FTP配置参数 ================== -->
32 36
   <!-- 设置FTP -->
33
-  <add key="ftp" value="192.168.4.18" />
37
+  <add key="ftp" value="10.11.202.223" />
34 38
   <!-- 设置账户名 -->
35 39
   <add key="account" value="bingbing" />
36 40
   <!-- 设置密码 -->
37 41
   <add key="password" value="Bing123456" />
38 42
   <!-- 文件保存位置 -->
39 43
   <add key="saveloc" value="\upload_wav\" />
44
+  
40 45
 </appSettings>

+ 2 - 1
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/obj/Release/Package/PackageTmp/Web.config

@@ -17,11 +17,12 @@
17 17
     <add key="smssign" value="" />
18 18
   </appSettings>
19 19
   <connectionStrings>
20
+    <!--<add name="ConnectionString" connectionString="Data Source=192.168.4.18;User ID=sa;pwd=800100;Initial Catalog=CallCenter_XinXiangXLX;"/>-->
20 21
     <add name="ConnectionString" connectionString="Data Source=192.168.4.18;User ID=sa;pwd=800100;Initial Catalog=CallCenter_XinXiangXLX;" />
21 22
   </connectionStrings>
22 23
   <system.web>
23 24
     <compilation targetFramework="4.5" />
24
-    <httpRuntime targetFramework="4.5" />
25
+    <httpRuntime targetFramework="4.5" maxRequestLength="20971520" executionTimeout="360000" />
25 26
     <httpModules>
26 27
       <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" />
27 28
     </httpModules>

+ 4 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/obj/Release/Package/PackageTmp/packages.config

@@ -16,5 +16,9 @@
16 16
   <package id="Microsoft.AspNet.WebPages.zh-Hans" version="3.2.3" targetFramework="net45" />
17 17
   <package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="1.0.0" targetFramework="net45" />
18 18
   <package id="Microsoft.Net.Compilers" version="1.0.0" targetFramework="net45" developmentDependency="true" />
19
+  <package id="Microsoft.Net.Http" version="2.0.20710.0" targetFramework="net45" />
19 20
   <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
21
+  <package id="Newtonsoft.Json" version="10.0.3" targetFramework="net45" />
22
+  <package id="qcloud.qcloudsms_csharp" version="0.1.6" targetFramework="net45" />
23
+  <package id="System.Net.Http" version="2.0.20710.0" targetFramework="net45" />
20 24
 </packages>

+ 3 - 2
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/obj/Release/TransformWebConfig/original/Web.config

@@ -17,11 +17,12 @@
17 17
     <add key="smssign" value=""/>
18 18
   </appSettings>
19 19
   <connectionStrings>
20
-    <add name="ConnectionString" connectionString="Data Source=192.168.4.18;User ID=sa;pwd=800100;Initial Catalog=CallCenter_XinXiangXLX;"/>
20
+    <!--<add name="ConnectionString" connectionString="Data Source=192.168.4.18;User ID=sa;pwd=800100;Initial Catalog=CallCenter_XinXiangXLX;"/>-->
21
+  <add name="ConnectionString" connectionString="Data Source=192.168.4.18;User ID=sa;pwd=800100;Initial Catalog=CallCenter_XinXiangXLX;" />
21 22
   </connectionStrings>
22 23
   <system.web>
23 24
     <compilation debug="true" targetFramework="4.5"/>
24
-    <httpRuntime targetFramework="4.5"/>
25
+    <httpRuntime targetFramework="4.5" maxRequestLength="20971520" executionTimeout="360000"/>
25 26
     <httpModules>
26 27
       <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web"/>
27 28
     </httpModules>

+ 2 - 1
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/obj/Release/TransformWebConfig/transformed/Web.config

@@ -17,11 +17,12 @@
17 17
     <add key="smssign" value="" />
18 18
   </appSettings>
19 19
   <connectionStrings>
20
+    <!--<add name="ConnectionString" connectionString="Data Source=192.168.4.18;User ID=sa;pwd=800100;Initial Catalog=CallCenter_XinXiangXLX;"/>-->
20 21
     <add name="ConnectionString" connectionString="Data Source=192.168.4.18;User ID=sa;pwd=800100;Initial Catalog=CallCenter_XinXiangXLX;" />
21 22
   </connectionStrings>
22 23
   <system.web>
23 24
     <compilation targetFramework="4.5" />
24
-    <httpRuntime targetFramework="4.5" />
25
+    <httpRuntime targetFramework="4.5" maxRequestLength="20971520" executionTimeout="360000" />
25 26
     <httpModules>
26 27
       <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" />
27 28
     </httpModules>

+ 4 - 0
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/packages.config

@@ -16,5 +16,9 @@
16 16
   <package id="Microsoft.AspNet.WebPages.zh-Hans" version="3.2.3" targetFramework="net45" />
17 17
   <package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="1.0.0" targetFramework="net45" />
18 18
   <package id="Microsoft.Net.Compilers" version="1.0.0" targetFramework="net45" developmentDependency="true" />
19
+  <package id="Microsoft.Net.Http" version="2.0.20710.0" targetFramework="net45" />
19 20
   <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
21
+  <package id="Newtonsoft.Json" version="10.0.3" targetFramework="net45" />
22
+  <package id="qcloud.qcloudsms_csharp" version="0.1.6" targetFramework="net45" />
23
+  <package id="System.Net.Http" version="2.0.20710.0" targetFramework="net45" />
20 24
 </packages>