Эх сурвалжийг харах

更新项目依赖和配置,添加备份项目文件

在 `ServiceCenter.csproj` 中:
- 添加 `<GeneratePackageOnBuild>` 属性。
- 更新和移除多个包引用和项目引用。
- 移除 `Attributes` 文件夹的编译和资源嵌入。

在 `WCS.Service.csproj` 和 `WCS.WorkEngineering.csproj` 中:
- 移除 `MessagePack` 包引用。

新增 `ServiceCenter - Backup.csproj` 文件:
- 设置目标框架为 `net8.0`,启用隐式 using 和可空引用类型。
- 添加多个包引用和项目引用。
- 添加 `Attributes` 文件夹引用。
林豪 左 1 жил өмнө
parent
commit
91e3afc00f

+ 3 - 0
WCS.Service/Program.cs

@@ -4,6 +4,8 @@ using ServiceCenter.Extensions;
 using ServiceCenter.Redis;
 using ServiceCenter.WebApi;
 using MessagePack;
+using ReZero.SuperAPI;
+using SqlSugar;
 
 namespace WCS.Service
 {
@@ -42,6 +44,7 @@ namespace WCS.Service
             //是否是win平台
             var isWin = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
             Console.WriteLine($"win:{isWin}");
+          
             if (isWin)
             {
                 var useUrls = RedisHub.Default.Check("UseUrls") ?? throw new Exception("请在Redis中配置网络访问端口");

+ 4 - 10
WCS.Service/WCS.Service.csproj

@@ -1,34 +1,28 @@
 <Project Sdk="Microsoft.NET.Sdk.Worker">
-
   <PropertyGroup>
-    <TargetFramework>net7.0</TargetFramework>
+    <TargetFramework>net8.0</TargetFramework>
     <Nullable>enable</Nullable>
     <ImplicitUsings>enable</ImplicitUsings>
     <UserSecretsId>dotnet-WCS.Service-ee485c84-3250-46d0-8109-1d37d3b27230</UserSecretsId>
   </PropertyGroup>
-
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
     <NoWarn>1701;1702;8602;8616;8618;8625;8600;8603;8714;1591</NoWarn>
   </PropertyGroup>
-
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
     <NoWarn>1701;1702;8602;8616;8618;8625;8600;8603;8714;1591</NoWarn>
   </PropertyGroup>
-
   <ItemGroup>
     <Compile Remove="Logs\**" />
     <Content Remove="Logs\**" />
     <EmbeddedResource Remove="Logs\**" />
     <None Remove="Logs\**" />
   </ItemGroup>
-
   <ItemGroup>
     <PackageReference Include="Microsoft.AspNetCore.Hosting" Version="2.2.7" />
-    <PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="7.0.0" />
-    <PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="7.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="8.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="8.0.0" />
   </ItemGroup>
-
   <ItemGroup>
     <ProjectReference Include="..\WCS.WorkEngineering\WCS.WorkEngineering.csproj" />
   </ItemGroup>
-</Project>
+</Project>

+ 2 - 1
WCS.Service/Worker.cs

@@ -11,6 +11,7 @@ using WCS.Core;
 using WCS.WorkEngineering;
 using MessagePack.ImmutableCollection;
 using MessagePack.Resolvers;
+using ReZero.SuperAPI;
 using ServiceCenter.Virtual_PLC;
 using WCS.Service.PLCAccessors;
 
@@ -47,7 +48,7 @@ namespace WCS.Service
         {
             if (stoppingToken.IsCancellationRequested)
                 return;
-
+          
             #region ³õʼ»¯RedisÁ¬½Ó
 
             var redisConnectionStrings = RedisHub.Default.Check("RedisConnectionStrings") ?? throw new Exception("ÇëÔÚRedisÖÐÅäÖÃRedisConnectionStrings");

+ 2 - 2
WCS.Service/appsettings.json

@@ -7,7 +7,7 @@
     }
   },
   "ConnectionStrings": {
-    "Redis": "10.30.37.2:6379,database=0,prefix=Sorting:"
-    //"Redis": "127.0.0.1,database=0,prefix=Sorting:"
+    //"Redis": "10.30.37.2:6379,database=0,prefix=Sorting:"
+    "Redis": "127.0.0.1,password=190131,database=0,prefix=Sorting:"
   }
 }

BIN
WCS.Service/xxx.db


+ 26 - 0
WCS.WorkEngineering/Startup.cs

@@ -4,6 +4,9 @@ using Microsoft.Extensions.Configuration;
 using Microsoft.Extensions.DependencyInjection;
 using Microsoft.OpenApi.Models;
 using System.Reflection;
+using ReZero;
+using ReZero.SuperAPI;
+using SqlSugar;
 
 namespace ServiceCenter.WebApi
 {
@@ -40,6 +43,29 @@ namespace ServiceCenter.WebApi
                 var xmlFilename = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml";
                 c.IncludeXmlComments(Path.Combine(AppContext.BaseDirectory, xmlFilename));
             });
+
+            //注册ReZero.Api
+            services.AddReZeroServices(api =>
+            {
+
+                var apiObj = new SuperAPIOptions();
+
+                //Swagger地址
+                apiObj.UiOptions.DefaultIndexSource = "/Swagger";
+
+                apiObj.DatabaseOptions = new DatabaseOptions()
+                {
+                    ConnectionConfig = new SuperAPIConnectionConfig()
+                    {
+                        ConnectionString = "datasource=xxx.db",
+                        DbType = DbType.Sqlite
+                    }
+                };
+
+                //启用超级API
+                api.EnableSuperApi(apiObj);
+
+            });
         }
 
         // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.

+ 8 - 0
WCS.WorkEngineering/Systems/DataCollectionSysyem.cs

@@ -56,6 +56,14 @@ namespace WCS.WorkEngineering.Systems
         {
             try
             {
+                var channel = new Channel
+                {
+                    World = World.Description,
+                    Stage = "DoLogics",
+                    System = Description,
+                    Item = this.Description
+                };
+                Ltc.SetChannel(channel);
                 var sw = new Stopwatch();
                 sw.Start();
 

+ 229 - 214
WCS.WorkEngineering/Systems/MainSysyem.cs

@@ -30,6 +30,14 @@ namespace WCS.WorkEngineering.Systems
         {
             try
             {
+                var channel = new Channel
+                {
+                    World = World.Description,
+                    Stage = "DoLogics",
+                    System = Description,
+                    Item = this.Description
+                };
+                Ltc.SetChannel(channel);
                 var sw = new Stopwatch();
                 sw.Start();
 
@@ -52,26 +60,26 @@ namespace WCS.WorkEngineering.Systems
                         var typeName = "";
                         try
                         {
-                            if (ps.PropertyType == typeof(ProtocolData<WCS_BCR80>[]))
-                            {
-                                if (pack.BCR80.Any())
-                                {
-                                    var value = pack.BCR80.Select(x => x.Data).ToList();
-                                    var sql = db.Insertable(value).ToSqlString();
-                                    db.Ado.ExecuteCommand(sql);
-                                    typeName = typeof(WCS_BCR80).Name;
-                                }
-                            }
-                            else if (ps.PropertyType == typeof(ProtocolData<WCS_BCR81>[]))
-                            {
-                                if (pack.BCR81.Any())
-                                {
-                                    var value = pack.BCR81.Select(x => x.Data).ToList();
-                                    var sql = db.Insertable(value).ToSqlString();
-                                    db.Ado.ExecuteCommand(sql);
-                                    typeName = typeof(WCS_BCR81).Name;
-                                }
-                            }
+                            //if (ps.PropertyType == typeof(ProtocolData<WCS_BCR80>[]))
+                            //{
+                            //    if (pack.BCR80.Any())
+                            //    {
+                            //        var value = pack.BCR80.Select(x => x.Data).ToList();
+                            //        var sql = db.Insertable(value).ToSqlString();
+                            //        db.Ado.ExecuteCommand(sql);
+                            //        typeName = typeof(WCS_BCR80).Name;
+                            //    }
+                            //}
+                            //else if (ps.PropertyType == typeof(ProtocolData<WCS_BCR81>[]))
+                            //{
+                            //    if (pack.BCR81.Any())
+                            //    {
+                            //        var value = pack.BCR81.Select(x => x.Data).ToList();
+                            //        var sql = db.Insertable(value).ToSqlString();
+                            //        db.Ado.ExecuteCommand(sql);
+                            //        typeName = typeof(WCS_BCR81).Name;
+                            //    }
+                            //}
                             //else if (ps.PropertyType == typeof(ProtocolData<WCS_BCR83>[]))
                             //{
                             //    if (pack.BCR83.Any())
@@ -82,49 +90,50 @@ namespace WCS.WorkEngineering.Systems
                             //        typeName = typeof(WCS_BCR83).Name;
                             //    }
                             //}
-                            else if (ps.PropertyType == typeof(ProtocolData<WCS_RGV520>[]))
-                            {
-                                if (pack.RGV520.Any())
-                                {
-                                    var value = pack.RGV520.Select(x => x.Data).ToList();
-                                    var sql = db.Insertable(value).ToSqlString();
-                                    db.Ado.ExecuteCommand(sql);
-                                    typeName = typeof(WCS_RGV520).Name;
-                                }
-                            }
-                            else if (ps.PropertyType == typeof(ProtocolData<WCS_RGV521>[]))
-                            {
-                                if (pack.RGV521.Any())
-                                {
-                                    var value = pack.RGV521.Select(x => x.Data).ToList();
-                                    var sql = db.Insertable(value).ToSqlString();
-                                    db.Ado.ExecuteCommand(sql);
-                                    typeName = typeof(WCS_RGV521).Name;
-                                }
-                            }
-                            else if (ps.PropertyType == typeof(ProtocolData<WCS_RGV523>[]))
-                            {
-                                if (pack.RGV523.Any())
-                                {
-                                    var value = pack.RGV523.Select(x => new QuestDb_RGV523()
-                                    {
-                                        Alarm = Convert.ToString(x.Data.Alarm),
-                                        Code = x.Data.Code,
-                                        Frame = x.Data.Frame.ToLocalTime()
-                                    }).ToList();
-                                    var sql = db.Insertable(value).ToSqlString();
-                                    db.Ado.ExecuteCommand(GetString(sql));
-                                    typeName = typeof(WCS_RGV523).Name;
-                                }
-                            }
-                            else if (ps.PropertyType == typeof(ProtocolData<WCS_Robot520>[]))
+                            //else if (ps.PropertyType == typeof(ProtocolData<WCS_RGV520>[]))
+                            //{
+                            //    if (pack.RGV520.Any())
+                            //    {
+                            //        var value = pack.RGV520.Select(x => x.Data).ToList();
+                            //        var sql = db.Insertable(value).ToSqlString();
+                            //        db.Ado.ExecuteCommand(sql);
+                            //        typeName = typeof(WCS_RGV520).Name;
+                            //    }
+                            //}
+                            //else if (ps.PropertyType == typeof(ProtocolData<WCS_RGV521>[]))
+                            //{
+                            //    if (pack.RGV521.Any())
+                            //    {
+                            //        var value = pack.RGV521.Select(x => x.Data).ToList();
+                            //        var sql = db.Insertable(value).ToSqlString();
+                            //        db.Ado.ExecuteCommand(sql);
+                            //        typeName = typeof(WCS_RGV521).Name;
+                            //    }
+                            //}
+                            //else if (ps.PropertyType == typeof(ProtocolData<WCS_RGV523>[]))
+                            //{
+                            //    if (pack.RGV523.Any())
+                            //    {
+                            //        var value = pack.RGV523.Select(x => new QuestDb_RGV523()
+                            //        {
+                            //            Alarm = Convert.ToString(x.Data.Alarm),
+                            //            Code = x.Data.Code,
+                            //            Frame = x.Data.Frame.ToLocalTime()
+                            //        }).ToList();
+                            //        var sql = db.Insertable(value).ToSqlString();
+                            //        db.Ado.ExecuteCommand(GetString(sql));
+                            //        typeName = typeof(WCS_RGV523).Name;
+                            //    }
+                            //}
+                            //else
+                            if (ps.PropertyType == typeof(ProtocolData<WCS_Robot520>[]))
                             {
                                 if (pack.Robot520.Any())
                                 {
                                     var value = pack.Robot520.Select(x => x.Data).ToList();
                                     var sql = db.Insertable(value).ToSqlString();
                                     db.Ado.ExecuteCommand(sql);
-                                    typeName = typeof(WCS_Robot520).Name.Length.ToString();
+                                    typeName = typeof(WCS_Robot520).Name;
                                 }
                             }
                             else if (ps.PropertyType == typeof(ProtocolData<WCS_Robot521>[]))
@@ -147,41 +156,41 @@ namespace WCS.WorkEngineering.Systems
                                     typeName = typeof(WCS_Station5).Name;
                                 }
                             }
-                            else if (ps.PropertyType == typeof(ProtocolData<WCS_Robot522>[]))
-                            {
-                                if (pack.Robot522.Any())
-                                {
-                                    var value = pack.Robot522.Select(x => new QuestDb_Robot522()
-                                    {
-                                        Alarm = Convert.ToString(x.Data.Alarm),
-                                        Code = x.Data.Code,
-                                        Frame = x.Data.Frame.ToLocalTime()
-                                    }).ToList();
-                                    var sql = db.Insertable(value).ToSqlString();
-                                    db.Ado.ExecuteCommand(sql);
-                                    typeName = typeof(WCS_Robot522).Name;
-                                }
-                            }
-                            else if (ps.PropertyType == typeof(ProtocolData<WCS_Robot530>[]))
-                            {
-                                if (pack.Robot530.Any())
-                                {
-                                    var value = pack.Robot530.Select(x => x.Data).ToList();
-                                    var sql = db.Insertable(value).ToSqlString();
-                                    db.Ado.ExecuteCommand(sql);
-                                    typeName = typeof(WCS_Robot530).Name;
-                                }
-                            }
-                            else if (ps.PropertyType == typeof(ProtocolData<WCS_Robot531>[]))
-                            {
-                                if (pack.Robot531.Any())
-                                {
-                                    var value = pack.Robot531.Select(x => x.Data).ToList();
-                                    var sql = db.Insertable(value).ToSqlString();
-                                    db.Ado.ExecuteCommand(sql);
-                                    typeName = typeof(WCS_Robot531).Name;
-                                }
-                            }
+                            //else if (ps.PropertyType == typeof(ProtocolData<WCS_Robot522>[]))
+                            //{
+                            //    if (pack.Robot522.Any())
+                            //    {
+                            //        var value = pack.Robot522.Select(x => new QuestDb_Robot522()
+                            //        {
+                            //            Alarm = Convert.ToString(x.Data.Alarm),
+                            //            Code = x.Data.Code,
+                            //            Frame = x.Data.Frame.ToLocalTime()
+                            //        }).ToList();
+                            //        var sql = db.Insertable(value).ToSqlString();
+                            //        db.Ado.ExecuteCommand(sql);
+                            //        typeName = typeof(WCS_Robot522).Name;
+                            //    }
+                            //}
+                            //else if (ps.PropertyType == typeof(ProtocolData<WCS_Robot530>[]))
+                            //{
+                            //    if (pack.Robot530.Any())
+                            //    {
+                            //        var value = pack.Robot530.Select(x => x.Data).ToList();
+                            //        var sql = db.Insertable(value).ToSqlString();
+                            //        db.Ado.ExecuteCommand(sql);
+                            //        typeName = typeof(WCS_Robot530).Name;
+                            //    }
+                            //}
+                            //else if (ps.PropertyType == typeof(ProtocolData<WCS_Robot531>[]))
+                            //{
+                            //    if (pack.Robot531.Any())
+                            //    {
+                            //        var value = pack.Robot531.Select(x => x.Data).ToList();
+                            //        var sql = db.Insertable(value).ToSqlString();
+                            //        db.Ado.ExecuteCommand(sql);
+                            //        typeName = typeof(WCS_Robot531).Name;
+                            //    }
+                            //}
                             else if (ps.PropertyType == typeof(ProtocolData<WCS_SRM520>[]))
                             {
                                 if (pack.SRM520.Any())
@@ -202,92 +211,92 @@ namespace WCS.WorkEngineering.Systems
                                     typeName = typeof(WCS_SRM521).Name;
                                 }
                             }
-                            else if (ps.PropertyType == typeof(ProtocolData<WCS_SRM523>[]))
-                            {
-                                if (pack.SRM523.Any())
-                                {
-                                    var value = pack.SRM523.Select(x => new QuestDb_SRM523()
-                                    {
-                                        Alarm = $"{Convert.ToString(x.Data.Alarm1)},{Convert.ToString(x.Data.Alarm1)}",
-                                        Code = x.Data.Code,
-                                        Frame = x.Data.Frame.ToLocalTime()
-                                    }).ToList();
-                                    var sql = db.Insertable(value).ToSqlString();
-                                    db.Ado.ExecuteCommand(GetString(sql));
-                                    typeName = typeof(WCS_SRM523).Name;
-                                }
-                            }
-                            else if (ps.PropertyType == typeof(ProtocolData<WCS_Station520>[]))
-                            {
-                                if (pack.Station520.Any())
-                                {
-                                    var value = pack.Station520.Select(x => x.Data).ToList();
-                                    var sql = db.Insertable(value).ToSqlString();
-                                    db.Ado.ExecuteCommand(sql);
-                                    typeName = typeof(WCS_Station520).Name;
-                                }
-                            }
-                            else if (ps.PropertyType == typeof(ProtocolData<WCS_Station521>[]))
-                            {
-                                if (pack.Station521.Any())
-                                {
-                                    var value = pack.Station521.Select(x => x.Data).ToList();
-                                    var sql = db.Insertable(value).ToSqlString();
-                                    db.Ado.ExecuteCommand(sql);
-                                    typeName = typeof(WCS_Station521).Name;
-                                }
-                            }
-                            else if (ps.PropertyType == typeof(ProtocolData<WCS_Station523>[]))
-                            {
-                                if (pack.Station523.Any())
-                                {
-                                    var value = pack.Station523.Select(x => x.Data).ToList();
-                                    var sql = db.Insertable(value).ToSqlString();
-                                    db.Ado.ExecuteCommand(sql);
-                                    typeName = typeof(WCS_Station523).Name;
-                                }
-                            }
-                            else if (ps.PropertyType == typeof(ProtocolData<WCS_Station524>[]))
-                            {
-                                if (pack.Station524.Any())
-                                {
-                                    var value = pack.Station524.Select(x => x.Data).ToList();
-                                    var sql = db.Insertable(value).ToSqlString();
+                            //else if (ps.PropertyType == typeof(ProtocolData<WCS_SRM523>[]))
+                            //{
+                            //    if (pack.SRM523.Any())
+                            //    {
+                            //        var value = pack.SRM523.Select(x => new QuestDb_SRM523()
+                            //        {
+                            //            Alarm = $"{Convert.ToString(x.Data.Alarm1)},{Convert.ToString(x.Data.Alarm1)}",
+                            //            Code = x.Data.Code,
+                            //            Frame = x.Data.Frame.ToLocalTime()
+                            //        }).ToList();
+                            //        var sql = db.Insertable(value).ToSqlString();
+                            //        db.Ado.ExecuteCommand(GetString(sql));
+                            //        typeName = typeof(WCS_SRM523).Name;
+                            //    }
+                            //}
+                            //else if (ps.PropertyType == typeof(ProtocolData<WCS_Station520>[]))
+                            //{
+                            //    if (pack.Station520.Any())
+                            //    {
+                            //        var value = pack.Station520.Select(x => x.Data).ToList();
+                            //        var sql = db.Insertable(value).ToSqlString();
+                            //        db.Ado.ExecuteCommand(sql);
+                            //        typeName = typeof(WCS_Station520).Name;
+                            //    }
+                            //}
+                            //else if (ps.PropertyType == typeof(ProtocolData<WCS_Station521>[]))
+                            //{
+                            //    if (pack.Station521.Any())
+                            //    {
+                            //        var value = pack.Station521.Select(x => x.Data).ToList();
+                            //        var sql = db.Insertable(value).ToSqlString();
+                            //        db.Ado.ExecuteCommand(sql);
+                            //        typeName = typeof(WCS_Station521).Name;
+                            //    }
+                            //}
+                            //else if (ps.PropertyType == typeof(ProtocolData<WCS_Station523>[]))
+                            //{
+                            //    if (pack.Station523.Any())
+                            //    {
+                            //        var value = pack.Station523.Select(x => x.Data).ToList();
+                            //        var sql = db.Insertable(value).ToSqlString();
+                            //        db.Ado.ExecuteCommand(sql);
+                            //        typeName = typeof(WCS_Station523).Name;
+                            //    }
+                            //}
+                            //else if (ps.PropertyType == typeof(ProtocolData<WCS_Station524>[]))
+                            //{
+                            //    if (pack.Station524.Any())
+                            //    {
+                            //        var value = pack.Station524.Select(x => x.Data).ToList();
+                            //        var sql = db.Insertable(value).ToSqlString();
 
-                                    db.Ado.ExecuteCommand(sql);
-                                    typeName = typeof(WCS_Station524).Name;
-                                }
-                            }
-                            else if (ps.PropertyType == typeof(ProtocolData<WCS_Station525>[]))
-                            {
-                                if (pack.Station525.Any())
-                                {
-                                    var value = pack.Station525.Select(x => x.Data).ToList();
-                                    var sql = db.Insertable(value).ToSqlString();
-                                    db.Ado.ExecuteCommand(sql);
-                                    typeName = typeof(WCS_Station525).Name;
-                                }
-                            }
-                            else if (ps.PropertyType == typeof(ProtocolData<WCS_Station90>[]))
-                            {
-                                if (pack.Station90.Any())
-                                {
-                                    var value = pack.Station90.Select(x => x.Data).ToList();
-                                    var sql = db.Insertable(value).ToSqlString();
-                                    db.Ado.ExecuteCommand(sql);
-                                    typeName = typeof(WCS_Station90).Name;
-                                }
-                            }
-                            else if (ps.PropertyType == typeof(ProtocolData<WCS_Station91>[]))
-                            {
-                                if (pack.Station91.Any())
-                                {
-                                    var value = pack.Station91.Select(x => x.Data).ToList();
-                                    var sql = db.Insertable(value).ToSqlString();
-                                    db.Ado.ExecuteCommand(sql);
-                                    typeName = typeof(WCS_Station91).Name;
-                                }
-                            }
+                            //        db.Ado.ExecuteCommand(sql);
+                            //        typeName = typeof(WCS_Station524).Name;
+                            //    }
+                            //}
+                            //else if (ps.PropertyType == typeof(ProtocolData<WCS_Station525>[]))
+                            //{
+                            //    if (pack.Station525.Any())
+                            //    {
+                            //        var value = pack.Station525.Select(x => x.Data).ToList();
+                            //        var sql = db.Insertable(value).ToSqlString();
+                            //        db.Ado.ExecuteCommand(sql);
+                            //        typeName = typeof(WCS_Station525).Name;
+                            //    }
+                            //}
+                            //else if (ps.PropertyType == typeof(ProtocolData<WCS_Station90>[]))
+                            //{
+                            //    if (pack.Station90.Any())
+                            //    {
+                            //        var value = pack.Station90.Select(x => x.Data).ToList();
+                            //        var sql = db.Insertable(value).ToSqlString();
+                            //        db.Ado.ExecuteCommand(sql);
+                            //        typeName = typeof(WCS_Station90).Name;
+                            //    }
+                            //}
+                            //else if (ps.PropertyType == typeof(ProtocolData<WCS_Station91>[]))
+                            //{
+                            //    if (pack.Station91.Any())
+                            //    {
+                            //        var value = pack.Station91.Select(x => x.Data).ToList();
+                            //        var sql = db.Insertable(value).ToSqlString();
+                            //        db.Ado.ExecuteCommand(sql);
+                            //        typeName = typeof(WCS_Station91).Name;
+                            //    }
+                            //}
                             else if (ps.PropertyType == typeof(ProtocolData<WCS_Truss520>[]))
                             {
                                 if (pack.Truss520.Any())
@@ -308,41 +317,41 @@ namespace WCS.WorkEngineering.Systems
                                     typeName = typeof(WCS_Truss521).Name;
                                 }
                             }
-                            else if (ps.PropertyType == typeof(ProtocolData<WCS_Truss523>[]))
-                            {
-                                if (pack.Truss523.Any())
-                                {
-                                    var value = pack.Truss523.Select(x => new QuestDb_Truss523()
-                                    {
-                                        Alarm = Convert.ToString(x.Data.Alarm),
-                                        Code = x.Data.Code,
-                                        Frame = x.Data.Frame.ToLocalTime()
-                                    }).ToList();
-                                    var sql = db.Insertable(value).ToSqlString();
-                                    db.Ado.ExecuteCommand(sql);
-                                    typeName = typeof(WCS_Truss523).Name;
-                                }
-                            }
-                            else if (ps.PropertyType == typeof(ProtocolData<WCS_Truss530>[]))
-                            {
-                                if (pack.Truss530.Any())
-                                {
-                                    var value = pack.Truss530.Select(x => x.Data).ToList();
-                                    var sql = db.Insertable(value).ToSqlString();
-                                    db.Ado.ExecuteCommand(sql);
-                                    typeName = typeof(WCS_Truss530).Name;
-                                }
-                            }
-                            else if (ps.PropertyType == typeof(ProtocolData<WCS_Truss531>[]))
-                            {
-                                if (pack.Truss531.Any())
-                                {
-                                    var value = pack.Truss531.Select(x => x.Data).ToList();
-                                    var sql = db.Insertable(value).ToSqlString();
-                                    db.Ado.ExecuteCommand(sql);
-                                    typeName = typeof(WCS_Truss531).Name;
-                                }
-                            }
+                            //else if (ps.PropertyType == typeof(ProtocolData<WCS_Truss523>[]))
+                            //{
+                            //    if (pack.Truss523.Any())
+                            //    {
+                            //        var value = pack.Truss523.Select(x => new QuestDb_Truss523()
+                            //        {
+                            //            Alarm = Convert.ToString(x.Data.Alarm),
+                            //            Code = x.Data.Code,
+                            //            Frame = x.Data.Frame.ToLocalTime()
+                            //        }).ToList();
+                            //        var sql = db.Insertable(value).ToSqlString();
+                            //        db.Ado.ExecuteCommand(sql);
+                            //        typeName = typeof(WCS_Truss523).Name;
+                            //    }
+                            //}
+                            //else if (ps.PropertyType == typeof(ProtocolData<WCS_Truss530>[]))
+                            //{
+                            //    if (pack.Truss530.Any())
+                            //    {
+                            //        var value = pack.Truss530.Select(x => x.Data).ToList();
+                            //        var sql = db.Insertable(value).ToSqlString();
+                            //        db.Ado.ExecuteCommand(sql);
+                            //        typeName = typeof(WCS_Truss530).Name;
+                            //    }
+                            //}
+                            //else if (ps.PropertyType == typeof(ProtocolData<WCS_Truss531>[]))
+                            //{
+                            //    if (pack.Truss531.Any())
+                            //    {
+                            //        var value = pack.Truss531.Select(x => x.Data).ToList();
+                            //        var sql = db.Insertable(value).ToSqlString();
+                            //        db.Ado.ExecuteCommand(sql);
+                            //        typeName = typeof(WCS_Truss531).Name;
+                            //    }
+                            //}
                         }
                         catch (Exception e)
                         {
@@ -351,13 +360,19 @@ namespace WCS.WorkEngineering.Systems
                         finally
                         {
                             sw10.Stop();
-                            World.Log($"执行耗时:{typeName}:{sw10.ElapsedMilliseconds}");
+                            if (sw10.ElapsedMilliseconds > 1000)
+                            {
+                                World.Log($"执行耗时:{typeName}:{sw10.ElapsedMilliseconds}");
+                            }
                         }
                     });
                 });
 
                 sw.Stop();
-                World.Log($"数据处理耗时:{sw.ElapsedMilliseconds}");
+                if (sw.ElapsedMilliseconds > 1000)
+                {
+                    World.Log($"数据处理耗时:{sw.ElapsedMilliseconds}");
+                }
             }
             catch (Exception e)
             {

+ 6 - 12
WCS.WorkEngineering/WCS.WorkEngineering.csproj

@@ -1,34 +1,29 @@
 <Project Sdk="Microsoft.NET.Sdk">
-
   <PropertyGroup>
-    <TargetFramework>net7.0</TargetFramework>
+    <TargetFramework>net8.0</TargetFramework>
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
     <GenerateDocumentationFile>true</GenerateDocumentationFile>
   </PropertyGroup>
-
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
     <NoWarn>1701;1702;8602;8616;8618;8625;8600;8603;8714;1591</NoWarn>
   </PropertyGroup>
-
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
     <NoWarn>1701;1702;8602;8616;8618;8625;8600;8603;8714;1591</NoWarn>
   </PropertyGroup>
-
   <ItemGroup>
     <None Remove="Systems\puiaxxwa.5zv~" />
   </ItemGroup>
-
   <ItemGroup>
-    <PackageReference Include="MessagePack" Version="2.5.140" />
-    <PackageReference Include="RestSharp" Version="111.3.0" />
+    <PackageReference Include="DuckDB.NET.Data.Full" Version="1.1.0.1" />
+    <PackageReference Include="MessagePack" Version="2.5.172" />
+    <PackageReference Include="RestSharp" Version="112.0.0" />
+    <PackageReference Include="Rezero.Api" Version="1.7.12" />
   </ItemGroup>
-
   <ItemGroup>
     <ProjectReference Include="..\..\ZTGT-FJZX\ServiceCenter\ServiceCenter.csproj" />
     <ProjectReference Include="..\..\ZTGT-FJZX\YWGC\FJK\WCS.Entity.Protocol\WCS.Entity.Protocol.csproj" />
   </ItemGroup>
-
   <ItemGroup>
     <Reference Include="wms.dto">
       <HintPath>..\DLC\wms.dto.dll</HintPath>
@@ -40,5 +35,4 @@
       <HintPath>..\DLC\wms.sqlsugar.dll</HintPath>
     </Reference>
   </ItemGroup>
-
-</Project>
+</Project>