From 2cc4dfef234b47bef364edf798b5051a25f33217 Mon Sep 17 00:00:00 2001 From: hutongqing <hutongqing@hnkhzn.com> Date: 星期五, 30 八月 2024 10:58:56 +0800 Subject: [PATCH] 1 --- WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs | 21 +++++++++++++-------- 1 files changed, 13 insertions(+), 8 deletions(-) diff --git a/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs b/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs index 11a4743..5e14f93 100644 --- a/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs +++ b/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs @@ -2,16 +2,18 @@ using Quartz; using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Text; using System.Threading.Tasks; using WIDESEAWCS_Core.Enums; -using WIDESEAWCS_IBasicInfoService; using WIDESEAWCS_ITaskInfoRepository; using WIDESEAWCS_ITaskInfoService; using WIDESEAWCS_Model.Models; using WIDESEAWCS_QuartzJob; using WIDESEAWCS_QuartzJob.DeviceBase; +using WIDESEAWCS_QuartzJob.Models; +using WIDESEAWCS_QuartzJob.Service; using WIDESEAWCS_QuartzJob.StackerCrane.Enum; using WIDESEAWCS_Tasks.StackerCraneJob; @@ -83,12 +85,15 @@ /// <param name="e"></param> private void CommonStackerCrane_StackerCraneTaskCompletedEventHandler(object? sender, WIDESEAWCS_QuartzJob.StackerCrane.StackerCraneTaskCompletedEventArgs e) { - CommonStackerCrane commonStackerCrane = sender as CommonStackerCrane; - if (commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType) != 5) + CommonStackerCrane? commonStackerCrane = sender as CommonStackerCrane; + if (commonStackerCrane != null) { - Console.Out.WriteLine("TaskCompleted" + e.TaskNum); - _taskService.StackCraneTaskCompleted(e.TaskNum); - commonStackerCrane.SetValue(StackerCraneDBName.WorkType, 5); + if (commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType) != 5) + { + Console.Out.WriteLine("TaskCompleted" + e.TaskNum); + _taskService.StackCraneTaskCompleted(e.TaskNum); + commonStackerCrane.SetValue(StackerCraneDBName.WorkType, 5); + } } } @@ -149,7 +154,7 @@ /// </summary> /// <param name="task">浠诲姟瀹炰綋</param> /// <returns>濡傛灉鏈鍗犵敤锛岃繑鍥炰紶鍏ョ殑浠诲姟淇℃伅锛屽惁鍒欙紝杩斿洖null</returns> - private Dt_Task? OutTaskStationIsOccupied(Dt_Task task) + private Dt_Task? OutTaskStationIsOccupied([NotNull] Dt_Task task) { Dt_Router? router = _routerService.QueryNextRoutes(task.Roadway, task.NextAddress).FirstOrDefault(); if (router != null) @@ -181,7 +186,7 @@ /// <param name="task">浠诲姟瀹炰綋</param> /// <returns></returns> /// <exception cref="Exception"></exception> - public StackerCraneTaskCommand? ConvertToStackerCraneTaskCommand(Dt_Task task) + public StackerCraneTaskCommand? ConvertToStackerCraneTaskCommand([NotNull] Dt_Task task) { StackerCraneTaskCommand stackerCraneTaskCommand = new StackerCraneTaskCommand(); -- Gitblit v1.9.3