From 1b8cce65d4987e4b7e94d1b178abb3af0978a2d4 Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <1247017146@qq.com>
Date: 星期三, 26 三月 2025 09:24:26 +0800
Subject: [PATCH] 123123
---
CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/Task/RequestInbound.cs | 51 +++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 43 insertions(+), 8 deletions(-)
diff --git a/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/Task/RequestInbound.cs b/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/Task/RequestInbound.cs
index 8bd3eb5..807a30d 100644
--- a/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/Task/RequestInbound.cs
+++ b/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/Task/RequestInbound.cs
@@ -1,6 +1,8 @@
锘縰sing 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>
@@ -418,25 +419,40 @@
var serialNosError = resultTrayCellsStatus.SerialNos.Where(x => x.SerialNoStatus != 1 && x.SerialNoStatus != 4).ToList();
if (serialNosError.Count > 0)
{
- //绌烘閫昏緫
+ //NG娴佺▼
+ var platform = _platFormRepository.QueryFirst(x => x.ProductionLine == resultTrayCellsStatus.ProductionLine);
+ ConveyorLineTaskCommand conveyorLineTaskCommand = new ConveyorLineTaskCommand()
+ {
+ TaskNum = 1,
+ TargetAddress=Convert.ToInt32( platform.Capacity),
+ Barcode= resultTrayCellsStatus.TrayBarcode,
+ };
+ conveyorLine.SendCommand(conveyorLineTaskCommand, childDeviceCode);
+ ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true);
+ ConsoleHelper.WriteSuccessLine($"MOM鏁版嵁寮傚父,閫佽嚦浜屽皝銆恵resultTrayCellsStatus.ProductionLine}銆戝紓甯稿彛銆恵Convert.ToInt32(platform.Capacity)}銆�");
+ return;
+ }
+ if (resultTrayCellsStatus.SerialNos.Count == 0)
+ {
var Traycontent = await _taskService.RequestWMSTask(command.Barcode, childDeviceCode);
if (Traycontent.Status)
{
ConsoleHelper.WriteSuccessLine("鍖栨垚绌烘璇锋眰鍥炴祦闈欑疆");
ExecuteConveyorLineTask(conveyorLine, command, ProtocalDetailValue, childDeviceCode);
+ return;
}
}
else
{
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)
{
@@ -452,24 +468,34 @@
{
ConsoleHelper.WriteSuccessLine("鍖栨垚瀹炴墭璇锋眰鍏ラ潤缃�");
ExecuteConveyorLineTask(conveyorLine, command, ProtocalDetailValue, childDeviceCode);
+ return;
}
else
{
ConsoleHelper.WriteWarningLine("鍑哄簱浠诲姟鏈畬鎴�");
+ return;
}
}
else if (task != null && task.TaskState == (int)TaskOutStatusEnum.SC_OutExecuting)
{
ConsoleHelper.WriteWarningLine("宸插瓨鍦ㄩ潤缃嚭搴撲换鍔�");
+ return;
}
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
{
@@ -494,7 +520,7 @@
RoadWay = isTrue,
SourceAddress = childDeviceCode,
TargetAddress = isTrue,
- TaskState = (int)TaskOutStatusEnum.OutNew,
+ TaskState = (int)TaskOutStatusEnum.SC_OutFinish,
Id = 2,
TaskType = (int)TaskOutboundTypeEnum.InToOut,
ProductionLine = resultTrayCellsStatus.ProductionLine,
@@ -503,14 +529,23 @@
if (Taskcontent.Status)
{
ExecuteConveyorLineTask(conveyorLine, command, ProtocalDetailValue, childDeviceCode);
+ return;
}
else
+ {
WriteInfo(conveyorLine.DeviceName, Taskcontent.Message);
-
+ return;
+ }
}
else
{
+ var Task = await _taskService.RequestWMSTask(command.Barcode, childDeviceCode);
+ if (Task.Status)
+ {
+ ExecuteConveyorLineTask(conveyorLine, command, ProtocalDetailValue, childDeviceCode);
+ }
ConsoleHelper.WriteWarningLine("浜屽皝缂撳瓨浣嶅凡婊�");
+ return;
}
}
--
Gitblit v1.9.3