From 45305c9a5f315bdb176556cd89e5818b1bbc4120 Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Wed, 7 Jan 2026 09:52:11 +0800 Subject: [PATCH] =?UTF-8?q?2026-01-07=20=E5=9B=BA=E5=AE=9A=E8=BD=BD?= =?UTF-8?q?=E5=85=B7=E6=A0=87=E7=AD=BE=E4=BC=98=E5=8C=96=E3=80=81=E5=9B=BA?= =?UTF-8?q?=E5=AE=9A=E6=89=93=E5=8D=B0=E6=A8=A1=E6=9D=BFA004=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/BoxForNotificationServiceImpl.java | 18 +++++++++++++-- .../boxManage/BoxForNotificationMapper.xml | 22 ++++++++++++++++--- 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/gaotao/modules/boxManage/service/impl/BoxForNotificationServiceImpl.java b/src/main/java/com/gaotao/modules/boxManage/service/impl/BoxForNotificationServiceImpl.java index e2a3713..7d8101e 100644 --- a/src/main/java/com/gaotao/modules/boxManage/service/impl/BoxForNotificationServiceImpl.java +++ b/src/main/java/com/gaotao/modules/boxManage/service/impl/BoxForNotificationServiceImpl.java @@ -339,10 +339,24 @@ public class BoxForNotificationServiceImpl implements BoxForNotificationService throw new RuntimeException("标签 " + rollInfo.getRollNo() + " 已经装盒/装箱,不允许重复扫描"); } - // 校验3: 检查合约号码 + // 校验3: 检查合约号码(outBatchNo可能是多个号码用";"拼接,如A001;B002;C003) + String rollBatchNo = rollInfo.getBatchNo(); boolean batchMatched = outboundDetails.stream() .filter(detail -> detail.getPartNo() != null && detail.getPartNo().equals(data.getPartNo())) - .anyMatch(detail -> detail.getOutBatchNo() != null && detail.getOutBatchNo().equals(rollInfo.getBatchNo())); + .anyMatch(detail -> { + String outBatchNo = detail.getOutBatchNo(); + if (outBatchNo == null || outBatchNo.isEmpty()) { + return false; + } + // 按";"分割,检查是否包含rollBatchNo + String[] batchNos = outBatchNo.split(";"); + for (String batchNo : batchNos) { + if (batchNo != null && batchNo.trim().equals(rollBatchNo)) { + return true; + } + } + return false; + }); if (!batchMatched) { throw new RuntimeException("标签 " + rollInfo.getRollNo() + " 合约号码(" + rollInfo.getBatchNo() + ")不符,请检查"); diff --git a/src/main/resources/mapper/boxManage/BoxForNotificationMapper.xml b/src/main/resources/mapper/boxManage/BoxForNotificationMapper.xml index 617cb5c..804bb88 100644 --- a/src/main/resources/mapper/boxManage/BoxForNotificationMapper.xml +++ b/src/main/resources/mapper/boxManage/BoxForNotificationMapper.xml @@ -158,9 +158,25 @@