From e5316b19ae5f33d29d6e9410e894caed30eebf29 Mon Sep 17 00:00:00 2001
From: wankeda <Administrator@DESKTOP-HAU3ST3>
Date: 星期二, 18 二月 2025 09:11:51 +0800
Subject: [PATCH] PP仓输送线,堆垛机交互
---
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/板材仓/ConveyorLineJob_BC.cs | 38 ++++++++++++++++++++++++++++++--------
1 files changed, 30 insertions(+), 8 deletions(-)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/ConveyorLineJob_BC.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/ConveyorLineJob_BC.cs"
index 9c98f0c..969d73c 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/ConveyorLineJob_BC.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/ConveyorLineJob_BC.cs"
@@ -104,7 +104,7 @@
{
#region 鐢熸垚浠诲姟鍚庣粰杈撻�佺嚎鍚姩淇″彿
Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) /*&& x.DeviceCode == item.StationDeviceCode*/ && (x.TaskState == TaskStatusEnum.New.ObjToInt()) && x.WarehouseId == warehouseDevice.WarehouseId);
- if (task != null && conveyorLineInfoWrite.Spare2 == 0)
+ if (task != null && conveyorLineInfoWrite.Spare2 == 0 && conveyorLineStatus.Goods)
{
List<string> stations = _routerExtension.GetEndPoint(item.StationCode, TaskTypeEnum.Inbound.ObjToInt()).Select(x => x.NextPosi).ToList();
WebResponseContent responseContent = _taskService.RequestWMSAssignRoadway(stations, task.TaskNum, conveyorLineInfoRead.Spare2);
@@ -112,6 +112,13 @@
{
device.SetValue(W_ConveyorLineDB.Spare2, 1, item.StationCode);
_taskService.UpdateTask(task, TaskStatusEnum.Line_Execute, deviceCode: item.StationDeviceCode, roadwayNo: responseContent.Data.ToString() ?? "");
+ }
+ }
+ else
+ {
+ if (conveyorLineInfoWrite.Spare2 != 0)
+ {
+ WriteDebug(device.DeviceName, $"鍚姩淇″彿宸插啓鍏�");
}
}
#endregion
@@ -165,6 +172,7 @@
}
else
{
+ //task.NextAddress鍙兘鏄痳outer.NextPosi
device.SetValue(W_ConveyorLineDB.EndPos, task.NextAddress, item.StationCode);
}
device.SetValue(W_ConveyorLineDB.TaskNum, task.TaskNum, item.StationCode);
@@ -172,6 +180,10 @@
device.SetValue(W_ConveyorLineDB.Spare1, ConveyorWorkTypeEnum.Outbound.ObjToInt(), item.StationCode);
device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode);
_taskService.UpdateTask(task, taskState, currentAddress: currentAddress, nextAddress: nextAddress, targetAddress: targetAddress, deviceCode: deviceCode);
+ }
+ else
+ {
+ WriteInfo(device.DeviceName, $"鏈壘鍒版墭鐩榹conveyorLineInfoRead.Barcode}瀵瑰簲鐨勪换鍔′俊鎭�");
}
#endregion
}
@@ -185,11 +197,17 @@
WebResponseContent responseContent = _taskService.RequestWMSAssignRoadway(stations, task.TaskNum, conveyorLineInfoRead.Spare2);
if (responseContent.Status)
{
+ //string currentAddress = task.CurrentAddress;
+ //string nextAddress = task.NextAddress;
+ //string targetAddress = task.TargetAddress;
+ string roadwayNo = task.Roadway;
+
string currentAddress = task.CurrentAddress;
string nextAddress = task.NextAddress;
string targetAddress = task.TargetAddress;
+ string deviceCode = task.DeviceCode;
TaskStatusEnum taskState = TaskStatusEnum.Line_Executing;
- List<Dt_Router> routers = _routerService.QueryNextRoutes(item.StationCode, task.Roadway, task.TaskType);
+ List<Dt_Router> routers = _routerService.QueryNextRoutes(item.StationCode, responseContent.Data.ToString(), task.TaskType);
Dt_Router? router = routers.FirstOrDefault();
if (routers == null || routers.Count == 0 || router == null)
{
@@ -204,13 +222,15 @@
if (router.IsEnd)
{
- string? targetLoca = _taskService.RequestAssignLocationByHeight(task.TaskNum, task.Roadway, conveyorLineInfoRead.Spare2);
+ string? targetLoca = _taskService.RequestAssignLocationByHeight(task.TaskNum, responseContent.Data.ToString(), conveyorLineInfoRead.Spare2);
if (!string.IsNullOrEmpty(targetLoca))
{
currentAddress = item.StackerCraneStationCode;
- nextAddress = targetAddress;
- taskState = TaskStatusEnum.SC_Execute;
targetAddress = targetLoca;
+ nextAddress = targetLoca;
+ taskState = TaskStatusEnum.SC_Execute;
+ deviceCode = item.StackerCraneCode;
+ roadwayNo = responseContent.Data.ToString();
device.SetValue(W_ConveyorLineDB.EndPos, task.CurrentAddress, item.StationCode);
}
else
@@ -221,16 +241,18 @@
}
else
{
+ //task.NextAddress鍙兘鏄痳outer.NextPosi
device.SetValue(W_ConveyorLineDB.EndPos, task.NextAddress, item.StationCode);
}
device.SetValue(W_ConveyorLineDB.TaskNum, task.TaskNum, item.StationCode);
device.SetValue(W_ConveyorLineDB.StartPos, task.CurrentAddress, item.StationCode);
device.SetValue(W_ConveyorLineDB.Spare1, ConveyorWorkTypeEnum.Outbound.ObjToInt(), item.StationCode);
device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode);
- _taskService.UpdateTask(task, taskState, currentAddress: currentAddress, nextAddress: nextAddress, targetAddress: targetAddress);
+ _taskService.UpdateTask(task, taskState, currentAddress: currentAddress, nextAddress: nextAddress, targetAddress: targetAddress, deviceCode: deviceCode, roadwayNo: roadwayNo);
}
- #endregion
+
}
+ #endregion
}
}
else if (!conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && conveyorLineSignalWrite.ACK)
@@ -250,7 +272,6 @@
device.SetValue(W_ConveyorLineDB.Spare1, ConveyorWorkTypeEnum.Outbound.ObjToInt(), item.StationCode);
device.SetValue(W_ConveyorLineDB.STB, true, item.StationCode);
}
- //else
//{
// task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) && string.IsNullOrEmpty(x.DeviceCode) && x.TaskState == TaskStatusEnum.New.ObjToInt() && x.WarehouseId == warehouseDevice.WarehouseId);
// if (task != null)
@@ -262,6 +283,7 @@
// }
// }
//}
+ //else
}
else if (!conveyorLineSignalRead.STB && conveyorLineSignalRead.ACK && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && conveyorLineSignalWrite.STB && !conveyorLineSignalWrite.ACK)
{
--
Gitblit v1.9.3