GP12触摸屏扫码规则调整

This commit is contained in:
赵正易 2025-04-23 16:33:36 +08:00
parent 3e26937d93
commit 8fc940dcfa

View File

@ -78,7 +78,7 @@ namespace ZR.Service.Business
// 标签的零件号解析
public string DoAnalyzePartnumber(string label)
{
// 标签零件号抓取
// 通用规则下的标签零件号抓取
var predicate = Expressionable
.Create<QcGp12BaseLabelAnalysis>()
.And(it => it.Code == "PartNumber")
@ -101,6 +101,20 @@ namespace ZR.Service.Business
return match.Groups[1].Value;
}
}
// 非通用规则下的标签零件号抓取
// 解析T58门把手产品标签
try
{
// 直接从标签中截取前 15 个字符作为零件号
if (!string.IsNullOrEmpty(label) && label.Length >= 40 && label.EndsWith('$'))
{
return label.Substring(0, 17);
}
}
catch (Exception)
{
return "";
}
return "";
}
@ -690,7 +704,10 @@ namespace ZR.Service.Business
}
qcGp12Workorder.EndTime = nowTime;
qcGp12Workorder.Type = "2";
qcGp12Workorder.Remark += "已生成过报表";
if (!qcGp12Workorder.Remark.Contains("已生成过报表"))
{
qcGp12Workorder.Remark += "已生成过报表";
}
Context.Updateable(qcGp12Workorder).ExecuteCommand();
// 生成报表记录
List<QcGp12ServiceStatistics> addList = new();