From a5fec958ef86371826ed4eb947ea0ebd476cd0ed Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com>
Date: 星期五, 04 七月 2025 15:10:37 +0800
Subject: [PATCH] 修复方法声明并重构命令发送逻辑在 ITaskService.cs中QueryExecutingConveyorLineTask方法的声明末尾添加了分号。注释掉了多处 conveyorLine.SendCommand的调用,并替换为 SendCommand方法,确保在发送命令时设置了必要的值。 在 RequestInbound.cs中,进行了类似的重构,更新了任务状态。
---
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/GWTask/RequestInbound.cs | 10 ++++++++--
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs | 2 +-
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs | 41 ++++++++++++++++++++++++++++++++++-------
3 files changed, 43 insertions(+), 10 deletions(-)
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs
index 2b6feb9..2f5d80f 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs
@@ -157,7 +157,7 @@
/// <param name="taskNum">浠诲姟鍙�</param>
/// <param name="nextAddress">涓嬩竴鍦板潃</param>
/// <returns></returns>
- Dt_Task QueryExecutingConveyorLineTask(string nextAddress, string Barcode)
+ Dt_Task QueryExecutingConveyorLineTask(string nextAddress, string Barcode);
/// <summary>
/// 鏍规嵁鎵樼洏鍙枫�佷笅涓�鍦板潃鏌ヨ杈撻�佺嚎鎵ц涓殑浠诲姟
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs
index b4a25b1..b6b2846 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs
@@ -25,6 +25,7 @@
using Newtonsoft.Json;
using Quartz;
using SqlSugar;
+using System.ComponentModel.Design;
using System.Reflection;
using WIDESEAWCS_BasicInfoRepository;
using WIDESEAWCS_Common;
@@ -217,7 +218,10 @@
return;
}
ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task);
- conveyorLine.SendCommand(taskCommand, childDeviceCode);
+ //conveyorLine.SendCommand(taskCommand, childDeviceCode);
+
+ SendCommand(taskCommand, conveyorLine, childDeviceCode);
+
conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, Convert.ToInt16(1), childDeviceCode);
_taskService.UpdateTaskStatusToNext(task);
}
@@ -249,7 +253,10 @@
if (newTask != null)
{
ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(newTask);
- conveyorLine.SendCommand(taskCommand, childDeviceCode);
+ //conveyorLine.SendCommand(taskCommand, childDeviceCode);
+
+ SendCommand(taskCommand, conveyorLine, childDeviceCode);
+
conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, Convert.ToInt16(1), childDeviceCode);
_taskService.UpdateData(newTask);
}
@@ -292,7 +299,10 @@
if (task != null)
{
ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task);
- conveyorLine.SendCommand(taskCommand, childDeviceCode);
+ //conveyorLine.SendCommand(taskCommand, childDeviceCode);
+
+ SendCommand(taskCommand, conveyorLine, childDeviceCode);
+
conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, Convert.ToInt16(1), childDeviceCode);
_taskService.UpdateTaskStatusToNext(task);
@@ -346,7 +356,10 @@
if (newTask != null)
{
ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(newTask);
- conveyorLine.SendCommand(taskCommand, childDeviceCode);
+ //conveyorLine.SendCommand(taskCommand, childDeviceCode);
+
+ SendCommand(taskCommand, conveyorLine, childDeviceCode);
+
conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, Convert.ToInt16(1), childDeviceCode);
_taskService.UpdateData(newTask);
}
@@ -355,7 +368,10 @@
{
ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task);
taskCommand.ConveyorLineTargetAddress = Convert.ToInt16(stationManager.stationNGChildCode);
- conveyorLine.SendCommand(taskCommand, childDeviceCode);
+ //conveyorLine.SendCommand(taskCommand, childDeviceCode);
+
+ SendCommand(taskCommand, conveyorLine, childDeviceCode);
+
conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, Convert.ToInt16(1), childDeviceCode);
_taskService.UpdateTaskStatusToNext(task);
}
@@ -404,7 +420,8 @@
}
}
- conveyorLine.SendCommand(taskCommand, childDeviceCode);
+ //conveyorLine.SendCommand(taskCommand, childDeviceCode);
+ SendCommand(taskCommand, conveyorLine, childDeviceCode);
conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, Convert.ToInt16(1), childDeviceCode);
content = _taskService.UpdateTaskStatusToNext(task);
}
@@ -437,7 +454,8 @@
}
}
- conveyorLine.SendCommand(taskCommand, childDeviceCode);
+ //conveyorLine.SendCommand(taskCommand, childDeviceCode);
+ SendCommand(taskCommand, conveyorLine, childDeviceCode);
conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, Convert.ToInt16(1), childDeviceCode);
taskNext.ExceptionMessage = log;
@@ -524,6 +542,15 @@
}
return content;
}
+
+ public void SendCommand(ConveyorLineTaskCommand_After taskCommand, CommonConveyorLine_GW conveyorLine, string childDeviceCode)
+ {
+ conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, taskCommand.ConveyorLineTargetAddress, childDeviceCode);
+ Thread.Sleep(100);
+ conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineBarcode, taskCommand.ConveyorLineBarcode, childDeviceCode);
+ Thread.Sleep(100);
+ conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTaskNum, taskCommand.ConveyorLineTaskNum, childDeviceCode);
+ }
}
}
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/GWTask/RequestInbound.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/GWTask/RequestInbound.cs
index 8f0f5d2..101939f 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/GWTask/RequestInbound.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/GWTask/RequestInbound.cs
@@ -267,7 +267,10 @@
if (task != null)
{
var taskCommand = MapTaskCommand(task, command);
- conveyorLine.SendCommand(taskCommand, childDeviceCode);
+
+ //conveyorLine.SendCommand(taskCommand, childDeviceCode);
+ SendCommand(taskCommand, conveyorLine, childDeviceCode);
+
_taskService.UpdateTaskStatusToNext(task);
}
}
@@ -324,7 +327,10 @@
return;
}
ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task);
- conveyorLine.SendCommand(taskCommand, childDeviceCode);
+ //conveyorLine.SendCommand(taskCommand, childDeviceCode);
+
+ SendCommand(taskCommand, conveyorLine, childDeviceCode);
+
conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, Convert.ToInt16(1), childDeviceCode);
_taskService.UpdateTaskStatusToNext(task);
--
Gitblit v1.9.3