From 1f361850d35ba47225951efbc49d592eea685cf8 Mon Sep 17 00:00:00 2001
From: z8018 <1282578289@qq.com>
Date: 星期三, 16 四月 2025 17:35:53 +0800
Subject: [PATCH] 1

---
 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/GantryPositionJob.cs |   22 +++++++++++++---------
 1 files changed, 13 insertions(+), 9 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/GantryPositionJob.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/GantryPositionJob.cs"
index 9ddaaa4..e799eba 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/GantryPositionJob.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/GantryPositionJob.cs"
@@ -13,7 +13,7 @@
     [DisallowConcurrentExecution]
     public class GantryPositionJob : JobBase, IJob
     {
-        
+
 
         public GantryPositionJob()
         {
@@ -22,12 +22,13 @@
 
         public Task Execute(IJobExecutionContext context)
         {
-            try
+
+            bool flag = context.JobDetail.JobDataMap.TryGetValue("JobParams", out object? value);
+            if (flag && value != null && value is OtherDevice)
             {
-                bool flag = context.JobDetail.JobDataMap.TryGetValue("JobParams", out object? value);
-                if (flag && value != null && value is OtherDevice)
+                OtherDevice otherDevice = (OtherDevice)value;
+                try
                 {
-                    OtherDevice otherDevice = (OtherDevice)value;
                     {
                         List<string> hDeviceChildCodes = otherDevice.DeviceProDTOs.Where(x => x.DeviceProParamType == nameof(OPositions.HPositions)).GroupBy(x => x.DeviceChildCode).Select(x => x.Key).ToList();
                         DeviceProDTO deviceProDTOH = otherDevice.DeviceProDTOs.Where(x => x.DeviceProParamType == nameof(OPositions.HPositions)).OrderBy(x => x.DeviceProOffset).First();
@@ -71,16 +72,19 @@
                             }
                         }
                     }
-                    
+                }
+                catch (Exception ex)
+                {
+                    WriteError($"{otherDevice.DeviceCode}-{otherDevice.DeviceName}", ex.Message, ex);
                 }
             }
-            catch (Exception ex)
+            else
             {
-                WriteError(nameof(GantryPositionJob), "閿欒", ex);
+                WriteError(nameof(CommonConveyorLightJob), "鍙傛暟閿欒,鏈紶閫掕澶囧弬鏁版垨璁惧绫诲瀷閿欒");
             }
             return Task.CompletedTask;
         }
     }
 
-    
+
 }

--
Gitblit v1.9.3