From 5e15573b1c4fdf3f20fae62170df04389a99bbe3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=AD=A3=E6=98=93?= Date: Thu, 9 Jan 2025 17:11:32 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A6=E6=91=B8=E5=B1=8FGP12?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/mes/qc/GP12/QcGp12Controller.cs | 13 ++++++++++--- ZR.Service/mes/qc/QcGp12Service.cs | 16 ++++++++++++++-- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/ZR.Admin.WebApi/Controllers/mes/qc/GP12/QcGp12Controller.cs b/ZR.Admin.WebApi/Controllers/mes/qc/GP12/QcGp12Controller.cs index 99f83122..9d24b3d9 100644 --- a/ZR.Admin.WebApi/Controllers/mes/qc/GP12/QcGp12Controller.cs +++ b/ZR.Admin.WebApi/Controllers/mes/qc/GP12/QcGp12Controller.cs @@ -125,11 +125,18 @@ namespace ZR.Admin.WebApi.Controllers [AllowAnonymous] public IActionResult ScanInnerLabel([FromBody] QcGp12LabelScanDto parm) { - var modal = parm.Adapt().ToCreate(HttpContext); + try + { + var modal = parm.Adapt().ToCreate(HttpContext); - var response = _QcGp12Service.ScanInnerLabel(modal); + var response = _QcGp12Service.ScanInnerLabel(modal); - return SUCCESS(response); + return SUCCESS(response); + }catch(Exception ex) + { + return SUCCESS("请刷新页面"); + } + } /// diff --git a/ZR.Service/mes/qc/QcGp12Service.cs b/ZR.Service/mes/qc/QcGp12Service.cs index e06d0596..c93f9d16 100644 --- a/ZR.Service/mes/qc/QcGp12Service.cs +++ b/ZR.Service/mes/qc/QcGp12Service.cs @@ -548,12 +548,24 @@ namespace ZR.Service.Business DateTime nowTime = DateTime.Now; // 标签防错 string partNumber = DoAnalyzePartnumber(data.Label); - if (partNumber != data.PartNumber) { return "内标签零件号与外箱标签不一致!"; } - + int qt = DoAnalyzeQuantity(data.Label); + if (qt >= 6) + { + return "该标签可能为外箱标签!"; + } + bool hasAny = Context + .Queryable() + .Where(it => it.Label == data.Label) + .Any(); + if (hasAny) + { + return "重复扫码!"; + } + // 标签录入 int sort = 0; QcGp12RecordLabelScan labelScan = Context .Queryable()