From 04b4e2ca4bbbc147036a0bf15ce0b8b1c45cc74b Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com>
Date: 星期六, 11 十月 2025 16:26:22 +0800
Subject: [PATCH] 新增设备状态上传与包装站台换型功能在CommonConveyorLine_BZJob.cs和CommonConveyorLine_GWJob.cs中新增对信号状态判断逻辑。 在 ConfigConst.cs`中新增常量 EqptRun,用于设备状态上传。新增 EqptRunDTO类,支持设备运行状态的数据传输。在 IAgingInOrOutInputService.cs中定义 Change方法接口,并在AgingInOrOutInputService.cs中实现设备型号修改逻辑。优化 Dt_TaskService.cs中的异常电芯处理、组盘信息获取、库存查询逻辑,并新增包装站台换型功能。 - 增强日志记录,便于问题排查。
---
CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs | 32 ++++++++++++++++++++++++++++++--
1 files changed, 30 insertions(+), 2 deletions(-)
diff --git a/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs b/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
index 65bf6f2..adcf4e2 100644
--- a/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
+++ b/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
@@ -113,7 +113,9 @@
//builder.AppendLine();
//ConsoleHelper.WriteColorLine(builder, ConsoleColor.Blue);
commonStackerCrane.LastTaskType = task.TaskType;
+
_taskService.UpdateTaskStatusToNext(task.TaskNum);
+
}
}
else
@@ -182,6 +184,22 @@
var task = _taskRepository.QueryFirst(x => x.TaskNum == e.TaskNum);
if (task == null) commonStackerCrane.SetValue(StackerCraneDBName.WorkType, 5);
+
+ if (commonStackerCrane.DeviceCode.Contains("CW") && task.TaskType == (int)TaskOutboundTypeEnum.InToOut)
+ {
+ var stationinfo = _stationManagerRepository.QueryFirst(x => x.stationPLC == "1006" && x.stationType == 10 && x.Roadway == commonStackerCrane.DeviceCode);
+
+ IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationinfo.stationPLC);
+ if (device != null)
+ {
+ CommonConveyorLine_GW conveyorLine = (CommonConveyorLine_GW)device;
+ conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, Convert.ToInt16(3292), stationinfo.stationChildCode);
+ Thread.Sleep(100);
+ conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTaskNum, 1000, stationinfo.stationChildCode);
+ }
+ WriteInfo(commonStackerCrane.DeviceName, $"銆愭墜鍔ㄥ嚭搴撹褰曘�戜换鍔″彿銆恵e.TaskNum}銆戞墭鐩樺彿銆恵task.PalletCode}銆�");
+ }
+
if (commonStackerCrane.DeviceCode.Contains("GW") && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
{
@@ -264,7 +282,6 @@
if (task != null && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
{
#region 闈欑疆鍑哄簱鍒ゆ柇鏄惁鑳芥墽琛屼换鍔�
- //if (task != null && task.Roadway.Contains("JZ") && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
if (task != null && task.Roadway.Contains("JZ") && task.TaskType==(int)TaskOutboundTypeEnum.Outbound)
{
// 鏌ヨ鏄惁瀛樺湪闈欑疆鍏ュ簱浠诲姟
@@ -555,7 +572,18 @@
}
else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
{
- if (task.Roadway.Contains("GW") || task.TaskType == (int)TaskOutboundTypeEnum.OutFireAlarm)
+ if (task.TaskType == (int)TaskOutboundTypeEnum.InToOut)
+ {
+ string[] endCodes = task.TargetAddress.Split("-");
+ stackerCraneTaskCommand.EndRow = Convert.ToInt16(endCodes[0]);
+ stackerCraneTaskCommand.EndColumn = Convert.ToInt16(endCodes[1]);
+ stackerCraneTaskCommand.EndLayer = Convert.ToInt16(endCodes[2]);
+ string[] sourceCodes = task.SourceAddress.Split("-");
+ stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[0]) % 2 != 0 ? (short)1 : (short)2;
+ stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[1]);
+ stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[2]);
+ }
+ else if (task.Roadway.Contains("GW") || task.TaskType == (int)TaskOutboundTypeEnum.OutFireAlarm)
{
string[] endCodes = task.NextAddress.Split("-");
stackerCraneTaskCommand.EndRow = Convert.ToInt16(endCodes[0]);
--
Gitblit v1.9.3