diff --git a/HBLConsole.MORKM/Control_MORKM.cs b/HBLConsole.MORKM/Control_MORKM.cs index 6245e8b..2ac7842 100644 --- a/HBLConsole.MORKM/Control_MORKM.cs +++ b/HBLConsole.MORKM/Control_MORKM.cs @@ -256,6 +256,7 @@ namespace HBLConsole.MORKM MessageLog.GetInstance.Show($"接收到{OrderCount}次订单"); if (order is MorkOrderPush morkOrderPush) { + List locs = new List(); foreach (var item in morkOrderPush.GoodBatchings) { var res = Json.Data.orderMaterialDelivery?.BatchingInfo?.FirstOrDefault(p => p.BatchingId == item.BatchingId); @@ -265,8 +266,7 @@ namespace HBLConsole.MORKM { if (loc >= 1 && loc <= 5) { - if (mORKS.RBTakeNoodleTask.FirstOrDefault(p => p.SuborderId == morkOrderPush.SuborderId) == null) - mORKS.RBTakeNoodleTask.Enqueue(new OrderLocInfo() { Loc = ushort.Parse(res.BatchingLoc), SuborderId = morkOrderPush.SuborderId, BatchingId = res.BatchingId }); + locs.Add(new OrderLocInfo() { Loc = ushort.Parse(res.BatchingLoc), SuborderId = morkOrderPush.SuborderId, BatchingId = res.BatchingId }); } else if (loc >= 10 && loc <= 11) { @@ -287,8 +287,31 @@ namespace HBLConsole.MORKM } } } - } + + while (locs.Count > 0) + { + for (int i = 0; i < locs.Count; i++) + { + var res = locs.FirstOrDefault(p => p.Loc % 2 != 0); + if (res != null) + { + if (mORKS.RBTakeNoodleTask.FirstOrDefault(p => p.SuborderId == res.SuborderId) == null) + mORKS.RBTakeNoodleTask.Enqueue(res); + locs.Remove(res); + + } + else + { + if (mORKS.RBTakeNoodleTask.FirstOrDefault(p => p.SuborderId == locs[i].SuborderId) == null) + mORKS.RBTakeNoodleTask.Enqueue(locs[i]); + locs.RemoveAt(i); + + } + } + } + + } } public void Main() diff --git a/HBLConsole/App.xaml.cs b/HBLConsole/App.xaml.cs index 614bfcd..0e9913a 100644 --- a/HBLConsole/App.xaml.cs +++ b/HBLConsole/App.xaml.cs @@ -36,7 +36,6 @@ namespace HBLConsole protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); - //SystemHelper.GetInstance.AutoStart(true); ViewModelBase.Init(); SystemHelper.GetInstance.CreateDesktopShortcut(); AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;