From 6aa77fc8222d353a1f3d99ef3458a8502438db6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A6=82=E6=84=8F=20=E5=BD=AD?= <2417589739@qq.com> Date: Wed, 11 May 2022 21:01:55 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=8A=B6=E6=80=81=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HBLConsole.Business/AbstractServer/Base.cs | 30 +++++++++---------- HBLConsole/App.config | 14 ++++----- HBLConsole/View/OrderStatusView.xaml | 6 ++++ HBLConsole/ViewModel/ViewModelBase.cs | 34 +++++++++++++++------- 4 files changed, 51 insertions(+), 33 deletions(-) diff --git a/HBLConsole.Business/AbstractServer/Base.cs b/HBLConsole.Business/AbstractServer/Base.cs index 1210139..39aa75b 100644 --- a/HBLConsole.Business/AbstractServer/Base.cs +++ b/HBLConsole.Business/AbstractServer/Base.cs @@ -49,20 +49,20 @@ namespace HBLConsole.Business.AbstractServer private void GetMake() { - try - { - string result = string.Empty; - string DeviceSeries=GVL.GeneralConfig.DeviceType.ToString(); - string Version = "1.0.0.0"; - var jsondata = new { DeviceSeries, Version }; - string header = $"[{InternetInfo.StockServer}/GetItemInfo]_[{DateTime.Now.Ticks}]"; - string url = $"{InternetInfo.StockServer}GetDeviceMake"; - result = APIHelper.GetInstance.HttpRequest(url, header, jsondata, RequestType.POST); - } - catch (Exception ex) - { - MessageLog.GetInstance.ShowEx(ex.ToString()); - } + try + { + string result = string.Empty; + string DeviceSeries = GVL.GeneralConfig.DeviceType.ToString(); + string Version = "1.0.0.0"; + var jsondata = new { DeviceSeries, Version }; + string header = $"[{InternetInfo.StockServer}/GetItemInfo]_[{DateTime.Now.Ticks}]"; + string url = $"{InternetInfo.StockServer}GetDeviceMake"; + result = APIHelper.GetInstance.HttpRequest(url, header, jsondata, RequestType.POST); + } + catch (Exception ex) + { + MessageLog.GetInstance.ShowEx(ex.ToString()); + } } /// @@ -84,7 +84,7 @@ namespace HBLConsole.Business.AbstractServer //string url = $"http://192.168.0.62:7000{InternetInfo.StockServer}/GetItemInfo"; string url = $"{InternetInfo.StockServer}GetItemInfo"; - result = APIHelper.GetInstance.HttpRequest(url, header, jsondata, RequestType.POST); + result = APIHelper.GetInstance.HttpRequest(url, header, jsondata, RequestType.POST); // result = APIHelper.GetInstance.HttpRequest("https://bpa.black-pa.com:21527/stock/GetItemInfo", header, jsondata, RequestType.POST); if (PushType == 1) diff --git a/HBLConsole/App.config b/HBLConsole/App.config index 3418976..63ac14e 100644 --- a/HBLConsole/App.config +++ b/HBLConsole/App.config @@ -14,27 +14,27 @@ - - + + - - + - + - + - + diff --git a/HBLConsole/View/OrderStatusView.xaml b/HBLConsole/View/OrderStatusView.xaml index a187b41..973dd98 100644 --- a/HBLConsole/View/OrderStatusView.xaml +++ b/HBLConsole/View/OrderStatusView.xaml @@ -207,7 +207,9 @@ + + @@ -274,9 +276,11 @@ Text="完成时间" /> + + + + diff --git a/HBLConsole/ViewModel/ViewModelBase.cs b/HBLConsole/ViewModel/ViewModelBase.cs index b133266..05c0502 100644 --- a/HBLConsole/ViewModel/ViewModelBase.cs +++ b/HBLConsole/ViewModel/ViewModelBase.cs @@ -188,8 +188,17 @@ namespace HBLConsole.ViewModel { Application.Current.Dispatcher.Invoke(() => { + //orderStatusLists.Where(p=>p.OrderStatus==ORDER_STATUS.COOKING).ToList()?.ForEach(item=> + //{ + // orderStatusLists.Remove(item); + //}); orderStatusLists.Clear(); WaitTakeMeal.Clear(); + for (int i = 0; i < orderStatusLists.Count; i++) + { + GeneralConfig.morkOrderPushes.Enqueue(orderStatusLists.ElementAt(i).OrderPush); + } + }); }), "ClearOrders"); @@ -236,22 +245,25 @@ namespace HBLConsole.ViewModel orderStatusLists.ElementAt(index).EndDate = DateTime.Now.ToString("HH:mm:ss"); TimeSpan timeSpan = DateTime.Now.Subtract(Convert.ToDateTime(orderStatusLists.ElementAt(index).StartDate)); orderStatusLists.ElementAt(index).CompleteDate = $"{timeSpan.TotalSeconds.ToString("0.00")} S"; - WaitTakeMeal.Insert(0, orderStatusLists.ElementAt(index)); - orderStatusLists.RemoveAt(index); + //压力测试时注释,正常使用需要取消注释 + //WaitTakeMeal.Insert(0, orderStatusLists.ElementAt(index)); + //orderStatusLists.RemoveAt(index); }); } break; case ORDER_STATUS.COMPLETED_TAKE: - var re = WaitTakeMeal.FirstOrDefault(p => p.OrderPush.SuborderId == orderStatusChange.SuborderId); - if (re != null) - { - App.Current.Dispatcher.BeginInvoke((Action)delegate - { - WaitTakeMeal.Remove(re); - Json.Data.orderLists.Remove(re); - }); - } + + //压力测试时注释,正常使用需要取消注释 + //var re = WaitTakeMeal.FirstOrDefault(p => p.OrderPush.SuborderId == orderStatusChange.SuborderId); + //if (re != null) + //{ + // App.Current.Dispatcher.BeginInvoke((Action)delegate + // { + // WaitTakeMeal.Remove(re); + // Json.Data.orderLists.Remove(re); + // }); + //} break; default: break;