diff --git a/Aucma.Core.CodeBinding/ViewModels/IndexPageViewModel.cs b/Aucma.Core.CodeBinding/ViewModels/IndexPageViewModel.cs index f1b365dd..c7491bd5 100644 --- a/Aucma.Core.CodeBinding/ViewModels/IndexPageViewModel.cs +++ b/Aucma.Core.CodeBinding/ViewModels/IndexPageViewModel.cs @@ -60,13 +60,13 @@ namespace Aucma.Core.CodeBinding.ViewModels { // 赋值 Code1 = "B236000007811023002"; - Code1Time = "2023-10-23 16:05:23"; + // Code1Time = "2023-10-23 16:05:23"; Code2 = "B236000007811023002"; - Code2Time = "2023-10-23 16:05:23"; + // Code2Time = "2023-10-23 16:05:23"; BindingInfo = "条码[B236000007811023002]和SN条码[B236000007811023002]绑定成功!"; LoadCharts(); List records = null; - records = await _codeBindingRecordServices.QueryAsync(x => x.BoxCode != null && x.RecordTime2 >= System.DateTime.Now.AddDays(-3), "RECORD_TIME1 desc"); + records = await _codeBindingRecordServices.QueryAsync(x => x.BoxCode != null && x.RecordTime2 >= System.DateTime.Now.AddDays(-1), "RECORD_TIME1 desc"); if (records != null) { foreach (CodeBindingRecord record in records) @@ -80,7 +80,7 @@ namespace Aucma.Core.CodeBinding.ViewModels } } - // 之后修改为统计近一天或者几天 + // 修改为统计近一天 private async void LoadCharts() { List list = await _codeBindingRecordServices.QueryCharts(); @@ -100,6 +100,8 @@ namespace Aucma.Core.CodeBinding.ViewModels column.Foreground = Brushes.White; ModelStatistics.Add(column); ProductionHourList = chartList; + + } // 测试方法 private async void add() @@ -127,20 +129,20 @@ namespace Aucma.Core.CodeBinding.ViewModels } } - /// - /// 条码1扫描时间 - /// - private string code1Time = string.Empty; - public string Code1Time - { - get { return code1Time; } - - set - { - code1Time = value; - OnPropertyChanged(nameof(Code1Time)); - } - } + ///// + ///// 条码1扫描时间 + ///// + //private string code1Time = string.Empty; + //public string Code1Time + //{ + // get { return code1Time; } + + // set + // { + // code1Time = value; + // OnPropertyChanged(nameof(Code1Time)); + // } + //} /// /// 条码2 /// @@ -154,19 +156,19 @@ namespace Aucma.Core.CodeBinding.ViewModels OnPropertyChanged(nameof(Code2)); } } - /// - /// 条码2扫描时间 - /// - private string code2Time = string.Empty; - public string Code2Time - { - get { return code2Time; } - set - { - code2Time = value; - OnPropertyChanged(nameof(Code2Time)); - } - } + ///// + ///// 条码2扫描时间 + ///// + //private string code2Time = string.Empty; + //public string Code2Time + //{ + // get { return code2Time; } + // set + // { + // code2Time = value; + // OnPropertyChanged(nameof(Code2Time)); + // } + //} /// /// 绑定提示信息 /// @@ -228,7 +230,7 @@ namespace Aucma.Core.CodeBinding.ViewModels private void RefreshCode1(string code1, string time) { Code1 = code1; - Code1Time = time; + // Code1Time = time; } /// @@ -238,7 +240,7 @@ namespace Aucma.Core.CodeBinding.ViewModels private void RefreshCode2(CodeBindingRecord record) { Code2 = record.ProductCode; - Code2Time = record.RecordTime2.ToString(); + // Code2Time = record.RecordTime2.ToString(); if ("成功".Equals(record.BindingResult)) { BindingInfo = "条码【" + record.BoxCode + "】与SN码【" + record.ProductCode + "】绑定成功"; diff --git a/Aucma.Core.CodeBinding/ViewModels/StatisticsPageViewModel.cs b/Aucma.Core.CodeBinding/ViewModels/StatisticsPageViewModel.cs index ebf7c8d2..a7bdcfb8 100644 --- a/Aucma.Core.CodeBinding/ViewModels/StatisticsPageViewModel.cs +++ b/Aucma.Core.CodeBinding/ViewModels/StatisticsPageViewModel.cs @@ -34,7 +34,7 @@ namespace Aucma.Core.CodeBinding.ViewModels { List records = null; - records = await _codeBindingRecordServices.QueryAsync(x => x.BoxCode != null, "RECORD_TIME1 desc"); + records = await _codeBindingRecordServices.QueryAsync(x => x.BoxCode != null && x.RecordTime2 >= System.DateTime.Now.AddDays(-1), "RECORD_TIME1 desc"); if (records != null) { foreach (CodeBindingRecord record in records) diff --git a/Aucma.Core.CodeBinding/Views/IndexPageView.xaml b/Aucma.Core.CodeBinding/Views/IndexPageView.xaml index 70fdef81..b98bba6d 100644 --- a/Aucma.Core.CodeBinding/Views/IndexPageView.xaml +++ b/Aucma.Core.CodeBinding/Views/IndexPageView.xaml @@ -40,27 +40,23 @@ - -