From b2b779905bc8a71b52d0e14f91652309d9279878 Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期二, 03 二月 2026 14:37:38 +0800
Subject: [PATCH] 一堆逻辑修改
---
项目代码/WCS/WCSServices/WIDESEAWCS_Tasks/原料库/StackerCraneJob_YLSC3.cs | 48 +++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 43 insertions(+), 5 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\345\216\237\346\226\231\345\272\223/StackerCraneJob_YLSC3.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\345\216\237\346\226\231\345\272\223/StackerCraneJob_YLSC3.cs"
index ce77f6a..3614307 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\345\216\237\346\226\231\345\272\223/StackerCraneJob_YLSC3.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\345\216\237\346\226\231\345\272\223/StackerCraneJob_YLSC3.cs"
@@ -25,6 +25,8 @@
using WIDESEAWCS_Core.Helper;
using HslCommunication.WebSocket;
using WIDESEAWCS_DTO.Equipment;
+using WIDESEAWCS_QuartzJob.StackerCrane;
+using WIDESEAWCS_DTO.TaskInfo;
namespace WIDESEAWCS_Tasks
{
@@ -63,7 +65,14 @@
commonStackerCrane.StackerCraneTaskCompletedEventHandler += CommonStackerCrane_StackerCraneTaskCompletedEventHandler;//璁㈤槄浠诲姟瀹屾垚浜嬩欢
}
commonStackerCrane.CheckStackerCraneTaskCompleted();//闃叉浠诲姟瀹屾垚浜嬩欢鐩戞祴瓒呮椂锛屽啀鎵嬪姩瑙﹀彂涓�娆�
- if (commonStackerCrane.StackerCraneAutoStatusValue == StackerCraneAutoStatus.Automatic && commonStackerCrane.StackerCraneStatusValue == StackerCraneStatus.Normal && commonStackerCrane.StackerCraneWorkStatusValue == StackerCraneWorkStatus.Standby)
+
+ //鑾峰彇褰撳墠鍫嗗灈鏈虹姸鎬�
+ if (commonStackerCrane.CurrentTaskNum>0 && (commonStackerCrane.StackerCraneWorkStatusValue == StackerCraneWorkStatus.WorkCompleted || commonStackerCrane.Communicator.Read<short>("DB1000.40.0") == 3))
+ {
+ StackerCraneTaskCompletedEventArgs e = new StackerCraneTaskCompletedEventArgs(commonStackerCrane.CurrentTaskNum);
+ CommonStackerCrane_StackerCraneTaskCompletedEventHandler(commonStackerCrane, e);
+ }
+ else if (commonStackerCrane.StackerCraneAutoStatusValue == StackerCraneAutoStatus.Automatic && commonStackerCrane.StackerCraneStatusValue == StackerCraneStatus.Normal && commonStackerCrane.StackerCraneWorkStatusValue == StackerCraneWorkStatus.Standby)//鍒ゆ柇涓嬪彂
{
short stackerError = commonStackerCrane.Communicator.Read<short>("DB1000.54.0");
if (stackerError == 0)
@@ -86,6 +95,19 @@
Thread.Sleep(1000);
}
}
+ }
+ ErrorDeviceInfo? deviceInfo = RoadwayError.Roadways.FirstOrDefault(x => x.Code == commonStackerCrane.DeviceCode);
+ if (deviceInfo != null)
+ {
+ RoadwayError.Roadways.Remove(deviceInfo);
+ }
+ }
+ else
+ {
+ ErrorDeviceInfo? deviceInfo = RoadwayError.Roadways.FirstOrDefault(x => x.Code == commonStackerCrane.DeviceCode);
+ if (deviceInfo == null)
+ {
+ RoadwayError.Roadways.Add(new ErrorDeviceInfo() { Code = commonStackerCrane.DeviceCode, Roadway = commonStackerCrane.DeviceCode });
}
}
}
@@ -122,7 +144,7 @@
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
- private void CommonStackerCrane_StackerCraneTaskCompletedEventHandler(object? sender, WIDESEAWCS_QuartzJob.StackerCrane.StackerCraneTaskCompletedEventArgs e)
+ private void CommonStackerCrane_StackerCraneTaskCompletedEventHandler(object? sender,StackerCraneTaskCompletedEventArgs e)
{
CommonStackerCrane? commonStackerCrane = sender as CommonStackerCrane;
if (commonStackerCrane != null)
@@ -152,7 +174,12 @@
_taskService.UpdateTaskExceptionMessage(taskNum, $"杈撻�佺嚎鍑哄簱绔欑偣鏈厤缃�,{task.NextAddress}");
return WebResponseContent.Instance.Error($"杈撻�佺嚎鍑哄簱绔欑偣鏈厤缃�,{task.NextAddress}");
}
- Dt_Router router = _routerRepository.QueryFirst(x => x.InOutType == task.TaskType && x.StartPosi == stationManger.StationCode && x.ChildPosi == stationManger.StationDeviceCode);
+ bool depth = false;
+ if (task.Grade > 0 && task.TaskType == TaskTypeEnum.PrintYLOutbound.ObjToInt())
+ {
+ depth = true;
+ }
+ Dt_Router router = _routerRepository.QueryFirst(x => x.InOutType == task.TaskType && x.StartPosi == stationManger.StationCode && x.ChildPosi == stationManger.StationDeviceCode && (depth ? x.Depth == 2 : true));
if (router == null)
{
_taskService.UpdateTaskExceptionMessage(taskNum, $"鏈壘鍒拌矾鐢变俊鎭�,{task.NextAddress}");
@@ -243,6 +270,13 @@
/// <returns></returns>
private Dt_Task? GetTask(CommonStackerCrane commonStackerCrane)
{
+ //鍒ゆ柇鏄惁鏈夋鎵ц鐨勪换鍔★紝濡傛灉鏈夊垯涓嶄笅鍙�
+ Dt_Task? taskOld = _taskRepository.QueryFirst(x => x.DeviceCode == commonStackerCrane.DeviceCode && x.Roadway == commonStackerCrane.DeviceCode && x.TaskState == TaskStatusEnum.SC_Executing.ObjToInt());
+ if (taskOld != null)
+ {
+ return null;
+ }
+
Dt_Task? task;
if (commonStackerCrane.LastTaskType == null)
{
@@ -342,8 +376,8 @@
CommonConveyorLine client = (CommonConveyorLine)device;
if (client.GetValue<ConveyorLineDBName, short>(ConveyorLineDBName.InteractiveSignal, stationManger.StationCode) != 99)//鍑哄簱绔欏彴鏈鍗犵敤
{
- task.NextAddress = stationManger.StackerCraneStationCode;
- _taskRepository.UpdateData(task);
+ //task.NextAddress = stationManger.StackerCraneStationCode;
+ //_taskRepository.UpdateData(task);
return task;
}
else
@@ -378,6 +412,10 @@
YLStackerCraneTaskCommand stackerCraneTaskCommand = new YLStackerCraneTaskCommand();
stackerCraneTaskCommand.PalletType = Convert.ToInt16(task.PalletType);
+ if (task.TaskLength>=1160 && task.TaskLength<1630)
+ {
+ stackerCraneTaskCommand.PalletType = 3;
+ }
stackerCraneTaskCommand.TaskNum = task.TaskNum;
stackerCraneTaskCommand.WorkType = 5;
if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)//鍒ゆ柇鏄惁鏄叆搴撲换鍔�
--
Gitblit v1.9.3