Browse Source

测试修改

Lishi
xxe 2 years ago
parent
commit
1efa6cddb1
3 changed files with 7 additions and 119 deletions
  1. +3
    -2
      HKCardOUT/Logic/Service/HKCore.cs
  2. +1
    -114
      HKCardOUT/ViewModels/AdWindowViewModel.cs
  3. +3
    -3
      HKCardOUT/Views/AdWindow.xaml.cs

+ 3
- 2
HKCardOUT/Logic/Service/HKCore.cs View File

@@ -294,10 +294,11 @@ namespace HKCardOUT.Logic.Service
// .WhereIF(screen == 1, t => t.Location == "1" || t.Location == "2")
// .WhereIF(screen ==2, t => t.Location == "5" || t.Location == "6").Select(t => t.Location).ToList();
//return count.GroupBy(t => t).ToDictionary(t => t.Key, t => t.Count());

string a = screen[0].ToString();
string b = screen[1].ToString();
var today = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd 00:00:00"));
var count = DbContext.Context.Queryable<SaleLog>().Where(t => t.CreateTime >= today)
.WhereIF(screen.Length == 2, t => t.Location == $"{screen[0]}" || t.Location == $"{screen[1]}").Select(t => t.Location).ToList();
.WhereIF(screen.Length == 2, t => t.Location == a || t.Location == b).Select(t => t.Location).ToList();
return count.GroupBy(t => t).ToDictionary(t => t.Key, t => t.Count());
}
}


+ 1
- 114
HKCardOUT/ViewModels/AdWindowViewModel.cs View File

@@ -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);
}
}
}

+ 3
- 3
HKCardOUT/Views/AdWindow.xaml.cs View File

@@ -43,9 +43,9 @@ namespace HKCardOUT.Views
if (BindScreen != -1)
{
int[] NotchNum = new int[2];
if (bindScreen == 0) NotchNum[0] = 1; NotchNum[1] = 2;
if (bindScreen == 1) NotchNum[0] = 5; NotchNum[1] = 6;
if (bindScreen == 2) NotchNum[0] = 3; NotchNum[1] = 4;
if (bindScreen == 1) { NotchNum[0] = 1; NotchNum[1] = 2; }
if (bindScreen == 2) { NotchNum[0] = 5; NotchNum[1] = 6; }
if (bindScreen == 0) { NotchNum[0] = 3; NotchNum[1] = 4; }
(this.DataContext as AdWindowViewModel).InitData(NotchNum);




Loading…
Cancel
Save