wanshenmean
2025-03-20 047e8be481b2b626a5dbcc613b5f2e77323239be
更新配置和任务处理逻辑

- 更新 `.gitignore`,添加调试和构建文件路径。
- 删除 `CodeChunks.db`、`.dtbcache.v2` 和 `.suo` 等二进制文件。
- 修改 `appsettings.json` 中的数据库连接字符串。
- 在 `TaskService.cs` 中添加对 `WIDESEAWCS_BasicInfoRepository` 的引用,并注释掉与 `stationType` 相关的逻辑。
- 在 `CommonConveyorLine_AfterJob.cs` 中注释掉与 `stationType` 为 6 的条件相关的代码。
- 在 `CommonConveyorLine_GWJob.cs` 中调整获取 `command` 的逻辑,处理特定 `childDeviceCode`。
- 在 `CommonStackerStationCraneJob.cs` 中增加对出库任务的站台占用检查。
已删除3个文件
已修改6个文件
186 ■■■■ 文件已修改
.gitignore 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CodeManagement/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.13.439.2385/CodeChunks.db 补丁 | 查看 | 原始文档 | blame | 历史
CodeManagement/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/DesignTimeBuild/.dtbcache.v2 补丁 | 查看 | 原始文档 | blame | 历史
CodeManagement/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/v17/.suo 补丁 | 查看 | 原始文档 | blame | 历史
CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs 66 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_After/CommonConveyorLine_AfterJob.cs 51 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerStationJob/CommonStackerStationCraneJob.cs 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.gitignore
@@ -2449,3 +2449,39 @@
CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/obj/Debug/net6.0/staticwebassets/msbuild.WIDESEA_WMSServer.Microsoft.AspNetCore.StaticWebAssetEndpoints.props
CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/obj/Debug/net6.0/staticwebassets/msbuild.WIDESEA_WMSServer.Microsoft.AspNetCore.StaticWebAssets.props
CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/obj/WIDESEA_WMSServer.csproj.nuget.g.targets
/CodeManagement/WCS/WIDESEAWCS_Server/.vs/ProjectEvaluation/wideseawcs_server.metadata.v9.bin
/CodeManagement/WCS/WIDESEAWCS_Server/.vs/ProjectEvaluation/wideseawcs_server.projects.v9.bin
/CodeManagement/WCS/WIDESEAWCS_Server/.vs/ProjectEvaluation/wideseawcs_server.strings.v9.bin
/CodeManagement/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/DesignTimeBuild/.dtbcache.v2
/CodeManagement/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/DesignTimeBuild/.dtbcache.v2
/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoRepository/obj/Debug/net6.0/WIDESEAWCS_BasicInfoRepository.csproj.BuildWithSkipAnalyzers
/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/obj/Debug/net6.0/WIDESEAWCS_BasicInfoService.csproj.BuildWithSkipAnalyzers
/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/obj/Debug/net6.0/WIDESEAWCS_DTO.csproj.BuildWithSkipAnalyzers
/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_IBasicInfoRepository/obj/Debug/net6.0/WIDESEAWCS_IBasicInfoRepository.csproj.BuildWithSkipAnalyzers
/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_IBasicInfoService/obj/Debug/net6.0/WIDESEAWCS_IBasicInfoService.csproj.BuildWithSkipAnalyzers
/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_ISystemRepository/obj/Debug/net6.0/WIDESEAWCS_ISystemRepository.csproj.BuildWithSkipAnalyzers
/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_ISystemServices/obj/Debug/net6.0/WIDESEAWCS_ISystemServices.csproj.BuildWithSkipAnalyzers
/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoRepository/obj/Debug/net6.0/WIDESEAWCS_ITaskInfoRepository.csproj.BuildWithSkipAnalyzers
/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/obj/Debug/net6.0/WIDESEAWCS_ITaskInfoService.csproj.BuildWithSkipAnalyzers
/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfo_HtyRepository/obj/Debug/net6.0/WIDESEAWCS_ITaskInfo_HtyRepository.csproj.BuildWithSkipAnalyzers
/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfo_HtyService/obj/Debug/net6.0/WIDESEAWCS_ITaskInfo_HtyService.csproj.BuildWithSkipAnalyzers
/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/obj/Debug/net6.0/WIDESEAWCS_Model.csproj.BuildWithSkipAnalyzers
/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_ProcessParameters/obj/Debug/net6.0/WIDESEAWCS_IProcessRepository.csproj.BuildWithSkipAnalyzers
/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_ProcessRepository/obj/Debug/net6.0/WIDESEAWCS_ProcessRepository.csproj.BuildWithSkipAnalyzers
/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/obj/Debug/net6.0/WIDESEAWCS_QuartzJob.csproj.BuildWithSkipAnalyzers
/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/bin/Debug/net6.0/Log_PLCReadWrite/分容11线入库输送线/Logs_20250319142110.txt
/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/bin/Debug/net6.0/Log_PLCReadWrite/高温入库输送线/Logs_20250320094927.txt
/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/obj/Debug/net6.0/ApiEndpoints.json
/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/obj/Debug/net6.0/EndpointInfo/WIDESEAWCS_Server_V1.json
/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/obj/Debug/net6.0/EndpointInfo/WIDESEAWCS_Server_V2.json
/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/obj/Debug/net6.0/WIDESEAWCS_Server.csproj.BuildWithSkipAnalyzers
/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/obj/WIDESEAWCS_Server.csproj.EntityFrameworkCore.targets
/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_SignalR/obj/Debug/net6.0/WIDESEAWCS_SignalR.csproj.BuildWithSkipAnalyzers
/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemRepository/obj/Debug/net6.0/WIDESEAWCS_SystemRepository.csproj.BuildWithSkipAnalyzers
/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_SystemServices/obj/Debug/net6.0/WIDESEAWCS_SystemServices.csproj.BuildWithSkipAnalyzers
/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoRepository/obj/Debug/net6.0/WIDESEAWCS_TaskInfoRepository.csproj.BuildWithSkipAnalyzers
/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/obj/Debug/net6.0/WIDESEAWCS_TaskInfoService.csproj.BuildWithSkipAnalyzers
/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfo_HtyRepository/obj/Debug/net6.0/WIDESEAWCS_TaskInfo_HtyRepository.csproj.BuildWithSkipAnalyzers
/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfo_HtyService/obj/Debug/net6.0/WIDESEAWCS_TaskInfo_HtyService.csproj.BuildWithSkipAnalyzers
*.log
*.BuildWithSkipAnalyzers
CodeManagement/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.13.439.2385/CodeChunks.db
Binary files differ
CodeManagement/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/DesignTimeBuild/.dtbcache.v2
Binary files differ
CodeManagement/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/v17/.suo
Binary files differ
CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json
@@ -11,7 +11,7 @@
  "ConnectionStringsEncryption": false,
  "MainDB": "DB_WIDESEA", //当前项目的主库,所对应的连接字符串的Enabled必须为true
  //连接字符串
  "ConnectionString": "Data Source=.;Initial Catalog=WIDESEA_WCSDB_BB3F;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
  "ConnectionString": "Data Source=.;Initial Catalog=WIDESEA_WCS3F09;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
  //跨域
  "Cors": {
    "PolicyName": "CorsIpAccess", //策略名称
CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs
@@ -2,6 +2,7 @@
using Mapster;
using Newtonsoft.Json;
using System.Diagnostics.CodeAnalysis;
using WIDESEAWCS_BasicInfoRepository;
using WIDESEAWCS_Common;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core;
@@ -227,22 +228,22 @@
                    return content.Error($"【{stationManager.stationChildCode}】已存在直接出库任务任务");
                }
                if (stationManager.stationType == 7)
                {
                    var result = await HandleStationType7(palletCode, stationManager);
                    if (result != null)
                    {
                        return result;
                    }
                }
                else if (stationManager.stationType == 6)
                {
                    var result = await HandleStationType6(palletCode, stationManager);
                    if (result != null)
                    {
                        return result;
                    }
                }
                //if (stationManager.stationType == 7)
                //{
                //    var result = await HandleStationType7(palletCode, stationManager);
                //    if (result != null)
                //    {
                //        return result;
                //    }
                //}
                //else if (stationManager.stationType == 6)
                //{
                //    var result = await HandleStationType6(palletCode, stationManager);
                //    if (result != null)
                //    {
                //        return result;
                //    }
                //}
                // 发起请求获取入库任务
                content = await RequestInTask(palletCode, stationManager);
@@ -279,38 +280,9 @@
        }
        // 处理 stationType 为 7 的情况
        private async Task<WebResponseContent> HandleStationType7(string palletCode, Dt_StationManager stationManager)
        private async Task<WebResponseContent> HandleStationType7(Dt_StationManager stationManager)
        {
            var station = await _stationManagerRepository.QueryFirstAsync(x => x.stationType == 6 && x.productLine == stationManager.productLine && x.stationArea == stationManager.stationArea);
            var runTask = await BaseDal.QueryFirstAsync(x => x.CurrentAddress == station.stationChildCode && x.TaskState == (int)TaskInStatusEnum.Line_InFinish && x.TaskType == (int)TaskInboundTypeEnum.InTray);
            if (runTask != null)
            {
                runTask.TargetAddress = stationManager.stationLocation;
                runTask.NextAddress = stationManager.stationChildCode;
                runTask.Grade = 3;
                runTask.TaskType = (int)TaskOutboundTypeEnum.InToOut;
                runTask.TaskState = (int)TaskOutStatusEnum.OutNew;
                var wmsIpAddrss = GetWmsIpAddress(SysConfigKeyConst.SetEmptyOutbyInToOutAsync);
                var result = await HttpHelper.PostAsync(wmsIpAddrss, new { palletCode = runTask.PalletCode, EquiCodeMOM = stationManager.stationEquipMOM, Roadways = stationManager.Roadway, area = stationManager.stationArea, Position = station.stationChildCode }.ToJsonString());
                var content = JsonConvert.DeserializeObject<WebResponseContent>(result);
                if (content.Status)
                {
                    await BaseDal.UpdateDataAsync(runTask);
                    ConsoleHelper.WriteSuccessLine($"【{runTask.PalletCode}直接出库至二封】");
                    return content.OK("成功");
                }
                else
                {
                    ConsoleHelper.WriteErrorLine(content.Message);
                }
            }
            else
            {
                ConsoleHelper.WriteErrorLine($"【{station.stationChildCode}】未找到空托盘入库任务");
            }
            var station = await _taskNeedBarcodeRepository.QueryFirstAsync(x => x.toArea == stationManager.stationChildCode && x.productLine == stationManager.productLine);
            return null;
        }
CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_After/CommonConveyorLine_AfterJob.cs
@@ -97,10 +97,10 @@
                                method.Invoke(this, new object[] { conveyorLine, command, station });
                            }
                        }
                        if (station.stationType == 6 && station.stationArea == "3")
                        {
                            await GetEmptyTrayAsync(station, conveyorLine, command);
                        }
                        //if (station.stationType == 6 && station.stationArea == "3")
                        //{
                        //    await GetEmptyTrayAsync(station, conveyorLine, command);
                        //}
                        #region 调用事件总线通知前端
@@ -181,8 +181,10 @@
        public void RequestEmptyOutbound(CommonConveyorLine_After conveyorLine, ConveyorLineTaskCommand_After command, Dt_StationManager stationInfo)
        {
            if (stationInfo.stationType != 7) return;
            var taskNew = _taskRepository.QueryFirst(x => x.Roadway == stationInfo.Roadway && x.TaskType == (int)TaskOutboundTypeEnum.OutTray);
            if (taskNew == null)   //不存在空框出库任务 则请求WMS出空库
            var taskNew = _taskRepository.QueryData(x => x.TargetAddress == stationInfo.stationChildCode && x.TaskType == (int)TaskOutboundTypeEnum.OutTray);
            var cache = command.Reserved5;
            if (taskNew.Count < cache)   //不存在空框出库任务 则请求WMS出空库
            {
                ConsoleHelper.WriteWarningLine("请求空托盘");
                if (_taskService.RequestTask(command.ConveyorLineBarcode, stationInfo).Result.Status)
@@ -194,43 +196,6 @@
                }
            }
        }
        /// <summary>
        /// 输送线请求入库
        /// </summary>
        /// <param name="conveyorLine">输送线实例对象</param>
        /// <param name="command">读取的请求信息</param>
        /// <param name="childDeviceCode">子设备编号</param>
        //public void RequestInbound(CommonConveyorLine_After conveyorLine, ConveyorLineTaskCommand_After command, string childDeviceCode)
        //{
        //    var stationInfo = _stationManagerService.GetStationInfoByChildCode(childDeviceCode);
        //    if (stationInfo != null)
        //    {
        //        //_taskService.r
        //    }
        //    var taskNew = _taskService.QueryCraneConveyorLineTask(command.ConveyorLineTaskNum.ObjToInt(), childDeviceCode);
        //    if (taskNew == null)
        //    {
        //        string barcode = command.ConveyorLineBarcode.TrimEnd();
        //        if (_taskService.RequestWMSTask(command.ConveyorLineBarcode, childDeviceCode).Result.Status)
        //        {
        //            Dt_Task task = _taskService.QueryConveyorLineTask(conveyorLine.DeviceCode, childDeviceCode);
        //            if (task != null)
        //            {
        //                ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task);
        //                //taskCommand.InteractiveSignal = command.InteractiveSignal;
        //                taskCommand.ResponState = 1;
        //                taskCommand.ConveyorLineTaskNum = task.TaskNum;
        //                taskCommand.ConveyorLineTargetAddress = Convert.ToInt16(task.NextAddress);
        //                conveyorLine.SendCommand(taskCommand, childDeviceCode);
        //                //ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true);
        //                _taskService.UpdateTaskStatusToNext(task);
        //            }
        //        }
        //    }
        //}
        private async Task GetEmptyTrayAsync(Dt_StationManager stationManager, CommonConveyorLine_After commonConveyor, ConveyorLineTaskCommand_After conveyorLine)
        {
CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs
@@ -40,11 +40,13 @@
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_QuartzJob;
using WIDESEAWCS_QuartzJob.DeviceBase;
using WIDESEAWCS_QuartzJob.DTO;
using WIDESEAWCS_QuartzJob.Repository;
using WIDESEAWCS_QuartzJob.Service;
using WIDESEAWCS_SignalR;
using WIDESEAWCS_Tasks.ConveyorLineJob;
using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database;
using ICacheService = WIDESEAWCS_Core.Caches.ICacheService;
using Platform = WIDESEAWCS_Model.Models.Platform;
@@ -117,7 +119,14 @@
                    List<string> childDeviceCodes = _routerService.QueryAllPositions(conveyorLine.DeviceCode);
                    foreach (string childDeviceCode in childDeviceCodes)
                    {
                        ConveyorLineTaskCommand_After command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand_After>(childDeviceCode);
                        ConveyorLineTaskCommand_After command = null;
                        if (childDeviceCode == "2236")
                        {
                            var stationPLC = _stationManagerRepository.QueryFirst(x => x.stationType == 1 && x.stationChildCode == childDeviceCode).stationPLC;
                            IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationPLC);
                            CommonConveyorLine_After conveyorLine1 = (CommonConveyorLine_After)device;
                            command = conveyorLine1.ReadCustomer<ConveyorLineTaskCommand_After>(childDeviceCode);
                        }
                        if (command == null) continue;
                        if (command.ConveyorLineBarcode.Trim().Contains("\0")) command.ConveyorLineBarcode = "";
CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerStationJob/CommonStackerStationCraneJob.cs
@@ -192,6 +192,25 @@
            if (task != null && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
            {
                if (task.TaskType == (int)TaskOutboundTypeEnum.Outbound)
                {
                    Dt_StationManager stationManager = _stationManagerRepository.QueryFirst(x => x.Roadway == task.Roadway && x.stationLocation == task.TargetAddress);
                    IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManager.stationPLC);
                    if (device != null)
                    {
                        CommonConveyorLine_After conveyorLine = (CommonConveyorLine_After)device;
                        string str = conveyorLine.DeviceProDTOs.Where(x => x.DeviceChildCode == stationManager.stationChildCode).Select(x => x.DeviceProAddress) + ".0";
                        conveyorLine.Communicator.Write(str, true);
                        return task;
                    }
                    else
                    {
                        _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"未找到出库站台【{task.NextAddress}】对应的通讯对象,无法判断出库站台是否被占用");
                        return null;
                    }
                }
                else
                {
                // 检查当前出库任务站台是否允许放货
                var occupiedStation = OutTaskStationIsOccupied(task);
                if (occupiedStation == null)
@@ -204,6 +223,7 @@
                {
                    return task;
                }
                }
                if (task == null)
                {