|
|
|
@ -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())){ |
|
|
|
|