From c5c3e4e538a11f2a6391e6b2613375b1f92eb20a Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期三, 15 四月 2026 14:39:18 +0800
Subject: [PATCH] feat: 添加Quartz日志助手类并重构任务服务日志记录
---
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/ConveyorLineTargetAddressSelector.cs | 13 +++----------
1 files changed, 3 insertions(+), 10 deletions(-)
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/ConveyorLineTargetAddressSelector.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/ConveyorLineTargetAddressSelector.cs
index c4ecdf4..24c16e3 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/ConveyorLineTargetAddressSelector.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/ConveyorLineTargetAddressSelector.cs
@@ -418,10 +418,7 @@
string deviceType)
{
// 璁板綍褰撳墠璇锋眰鐘舵�佺殑璋冭瘯鏃ュ織锛屼緵鎺掓煡闂浣跨敤
- _logger.LogDebug("ProcessDeviceRequest锛歿DeviceType}锛屽瓙璁惧: {ChildDeviceCode}锛岀墿鏂欒姹�: {MaterialReq}锛屽嚭鏂欒姹�: {OutputReq}",
- deviceType, childDeviceCode, materialRequest, outputRequest);
- // 鍚屾鍐欏叆 Quartz 鏃ュ織鏂囦欢锛堝弻鍐欏彲杩芥函锛岃繖閲屼繚鐣欎笌鍘熼�昏緫涓�鑷寸殑琛屼负锛�
- QuartzLogger.Debug($"ProcessDeviceRequest锛歿deviceType}锛屽瓙璁惧: {childDeviceCode}锛岀墿鏂欒姹�: {materialRequest}锛屽嚭鏂欒姹�: {outputRequest}", conveyorLine.DeviceCode);
+ QuartzLogHelper.LogDebug(_logger, "ProcessDeviceRequest锛歿DeviceType}锛屽瓙璁惧: {ChildDeviceCode}锛岀墿鏂欒姹�: {MaterialReq}锛屽嚭鏂欒姹�: {OutputReq}", $"ProcessDeviceRequest锛歿deviceType}锛屽瓙璁惧: {childDeviceCode}锛岀墿鏂欒姹�: {materialRequest}锛屽嚭鏂欒姹�: {outputRequest}", conveyorLine.DeviceCode, deviceType, childDeviceCode, materialRequest, outputRequest);
// 鍒嗘敮鍒ゆ柇锛氳澶囨槸闇�瑕佺墿鏂欒繕鏄渶瑕佸嚭鏂�
if (materialRequest)
@@ -432,8 +429,7 @@
// 2. 鍥炲 ACK 纭淇″彿锛屽憡鐭ヨ澶囧凡鏀跺埌璇锋眰
conveyorLine.SetValue(ConveyorLineDBNameNew.WCS_ACK, 1, childDeviceCode);
// 3. 璁板綍淇℃伅鏃ュ織锛岃〃鏄庡凡瀹屾垚鐩爣鍦板潃璁剧疆鍜� ACK 鍥炲
- _logger.LogInformation("ProcessDeviceRequest锛歿DeviceType} 闇�瑕佺墿鏂欙紝宸茶缃洰鏍囧湴鍧�鍜孉CK", deviceType);
- QuartzLogger.Info($"ProcessDeviceRequest锛歿deviceType} 闇�瑕佺墿鏂欙紝宸茶缃洰鏍囧湴鍧�鍜孉CK", conveyorLine.DeviceCode);
+ QuartzLogHelper.LogInfo(_logger, "ProcessDeviceRequest锛歿DeviceType} 闇�瑕佺墿鏂欙紝宸茶缃洰鏍囧湴鍧�鍜孉CK", $"ProcessDeviceRequest锛歿deviceType} 闇�瑕佺墿鏂欙紝宸茶缃洰鏍囧湴鍧�鍜孉CK", conveyorLine.DeviceCode, deviceType);
}
else
{
@@ -457,10 +453,7 @@
private void WriteDebug(CommonConveyorLine conveyorLine, string scenario, string childDeviceCode, string nextAddress)
{
// 鍐欏叆缁撴瀯鍖栨棩蹇楋紙鍙 Serilog 绛夋棩蹇楁鏋舵崟鑾凤級
- _logger.LogDebug("Handle{Scenario}锛氬瓙璁惧: {ChildDeviceCode}锛岀洰鏍囧湴鍧�: {NextAddress}",
- scenario, childDeviceCode, nextAddress);
- // 鍐欏叆 Quartz 涓撶敤鏃ュ織鏂囦欢锛堜緵瀹氭椂浠诲姟杞ㄨ抗杩借釜锛�
- QuartzLogger.Debug($"Handle{scenario}锛氬瓙璁惧: {childDeviceCode}锛岀洰鏍囧湴鍧�: {nextAddress}", conveyorLine.DeviceCode);
+ QuartzLogHelper.LogDebug(_logger, "Handle{Scenario}锛氬瓙璁惧: {ChildDeviceCode}锛岀洰鏍囧湴鍧�: {NextAddress}", $"Handle{scenario}锛氬瓙璁惧: {childDeviceCode}锛岀洰鏍囧湴鍧�: {nextAddress}", conveyorLine.DeviceCode, scenario, childDeviceCode, nextAddress);
}
}
}
--
Gitblit v1.9.3