1
huangxiaoqiang
2025-03-26 fd07b13b6a8f6484cd370666d74776314911b300
CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/Task/RequestInbound.cs
@@ -1,6 +1,8 @@
using HslCommunication;
using Mapster;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using Microsoft.CodeAnalysis;
using Microsoft.VisualBasic;
using Newtonsoft.Json;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
@@ -400,7 +402,6 @@
            #endregion
        }
        /// <summary>
        /// 成化入静置
        /// </summary>
@@ -431,7 +432,7 @@
                ConsoleHelper.WriteSuccessLine($"MOM数据异常,送至二封【{resultTrayCellsStatus.ProductionLine}】异常口【{Convert.ToInt32(platform.Capacity)}】");
                return;
            }
            if (resultTrayCellsStatus.SerialNos.Count < 0)
            if (resultTrayCellsStatus.SerialNos.Count == 0)
            {
                var Traycontent = await _taskService.RequestWMSTask(command.Barcode, childDeviceCode);
                if (Traycontent.Status)
@@ -445,13 +446,13 @@
            {
                var configz = _sys_ConfigService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_IPAddress);
                var wmsbase = configz.Where(x => x.ConfigKey == SysConfigKeyConst.WMSIP_BASE).FirstOrDefault()?.ConfigValue;
                var address = configz.Where(x => x.ConfigKey == SysConfigKeyConst.GetJZStockInfo).FirstOrDefault()?.ConfigValue;
                var address = configz.Where(x => x.ConfigKey == SysConfigKeyConst.QueryStockInfoForRealTrayJZAsync).FirstOrDefault()?.ConfigValue;
                if (wmsbase == null || address == null)
                {
                    throw new InvalidOperationException("WMS IP 未配置");
                }
                var wmsIpAddrss = wmsbase + address;
                var result = await HttpHelper.PostAsync(wmsIpAddrss);
                var result = await HttpHelper.PostAsync(wmsIpAddrss, new { ProductLine = resultTrayCellsStatus.ProductionLine }.ToJsonString());
                var StockInfocontent = JsonConvert.DeserializeObject<WebResponseContent>(result);
                if (StockInfocontent.Status)
                {
@@ -482,12 +483,19 @@
                        }
                        else
                        {
                            ExecuteConveyorLineTask(conveyorLine, command, ProtocalDetailValue, childDeviceCode);
                            var Task = await _taskService.RequestWMSTask(command.Barcode, childDeviceCode);
                            if (Task.Status)
                            {
                                ExecuteConveyorLineTask(conveyorLine, command, ProtocalDetailValue, childDeviceCode);
                            }
                            return;
                        }
                    }
                    else
                    {
                        WriteInfo(conveyorLine.DeviceName, Taskcontent.Message);
                        return;
                    }
                }
                else
                {
@@ -531,6 +539,11 @@
                    }
                    else
                    {
                        var Task = await _taskService.RequestWMSTask(command.Barcode, childDeviceCode);
                        if (Task.Status)
                        {
                            ExecuteConveyorLineTask(conveyorLine, command, ProtocalDetailValue, childDeviceCode);
                        }
                        ConsoleHelper.WriteWarningLine("二封缓存位已满");
                        return;
                    }