From 2498dd4959d15a08b2dd6c6baaf08c838921ed1f Mon Sep 17 00:00:00 2001 From: xxe Date: Fri, 18 Nov 2022 14:30:02 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HKCardOUT/Bootstrapper.cs | 1 - HKCardOUT/Views/RootView.xaml.cs | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/HKCardOUT/Bootstrapper.cs b/HKCardOUT/Bootstrapper.cs index ae09f3b..9953b94 100644 --- a/HKCardOUT/Bootstrapper.cs +++ b/HKCardOUT/Bootstrapper.cs @@ -48,7 +48,6 @@ namespace HKCardOUT } Thread.Sleep(3000); }), "循环状态监测线程", false); - HKLogImport.Init("HKCardOUT"); } protected override void ConfigureIoC(IStyletIoCBuilder builder) diff --git a/HKCardOUT/Views/RootView.xaml.cs b/HKCardOUT/Views/RootView.xaml.cs index 9524e6c..15a0fb0 100644 --- a/HKCardOUT/Views/RootView.xaml.cs +++ b/HKCardOUT/Views/RootView.xaml.cs @@ -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,7 @@ namespace HKCardOUT.Views { public RootView() { + HKLogImport.Init("HKCardOUT"); InitializeComponent(); MessageLog.GetInstance.NotifyShow = new Action((s) => { From 22c404857761ef5d033b601841412863c13133cf Mon Sep 17 00:00:00 2001 From: xxe Date: Fri, 18 Nov 2022 16:40:07 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E6=B8=85=E7=90=86=E5=B1=8F=E5=B9=95?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HKCardOUT/ViewModels/AdWindowViewModel.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/HKCardOUT/ViewModels/AdWindowViewModel.cs b/HKCardOUT/ViewModels/AdWindowViewModel.cs index 0828f9e..80a2850 100644 --- a/HKCardOUT/ViewModels/AdWindowViewModel.cs +++ b/HKCardOUT/ViewModels/AdWindowViewModel.cs @@ -23,6 +23,7 @@ namespace HKCardOUT.ViewModels { Foods.Add(""); } + } #region 属性 @@ -34,9 +35,9 @@ namespace HKCardOUT.ViewModels private AdInfoModel _mRAdinfo = new AdInfoModel(); public ObservableCollection Foods { get; set; } = new ObservableCollection(); + #endregion - #endregion void FoodsInit(int[] ScreenLoc) { @@ -60,6 +61,15 @@ namespace HKCardOUT.ViewModels { FoodsInit(BindScreen); + ThreadManage.GetInstance().StartLong(() => { + if (DateTime.Now.Hour == 16) + { + LAdInfo.AInfo = new ObservableCollection(); + RAdinfo.AInfo = new ObservableCollection(); + } + Thread.Sleep(5000); + }, "清理屏幕数据", true); + ThreadManage.GetInstance().StartLong(() => { var model = (new HKCore()).PullDaySaleLog(BindScreen); From a75bf6add1c381ce1fb8f6cc783094b4fdcf6f39 Mon Sep 17 00:00:00 2001 From: xxe Date: Sat, 19 Nov 2022 09:56:52 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HKLog/HKLogImport.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HKLog/HKLogImport.cs b/HKLog/HKLogImport.cs index c55c931..76e6d9a 100644 --- a/HKLog/HKLogImport.cs +++ b/HKLog/HKLogImport.cs @@ -10,7 +10,7 @@ namespace HKLog //日志 Log.Logger = new LoggerConfiguration() .MinimumLevel.Information() - .WriteTo.File($"Logs/{input}.log", rollingInterval: RollingInterval.Day) + .WriteTo.File($"D:\\HK刷卡端正式环境\\Logs\\{input}.log", rollingInterval: RollingInterval.Day) .CreateLogger(); } public static void WriteInfo(string msg) From 51a592ea409fc4bc3cedf7c4e0432622bfeba9f2 Mon Sep 17 00:00:00 2001 From: xxe Date: Sat, 19 Nov 2022 10:17:51 +0800 Subject: [PATCH 4/5] 1 --- HKCardOUT/Views/RootView.xaml.cs | 1 + HKLog/HKLogImport.cs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/HKCardOUT/Views/RootView.xaml.cs b/HKCardOUT/Views/RootView.xaml.cs index 15a0fb0..72d623d 100644 --- a/HKCardOUT/Views/RootView.xaml.cs +++ b/HKCardOUT/Views/RootView.xaml.cs @@ -18,6 +18,7 @@ namespace HKCardOUT.Views public RootView() { HKLogImport.Init("HKCardOUT"); + HKLogImport.WriteInfo("程序初始化"); InitializeComponent(); MessageLog.GetInstance.NotifyShow = new Action((s) => { diff --git a/HKLog/HKLogImport.cs b/HKLog/HKLogImport.cs index 76e6d9a..7791ace 100644 --- a/HKLog/HKLogImport.cs +++ b/HKLog/HKLogImport.cs @@ -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($"D:\\HK刷卡端正式环境\\Logs\\{input}.log", rollingInterval: RollingInterval.Day) + .WriteTo.File(path, rollingInterval: RollingInterval.Day) .CreateLogger(); } public static void WriteInfo(string msg) From 63d8cf9bc5a0f2927af73ef1df824424e19ecb53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A6=82=E6=84=8F=20=E5=BD=AD?= <2417589739@qq.com> Date: Sat, 19 Nov 2022 14:29:25 +0800 Subject: [PATCH 5/5] 11 --- HKCardOUT/ViewModels/AdWindowViewModel.cs | 11 ++++++++--- HKCardOUT/Views/AdWindow.xaml.cs | 2 ++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/HKCardOUT/ViewModels/AdWindowViewModel.cs b/HKCardOUT/ViewModels/AdWindowViewModel.cs index 80a2850..1061be5 100644 --- a/HKCardOUT/ViewModels/AdWindowViewModel.cs +++ b/HKCardOUT/ViewModels/AdWindowViewModel.cs @@ -23,7 +23,7 @@ namespace HKCardOUT.ViewModels { Foods.Add(""); } - + } #region 属性 @@ -61,7 +61,8 @@ namespace HKCardOUT.ViewModels { FoodsInit(BindScreen); - ThreadManage.GetInstance().StartLong(() => { + ThreadManage.GetInstance().StartLong(() => + { if (DateTime.Now.Hour == 16) { LAdInfo.AInfo = new ObservableCollection(); @@ -115,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)) @@ -128,6 +129,10 @@ namespace HKCardOUT.ViewModels } } } + else + { + HKLog.HKLogImport.WriteInfo("未包含屏幕" + BindScreen[i]); + } } Thread.Sleep(10); }, $"屏幕刷卡信息{BindScreen[0]}-{BindScreen[1]}", true); diff --git a/HKCardOUT/Views/AdWindow.xaml.cs b/HKCardOUT/Views/AdWindow.xaml.cs index e7e9c87..3e0f5bf 100644 --- a/HKCardOUT/Views/AdWindow.xaml.cs +++ b/HKCardOUT/Views/AdWindow.xaml.cs @@ -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()); DataBus.SaleLogDtoList[info.Location].Enqueue(info);