diff --git a/SlnMesnac.Model/domain/ScanLog.cs b/SlnMesnac.Model/domain/ScanLog.cs index 1ec91ee..b3a9d64 100644 --- a/SlnMesnac.Model/domain/ScanLog.cs +++ b/SlnMesnac.Model/domain/ScanLog.cs @@ -40,7 +40,13 @@ namespace SlnMesnac.Model.domain [SugarColumn(ColumnName = "url")] public string Url { get; set; } - [SugarColumn(IsIgnore = true)] + + [ExcelColumnName("结果状态"), ExcelColumnWidth(50)] + [SugarColumn(ColumnName = "is_ok")] + public string IsOk { get; set; } + + [ExcelColumnName("最终结果"), ExcelColumnWidth(50)] + [SugarColumn(ColumnName = "result")] public string Result { get; set; } } } \ No newline at end of file diff --git a/SlnMesnac.TouchSocket/ApiServer.cs b/SlnMesnac.TouchSocket/ApiServer.cs index eb09fb1..0a5e818 100644 --- a/SlnMesnac.TouchSocket/ApiServer.cs +++ b/SlnMesnac.TouchSocket/ApiServer.cs @@ -78,6 +78,18 @@ namespace SlnMesnac.TouchSocket { FilterBuffer(ref hk, out string result); + string isOk = string.Empty; + + if(result != "澶氭潯鐮" && result != "noread" && result != "NoRead" && !string.IsNullOrEmpty(result)) + { + isOk = "Ok"; + }else if(result == "澶氭潯鐮") + { + isOk = "Mul"; + }else + { + isOk = "Ng"; + } ScanLogSocket scan = new ScanLogSocket() { @@ -87,6 +99,7 @@ namespace SlnMesnac.TouchSocket rfid = hk.rfid, timestamp = hk.timestamp, url = hk.url, + isOk = isOk, result = result }; ba = ScanBack(scan); @@ -195,6 +208,7 @@ namespace SlnMesnac.TouchSocket Rfid = scanLog.rfid, Ocr = scanLog.ocr, Url = scanLog.url, + IsOk = scanLog.isOk, Result = scanLog.result, }; @@ -250,7 +264,7 @@ namespace SlnMesnac.TouchSocket if (buffer.Length > 1) { hk.rfid = "澶氭潯鐮"; - result = "澶氭潯鐮"; + } else { @@ -259,17 +273,20 @@ namespace SlnMesnac.TouchSocket { AnasysBuffer(ref rfidStr); - if(rfidStr != hk.code && !string.IsNullOrEmpty(hk.code) && hk.code != "NoRead") - { - result = hk.code; - } - else - { - result = rfidStr; - hk.rfid = rfidStr; - } + hk.rfid = rfidStr; + + } } + + if (hk.rfid != hk.code && !string.IsNullOrEmpty(hk.code) && hk.code != "NoRead") + { + result = hk.code; + } + else + { + result = hk.rfid; + } } //澶勭悊ATR鏁版嵁 @@ -292,6 +309,25 @@ namespace SlnMesnac.TouchSocket } } } + else + { + string[] buffer = hk.code.Split(","); + + if (buffer.Length > 1) + { + hk.code = "澶氭潯鐮"; + + } + + if (hk.rfid == hk.code && !string.IsNullOrEmpty(hk.rfid) && hk.rfid != "NoRead" && hk.rfid != "澶氭潯鐮") + { + result = hk.rfid; + } + else + { + result = hk.code; + } + } } catch(Exception ex) diff --git a/SlnMesnac.TouchSocket/ScanLogSocket.cs b/SlnMesnac.TouchSocket/ScanLogSocket.cs index 8121a4d..b4e2a50 100644 --- a/SlnMesnac.TouchSocket/ScanLogSocket.cs +++ b/SlnMesnac.TouchSocket/ScanLogSocket.cs @@ -29,6 +29,8 @@ public class ScanLogSocket public string url { get; set; } + public string isOk { get; set; } + public string result { get; set; } } diff --git a/SlnMesnac.WPF/Page/IndexControl.xaml b/SlnMesnac.WPF/Page/IndexControl.xaml index d1eea11..ea7b13a 100644 --- a/SlnMesnac.WPF/Page/IndexControl.xaml +++ b/SlnMesnac.WPF/Page/IndexControl.xaml @@ -154,6 +154,7 @@ +