Procházet zdrojové kódy

fix:优化采集数据返回

wang.sq@aliyun.com před 5 měsíci
rodič
revize
7b780176db

+ 9 - 1
IMCS_CCS/.config/dotnet-tools.json

@@ -1,5 +1,13 @@
 {
 {
   "version": 1,
   "version": 1,
   "isRoot": true,
   "isRoot": true,
-  "tools": {}
+  "tools": {
+    "dotnet-ef": {
+      "version": "9.0.0",
+      "commands": [
+        "dotnet-ef"
+      ],
+      "rollForward": false
+    }
+  }
 }
 }

+ 3 - 1
IMCS_CCS/Program.cs

@@ -23,8 +23,10 @@ namespace IMCS.CCS
                 //设置NLog
                 //设置NLog
                 LogUtil.Init(logger);
                 LogUtil.Init(logger);
                 logger.Debug("初始化 Main !");
                 logger.Debug("初始化 Main !");
+                Console.WriteLine("初始化 Main !");
 
 
                 await host.RunAsync();
                 await host.RunAsync();
+
                 //host.Run();
                 //host.Run();
             }
             }
             catch (Exception exception)
             catch (Exception exception)
@@ -51,9 +53,9 @@ namespace IMCS.CCS
                     {
                     {
                         //监听端口 5001 用于 Web Service
                         //监听端口 5001 用于 Web Service
                         options.ListenAnyIP(8089, configure => configure.Protocols = HttpProtocols.Http1);
                         options.ListenAnyIP(8089, configure => configure.Protocols = HttpProtocols.Http1);
+                        Console.WriteLine("初始化监听成功");
                         //监听端口 5001 用于 Web Service
                         //监听端口 5001 用于 Web Service
                         //options.ListenAnyIP(5201, configure => configure.Protocols = HttpProtocols.Http2);
                         //options.ListenAnyIP(5201, configure => configure.Protocols = HttpProtocols.Http2);
-
                     });
                     });
                     #endregion
                     #endregion
 
 

+ 4 - 4
IMCS_CCS/Properties/PublishProfiles/FolderProfile.pubxml

@@ -4,9 +4,9 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
 -->
 -->
 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup>
   <PropertyGroup>
-    <DeleteExistingFiles>True</DeleteExistingFiles>
-    <ExcludeApp_Data>False</ExcludeApp_Data>
-    <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
+    <DeleteExistingFiles>true</DeleteExistingFiles>
+    <ExcludeApp_Data>false</ExcludeApp_Data>
+    <LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
     <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
     <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
     <LastUsedPlatform>Any CPU</LastUsedPlatform>
     <LastUsedPlatform>Any CPU</LastUsedPlatform>
     <PublishProvider>FileSystem</PublishProvider>
     <PublishProvider>FileSystem</PublishProvider>
@@ -14,7 +14,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
     <WebPublishMethod>FileSystem</WebPublishMethod>
     <WebPublishMethod>FileSystem</WebPublishMethod>
     <SiteUrlToLaunchAfterPublish />
     <SiteUrlToLaunchAfterPublish />
     <TargetFramework>netcoreapp3.1</TargetFramework>
     <TargetFramework>netcoreapp3.1</TargetFramework>
-    <RuntimeIdentifier>linux-x64</RuntimeIdentifier>
+    <RuntimeIdentifier>win-x64</RuntimeIdentifier>
     <ProjectGuid>5c351dec-c70b-45ce-a622-e3c5ab91a84b</ProjectGuid>
     <ProjectGuid>5c351dec-c70b-45ce-a622-e3c5ab91a84b</ProjectGuid>
     <SelfContained>true</SelfContained>
     <SelfContained>true</SelfContained>
   </PropertyGroup>
   </PropertyGroup>

+ 1 - 0
IMCS_CCS/Service/Impl/HttpRequestService.cs

@@ -376,6 +376,7 @@ namespace IMCS.CCS.Services
             {
             {
                 Log.Instance.WriteLogAdd(ActionTypeEnum.UploadFile + "上传异常===>>" + ex.Message + JsonConvert.SerializeObject(req),
                 Log.Instance.WriteLogAdd(ActionTypeEnum.UploadFile + "上传异常===>>" + ex.Message + JsonConvert.SerializeObject(req),
                     EnumHelper.GetDescription(ActionTypeEnum.UploadFile));
                     EnumHelper.GetDescription(ActionTypeEnum.UploadFile));
+                responseData.resultMsg = ActionTypeEnum.UploadFile + "上传异常===>>" + ex.Message + JsonConvert.SerializeObject(req);
                 responseData.result = "false";
                 responseData.result = "false";
                 return responseData;
                 return responseData;
             }
             }

+ 2 - 2
IMCS_CCS/Service/Impl/TaskJobService.cs

@@ -1429,7 +1429,7 @@ namespace IMCS.CCS.Service.Impl
                         }
                         }
 
 
                         Log.Instance.WriteLogAdd(device.Ip + ":" + device.ProtocolType + "连接失败,或已离线", LOG_TITLE_DEVICE);
                         Log.Instance.WriteLogAdd(device.Ip + ":" + device.ProtocolType + "连接失败,或已离线", LOG_TITLE_DEVICE);
-                        message = message + device.Ip + ",连接失败,或已离线,ip:" + device.Ip + ",协议类型:" + device.ProtocolType;
+                        message = message+ "======设备连接失败,或已离线,ip:" + device.Ip + ",协议类型:" + device.ProtocolType;
                         continue;
                         continue;
                     }
                     }
                     else
                     else
@@ -1442,7 +1442,7 @@ namespace IMCS.CCS.Service.Impl
                             await _deviceService.UpdateAndCache(oldDevice); 
                             await _deviceService.UpdateAndCache(oldDevice); 
                         }
                         }
                         Log.Instance.WriteLogAdd(device.Ip + ":"+ device.ProtocolType +  "连接成功", LOG_TITLE_DEVICE);
                         Log.Instance.WriteLogAdd(device.Ip + ":"+ device.ProtocolType +  "连接成功", LOG_TITLE_DEVICE);
-                        message = message + ",plc连接成功,ip:" + device.Ip + ",协议类型:" + device.ProtocolType;
+                        message = message + "======连接成功,ip:" + device.Ip + ",协议类型:" + device.ProtocolType;
                         continue;
                         continue;
                     }
                     }
                     Thread.Sleep(50);
                     Thread.Sleep(50);

+ 5 - 0
IMCS_CCS/Startup.cs

@@ -125,6 +125,8 @@ namespace IMCS.CCS
         // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
         // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
         public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
         public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
         {
         {
+            Console.WriteLine("初始化配置信息");
+
             //if (env.IsDevelopment())
             //if (env.IsDevelopment())
             //{
             //{
                 app.UseDeveloperExceptionPage();
                 app.UseDeveloperExceptionPage();
@@ -146,6 +148,9 @@ namespace IMCS.CCS
             {
             {
                 endpoints.MapControllers();
                 endpoints.MapControllers();
             });
             });
+
+
+            Console.WriteLine("启动成功");
         }
         }
     }
     }
 }
 }

+ 4 - 4
IMCS_CCS/appsettings.json

@@ -20,7 +20,7 @@
     "Project": "IMCS.CCS:Project",
     "Project": "IMCS.CCS:Project",
     "Tasks": "IMCS.CCS:Tasks"
     "Tasks": "IMCS.CCS:Tasks"
   },  
   },  
-  "RedisConnectionString": "192.168.50.111:6379,password=123456,defaultDatabase=0", 
+  "RedisConnectionString": "192.168.50.111:6379,password=123456,defaultDatabase=0",
   "ConnectionStrings": {
   "ConnectionStrings": {
     "mysqlContext": "server=localhost;port=3306;database=ccs_331;uid=root;pwd=123456;CharSet=utf8;Allow Zero Datetime=True",
     "mysqlContext": "server=localhost;port=3306;database=ccs_331;uid=root;pwd=123456;CharSet=utf8;Allow Zero Datetime=True",
     "ecsUrlContext": "http://localhost:9099/api/authority/taskNode/taskNodeCallback",
     "ecsUrlContext": "http://localhost:9099/api/authority/taskNode/taskNodeCallback",
@@ -30,8 +30,8 @@
     "FTPServer": "127.0.0.1",
     "FTPServer": "127.0.0.1",
     "FTPUser": "test",
     "FTPUser": "test",
     "FTPPwd": "test",
     "FTPPwd": "test",
-    "fanucUrlContext": "http://localhost:5100/fanuc/",
-    "opcuacUrlContext": "http://localhost:8010/opcua/",
-    "hdhUrlContext": "http://localhost:8011/heidenhain/"
+    "fanucUrlContext": "http://127.0.0.1:5100/fanuc/",
+    "opcuacUrlContext": "http://127.0.0.1:8010/opcua/",
+    "hdhUrlContext": "http://127.0.0.1:8011/heidenhain/"
   }
   }
 }
 }