From 02a4fdd78cef9c7d2a26bfb9aa187179cf0baac3 Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com>
Date: 星期三, 25 二月 2026 17:44:26 +0800
Subject: [PATCH] 1
---
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_CW/CWTask/RequestInbound.cs | 121 ++++++++++++----------------------------
1 files changed, 36 insertions(+), 85 deletions(-)
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_CW/CWTask/RequestInbound.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_CW/CWTask/RequestInbound.cs
index 987db4f..2d4d0fc 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_CW/CWTask/RequestInbound.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_CW/CWTask/RequestInbound.cs
@@ -47,94 +47,46 @@
/// </summary>
private void HandleNewTask(CommonConveyorLine_CW conveyorLine, ConveyorLineTaskCommand_After command, string childDeviceCode)
{
- Dt_StationManager stationManager = _stationManagerRepository.QueryFirst(x => x.stationPLC == conveyorLine.DeviceCode && x.stationChildCode == childDeviceCode);
-
- if (stationManager == null)
+ try
{
- // Handle the case where stationManager is not found, if necessary
- Console.WriteLine($"鏈壘鍒皗childDeviceCode}绔欏彴");
- return;
- }
- // 鏍规嵁绔欑被鍨嬫墽琛岀浉搴旂殑鏂规硶
- switch (stationManager.stationType)
- {
- case 8:
- case 9:
- case 11:
- case 12:
- var task = _taskService.QueryExecutingTaskByBarcode(command.ConveyorLineBarcode, childDeviceCode);
- if (task != null)
- {
+ Dt_StationManager stationManager = _stationManagerRepository.QueryFirst(x => x.stationPLC == conveyorLine.DeviceCode && x.stationChildCode == childDeviceCode);
+
+ if (stationManager == null)
+ {
+ // Handle the case where stationManager is not found, if necessary
+ Console.WriteLine($"鏈壘鍒皗childDeviceCode}绔欏彴");
+ return;
+ }
+
+ // 鏍规嵁绔欑被鍨嬫墽琛岀浉搴旂殑鏂规硶
+ switch (stationManager.stationType)
+ {
+ case 8:
+ case 9:
+ case 11:
+ case 12:
+ var task = _taskService.QueryExecutingTaskByBarcode(command.ConveyorLineBarcode, childDeviceCode);
+ if (task != null)
+ {
+ ExecuteStationAction(stationManager, conveyorLine, command, childDeviceCode);
+ }
+ break;
+ case 1:
+ case 6:
+ case 10:
ExecuteStationAction(stationManager, conveyorLine, command, childDeviceCode);
- }
- break;
- case 1:
- case 6:
- case 10:
- ExecuteStationAction(stationManager, conveyorLine, command, childDeviceCode);
- break;
- //case 16:
- // ExecuteStationAction(stationManager, conveyorLine, command, childDeviceCode);
- // break;
+ break;
+ //case 16:
+ // ExecuteStationAction(stationManager, conveyorLine, command, childDeviceCode);
+ // break;
+ }
+
}
-
- #region
- //Dt_StationManager stationManager = _stationManagerRepository.QueryFirst(x => x.stationPLC == conveyorLine.DeviceCode && x.stationChildCode == childDeviceCode);
-
- //if (stationManager.stationType == 8)
- //{
- // var task = _taskService.QueryExecutingConveyorLineTask(command.ConveyorLineTaskNum, childDeviceCode);
- // if (task != null)
- // {
- // RequestInNextAddress(conveyorLine, command, childDeviceCode);
- // }
- //}
- //else if (stationManager.stationType == 9)
- //{
- // var task = _taskService.QueryExecutingConveyorLineTask(command.ConveyorLineTaskNum, childDeviceCode);
- // if (task != null)
- // {
- // ConveyorLineInFinish(conveyorLine, command, childDeviceCode);
- // }
- //}
- //else if (stationManager.stationType == 1)
- //{
- // if (stationManager.stationArea.Contains("GW"))
- // {
- // var taskGW = _taskRepository.QueryFirst(x => x.TargetAddress == childDeviceCode && x.TaskState == (int)TaskOutStatusEnum.OutFinish);
- // if (taskGW != null)
- // {
- // command.ConveyorLineBarcode = taskGW.PalletCode;
- // }
- // }
- // RequestWmsTask(conveyorLine, command, childDeviceCode);
- //}
- //else if (stationManager.stationType == 10)
- //{
- // var task = _taskService.QueryConveyorLineTask(conveyorLine.DeviceCode, childDeviceCode);
- // if (task != null)
- // {
- // RequestOutbound(conveyorLine, command, childDeviceCode);
- // }
- //}
- //else if (stationManager.stationType == 11)
- //{
- // var task = _taskService.QueryExecutingConveyorLineTask(command.ConveyorLineTaskNum, childDeviceCode);
- // if (task != null)
- // {
- // RequestOutNextAddress(conveyorLine, command, childDeviceCode);
- // }
- //}
- //else if (stationManager.stationType == 12)
- //{
- // var task = _taskService.QueryExecutingConveyorLineTask(command.ConveyorLineTaskNum, childDeviceCode);
- // if (task != null)
- // {
- // ConveyorLineOutFinish(conveyorLine, command, childDeviceCode);
- // }
- //}
- #endregion
+ catch (Exception ex)
+ {
+ WriteInfo("HandleNewTask", $"銆恵ex.Message}銆�");
+ }
}
private void ExecuteStationAction(Dt_StationManager stationManager, CommonConveyorLine_CW conveyorLine, ConveyorLineTaskCommand_After command, string childDeviceCode)
@@ -168,7 +120,6 @@
AbNormalStationBZTask(conveyorLine, command, childDeviceCode);
break;
case 1:
-
RequestWmsTask(conveyorLine, command, childDeviceCode, stationManager);
break;
}
--
Gitblit v1.9.3