Commit b1a35793 刘韬

优化从web接口解析式的结果排序

1 个父辈 1fe12e83
......@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Reflection.Emit;
using System.Xml;
using CameraVisionLib.Model;
......@@ -397,6 +398,8 @@ namespace BLL
bool isMatch = false;
List<MaterialCodeOCR> ocrlist = new List<MaterialCodeOCR>();
List<BarcodeInfo> ocrcode = new List<BarcodeInfo>();
//命中规则的条码索引
List<int> MatchCodeIndex = new List<int>();
int[] id = mateTemp[index].GetCodeID();
for (int i = 0; i < id.Length; i++)
{
......@@ -415,6 +418,7 @@ namespace BLL
{
if (!keyword.ContainsKey(key))
{
MatchCodeIndex.Add(j);
keyword.Add(key, matchKey[key]);
LogNet.log.Info($"{mateTemp[index].Name} 匹配 [{key}={matchKey[key]}]");
}
......@@ -484,6 +488,20 @@ namespace BLL
if (isMatch)
{
MatchAnalysis.TemplateResult(true);
#region Code按照 匹配到的列表重新排序
MatchCodeIndex = MatchCodeIndex.Distinct().ToList();
var code2 = new List<BarcodeInfo>();
foreach(var i in MatchCodeIndex) {
if (code.Count>i)
code2.Add(code[i]);
}
foreach (var c in code)
{
if (!code2.Contains(c))
code2.Add(c);
}
code = code2.ToList();
#endregion
return true;
}
else
......
......@@ -9,9 +9,10 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ExtensionGroup</RootNamespace>
<AssemblyName>ExtensionGroup</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
......
......@@ -20,6 +20,10 @@ namespace SmartScan
//Language.SetLanguage(this);
this.SizeChanged += FrmSetPlus_SizeChanged;
this.FormClosing += FrmSetPlus_FormClosing;
this.Width = 1024;
this.Height = 738;
this.Top = 15;
this.Left = 0;
}
private void FrmSetPlus_FormClosing(object sender, FormClosingEventArgs e)
......
......@@ -50,7 +50,8 @@ namespace SmartScan
process.StartInfo = new ProcessStartInfo();
process.StartInfo.FileName = paddle;
process.StartInfo.WorkingDirectory = ".\\paddle";
process.Start();
if (File.Exists(".\\paddle\\paddleOCR.exe"))
process.Start();
}
//else
......
......@@ -77,7 +77,7 @@ namespace SmartScan
}
if (webResultCode != null)
if (webResultCode != null || !rtn)
return webResultCode;
LogNet.log.Info("Work scan is done");
List<KeyValuePair<string, string>> result = new List<KeyValuePair<string, string>>();
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!