change - 识别率、时间戳转换修改

master
wenjy 1 month ago
parent 290b596604
commit c2f69e01c4

@ -153,7 +153,8 @@ namespace SlnMesnac.Business
if (tagScanList.Count > 0)
{
var isOkList = tagScanList.Where(x => x.IsOk == "Ok").ToList();
//var isOkList = tagScanList.Where(x => x.IsOk == "Ok").ToList();
var isOkList = tagScanList.Where(x => x.IsOk != "NG").ToList();
double passRate = ((double)isOkList.Count / (double)tagScanList.Count)*100;

@ -219,9 +219,15 @@ namespace SlnMesnac.TouchSocket
//_logger.LogInformation("扫描数据回传接口");
//_logger.LogInformation("{Data}", scanLog.ToJsonString());
_logger.LogInformation($"收到接口数据:{scanLog.ToJsonString()}");
DateTimeOffset dateTimeOffset = DateTimeOffset.FromUnixTimeMilliseconds(scanLog.timestamp);
_logger.LogInformation($"时间戳: {scanLog.timestamp};转换为时间:{dateTimeOffset.LocalDateTime};{dateTimeOffset.LocalDateTime}");
var model = new ScanLogModel()
{
CreateTime = scanLog.CreateTime,
CreateTime = dateTimeOffset.LocalDateTime,
DataType = scanLog.data_type,
Code = scanLog.code,
Rfid = scanLog.rfid,
@ -336,12 +342,13 @@ namespace SlnMesnac.TouchSocket
}
else
{
string mulRes = string.Empty;
string[] buffer = hk.code.Split(",");
if (buffer.Length > 1)
{
hk.code = "多条码";
//hk.code = "多条码";
mulRes = "多条码";
}
if (hk.rfid == hk.code && !string.IsNullOrEmpty(hk.rfid) && hk.rfid != "NoRead" && hk.rfid != "多条码")
@ -350,7 +357,15 @@ namespace SlnMesnac.TouchSocket
}
else
{
result = hk.code;
if(hk.code.Contains(hk.rfid))
{
hk.code = hk.rfid;
result = hk.code;
}
else
{
result = mulRes;
}
}
}

@ -10,11 +10,12 @@ public class ScanLogSocket
public DateTime CreateTime
{
get
{
DateTimeOffset dateTimeOffset = DateTimeOffset.FromUnixTimeMilliseconds(timestamp);
return dateTimeOffset.UtcDateTime;
}
//get
//{
// DateTimeOffset dateTimeOffset = DateTimeOffset.FromUnixTimeMilliseconds(timestamp);
// return dateTimeOffset.UtcDateTime;
//}
get; set;
}
public long timestamp { get; set; }

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>

@ -51,7 +51,7 @@ namespace SlnMesnac.WPF.ViewModel
private void Init()
{
PassRate = tagScanBusiness.TagScanPassRate();
//PassRate = tagScanBusiness.TagScanPassRate();
// 初始化数据
RecogEfficiency = new SeriesCollection
@ -169,7 +169,10 @@ namespace SlnMesnac.WPF.ViewModel
TagAmount++;
PassRate = tagScanBusiness.TagScanPassRate();
//PassRate = tagScanBusiness.TagScanPassRate();
var isOkList = scanLogModelsItems.Where(x => x.IsOk != "Ng").ToList();
double passRate = ((double)isOkList.Count / (double)scanLogModelsItems.Count) * 100;
PassRate = Math.Round(passRate, 2);
});
};

Loading…
Cancel
Save