CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_After/CommonConveyorLine_AfterJob.cs
@@ -38,6 +38,7 @@
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_QuartzJob;
using WIDESEAWCS_QuartzJob.DeviceBase;
using WIDESEAWCS_QuartzJob.DTO;
using WIDESEAWCS_QuartzJob.Service;
using WIDESEAWCS_SignalR;
@@ -182,16 +183,19 @@
        {
            if (stationInfo.stationType != 7) return;
            var taskNew = _taskRepository.QueryData(x => x.TargetAddress == stationInfo.stationChildCode && x.TaskType == (int)TaskOutboundTypeEnum.OutTray);
            var need = _needBarcodeRepository.QueryFirst(x => x.toArea == stationInfo.stationChildCode && x.productLine == stationInfo.productLine);
            var cache = command.Reserved5;
            if (taskNew.Count < need.cacheNum)   //不存在空框出库任务 则请求WMS出空库
            var taskNew = _taskRepository.QueryData(x => x.TaskType == (int)TaskOutboundTypeEnum.OutTray);
            //var need = _needBarcodeRepository.QueryFirst(x => x.toArea == stationInfo.stationChildCode && x.productLine == stationInfo.productLine);
            //var cache = command.Reserved5;
            //var proAddress = conveyorLine.DeviceProDTOs.Where(x => x.DeviceChildCode == stationInfo.stationChildCode).Where(x => x.DeviceProParamName == ConveyorLineDBName_After.Reserve5.ToString()).FirstOrDefault().DeviceProAddress;
            var cache = Convert.ToInt16(conveyorLine.ReadValue(ConveyorLineDBName_After.Reserve5, stationInfo.stationChildCode));
            ConsoleHelper.WriteColorLine($"已经有{taskNew.Count}个任务,可以放{cache}个空托盘", ConsoleColor.DarkCyan);
            if (taskNew.Count + 1 < cache)   //不存在空框出库任务 则请求WMS出空库
            {
                //ConsoleHelper.WriteWarningLine("请求空托盘");
                if (_taskService.RequestTask(command.ConveyorLineBarcode, stationInfo).Result.Status)
                {
                    need.inLineNum += 1;
                    _needBarcodeRepository.UpdateData(need);
                    //need.inLineNum += 1;
                    //_needBarcodeRepository.UpdateData(need);
                }
            }
        }