From 75ef0dfecf2331c0828a1a182b1d3243d3041c51 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期二, 21 四月 2026 13:19:44 +0800
Subject: [PATCH] refactor: 统一日志组件为Serilog并优化相关功能

---
 Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs
index a7b7695..c4d84ef 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs
@@ -21,12 +21,14 @@
 using System.Reflection;
 using System.Text;
 using System.Threading.Tasks;
-using AutoMapper;
+using MapsterMapper;
 using OfficeOpenXml.FormulaParsing.Excel.Functions.Text;
 using Quartz;
+using WIDESEAWCS_Common.Constants;
 using WIDESEAWCS_Communicator;
 using WIDESEAWCS_Core;
 using WIDESEAWCS_Core.Helper;
+using WIDESEAWCS_Core.LogHelper;
 using WIDESEAWCS_ITaskInfoService;
 using WIDESEAWCS_Model.Models;
 using WIDESEAWCS_QuartzJob;
@@ -63,11 +65,6 @@
                     List<Task> tasks = new List<Task>();
                     foreach (string childDeviceCode in childDeviceCodes)
                     {
-                        int num = new Random().Next(1, 100);
-                        if (num < 30)
-                        {
-                            throw new CommunicationException("閿欒娴嬭瘯", CommunicationErrorType.Unknown);
-                        }
                         ConveyorLineTaskCommand command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand>(childDeviceCode);
                         if (command != null)
                         {
@@ -91,6 +88,8 @@
             }
             catch (Exception ex)
             {
+                // 璁板綍寮傚父锛岄伩鍏嶉敊璇闈欓粯鍚炴帀
+                QuartzLogger.Error("CommonConveyorLineJob Execute 寮傚父", "CommonConveyorLineJob", ex);
             }
             return Task.CompletedTask;
         }
@@ -149,7 +148,7 @@
             Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode);
             if (task != null)
             {
-                conveyorLine.SetValue(ConveyorLineDBName.WriteInteractiveSignal, 0, childDeviceCode);
+                conveyorLine.SetValue(ConveyorLineDBName.WriteInteractiveSignal, DeviceAddressConst.InteractiveSignalReset, childDeviceCode);
                 WebResponseContent content = _taskService.UpdateTaskStatusToNext(task);
                 Console.Out.WriteLine(content.Serialize());
             }
@@ -206,10 +205,11 @@
             Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode);
             if (task != null)
             {
-                conveyorLine.SetValue(ConveyorLineDBName.WriteInteractiveSignal, 0, childDeviceCode);
+                conveyorLine.SetValue(ConveyorLineDBName.WriteInteractiveSignal, DeviceAddressConst.InteractiveSignalReset, childDeviceCode);
                 WebResponseContent content = _taskService.UpdateTaskStatusToNext(task);
                 Console.Out.WriteLine(content.Serialize());
             }
         }
     }
 }
+

--
Gitblit v1.9.3