From bd532fa1e9eff5dc6322f1c707ef7cc82c240b7d Mon Sep 17 00:00:00 2001 From: wenjy Date: Wed, 9 Oct 2024 10:54:12 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E4=BF=AE=E6=94=B9=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E9=80=BB=E8=BE=91=EF=BC=8C=E5=A4=9A=E6=9D=A1=E7=A0=81?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SlnMesnac.Model/domain/ScanLog.cs | 8 +++- SlnMesnac.TouchSocket/ApiServer.cs | 56 +++++++++++++++++++++----- SlnMesnac.TouchSocket/ScanLogSocket.cs | 2 + SlnMesnac.WPF/Page/IndexControl.xaml | 1 + 4 files changed, 56 insertions(+), 11 deletions(-) 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 @@ +