From e46aa927d231af83724683c7286d9db503e24cf7 Mon Sep 17 00:00:00 2001
From: z8018 <1282578289@qq.com>
Date: 星期二, 10 六月 2025 11:46:20 +0800
Subject: [PATCH] 1

---
 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/CommonConveyorLightJob.cs |   46 ++++++++++------------------------------------
 1 files changed, 10 insertions(+), 36 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/CommonConveyorLightJob.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/CommonConveyorLightJob.cs"
index dfdcbfc..32caa7f 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/CommonConveyorLightJob.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/CommonConveyorLightJob.cs"
@@ -14,6 +14,15 @@
 
 namespace WIDESEAWCS_Tasks
 {
+    /// <summary>
+    /// 閫氱敤浼犻�佸甫鐏厜鎺у埗浠诲姟 <br/>
+    /// 浠嶱LC璇诲彇绔欑偣鐘舵�佸拰閲婃斁淇″彿锛屾洿鏂扮伅鍏夌姸鎬佸瓧鍏革紝骞惰缃搴旂殑PLC淇″彿 <br/>
+    /// 涓昏鍔熻兘锛� <br/>
+    /// 1. 璇诲彇PLC涓璂B15.922.0鍜孌B15.924.0鐨�16浣嶅竷灏旀暟缁勪綔涓虹珯鐐圭姸鎬佸拰閲婃斁淇″彿 <br/>
+    /// 2. 鏍规嵁璁惧瀛愮爜鍒嗙粍鏇存柊LightStatusStorage涓殑鐘舵�佸瓧鍏� <br/>
+    /// 3. 鏍规嵁褰撳墠鐏厜鐘舵�佽缃甈LC瀵瑰簲鐨勫畬鎴�/閿欒/宸ヤ綔涓�/璇煶淇″彿 <br/>
+    /// 寮傚父澶勭悊锛氳褰曡澶囦唬鐮佸拰鍚嶇О鐩稿叧鐨勫紓甯镐俊鎭�
+    /// </summary>
     [DisallowConcurrentExecution]
     public class CommonConveyorLightJob : JobBase, IJob
     {
@@ -31,9 +40,8 @@
         public Task Execute(IJobExecutionContext context)
         {
             bool flag = context.JobDetail.JobDataMap.TryGetValue("JobParams", out object? value);
-            if (flag && value != null && value is OtherDevice)
+            if (flag && value != null && value is OtherDevice otherDevice)
             {
-                OtherDevice otherDevice = (OtherDevice)value;
                 try
                 {
                     bool[] stationStatusArray = otherDevice.Communicator.Read<bool>("DB15.922.0", 16);
@@ -122,40 +130,6 @@
 
                                     if (otherDevice.GetValue<LightStatusEnum, bool>(LightStatusEnum.LightVoice, deviceChildCodes[i]))
                                         otherDevice.SetValue(LightStatusEnum.LightVoice, false, deviceChildCodes[i]);
-                                }
-                                else if (LightStatusStorage.LightStatusDic[deviceChildCodes[i]] == LightStatusEnum.ReadyRelease)
-                                {
-                                    Dt_Task task = _taskRepository.QueryFirst(x => x.NextAddress.Contains(deviceChildCodes[i]));
-                                    if (task == null)
-                                    {
-                                        Dt_Container container = _containerRepository.QueryFirst(x => x.ContainerCode == deviceChildCodes[i]);
-                                        if (container != null && container.ContainerStatus == ContainerStatusEnum.ReadyRelease.ObjToInt())
-                                        {
-                                            container.ContainerStatus = ContainerStatusEnum.Release.ObjToInt();
-
-                                            _containerRepository.UpdateData(container);
-
-                                            if (!otherDevice.GetValue<LightStatusEnum, bool>(LightStatusEnum.LightCompleted, deviceChildCodes[i]))
-                                                otherDevice.SetValue(LightStatusEnum.LightCompleted, true, deviceChildCodes[i]);
-
-                                            if (otherDevice.GetValue<LightStatusEnum, bool>(LightStatusEnum.LightError, deviceChildCodes[i]))
-                                                otherDevice.SetValue(LightStatusEnum.LightError, false, deviceChildCodes[i]);
-
-                                            if (otherDevice.GetValue<LightStatusEnum, bool>(LightStatusEnum.LightWorking, deviceChildCodes[i]))
-                                                otherDevice.SetValue(LightStatusEnum.LightWorking, false, deviceChildCodes[i]);
-
-                                            if (otherDevice.GetValue<LightStatusEnum, bool>(LightStatusEnum.LightVoice, deviceChildCodes[i]))
-                                                otherDevice.SetValue(LightStatusEnum.LightVoice, false, deviceChildCodes[i]);
-
-                                            //_webSocketServer鍙戦�佹暟鎹�
-                                            _webSocketServer.PublishAllClientPayload(new
-                                            {
-                                                stationCode = deviceChildCodes[i],
-                                                release = 1,
-                                            }.Serialize());
-                                        }
-
-                                    }
                                 }
                                 else if (LightStatusStorage.LightStatusDic[deviceChildCodes[i]] == LightStatusEnum.Ready)
                                 {

--
Gitblit v1.9.3