huangxiaoqiang
2025-04-02 6654c7a847347732a58c9625a60667fd828b7db6
CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs
@@ -373,7 +373,8 @@
        /// <param name="childDeviceCode">子设备编号</param>
        public void ConveyorLineOutFinish(CommonConveyorLine_GW conveyorLine, ConveyorLineTaskCommand_After command, string childDeviceCode)
        {
            WriteInfo("出库", $"【{JsonConvert.SerializeObject(command.ConveyorLineTaskNum)}】,【{childDeviceCode}】托盘号:【{command.ConveyorLineBarcode}】");
            try
            {
            var task = _taskService.QueryExecutingConveyorLineTask(command.ConveyorLineTaskNum, childDeviceCode);
            if (task != null)
            {
@@ -393,41 +394,36 @@
                    taskCommand.ConveyorLineTargetAddress = Convert.ToInt16(stationManager.stationLocation);
                }
                if ((stationManager.stationPLC == "1007" && stationManager.stationArea == "Cache") || task.TaskType == (int)TaskOutboundTypeEnum.OutTray)  //更新在途数据
                    if (stationManager.stationPLC == "1007" && stationManager.stationArea == "Cache")  //更新在途数据
                {
                    dt_needBarcode needBarcode = _needBarcodeRepository.QueryFirst(x => x.productLine == stationManager.productLine && x.toArea == stationManager.stationChildCode);
                    if (needBarcode != null)
                    {
                            if (needBarcode.inLineNum == 0 || needBarcode.inLineNum > 0)
                            {
                                needBarcode.inLineNum = 0;
                            }
                            else
                            {
                        needBarcode.inLineNum--;
                            }
                        _needBarcodeRepository.UpdateData(needBarcode);
                    }
                }
                conveyorLine.SendCommand(taskCommand, childDeviceCode);
                    conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTaskNum, taskCommand.ConveyorLineTaskNum, childDeviceCode);
                    conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, taskCommand.ConveyorLineTargetAddress, childDeviceCode);
                    conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineBarcode, taskCommand.ConveyorLineBarcode, childDeviceCode);
                    //conveyorLine.SetValue(ConveyorLineDBName_After.InteractiveSignal, taskCommand.InteractiveSignal, childDeviceCode);
                conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode);
                
                content = _taskService.UpdateTaskStatusToNext(task);
            }
            //else
            //{
            //    Dt_StationManager stationManager = _stationManagerRepository.QueryFirst(x => x.stationPLC == conveyorLine.DeviceCode && x.stationChildCode == childDeviceCode && x.stationArea == "Cache");
            //    ////查询对应产线的在途数据
            //    //dt_needBarcode needBarcode = _needBarcodeRepository.QueryFirst(x => x.productLine == station.productLine);
            //    //needBarcode.inLineNum = _taskRepository.QueryData(x => x.TargetAddress == station.stationChildCode).Count();
            //    //若在途数量小于目标位置的缓存数量 则寻找对应常温库存中常温3工序的可出库数据 并建立出库任务
            //    //if (needBarcode.inLineNum <= needBarcode.cacheNum)
            //    //{
            //    //}
            //    //如果包装缓存站台存在 且有请求  则
            //    if (stationManager != null)
            //    {
            //        _taskService.RequestOutTaskToBZAsync(stationManager);
            //    }
            //}
            }
            catch (Exception ex)
            {
                WriteInfo($"{conveyorLine.DeviceName}输送线出库完成", $"异常信息【{JsonConvert.SerializeObject(ex.Message)}】,子节点【{childDeviceCode}】托盘号:【{command.ConveyorLineBarcode}】");
            }
        }
        /// <summary>