From 5c272c606bdf2da3577dbaa5f48d0ee163f1e7d2 Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期四, 26 三月 2026 10:35:24 +0800
Subject: [PATCH] 纸张淋膜半成品入库逻辑优化
---
项目代码/WCS/WCSServices/WIDESEAWCS_Tasks/成品仓/StackerCraneJob_CP.cs | 26 ++++++++++++++++++++------
1 files changed, 20 insertions(+), 6 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\346\210\220\345\223\201\344\273\223/StackerCraneJob_CP.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\346\210\220\345\223\201\344\273\223/StackerCraneJob_CP.cs"
index 50e9cba..f7a83e6 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\346\210\220\345\223\201\344\273\223/StackerCraneJob_CP.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\346\210\220\345\223\201\344\273\223/StackerCraneJob_CP.cs"
@@ -23,6 +23,7 @@
using SqlSugar.Extensions;
using WIDESEAWCS_Tasks.ConveyorLineJob;
using WIDESEAWCS_QuartzJob.Repository;
+using WIDESEAWCS_QuartzJob.StackerCrane;
namespace WIDESEAWCS_Tasks
{
@@ -57,8 +58,13 @@
{
commonStackerCrane.StackerCraneTaskCompletedEventHandler += CommonStackerCrane_StackerCraneTaskCompletedEventHandler;//璁㈤槄浠诲姟瀹屾垚浜嬩欢
}
- commonStackerCrane.CheckStackerCraneTaskCompleted();//闃叉浠诲姟瀹屾垚浜嬩欢鐩戞祴瓒呮椂锛屽啀鎵嬪姩瑙﹀彂涓�娆�
- if (commonStackerCrane.StackerCraneAutoStatusValue == StackerCraneAutoStatus.Automatic && commonStackerCrane.StackerCraneStatusValue == StackerCraneStatus.Normal && commonStackerCrane.StackerCraneWorkStatusValue == StackerCraneWorkStatus.Standby)
+ //commonStackerCrane.CheckStackerCraneTaskCompleted();//闃叉浠诲姟瀹屾垚浜嬩欢鐩戞祴瓒呮椂锛屽啀鎵嬪姩瑙﹀彂涓�娆�
+ 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)
@@ -121,7 +127,7 @@
{
if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
{
- Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.StackerCraneStationCode == task.NextAddress && x.StackerCraneCode==deviceCode);
+ Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == task.NextAddress && x.StackerCraneCode==deviceCode);
if (stationManger == null)
{
_taskExecuteDetailService.AddTaskExecuteDetail(taskNum, $"杈撻�佺嚎鍑哄簱绔欑偣鏈厤缃�,{task.NextAddress}");
@@ -182,6 +188,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)
{
@@ -252,8 +265,8 @@
short command = client.GetValue<R_ConveyorLineCPDB, short>(R_ConveyorLineCPDB.Command, stationManger.StationCode);
if (command==3)//鍑哄簱绔欏彴鏈鍗犵敤
{
- task.NextAddress = stationManger.StackerCraneStationCode;
- _taskRepository.UpdateData(task);
+ //task.NextAddress = stationManger.StackerCraneStationCode;
+ //_taskRepository.UpdateData(task);
return task;
}
else
@@ -319,7 +332,8 @@
}
else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)//鍒ゆ柇鏄惁鏄嚭搴撲换鍔�
{
- string[] targetCodes = task.NextAddress.Split("-");
+ Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == task.NextAddress && x.StackerCraneCode == task.DeviceCode);
+ string[] targetCodes = stationManger.StackerCraneStationCode.Split("-");
if (targetCodes.Length == 3)
{
stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]);
--
Gitblit v1.9.3