Przeglądaj źródła

Merge branch 'Lishi'

master
pry 2 lat temu
rodzic
commit
e20a5e54cc
5 zmienionych plików z 24 dodań i 4 usunięć
  1. +0
    -1
      HKCardOUT/Bootstrapper.cs
  2. +17
    -2
      HKCardOUT/ViewModels/AdWindowViewModel.cs
  3. +2
    -0
      HKCardOUT/Views/AdWindow.xaml.cs
  4. +3
    -0
      HKCardOUT/Views/RootView.xaml.cs
  5. +2
    -1
      HKLog/HKLogImport.cs

+ 0
- 1
HKCardOUT/Bootstrapper.cs Wyświetl plik

@@ -48,7 +48,6 @@ namespace HKCardOUT
}
Thread.Sleep(3000);
}), "循环状态监测线程", false);
HKLogImport.Init("HKCardOUT");
}

protected override void ConfigureIoC(IStyletIoCBuilder builder)


+ 17
- 2
HKCardOUT/ViewModels/AdWindowViewModel.cs Wyświetl plik

@@ -23,6 +23,7 @@ namespace HKCardOUT.ViewModels
{
Foods.Add("");
}

}

#region 属性
@@ -34,9 +35,9 @@ namespace HKCardOUT.ViewModels
private AdInfoModel _mRAdinfo = new AdInfoModel();

public ObservableCollection<string> Foods { get; set; } = new ObservableCollection<string>();
#endregion


#endregion

void FoodsInit(int[] ScreenLoc)
{
@@ -60,6 +61,16 @@ namespace HKCardOUT.ViewModels
{
FoodsInit(BindScreen);

ThreadManage.GetInstance().StartLong(() =>
{
if (DateTime.Now.Hour == 16)
{
LAdInfo.AInfo = new ObservableCollection<ScreenInfoDto>();
RAdinfo.AInfo = new ObservableCollection<ScreenInfoDto>();
}
Thread.Sleep(5000);
}, "清理屏幕数据", true);

ThreadManage.GetInstance().StartLong(() =>
{
var model = (new HKCore()).PullDaySaleLog(BindScreen);
@@ -105,7 +116,7 @@ namespace HKCardOUT.ViewModels
data.UserName = DataBus.UserListDto
.Where(t => t.Cards.Select(x => x.CardNum).Contains(data.CardNo))
.Select(x => x.Name).FirstOrDefault();
HKLog.HKLogImport.WriteInfo("取出刷卡信息" + data.ToJsonString());
App.Current.Dispatcher.Invoke(() =>
{
if (LAdInfo.Info != null && !string.IsNullOrEmpty(LAdInfo.Info.UserName))
@@ -118,6 +129,10 @@ namespace HKCardOUT.ViewModels
}
}
}
else
{
HKLog.HKLogImport.WriteInfo("未包含屏幕" + BindScreen[i]);
}
}
Thread.Sleep(10);
}, $"屏幕刷卡信息{BindScreen[0]}-{BindScreen[1]}", true);


+ 2
- 0
HKCardOUT/Views/AdWindow.xaml.cs Wyświetl plik

@@ -52,8 +52,10 @@ namespace HKCardOUT.Views
{
if (DataBus.saleLogDtos.Count > 0)
{
HKLog.HKLogImport.WriteInfo("添加刷卡信息");
if (DataBus.saleLogDtos.TryDequeue(out SaleLogDto info))
{
HKLog.HKLogImport.WriteInfo("取出信息加入队列");
if (!DataBus.SaleLogDtoList.ContainsKey(info.Location))
DataBus.SaleLogDtoList.TryAdd(info.Location, new ConcurrentQueue<SaleLogDto>());
DataBus.SaleLogDtoList[info.Location].Enqueue(info);


+ 3
- 0
HKCardOUT/Views/RootView.xaml.cs Wyświetl plik

@@ -1,6 +1,7 @@
using BPA.Helper;
using Helper;
using HKCardOUT.ViewModels;
using HKLog;
using System;
using System.IO;
using System.Linq;
@@ -16,6 +17,8 @@ namespace HKCardOUT.Views
{
public RootView()
{
HKLogImport.Init("HKCardOUT");
HKLogImport.WriteInfo("程序初始化");
InitializeComponent();
MessageLog.GetInstance.NotifyShow = new Action<string>((s) =>
{


+ 2
- 1
HKLog/HKLogImport.cs Wyświetl plik

@@ -7,10 +7,11 @@ namespace HKLog
{
public static void Init(string input)
{
var path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Logs",$"{input}.log");
//日志
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Information()
.WriteTo.File($"Logs/{input}.log", rollingInterval: RollingInterval.Day)
.WriteTo.File(path, rollingInterval: RollingInterval.Day)
.CreateLogger();
}
public static void WriteInfo(string msg)


Ładowanie…
Anuluj
Zapisz