From 5171d3f59b89389bf75293afd210cfa6de4ccff7 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期五, 10 四月 2026 23:03:49 +0800
Subject: [PATCH] feat: 添加堆垛机相关常量类并重构代码使用常量
---
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/StackerCraneCommandBuilder.cs | 19 ++++++++++---------
1 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/StackerCraneCommandBuilder.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/StackerCraneCommandBuilder.cs
index edf399a..a8637cb 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/StackerCraneCommandBuilder.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/StackerCraneCommandBuilder.cs
@@ -1,6 +1,7 @@
using Microsoft.Extensions.Logging;
using System;
using System.Diagnostics.CodeAnalysis;
+using WIDESEAWCS_Common.Constants;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core.LogHelper;
using WIDESEAWCS_ITaskInfoService;
@@ -128,8 +129,8 @@
return new StackerCraneTaskCommand
{
TaskNum = task.TaskNum, // 浠诲姟鍙�
- WorkType = 1, // 浣滀笟绫诲瀷
- //WorkAction = 1 // 浣滀笟鎸囦护锛氬紑濮嬫墽琛�
+ WorkType = StackerCraneConst.WorkTypeInbound, // 浣滀笟绫诲瀷锛氬叆搴�
+ //WorkAction = StackerCraneWorkActionEnum.StartTask // 浣滀笟鎸囦护锛氬紑濮嬫墽琛�
};
}
@@ -148,10 +149,10 @@
{
Barcode = task.PalletCode, // 鎵樼洏鏉$爜
TaskNum = task.TaskNum, // 浠诲姟鍙�
- WorkType = 1, // 浣滀笟绫诲瀷
- WorkAction = 1, // 浣滀笟鎸囦护锛氬紑濮嬫墽琛�
- FireAlarm = 0, // 鐏锛氭甯�
- HeartBeat = 0, // 蹇冭烦
+ WorkType = StackerCraneConst.WorkTypeInbound, // 浣滀笟绫诲瀷锛氬叆搴�
+ WorkAction = (short)StackerCraneWorkActionEnum.StartTask, // 浣滀笟鎸囦护锛氬紑濮嬫墽琛�
+ FireAlarm = StackerCraneConst.FireAlarmNormal, // 鐏锛氭甯�
+ HeartBeat = StackerCraneConst.HeartBeatInitial, // 蹇冭烦
FieldName = string.Empty // 淇濈暀瀛楁
};
}
@@ -202,11 +203,11 @@
_logger.LogInformation("BuildInboundCommand锛氭瀯寤哄叆搴撳懡浠わ紝浠诲姟鍙�: {TaskNum}", task.TaskNum);
QuartzLogger.Info($"BuildInboundCommand锛氭瀯寤哄叆搴撳懡浠わ紝浠诲姟鍙�: {task.TaskNum}", task.Roadway);
- // 纭畾浠诲姟绫诲瀷锛堢┖鎵樼洏鐢ㄧ壒娈婄被鍨� 100锛�
+ // 纭畾浠诲姟绫诲瀷锛堢┖鎵樼洏鐢ㄧ壒娈婄被鍨嬶級
int taskType = 0;
if (task.TaskType == (int)TaskOutboundTypeEnum.OutEmpty)
{
- taskType = 100;
+ taskType = StackerCraneConst.EmptyPalletTaskType;
}
else
taskType = task.TaskType;
@@ -270,7 +271,7 @@
int taskType = 0;
if (task.TaskType == (int)TaskOutboundTypeEnum.OutEmpty)
{
- taskType = 100;
+ taskType = StackerCraneConst.EmptyPalletTaskType;
}
else
taskType = task.TaskType;
--
Gitblit v1.9.3