From bb66bf9372783cfb1af35a5384fdc69cc9c56a9f Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期二, 10 六月 2025 23:14:56 +0800
Subject: [PATCH] 1

---
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP仓/TSJConveyorLineJob_PP.cs |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP\344\273\223/TSJConveyorLineJob_PP.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP\344\273\223/TSJConveyorLineJob_PP.cs"
index d52dd9a..2a48f12 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP\344\273\223/TSJConveyorLineJob_PP.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP\344\273\223/TSJConveyorLineJob_PP.cs"
@@ -96,20 +96,23 @@
 
                         //}
                         #endregion
+                        //2016鍑哄簱绔欏彴浠诲姟瀹屾垚
                         if (item.StationType == StationTypeEnum.StationType_OnlyOutbound.ObjToInt())
                         {
                             if (conveyorLineSignalRead.STB)
                             {
                                 device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode);
+
+                                Thread.Sleep(500);
+                                device.SetValue(W_ConveyorLineDB.ACK, false, item.StationCode);
+                                _taskService.TaskCompleted(conveyorLineInfoRead.TaskNum);
                             }
-                            Thread.Sleep(500);
-                            device.SetValue(W_ConveyorLineDB.ACK, false, item.StationCode);
                         }
                         else if (item.StationType == StationTypeEnum.StationType_InboundAndOutbound.ObjToInt())
                         {
                             if (!conveyorLineSignalRead.STB && !conveyorLineSignalRead.ACK && conveyorLineStatus.Online && !conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !conveyorLineSignalWrite.STB && !conveyorLineSignalWrite.ACK)
                             {
-                                Dt_Task task = _taskRepository.QueryFirst(x => _taskService.TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == TaskStatusEnum.New.ObjToInt() && string.IsNullOrEmpty(x.TargetAddress) && !string.IsNullOrEmpty(x.NextAddress));
+                                Dt_Task task = _taskRepository.QueryFirst(x => _taskService.TaskOutboundTypes.Contains(x.TaskType) && x.DeviceCode == item.StackerCraneCode && x.TaskState == TaskStatusEnum.New.ObjToInt() && string.IsNullOrEmpty(x.TargetAddress) && !string.IsNullOrEmpty(x.NextAddress));
                                 if (task != null)
                                 {
                                     _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, nextAddress: item.StationCode, deviceCode: item.StackerCraneCode, targetAddress: item.StationCode);
@@ -118,7 +121,7 @@
 
                             if (conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !conveyorLineSignalWrite.ACK)//鍏ュ簱
                             {
-                                Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNum && x.NextAddress == item.StationCode);
+                                Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNum && x.DeviceCode == item.StationDeviceCode && x.NextAddress == item.StationCode);
                                 if (task != null && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)
                                 {
                                     Dt_StationManger? stationManger = stationMangers.FirstOrDefault(x => x.StationCode == item.StationCode);

--
Gitblit v1.9.3