From 29f20b28392d212c04c0c40a512894f8622cfa53 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期三, 16 四月 2025 09:32:01 +0800
Subject: [PATCH] 合并

---
 CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs b/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs
index c442888..aea5799 100644
--- a/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs
+++ b/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs
@@ -24,6 +24,8 @@
 using HslCommunication;
 using Microsoft.CodeAnalysis;
 using Newtonsoft.Json;
+using OfficeOpenXml.FormulaParsing.Excel.Functions.Math;
+using OfficeOpenXml.FormulaParsing.Excel.Functions.RefAndLookup;
 using Quartz;
 using SqlSugar;
 using System.Reflection;
@@ -136,7 +138,7 @@
 
                         if (childDeviceCode == "3464" || childDeviceCode == "3460" || childDeviceCode == "3456" )
                         {
-                            Platform platform = _platFormRepository.QueryFirst(x => x.PLCCode == conveyorLine.DeviceCode && x.PlatCode == childDeviceCode && x.Status == "Active");
+                            Platform platform = _platFormRepository.QueryFirst(x => x.DeviceCode == conveyorLine.DeviceCode && x.PlatCode == childDeviceCode && x.Status == "Active");
                             if (platform != null)
                             {
                                 if (command.HasPallet != 1)
@@ -411,13 +413,17 @@
                             _needBarcodeRepository.UpdateData(needBarcode);
                         }
                     }
+                    content = _taskService.UpdateTaskStatusToNext(task);
+                    var proAddress = conveyorLine.DeviceProDTOs
+                                    .FirstOrDefault(x => x.DeviceChildCode == childDeviceCode && x.DeviceProParamName == ConveyorLineDBName_After.InteractiveSignal.ToString())
+                                    ?.DeviceProAddress;
+                    string address = proAddress.Contains(".0") ? proAddress : proAddress + ".0";
                     conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTaskNum, taskCommand.ConveyorLineTaskNum, childDeviceCode);
                     conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, taskCommand.ConveyorLineTargetAddress, childDeviceCode);
                     conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineBarcode, taskCommand.ConveyorLineBarcode, childDeviceCode);
+                    conveyorLine.Communicator.Write(address, 1);
                     //conveyorLine.SetValue(ConveyorLineDBName_After.InteractiveSignal, taskCommand.InteractiveSignal, childDeviceCode);
-                    conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode);
-
-                    content = _taskService.UpdateTaskStatusToNext(task);
+                    //conveyorLine.SetValue(ConveyorLineDBName_After.ResponState, 1, childDeviceCode);
                 }
             }
             catch (Exception ex)

--
Gitblit v1.9.3