wanshenmean
2026-02-05 c388f1acccd0b7e76a4366fbaddaca6551826b74
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/QuartzNet/QuartzNetExtension.cs
@@ -47,7 +47,7 @@
                    {
                        try
                        {
                            if (!x.DeviceName.Contains("机械手"))
                            if (!x.DevicePlcType.Contains("Socket"))
                            {
                                #region 连接PLC
@@ -93,7 +93,7 @@
                                }).ToList();
                                // 根据设备类型获取设备协议详情
                                List<DeviceProtocolDetailDTO> deviceProtocolDetails = _deviceProtocolDetailService.GetDeviceProtocolDetailsByDeviceType(x.DeviceType);
                                List<DeviceProtocolDetailDTO> deviceProtocolDetails = _deviceProtocolDetailService.GetDeviceProtocolDetailsByDeviceId(x.Id);
                                // 加载设备程序集
                                Assembly assemblyDevice = Assembly.Load($"WIDESEAWCS_QuartzJob");
@@ -121,14 +121,14 @@
                });
                for (int i = 0; i < dispatches.Count; i++)
                {
                    var targetDevice = deviceInfos.FirstOrDefault(x => x.Id == dispatches[i].Id);
                    var targetDevice = deviceInfos.FirstOrDefault(x => x.DispatchId == dispatches[i].Id);
                    if (targetDevice is null) continue;
                    // 使用模式匹配
                    dispatches[i].JobParams = targetDevice switch
                    {
                        { DeviceName: var name } when name.Contains("机械手")
                        { DevicePlcType: var type } when type.Contains("Socket")
                            => new RobotCraneDevice { DeviceCode = targetDevice.DeviceCode, DeviceName = targetDevice.DeviceName, IPAddress = targetDevice.DeviceIp + ":" + targetDevice.DevicePort },
                        _ => targetDevice.Device
                    };