1
huanghongfeng
2025-10-22 0cbe01e1241f9af562d86dc79b5f0949ada81dba
´úÂë¹ÜÀí/WCS/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs
@@ -6,6 +6,7 @@
using System.Threading.Tasks;
using WIDESEA_Common.Log;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_DTO.Enum;
using WIDESEAWCS_ISystemServices;
@@ -43,12 +44,36 @@
        {
            try
            {
                CommonConveyorLine conveyorLine = (CommonConveyorLine)context.JobDetail.JobDataMap.Get("JobParams");
                if (conveyorLine != null)
                {
                    AQMConveyorRgvommand aQMConveyor=AQMCommand(conveyorLine, "AQM001");
                    //根据设备查找出对应的站台信息
                    /*List<AGVStation> aGVStations = _agvStationService.GetYljSide(conveyorLine.DeviceCode);
                    foreach (var Stations in aGVStations)
                    {
                        PlatformStatus aQMConveyor = StoticCommand(conveyorLine, Stations.ChildPosiDeviceCode);
                        if(aQMConveyor.HCJ_GoodsStatus==0)    //可进行放货
                        {
                            WebResponseContent webResponseContent = new WebResponseContent();
                            //根据类型查找任务
                            if (Stations.Station_material== (int)RGVEquipment.AbnormalOutbound)
                            {
                                //查找是否有异常搬运任务
                                webResponseContent = _taskService.UpdateDeliveryAddress(Stations.HCJStorageaddress.ToString(), 1);   //还需要传入地址
                            }
                            else
                            {
                                //出库站台的任务
                                webResponseContent = _taskService.UpdateDeliveryAddress(Stations.HCJStorageaddress.ToString(), 2);
                            }
                        }
                    }*/
                    /*
                    //安全门开门申请+安全门状态  1
                    if(aQMConveyor.DoorRequest==1)
                    {
@@ -71,7 +96,7 @@
                        //读取DBW8=1,DBW6=1,DBW10=1,DBW4=1,符合后,进行写入切换状态DBW0=3
                        AQMReturnnormal aQMReturnnormal=AQMStoticCommand(conveyorLine, "AQM001");   //判断
                    }
                    }*/
                }
            }
            catch (Exception ex)
@@ -137,5 +162,30 @@
            return conveyorLine.DeviceProDTOs.FirstOrDefault(x => x.DeviceChildCode == PLCmanipula && x.DeviceProParamName == DeviceProParamName && x.DeviceProParamType == DeviceProParamType);
        }
        public PlatformStatus StoticCommand(CommonConveyorLine conveyorLine, string kladder)
        {
            PlatformStatus conveyorRgvCommand = new PlatformStatus();
            List<DeviceProDTO> deviceProDTO6 = conveyorLine.DeviceProDTOs
                .Where(x => x.DeviceChildCode == kladder
                            && x.DeviceProParamType == "ReadDeviceCommand")
                .ToList();
            foreach (var item in deviceProDTO6)
            {
                var paramName = item.DeviceProParamName;
                var propertyInfo = typeof(PlatformStatus).GetProperty(paramName);
                if (propertyInfo != null)
                {
                    if (item.DeviceDataType == "int")
                    {
                        var value = conveyorLine.Communicator.Read<short>(item.DeviceProAddress);
                        propertyInfo.SetValue(conveyorRgvCommand, value);
                    }
                }
            }
            return conveyorRgvCommand;
        }
    }
}