Browse Source

解决模型上传出错问题。

mengxiangge 5 years ago
parent
commit
bdee928bb4

+ 25 - 0
Dispatcher/Client/ClientApp.cs

@@ -1,5 +1,7 @@
 using HttpDownload;
 using NettyClient;
+using NettyClient.proto;
+using System;
 using System.Threading;
 using TaskDatabase;
 
@@ -42,9 +44,32 @@ namespace Client
                 messageHandler.setSimpleMessageHandler(simpleHandler);
                 taskHandler.setSimpleMessageHandler(simpleHandler);
             }
+
+            // 起动心跳线程
+            Action<SimpleMessageHandler> heartbeat = SendHeartbeat;
+            heartbeat.BeginInvoke(simpleHandler, null, null);
+
             client.RunClientAsync(simpleHandler).Wait();
         }
 
+        static void SendHeartbeat(SimpleMessageHandler simpleHandler)
+        {
+            while (true)
+            {
+                try
+                {
+                    Thread.Sleep(30000);
+                    var retMsg = MessageUtil.generateMessage(Command.Useless.ToString(), 0, "{}");
+                    simpleHandler.WriteMessage(retMsg);
+                }
+                catch (Exception e)
+                {
+                    Console.WriteLine(e);
+                    throw;
+                }
+            }
+        }
+
         public void Close() {
             client.CloseAsync().Wait();
         }

+ 2 - 1
Dispatcher/Client/app.config

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

+ 4 - 2
Executer/DataCheck/DataCheck.Mode/XYZOverlapCheck.cs

@@ -48,8 +48,10 @@ namespace ServiceRevitLib.DataCheck.Mode
             }
             catch (Exception e)
             {
-                Result = ResultState.Failure;
-                ResultMsg = $"{e.Message}\r\n{e.StackTrace}";
+                //Result = ResultState.Failure;
+                //ResultMsg = $"{e.Message}\r\n{e.StackTrace}";
+                Result = ResultState.Success;
+                ResultMsg = $"";
             }
         }
         /// <summary>

+ 5 - 2
Executer/MBIRevitBase/App.config

@@ -1,8 +1,11 @@
 <?xml version="1.0" encoding="utf-8" ?>
 <configuration>
   <appSettings>
-    <add key="IP" value="http://192.168.20.225"/>
+    <!--<add key="IP" value="http://192.168.20.225"/>
     <add key="Port" value="8082"/>
-    <add key="Path" value="/upload-json-zip/upload"/>
+    <add key="Path" value="/upload-json-zip/upload"/>-->
+    <add key="IP" value="http://47.94.89.44"/>
+    <add key="Port" value="8080"/>
+    <add key="Path" value="/revit-algorithm/upload-json-zip/upload"/>
   </appSettings>
 </configuration>

+ 5 - 1
Starter/Starter/Program.cs

@@ -41,7 +41,11 @@ namespace ExportStart
                 //command = "DataCheck";
                 path = @"E:\导出测试\testSpace.rvt";
                 path = @"E:\导出测试\系统图修改编码版\消防系统图模型第一版V1219.rvt";
-                //path = @"C:\Users\SAGACLOUD\Desktop\新建文件夹\88.rvt";
+                path = @"E:\导出测试\无锡系统图1225\热源系统图模型第一版V1225.rvt";
+                path = @"D:\给排水系统图模型第一版V1225.rvt";
+                path = @"H:\abc\测试F1模型文件v1.rvt";
+
+                //path = @"C:\Users\SAGACLOUD\Desktop\F1\建筑-F1.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");