From 88676143aeceaeec3bd108f9cd609c4f3470ba96 Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期三, 30 七月 2025 15:07:32 +0800
Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/MeiRuiAn/HuaiAn

---
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/辅料仓/ConveyorLineJob_FL.cs |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\350\276\205\346\226\231\344\273\223/ConveyorLineJob_FL.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\350\276\205\346\226\231\344\273\223/ConveyorLineJob_FL.cs"
index 4e0c629..d67fe80 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\350\276\205\346\226\231\344\273\223/ConveyorLineJob_FL.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\350\276\205\346\226\231\344\273\223/ConveyorLineJob_FL.cs"
@@ -75,15 +75,28 @@
                         {
                             R_ConveyorLineFLInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_ConveyorLineFLInfo>(deviceProRead.DeviceProAddress);
                             bool conveyArrivaled = device.GetValue<R_ConveyorLineFLDB, bool>(R_ConveyorLineFLDB.ConveyArrivaled, item.StationCode);
-                            if (conveyArrivaled)
+                            //杈撻�佺嚎鍙栨枡鍙e埌浣嶆洿鏂颁换鍔$姸鎬�
+                            if (conveyorLineInfoRead!=null && conveyArrivaled)
                             {
-                                Dt_Task newTask = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNum.ObjToInt() && x.PalletCode == conveyorLineInfoRead.Barcode && x.TaskState == TaskStatusEnum.New.ObjToInt() && x.DeviceCode == item.StackerCraneCode && !string.IsNullOrEmpty(x.DeviceCode));
-                                if (newTask != null)
+                                Dt_Task LineTask = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNum.ObjToInt() && x.PalletCode == conveyorLineInfoRead.Barcode && x.TaskState == TaskStatusEnum.Line_Executing.ObjToInt() && x.DeviceCode == item.StackerCraneCode);
+                                if (LineTask != null)
                                 {
-                                    _taskService.UpdateTask(newTask, TaskStatusEnum.AGV_Execute);
+                                    _taskService.UpdateTask(LineTask, TaskStatusEnum.AGV_Execute);
                                 }
                                 WriteError(item.StationName, $"鍏ュ簱鍒颁綅淇″彿锛屾墭鐩樺彿{conveyorLineInfoRead.Barcode},浠诲姟鍙�:{conveyorLineInfoRead.TaskNum}");
                             }
+
+                            //鍙戦�佽緭閫佺嚎浠诲姟
+                            Dt_Task? newTask = _taskRepository.QueryData(x => x.TaskState == TaskStatusEnum.New.ObjToInt() && x.DeviceCode == item.StackerCraneCode && x.TaskType>=TaskTypeEnum.Inbound.ObjToInt()).OrderBy(x=>x.TaskNum).FirstOrDefault();
+                            if (newTask != null)
+                            {
+                                device.SetValue(W_ConveyorLineFLDB.Barcode, newTask.PalletCode, item.StationCode);
+                                Thread.Sleep(500);
+                                device.SetValue(W_ConveyorLineFLDB.TaskNum, newTask.TaskNum, item.StationCode);
+                                Thread.Sleep(500);
+                                device.SetValue(GroundStationDBName.W_PutFinish, true, item.StationCode);
+                                _taskService.UpdateTask(newTask, TaskStatusEnum.Line_Executing);
+                            }
                         }
                     }
 

--
Gitblit v1.9.3