From 7ca9651f81d7b84f054194d3d46fdbd1d9c8b922 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期三, 09 七月 2025 22:55:27 +0800
Subject: [PATCH] 增加质检出入库逻辑

---
 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/ConveyorLineExtend/AGVsignal.cs |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/ConveyorLineExtend/AGVsignal.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/ConveyorLineExtend/AGVsignal.cs"
index 4b74737..68e822b 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/ConveyorLineExtend/AGVsignal.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/ConveyorLineExtend/AGVsignal.cs"
@@ -123,9 +123,9 @@
         public static WebResponseContent AGVRequestinProductionLine(ConveyorLineDTO conveyor)
         {
             WebResponseContent content = new WebResponseContent();
+            OtherDevice? ProductionLine = Storage.Devices.FirstOrDefault(x => x.DeviceCode == conveyor.Station) as OtherDevice;
             try
             {
-                OtherDevice? ProductionLine = Storage.Devices.FirstOrDefault(x => x.DeviceCode == conveyor.Station) as OtherDevice;
                 if (ProductionLine == null) throw new Exception("鏈壘鍒颁骇绾胯澶囦俊鎭�");
                 if (!ProductionLine.IsConnected) throw new Exception($"浜х嚎璁惧閫氳寮傚父");
                 content.Status = ProductionLine.SetValue(ProductionLineDBName.WagvState, conveyor.Type);
@@ -135,7 +135,8 @@
                 switch (conveyor.Type)
                 {
                     case 1:
-                        if (agvState != conveyor.Type) throw new Exception("浜х嚎涓嶅厑璁歌繘鍏ヤ綔涓�");
+                        if (agvState != conveyor.Type) throw new Exception($"AGV鐢宠杩涘叆锛屼骇绾夸笉鍏佽杩涘叆浣滀笟锛屼骇绾夸俊鍙枫�恵agvState}銆�");
+                        ProductionLine?.Communicator.LogNet.WriteDebug($"AGV鐢宠杩涘叆锛屼骇绾垮厑璁歌繘鍏ヤ綔涓氾紝浜х嚎淇″彿銆恵agvState}銆�");
                         content.OK();
                         break;
                     case 2:
@@ -144,7 +145,7 @@
                         break;
                     case 3:
                         content.Status = ProductionLine.SetValue(ProductionLineDBName.Wrequest, 2);
-                        //if (content.Status) content.Status = ProductionLine.SetValue(ProductionLineDBName.WagvState, 3);
+                        ProductionLine?.Communicator.LogNet.WriteDebug($"AGV宸茬寮�锛屼换鍔″畬鎴�");
                         break;
                 }
                 content = content.Status ? content.OK() : content.Error("鍐欏叆澶辫触");
@@ -152,6 +153,7 @@
             catch (Exception ex)
             {
                 content.Error(ex.Message);
+                ProductionLine?.Communicator.LogNet.WriteDebug(ex.Message);
             }
             return content;
         }

--
Gitblit v1.9.3