From 46cca98136c61d544d7e1ab44f771c3f9ed80ed5 Mon Sep 17 00:00:00 2001 From: "qianhao.xu" Date: Thu, 14 Mar 2024 08:18:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wms/WMentryWarehousing_productService.cs | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/ZR.Service/mes/wms/WMentryWarehousing_productService.cs b/ZR.Service/mes/wms/WMentryWarehousing_productService.cs index baa1f2cb..26122623 100644 --- a/ZR.Service/mes/wms/WMentryWarehousing_productService.cs +++ b/ZR.Service/mes/wms/WMentryWarehousing_productService.cs @@ -76,14 +76,31 @@ namespace ZR.Service.mes.wms /// public int isProductionPackage(string production_packcode) { - Regex r = new Regex("BNW_\\d{9}_\\d{3}"); + Regex r = new Regex("CodeBNW\\d{9}_\\d{0,3}"); + Regex r1 = new Regex("Code=BNW\\d{9}_\\d{0,3}"); + + //todo 不是箱子 - if (!r.IsMatch(production_packcode)) + if (!r.IsMatch(production_packcode)& !r1.IsMatch(production_packcode)) { return 2; + } + // 匹配 CodeBNW\\d{9}_\\d{0,3} + + if (r.IsMatch(production_packcode)) + { + string workorder_id = production_packcode.Substring(3, 9); + string flow_id = production_packcode.Substring(13, 3).ToString("000"); + + } + + if (r1.IsMatch(production_packcode)) + { + + } string workorder_id = production_packcode.Substring(3, 9); - string flow_id = production_packcode.Substring(13, 3); + string flow_id = production_packcode.Substring(13, 3).ToString("000"); bool isExist = Context.Queryable() .Where(it => it.WorkOrderNum == workorder_id) .Where(it => it.PackingCode.EndsWith(flow_id))