@@ -48,7 +48,6 @@ namespace HKCardOUT | |||||
} | } | ||||
Thread.Sleep(3000); | Thread.Sleep(3000); | ||||
}), "循环状态监测线程", false); | }), "循环状态监测线程", false); | ||||
HKLogImport.Init("HKCardOUT"); | |||||
} | } | ||||
protected override void ConfigureIoC(IStyletIoCBuilder builder) | protected override void ConfigureIoC(IStyletIoCBuilder builder) | ||||
@@ -23,6 +23,7 @@ namespace HKCardOUT.ViewModels | |||||
{ | { | ||||
Foods.Add(""); | Foods.Add(""); | ||||
} | } | ||||
} | } | ||||
#region 属性 | #region 属性 | ||||
@@ -34,9 +35,9 @@ namespace HKCardOUT.ViewModels | |||||
private AdInfoModel _mRAdinfo = new AdInfoModel(); | private AdInfoModel _mRAdinfo = new AdInfoModel(); | ||||
public ObservableCollection<string> Foods { get; set; } = new ObservableCollection<string>(); | public ObservableCollection<string> Foods { get; set; } = new ObservableCollection<string>(); | ||||
#endregion | |||||
#endregion | |||||
void FoodsInit(int[] ScreenLoc) | void FoodsInit(int[] ScreenLoc) | ||||
{ | { | ||||
@@ -60,6 +61,16 @@ namespace HKCardOUT.ViewModels | |||||
{ | { | ||||
FoodsInit(BindScreen); | 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(() => | ThreadManage.GetInstance().StartLong(() => | ||||
{ | { | ||||
var model = (new HKCore()).PullDaySaleLog(BindScreen); | var model = (new HKCore()).PullDaySaleLog(BindScreen); | ||||
@@ -105,7 +116,7 @@ namespace HKCardOUT.ViewModels | |||||
data.UserName = DataBus.UserListDto | data.UserName = DataBus.UserListDto | ||||
.Where(t => t.Cards.Select(x => x.CardNum).Contains(data.CardNo)) | .Where(t => t.Cards.Select(x => x.CardNum).Contains(data.CardNo)) | ||||
.Select(x => x.Name).FirstOrDefault(); | .Select(x => x.Name).FirstOrDefault(); | ||||
HKLog.HKLogImport.WriteInfo("取出刷卡信息" + data.ToJsonString()); | |||||
App.Current.Dispatcher.Invoke(() => | App.Current.Dispatcher.Invoke(() => | ||||
{ | { | ||||
if (LAdInfo.Info != null && !string.IsNullOrEmpty(LAdInfo.Info.UserName)) | 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); | Thread.Sleep(10); | ||||
}, $"屏幕刷卡信息{BindScreen[0]}-{BindScreen[1]}", true); | }, $"屏幕刷卡信息{BindScreen[0]}-{BindScreen[1]}", true); | ||||
@@ -52,8 +52,10 @@ namespace HKCardOUT.Views | |||||
{ | { | ||||
if (DataBus.saleLogDtos.Count > 0) | if (DataBus.saleLogDtos.Count > 0) | ||||
{ | { | ||||
HKLog.HKLogImport.WriteInfo("添加刷卡信息"); | |||||
if (DataBus.saleLogDtos.TryDequeue(out SaleLogDto info)) | if (DataBus.saleLogDtos.TryDequeue(out SaleLogDto info)) | ||||
{ | { | ||||
HKLog.HKLogImport.WriteInfo("取出信息加入队列"); | |||||
if (!DataBus.SaleLogDtoList.ContainsKey(info.Location)) | if (!DataBus.SaleLogDtoList.ContainsKey(info.Location)) | ||||
DataBus.SaleLogDtoList.TryAdd(info.Location, new ConcurrentQueue<SaleLogDto>()); | DataBus.SaleLogDtoList.TryAdd(info.Location, new ConcurrentQueue<SaleLogDto>()); | ||||
DataBus.SaleLogDtoList[info.Location].Enqueue(info); | DataBus.SaleLogDtoList[info.Location].Enqueue(info); | ||||
@@ -1,6 +1,7 @@ | |||||
using BPA.Helper; | using BPA.Helper; | ||||
using Helper; | using Helper; | ||||
using HKCardOUT.ViewModels; | using HKCardOUT.ViewModels; | ||||
using HKLog; | |||||
using System; | using System; | ||||
using System.IO; | using System.IO; | ||||
using System.Linq; | using System.Linq; | ||||
@@ -16,6 +17,8 @@ namespace HKCardOUT.Views | |||||
{ | { | ||||
public RootView() | public RootView() | ||||
{ | { | ||||
HKLogImport.Init("HKCardOUT"); | |||||
HKLogImport.WriteInfo("程序初始化"); | |||||
InitializeComponent(); | InitializeComponent(); | ||||
MessageLog.GetInstance.NotifyShow = new Action<string>((s) => | MessageLog.GetInstance.NotifyShow = new Action<string>((s) => | ||||
{ | { | ||||
@@ -7,10 +7,11 @@ namespace HKLog | |||||
{ | { | ||||
public static void Init(string input) | public static void Init(string input) | ||||
{ | { | ||||
var path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Logs",$"{input}.log"); | |||||
//日志 | //日志 | ||||
Log.Logger = new LoggerConfiguration() | Log.Logger = new LoggerConfiguration() | ||||
.MinimumLevel.Information() | .MinimumLevel.Information() | ||||
.WriteTo.File($"Logs/{input}.log", rollingInterval: RollingInterval.Day) | |||||
.WriteTo.File(path, rollingInterval: RollingInterval.Day) | |||||
.CreateLogger(); | .CreateLogger(); | ||||
} | } | ||||
public static void WriteInfo(string msg) | public static void WriteInfo(string msg) | ||||