Browse Source

位置

Lishi
xxe 2 years ago
parent
commit
aeba513492
2 changed files with 26 additions and 37 deletions
  1. +26
    -24
      HKCardOUT/ViewModels/AdWindowViewModel.cs
  2. +0
    -13
      HKCardOUT/Views/AdWindow.xaml.cs

+ 26
- 24
HKCardOUT/ViewModels/AdWindowViewModel.cs View File

@@ -81,33 +81,35 @@ namespace HKCardOUT.ViewModels
sb2.Append((!Main.GetInstance.GetIsConnect(3) ? "3号未连接" : (Main.GetInstance.GetIsSwipe(3) ? "3号正常" : "3号异常")) + "\r");
RAdinfo.Msg = sb2.ToString();

DataBus.saleLogDtos.TryDequeue(out SaleLogDto info);
ScreenInfoDto data = new ScreenInfoDto
if (DataBus.saleLogDtos.Count > 0)
{
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 (LAdInfo.Info != null && !string.IsNullOrEmpty(LAdInfo.Info.UserName))
{
LAdInfo.AInfo.Insert(0, LAdInfo.Info);
LAdInfo.Info.Time = DateTime.Now.ToString("HH:mm:ss");
}
if (RAdinfo.Info != null && !string.IsNullOrEmpty(RAdinfo.Info.UserName))
DataBus.saleLogDtos.TryDequeue(out SaleLogDto info);
ScreenInfoDto data = new ScreenInfoDto
{
RAdinfo.AInfo.Insert(0, RAdinfo.Info);
RAdinfo.Info.Time = DateTime.Now.ToString("HH:mm:ss");
}
});
LAdInfo.Info = data.Location == "4"||data.Location=="5"||data.Location=="6" ? data : new ScreenInfoDto();
RAdinfo.Info = data.Location == "1" || data.Location == "2" || data.Location == "3" ? 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 (LAdInfo.Info != null && !string.IsNullOrEmpty(LAdInfo.Info.UserName))
{
LAdInfo.AInfo.Insert(0, LAdInfo.Info);
LAdInfo.Info.Time = DateTime.Now.ToString("HH:mm:ss");
}
if (RAdinfo.Info != null && !string.IsNullOrEmpty(RAdinfo.Info.UserName))
{
RAdinfo.AInfo.Insert(0, RAdinfo.Info);
RAdinfo.Info.Time = DateTime.Now.ToString("HH:mm:ss");
}
});
LAdInfo.Info = data.Location == "4" || data.Location == "5" || data.Location == "6" ? data : new ScreenInfoDto();
RAdinfo.Info = data.Location == "1" || data.Location == "2" || data.Location == "3" ? data : new ScreenInfoDto();
}
Thread.Sleep(10);
}, $"屏幕刷卡信息", true);
}


+ 0
- 13
HKCardOUT/Views/AdWindow.xaml.cs View File

@@ -39,19 +39,6 @@ namespace HKCardOUT.Views
this.WindowState = WindowState.Maximized;
(this.DataContext as AdWindowViewModel).InitData();

ThreadManage.GetInstance().StartLong(new Action(() =>
{
if (DataBus.saleLogDtos.Count > 0)
{
if (DataBus.saleLogDtos.TryDequeue(out SaleLogDto info))
{
if (!DataBus.SaleLogDtoList.ContainsKey(info.Location))
DataBus.SaleLogDtoList.TryAdd(info.Location, new ConcurrentQueue<SaleLogDto>());
DataBus.SaleLogDtoList[info.Location].Enqueue(info);
}
}
Thread.Sleep(100);
}), "刷卡队列分配");
InitView2(input);

};


Loading…
Cancel
Save