|
|
@@ -117,25 +117,6 @@ namespace HKCardOUT.ViewModels |
|
|
|
if (Foods == null) |
|
|
|
{ |
|
|
|
string GateId = string.Empty; |
|
|
|
//int[] loc = new int[2]; |
|
|
|
//if (ScreenLoc == 0) |
|
|
|
//{ |
|
|
|
// loc[0] = 0; |
|
|
|
// loc[1] = 1; |
|
|
|
// GateId = DataBus.StoreInfo.Devices.Where(t => t.Address == "02" || t.Address == "01").Select(t => t.GateId).FirstOrDefault(); |
|
|
|
//} |
|
|
|
//else if (ScreenLoc == 1) |
|
|
|
//{ |
|
|
|
// loc[0] = 4; |
|
|
|
// loc[1] = 5; |
|
|
|
// GateId = DataBus.StoreInfo.Devices.Where(t => t.Address == "05" || t.Address == "06").Select(t => t.GateId).FirstOrDefault(); |
|
|
|
//} |
|
|
|
//else if (ScreenLoc == 2) |
|
|
|
//{ |
|
|
|
// loc[0] = 2; |
|
|
|
// loc[1] = 3; |
|
|
|
// GateId = DataBus.StoreInfo.Devices.Where(t => t.Address == "03" || t.Address == "04").Select(t => t.GateId).FirstOrDefault(); |
|
|
|
//} |
|
|
|
GateId = DataBus.StoreInfo.Devices.Where(t => t.Address == $"0{ScreenLoc[0]}" || t.Address == $"0{ScreenLoc[1]}").Select(t => t.GateId).FirstOrDefault(); |
|
|
|
var res = DataBus.Menu.GateFood.Where(t => t.GateId == GateId)?.Select(t => t.Foods)?.FirstOrDefault(); |
|
|
|
if (res != null) Foods = new ObservableCollection<string>(res); |
|
|
@@ -160,41 +141,11 @@ namespace HKCardOUT.ViewModels |
|
|
|
|
|
|
|
public void InitData(int[] BindScreen) |
|
|
|
{ |
|
|
|
//int BindScreen |
|
|
|
FoodsInit(BindScreen); |
|
|
|
|
|
|
|
ThreadManage.GetInstance().StartLong(() => |
|
|
|
{ |
|
|
|
var model = (new HKCore()).PullDaySaleLog(BindScreen); |
|
|
|
|
|
|
|
//if (BindScreen == 1) |
|
|
|
//{ |
|
|
|
// LGate = "6号档口"; |
|
|
|
// RGate = "5号档口"; |
|
|
|
// LCount = model.Where(t => t.Key == "6").FirstOrDefault().Value; |
|
|
|
// RCount = model.Where(t => t.Key == "5").FirstOrDefault().Value; |
|
|
|
// LMsg = HKControl.Main.GetInstance.GetIsSwipe(6) ? "正常" : "异常"; |
|
|
|
// RMsg = HKControl.Main.GetInstance.GetIsSwipe(5) ? "正常" : "异常"; |
|
|
|
//} |
|
|
|
//if (BindScreen == 0) |
|
|
|
//{ |
|
|
|
// LGate = "2号档口"; |
|
|
|
// RGate = "1号档口"; |
|
|
|
// LCount = model.Where(t => t.Key == "2").FirstOrDefault().Value; |
|
|
|
// RCount = model.Where(t => t.Key == "1").FirstOrDefault().Value; |
|
|
|
// LMsg = HKControl.Main.GetInstance.GetIsSwipe(6) ? "正常" : "异常"; |
|
|
|
// RMsg = HKControl.Main.GetInstance.GetIsSwipe(5) ? "正常" : "异常"; |
|
|
|
//} |
|
|
|
//if (BindScreen == 2) |
|
|
|
//{ |
|
|
|
// LGate = "4号档口"; |
|
|
|
// RGate = "3号档口"; |
|
|
|
// LCount = model.Where(t => t.Key == "4").FirstOrDefault().Value; |
|
|
|
// RCount = model.Where(t => t.Key == "3").FirstOrDefault().Value; |
|
|
|
// LMsg = HKControl.Main.GetInstance.GetIsSwipe(4) ? "正常" : "异常"; |
|
|
|
// RMsg = HKControl.Main.GetInstance.GetIsSwipe(3) ? "正常" : "异常"; |
|
|
|
//} |
|
|
|
|
|
|
|
LGate = $"{BindScreen[1]}号档口"; |
|
|
|
RGate = $"{BindScreen[0]}号档口"; |
|
|
|
LCount = model.Where(t => t.Key == $"{BindScreen[1]}").FirstOrDefault().Value; |
|
|
@@ -202,7 +153,6 @@ namespace HKCardOUT.ViewModels |
|
|
|
LMsg = HKControl.Main.GetInstance.GetIsSwipe(BindScreen[1]) ? "正常" : "异常"; |
|
|
|
RMsg = HKControl.Main.GetInstance.GetIsSwipe(BindScreen[0]) ? "正常" : "异常"; |
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < BindScreen.Length; i++) |
|
|
|
{ |
|
|
|
if (DataBus.SaleLogDtoList.ContainsKey(BindScreen[i].ToString())) |
|
|
@@ -235,71 +185,8 @@ namespace HKCardOUT.ViewModels |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//if (DataBus.saleLogDtos.TryDequeue(out SaleLogDto info)) |
|
|
|
//{ |
|
|
|
// ScreenInfoDto data = new ScreenInfoDto |
|
|
|
// { |
|
|
|
// CardNo = info.CardNo, |
|
|
|
// UserName = "", |
|
|
|
// Location = info.Location, |
|
|
|
// }; |
|
|
|
// data.UserName = DataBus.UserListDto |
|
|
|
// .Where(t => t.Cards.Select(x => x.CardNum).Contains(data.CardNo)) |
|
|
|
// .Select(x => x.Name).FirstOrDefault(); |
|
|
|
|
|
|
|
// App.Current.Dispatcher.Invoke(() => |
|
|
|
// { |
|
|
|
// if (LInfo != null && !string.IsNullOrEmpty(LInfo.UserName)) |
|
|
|
// ALInfo.Insert(0, LInfo); LInfo.Time = DateTime.Now.ToString("HH:mm:ss"); |
|
|
|
// if (RInfo != null && !string.IsNullOrEmpty(RInfo.UserName)) |
|
|
|
// ARInfo.Insert(0, RInfo); RInfo.Time = DateTime.Now.ToString("HH:mm:ss"); |
|
|
|
// }); |
|
|
|
// LInfo = data.Location == $"{BindScreen[1]}" ? data : new ScreenInfoDto(); |
|
|
|
// RInfo = data.Location == $"{BindScreen[0]}" ? data : new ScreenInfoDto(); |
|
|
|
|
|
|
|
|
|
|
|
//if (BindScreen == 1) |
|
|
|
//{ |
|
|
|
// App.Current.Dispatcher.Invoke(() => |
|
|
|
// { |
|
|
|
// if (LInfo != null && !string.IsNullOrEmpty(LInfo.UserName)) |
|
|
|
// ALInfo.Insert(0, LInfo); LInfo.Time = DateTime.Now.ToString("HH:mm:ss"); |
|
|
|
// if (RInfo != null && !string.IsNullOrEmpty(RInfo.UserName)) |
|
|
|
// ARInfo.Insert(0, RInfo); RInfo.Time = DateTime.Now.ToString("HH:mm:ss"); |
|
|
|
// }); |
|
|
|
// LInfo = data.Location == "6" ? data : new ScreenInfoDto(); |
|
|
|
// RInfo = data.Location == "5" ? data : new ScreenInfoDto(); |
|
|
|
//} |
|
|
|
//if (BindScreen == 0) |
|
|
|
//{ |
|
|
|
// App.Current.Dispatcher.Invoke(() => |
|
|
|
// { |
|
|
|
// if (LInfo != null && !string.IsNullOrEmpty(LInfo.UserName)) |
|
|
|
// ALInfo.Insert(0, LInfo); LInfo.Time = DateTime.Now.ToString("HH:mm:ss"); |
|
|
|
// if (RInfo != null && !string.IsNullOrEmpty(RInfo.UserName)) |
|
|
|
// ARInfo.Insert(0, RInfo); RInfo.Time = DateTime.Now.ToString("HH:mm:ss"); |
|
|
|
// }); |
|
|
|
// LInfo = data.Location == "2" ? data : new ScreenInfoDto(); |
|
|
|
// RInfo = data.Location == "1" ? data : new ScreenInfoDto(); |
|
|
|
//} |
|
|
|
//if (BindScreen == 2) |
|
|
|
//{ |
|
|
|
// App.Current.Dispatcher.Invoke(() => |
|
|
|
// { |
|
|
|
// if (LInfo != null && !string.IsNullOrEmpty(LInfo.UserName)) |
|
|
|
// ALInfo.Insert(0, LInfo); LInfo.Time = DateTime.Now.ToString("HH:mm:ss"); |
|
|
|
// if (RInfo != null && !string.IsNullOrEmpty(RInfo.UserName)) |
|
|
|
// ARInfo.Insert(0, RInfo); RInfo.Time = DateTime.Now.ToString("HH:mm:ss"); |
|
|
|
// }); |
|
|
|
// LInfo = data.Location == "4" ? data : new ScreenInfoDto(); |
|
|
|
// RInfo = data.Location == "3" ? data : new ScreenInfoDto(); |
|
|
|
//} |
|
|
|
//} |
|
|
|
Thread.Sleep(100); |
|
|
|
}, $"屏幕刷卡信息{BindScreen}", true); |
|
|
|
}, $"屏幕刷卡信息{BindScreen[0]}-{BindScreen[1]}", true); |
|
|
|
} |
|
|
|
} |
|
|
|
} |