Przeglądaj źródła

号码归属地

duhongyu 3 lat temu
rodzic
commit
950c71c90f
15 zmienionych plików z 281 dodań i 83 usunięć
  1. 30 2
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/CallCenterApi.Interface.csproj
  2. 35 2
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/CallOutOptController.cs
  3. 0 5
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/customer/CustomerController.cs
  4. 2 2
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/report/BusinessController.cs
  5. 61 12
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/CallInScreenController.cs
  6. 91 7
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/MobiledataController.cs
  7. 38 22
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderController.cs
  8. 10 6
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkorderAppController.cs
  9. 7 0
      codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/packages.config
  10. 2 3
      codegit/CallCenterCommon/CallCenter.QuartzService/CallCenter.QuartzService.csproj
  11. 1 13
      codegit/CallCenterCommon/CallCenter.QuartzService/SMSService.cs
  12. 0 4
      codegit/CallCenterCommon/CallCenter.QuartzService/SMSTask.cs
  13. 1 1
      codegit/CallCenterCommon/CallCenter.QuartzService/packages.config
  14. 2 3
      codegit/CallCenterCommon/CallCenter.Utility/CallCenter.Utility.csproj
  15. 1 1
      codegit/CallCenterCommon/CallCenter.Utility/packages.config

+ 30 - 2
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/CallCenterApi.Interface.csproj

49
       <SpecificVersion>False</SpecificVersion>
49
       <SpecificVersion>False</SpecificVersion>
50
       <HintPath>..\..\..\CallCenterWeb\CallCenterWeb.UI\Bin\GetuiServerApiSDK.dll</HintPath>
50
       <HintPath>..\..\..\CallCenterWeb\CallCenterWeb.UI\Bin\GetuiServerApiSDK.dll</HintPath>
51
     </Reference>
51
     </Reference>
52
+    <Reference Include="HtmlAgilityPack, Version=1.11.45.0, Culture=neutral, PublicKeyToken=bd319b19eaf3b43a, processorArchitecture=MSIL">
53
+      <HintPath>..\..\..\packages\HtmlAgilityPack.1.11.45\lib\Net45\HtmlAgilityPack.dll</HintPath>
54
+    </Reference>
52
     <Reference Include="ICSharpCode.SharpZipLib">
55
     <Reference Include="ICSharpCode.SharpZipLib">
53
       <HintPath>..\..\..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll</HintPath>
56
       <HintPath>..\..\..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll</HintPath>
54
     </Reference>
57
     </Reference>
85
       <Private>True</Private>
88
       <Private>True</Private>
86
     </Reference>
89
     </Reference>
87
     <Reference Include="Microsoft.CSharp" />
90
     <Reference Include="Microsoft.CSharp" />
88
-    <Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
89
-      <HintPath>..\..\..\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
91
+    <Reference Include="Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
92
+      <HintPath>..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll</HintPath>
93
+    </Reference>
94
+    <Reference Include="Microsoft.Threading.Tasks.Extensions, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
95
+      <HintPath>..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll</HintPath>
96
+    </Reference>
97
+    <Reference Include="Microsoft.Threading.Tasks.Extensions.Desktop, Version=1.0.168.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
98
+      <HintPath>..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll</HintPath>
99
+    </Reference>
100
+    <Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
101
+      <HintPath>..\..\..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
90
     </Reference>
102
     </Reference>
91
     <Reference Include="NPOI, Version=2.3.0.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
103
     <Reference Include="NPOI, Version=2.3.0.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
92
       <SpecificVersion>False</SpecificVersion>
104
       <SpecificVersion>False</SpecificVersion>
112
       <SpecificVersion>False</SpecificVersion>
124
       <SpecificVersion>False</SpecificVersion>
113
       <HintPath>Lib\Senparc.Weixin.MP.dll</HintPath>
125
       <HintPath>Lib\Senparc.Weixin.MP.dll</HintPath>
114
     </Reference>
126
     </Reference>
127
+    <Reference Include="StarkbankEcdsa, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b2e6337a5d77bfbc, processorArchitecture=MSIL">
128
+      <HintPath>..\..\..\packages\starkbank-ecdsa.1.3.3\lib\net40\StarkbankEcdsa.dll</HintPath>
129
+    </Reference>
115
     <Reference Include="System.ComponentModel.Composition" />
130
     <Reference Include="System.ComponentModel.Composition" />
116
     <Reference Include="System.Data.DataSetExtensions" />
131
     <Reference Include="System.Data.DataSetExtensions" />
117
     <Reference Include="System.Net" />
132
     <Reference Include="System.Net" />
118
     <Reference Include="System.Net.Http" />
133
     <Reference Include="System.Net.Http" />
134
+    <Reference Include="System.Net.Http.Extensions, Version=2.2.29.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
135
+      <HintPath>..\..\..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Extensions.dll</HintPath>
136
+    </Reference>
137
+    <Reference Include="System.Net.Http.Primitives, Version=4.2.29.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
138
+      <HintPath>..\..\..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Primitives.dll</HintPath>
139
+    </Reference>
119
     <Reference Include="System.Net.Http.WebRequest" />
140
     <Reference Include="System.Net.Http.WebRequest" />
141
+    <Reference Include="System.Security" />
120
     <Reference Include="System.Transactions" />
142
     <Reference Include="System.Transactions" />
121
     <Reference Include="System.Web.DynamicData" />
143
     <Reference Include="System.Web.DynamicData" />
122
     <Reference Include="System.Web.Entity" />
144
     <Reference Include="System.Web.Entity" />
307
       <SubType>Designer</SubType>
329
       <SubType>Designer</SubType>
308
     </Content>
330
     </Content>
309
     <Content Include="ExcelMod\CustomerList_Mod.xls" />
331
     <Content Include="ExcelMod\CustomerList_Mod.xls" />
332
+    <Content Include="libman.json" />
310
     <None Include="Properties\PublishProfiles\1q.pubxml" />
333
     <None Include="Properties\PublishProfiles\1q.pubxml" />
311
     <None Include="Properties\PublishProfiles\FolderProfile.pubxml" />
334
     <None Include="Properties\PublishProfiles\FolderProfile.pubxml" />
312
     <None Include="Properties\PublishProfiles\my.pubxml" />
335
     <None Include="Properties\PublishProfiles\my.pubxml" />
468
     <Error Condition="!Exists('..\..\..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props'))" />
491
     <Error Condition="!Exists('..\..\..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props'))" />
469
     <Error Condition="!Exists('..\..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props'))" />
492
     <Error Condition="!Exists('..\..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props'))" />
470
   </Target>
493
   </Target>
494
+  <Import Project="..\..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets" Condition="Exists('..\..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" />
495
+  <Target Name="EnsureBclBuildImported" BeforeTargets="BeforeBuild" Condition="'$(BclBuildImported)' == ''">
496
+    <Error Condition="!Exists('..\..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=317567." HelpKeyword="BCLBUILD2001" />
497
+    <Error Condition="Exists('..\..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="The build restored NuGet packages. Build the project again to include these packages in the build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317568." HelpKeyword="BCLBUILD2002" />
498
+  </Target>
471
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
499
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
472
        Other similar extension points exist, see Microsoft.Common.targets.
500
        Other similar extension points exist, see Microsoft.Common.targets.
473
   <Target Name="BeforeBuild">
501
   <Target Name="BeforeBuild">

+ 35 - 2
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/CallOutOptController.cs

1
-using CallCenter.Utility;
1
+
2
+using CallCenter.Utility;
2
 using CallCenterApi.Interface.Controllers.Base;
3
 using CallCenterApi.Interface.Controllers.Base;
3
 using System;
4
 using System;
4
 using System.Collections.Generic;
5
 using System.Collections.Generic;
6
 using System.Web;
7
 using System.Web;
7
 using System.Web.Mvc;
8
 using System.Web.Mvc;
8
 
9
 
10
+
9
 namespace CallCenterApi.Interface.Controllers
11
 namespace CallCenterApi.Interface.Controllers
10
 {
12
 {
11
     public class CallOutOptController : BaseController
13
     public class CallOutOptController : BaseController
65
             }
67
             }
66
             return NoToken("未知错误,请重新登录");
68
             return NoToken("未知错误,请重新登录");
67
         }
69
         }
68
-
70
+      
69
         /// <summary>
71
         /// <summary>
70
         /// 根据号码和区号判断号码是否为归属地号码
72
         /// 根据号码和区号判断号码是否为归属地号码
71
         /// 返回0为分机号或特殊号码
73
         /// 返回0为分机号或特殊号码
100
                             return 2;
102
                             return 2;
101
                         }
103
                         }
102
                     }
104
                     }
105
+                    else
106
+                    {
107
+                       
108
+                        var PhoneNumber = tel.MobiledataController.GetDetails (phone.Substring(0, 7));
109
+                        if (PhoneNumber != null)
110
+                        {
111
+                            Model.T_Sys_MobileData dModel = new Model.T_Sys_MobileData();
112
+                            dModel.F_MobileNum = phone.Substring(0, 7);
113
+                            var model = new BLL.T_Sys_MobileData().GetList(1, "F_CityDes='" + PhoneNumber["省份"] + "-" + PhoneNumber["市区"] + "' and F_IsDelete=0", "F_Id desc  ");
114
+                            if (model != null)
115
+                                dModel.F_ZipCode = model.FirstOrDefault().F_ZipCode;
116
+                            dModel.F_CityDes = PhoneNumber["省份"] + "-" + PhoneNumber["市区"];
117
+                            dModel.F_CardDes = PhoneNumber["电信运营商"];
118
+                            dModel.F_IsDelete = 0;
119
+                            dModel.F_CreateUser = "8000";
120
+                            dModel.F_CreateTime = DateTime.Now;
121
+                            int t = new BLL.T_Sys_MobileData().Add(dModel);
122
+                            if (t > 0)
123
+                            {
124
+                                if (dModel.F_ZipCode.Equals(zipcode))
125
+                                {
126
+                                    return 1;
127
+                                }
128
+                                else
129
+                                {
130
+                                    return 2;
131
+                                }
132
+                            }
133
+
134
+                        }
135
+                    }
103
                 }
136
                 }
104
                 else
137
                 else
105
                 {
138
                 {

+ 0 - 5
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/customer/CustomerController.cs

1
 
1
 
2
 using System;
2
 using System;
3
-using System.Collections.Generic;
4
 using System.Linq;
3
 using System.Linq;
5
 using System.Web;
4
 using System.Web;
6
 using System.Web.Mvc;
5
 using System.Web.Mvc;
10
 using CallCenterApi.Common;
9
 using CallCenterApi.Common;
11
 using CallCenterApi.DB;
10
 using CallCenterApi.DB;
12
 using System.IO;
11
 using System.IO;
13
-using NPOI.XSSF.UserModel;
14
-using NPOI.HSSF.UserModel;
15
-using NPOI.SS.UserModel;
16
-using Newtonsoft.Json;
17
 using System.Reflection;
12
 using System.Reflection;
18
 
13
 
19
 namespace CallCenterApi.Interface.Controllers.customer
14
 namespace CallCenterApi.Interface.Controllers.customer

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

436
                     user = usermodel.F_UserName;
436
                     user = usermodel.F_UserName;
437
 
437
 
438
             }
438
             }
439
-            else if (DeptName == "山东" || DeptName == "华东"  )
439
+            else if (DeptName == "鲁西" || DeptName == "华东" || DeptName == "鲁东")
440
             {
440
             {
441
                 var usermodel = new BLL.T_Sys_UserAccount().GetModel("8010");
441
                 var usermodel = new BLL.T_Sys_UserAccount().GetModel("8010");
442
                 if (usermodel != null)
442
                 if (usermodel != null)
443
                     user = usermodel.F_UserName;
443
                     user = usermodel.F_UserName;
444
             }
444
             }
445
-            else if ( DeptName == "川渝" || DeptName == "湘赣" || DeptName == "陕宁" || DeptName == "晋蒙" || DeptName == "华南")
445
+            else if ( DeptName == "川渝" || DeptName == "湖南" || DeptName == "陕宁" || DeptName == "晋蒙"  || DeptName == "闽赣" || DeptName == "广东" || DeptName == "广海")
446
             {
446
             {
447
                 var usermodel = new BLL.T_Sys_UserAccount().GetModel("822353");
447
                 var usermodel = new BLL.T_Sys_UserAccount().GetModel("822353");
448
                 if (usermodel != null)
448
                 if (usermodel != null)

+ 61 - 12
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/CallInScreenController.cs

1
-using CallCenter.Utility;
1
+
2
+using CallCenter.Utility;
2
 using CallCenterApi.Common;
3
 using CallCenterApi.Common;
3
 using CallCenterApi.DB;
4
 using CallCenterApi.DB;
4
 using CallCenterApi.Interface.Controllers.Base;
5
 using CallCenterApi.Interface.Controllers.Base;
10
 using System.Web;
11
 using System.Web;
11
 using System.Web.Mvc;
12
 using System.Web.Mvc;
12
 
13
 
14
+
13
 namespace CallCenterApi.Interface.Controllers.tel
15
 namespace CallCenterApi.Interface.Controllers.tel
14
 {
16
 {
15
     public class CallInScreenController : BaseController
17
     public class CallInScreenController : BaseController
177
         /// <returns></returns>
179
         /// <returns></returns>
178
         public ActionResult GetPhoneLocation()
180
         public ActionResult GetPhoneLocation()
179
         {
181
         {
180
-            
182
+
181
             if (Request.IsAuthenticated)
183
             if (Request.IsAuthenticated)
182
             {
184
             {
183
                 string location = "未知";
185
                 string location = "未知";
195
                     }
197
                     }
196
                     else
198
                     else
197
                     {
199
                     {
198
-                        BLL.T_Sys_TelTitleData numbBll = new BLL.T_Sys_TelTitleData();
199
-                        List<Model.T_Sys_TelTitleData> mobileModel1 = numbBll.GetModelList(" F_KeyPhoneNum='" + tel.Substring(0, 4) + "'");
200
-                        if (mobileModel1 == null || mobileModel1.Count <= 0)
200
+
201
+                        var PhoneNumber = MobiledataController.GetDetails(tel.Substring(1, 7));
202
+                        if (PhoneNumber != null)
201
                         {
203
                         {
202
-                            mobileModel1 = numbBll.GetModelList(" F_KeyPhoneNum='" + tel.Substring(0, 3) + "'");
204
+                            Model.T_Sys_MobileData dModel = new Model.T_Sys_MobileData();
205
+                            dModel.F_MobileNum = tel.Substring(1, 7);
206
+                            var model = new BLL.T_Sys_MobileData().GetList(1, "F_CityDes='" + PhoneNumber["省份"] + "-" + PhoneNumber["市区"] + "' and F_IsDelete=0", "F_Id desc  ");
207
+                            if (model != null)
208
+                                dModel.F_ZipCode = model.FirstOrDefault().F_ZipCode;
209
+                            dModel.F_CityDes = PhoneNumber["省份"] + "-" + PhoneNumber["市区"];
210
+                            dModel.F_CardDes = PhoneNumber["电信运营商"];
211
+                            dModel.F_IsDelete = 0;
212
+                            dModel.F_CreateUser = "8000";
213
+                            dModel.F_CreateTime = DateTime.Now;
214
+                            int t = new BLL.T_Sys_MobileData().Add(dModel);
215
+                            if (t > 0)
216
+                            {
217
+                                location = dModel.F_CityDes + dModel.F_CardDes;
218
+                            }
219
+
203
                         }
220
                         }
204
-                        if (mobileModel1.Count > 0)
221
+                        else
205
                         {
222
                         {
206
-                            location = mobileModel1[0].F_TitleName;
223
+                            BLL.T_Sys_TelTitleData numbBll = new BLL.T_Sys_TelTitleData();
224
+                            List<Model.T_Sys_TelTitleData> mobileModel1 = numbBll.GetModelList(" F_KeyPhoneNum='" + tel.Substring(0, 4) + "'");
225
+                            if (mobileModel1 == null || mobileModel1.Count <= 0)
226
+                            {
227
+                                mobileModel1 = numbBll.GetModelList(" F_KeyPhoneNum='" + tel.Substring(0, 3) + "'");
228
+                            }
229
+                            if (mobileModel1.Count > 0)
230
+                            {
231
+                                location = mobileModel1[0].F_TitleName;
232
+                            }
233
+
207
                         }
234
                         }
208
                     }
235
                     }
236
+
209
                 }
237
                 }
210
                 else
238
                 else
211
                 {
239
                 {
218
                         {
246
                         {
219
                             location = mobileModel.F_CityDes + mobileModel.F_CardDes;
247
                             location = mobileModel.F_CityDes + mobileModel.F_CardDes;
220
                         }
248
                         }
249
+                        else
250
+                        {
251
+                            var PhoneNumber = MobiledataController .GetDetails (tel.Substring(0, 7));
252
+                            if (PhoneNumber != null)
253
+                            {
254
+                                Model.T_Sys_MobileData dModel = new Model.T_Sys_MobileData();
255
+                                dModel.F_MobileNum = tel.Substring(0, 7);
256
+                                var model = new BLL.T_Sys_MobileData().GetList(1, "F_CityDes='" + PhoneNumber["省份"] + "-" + PhoneNumber["市区"] + "' and F_IsDelete=0", "F_Id desc  ");
257
+                                if (model != null)
258
+                                    dModel.F_ZipCode = model.FirstOrDefault().F_ZipCode;
259
+                                dModel.F_CityDes = PhoneNumber["省份"] + "-" + PhoneNumber["市区"];
260
+                                dModel.F_CardDes = PhoneNumber["电信运营商"];
261
+                                dModel.F_IsDelete = 0;
262
+                                dModel.F_CreateUser = "8000";
263
+                                dModel.F_CreateTime = DateTime.Now;
264
+                                int t = new BLL.T_Sys_MobileData().Add(dModel);
265
+                                if (t > 0)
266
+                                {
267
+                                    location = dModel.F_CityDes + dModel.F_CardDes;
268
+                                }
269
+
270
+                            }
271
+                        }
221
                     }
272
                     }
222
                     else
273
                     else
223
                     {
274
                     {
236
                         }
287
                         }
237
                     }
288
                     }
238
                 }
289
                 }
239
-
240
                 return Success("归属地加载成功", location);
290
                 return Success("归属地加载成功", location);
241
-
242
             }
291
             }
243
-            return NoToken("未知错误,请重新登录");
244
-        }
292
+                return NoToken("未知错误,请重新登录");
293
+         }
245
 
294
 
246
         /// <summary>
295
         /// <summary>
247
         /// 历史记录列表
296
         /// 历史记录列表

+ 91 - 7
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/MobiledataController.cs

1
-using CallCenter.Utility;
2
-using CallCenterApi.Common;
1
+
2
+using CallCenter.Utility;
3
 using CallCenterApi.DB;
3
 using CallCenterApi.DB;
4
 using CallCenterApi.Interface.Controllers.Base;
4
 using CallCenterApi.Interface.Controllers.Base;
5
+using HtmlAgilityPack;
5
 using System;
6
 using System;
6
 using System.Collections.Generic;
7
 using System.Collections.Generic;
7
 using System.Data;
8
 using System.Data;
8
 using System.Linq;
9
 using System.Linq;
9
-using System.Web;
10
+using System.Net;
11
+using System.Net.Security;
12
+using System.Security.Cryptography.X509Certificates;
13
+using System.Text.RegularExpressions;
10
 using System.Web.Mvc;
14
 using System.Web.Mvc;
11
 
15
 
16
+
12
 namespace CallCenterApi.Interface.Controllers.tel
17
 namespace CallCenterApi.Interface.Controllers.tel
13
 {
18
 {
14
     public class MobiledataController : BaseController
19
     public class MobiledataController : BaseController
93
                     }
98
                     }
94
                     else
99
                     else
95
                     {
100
                     {
96
-                        return Error("获取号码归属地失败");
97
-                    }
98
-                }
101
+                        var PhoneNumber = GetDetails(mobileNum.Trim());
102
+                        if (PhoneNumber != null)
103
+                        {
104
+                            dModel = new Model.T_Sys_MobileData();
105
+                            dModel.F_MobileNum = mobileNum.Trim();
106
+                            var model = new BLL.T_Sys_MobileData().GetList(1, "F_CityDes='" + PhoneNumber["省份"] + "-" + PhoneNumber["市区"]  + "' and F_IsDelete=0", "F_Id desc  ");
107
+                            if (model != null)
108
+                                dModel.F_ZipCode = model.FirstOrDefault().F_ZipCode;
109
+                            dModel.F_CityDes = PhoneNumber["省份"] + "-" + PhoneNumber["市区"];
110
+                            dModel.F_CardDes = PhoneNumber["电信运营商"];
111
+                            dModel.F_IsDelete = 0;
112
+                            dModel.F_CreateUser = "8000";
113
+                            dModel.F_CreateTime = DateTime.Now;
114
+                            int n = new BLL.T_Sys_MobileData().Add(dModel);
115
+                            if (n > 0)
116
+                            {
117
+                                dModel.F_Id = n;
118
+                                return Success("获取号码归属地成功", dModel);
119
+                            }
120
+                            else
121
+                            {
122
+                                return Error("获取号码归属地失败");
123
+                            }
124
+
125
+
126
+
127
+                               }
128
+
129
+                               return Error("获取号码归属地失败");
130
+                            }
131
+                        }
99
                 else
132
                 else
100
                 {
133
                 {
101
                     return Error("获取参数失败");
134
                     return Error("获取参数失败");
102
                 }
135
                 }
103
 
136
 
104
-            }
137
+           }
105
             return NoToken("未知错误,请重新登录");
138
             return NoToken("未知错误,请重新登录");
106
         }
139
         }
140
+        static HtmlDocument GetDocument(string url)
141
+        {
142
+           
143
+            HtmlWeb web = new HtmlWeb();
144
+            ServicePointManager.Expect100Continue = true;
145
+            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
146
+            ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, errors) => true;
147
+            HtmlDocument doc = web.Load(url);
148
+            return doc;
149
+        }
107
 
150
 
151
+        //private static bool CheckValidationResult(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors)
152
+        //{
153
+        //    return true; //总是接受  
154
+        //}
155
+
156
+        public  static  Dictionary<string, string> GetDetails(string moblie)
157
+        {
158
+            string url = "https://www.chahaoba.com/" + moblie;
159
+            HtmlDocument document = GetDocument(url);
160
+            var priceXPath = @"//*[@id='mw-content-text']";
161
+            var Node = document.DocumentNode.SelectSingleNode(priceXPath);
162
+            List<string> InnerText = new List<string>();
163
+            foreach (HtmlNode table in Node.SelectNodes("//table"))
164
+            {
165
+                foreach (HtmlNode row in table.SelectNodes(".//tr"))
166
+                {
167
+                    foreach (HtmlNode cell in row.SelectNodes("th|td"))
168
+                    {
169
+                        InnerText.Add(cell.InnerText );
170
+                    }
171
+                }
172
+            }
173
+            Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
174
+            if (InnerText != null )
175
+            {
176
+               for (int i=0;i< InnerText.Count;i ++)
177
+                {
178
+                    if(InnerText[i ]== "归属省份地区")
179
+                    {
180
+                        keyValuePairs.Add("市区", InnerText[i + 1].Split('、')[0]);
181
+                        keyValuePairs.Add("省份", InnerText[i + 1].Split('、')[1]);
182
+                    }
183
+                    else if (InnerText[i] == "电信运营商")
184
+                    {
185
+                        keyValuePairs.Add("电信运营商", InnerText[i + 1]);
186
+                    }
187
+                }
188
+            }
189
+            return keyValuePairs;
190
+
191
+        }
108
         //添加/编辑号码归属地
192
         //添加/编辑号码归属地
109
         public ActionResult AddMobiledata(string mobileNum, string zipCode, string cityDes, string cardDes, int id = 0)
193
         public ActionResult AddMobiledata(string mobileNum, string zipCode, string cityDes, string cardDes, int id = 0)
110
         {
194
         {

Plik diff jest za duży
+ 38 - 22
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkOrderController.cs


Plik diff jest za duży
+ 10 - 6
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/workorder/WorkorderAppController.cs


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

1
 <?xml version="1.0" encoding="utf-8"?>
1
 <?xml version="1.0" encoding="utf-8"?>
2
 <packages>
2
 <packages>
3
+  <package id="HtmlAgilityPack" version="1.11.45" targetFramework="net45" />
3
   <package id="Microsoft.ApplicationInsights" version="2.2.0" targetFramework="net45" />
4
   <package id="Microsoft.ApplicationInsights" version="2.2.0" targetFramework="net45" />
4
   <package id="Microsoft.ApplicationInsights.Agent.Intercept" version="2.0.6" targetFramework="net45" />
5
   <package id="Microsoft.ApplicationInsights.Agent.Intercept" version="2.0.6" targetFramework="net45" />
5
   <package id="Microsoft.ApplicationInsights.DependencyCollector" version="2.2.0" targetFramework="net45" />
6
   <package id="Microsoft.ApplicationInsights.DependencyCollector" version="2.2.0" targetFramework="net45" />
13
   <package id="Microsoft.AspNet.Razor.zh-Hans" version="3.2.3" targetFramework="net45" />
14
   <package id="Microsoft.AspNet.Razor.zh-Hans" version="3.2.3" targetFramework="net45" />
14
   <package id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net45" />
15
   <package id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net45" />
15
   <package id="Microsoft.AspNet.WebPages.zh-Hans" version="3.2.3" targetFramework="net45" />
16
   <package id="Microsoft.AspNet.WebPages.zh-Hans" version="3.2.3" targetFramework="net45" />
17
+  <package id="Microsoft.Bcl" version="1.1.10" targetFramework="net45" />
18
+  <package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net45" />
19
+  <package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="net45" />
16
   <package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="1.0.0" targetFramework="net45" />
20
   <package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="1.0.0" targetFramework="net45" />
17
   <package id="Microsoft.Net.Compilers" version="1.0.0" targetFramework="net45" developmentDependency="true" />
21
   <package id="Microsoft.Net.Compilers" version="1.0.0" targetFramework="net45" developmentDependency="true" />
22
+  <package id="Microsoft.Net.Http" version="2.2.29" targetFramework="net45" />
18
   <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
23
   <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
24
+  <package id="Newtonsoft.Json" version="12.0.1" targetFramework="net45" />
25
+  <package id="starkbank-ecdsa" version="1.3.3" targetFramework="net45" />
19
 </packages>
26
 </packages>

+ 2 - 3
codegit/CallCenterCommon/CallCenter.QuartzService/CallCenter.QuartzService.csproj

45
     <Reference Include="log4net, Version=2.0.7.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
45
     <Reference Include="log4net, Version=2.0.7.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
46
       <HintPath>..\..\packages\log4net.2.0.7\lib\net45-full\log4net.dll</HintPath>
46
       <HintPath>..\..\packages\log4net.2.0.7\lib\net45-full\log4net.dll</HintPath>
47
     </Reference>
47
     </Reference>
48
-    <Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
49
-      <HintPath>..\..\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
50
-      <Private>True</Private>
48
+    <Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
49
+      <HintPath>..\..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
51
     </Reference>
50
     </Reference>
52
     <Reference Include="Quartz, Version=2.5.0.0, Culture=neutral, PublicKeyToken=f6b8c98a402cc8a4, processorArchitecture=MSIL">
51
     <Reference Include="Quartz, Version=2.5.0.0, Culture=neutral, PublicKeyToken=f6b8c98a402cc8a4, processorArchitecture=MSIL">
53
       <HintPath>..\..\packages\Quartz.2.5.0\lib\net40\Quartz.dll</HintPath>
52
       <HintPath>..\..\packages\Quartz.2.5.0\lib\net40\Quartz.dll</HintPath>

+ 1 - 13
codegit/CallCenterCommon/CallCenter.QuartzService/SMSService.cs

1
-
2
-using Newtonsoft.Json;
3
-using Newtonsoft.Json.Linq;
4
-using System;
5
-using System.Collections.Generic;
6
-using System.ComponentModel;
1
+using System.Collections.Generic;
7
 using System.Configuration;
2
 using System.Configuration;
8
-using System.Data;
9
-using System.Diagnostics;
10
-using System.IO;
11
-using System.Linq;
12
-using System.Net;
13
 using System.ServiceProcess;
3
 using System.ServiceProcess;
14
-using System.Text;
15
-using System.Threading.Tasks;
16
 
4
 
17
 namespace CallCenter.QuartzService
5
 namespace CallCenter.QuartzService
18
 {
6
 {

+ 0 - 4
codegit/CallCenterCommon/CallCenter.QuartzService/SMSTask.cs

1
 using Newtonsoft.Json;
1
 using Newtonsoft.Json;
2
 using Newtonsoft.Json.Linq;
2
 using Newtonsoft.Json.Linq;
3
 using System;
3
 using System;
4
-using System.Collections.Generic;
5
 using System.Configuration;
4
 using System.Configuration;
6
-using System.Linq;
7
-using System.Text;
8
-using System.Threading.Tasks;
9
 
5
 
10
 namespace CallCenter.QuartzService
6
 namespace CallCenter.QuartzService
11
 {
7
 {

+ 1 - 1
codegit/CallCenterCommon/CallCenter.QuartzService/packages.config

3
   <package id="Common.Logging" version="3.3.1" targetFramework="net45" />
3
   <package id="Common.Logging" version="3.3.1" targetFramework="net45" />
4
   <package id="Common.Logging.Core" version="3.3.1" targetFramework="net45" />
4
   <package id="Common.Logging.Core" version="3.3.1" targetFramework="net45" />
5
   <package id="log4net" version="2.0.7" targetFramework="net45" />
5
   <package id="log4net" version="2.0.7" targetFramework="net45" />
6
-  <package id="Newtonsoft.Json" version="10.0.2" targetFramework="net45" />
6
+  <package id="Newtonsoft.Json" version="12.0.1" targetFramework="net45" />
7
   <package id="Quartz" version="2.5.0" targetFramework="net45" />
7
   <package id="Quartz" version="2.5.0" targetFramework="net45" />
8
 </packages>
8
 </packages>

+ 2 - 3
codegit/CallCenterCommon/CallCenter.Utility/CallCenter.Utility.csproj

34
       <HintPath>..\..\packages\log4net.2.0.7\lib\net45-full\log4net.dll</HintPath>
34
       <HintPath>..\..\packages\log4net.2.0.7\lib\net45-full\log4net.dll</HintPath>
35
       <Private>True</Private>
35
       <Private>True</Private>
36
     </Reference>
36
     </Reference>
37
-    <Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
38
-      <HintPath>..\..\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
39
-      <Private>True</Private>
37
+    <Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
38
+      <HintPath>..\..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
40
     </Reference>
39
     </Reference>
41
     <Reference Include="NPOI, Version=2.3.0.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
40
     <Reference Include="NPOI, Version=2.3.0.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
42
       <HintPath>..\..\packages\NPOI.2.3.0\lib\net40\NPOI.dll</HintPath>
41
       <HintPath>..\..\packages\NPOI.2.3.0\lib\net40\NPOI.dll</HintPath>

+ 1 - 1
codegit/CallCenterCommon/CallCenter.Utility/packages.config

1
 <?xml version="1.0" encoding="utf-8"?>
1
 <?xml version="1.0" encoding="utf-8"?>
2
 <packages>
2
 <packages>
3
   <package id="log4net" version="2.0.7" targetFramework="net45" />
3
   <package id="log4net" version="2.0.7" targetFramework="net45" />
4
-  <package id="Newtonsoft.Json" version="10.0.2" targetFramework="net45" />
4
+  <package id="Newtonsoft.Json" version="12.0.1" targetFramework="net45" />
5
   <package id="NPOI" version="2.3.0" targetFramework="net45" />
5
   <package id="NPOI" version="2.3.0" targetFramework="net45" />
6
   <package id="SharpZipLib" version="0.86.0" targetFramework="net45" />
6
   <package id="SharpZipLib" version="0.86.0" targetFramework="net45" />
7
   <package id="StackExchange.Redis" version="1.2.6" targetFramework="net45" />
7
   <package id="StackExchange.Redis" version="1.2.6" targetFramework="net45" />