From a38b50675f2cf8e813bd337ca2f9d9456cc421d3 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期四, 17 十月 2024 09:50:14 +0800
Subject: [PATCH] WCS

---
 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs |   34 ++++++----------------------------
 1 files changed, 6 insertions(+), 28 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs"
index 5e14f93..6738196 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs"
@@ -6,6 +6,7 @@
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using WIDESEAWCS_Common.StackerCraneEnum;
 using WIDESEAWCS_Core.Enums;
 using WIDESEAWCS_ITaskInfoRepository;
 using WIDESEAWCS_ITaskInfoService;
@@ -39,37 +40,12 @@
         {
             try
             {
-                CommonStackerCrane commonStackerCrane = (CommonStackerCrane)context.JobDetail.JobDataMap.Get("JobParams");
-                if (commonStackerCrane != null)
+                SpeStackerCrane commonStackerCrane1 = (SpeStackerCrane)context.JobDetail.JobDataMap.Get("JobParams");
+                if (commonStackerCrane1.GetStackerCraneStatus<StackerCraneAutoStatus>() == StackerCraneAutoStatus.Automatic && commonStackerCrane1.GetStackerCraneStatus<Onlinestate>() == Onlinestate.online)
                 {
-                    if (!commonStackerCrane.IsEventSubscribed)
-                    {
-                        commonStackerCrane.StackerCraneTaskCompletedEventHandler += CommonStackerCrane_StackerCraneTaskCompletedEventHandler;//璁㈤槄浠诲姟瀹屾垚浜嬩欢
-                    }
 
-                    if (commonStackerCrane.StackerCraneAutoStatusValue == StackerCraneAutoStatus.Automatic && commonStackerCrane.StackerCraneStatusValue == StackerCraneStatus.Normal)
-                    {
-                        commonStackerCrane.CheckStackerCraneTaskCompleted();//闃叉浠诲姟瀹屾垚浜嬩欢鐩戞祴瓒呮椂锛屽啀鎵嬪姩瑙﹀彂涓�娆�
-
-                        if (commonStackerCrane.StackerCraneWorkStatusValue == StackerCraneWorkStatus.Standby)
-                        {
-                            Dt_Task? task = GetTask(commonStackerCrane);
-                            if (task != null)
-                            {
-                                StackerCraneTaskCommand? stackerCraneTaskCommand = ConvertToStackerCraneTaskCommand(task);
-                                if (stackerCraneTaskCommand != null)
-                                {
-                                    bool sendFlag = commonStackerCrane.SendCommand(stackerCraneTaskCommand);
-                                    if (sendFlag)
-                                    {
-                                        commonStackerCrane.LastTaskType = task.TaskType;
-                                        _taskService.UpdateTaskStatusToNext(task.TaskNum);
-                                    }
-                                }
-                            }
-                        }
-                    }
                 }
+
             }
             catch (Exception ex)
             {
@@ -86,6 +62,8 @@
         private void CommonStackerCrane_StackerCraneTaskCompletedEventHandler(object? sender, WIDESEAWCS_QuartzJob.StackerCrane.StackerCraneTaskCompletedEventArgs e)
         {
             CommonStackerCrane? commonStackerCrane = sender as CommonStackerCrane;
+            SpeStackerCrane? commonStackerCrane1 = sender as SpeStackerCrane;
+            commonStackerCrane1.GetStackerCraneStatus<StackerCraneDBName>();
             if (commonStackerCrane != null)
             {
                 if (commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType) != 5)

--
Gitblit v1.9.3