From 438a163b5eb1e8a40e7f39f46602962b7f95a6f6 Mon Sep 17 00:00:00 2001
From: xxyy <cathay_xy@163.com>
Date: 星期一, 10 三月 2025 15:52:35 +0800
Subject: [PATCH] 更新库存状态并清理相关缓存

---
 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerStationJob/CommonStackerStationCraneJob.cs |   18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerStationJob/CommonStackerStationCraneJob.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerStationJob/CommonStackerStationCraneJob.cs
index 8e4d073..73152f9 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerStationJob/CommonStackerStationCraneJob.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerStationJob/CommonStackerStationCraneJob.cs
@@ -22,6 +22,7 @@
 using WIDESEAWCS_QuartzJob.StackerCrane.Enum;
 using WIDESEAWCS_SignalR;
 using WIDESEAWCS_Tasks.StackerCraneJob;
+using WIDESEAWCS_Common;
 
 namespace WIDESEAWCS_Tasks
 {
@@ -51,10 +52,6 @@
         {
             try
             {
-                // speStackerCrane.GetStackerCraneStatus<StackerCraneAutoStatus>();
-                // speStackerCrane.GetStackerCraneStatus<StackerCraneWorkStatus>();
-                // speStackerCrane.GetStackerCraneStatus<StackerCraneStatus>();
-
                 CommonStackerStationCrane commonStackerCrane = (CommonStackerStationCrane)context.JobDetail.JobDataMap.Get("JobParams");
                 if (commonStackerCrane != null)
                 {
@@ -71,7 +68,12 @@
 
                         if (commonStackerCrane.StackerCraneWorkStatusValue == StackerCraneWorkStatus.Standby)
                         {
-                            Dt_Task? task = GetTask(commonStackerCrane);
+                            Dt_Task? task = null;
+                            if (StaticVariable.isLineRun)
+                            {
+                                StaticVariable.isStackerRun = false;
+                                task = GetTask(commonStackerCrane);
+                            }
                             if (task != null)
                             {
                                 StackerCraneTaskCommand? stackerCraneTaskCommand = ConvertToStackerCraneTaskCommand(task);
@@ -81,8 +83,6 @@
                                     bool sendFlag = commonStackerCrane.SendCommand(stackerCraneTaskCommand);
                                     if (sendFlag)
                                     {
-                                        //commonStackerCrane.LastTaskType = task.TaskType;
-                                        //_taskService.UpdateTaskStatusToNext(task.TaskNum);
                                         StringBuilder builder = new StringBuilder();
                                         builder.AppendLine();
                                         builder.AppendLine($"銆恵commonStackerCrane.DeviceName}銆戝爢鍨涙満鐘舵�侊細銆恵commonStackerCrane.StackerCraneStatusDes}銆�,鏃堕棿锛氥�恵DateTime.Now}銆�");
@@ -131,6 +131,10 @@
                 WriteError("CommonStackerStationCraneJob", "test", ex);
                 //Console.WriteLine(nameof(CommonStackerCraneJob) + ":" + ex.ToString());
             }
+            finally
+            {
+                StaticVariable.isStackerRun = true;
+            }
             //WriteDebug("CommonStackerStationCraneJob", "test");
             return Task.CompletedTask;
         }

--
Gitblit v1.9.3