From b690250002ee04f4309e6a90fd16fbfd9bd959e2 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期五, 01 五月 2026 23:11:23 +0800
Subject: [PATCH] feat(router): 添加托盘操作页面路由
---
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs | 44 ++++++--------------------------------------
1 files changed, 6 insertions(+), 38 deletions(-)
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
index 648454e..efaf9b7 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
@@ -81,7 +81,7 @@
/// <summary>
/// 鏃ュ織璁板綍鍣�
/// </summary>
- private readonly ILogger _logger;
+ private readonly ILogger _logger;
/// <summary>
/// 鍫嗗灈鏈鸿澶囩紪鐮�
@@ -121,36 +121,6 @@
}
/// <summary>
- /// 鍔犺浇閰嶇疆鏂囦欢锛堜紭鍏堢骇锛氶厤缃枃浠� > 榛樿閰嶇疆锛�
- /// </summary>
- /// <remarks>
- /// 浠庡簲鐢ㄧ▼搴忕洰褰曚笅鐨� StackerCraneJob/stackercrane-command-config.json 璇诲彇閰嶇疆銆�
- /// 濡傛灉鏂囦欢涓嶅瓨鍦ㄦ垨瑙f瀽澶辫触锛屼娇鐢ㄩ粯璁ら厤缃��
- /// </remarks>
- /// <returns>鍫嗗灈鏈哄懡浠ら厤缃�</returns>
- private static StackerCraneCommandConfig LoadConfig()
- {
- try
- {
- // 鏋勯�犻厤缃枃浠惰矾寰�
- string configPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "StackerCraneJob", "stackercrane-command-config.json");
- if (File.Exists(configPath))
- {
- // 璇诲彇骞惰В鏋� JSON 閰嶇疆
- string json = File.ReadAllText(configPath);
- return System.Text.Json.JsonSerializer.Deserialize<StackerCraneCommandConfig>(json) ?? new StackerCraneCommandConfig();
- }
- }
- catch (Exception ex)
- {
- // 閰嶇疆鍔犺浇澶辫触锛屼娇鐢ㄩ粯璁ら厤缃�
- Console.WriteLine($"閰嶇疆鍔犺浇澶辫触: {ex.Message}锛屼娇鐢ㄩ粯璁ら厤缃�");
- }
-
- return new StackerCraneCommandConfig();
- }
-
- /// <summary>
/// Quartz Job 鐨勬墽琛屽叆鍙�
/// </summary>
/// <remarks>
@@ -174,9 +144,8 @@
bool flag = context.JobDetail.JobDataMap.TryGetValue("JobParams", out object? value);
if (!flag || value is not CommonStackerCrane commonStackerCrane)
{
- _logger.Information("Execute锛氬弬鏁版棤鏁堬紝鏈壘鍒� JobParams 鎴栫被鍨嬩笉鍖归厤");
// 鍙傛暟鏃犳晥锛岀洿鎺ヨ繑鍥�
- QuartzLogHelper.LogWarn(_logger, "Execute锛氬弬鏁版棤鏁�", "Execute锛氬弬鏁版棤鏁�", "CommonStackerCraneJob");
+ QuartzLogHelper.LogInfo(_logger, "Execute锛氬弬鏁版棤鏁�", "CommonStackerCraneJob");
return Task.CompletedTask;
}
@@ -216,7 +185,6 @@
if (stackerCraneTaskCommand == null)
{
// 鍛戒护鏋勫缓澶辫触
- QuartzLogHelper.LogWarn(_logger, "Execute锛氬懡浠ゆ瀯寤哄け璐ワ紝璁惧: {DeviceCode}锛屼换鍔″彿: {TaskNum}", $"鍛戒护鏋勫缓澶辫触锛屼换鍔″彿: {task.TaskNum}", _deviceCode, _deviceCode, task.TaskNum);
return Task.CompletedTask;
}
@@ -230,17 +198,17 @@
commonStackerCrane.LastTaskType = task.TaskType;
_taskService.UpdateTaskStatusToNext(task.TaskNum);
- QuartzLogHelper.LogInfo(_logger, "Execute锛氬懡浠ゅ彂閫佹垚鍔燂紝璁惧: {DeviceCode}锛屼换鍔″彿: {TaskNum}", $"鍛戒护鍙戦�佹垚鍔燂紝浠诲姟鍙�: {task.TaskNum}", _deviceCode, _deviceCode, task.TaskNum);
+ QuartzLogHelper.LogInfo(_logger, $"Execute锛氬懡浠ゅ彂閫佹垚鍔燂紝璁惧: {_deviceCode}锛屼换鍔″彿: {task.TaskNum}", _deviceCode);
}
else
{
- QuartzLogHelper.LogError(_logger, "Execute锛氬懡浠ゅ彂閫佸け璐ワ紝璁惧: {DeviceCode}锛屼换鍔″彿: {TaskNum}", $"鍛戒护鍙戦�佸け璐�", _deviceCode, _deviceCode, task.TaskNum);
+ QuartzLogHelper.LogInfo(_logger, $"Execute锛氬懡浠ゅ彂閫佸け璐ワ紝璁惧: {_deviceCode}锛屼换鍔″彿: {task.TaskNum}", _deviceCode);
}
}
catch (Exception ex)
{
// 璁板綍寮傚父
- QuartzLogHelper.LogError(_logger, ex, "Execute锛氭墽琛屽紓甯革紝璁惧: {DeviceCode}", $"鎵ц寮傚父: {ex.Message}", _deviceCode, _deviceCode);
+ QuartzLogHelper.LogError(_logger, ex, $"Execute锛氭墽琛屽紓甯革紝璁惧: {_deviceCode}", $"鎵ц寮傚父: {ex.Message}", _deviceCode, _deviceCode);
}
finally
{
@@ -268,7 +236,7 @@
if (stackerCrane != null)
{
// 璁板綍鏃ュ織
- QuartzLogHelper.LogInfo(_logger, "CommonStackerCrane_StackerCraneTaskCompletedEventHandler锛氫换鍔″畬鎴愶紝浠诲姟鍙�: {TaskNum}", $"浠诲姟瀹屾垚锛屼换鍔″彿: {e.TaskNum}", stackerCrane.DeviceCode, e.TaskNum);
+ QuartzLogHelper.LogInfo(_logger, $"CommonStackerCrane_StackerCraneTaskCompletedEventHandler锛氫换鍔″畬鎴愶紝浠诲姟鍙�: {e.TaskNum}", stackerCrane.DeviceCode);
// 鏇存柊浠诲姟鐘舵�佷负瀹屾垚
if (_taskService.StackCraneTaskCompleted(e.TaskNum).Status)
--
Gitblit v1.9.3