Selaa lähdekoodia

jxing merge commit

garrett 5 vuotta sitten
vanhempi
commit
89f7d8626b

+ 1 - 3
Config/test/Client.exe.config

@@ -1,9 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <configuration>
   <appSettings>
-    <!--
-    <add key="IP" value="47.94.89.44"/>-->
-    <add key="IP" value="172.16.42.210"/>
+    <add key="IP" value="192.168.0.3"/>
     <add key="Port" value="6666"/>
     <add key="DownloadFileDir" value="E:\\"/>
     <add key="MaxTaskCount" value="3"/>

+ 20 - 113
Dispatcher/Client/Client.csproj

@@ -35,175 +35,80 @@
     <StartupObject />
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="BouncyCastle.Crypto, Version=1.8.3.0, Culture=neutral, PublicKeyToken=0e99375e54769942">
-      <HintPath>..\..\packages\BouncyCastle.1.8.3.1\lib\BouncyCastle.Crypto.dll</HintPath>
-    </Reference>
     <Reference Include="DotNetty.Buffers, Version=0.6.0.0, Culture=neutral, PublicKeyToken=bc13ca065fa06c29, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\DotNetty.Buffers.0.6.0\lib\net45\DotNetty.Buffers.dll</HintPath>
+      <HintPath>..\packages\DotNetty.Buffers.0.6.0\lib\net45\DotNetty.Buffers.dll</HintPath>
     </Reference>
     <Reference Include="DotNetty.Common, Version=0.6.0.0, Culture=neutral, PublicKeyToken=bc13ca065fa06c29, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\DotNetty.Common.0.6.0\lib\net45\DotNetty.Common.dll</HintPath>
+      <HintPath>..\packages\DotNetty.Common.0.6.0\lib\net45\DotNetty.Common.dll</HintPath>
     </Reference>
     <Reference Include="DotNetty.Transport, Version=0.6.0.0, Culture=neutral, PublicKeyToken=bc13ca065fa06c29, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\DotNetty.Transport.0.6.0\lib\net45\DotNetty.Transport.dll</HintPath>
+      <HintPath>..\packages\DotNetty.Transport.0.6.0\lib\net45\DotNetty.Transport.dll</HintPath>
     </Reference>
     <Reference Include="Google.Protobuf, Version=3.8.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
       <HintPath>..\..\packages\Google.Protobuf.3.8.0\lib\net45\Google.Protobuf.dll</HintPath>
     </Reference>
     <Reference Include="Microsoft.Extensions.Configuration, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\Microsoft.Extensions.Configuration.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.dll</HintPath>
+      <HintPath>..\packages\Microsoft.Extensions.Configuration.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.dll</HintPath>
     </Reference>
     <Reference Include="Microsoft.Extensions.Configuration.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\Microsoft.Extensions.Configuration.Abstractions.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.Abstractions.dll</HintPath>
+      <HintPath>..\packages\Microsoft.Extensions.Configuration.Abstractions.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.Abstractions.dll</HintPath>
     </Reference>
     <Reference Include="Microsoft.Extensions.Configuration.Binder, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\Microsoft.Extensions.Configuration.Binder.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.Binder.dll</HintPath>
+      <HintPath>..\packages\Microsoft.Extensions.Configuration.Binder.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.Binder.dll</HintPath>
     </Reference>
     <Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.2.0\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
+      <HintPath>..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.2.0\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
     </Reference>
     <Reference Include="Microsoft.Extensions.Logging, Version=1.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\Microsoft.Extensions.Logging.1.1.1\lib\netstandard1.1\Microsoft.Extensions.Logging.dll</HintPath>
+      <HintPath>..\packages\Microsoft.Extensions.Logging.1.1.1\lib\netstandard1.1\Microsoft.Extensions.Logging.dll</HintPath>
     </Reference>
     <Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
       <HintPath>..\..\packages\Microsoft.Extensions.Logging.Abstractions.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
     </Reference>
     <Reference Include="Microsoft.Extensions.Options, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\Microsoft.Extensions.Options.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Options.dll</HintPath>
+      <HintPath>..\packages\Microsoft.Extensions.Options.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Options.dll</HintPath>
     </Reference>
     <Reference Include="Microsoft.Extensions.Primitives, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\Microsoft.Extensions.Primitives.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Primitives.dll</HintPath>
-    </Reference>
-    <Reference Include="Microsoft.Win32.Primitives, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\Microsoft.Win32.Primitives.4.3.0\lib\net46\Microsoft.Win32.Primitives.dll</HintPath>
-      <Private>True</Private>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="MySql.Data, Version=8.0.18.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\MySql.Data.8.0.18\lib\net452\MySql.Data.dll</HintPath>
+      <HintPath>..\packages\Microsoft.Extensions.Primitives.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Primitives.dll</HintPath>
     </Reference>
     <Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
       <HintPath>..\..\packages\Newtonsoft.Json.11.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
     </Reference>
-    <Reference Include="Renci.SshNet, Version=2016.1.0.0, Culture=neutral, PublicKeyToken=1cee9f8bde3db106, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\SSH.NET.2016.1.0\lib\net40\Renci.SshNet.dll</HintPath>
-    </Reference>
     <Reference Include="System" />
-    <Reference Include="System.AppContext, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.AppContext.4.3.0\lib\net46\System.AppContext.dll</HintPath>
-      <Private>True</Private>
-      <Private>True</Private>
-    </Reference>
     <Reference Include="System.Buffers, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.Buffers.4.4.0\lib\netstandard2.0\System.Buffers.dll</HintPath>
+      <HintPath>..\packages\System.Buffers.4.4.0\lib\netstandard2.0\System.Buffers.dll</HintPath>
     </Reference>
-    <Reference Include="System.ComponentModel, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
     <Reference Include="System.ComponentModel.Annotations, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.ComponentModel.Annotations.4.5.0\lib\net461\System.ComponentModel.Annotations.dll</HintPath>
+      <HintPath>..\packages\System.ComponentModel.Annotations.4.5.0\lib\net461\System.ComponentModel.Annotations.dll</HintPath>
     </Reference>
     <Reference Include="System.ComponentModel.Composition" />
     <Reference Include="System.ComponentModel.DataAnnotations" />
     <Reference Include="System.Configuration" />
-    <Reference Include="System.Configuration.Install" />
-    <Reference Include="System.Console, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.Console.4.3.0\lib\net46\System.Console.dll</HintPath>
-      <Private>True</Private>
-      <Private>True</Private>
-    </Reference>
     <Reference Include="System.Core" />
     <Reference Include="System.Diagnostics.DiagnosticSource, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.Diagnostics.DiagnosticSource.4.3.0\lib\net46\System.Diagnostics.DiagnosticSource.dll</HintPath>
-    </Reference>
-    <Reference Include="System.Drawing" />
-    <Reference Include="System.Drawing.Design" />
-    <Reference Include="System.Globalization.Calendars, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.Globalization.Calendars.4.3.0\lib\net46\System.Globalization.Calendars.dll</HintPath>
-      <Private>True</Private>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="System.IO.Compression, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll</HintPath>
-      <Private>True</Private>
-      <Private>True</Private>
+      <HintPath>..\packages\System.Diagnostics.DiagnosticSource.4.3.0\lib\net46\System.Diagnostics.DiagnosticSource.dll</HintPath>
     </Reference>
     <Reference Include="System.IO.Compression.FileSystem" />
-    <Reference Include="System.IO.Compression.ZipFile, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.IO.Compression.ZipFile.4.3.0\lib\net46\System.IO.Compression.ZipFile.dll</HintPath>
-      <Private>True</Private>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="System.IO.FileSystem, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.IO.FileSystem.4.3.0\lib\net46\System.IO.FileSystem.dll</HintPath>
-      <Private>True</Private>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="System.IO.FileSystem.Primitives, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.IO.FileSystem.Primitives.4.3.0\lib\net46\System.IO.FileSystem.Primitives.dll</HintPath>
-      <Private>True</Private>
-      <Private>True</Private>
-    </Reference>
     <Reference Include="System.Management" />
     <Reference Include="System.Memory, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.Memory.4.5.1\lib\netstandard2.0\System.Memory.dll</HintPath>
-    </Reference>
-    <Reference Include="System.Net.Http, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.Net.Http.4.3.0\lib\net46\System.Net.Http.dll</HintPath>
-      <Private>True</Private>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="System.Net.Sockets, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.Net.Sockets.4.3.0\lib\net46\System.Net.Sockets.dll</HintPath>
-      <Private>True</Private>
-      <Private>True</Private>
+      <HintPath>..\..\packages\System.Memory.4.5.2\lib\netstandard2.0\System.Memory.dll</HintPath>
     </Reference>
     <Reference Include="System.Numerics" />
     <Reference Include="System.Numerics.Vectors, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.Numerics.Vectors.4.4.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
+      <HintPath>..\packages\System.Numerics.Vectors.4.4.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
     </Reference>
-    <Reference Include="System.Runtime, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
     <Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
-    </Reference>
-    <Reference Include="System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll</HintPath>
-      <Private>True</Private>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="System.Security.Cryptography.Algorithms, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net461\System.Security.Cryptography.Algorithms.dll</HintPath>
-      <Private>True</Private>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="System.Security.Cryptography.Encoding, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll</HintPath>
-      <Private>True</Private>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="System.Security.Cryptography.Primitives, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll</HintPath>
-      <Private>True</Private>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="System.Security.Cryptography.X509Certificates, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll</HintPath>
-      <Private>True</Private>
-      <Private>True</Private>
+      <HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
     </Reference>
     <Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.Threading.Tasks.Extensions.4.5.1\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll</HintPath>
+      <HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.1\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll</HintPath>
     </Reference>
-    <Reference Include="System.Transactions" />
     <Reference Include="System.Windows.Forms" />
     <Reference Include="System.Xml.Linq" />
     <Reference Include="System.Data.DataSetExtensions" />
     <Reference Include="Microsoft.CSharp" />
     <Reference Include="System.Data" />
     <Reference Include="System.Xml" />
-    <Reference Include="System.Xml.ReaderWriter, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.Xml.ReaderWriter.4.3.0\lib\net46\System.Xml.ReaderWriter.dll</HintPath>
-      <Private>True</Private>
-      <Private>True</Private>
-    </Reference>
   </ItemGroup>
   <ItemGroup>
     <Compile Include="MainClass.cs" />
@@ -219,7 +124,9 @@
   </ItemGroup>
   <ItemGroup>
     <None Include="app.config" />
-    <None Include="packages.config" />
+    <None Include="packages.config">
+      <SubType>Designer</SubType>
+    </None>
   </ItemGroup>
   <ItemGroup>
     <Content Include="Readme.txt" />

+ 2 - 2
Dispatcher/Client/ClientApp.cs

@@ -61,12 +61,12 @@ namespace Client
         {
             while (true)
             {
+                Thread.Sleep(interval * 1000);
                 if (!TaskNettyClient.isConnected)
                 {
                     Console.WriteLine(DateTime.Now + ": reconnecting....");
                     Restart();
                 }
-                Thread.Sleep(interval * 1000);
             }
         }
 
@@ -77,7 +77,7 @@ namespace Client
                 try
                 {
                     Thread.Sleep(30000);
-                    var retMsg = MessageUtil.generateMessage(Command.Useless.ToString(), 0, "{}");
+                    var retMsg = MessageUtil.generateMessageStr(Command.Useless.ToString(), "", "{}");
                     simpleHandler.WriteMessage(retMsg);
                 }
                 catch (Exception e)

+ 6 - 5
Dispatcher/Client/MessageHandler.cs

@@ -1,5 +1,5 @@
 using NettyClient;
-using NettyClient.proto;
+using Message = Cn.Sagacloud.Proto.Message;
 using Newtonsoft.Json;
 using System;
 using System.Collections.Generic;
@@ -7,6 +7,7 @@ using System.Linq;
 using System.Text;
 using System.Threading;
 using System.Threading.Tasks;
+using NettyClient.proto;
 
 namespace Client
 {
@@ -48,13 +49,13 @@ namespace Client
                             bool isSuccess = taskHandler.addOneTask(message.TaskId, message.Content);
                             if (isSuccess)
                             {
-                                retMsg = MessageUtil.generateMessage(Command.AcceptTask.ToString(), message.TaskId, "");
+                                retMsg = MessageUtil.generateMessageStr(Command.AcceptTask.ToString(), message.TaskId, "");
                                 simpleHandler.WriteMessage(retMsg);
                             }
                         }
                         else {
                             // 3. 如果拒绝, 直接返回拒绝消息
-                            retMsg = MessageUtil.generateMessage(Command.RefuseTask.ToString(), message.TaskId, "");
+                            retMsg = MessageUtil.generateMessageStr(Command.RefuseTask.ToString(), message.TaskId, "");
                             simpleHandler.WriteMessage(retMsg);
                         }
                         break;
@@ -63,7 +64,7 @@ namespace Client
                         info.Ipv4 = ClientInfoUtil.GetClientLocalIPv4Address();
                         info.MacAddr = ClientInfoUtil.GetMacAddress();
                         info.Name = ClientInfoUtil.GetUserName();
-                        retMsg = MessageUtil.generateMessage(Command.ClientInfo.ToString(), 0, JsonConvert.SerializeObject(info, Formatting.None));
+                        retMsg = MessageUtil.generateMessageStr(Command.ClientInfo.ToString(), "", JsonConvert.SerializeObject(info, Formatting.None));
                         simpleHandler.WriteMessage(retMsg);
                         break;
                     default:
@@ -72,7 +73,7 @@ namespace Client
             }
         }
 
-        private bool checkIsAcceptTask(int taskId)
+        private bool checkIsAcceptTask(string taskId)
         {
             //一. isPauseTask == true的时候拒绝任务, 二. 如果已存在该任务, 则拒绝, 三. 如果当前任务数达到maxTaskCount, 拒绝
             if (isPauseTask)

+ 1 - 1
Dispatcher/Client/Start/RevitCmdExecutor.cs

@@ -46,7 +46,7 @@ namespace Client.Start
                                               "\"" + filePathList.First() + "\"";
                 process.Start();//执行
                 //string msg = process.StandardOutput.ReadToEnd();//读取输出
-                process.WaitForExit(21*60*1000);//等待执行完成
+                process.WaitForExit(60*60*1000);//等待执行完成
                 //process.Close();//结束
                 if(!process.HasExited)
                     process.Kill();

+ 10 - 10
Dispatcher/Client/TaskHandler.cs

@@ -29,14 +29,14 @@ namespace Client
                         bool isAllDownloaded = true;
                         // 看当前任务依赖的文件下载状况
                         foreach (DownloadTaskModel downloadTaskModel in task.DownloadTaskModelList) {
-                            DownloadTask download = taskDownloadManager.getDownloadTaskByDownloadTaskId(downloadTaskModel.Tid);
+                            DownloadTask download = taskDownloadManager.getDownloadTaskByDownloadTaskId(downloadTaskModel.Task_id);
                             if (download == null) // 如果还未加入下载队列
                             {
                                 // 开始下载
                                 if (downloadTaskModel.Local_dir == null) {
-                                    downloadTaskModel.Local_dir = defaultFileDir + downloadTaskModel.Tid + ".rvt";
+                                    downloadTaskModel.Local_dir = defaultFileDir + downloadTaskModel.Task_id + ".rvt";
                                 } 
-                                download = taskDownloadManager.enqueueTask(task.Id, downloadTaskModel.Tid, downloadTaskModel.Task_url,
+                                download = taskDownloadManager.enqueueTask(task.Id, downloadTaskModel.Task_url,
                                     downloadTaskModel.Local_dir, downloadTaskModel.Task_md5, downloadTaskModel.Downloaded_bytes);
                                 taskDownloadManager.runTask(download);
                                 isAllDownloaded &= false;
@@ -66,7 +66,7 @@ namespace Client
                             task.Task_status = -1;
                             taskService.UpdateTask(task);
                             taskModels.RemoveAt(i);
-                            simpleHandler.WriteMessage(MessageUtil.generateMessage(Command.DownloadError.ToString(), task.Id, ""));
+                            simpleHandler.WriteMessage(MessageUtil.generateMessageStr(Command.DownloadError.ToString(), task.Id, ""));
                             continue;
                         }
                         // 如果该任务的所有下载文件均已完成, 开始执行Revit命令
@@ -80,7 +80,7 @@ namespace Client
                                 try
                                 {
                                     string resultJson = revitCommandExcutor.ExecuteCmd(task.Task_cmd, task.Task_param, fileSet);
-                                    simpleHandler.WriteMessage(MessageUtil.generateMessage(Command.TaskSuccess.ToString(), task.Id, resultJson));
+                                    simpleHandler.WriteMessage(MessageUtil.generateMessageStr(Command.TaskSuccess.ToString(), task.Id, resultJson));
                                     task.Task_status = 1;
                                     task.Task_result_json = resultJson;
                                     taskService.UpdateTask(task);
@@ -100,7 +100,7 @@ namespace Client
                             task.Task_status = -2;
                             taskService.UpdateTask(task);
                             taskModels.RemoveAt(i);
-                            simpleHandler.WriteMessage(MessageUtil.generateMessage(Command.CommandError.ToString(), task.Id, ""));
+                            simpleHandler.WriteMessage(MessageUtil.generateMessageStr(Command.CommandError.ToString(), task.Id, ""));
                             continue;
                         }
                     }
@@ -109,7 +109,7 @@ namespace Client
                 catch (Exception ex){
                     Console.WriteLine(ex.StackTrace);
                 }
-                Thread.Sleep(1000);
+                Thread.Sleep(3*1000);
                 
             }
         }
@@ -154,7 +154,7 @@ namespace Client
             IList<TaskModel> tasks = taskService.GetTasksByStatus(0); // 任务状态 0 未执行完的任务, 1 执行完成  -1 下载出错  -2 revit命令执行异常
             taskModels = tasks;
         }
-        internal bool addOneTask(int taskId, string msgContent) {
+        internal bool addOneTask(string taskId, string msgContent) {
             try
             {
                 TaskModel taskModel = JsonConvert.DeserializeObject<TaskModel>(msgContent);
@@ -162,7 +162,7 @@ namespace Client
                 TaskModel task = taskService.GetTasksByTaskId(taskId)[0];
                 taskModels.Add(task);
                 foreach (DownloadTaskModel download in taskModel.DownloadTaskModelList) {
-                    download.Local_dir = defaultFileDir + download.Tid + ".rvt";
+                    download.Local_dir = defaultFileDir + download.Task_id + ".rvt";
                     taskService.UpdateDownload(download);
                 }
                 return true;
@@ -173,7 +173,7 @@ namespace Client
             }
         }
 
-        internal bool isContainTask(int taskId)
+        internal bool isContainTask(string taskId)
         {
             try
             {

+ 1 - 5
Dispatcher/Client/app.config

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <configuration>
   <appSettings>
-    <add key="IP" value="172.16.43.94" />
+    <add key="IP" value="192.168.0.3" />
     <!--<add key="IP" value="47.94.89.44" />-->
     <add key="Port" value="6666" />
     <add key="DownloadFileDir" value="E:\\" />
@@ -74,10 +74,6 @@
         <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
         <bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="11.0.0.0" />
       </dependentAssembly>
-      <dependentAssembly>
-        <assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
-      </dependentAssembly>
     </assemblyBinding>
   </runtime>
   <startup>

+ 1 - 1
Dispatcher/Client/packages.config

@@ -39,7 +39,7 @@
   <package id="System.IO.FileSystem.Primitives" version="4.3.0" targetFramework="net461" />
   <package id="System.Linq" version="4.3.0" targetFramework="net461" />
   <package id="System.Linq.Expressions" version="4.3.0" targetFramework="net461" />
-  <package id="System.Memory" version="4.5.1" targetFramework="net461" />
+  <package id="System.Memory" version="4.5.2" targetFramework="net461" />
   <package id="System.Net.Http" version="4.3.0" targetFramework="net461" />
   <package id="System.Net.Primitives" version="4.3.0" targetFramework="net461" />
   <package id="System.Net.Sockets" version="4.3.0" targetFramework="net461" />

+ 4 - 5
Dispatcher/HttpDownload/DownloadTask.cs

@@ -9,8 +9,8 @@ namespace HttpDownload
 {
     public class DownloadTask
     {
-        public int BelongingId { get; set; }
-        public int DownloadTaskId { get; set; }
+        public string BelongingId { get; set; }     // 任务id
+        //public int DownloadTaskId { get; set; }
         public string FileUrl { get; }
         public string FileDir { get; }
         public long Offset { get; } // 开始下载的位置
@@ -41,10 +41,9 @@ namespace HttpDownload
 
         }
 
-        public DownloadTask(int belongingId, int downTaskId, string fileUrl, string fileDir, string expectedMD5, long offset = 0L)
+        public DownloadTask(string taskId, string fileUrl, string fileDir, string expectedMD5, long offset = 0L)
         {
-            this.BelongingId = belongingId;
-            this.DownloadTaskId = downTaskId;
+            this.BelongingId = taskId;
             this.FileUrl = fileUrl;
             this.FileDir = fileDir;
             this.Offset = offset;

+ 5 - 5
Dispatcher/HttpDownload/TaskDownloadManager.cs

@@ -44,16 +44,16 @@ namespace HttpDownload
             allTasks.Add(task);
             return task;
         }
-        public DownloadTask enqueueTask(int belongingId, int downTaskId, string fileUrl, string fileDir, string expectedMD5, long offset = 0L)
+        public DownloadTask enqueueTask(string taskId, string fileUrl, string fileDir, string expectedMD5, long offset = 0L)
         {
-            DownloadTask task = new DownloadTask(belongingId, downTaskId, fileUrl, fileDir, expectedMD5, offset);
+            DownloadTask task = new DownloadTask(taskId, fileUrl, fileDir, expectedMD5, offset);
             allTasks.Add(task);
             return task;
         }
 
-        public DownloadTask getDownloadTaskByDownloadTaskId(int downloadTaskId) {
+        public DownloadTask getDownloadTaskByDownloadTaskId(string taskId) {
             foreach (DownloadTask down in allTasks) {
-                if (downloadTaskId == down.DownloadTaskId) {
+                if (taskId == down.BelongingId) {
                     return down;
                 }
             }
@@ -89,7 +89,7 @@ namespace HttpDownload
         public Hashtable getAllTasksMap() {
             Hashtable table = new Hashtable();
             foreach (DownloadTask down in allTasks) {
-                int belongingid = down.BelongingId;
+                string belongingid = down.BelongingId;
                 if (table.ContainsKey(belongingid))
                 {
                     ArrayList arr = (ArrayList)table[belongingid];

+ 30 - 118
Dispatcher/NettyClient/NettyClient.csproj

@@ -34,181 +34,90 @@
     <StartupObject />
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="BouncyCastle.Crypto, Version=1.8.3.0, Culture=neutral, PublicKeyToken=0e99375e54769942">
-      <HintPath>..\..\packages\BouncyCastle.1.8.3.1\lib\BouncyCastle.Crypto.dll</HintPath>
-    </Reference>
     <Reference Include="DotNetty.Buffers, Version=0.6.0.0, Culture=neutral, PublicKeyToken=bc13ca065fa06c29, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\DotNetty.Buffers.0.6.0\lib\net45\DotNetty.Buffers.dll</HintPath>
+      <HintPath>..\packages\DotNetty.Buffers.0.6.0\lib\net45\DotNetty.Buffers.dll</HintPath>
     </Reference>
     <Reference Include="DotNetty.Codecs, Version=0.6.0.0, Culture=neutral, PublicKeyToken=bc13ca065fa06c29, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\DotNetty.Codecs.0.6.0\lib\net45\DotNetty.Codecs.dll</HintPath>
+      <HintPath>..\packages\DotNetty.Codecs.0.6.0\lib\net45\DotNetty.Codecs.dll</HintPath>
     </Reference>
     <Reference Include="DotNetty.Codecs.Protobuf, Version=0.6.0.0, Culture=neutral, PublicKeyToken=bc13ca065fa06c29, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\DotNetty.Codecs.Protobuf.0.6.0\lib\net45\DotNetty.Codecs.Protobuf.dll</HintPath>
+      <HintPath>..\packages\DotNetty.Codecs.Protobuf.0.6.0\lib\net45\DotNetty.Codecs.Protobuf.dll</HintPath>
     </Reference>
     <Reference Include="DotNetty.Common, Version=0.6.0.0, Culture=neutral, PublicKeyToken=bc13ca065fa06c29, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\DotNetty.Common.0.6.0\lib\net45\DotNetty.Common.dll</HintPath>
+      <HintPath>..\packages\DotNetty.Common.0.6.0\lib\net45\DotNetty.Common.dll</HintPath>
     </Reference>
     <Reference Include="DotNetty.Transport, Version=0.6.0.0, Culture=neutral, PublicKeyToken=bc13ca065fa06c29, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\DotNetty.Transport.0.6.0\lib\net45\DotNetty.Transport.dll</HintPath>
+      <HintPath>..\packages\DotNetty.Transport.0.6.0\lib\net45\DotNetty.Transport.dll</HintPath>
     </Reference>
-    <Reference Include="Google.Protobuf">
-      <HintPath>..\..\packages\Google.Protobuf.3.6.1\lib\net45\Google.Protobuf.dll</HintPath>
+    <Reference Include="Google.Protobuf, Version=3.8.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
+      <HintPath>..\..\packages\Google.Protobuf.3.8.0\lib\net45\Google.Protobuf.dll</HintPath>
     </Reference>
     <Reference Include="Microsoft.Extensions.Configuration, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\Microsoft.Extensions.Configuration.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.dll</HintPath>
+      <HintPath>..\packages\Microsoft.Extensions.Configuration.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.dll</HintPath>
     </Reference>
     <Reference Include="Microsoft.Extensions.Configuration.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\Microsoft.Extensions.Configuration.Abstractions.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.Abstractions.dll</HintPath>
+      <HintPath>..\packages\Microsoft.Extensions.Configuration.Abstractions.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.Abstractions.dll</HintPath>
     </Reference>
     <Reference Include="Microsoft.Extensions.Configuration.Binder, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\Microsoft.Extensions.Configuration.Binder.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.Binder.dll</HintPath>
+      <HintPath>..\packages\Microsoft.Extensions.Configuration.Binder.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.Binder.dll</HintPath>
     </Reference>
     <Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.2.0\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
+      <HintPath>..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.2.0\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
     </Reference>
     <Reference Include="Microsoft.Extensions.Logging, Version=1.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\Microsoft.Extensions.Logging.1.1.1\lib\netstandard1.1\Microsoft.Extensions.Logging.dll</HintPath>
+      <HintPath>..\packages\Microsoft.Extensions.Logging.1.1.1\lib\netstandard1.1\Microsoft.Extensions.Logging.dll</HintPath>
     </Reference>
     <Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=1.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\Microsoft.Extensions.Logging.Abstractions.1.1.1\lib\netstandard1.1\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
+      <HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.1.1.1\lib\netstandard1.1\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
     </Reference>
     <Reference Include="Microsoft.Extensions.Options, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\Microsoft.Extensions.Options.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Options.dll</HintPath>
+      <HintPath>..\packages\Microsoft.Extensions.Options.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Options.dll</HintPath>
     </Reference>
     <Reference Include="Microsoft.Extensions.Options.ConfigurationExtensions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\Microsoft.Extensions.Options.ConfigurationExtensions.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Options.ConfigurationExtensions.dll</HintPath>
+      <HintPath>..\packages\Microsoft.Extensions.Options.ConfigurationExtensions.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Options.ConfigurationExtensions.dll</HintPath>
     </Reference>
     <Reference Include="Microsoft.Extensions.Primitives, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\Microsoft.Extensions.Primitives.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Primitives.dll</HintPath>
-    </Reference>
-    <Reference Include="Microsoft.Win32.Primitives, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\Microsoft.Win32.Primitives.4.3.0\lib\net46\Microsoft.Win32.Primitives.dll</HintPath>
-      <Private>True</Private>
-      <Private>True</Private>
+      <HintPath>..\packages\Microsoft.Extensions.Primitives.2.2.0\lib\netstandard2.0\Microsoft.Extensions.Primitives.dll</HintPath>
     </Reference>
-    <Reference Include="Renci.SshNet, Version=2016.1.0.0, Culture=neutral, PublicKeyToken=1cee9f8bde3db106, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\SSH.NET.2016.1.0\lib\net40\Renci.SshNet.dll</HintPath>
+    <Reference Include="Microsoft.QualityTools.Testing.Fakes, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
     </Reference>
     <Reference Include="System" />
-    <Reference Include="System.AppContext, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.AppContext.4.3.0\lib\net46\System.AppContext.dll</HintPath>
-      <Private>True</Private>
-      <Private>True</Private>
-    </Reference>
     <Reference Include="System.Buffers, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.Buffers.4.4.0\lib\netstandard2.0\System.Buffers.dll</HintPath>
+      <HintPath>..\packages\System.Buffers.4.4.0\lib\netstandard2.0\System.Buffers.dll</HintPath>
     </Reference>
     <Reference Include="System.Collections.Immutable, Version=1.2.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.Collections.Immutable.1.5.0\lib\netstandard2.0\System.Collections.Immutable.dll</HintPath>
+      <HintPath>..\packages\System.Collections.Immutable.1.5.0\lib\netstandard2.0\System.Collections.Immutable.dll</HintPath>
     </Reference>
-    <Reference Include="System.ComponentModel" />
     <Reference Include="System.ComponentModel.Annotations, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.ComponentModel.Annotations.4.5.0\lib\net461\System.ComponentModel.Annotations.dll</HintPath>
+      <HintPath>..\packages\System.ComponentModel.Annotations.4.5.0\lib\net461\System.ComponentModel.Annotations.dll</HintPath>
     </Reference>
     <Reference Include="System.ComponentModel.Composition" />
     <Reference Include="System.ComponentModel.DataAnnotations" />
-    <Reference Include="System.Configuration" />
-    <Reference Include="System.Configuration.Install" />
-    <Reference Include="System.Console, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.Console.4.3.0\lib\net46\System.Console.dll</HintPath>
-      <Private>True</Private>
-      <Private>True</Private>
-    </Reference>
     <Reference Include="System.Core" />
     <Reference Include="System.Diagnostics.DiagnosticSource, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.Diagnostics.DiagnosticSource.4.3.0\lib\net46\System.Diagnostics.DiagnosticSource.dll</HintPath>
-    </Reference>
-    <Reference Include="System.Drawing" />
-    <Reference Include="System.Drawing.Design" />
-    <Reference Include="System.Globalization.Calendars, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.Globalization.Calendars.4.3.0\lib\net46\System.Globalization.Calendars.dll</HintPath>
-      <Private>True</Private>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="System.IO.Compression, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll</HintPath>
-      <Private>True</Private>
-      <Private>True</Private>
+      <HintPath>..\packages\System.Diagnostics.DiagnosticSource.4.3.0\lib\net46\System.Diagnostics.DiagnosticSource.dll</HintPath>
     </Reference>
     <Reference Include="System.IO.Compression.FileSystem" />
-    <Reference Include="System.IO.Compression.ZipFile, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.IO.Compression.ZipFile.4.3.0\lib\net46\System.IO.Compression.ZipFile.dll</HintPath>
-      <Private>True</Private>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="System.IO.FileSystem, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.IO.FileSystem.4.3.0\lib\net46\System.IO.FileSystem.dll</HintPath>
-      <Private>True</Private>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="System.IO.FileSystem.Primitives, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.IO.FileSystem.Primitives.4.3.0\lib\net46\System.IO.FileSystem.Primitives.dll</HintPath>
-      <Private>True</Private>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="System.Management" />
     <Reference Include="System.Memory, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.Memory.4.5.1\lib\netstandard2.0\System.Memory.dll</HintPath>
-    </Reference>
-    <Reference Include="System.Net.Http, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.Net.Http.4.3.0\lib\net46\System.Net.Http.dll</HintPath>
-      <Private>True</Private>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="System.Net.Sockets, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.Net.Sockets.4.3.0\lib\net46\System.Net.Sockets.dll</HintPath>
-      <Private>True</Private>
-      <Private>True</Private>
+      <HintPath>..\..\packages\System.Memory.4.5.2\lib\netstandard2.0\System.Memory.dll</HintPath>
     </Reference>
     <Reference Include="System.Numerics" />
     <Reference Include="System.Numerics.Vectors, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.Numerics.Vectors.4.4.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
+      <HintPath>..\packages\System.Numerics.Vectors.4.4.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
     </Reference>
-    <Reference Include="System.Runtime, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
     <Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
-    </Reference>
-    <Reference Include="System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll</HintPath>
-      <Private>True</Private>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="System.Security.Cryptography.Algorithms, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net461\System.Security.Cryptography.Algorithms.dll</HintPath>
-      <Private>True</Private>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="System.Security.Cryptography.Encoding, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll</HintPath>
-      <Private>True</Private>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="System.Security.Cryptography.Primitives, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll</HintPath>
-      <Private>True</Private>
-      <Private>True</Private>
-    </Reference>
-    <Reference Include="System.Security.Cryptography.X509Certificates, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll</HintPath>
-      <Private>True</Private>
-      <Private>True</Private>
+      <HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
     </Reference>
     <Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.Threading.Tasks.Extensions.4.5.1\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll</HintPath>
+      <HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.1\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll</HintPath>
     </Reference>
-    <Reference Include="System.Transactions" />
     <Reference Include="System.Windows.Forms" />
     <Reference Include="System.Xml.Linq" />
     <Reference Include="System.Data.DataSetExtensions" />
     <Reference Include="Microsoft.CSharp" />
     <Reference Include="System.Data" />
     <Reference Include="System.Xml" />
-    <Reference Include="System.Xml.ReaderWriter, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\..\packages\System.Xml.ReaderWriter.4.3.0\lib\net46\System.Xml.ReaderWriter.dll</HintPath>
-      <Private>True</Private>
-      <Private>True</Private>
-    </Reference>
   </ItemGroup>
   <ItemGroup>
     <Compile Include="ClientWrapper.cs" />
@@ -219,8 +128,11 @@
     <Compile Include="SimpleMessageHandler.cs" />
   </ItemGroup>
   <ItemGroup>
-    <None Include="app.config" />
+    <None Include="app.config">
+      <SubType>Designer</SubType>
+    </None>
     <None Include="packages.config" />
+    <None Include="proto\MessageProto.cs-bak" />
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
 </Project>

+ 1 - 1
Dispatcher/NettyClient/SimpleMessageHandler.cs

@@ -2,7 +2,7 @@
 using System;
 using System.Collections.Concurrent;
 using System.Windows.Forms;
-using Message = NettyClient.proto.Message;
+using Message = Cn.Sagacloud.Proto.Message;
 
 namespace NettyClient
 {

+ 1 - 1
Dispatcher/NettyClient/TaskNettyClient.cs

@@ -7,7 +7,7 @@ using System.Threading;
 using System.Threading.Tasks;
 using System.Windows.Forms;
 using DotNetty.Codecs.Protobuf;
-using Message = NettyClient.proto.Message;
+using Message = Cn.Sagacloud.Proto.Message;
 
 namespace NettyClient
 {

+ 1 - 5
Dispatcher/NettyClient/app.config

@@ -20,7 +20,7 @@
       </dependentAssembly>
       <dependentAssembly>
         <assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-3.6.1.0" newVersion="3.6.1.0" />
+        <bindingRedirect oldVersion="0.0.0.0-3.8.0.0" newVersion="3.8.0.0" />
       </dependentAssembly>
       <dependentAssembly>
         <assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
@@ -70,10 +70,6 @@
         <assemblyIdentity name="DotNetty.Transport" publicKeyToken="bc13ca065fa06c29" culture="neutral" />
         <bindingRedirect oldVersion="0.0.0.0-0.6.0.0" newVersion="0.6.0.0" />
       </dependentAssembly>
-      <dependentAssembly>
-        <assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
-      </dependentAssembly>
     </assemblyBinding>
   </runtime>
 </configuration>

+ 2 - 4
Dispatcher/NettyClient/packages.config

@@ -1,12 +1,11 @@
 <?xml version="1.0" encoding="utf-8"?>
 <packages>
-  <package id="BouncyCastle" version="1.8.3.1" targetFramework="net461" />
   <package id="DotNetty.Buffers" version="0.6.0" targetFramework="net461" />
   <package id="DotNetty.Codecs" version="0.6.0" targetFramework="net461" />
   <package id="DotNetty.Codecs.Protobuf" version="0.6.0" targetFramework="net461" />
   <package id="DotNetty.Common" version="0.6.0" targetFramework="net461" />
   <package id="DotNetty.Transport" version="0.6.0" targetFramework="net461" />
-  <package id="Google.Protobuf" version="3.6.1" targetFramework="net461" />
+  <package id="Google.Protobuf" version="3.8.0" targetFramework="net461" />
   <package id="Microsoft.Extensions.Configuration" version="2.2.0" targetFramework="net461" />
   <package id="Microsoft.Extensions.Configuration.Abstractions" version="2.2.0" targetFramework="net461" />
   <package id="Microsoft.Extensions.Configuration.Binder" version="2.2.0" targetFramework="net461" />
@@ -19,7 +18,6 @@
   <package id="Microsoft.NETCore.Platforms" version="1.1.0" targetFramework="net461" />
   <package id="Microsoft.Win32.Primitives" version="4.3.0" targetFramework="net461" />
   <package id="NETStandard.Library" version="1.6.1" targetFramework="net461" />
-  <package id="SSH.NET" version="2016.1.0" targetFramework="net461" />
   <package id="System.AppContext" version="4.3.0" targetFramework="net461" />
   <package id="System.Buffers" version="4.4.0" targetFramework="net461" />
   <package id="System.Collections" version="4.3.0" targetFramework="net461" />
@@ -41,7 +39,7 @@
   <package id="System.IO.FileSystem.Primitives" version="4.3.0" targetFramework="net461" />
   <package id="System.Linq" version="4.3.0" targetFramework="net461" />
   <package id="System.Linq.Expressions" version="4.3.0" targetFramework="net461" />
-  <package id="System.Memory" version="4.5.1" targetFramework="net461" />
+  <package id="System.Memory" version="4.5.2" targetFramework="net461" />
   <package id="System.Net.Http" version="4.3.0" targetFramework="net461" />
   <package id="System.Net.Primitives" version="4.3.0" targetFramework="net461" />
   <package id="System.Net.Sockets" version="4.3.0" targetFramework="net461" />

+ 79 - 75
Dispatcher/NettyClient/proto/MessageProto.cs

@@ -5,69 +5,70 @@
 #pragma warning disable 1591, 0612, 3021
 #region Designer generated code
 
-using pb = Google.Protobuf;
-using pbr = Google.Protobuf.Reflection;
-namespace NettyClient.proto
-{
+using pb = global::Google.Protobuf;
+using pbc = global::Google.Protobuf.Collections;
+using pbr = global::Google.Protobuf.Reflection;
+using scg = global::System.Collections.Generic;
+namespace Cn.Sagacloud.Proto {
 
-    /// <summary>Holder for reflection information generated from MessageProto.proto</summary>
-    public static partial class MessageProtoReflection {
+  /// <summary>Holder for reflection information generated from MessageProto.proto</summary>
+  public static partial class MessageProtoReflection {
 
     #region Descriptor
     /// <summary>File descriptor for MessageProto.proto</summary>
-    public static pbr.FileDescriptor Descriptor {
+    public static pbr::FileDescriptor Descriptor {
       get { return descriptor; }
     }
-    private static pbr.FileDescriptor descriptor;
+    private static pbr::FileDescriptor descriptor;
 
     static MessageProtoReflection() {
-      byte[] descriptorData = System.Convert.FromBase64String(
+      byte[] descriptorData = global::System.Convert.FromBase64String(
           string.Concat(
             "ChJNZXNzYWdlUHJvdG8ucHJvdG8SEmNuLnNhZ2FjbG91ZC5wcm90byI3CgdN",
-            "ZXNzYWdlEgsKA2NtZBgBIAEoCRIOCgZ0YXNrSWQYAiABKAUSDwoHY29udGVu",
-            "dBgDIAEoCUIQQgxNZXNzYWdlUHJvdG9IAWIGcHJvdG8z"));
-      descriptor = pbr.FileDescriptor.FromGeneratedCode(descriptorData,
-          new pbr.FileDescriptor[] { },
-          new pbr.GeneratedClrTypeInfo(null, new pbr.GeneratedClrTypeInfo[] {
-            new pbr.GeneratedClrTypeInfo(typeof(Message), Message.Parser, new[]{ "Cmd", "TaskId", "Content" }, null, null, null)
+            "ZXNzYWdlEgsKA2NtZBgBIAEoCRIOCgZ0YXNrSWQYAiABKAkSDwoHY29udGVu",
+            "dBgDIAEoCUITQg9NZXNzYWdlUHJvdG9TdHJIAWIGcHJvdG8z"));
+      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
+          new pbr::FileDescriptor[] { },
+          new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
+            new pbr::GeneratedClrTypeInfo(typeof(global::Cn.Sagacloud.Proto.Message), global::Cn.Sagacloud.Proto.Message.Parser, new[]{ "Cmd", "TaskId", "Content" }, null, null, null)
           }));
     }
     #endregion
 
   }
   #region Messages
-  public sealed partial class Message : pb.IMessage<Message> {
-    private static readonly pb.MessageParser<Message> _parser = new pb.MessageParser<Message>(() => new Message());
-     //04 private pb.UnknownFieldSet _unknownFields;
-    [System.Diagnostics.DebuggerNonUserCodeAttribute]
-    public static pb.MessageParser<Message> Parser { get { return _parser; } }
-
-    [System.Diagnostics.DebuggerNonUserCodeAttribute]
-    public static pbr.MessageDescriptor Descriptor {
-      get { return MessageProtoReflection.Descriptor.MessageTypes[0]; }
+  public sealed partial class Message : pb::IMessage<Message> {
+    private static readonly pb::MessageParser<Message> _parser = new pb::MessageParser<Message>(() => new Message());
+    private pb::UnknownFieldSet _unknownFields;
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+    public static pb::MessageParser<Message> Parser { get { return _parser; } }
+
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+    public static pbr::MessageDescriptor Descriptor {
+      get { return global::Cn.Sagacloud.Proto.MessageProtoReflection.Descriptor.MessageTypes[0]; }
     }
 
-    [System.Diagnostics.DebuggerNonUserCodeAttribute]
-    pbr.MessageDescriptor pb.IMessage.Descriptor {
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+    pbr::MessageDescriptor pb::IMessage.Descriptor {
       get { return Descriptor; }
     }
 
-    [System.Diagnostics.DebuggerNonUserCodeAttribute]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
     public Message() {
       OnConstruction();
     }
 
     partial void OnConstruction();
 
-    [System.Diagnostics.DebuggerNonUserCodeAttribute]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
     public Message(Message other) : this() {
       cmd_ = other.cmd_;
       taskId_ = other.taskId_;
       content_ = other.content_;
-        //04  _unknownFields = pb.UnknownFieldSet.Clone(other._unknownFields);
-        }
+      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+    }
 
-        [System.Diagnostics.DebuggerNonUserCodeAttribute]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
     public Message Clone() {
       return new Message(this);
     }
@@ -75,42 +76,42 @@ namespace NettyClient.proto
     /// <summary>Field number for the "cmd" field.</summary>
     public const int CmdFieldNumber = 1;
     private string cmd_ = "";
-    [System.Diagnostics.DebuggerNonUserCodeAttribute]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
     public string Cmd {
       get { return cmd_; }
       set {
-        cmd_ = pb.ProtoPreconditions.CheckNotNull(value, "value");
+        cmd_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
       }
     }
 
     /// <summary>Field number for the "taskId" field.</summary>
     public const int TaskIdFieldNumber = 2;
-    private int taskId_;
-    [System.Diagnostics.DebuggerNonUserCodeAttribute]
-    public int TaskId {
+    private string taskId_ = "";
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+    public string TaskId {
       get { return taskId_; }
       set {
-        taskId_ = value;
+        taskId_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
       }
     }
 
     /// <summary>Field number for the "content" field.</summary>
     public const int ContentFieldNumber = 3;
     private string content_ = "";
-    [System.Diagnostics.DebuggerNonUserCodeAttribute]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
     public string Content {
       get { return content_; }
       set {
-        content_ = pb.ProtoPreconditions.CheckNotNull(value, "value");
+        content_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
       }
     }
 
-    [System.Diagnostics.DebuggerNonUserCodeAttribute]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
     public override bool Equals(object other) {
       return Equals(other as Message);
     }
 
-    [System.Diagnostics.DebuggerNonUserCodeAttribute]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
     public bool Equals(Message other) {
       if (ReferenceEquals(other, null)) {
         return false;
@@ -121,61 +122,64 @@ namespace NettyClient.proto
       if (Cmd != other.Cmd) return false;
       if (TaskId != other.TaskId) return false;
       if (Content != other.Content) return false;
-        //04  return Equals(_unknownFields, other._unknownFields);
-            return true;
+      return Equals(_unknownFields, other._unknownFields);
     }
 
-        [System.Diagnostics.DebuggerNonUserCodeAttribute]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
     public override int GetHashCode() {
       int hash = 1;
       if (Cmd.Length != 0) hash ^= Cmd.GetHashCode();
-      if (TaskId != 0) hash ^= TaskId.GetHashCode();
+      if (TaskId.Length != 0) hash ^= TaskId.GetHashCode();
       if (Content.Length != 0) hash ^= Content.GetHashCode();
-            //04   if (_unknownFields != null) {hash ^= _unknownFields.GetHashCode();}
-            return hash;
+      if (_unknownFields != null) {
+        hash ^= _unknownFields.GetHashCode();
+      }
+      return hash;
     }
 
-    [System.Diagnostics.DebuggerNonUserCodeAttribute]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
     public override string ToString() {
-      return pb.JsonFormatter.ToDiagnosticString(this);
+      return pb::JsonFormatter.ToDiagnosticString(this);
     }
 
-    [System.Diagnostics.DebuggerNonUserCodeAttribute]
-    public void WriteTo(pb.CodedOutputStream output) {
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+    public void WriteTo(pb::CodedOutputStream output) {
       if (Cmd.Length != 0) {
         output.WriteRawTag(10);
         output.WriteString(Cmd);
       }
-      if (TaskId != 0) {
-        output.WriteRawTag(16);
-        output.WriteInt32(TaskId);
+      if (TaskId.Length != 0) {
+        output.WriteRawTag(18);
+        output.WriteString(TaskId);
       }
       if (Content.Length != 0) {
         output.WriteRawTag(26);
         output.WriteString(Content);
       }
+      if (_unknownFields != null) {
+        _unknownFields.WriteTo(output);
+      }
+    }
 
-        //04    if (_unknownFields != null){_unknownFields.WriteTo(output);}
-        }
-
-        [System.Diagnostics.DebuggerNonUserCodeAttribute]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
     public int CalculateSize() {
       int size = 0;
       if (Cmd.Length != 0) {
-        size += 1 + pb.CodedOutputStream.ComputeStringSize(Cmd);
+        size += 1 + pb::CodedOutputStream.ComputeStringSize(Cmd);
       }
-      if (TaskId != 0) {
-        size += 1 + pb.CodedOutputStream.ComputeInt32Size(TaskId);
+      if (TaskId.Length != 0) {
+        size += 1 + pb::CodedOutputStream.ComputeStringSize(TaskId);
       }
       if (Content.Length != 0) {
-        size += 1 + pb.CodedOutputStream.ComputeStringSize(Content);
+        size += 1 + pb::CodedOutputStream.ComputeStringSize(Content);
       }
-
-            //04    if (_unknownFields != null){size += _unknownFields.CalculateSize();}
-            return size;
+      if (_unknownFields != null) {
+        size += _unknownFields.CalculateSize();
+      }
+      return size;
     }
 
-    [System.Diagnostics.DebuggerNonUserCodeAttribute]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
     public void MergeFrom(Message other) {
       if (other == null) {
         return;
@@ -183,29 +187,29 @@ namespace NettyClient.proto
       if (other.Cmd.Length != 0) {
         Cmd = other.Cmd;
       }
-      if (other.TaskId != 0) {
+      if (other.TaskId.Length != 0) {
         TaskId = other.TaskId;
       }
       if (other.Content.Length != 0) {
         Content = other.Content;
       }
-        //04  _unknownFields = pb.UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
-        }
+      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+    }
 
-        [System.Diagnostics.DebuggerNonUserCodeAttribute]
-    public void MergeFrom(pb.CodedInputStream input) {
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+    public void MergeFrom(pb::CodedInputStream input) {
       uint tag;
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
           default:
-              //04 _unknownFields = Google.Protobuf.UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
-                        break;
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+            break;
           case 10: {
             Cmd = input.ReadString();
             break;
           }
-          case 16: {
-            TaskId = input.ReadInt32();
+          case 18: {
+            TaskId = input.ReadString();
             break;
           }
           case 26: {

+ 12 - 11
Dispatcher/NettyClient/proto/MessageProto - 复制.cs

@@ -4,9 +4,10 @@
 // </auto-generated>
 #pragma warning disable 1591, 0612, 3021
 #region Designer generated code
+
 using pb = Google.Protobuf;
 using pbr = Google.Protobuf.Reflection;
-namespace Cn.Sagacloud.Proto
+namespace NettyClient.proto
 {
 
     /// <summary>Holder for reflection information generated from MessageProto.proto</summary>
@@ -28,7 +29,7 @@ namespace Cn.Sagacloud.Proto
       descriptor = pbr.FileDescriptor.FromGeneratedCode(descriptorData,
           new pbr.FileDescriptor[] { },
           new pbr.GeneratedClrTypeInfo(null, new pbr.GeneratedClrTypeInfo[] {
-            new pbr.GeneratedClrTypeInfo(typeof(Cn.Sagacloud.Proto.Message), Cn.Sagacloud.Proto.Message.Parser, new[]{ "Cmd", "TaskId", "Content" }, null, null, null)
+            new pbr.GeneratedClrTypeInfo(typeof(Message), Message.Parser, new[]{ "Cmd", "TaskId", "Content" }, null, null, null)
           }));
     }
     #endregion
@@ -37,13 +38,13 @@ namespace Cn.Sagacloud.Proto
   #region Messages
   public sealed partial class Message : pb.IMessage<Message> {
     private static readonly pb.MessageParser<Message> _parser = new pb.MessageParser<Message>(() => new Message());
-     private pb.UnknownFieldSet _unknownFields;
+     //04 private pb.UnknownFieldSet _unknownFields;
     [System.Diagnostics.DebuggerNonUserCodeAttribute]
     public static pb.MessageParser<Message> Parser { get { return _parser; } }
 
     [System.Diagnostics.DebuggerNonUserCodeAttribute]
     public static pbr.MessageDescriptor Descriptor {
-      get { return Cn.Sagacloud.Proto.MessageProtoReflection.Descriptor.MessageTypes[0]; }
+      get { return MessageProtoReflection.Descriptor.MessageTypes[0]; }
     }
 
     [System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -63,7 +64,7 @@ namespace Cn.Sagacloud.Proto
       cmd_ = other.cmd_;
       taskId_ = other.taskId_;
       content_ = other.content_;
-         _unknownFields = pb.UnknownFieldSet.Clone(other._unknownFields);
+        //04  _unknownFields = pb.UnknownFieldSet.Clone(other._unknownFields);
         }
 
         [System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -120,7 +121,7 @@ namespace Cn.Sagacloud.Proto
       if (Cmd != other.Cmd) return false;
       if (TaskId != other.TaskId) return false;
       if (Content != other.Content) return false;
-        return Equals(_unknownFields, other._unknownFields);
+        //04  return Equals(_unknownFields, other._unknownFields);
             return true;
     }
 
@@ -130,7 +131,7 @@ namespace Cn.Sagacloud.Proto
       if (Cmd.Length != 0) hash ^= Cmd.GetHashCode();
       if (TaskId != 0) hash ^= TaskId.GetHashCode();
       if (Content.Length != 0) hash ^= Content.GetHashCode();
-            if (_unknownFields != null) {hash ^= _unknownFields.GetHashCode();}
+            //04   if (_unknownFields != null) {hash ^= _unknownFields.GetHashCode();}
             return hash;
     }
 
@@ -154,7 +155,7 @@ namespace Cn.Sagacloud.Proto
         output.WriteString(Content);
       }
 
-            if (_unknownFields != null){_unknownFields.WriteTo(output);}
+        //04    if (_unknownFields != null){_unknownFields.WriteTo(output);}
         }
 
         [System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -170,7 +171,7 @@ namespace Cn.Sagacloud.Proto
         size += 1 + pb.CodedOutputStream.ComputeStringSize(Content);
       }
 
-             if (_unknownFields != null){size += _unknownFields.CalculateSize();}
+            //04    if (_unknownFields != null){size += _unknownFields.CalculateSize();}
             return size;
     }
 
@@ -188,7 +189,7 @@ namespace Cn.Sagacloud.Proto
       if (other.Content.Length != 0) {
         Content = other.Content;
       }
-        _unknownFields = pb.UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+        //04  _unknownFields = pb.UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
         }
 
         [System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -197,7 +198,7 @@ namespace Cn.Sagacloud.Proto
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
           default:
-_unknownFields = Google.Protobuf.UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+              //04 _unknownFields = Google.Protobuf.UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
                         break;
           case 10: {
             Cmd = input.ReadString();

+ 11 - 1
Dispatcher/NettyClient/proto/MessageUtil.cs

@@ -3,12 +3,22 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using Message = Cn.Sagacloud.Proto.Message;
 
 namespace NettyClient.proto
 {
     public class MessageUtil
     {
-        public static Message generateMessage(string cmd, int taskId, string content) {
+        //public static Message generateMessage(string cmd, int taskId, string content) {
+        //    Message msg = new Message();
+        //    msg.Cmd = cmd;
+        //    msg.TaskId = taskId;
+        //    msg.Content = content;
+        //    return msg;
+        //}
+
+        public static Message generateMessageStr(string cmd, string taskId, string content)
+        {
             Message msg = new Message();
             msg.Cmd = cmd;
             msg.TaskId = taskId;

+ 5 - 8
Dispatcher/TaskDatabase/Mappings/TaskModel.hbm.xml

@@ -7,10 +7,10 @@
   <class name="TaskModel" table="task" entity-name="TaskModel">
     <id name="Tid">
       <!--<generator class="guid" />-->
-      <generator class="native" />
+      <generator class="identity" />
       <!--  <generator class="native" />主键自增。使用数据库自带的生成器 -->
     </id>
-    <property name="Id" />
+    <property name="Id" column="id" type="string"/>
     <property name="Task_name"/>
     <property name="Task_cmd" update="false" />
     <property name="Task_param" update="false"/>
@@ -25,15 +25,12 @@
   </class>
 
   <class name="DownloadTaskModel" table="download">
-    <id name="Tid">
+    <id name="Id" column="id">
       <!--<generator class="guid" />-->
-      <generator class="native" />
+      <generator class="identity" />
       <!--  <generator class="native" />主键自增。使用数据库自带的生成器 -->
     </id>
-    <property name="Id" />
-    <property name="Task_id" >
-      <!--<many-to-one class="DownloadTaskModel" column="Task_Id"/>-->
-    </property>
+    <property name="Task_id" />
     <property name="Task_url" />
     <property name="Task_md5" />
     <property name="Local_dir" />

+ 2 - 2
Dispatcher/TaskDatabase/Model/DownloadTaskModel.cs

@@ -5,8 +5,8 @@ namespace TaskDatabase.Model
 
     public class DownloadTaskModel
     {
-        public virtual int Tid { get; set; }
-        [JsonProperty(PropertyName = "id")]
+        //public virtual int Tid { get; set; }
+        //[JsonProperty(PropertyName = "id")]
         public virtual int Id { get; set; }
         [JsonProperty(PropertyName = "taskId")]
         public virtual string Task_id { get; set; }

+ 1 - 1
Dispatcher/TaskDatabase/Model/TaskModel.cs

@@ -11,7 +11,7 @@ namespace TaskDatabase.Model
     {
         public virtual int Tid { get; set; }
         [JsonProperty(PropertyName = "id")]
-        public virtual int Id { get; set; }
+        public virtual string Id { get; set; }
         [JsonProperty(PropertyName = "name")]
         public virtual string Task_name { get; set; }
         [JsonProperty(PropertyName = "cmd")]

+ 1 - 0
Dispatcher/TaskDatabase/TaskDatabase.csproj

@@ -88,6 +88,7 @@
   <ItemGroup>
     <Content Include="hibernate.cfg.xml">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+      <SubType>Designer</SubType>
     </Content>
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

+ 6 - 7
Dispatcher/TaskDatabase/TaskService.cs

@@ -25,7 +25,7 @@ namespace TaskDatabase
                         try
                         {
                             session.Save(task);
-                            if(task.DownloadTaskModelList != null)
+                            if (task.DownloadTaskModelList != null)
                             {
                                 foreach(var download in task.DownloadTaskModelList)
                                 {
@@ -35,12 +35,11 @@ namespace TaskDatabase
                             transaction.Commit();
                         }
                         catch (Exception ex){
+                            Console.WriteLine("write:" + ex.Message);
                             if (transaction != null && transaction.IsActive)
                             {
                                 transaction.Rollback();
                             }
-                            Console.WriteLine(ex.Message);
-                            return false;
                         }
                     }
                 }
@@ -113,7 +112,7 @@ namespace TaskDatabase
             return null;
         }
 
-        public TaskModel GetTasksByTid(int tid)
+        public TaskModel GetTasksByTid(string taskId)
         {
             ITransaction transaction = null;
             try
@@ -123,7 +122,7 @@ namespace TaskDatabase
                     using (transaction = session.BeginTransaction())
                     {
                         var queryResult = session.CreateCriteria(typeof(TaskModel))
-                                .Add(Restrictions.Eq("Tid", tid))
+                                .Add(Restrictions.Eq("Id", taskId))
                                 .UniqueResult<TaskModel>();
                         return queryResult;
                     }
@@ -137,7 +136,7 @@ namespace TaskDatabase
             return null;
         }
 
-        public IList<TaskModel> GetTasksByTaskId(int taskId)
+        public IList<TaskModel> GetTasksByTaskId(string taskId)
         {
             ITransaction transaction = null;
             try
@@ -160,7 +159,7 @@ namespace TaskDatabase
             return null;
         }
 
-        public bool isContainsTask(int taskId)
+        public bool isContainsTask(string taskId)
         {
             ITransaction transaction = null;
             try

+ 1 - 1
Dispatcher/TaskDatabase/hibernate.cfg.xml

@@ -4,7 +4,7 @@
     <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
     <property name="dialect">NHibernate.Dialect.MySQL5Dialect</property>
     <property name="connection.driver_class">NHibernate.Driver.MySqlDataDriver</property>
-    <property name="connection.connection_string">Server=localhost;Database=worker;User ID=root;Password=123456</property>
+    <property name="connection.connection_string">Server=127.0.0.1;Database=worker_str;User ID=root;Password=123456</property>
     <property name="show_sql">false</property>
     <mapping assembly="TaskDatabase"/>
   </session-factory>

BIN
Executer/DataCheck/DataCheckResource/模型检查结果输出格式-模版.xlsx


+ 1 - 1
Executer/DataExport/RevitToJBim/ComponentParse/ParseSpace.cs

@@ -103,7 +103,7 @@ namespace RevitToJBim.ComponentParse
                     }
                 }
                 //外轮廓
-                bimObject.OutLine2 = space.GetSpaceOutline();
+                bimObject.OutLine2 = null; //space.GetSpaceOutline();
             }
  
             context.AddBimObject(bimObject);

+ 1 - 1
Starter/StartVisionSelector/Program.cs

@@ -109,7 +109,7 @@ namespace StartVisionSelector
             process.Start();//执行
             string msg = process.StandardOutput.ReadToEnd();//读取输出
             Console.WriteLine(msg);
-            process.WaitForExit(20*60*1000);//等待执行完成
+            process.WaitForExit(60*60*1000);//等待执行完成
             //process.Close();//结束
             if(!process.HasExited)
                 process.Kill();

+ 2 - 2
Starter/Starter/Program.cs

@@ -38,14 +38,14 @@ namespace ExportStart
             if (string.IsNullOrWhiteSpace(command))
             {
                 command = "DataExport";
-                command = "DataCheck";
+                //command = "DataCheck";
                 path = @"E:\导出测试\testSpace.rvt";
                 path = @"E:\导出测试\系统图修改编码版\消防系统图模型第一版V1219.rvt";
                 path = @"E:\导出测试\无锡系统图1225\热源系统图模型第一版V1225.rvt";
                 path = @"D:\给排水系统图模型第一版V1225.rvt";
                 path = @"E:\1245.rvt";
 
-                //path = @"C:\Users\SAGACLOUD\Desktop\F1\建筑-F1.rvt";
+                path = @"C:\Users\SAGACLOUD\Desktop\北京亚洲金融大厦F9模型文件v3(1).rvt";
                 //path = @"D:\安装包\CAD\测试模型\F4测试.rvt";
                 JObject jObject = new JObject();
                 jObject.Add("ResultFileName", @"C:\Users\SAGACLOUD\AppData\Local\RevitService\Result_e26be2fd-2097-462b-bdd0-a2a86b616928.txt");