From 165f53fa1876185f5f087244cd884e065244ce58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B8=B8=E7=86=9F=E5=90=B4=E5=BD=A6=E7=A5=96?= Date: Fri, 5 Sep 2025 15:12:47 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E8=AE=A2=E5=8D=95=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../boxManage/data/SoReceiveBoxRollsData.java | 4 ++++ .../impl/BoxForNotificationServiceImpl.java | 18 ++++++++++++------ .../boxManage/BoxForNotificationMapper.xml | 5 +++-- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/gaotao/modules/boxManage/data/SoReceiveBoxRollsData.java b/src/main/java/com/gaotao/modules/boxManage/data/SoReceiveBoxRollsData.java index 347bd12..3497151 100644 --- a/src/main/java/com/gaotao/modules/boxManage/data/SoReceiveBoxRollsData.java +++ b/src/main/java/com/gaotao/modules/boxManage/data/SoReceiveBoxRollsData.java @@ -9,4 +9,8 @@ import org.apache.ibatis.type.Alias; @Alias("SoReceiveBoxRollsData") public class SoReceiveBoxRollsData extends SoReceiveBoxRolls { private Integer orderId; + + private String batchNo; + + private String locationId; } 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 27e7b2c..2bb3041 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 @@ -137,12 +137,18 @@ public class BoxForNotificationServiceImpl implements BoxForNotificationService if (!partNoMatch) { throw new RuntimeException("该卷的物料编号与销售发货单中的物料编号不匹配"); } - // 校验批次号:只要有一行partNo和batchNo都匹配即可 - boolean batchNoMatch = checkPartNo.stream() - .filter(detail -> detail.getPartNo() != null && detail.getPartNo().equals(stock.getPartNo())) - .anyMatch(detail -> detail.getOutBatchNo() != null && detail.getOutBatchNo().equals(stock.getBatchNo())); - if (!batchNoMatch) { - throw new RuntimeException("该卷的批次号与销售发货单中的批次号不匹配"); + if(stock.getBatchNo()==null||"".equals(stock.getBatchNo())){ + throw new RuntimeException("该卷的批次号为空,无法操作"); + } + //---*批号的物料可以通吃 + if(!"*".equals(stock.getBatchNo())) { + // 校验批次号:只要有一行partNo和batchNo都匹配即可 + boolean batchNoMatch = checkPartNo.stream() + .filter(detail -> detail.getPartNo() != null && detail.getPartNo().equals(stock.getPartNo())) + .anyMatch(detail -> detail.getOutBatchNo() != null && detail.getOutBatchNo().equals(stock.getBatchNo())); + if (!batchNoMatch) { + throw new RuntimeException("该卷的批次号与销售发货单中的批次号不匹配"); + } } // 检查箱的仓库是否为空,如果为空则更新为卷的仓库,如果不为空则检查是否一致 if(box.getWareHouseID()==null||"".equals(box.getWareHouseID())){ diff --git a/src/main/resources/mapper/boxManage/BoxForNotificationMapper.xml b/src/main/resources/mapper/boxManage/BoxForNotificationMapper.xml index 2173eed..3da8773 100644 --- a/src/main/resources/mapper/boxManage/BoxForNotificationMapper.xml +++ b/src/main/resources/mapper/boxManage/BoxForNotificationMapper.xml @@ -124,9 +124,10 @@ \ No newline at end of file