From 8fc940dcfad999511d850c4200caa11757f792de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=AD=A3=E6=98=93?= Date: Wed, 23 Apr 2025 16:33:36 +0800 Subject: [PATCH] =?UTF-8?q?GP12=E8=A7=A6=E6=91=B8=E5=B1=8F=E6=89=AB?= =?UTF-8?q?=E7=A0=81=E8=A7=84=E5=88=99=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ZR.Service/mes/qc/QcGp12Service.cs | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) 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();