diff --git a/ZR.Service/mes/qc/QcGp12Service.cs b/ZR.Service/mes/qc/QcGp12Service.cs index 8bf15958..005872e1 100644 --- a/ZR.Service/mes/qc/QcGp12Service.cs +++ b/ZR.Service/mes/qc/QcGp12Service.cs @@ -78,7 +78,7 @@ namespace ZR.Service.Business // 标签的零件号解析 public string DoAnalyzePartnumber(string label) { - // 标签零件号抓取 + // 通用规则下的标签零件号抓取 var predicate = Expressionable .Create() .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 addList = new();