From 7153aa7451d9a7ceb420a8f588245c16ac24c69c Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Wed, 7 Jan 2026 13:25:43 +0800 Subject: [PATCH] =?UTF-8?q?2026-01-07=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/BoxForNotificationServiceImpl.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 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 fbe5437..c7a33b3 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 @@ -168,10 +168,24 @@ public class BoxForNotificationServiceImpl implements BoxForNotificationService //---*批号的物料可以通吃 if(!"*".equals(stock.getBatchNo())) { - // 校验批次号:只要有一行partNo和batchNo都匹配即可 + // 校验批次号:outBatchNo可能是多个号码用";"拼接,如A001;B002;C003 + String rollBatchNo = stock.getBatchNo(); boolean batchNoMatch = checkPartNo.stream() .filter(detail -> detail.getPartNo() != null && detail.getPartNo().equals(stock.getPartNo())) - .anyMatch(detail -> detail.getOutBatchNo() != null && detail.getOutBatchNo().equals(stock.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 (!batchNoMatch) { throw new RuntimeException("该卷的批次号与销售发货单中的批次号不匹配"); }