diff --git a/SlnMesnac.Business/LogInfoBusiness.cs b/SlnMesnac.Business/LogInfoBusiness.cs
new file mode 100644
index 0000000..56f9b3c
--- /dev/null
+++ b/SlnMesnac.Business/LogInfoBusiness.cs
@@ -0,0 +1,71 @@
+using SlnMesnac.Common;
+using SlnMesnac.Model.domain;
+using SlnMesnac.Repository.service.LogImpl;
+using SlnMesnac.Repository.service.ScanLog;
+using System;
+using System.Collections.Generic;
+using System.Linq.Expressions;
+using System.Text;
+
+#region << 版 本 注 释 >>
+/*--------------------------------------------------------------------
+* 版权所有 (c) 2024 WenJY 保留所有权利。
+* CLR版本:4.0.30319.42000
+* 机器名称:T14-GEN3-7895
+* 命名空间:SlnMesnac.Business
+* 唯一标识:9d48fdd1-4ce5-4944-9756-2a814bdd51ff
+*
+* 创建者:WenJY
+* 电子邮箱:
+* 创建时间:2024-10-09 9:53:19
+* 版本:V1.0.0
+* 描述:
+*
+*--------------------------------------------------------------------
+* 修改人:
+* 时间:
+* 修改说明:
+*
+* 版本:V1.0.0
+*--------------------------------------------------------------------*/
+#endregion << 版 本 注 释 >>
+namespace SlnMesnac.Business
+{
+ public class LogInfoBusiness
+ {
+ private IBaseLogService logService;
+
+ public LogInfoBusiness(IBaseLogService _logService)
+ {
+ logService = _logService;
+ }
+
+ ///
+ /// 查询日志信息
+ ///
+ ///
+ ///
+ ///
+ ///
+ public void QueryLogInfo(string logLevel, DateTime beginTime, DateTime endTime, out List result)
+ {
+ //var info = scanLogService.Query(x => x.CreateTime >= beginTime && x.CreateTime <= endTime);
+ Expression> exp = s1 => true;
+ if (beginTime != null)
+ {
+ exp = exp.And(x => x.CreateTime >= beginTime.Date);
+ }
+
+ if (endTime != null)
+ {
+ exp = exp.And(x => x.CreateTime <= endTime.Date);
+ }
+
+ if (!string.IsNullOrEmpty(logLevel) && logLevel != "所有")
+ {
+ exp = exp.And(x => x.LogLevel == logLevel);
+ }
+ result = logService.Query(exp);
+ }
+ }
+}
diff --git a/SlnMesnac.Business/TagScanBusiness.cs b/SlnMesnac.Business/TagScanBusiness.cs
index b0c1c05..be1b040 100644
--- a/SlnMesnac.Business/TagScanBusiness.cs
+++ b/SlnMesnac.Business/TagScanBusiness.cs
@@ -123,12 +123,12 @@ namespace SlnMesnac.Business
Expression> exp = s1 => true;
if(beginTime != null)
{
- exp = exp.And(x => x.CreateTime >= beginTime);
+ exp = exp.And(x => x.CreateTime >= beginTime.Date);
}
if (endTime != null)
{
- exp = exp.And(x => x.CreateTime <= endTime);
+ exp = exp.And(x => x.CreateTime <= endTime.Date);
}
if (!string.IsNullOrEmpty(rfidStr))
diff --git a/SlnMesnac.WPF/Page/History/HistoryControl.xaml b/SlnMesnac.WPF/Page/History/HistoryControl.xaml
index 72faeb0..038cdec 100644
--- a/SlnMesnac.WPF/Page/History/HistoryControl.xaml
+++ b/SlnMesnac.WPF/Page/History/HistoryControl.xaml
@@ -14,7 +14,7 @@
-
+
@@ -25,9 +25,9 @@
-
+
-
+
diff --git a/SlnMesnac.WPF/Page/LogInfo/LogInfoControl.xaml b/SlnMesnac.WPF/Page/LogInfo/LogInfoControl.xaml
index d98a561..22e1839 100644
--- a/SlnMesnac.WPF/Page/LogInfo/LogInfoControl.xaml
+++ b/SlnMesnac.WPF/Page/LogInfo/LogInfoControl.xaml
@@ -24,24 +24,17 @@
-->
-
- INFO
- WARN
- ERROR
+
+ Info
+ Warn
+ Error
所有
-
-
+
-
+
@@ -51,17 +44,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
diff --git a/SlnMesnac.WPF/Page/LogInfo/LogInfoControl.xaml.cs b/SlnMesnac.WPF/Page/LogInfo/LogInfoControl.xaml.cs
index f5077a1..f720c2c 100644
--- a/SlnMesnac.WPF/Page/LogInfo/LogInfoControl.xaml.cs
+++ b/SlnMesnac.WPF/Page/LogInfo/LogInfoControl.xaml.cs
@@ -1,4 +1,5 @@
-using System;
+using SlnMesnac.WPF.ViewModel;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -23,6 +24,8 @@ namespace SlnMesnac.WPF.Page.LogInfo
public LogInfoControl()
{
InitializeComponent();
+
+ this.DataContext = new LogInfoViewModel();
}
}
}
diff --git a/SlnMesnac.WPF/ViewModel/LogInfoViewModel.cs b/SlnMesnac.WPF/ViewModel/LogInfoViewModel.cs
new file mode 100644
index 0000000..09f6d08
--- /dev/null
+++ b/SlnMesnac.WPF/ViewModel/LogInfoViewModel.cs
@@ -0,0 +1,85 @@
+using CommunityToolkit.Mvvm.ComponentModel;
+using CommunityToolkit.Mvvm.Input;
+using Microsoft.Extensions.DependencyInjection;
+using SlnMesnac.Business;
+using SlnMesnac.Model.domain;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Controls;
+
+#region << 版 本 注 释 >>
+/*--------------------------------------------------------------------
+* 版权所有 (c) 2024 WenJY 保留所有权利。
+* CLR版本:4.0.30319.42000
+* 机器名称:T14-GEN3-7895
+* 命名空间:SlnMesnac.WPF.ViewModel
+* 唯一标识:06dea146-4bed-4f74-9aac-01f8ea91d6bf
+*
+* 创建者:WenJY
+* 电子邮箱:
+* 创建时间:2024-10-09 8:50:06
+* 版本:V1.0.0
+* 描述:
+*
+*--------------------------------------------------------------------
+* 修改人:
+* 时间:
+* 修改说明:
+*
+* 版本:V1.0.0
+*--------------------------------------------------------------------*/
+#endregion << 版 本 注 释 >>
+namespace SlnMesnac.WPF.ViewModel
+{
+ public partial class LogInfoViewModel: ObservableObject
+ {
+
+ private readonly LogInfoBusiness logInfoBusiness;
+
+ public LogInfoViewModel()
+ {
+ logInfoBusiness = App.ServiceProvider.GetService();
+
+ }
+
+ public ComboBoxItem _logLevel = null;
+ public ComboBoxItem LogLevel
+ {
+ get => _logLevel;
+ set => SetProperty(ref _logLevel, value);
+ }
+
+ public DateTime _beginTime = DateTime.Now;
+ public DateTime BeginTime
+ {
+ get => _beginTime;
+ set => SetProperty(ref _beginTime, value);
+ }
+
+ public DateTime _endTime = DateTime.Now;
+ public DateTime EndTime
+ {
+ get => _endTime;
+ set => SetProperty(ref _endTime, value);
+ }
+
+ private ObservableCollection _scanItems = new ObservableCollection();
+ public ObservableCollection ScanItems
+ {
+ get => _scanItems;
+ set => SetProperty(ref _scanItems, value);
+ }
+
+ [RelayCommand]
+ private void Query()
+ {
+ logInfoBusiness.QueryLogInfo(_logLevel.Content.ToString(), _beginTime, _endTime, out List info);
+
+ ScanItems = new ObservableCollection(info);
+ }
+ }
+}