From 18828b299d8208cfba1e70b08ba86b4e9c5b91f5 Mon Sep 17 00:00:00 2001
From: Admin <Admin@ADMIN>
Date: 星期二, 25 十一月 2025 14:51:09 +0800
Subject: [PATCH] 优化入库效率

---
 代码管理/WCS/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs |   85 +++++++++++++++++++-----------------------
 1 files changed, 39 insertions(+), 46 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs"
index b705d00..a944ecd 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs"
@@ -52,13 +52,13 @@
                         if (Stations.Station_material == (int)RGVEquipment.AQMexit)
                         {
 
-                            bool Security = SecurityDoorEquipment(conveyorLine, Stations);
+                            bool Security = SecurityDoorEquipment(conveyorLine, Stations);  //瀹夊叏闂�
                             if (Security) continue;
 
                         }
                         else
                         {
-                            bool HCJPlat=PlatformEquipmentInformation(conveyorLine, Stations);
+                            bool HCJPlat=PlatformEquipmentInformation(conveyorLine, Stations);  //寮傚父绔欏彴锛屽嚭搴撶珯鍙�
                             if (HCJPlat) continue;
                         }
                         
@@ -76,12 +76,15 @@
         //澶勭悊瀹夊叏闂ㄧ殑閫昏緫
         private void HandleDoorRequest(AQMReturnnormal aQMConveyor, AGVStation aGVStation,int tasktype)  //1锛氬叆搴�  2锛氬嚭搴�
         {
-            if (_gvOperationService.AQMReadAlarminform(tasktype) && _equipmentStatusService.GetSCstatus())
+            /*bool RGValarm = _gvOperationService.AQMReadAlarminform(tasktype);
+            bool SCstatus = _equipmentStatusService.GetSCstatus();
+           if (RGValarm || SCstatus)
             {
                 //鍐欏叆鎶ヨ
                 GetDeviceAddress.WriteSecurityDoorpolice(aGVStation.ChildPosiDeviceCode, "AlarmSummary", 1);
-                _gvOperationService.WriteOutbuttonpause(null);
-            }
+
+                bool RGVRGV_DWorkingmode = tasktype == 1 ? _gvOperationService.InWriteOutbuttonpause(null).Status : _gvOperationService.WriteOutbuttonpause(null).Status;
+            }*/
 
             if (aQMConveyor.DoorRequest == 1 && aQMConveyor.IndicatorStatus == (int)SafetyDoorStatus.YellowBlink2Hz)
             {
@@ -121,26 +124,29 @@
             {
                 // 鑾峰彇瀹夊叏闂ㄤ俊鎭�
                 AQMReturnnormal aQMConveyor = AQMStoticCommand(conveyorLine, Stations.ChildPosiDeviceCode);
+                if(aQMConveyor != null)
+                {
+                    if (aQMConveyor.SafetyLockStatus == 1)
+                    {
+                        //鍐欏叆鎶ヨ
+                        GetDeviceAddress.WriteSecurityDoorpolice(Stations.ChildPosiDeviceCode, "AlarmSummary", 0);
+                        //鍐欏叆寮�闂ㄤ俊鍙�
+                        GetDeviceAddress.WriteSecurityDoorpolice(Stations.ChildPosiDeviceCode, "OpenDoor", 0);
+                    }
 
-                if (aQMConveyor.SafetyLockStatus == 1)
-                {
-                    //鍐欏叆鎶ヨ
-                    GetDeviceAddress.WriteSecurityDoorpolice(Stations.ChildPosiDeviceCode, "AlarmSummary", 0);
-                    //鍐欏叆寮�闂ㄤ俊鍙�
-                    GetDeviceAddress.WriteSecurityDoorpolice(Stations.ChildPosiDeviceCode, "OpenDoor", 0);
+                    // 鏍规嵁浠诲姟绫诲瀷閫夋嫨澶勭悊绛栫暐
+                    if (Stations.Station_tasktype == (int)RGVTasktype.Outbound)
+                    {
+                        if (aQMConveyor.EmergencyStopStatus == 0 || aQMConveyor.SafetyLockStatus==0) _gvOperationService.WriteOutbuttonpause(null);
+                        HandleDoorRequest(aQMConveyor, Stations, 2);
+                    }
+                    else
+                    {
+                        if (aQMConveyor.EmergencyStopStatus == 0 || aQMConveyor.SafetyLockStatus == 0) _gvOperationService.InWriteOutbuttonpause(null);
+                        HandleDoorRequest(aQMConveyor, Stations, 1);
+                    }
                 }
-
-                // 鏍规嵁浠诲姟绫诲瀷閫夋嫨澶勭悊绛栫暐
-                if (Stations.Station_tasktype == (int)RGVTasktype.Outbound)
-                {
-                    if (aQMConveyor.EmergencyStopStatus == 0) _gvOperationService.WriteOutbuttonpause(null);
-                    HandleDoorRequest(aQMConveyor, Stations, 2);
-                }
-                else
-                {
-                    if (aQMConveyor.EmergencyStopStatus == 0) _gvOperationService.InWriteOutbuttonpause(null);
-                    HandleDoorRequest(aQMConveyor, Stations, 1);
-                }
+                
                 return false;
             }
             catch (Exception ex)
@@ -154,8 +160,7 @@
         {
             try
             {
-                PlatformStatus aQMConveyor = StoticCommand(conveyorLine, Stations.ChildPosiDeviceCode);
-                if (aQMConveyor.HCJ_GoodsStatus == 0)    //鍙繘琛屾斁璐�
+                if (StoticCommand(conveyorLine, Stations.HCJStorageaddress.ToString()))    //鍙繘琛屾斁璐�
                 {
                     WebResponseContent webResponseContent = new WebResponseContent();
                     //鏍规嵁绫诲瀷鏌ユ壘浠诲姟
@@ -170,6 +175,7 @@
                         webResponseContent = _taskService.UpdateDeliveryAddress(Stations.HCJStorageaddress.ToString(), 2);
                     }
                 }
+
                 return false;
             }
             catch (Exception ex)
@@ -221,29 +227,16 @@
         }
 
         //绔欏彴淇″彿
-        public PlatformStatus StoticCommand(CommonConveyorLine conveyorLine, string kladder)
+        public bool StoticCommand(CommonConveyorLine conveyorLine, string kladder)
         {
-            PlatformStatus conveyorRgvCommand = new PlatformStatus();
-            List<DeviceProDTO> deviceProDTO6 = conveyorLine.DeviceProDTOs
-                .Where(x => x.DeviceChildCode == kladder
-                            && x.DeviceProParamName== "HCJ_GoodsStatus"
-                            && x.DeviceProParamType == "ReadDeviceCommand")
-                .ToList();
-            foreach (var item in deviceProDTO6)
-            {
-                var paramName = item.DeviceProParamName;
-                var propertyInfo = typeof(PlatformStatus).GetProperty(paramName);
+            DeviceProDTO? deviceProDTO6 = conveyorLine.DeviceProDTOs.FirstOrDefault(x => x.DeviceChildCode == kladder
+                            && x.DeviceProParamName == "HCJ_GoodsStatus"
+                            && x.DeviceProParamType == "ReadDeviceCommand");
+            if(deviceProDTO6 == null) { return false; }
 
-                if (propertyInfo != null)
-                {
-                    if (item.DeviceDataType == "short")
-                    {
-                        var value = conveyorLine.Communicator.Read<short>(item.DeviceProAddress);
-                        propertyInfo.SetValue(conveyorRgvCommand, value);
-                    }
-                }
-            }
-            return conveyorRgvCommand;
+            var value = conveyorLine.Communicator.Read<short>(deviceProDTO6.DeviceProAddress);
+            if (value == 0) {  return true; }
+            return false;
         }
 
 

--
Gitblit v1.9.3