| | |
| | | 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) |
| | |
| | | } |
| | | 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) |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Thread.Sleep(1000); |
| | | WriteError($"çº¿ç¨ {Thread.CurrentThread.ManagedThreadId}", $"å¼å¸¸:{ex.Message}"); |
| | | Thread.Sleep(1500); |
| | | shouldRestart = true; |
| | | } |
| | | } |
| | | }); |
| | | |