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/ConveyorLineJob_GW/GWTask/RequestInbound.cs | 31 ++++++++++++++-----------------
1 files changed, 14 insertions(+), 17 deletions(-)
diff --git a/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/GWTask/RequestInbound.cs b/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/GWTask/RequestInbound.cs
index 121566c..84f4a04 100644
--- a/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/GWTask/RequestInbound.cs
+++ b/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/GWTask/RequestInbound.cs
@@ -360,7 +360,19 @@
if (_taskRepository.QueryFirst(x => x.PalletCode == command.ConveyorLineBarcode) != null)
{
- WriteInfo(conveyorLine.DeviceName, "褰撳墠鎵樼洏瀛樺湪浠诲姟");
+ List<string> strings = new List<string>() { "3637", "3633", "3629" };
+
+ var taskExecuting = _taskRepository.QueryFirst(x => x.PalletCode == command.ConveyorLineBarcode && x.TaskState == (int)TaskOutStatusEnum.Line_OutExecuting && strings.Contains(x.TargetAddress));
+
+ if (taskExecuting != null)
+ {
+ taskExecuting.ExceptionMessage = "鏈帴鏀跺埌绾夸綋瀹屾垚淇″彿绯荤粺鍐呴儴鑷姩瀹屾垚";
+ _taskService.Delete(taskExecuting);
+ }
+
+ ConsoleHelper.WriteErrorLine($"褰撳墠鎵樼洏瀛樺湪浠诲姟锛氥�恵command.ConveyorLineBarcode}銆�");
+
+ WriteInfo(conveyorLine.DeviceName, $"褰撳墠鎵樼洏瀛樺湪浠诲姟{command.ConveyorLineBarcode}");
return;
}
@@ -371,15 +383,9 @@
var content = CreateAndSendTask(taskDTO);
if (content.Status)
{
- //var task = _taskService.QueryConveyorLineTask(conveyorLine.DeviceCode, childDeviceCode);
var task = _taskService.QueryConveyorLineTask(conveyorLine.DeviceCode, childDeviceCode, command.ConveyorLineBarcode);
if (task != null)
{
- //var taskCommand = MapTaskCommand(task, command);
- //conveyorLine.SendCommand(taskCommand, childDeviceCode);
- //conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode);
- //ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task);
-
conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTaskNum, (long)task.TaskNum, childDeviceCode);
conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, task.NextAddress, childDeviceCode);
conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineBarcode, task.PalletCode, childDeviceCode);
@@ -430,10 +436,6 @@
var Hastask = _taskService.QueryBarCodeConveyorLineTask(command.ConveyorLineBarcode, childDeviceCode);
if (Hastask != null)
{
- //ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(Hastask);
- //conveyorLine.SendCommand(taskCommand, childDeviceCode);
- //conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode);
-
conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTaskNum, (long)Hastask.TaskNum, childDeviceCode);
conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, Hastask.NextAddress, childDeviceCode);
conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineBarcode, Hastask.PalletCode, childDeviceCode);
@@ -447,11 +449,6 @@
var task = _taskService.QueryBarCodeConveyorLineTask(command.ConveyorLineBarcode, childDeviceCode);
if (task != null)
{
- //ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task);
- //conveyorLine.SendCommand(taskCommand, childDeviceCode);
- //conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode);
- //ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task);
-
conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTaskNum, (long)task.TaskNum, childDeviceCode);
conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, task.NextAddress, childDeviceCode);
conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineBarcode, task.PalletCode, childDeviceCode);
@@ -461,7 +458,7 @@
}
else
{
- if (content.Message != "璇锋眰杩囦簬棰戠箒锛岃绋嶅悗鍐嶈瘯" || content.Message != "鏃犳硶鑾峰彇鐩爣鍦板潃")
+ if (content.Message != "璇锋眰杩囦簬棰戠箒锛岃绋嶅悗鍐嶈瘯" && content.Message != "鏃犳硶鑾峰彇鐩爣鍦板潃")
{
WriteInfo(conveyorLine.DeviceName, content.Message);
conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, stationManager.stationNGChildCode, childDeviceCode);
--
Gitblit v1.9.3