diff --git a/SlnMesnac.Business/TagScanBusiness.cs b/SlnMesnac.Business/TagScanBusiness.cs index d118f37..cee5b2f 100644 --- a/SlnMesnac.Business/TagScanBusiness.cs +++ b/SlnMesnac.Business/TagScanBusiness.cs @@ -1,8 +1,11 @@ -using SlnMesnac.Model.domain; +using SlnMesnac.Common; +using SlnMesnac.Model.domain; +using SlnMesnac.Repository.service.ScanLog; using SlnMesnac.TouchSocket; using System; using System.Collections.Generic; using System.Diagnostics; +using System.Linq.Expressions; using System.Text; #region << 版 本 注 释 >> @@ -32,6 +35,7 @@ namespace SlnMesnac.Business public class TagScanBusiness { private ApiServer apiServer; + private IScanLogService scanLogService; public delegate void RefreshTagScanInfo(ScanLogModel scanLogModel); public event RefreshTagScanInfo? RefreshTagScanInfoEvent; @@ -43,13 +47,17 @@ namespace SlnMesnac.Business public event RefreshDeviceStatus? RefreshDeviceStatusEvent; - public TagScanBusiness(ApiServer apiServer) + public TagScanBusiness(ApiServer apiServer, IScanLogService scanLogService) { this.apiServer = apiServer; + this.scanLogService = scanLogService; this.RefreshScanInfo(); } + /// + /// 扫描信息刷新 + /// private void RefreshScanInfo() { //扫描记录刷新 @@ -99,6 +107,33 @@ namespace SlnMesnac.Business }; } + /// + /// 查询扫描记录 + /// + /// + /// + /// + /// + public void QuerySacnInfo(string rfidStr,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); + } + + if (endTime != null) + { + exp = exp.And(x => x.CreateTime <= endTime); + } + + if (!string.IsNullOrEmpty(rfidStr)) + { + exp = exp.And(x => x.Rfid == rfidStr); + } + result = scanLogService.Query(exp); + } } } diff --git a/SlnMesnac.Model/SlnMesnac.Model.csproj b/SlnMesnac.Model/SlnMesnac.Model.csproj index 4f9d9b5..75ced3c 100644 --- a/SlnMesnac.Model/SlnMesnac.Model.csproj +++ b/SlnMesnac.Model/SlnMesnac.Model.csproj @@ -6,6 +6,7 @@ + diff --git a/SlnMesnac.Model/domain/ScanLog.cs b/SlnMesnac.Model/domain/ScanLog.cs index 8d20e2f..f727fa3 100644 --- a/SlnMesnac.Model/domain/ScanLog.cs +++ b/SlnMesnac.Model/domain/ScanLog.cs @@ -1,5 +1,6 @@ using System; using System.Runtime.Serialization; +using MiniExcelLibs.Attributes; using SqlSugar; namespace SlnMesnac.Model.domain @@ -11,18 +12,31 @@ namespace SlnMesnac.Model.domain /// /// /// + [ExcelColumnName("ʶ"), ExcelColumnWidth(15)] [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true)] public int Id { get; set; } + + [ExcelColumnName("ɨʱ"), ExcelColumnWidth(30)] [SugarColumn(ColumnName = "create_time")] public DateTime CreateTime { get; set; } + + [ExcelColumnName(""), ExcelColumnWidth(15)] [SugarColumn(ColumnName = "data_type")] public int DataType { get; set; } + + [ExcelColumnName("RFID"), ExcelColumnWidth(30)] [SugarColumn(ColumnName = "rfid")] public string Rfid { get; set; } + + [ExcelColumnName("ATRʶ"), ExcelColumnWidth(30)] [SugarColumn(ColumnName = "code")] public string Code { get; set; } + + [ExcelColumnName("OCRʶ"), ExcelColumnWidth(30)] [SugarColumn(ColumnName = "ocr")] public string Ocr { get; set; } + + [ExcelColumnName("ȫͼ·"), ExcelColumnWidth(50)] [SugarColumn(ColumnName = "url")] public string Url { get; set; } } diff --git a/SlnMesnac.WPF/Page/History/HistoryControl.xaml b/SlnMesnac.WPF/Page/History/HistoryControl.xaml index 947c4f8..72faeb0 100644 --- a/SlnMesnac.WPF/Page/History/HistoryControl.xaml +++ b/SlnMesnac.WPF/Page/History/HistoryControl.xaml @@ -14,7 +14,7 @@ - + @@ -25,9 +25,9 @@ - + - +