From 4c216caadeb29a797aba3fc1548b7c8c68ed27ec Mon Sep 17 00:00:00 2001
From: 刘磊 <1161824510@qq.com>
Date: 星期六, 21 十二月 2024 09:36:59 +0800
Subject: [PATCH] 合并
---
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs | 52 +++++++++++++++++++++++++++++++++-------------------
1 files changed, 33 insertions(+), 19 deletions(-)
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs
index bc4f8f6..a64d5e3 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs
@@ -108,6 +108,27 @@
ConveyorLineTaskCommandWrite commandWrite = conveyorLine.ReadCustomer<ConveyorLineTaskCommandWrite>(childDeviceCode, "DeviceCommand");
if (command != null && commandWrite != null)
{
+
+ #region 璋冪敤浜嬩欢鎬荤嚎閫氱煡鍓嶇
+
+ var tokenInfos = _cacheService.Get<List<UserInfo>>("Cache_UserToken");
+ if (tokenInfos == null || !tokenInfos.Any())
+ {
+ //throw new Exception(conveyorLine.DeviceName + "缂撳瓨涓湭鎵惧埌Token缂撳瓨");
+ return;
+ }
+ var userTokenIds = tokenInfos?.Select(x => x.Token_ID).ToList();
+ var userIds = tokenInfos?.Select(x => x.UserId).ToList();
+
+ object obj = new
+ {
+ command,
+ commandWrite
+ };
+ _noticeService.LineData(userIds?.FirstOrDefault(), userTokenIds, new { conveyorLine.DeviceName, childDeviceCode, data = obj });
+
+ #endregion 璋冪敤浜嬩欢鎬荤嚎閫氱煡鍓嶇
+
var structs = BitConverter.GetBytes(commandWrite.WriteInteractiveSignal).Reverse().ToArray().ToBoolArray();
List<DeviceProtocolDetailDTO>? deviceProtocolDetails = conveyorLine.DeviceProtocolDetailDTOs.Where(x => x.DeviceProParamName == nameof(ConveyorLineTaskCommand.InteractiveSignal)).ToList();
@@ -190,25 +211,6 @@
}
}
- #region 璋冪敤浜嬩欢鎬荤嚎閫氱煡鍓嶇
-
- var tokenInfos = _cacheService.Get<List<UserInfo>>("Cache_UserToken");
- if (tokenInfos == null || !tokenInfos.Any())
- {
- //throw new Exception(conveyorLine.DeviceName + "缂撳瓨涓湭鎵惧埌Token缂撳瓨");
- return;
- }
- var userTokenIds = tokenInfos?.Select(x => x.Token_ID).ToList();
- var userIds = tokenInfos?.Select(x => x.UserId).ToList();
-
- object obj = new
- {
- command,
- commandWrite
- };
- _noticeService.LineData(userIds?.FirstOrDefault(), userTokenIds, new { conveyorLine.DeviceName, childDeviceCode, data = obj });
-
- #endregion 璋冪敤浜嬩欢鎬荤嚎閫氱煡鍓嶇
}
}
@@ -234,6 +236,18 @@
{
HandleTaskOut(conveyorLine, command, childDeviceCode, ProtocalDetailValue, task);
}
+ else
+ {
+ var next = task.NextAddress;
+ var taskCommand = MapTaskCommand(task, command);
+ task.NextAddress = next;
+ conveyorLine.SendCommand(taskCommand, childDeviceCode);
+
+ ConsoleHelper.WriteWarningLine($"銆恵conveyorLine._deviceName}銆戜换鍔″彿锛氥�恵command.TaskNum}銆�,鎵樼洏鏉$爜锛氥�恵command.Barcode}銆戝凡鍒拌揪銆恵childDeviceCode}銆戣姹傛壂鐮佸叆搴�,涓嬩竴鐩爣鍦板潃銆恵taskCommand.TargetAddress}銆�");
+
+ ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true);
+ _taskService.UpdateTaskStatusToNext(task);
+ }
}
else
{
--
Gitblit v1.9.3