diff --git a/SlnMesnac.Business/LogInfoBusiness.cs b/SlnMesnac.Business/LogInfoBusiness.cs
index 23d117d..71ccd93 100644
--- a/SlnMesnac.Business/LogInfoBusiness.cs
+++ b/SlnMesnac.Business/LogInfoBusiness.cs
@@ -48,7 +48,7 @@ namespace SlnMesnac.Business
///
///
///
- public void QueryLogInfo(string logLevel, DateTime beginTime, DateTime endTime, out List result)
+ public void QueryLogInfo(string logType, string logLevel, DateTime beginTime, DateTime endTime, out List result)
{
//var info = scanLogService.Query(x => x.CreateTime >= beginTime && x.CreateTime <= endTime);
Expression> exp = s1 => true;
@@ -67,6 +67,15 @@ namespace SlnMesnac.Business
exp = exp.And(x => x.LogLevel == logLevel);
}
+ if (!string.IsNullOrEmpty(logType) && logType != "所有")
+ {
+ if(logType == "系统数据")
+ {
+ logType = "1";
+ }
+ exp = exp.And(x => x.LogType == logType);
+ }
+
var list = logService.Query(exp);
result = list.OrderByDescending(x => x.CreateTime).ToList();
diff --git a/SlnMesnac.Business/TagScanBusiness.cs b/SlnMesnac.Business/TagScanBusiness.cs
index 049e35d..82044d4 100644
--- a/SlnMesnac.Business/TagScanBusiness.cs
+++ b/SlnMesnac.Business/TagScanBusiness.cs
@@ -134,7 +134,7 @@ namespace SlnMesnac.Business
if (!string.IsNullOrEmpty(rfidStr))
{
- exp = exp.And(x => x.Rfid == rfidStr);
+ exp = exp.And(x => x.Rfid == rfidStr || x.Code == rfidStr || x.Result == rfidStr);
}
var list = scanLogService.Query(exp);
diff --git a/SlnMesnac.Model/domain/BaseCode.cs b/SlnMesnac.Model/domain/BaseCode.cs
index d0aa1fa..aaf2c29 100644
--- a/SlnMesnac.Model/domain/BaseCode.cs
+++ b/SlnMesnac.Model/domain/BaseCode.cs
@@ -54,6 +54,9 @@ namespace SlnMesnac.Model.domain
[SugarColumn(ColumnName = "createtime")]
public DateTime CreateTime { get; set; }
+ [SugarColumn(ColumnName = "log_type")]
+ public string LogType { get; set; }
+
[SugarColumn(ColumnName = "log_level")]
public string LogLevel { get; set; }
diff --git a/SlnMesnac.TouchSocket/ApiServer.cs b/SlnMesnac.TouchSocket/ApiServer.cs
index d37b0cd..838aa7b 100644
--- a/SlnMesnac.TouchSocket/ApiServer.cs
+++ b/SlnMesnac.TouchSocket/ApiServer.cs
@@ -80,6 +80,7 @@ namespace SlnMesnac.TouchSocket
BaseLog log = new BaseLog();
log.LogLevel = "Info";
log.ErrMsg = "";
+ log.LogType = "包裹数据";
log.Content = hk.ToJsonString();
try
{
@@ -162,6 +163,7 @@ namespace SlnMesnac.TouchSocket
{
LogLevel = "Info",
ErrMsg = "",
+ LogType = "设备监控",
Content = scanStatus.ToJsonString()
};
try
diff --git a/SlnMesnac.WPF/Page/LogInfo/LogInfoControl.xaml b/SlnMesnac.WPF/Page/LogInfo/LogInfoControl.xaml
index 879aada..b903fae 100644
--- a/SlnMesnac.WPF/Page/LogInfo/LogInfoControl.xaml
+++ b/SlnMesnac.WPF/Page/LogInfo/LogInfoControl.xaml
@@ -13,17 +13,16 @@
+
-
+
+ 包裹数据
+ 设备监控
+ 系统数据
+ 所有
+
+
Info
Warn
@@ -51,6 +50,7 @@
+
diff --git a/SlnMesnac.WPF/ViewModel/LogInfoViewModel.cs b/SlnMesnac.WPF/ViewModel/LogInfoViewModel.cs
index cd15baa..2295236 100644
--- a/SlnMesnac.WPF/ViewModel/LogInfoViewModel.cs
+++ b/SlnMesnac.WPF/ViewModel/LogInfoViewModel.cs
@@ -46,6 +46,13 @@ namespace SlnMesnac.WPF.ViewModel
}
+ public ComboBoxItem _logType = null;
+ public ComboBoxItem LogType
+ {
+ get => _logType;
+ set => SetProperty(ref _logType, value);
+ }
+
public ComboBoxItem _logLevel = null;
public ComboBoxItem LogLevel
{
@@ -78,7 +85,8 @@ namespace SlnMesnac.WPF.ViewModel
private void Query()
{
string logLevel = _logLevel == null ? string.Empty : _logLevel.Content.ToString();
- logInfoBusiness.QueryLogInfo(logLevel, _beginTime, _endTime, out List info);
+ string logType = _logType == null ? string.Empty : _logType.Content.ToString();
+ logInfoBusiness.QueryLogInfo(logType, logLevel, _beginTime, _endTime, out List info);
ScanItems = new ObservableCollection(info);
}