1
huangxiaoqiang
2025-03-27 2cc749ec598c39f9172f9b989979f6218ec256b1
CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs
@@ -19,6 +19,7 @@
#endregion << 版 本 注 释 >>
using Autofac.Core;
using AutoMapper;
using HslCommunication;
using Microsoft.CodeAnalysis;
@@ -40,11 +41,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;
@@ -118,7 +121,6 @@
                    foreach (string childDeviceCode in childDeviceCodes)
                    {
                        ConveyorLineTaskCommand_After command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand_After>(childDeviceCode);
                        if (command == null) continue;
                        if (command.ConveyorLineBarcode.Trim().Contains("\0")) command.ConveyorLineBarcode = "";
@@ -132,7 +134,7 @@
                            }
                        }
                        if (childDeviceCode == "1670"||childDeviceCode=="1666"||childDeviceCode=="1548"||childDeviceCode=="1448")
                        if (childDeviceCode == "3464" || childDeviceCode == "3460" || childDeviceCode == "3456" )
                        {
                            Platform platform = _platFormRepository.QueryFirst(x => x.PLCCode == conveyorLine.DeviceCode && x.PlatCode == childDeviceCode && x.Status == "Active");
                            if (platform != null)
@@ -298,10 +300,10 @@
                //ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true);
                _taskService.UpdateTaskStatusToNext(task);
                if (task.TaskType == (int)TaskOutboundTypeEnum.OutTray)
                {
                    _taskService.UpdateTaskStatusToNext(task);
                }
                //if (task.TaskType == (int)TaskOutboundTypeEnum.OutTray)
                //{
                //    _taskService.UpdateTaskStatusToNext(task);
                //}
            }
        }
@@ -390,7 +392,7 @@
                    taskCommand.ConveyorLineTargetAddress = Convert.ToInt16(stationManager.stationLocation);
                }
                if (stationManager.stationPLC == "1018" && stationManager.stationArea == "Cache")  //更新在途数据
                if ((stationManager.stationPLC == "1007" && stationManager.stationArea == "Cache") || task.TaskType == (int)TaskOutboundTypeEnum.OutTray)  //更新在途数据
                {
                    dt_needBarcode needBarcode = _needBarcodeRepository.QueryFirst(x => x.productLine == stationManager.productLine && x.toArea == stationManager.stationChildCode);
@@ -449,10 +451,11 @@
        /// <param name="command">读取的请求信息</param>
        /// <param name="childDeviceCode">子设备编号</param>
        /// <param name="index">线体当前bool读取偏移地址</param>
        public async void EmptyTrayReturn(CommonConveyorLine_GW conveyorLine, ConveyorLineTaskCommand_After command, string childDeviceCode, int index, WIDESEAWCS_Model.Models.Platform platform)
        public async void EmptyTrayReturn(CommonConveyorLine_GW conveyorLine, ConveyorLineTaskCommand_After command, string childDeviceCode, int index, Platform platform)
        {
            try
            {
                WriteInfo("出库", $"【{JsonConvert.SerializeObject(platform)}】");
                TaskOutboundTypeEnum taskOutboundTypeEnum;
                if (platform.PlatformType.Contains("OutTray"))
                    taskOutboundTypeEnum = TaskOutboundTypeEnum.OutTray;
@@ -501,7 +504,7 @@
                    return;
                taskDTO = JsonConvert.DeserializeObject<WMSTaskDTO>(content.Data.ToString());
                WriteInfo("出库", $"【{JsonConvert.SerializeObject(taskDTO)}】");
                #endregion 调用WMS获取出库任务
                CreateAndSendTask(taskDTO);