From bf2aa9dd56432a74940ca1bb08fb4d7eaee37045 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期五, 27 三月 2026 11:03:37 +0800
Subject: [PATCH] feat(WCS): 完善 WIDESEAWCS_Tasks 模块日志系统
---
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/ConveyorLineTaskFilter.cs | 26 ++++++++++++++++++++++----
1 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/ConveyorLineTaskFilter.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/ConveyorLineTaskFilter.cs
index 297fbd0..429b7a9 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/ConveyorLineTaskFilter.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/ConveyorLineTaskFilter.cs
@@ -1,3 +1,5 @@
+using Microsoft.Extensions.Logging;
+using WIDESEAWCS_Core.LogHelper;
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
@@ -26,12 +28,19 @@
private readonly ITaskService _taskService;
/// <summary>
+ /// 鏃ュ織璁板綍鍣�
+ /// </summary>
+ private readonly ILogger _logger;
+
+ /// <summary>
/// 鏋勯�犲嚱鏁�
/// </summary>
/// <param name="taskService">浠诲姟鏈嶅姟瀹炰緥</param>
- public ConveyorLineTaskFilter(ITaskService taskService)
+ /// <param name="logger">鏃ュ織璁板綍鍣�</param>
+ public ConveyorLineTaskFilter(ITaskService taskService, ILogger logger)
{
_taskService = taskService;
+ _logger = logger;
}
/// <summary>
@@ -46,7 +55,10 @@
/// <returns>寰呭鐞嗙殑浠诲姟瀵硅薄锛屽鏋滄病鏈夊垯杩斿洖 null</returns>
public Dt_Task? QueryPendingTask(string deviceCode, string childDeviceCode)
{
- return _taskService.QueryConveyorLineTask(deviceCode, childDeviceCode);
+ var task = _taskService.QueryConveyorLineTask(deviceCode, childDeviceCode);
+ _logger.LogDebug("QueryPendingTask锛氳澶� {DeviceCode}锛屽瓙璁惧 {ChildDeviceCode}锛屾煡璇㈢粨鏋�: {TaskNum}", deviceCode, childDeviceCode, task?.TaskNum);
+ QuartzLogger.Debug($"QueryPendingTask锛氳澶� {deviceCode}锛屽瓙璁惧 {childDeviceCode}锛屾煡璇㈢粨鏋�: {task?.TaskNum}", deviceCode);
+ return task;
}
/// <summary>
@@ -61,7 +73,10 @@
/// <returns>鎵ц涓殑浠诲姟瀵硅薄锛屽鏋滄病鏈夊垯杩斿洖 null</returns>
public Dt_Task? QueryExecutingTask(int taskNo, string childDeviceCode)
{
- return _taskService.QueryExecutingConveyorLineTask(taskNo, childDeviceCode);
+ var task = _taskService.QueryExecutingConveyorLineTask(taskNo, childDeviceCode);
+ _logger.LogDebug("QueryExecutingTask锛氫换鍔″彿 {TaskNo}锛屽瓙璁惧 {ChildDeviceCode}锛屾煡璇㈢粨鏋�: {Found}", taskNo, childDeviceCode, task != null);
+ QuartzLogger.Debug($"QueryExecutingTask锛氫换鍔″彿 {taskNo}锛屽瓙璁惧 {childDeviceCode}锛屾煡璇㈢粨鏋�: {(task != null)}", childDeviceCode);
+ return task;
}
/// <summary>
@@ -76,7 +91,10 @@
/// <returns>璇锋眰鏄惁鎴愬姛</returns>
public bool RequestWmsTask(string barcode, string childDeviceCode)
{
- return _taskService.RequestWMSTask(barcode, childDeviceCode).Status;
+ _logger.LogInformation("RequestWmsTask锛氬悜WMS璇锋眰浠诲姟锛屾潯鐮�: {Barcode}锛屽瓙璁惧: {ChildDeviceCode}", barcode, childDeviceCode);
+ QuartzLogger.Info($"鍚慦MS璇锋眰浠诲姟锛屾潯鐮�: {barcode}", childDeviceCode);
+ var result = _taskService.RequestWMSTask(barcode, childDeviceCode);
+ return result.Status;
}
}
}
--
Gitblit v1.9.3