From 06e0e3b7d61e95902a6129de2490461cd0693e1d Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com>
Date: 星期三, 15 十月 2025 15:06:40 +0800
Subject: [PATCH] 新增异步方法并优化服务调用逻辑在多个数据库文件中进行了二进制文件的修改、删除和新增操作,可能涉及数据库内容的更新或重建。在 HttpsClient.cs文件中新增了 PostNotLimitAsync方法,用于发送支持 JSON 格式的异步 HTTP POST 请求,并记录请求和响应参数。在 AgingInOrOutInputService.cs文件中,将 HttpsClient.PostAsync替换为PostNotLimitAsync,以利用新方法的功能特性。同时删除了不再需要的注释代码。
---
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs | 35 +++++++++++++++++++++++++++++++++--
1 files changed, 33 insertions(+), 2 deletions(-)
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
index 5206c1b..42c341c 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
@@ -102,6 +102,8 @@
builder.AppendLine();
ConsoleHelper.WriteColorLine(builder, ConsoleColor.Blue);
commonStackerCrane.LastTaskType = task.TaskType;
+
+
_taskService.UpdateTaskStatusToNext(task.TaskNum);
}
}
@@ -168,6 +170,24 @@
var task = _taskRepository.QueryFirst(x => x.TaskNum == e.TaskNum);
if (task == null) commonStackerCrane.SetValue(StackerCraneDBName.WorkType, 5);
+
+ if (commonStackerCrane.DeviceCode.Contains("CW") && task.TaskType==(int)TaskOutboundTypeEnum.InToOut)
+ {
+ var stationinfo = _stationManagerRepository.QueryFirst(x => x.stationPLC == "1017" && x.stationType == 10 && x.Roadway == commonStackerCrane.DeviceCode);
+
+ IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationinfo.stationPLC);
+ if (device != null)
+ {
+ CommonConveyorLine_CW conveyorLine = (CommonConveyorLine_CW)device;
+ conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, Convert.ToInt16(1815), stationinfo.stationChildCode);
+ Thread.Sleep(100);
+ conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTaskNum, 1000, stationinfo.stationChildCode);
+ }
+ WriteInfo(commonStackerCrane.DeviceName, $"銆愭墜鍔ㄥ嚭搴撹褰曘�戜换鍔″彿銆恵e.TaskNum}銆戞墭鐩樺彿銆恵task.PalletCode}銆�");
+ }
+
+
+
if (commonStackerCrane.DeviceCode.Contains("GW") && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
{
@@ -299,7 +319,7 @@
device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == router.ChildPosiDeviceCode);
if (device != null)
{
- CommonConveyorLine_GW conveyorLine = (CommonConveyorLine_GW)device;
+ CommonConveyorLine_CW conveyorLine = (CommonConveyorLine_CW)device;
if (conveyorLine.IsOccupied(task.NextAddress))//鍑哄簱绔欏彴鏈鍗犵敤
{
return task;
@@ -496,7 +516,18 @@
}
else
{
- if (((task.TargetAddress == "002-021-001" || task.TargetAddress == "001-021-001") && task.Roadway.Contains("JZ")) || task.TaskType == (int)TaskOutboundTypeEnum.OutFireAlarm)
+ if ( task.TaskType == (int)TaskOutboundTypeEnum.InToOut)
+ {
+ string[] endCodes = task.TargetAddress.Split("-");
+ stackerCraneTaskCommand.EndRow = Convert.ToInt16(endCodes[0]);
+ stackerCraneTaskCommand.EndColumn = Convert.ToInt16(endCodes[1]);
+ stackerCraneTaskCommand.EndLayer = Convert.ToInt16(endCodes[2]);
+ string[] sourceCodes = task.SourceAddress.Split("-");
+ stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[0]) % 2 != 0 ? (short)1 : (short)2;
+ stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[1]);
+ stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[2]);
+ }
+ else if (((task.TargetAddress == "002-021-001" || task.TargetAddress == "001-021-001") && task.Roadway.Contains("JZ")) || task.TaskType == (int)TaskOutboundTypeEnum.OutFireAlarm)
{
string[] endCodes = task.NextAddress.Split("-");
stackerCraneTaskCommand.EndRow = Convert.ToInt16(endCodes[0]);
--
Gitblit v1.9.3