change - 修改过滤逻辑,多条码问题处理

master
wenjy 1 month ago
parent fcbdb97d1f
commit bd532fa1e9

@ -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; }
}
}

@ -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)

@ -29,6 +29,8 @@ public class ScanLogSocket
public string url { get; set; }
public string isOk { get; set; }
public string result { get; set; }
}

@ -154,6 +154,7 @@
<DataGridTextColumn Binding="{Binding Code}" Header="ATR" Width="2*" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding Ocr}" Header="OCR" Width="2*" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding Result}" Header="最终结果" Width="2*" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding IsOk}" Header="结果状态" Width="2*" IsReadOnly="True"/>
</DataGrid.Columns>
</DataGrid>
</Border>

Loading…
Cancel
Save