Browse Source

升级项目到 .NET 8.0 并更新多个包版本

将 `PlcSiemens.csproj`、`ServiceCenter.csproj`、`WCS.Core.csproj`、`WCS.Service.csproj` 和 `WCS.WorkEngineering.csproj` 的目标框架从 `net7.0` 升级到 `net8.0`。
在 `PlcSiemens.csproj` 和 `WCS.Core.csproj` 中添加了 `<GeneratePackageOnBuild>True</GeneratePackageOnBuild>` 属性。
在 `ServiceCenter.csproj` 中更新了 `Microsoft.AspNetCore.Mvc.NewtonsoftJson` 包的版本,从 `7.0.15` 升级到 `8.0.8`,并更新了 `PlcSiemens` 包的版本,从 `1.0.1` 升级到 `1.0.2`,同时添加了 `<PrivateAssets>` 和 `<IncludeAssets>` 属性。
在 `WCS.Core.csproj` 中更新了 `FreeRedis` 包的版本,从 `1.2.13` 升级到 `1.3.2`。
在 `WCS.Service.csproj` 中更新了 `Microsoft.Extensions.Hosting.Systemd` 和 `Microsoft.Extensions.Hosting.WindowsServices` 包的版本,从 `7.0.0` 和 `7.0.1` 升级到 `8.0.0`。
在 `LogHub.cs` 中调整了 `using` 语句的顺序。
在 `WmsApi.cs` 中删除了一些方法和属性,并添加了一个新方法 `FindAvailableFlatStorageSlot`。
在 `WorkStart.cs` 中删除了一些调试代码。
在 `FullPalletRewindStorageSystem.cs` 中添加了一个新的类 `FullPalletRewindStorageSystem`。
林豪 左 10 months ago
parent
commit
6470419898

+ 3 - 6
PLC.Siemens/PlcSiemens.csproj

@@ -1,17 +1,14 @@
 <Project Sdk="Microsoft.NET.Sdk">
-
   <PropertyGroup>
-    <TargetFramework>net7.0</TargetFramework>
+    <TargetFramework>net8.0</TargetFramework>
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
+    <GeneratePackageOnBuild>True</GeneratePackageOnBuild>
   </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>
-
-</Project>
+</Project>

+ 1 - 1
ServiceCenter/Logs/LogHub.cs

@@ -1,9 +1,9 @@
 using Newtonsoft.Json;
-using PlcSiemens.Core.Extension;
 using ServiceCenter.Extensions;
 using ServiceCenter.Redis;
 using System.Collections.Concurrent;
 using System.Diagnostics;
+using PlcSiemens.Core.Extension;
 using WCS.Core;
 
 namespace ServiceCenter.Logs

+ 8 - 11
ServiceCenter/ServiceCenter.csproj

@@ -1,34 +1,31 @@
 <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;1712;8619;8625;0168;8061;8604</NoWarn>
   </PropertyGroup>
-
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
     <NoWarn>1701;1702;8602;8616;8618;8625;8600;8603;8714;1591;1712;8619;8625;0168;8061;8604</NoWarn>
   </PropertyGroup>
-  
   <ItemGroup>
-    <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.15" />
-    <PackageReference Include="PlcSiemens" Version="1.0.1" />
+    <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.8" />
+    <PackageReference Include="PlcSiemens" Version="1.0.2">
+      <PrivateAssets>all</PrivateAssets>
+      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+    </PackageReference>
     <PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.5.0" />
     <PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="6.5.0" />
   </ItemGroup>
-  
   <ItemGroup>
+    <ProjectReference Include="..\PLC.Siemens\PlcSiemens.csproj" />
     <ProjectReference Include="..\WCS.Core\WCS.Core.csproj" />
     <ProjectReference Include="..\WCS.Entity\WCS.Entity.csproj" />
   </ItemGroup>
-  
   <ItemGroup>
     <Folder Include="Attributes\" />
   </ItemGroup>
-
-</Project>
+</Project>

+ 4 - 8
WCS.Core/WCS.Core.csproj

@@ -1,21 +1,17 @@
 <Project Sdk="Microsoft.NET.Sdk">
-
   <PropertyGroup>
-    <TargetFramework>net7.0</TargetFramework>
+    <TargetFramework>net8.0</TargetFramework>
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
+    <GeneratePackageOnBuild>True</GeneratePackageOnBuild>
   </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>
-    <PackageReference Include="FreeRedis" Version="1.2.13" />
+    <PackageReference Include="FreeRedis" Version="1.3.2" />
   </ItemGroup>
-
-</Project>
+</Project>

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

@@ -1,35 +1,29 @@
 <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="MessagePack" Version="2.5.140" />
     <PackageReference Include="Microsoft.AspNetCore.Hosting" Version="2.1.1" />
-    <PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="7.0.0" />
-    <PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="7.0.1" />
+    <PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="8.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="8.0.0" />
   </ItemGroup>
-
   <ItemGroup>
     <ProjectReference Include="..\YWGC\FJK\WCS.WorkEngineering\WCS.WorkEngineering.csproj" />
   </ItemGroup>
-</Project>
+</Project>

+ 12 - 0
YWGC/FJK/WCS.WorkEngineering/Systems/重绕区/FullPalletRewindStorageSystem.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WCS.WorkEngineering.Systems.重绕区
+{
+    class FullPalletRewindStorageSystem
+    {
+    }
+}

+ 2 - 10
YWGC/FJK/WCS.WorkEngineering/WCS.WorkEngineering.csproj

@@ -1,33 +1,26 @@
 <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" />
   </ItemGroup>
-
   <ItemGroup>
     <ProjectReference Include="..\..\..\ServiceCenter\ServiceCenter.csproj" />
     <ProjectReference Include="..\WCS.Entity.Protocol\WCS.Entity.Protocol.csproj" />
   </ItemGroup>
-
   <ItemGroup>
     <Reference Include="wms.dto">
       <HintPath>..\DLC\wms.dto.dll</HintPath>
@@ -39,5 +32,4 @@
       <HintPath>..\DLC\wms.sqlsugar.dll</HintPath>
     </Reference>
   </ItemGroup>
-
-</Project>
+</Project>

+ 22 - 114
YWGC/FJK/WCS.WorkEngineering/WebApi/Controllers/WmsApi.cs

@@ -44,47 +44,6 @@ namespace WCS.WorkEngineering.WebApi.Controllers
             }
         }
 
-        /// <summary>
-        /// 仓库编号
-        /// </summary>
-        public static string wareHouseId = ServiceHub.WarehouseName;
-
-        /// <summary>
-        ///  上传重量等信息
-        /// </summary>
-        /// <param name="taskCode">任务号</param>
-        /// <param name="weight">rfid</param>
-        /// <returns></returns>
-        public static SRes WcsUploadInfo(int taskCode, decimal weight) => WcsUploadInfo(taskCode, weight, "");
-
-        /// <summary>
-        ///  上传重量等信息
-        /// </summary>
-        /// <param name="taskCode">任务号</param>
-        /// <param name="RFID">重量</param>
-        /// <returns></returns>
-        public static SRes WcsUploadInfo(int taskCode, string RFID) => WcsUploadInfo(taskCode, 0, RFID);
-
-        /// <summary>
-        ///   上传重量等信息
-        /// </summary>
-        /// <param name="taskCode">任务号</param>
-        /// <param name="weight">重量</param>
-        /// <param name="RFID">rfid</param>
-        /// <returns></returns>
-        /// <exception cref="KnownException"></exception>
-        public static SRes WcsUploadInfo(int taskCode, decimal weight, string RFID)
-        {
-            var res = APICaller.CallApi2<SRes>(WmsUrl + "/api/Hj/WcsUploadInfo", new WcsUploadInfoRequest
-            {
-                TaskCode = taskCode,
-                Weight = weight,
-                RFID = RFID
-            });
-
-            return res;
-        }
-
         /// <summary>
         ///  变更流向
         /// </summary>
@@ -128,7 +87,7 @@ namespace WCS.WorkEngineering.WebApi.Controllers
         }
 
         /// <summary>
-        ///  分配货位
+        ///  环型库分配货位
         /// </summary>
         /// <param name="wcsTaskNum">WMS任务ID</param>
         /// <param name="tunnel">货位</param>
@@ -148,6 +107,27 @@ namespace WCS.WorkEngineering.WebApi.Controllers
             return res;
         }
 
+        /// <summary>
+        ///  平库分配货位
+        /// </summary>
+        /// <param name="wcsTaskNum">WMS任务ID</param>
+        /// <param name="tunnel">货位</param>
+        /// <param name="device">设备号</param>
+        /// <param name="size"></param>
+        /// <returns></returns>
+        /// <exception cref="Exception"></exception>
+        public static SRes<FJApplyStockInLocResponse> FindAvailableFlatStorageSlot(int wcsTaskNum, string tunnel, string device, int size)
+        {
+            var res = APICaller.CallApi2<SRes<FJApplyStockInLocResponse>>(WmsUrl + "/api/FJ/RingApplyStockInLoc", new FJApplyStockInLocRequest
+            {
+                TaskNum = wcsTaskNum,
+                PickUpEquipmentNo = device,
+                Height = size
+            });
+
+            return res;
+        }
+
         /// <summary>
         ///  堆垛机出库任务执行完成
         /// </summary>
@@ -279,32 +259,6 @@ namespace WCS.WorkEngineering.WebApi.Controllers
             }
         }
 
-        /// <summary>
-        ///  WMS完成或取消任务执行
-        /// </summary>
-        /// <param name="sRes"></param>
-        /// <param name="id"></param>
-        /// <param name="type">99完成,106取消</param>
-        /// <returns></returns>
-        public static SRes? CarryTaskInfo(SRes<HandleTaskResponse> sRes, int id, int type)
-        {
-            try
-            {
-                var res = WmsApi.CarryTaskInfo(new List<int>() { id }, type);
-                return res;
-            }
-            catch (Exception ex)
-            {
-                sRes.ResDataList.Add(new HandleTaskResponse()
-                {
-                    IsSuccess = false,
-                    TaskNo = id,
-                    Message = $"WMS错误:{ex.Message}",
-                });
-                return null;
-            }
-        }
-
         /// <summary>
         ///  一楼扫码入库
         /// </summary>
@@ -328,52 +282,6 @@ namespace WCS.WorkEngineering.WebApi.Controllers
             return res;
         }
 
-        /// <summary>
-        ///  工字轮/芯股进入主线扫码
-        /// </summary>
-        /// <param name="reqDto"></param>
-        /// <param name="equNo"></param>
-        /// <returns></returns>
-        /// <exception cref="KnownException"></exception>
-        public static SRes EnteMainLine(List<string> reqDto, string equNo)
-        {
-            var res = APICaller.CallApi<SRes>(WmsUrl + "/api/FJ/EnteMainLine", new FJEnteMainLineRequest
-            {
-                IShapedWheelCodes = reqDto,
-                equNo = equNo
-            });
-            if (res.ResCode != ResponseStatusCodeEnum.Sucess)
-            {
-                throw new KnownException(res.ResMsg, LogLevelEnum.High);
-            }
-            return res;
-        }
-
-        /// <summary>
-        ///  生成空托盘组盘任务
-        /// </summary>
-        /// <param name="palletCode"></param>
-        /// <param name="loc"></param>
-        /// <returns></returns>
-        /// <exception cref="KnownException"></exception>
-        public static SRes GroupTask(string palletCode, string loc)
-        {
-            var res = APICaller.CallApi<SRes>(WmsUrl + "/api/FJ/GroupTask", new FJBuildEmptyPalletsStockRequest
-            {
-                PalletCode = palletCode,
-                PalletType = FJPalletType.Pallet09,
-                PalletNum = "1",
-                StartLoc = loc,
-                WareCode = loc.GetWareCode(),
-                BusType = TaskBusType.组盘_托盘
-            });
-            if (res.ResCode != ResponseStatusCodeEnum.Sucess)
-            {
-                throw new KnownException(res.ResMsg, LogLevelEnum.High);
-            }
-            return res;
-        }
-
         /// <summary>
         ///  正常结盘
         /// </summary>

+ 0 - 8
YWGC/FJK/WCS.WorkEngineering/WorkStart.cs

@@ -926,10 +926,6 @@ namespace WCS.WorkEngineering
 
                         db530 += 18;
                         db531 += 250;
-                        if (conv.Code == "1662")
-                        {
-                            var a = 0;
-                        }
                     }
                 }
 
@@ -1448,10 +1444,6 @@ namespace WCS.WorkEngineering
 
                         db530 += 18;
                         db531 += 250;
-                        if (conv.Code == "1662")
-                        {
-                            var a = 0;
-                        }
                     }
                 }