From af5cfe514767e121d61a148e6e4a2440ed2f64f9 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期三, 08 四月 2026 18:05:00 +0800
Subject: [PATCH] chore: 从 git 跟踪中移除 Copilot 索引数据库文件
---
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/ConveyorLineDispatchHandler.cs | 48 +++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 41 insertions(+), 7 deletions(-)
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/ConveyorLineDispatchHandler.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/ConveyorLineDispatchHandler.cs
index 24700ff..29ae39a 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/ConveyorLineDispatchHandler.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/ConveyorLineDispatchHandler.cs
@@ -1,7 +1,9 @@
using MapsterMapper;
+using Microsoft.Extensions.Logging;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.Helper;
+using WIDESEAWCS_Core.LogHelper;
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_QuartzJob;
@@ -47,6 +49,11 @@
private readonly IMapper _mapper;
/// <summary>
+ /// 鏃ュ織璁板綍鍣�
+ /// </summary>
+ private readonly ILogger _logger;
+
+ /// <summary>
/// 杈撻�佺嚎浠诲姟杩囨护鍣�
/// </summary>
/// <remarks>
@@ -69,16 +76,18 @@
/// <param name="taskExecuteDetailService">浠诲姟鎵ц鏄庣粏鏈嶅姟</param>
/// <param name="routerService">璺敱鏈嶅姟</param>
/// <param name="mapper">瀵硅薄鏄犲皠鍣�</param>
- public ConveyorLineDispatchHandler(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IMapper mapper)
+ /// <param name="logger">鏃ュ織璁板綍鍣�</param>
+ public ConveyorLineDispatchHandler(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IMapper mapper, ILogger logger)
{
_taskService = taskService;
_taskExecuteDetailService = taskExecuteDetailService;
_routerService = routerService;
_mapper = mapper;
+ _logger = logger;
// 鍒濆鍖栦换鍔¤繃婊ゅ櫒鍜岀洰鏍囧湴鍧�閫夋嫨鍣�
- _taskFilter = new ConveyorLineTaskFilter(taskService);
- _targetAddressSelector = new ConveyorLineTargetAddressSelector();
+ _taskFilter = new ConveyorLineTaskFilter(taskService, _logger);
+ _targetAddressSelector = new ConveyorLineTargetAddressSelector(_logger);
}
/// <summary>
@@ -96,6 +105,8 @@
{
// 娓呴櫎浠诲姟鍙凤紝琛ㄧず褰撳墠绌洪棽
conveyorLine.SetValue(ConveyorLineDBNameNew.TaskNo, 0, childDeviceCode);
+ _logger.LogDebug("HeartBeat锛氬瓙璁惧 {ChildDeviceCode} 蹇冭烦", childDeviceCode);
+ QuartzLogger.Debug($"HeartBeat锛氬瓙璁惧 {childDeviceCode} 蹇冭烦", conveyorLine.DeviceCode);
}
/// <summary>
@@ -114,6 +125,9 @@
/// <param name="childDeviceCode">瀛愯澶囩紪鐮�</param>
public void RequestInbound(CommonConveyorLine conveyorLine, ConveyorLineTaskCommandNew command, string childDeviceCode)
{
+ _logger.LogInformation("RequestInbound锛氬瓙璁惧 {ChildDeviceCode} 璇锋眰鍏ュ簱", childDeviceCode);
+ QuartzLogger.Info($"璇锋眰鍏ュ簱锛屽瓙璁惧: {childDeviceCode}", conveyorLine.DeviceCode);
+
// 鍚� WMS 璇锋眰鏂颁换鍔★紙鍩轰簬鏉$爜锛�
if (_taskFilter.RequestWmsTask(command.Barcode, childDeviceCode))
{
@@ -132,6 +146,9 @@
// 鏇存柊浠诲姟鐘舵�佸埌涓嬩竴闃舵
_taskService.UpdateTaskStatusToNext(task);
+
+ _logger.LogInformation("RequestInbound锛氬叆搴撲换鍔″凡涓嬪彂锛屼换鍔″彿: {TaskNum}锛屽瓙璁惧: {ChildDeviceCode}", task.TaskNum, childDeviceCode);
+ QuartzLogger.Info($"鍏ュ簱浠诲姟宸蹭笅鍙戯紝浠诲姟鍙�: {task.TaskNum}锛屽瓙璁惧: {childDeviceCode}", conveyorLine.DeviceCode);
}
}
}
@@ -152,8 +169,13 @@
Dt_Task? task = _taskFilter.QueryExecutingTask(command.TaskNo, childDeviceCode);
if (task == null)
{
+ _logger.LogDebug("RequestInNextAddress锛氫换鍔� {TaskNo} 涓嶅瓨鍦�", command.TaskNo);
+ QuartzLogger.Debug($"RequestInNextAddress锛氫换鍔� {command.TaskNo} 涓嶅瓨鍦�", conveyorLine.DeviceCode);
return;
}
+
+ _logger.LogInformation("RequestInNextAddress锛氬叆搴撲笅涓�鍦板潃锛屼换鍔″彿: {TaskNum}锛屽瓙璁惧: {ChildDeviceCode}", task.TaskNum, childDeviceCode);
+ QuartzLogger.Info($"RequestInNextAddress锛氬叆搴撲笅涓�鍦板潃锛屼换鍔″彿: {task.TaskNum}锛屽瓙璁惧: {childDeviceCode}", conveyorLine.DeviceCode);
// 濡傛灉涓嶆槸绌烘墭鐩樹换鍔★紝澶勭悊鐩爣鍦板潃锛堜笌鎷樻潫鏈�/鎻掓嫈閽夋満浜や簰锛�
if (task.TaskType != (int)TaskOutboundTypeEnum.OutEmpty)
@@ -189,7 +211,9 @@
// 鏇存柊浠诲姟鐘舵�佸埌涓嬩竴闃舵锛堥�氬父鏄畬鎴愶級
WebResponseContent content = _taskService.UpdateTaskStatusToNext(task);
- Console.Out.WriteLine(content.Serialize());
+
+ _logger.LogInformation("ConveyorLineInFinish锛氬叆搴撳畬鎴愶紝浠诲姟鍙�: {TaskNum}锛屽瓙璁惧: {ChildDeviceCode}", task.TaskNum, childDeviceCode);
+ QuartzLogger.Info($"鍏ュ簱瀹屾垚锛屼换鍔″彿: {task.TaskNum}", conveyorLine.DeviceCode);
}
}
@@ -226,6 +250,9 @@
// 鏇存柊浠诲姟鐘舵��
_taskService.UpdateTaskStatusToNext(task);
+
+ _logger.LogInformation("RequestOutbound锛氬嚭搴撲换鍔″凡涓嬪彂锛屼换鍔″彿: {TaskNum}锛屽瓙璁惧: {ChildDeviceCode}", task.TaskNum, childDeviceCode);
+ QuartzLogger.Info($"鍑哄簱浠诲姟宸蹭笅鍙戯紝浠诲姟鍙�: {task.TaskNum}", conveyorLine.DeviceCode);
}
}
@@ -245,8 +272,13 @@
Dt_Task? task = _taskFilter.QueryExecutingTask(command.TaskNo, childDeviceCode);
if (task == null)
{
+ _logger.LogDebug("RequestOutNextAddress锛氫换鍔� {TaskNo} 涓嶅瓨鍦�", command.TaskNo);
+ QuartzLogger.Debug($"RequestOutNextAddress锛氫换鍔� {command.TaskNo} 涓嶅瓨鍦�", conveyorLine.DeviceCode);
return;
}
+
+ _logger.LogInformation("RequestOutNextAddress锛氬嚭搴撲笅涓�鍦板潃锛屼换鍔″彿: {TaskNum}锛屽瓙璁惧: {ChildDeviceCode}", task.TaskNum, childDeviceCode);
+ QuartzLogger.Info($"RequestOutNextAddress锛氬嚭搴撲笅涓�鍦板潃锛屼换鍔″彿: {task.TaskNum}锛屽瓙璁惧: {childDeviceCode}", conveyorLine.DeviceCode);
// 濡傛灉涓嶆槸绌烘墭鐩樹换鍔★紝澶勭悊鐩爣鍦板潃
if (task.TaskType != (int)TaskOutboundTypeEnum.OutEmpty)
@@ -277,12 +309,14 @@
Dt_Task? task = _taskFilter.QueryExecutingTask(command.TaskNo, childDeviceCode);
if (task != null)
{
+ // 鏇存柊浠诲姟鐘舵�佸埌涓嬩竴闃舵锛堥�氬父鏄畬鎴愶級
+ WebResponseContent content = _taskService.UpdateTaskStatusToNext(task);
+
// 鍥炲 ACK 纭
conveyorLine.SetValue(ConveyorLineDBNameNew.WCS_ACK, 1, childDeviceCode);
- // 鏇存柊浠诲姟鐘舵�佸埌涓嬩竴闃舵锛堥�氬父鏄畬鎴愶級
- WebResponseContent content = _taskService.UpdateTaskStatusToNext(task);
- Console.Out.WriteLine(content.Serialize());
+ _logger.LogInformation("ConveyorLineOutFinish锛氬嚭搴撳畬鎴愶紝浠诲姟鍙�: {TaskNum}锛屽瓙璁惧: {ChildDeviceCode}", task.TaskNum, childDeviceCode);
+ QuartzLogger.Info($"鍑哄簱瀹屾垚锛屼换鍔″彿: {task.TaskNum}", conveyorLine.DeviceCode);
}
}
}
--
Gitblit v1.9.3