wangxinhui
2026-02-03 b2b779905bc8a71b52d0e14f91652309d9279878
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Tasks/³ÉÆ·²Ö/ConveyorLineJob_CPH.cs
@@ -89,9 +89,15 @@
                            List<Dt_StationManger> stationMangers = _stationMangerRepository.QueryData(x => x.StationDeviceCode == device.DeviceCode);
                            Task.Run(() =>
                            {
                                bool shouldRestart = true;
                                while (shouldRestart)
                                {
                                try
                                {
                                        shouldRestart = false;
                                    Dt_StationManger? RequestIn = stationMangers.FirstOrDefault(x => x.StationDeviceCode == device.DeviceCode && x.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt());
                                        WriteError($"线程 {Thread.CurrentThread.ManagedThreadId}","开始执行");
                                    while (true)
                                    {
                                        if (RequestIn != null)
@@ -159,15 +165,24 @@
                                }
                                catch (Exception ex)
                                {
                                    Thread.Sleep(1000);
                                        WriteError($"线程 {Thread.CurrentThread.ManagedThreadId}", $"异常:{ex.Message}");
                                        Thread.Sleep(1500);
                                        shouldRestart = true;
                                    }
                                }
                            });
                            Task.Run(() =>
                            {
                                bool shouldRestart = true;
                                while (shouldRestart)
                                {
                                try
                                {
                                        shouldRestart = false;
                                    //获取所有码垛口
                                    List<Dt_StationManger> stationMangersMD = stationMangers.Where(x => x.StationDeviceCode == device.DeviceCode && x.StationType == StationTypeEnum.StationType_OnlyOutbound.ObjToInt()).ToList();
                                        WriteError($"线程 {Thread.CurrentThread.ManagedThreadId}", "开始执行");
                                    while (true)
                                    {
                                        if (stationMangersMD.Count > 0)
@@ -215,7 +230,10 @@
                                }
                                catch (Exception ex)
                                {
                                    Thread.Sleep(1000);
                                        WriteError($"线程 {Thread.CurrentThread.ManagedThreadId}", $"异常:{ex.Message}");
                                        Thread.Sleep(1500);
                                        shouldRestart = true;
                                    }
                                }
                            });