Commit 53b5e2bb 刘韬

条码匹配解析日志优化

1 个父辈 a03fc2eb
正在显示 1 个修改的文件 包含 17 行增加12 行删除
......@@ -43,23 +43,24 @@ namespace BLL
if (!ms.ContainsKey(matchKey))
ms.Add(matchKey,new MatchCollection());
ms[matchKey].Matchs.Add(match);
if (!MatchTemplateList[CurrnetTemplateName].MatchCollections.ContainsKey(matchKey))
{
MatchTemplateList[CurrnetTemplateName].MatchCollections.Add(matchKey, new MatchCollection());
MatchTemplateList[CurrnetTemplateName].MatchCollections[matchKey].barcodeInfo = CurrnetBarcode;
}
//if (!MatchTemplateList[CurrnetTemplateName].MatchCollections.ContainsKey(matchKey))
//{
// MatchTemplateList[CurrnetTemplateName].MatchCollections.Add(matchKey, new MatchCollection());
// MatchTemplateList[CurrnetTemplateName].MatchCollections[matchKey].barcodeInfo = CurrnetBarcode;
//}
MatchTemplateList[CurrnetTemplateName].MatchCollections[matchKey].Matchs.Add(match);
//MatchTemplateList[CurrnetTemplateName].MatchCollections[matchKey].Matchs.Add(match);
}
public static void MatchResult(string matchKey, bool isMatch) {
if (!MatchTemplateList[CurrnetTemplateName].BarcodeMatchs[CurrnetBarcode.Text].MatchCollections.ContainsKey(matchKey))
return;
MatchTemplateList[CurrnetTemplateName].BarcodeMatchs[CurrnetBarcode.Text].MatchCollections[matchKey].isMatch = isMatch;
MatchTemplateList[CurrnetTemplateName].MatchCollections[matchKey]=MatchTemplateList[CurrnetTemplateName].BarcodeMatchs[CurrnetBarcode.Text].MatchCollections[matchKey];
MatchTemplateList[CurrnetTemplateName].MatchCollections[matchKey].barcodeInfo = CurrnetBarcode;
//MatchTemplateList[CurrnetTemplateName].MatchCollections[matchKey]=MatchTemplateList[CurrnetTemplateName].BarcodeMatchs[CurrnetBarcode.Text].MatchCollections[matchKey];
//MatchTemplateList[CurrnetTemplateName].MatchCollections[matchKey].barcodeInfo = CurrnetBarcode;
}
public static void TemplateResult(bool isMatch) {
MatchTemplateList[CurrnetTemplateName].isMatch = isMatch;
......@@ -70,19 +71,23 @@ namespace BLL
//return;
foreach (var tp in MatchTemplateList) {
LogNet.log.Info($"开始解析模版:{tp.Key}");
foreach (var m in tp.Value.MatchCollections) {
foreach (var b in tp.Value.BarcodeMatchs)
{
LogNet.log.Info($"开始解析条码:{b.Key}");
foreach (var m in b.Value.MatchCollections)
{
LogNet.log.Info($"开始解析关键字:{m.Key}");
//LogNet.log.Info($"匹配到关键字:{m.Key}");
string matchlist = m.Value.barcodeInfo.Text + "\t/\t";
string matchlist = b.Key + "\t/\t";
foreach (var item in m.Value.Matchs)
{
matchlist += $"{item.colName},{item.isMatch},{item.matchDesc}\t/\t";
matchlist += $"{item.matchKey},{item.colName},{item.isMatch},{item.matchDesc}\t/\t";
}
LogNet.log.Info(matchlist);
}
}
}
}
public class TemplateCollection
{
public Dictionary<string, BarcodeMatch> BarcodeMatchs=new ();
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!