Browse Source

2026-01-07

优化
master
fengyuan_yang 2 months ago
parent
commit
7153aa7451
  1. 18
      src/main/java/com/gaotao/modules/boxManage/service/impl/BoxForNotificationServiceImpl.java

18
src/main/java/com/gaotao/modules/boxManage/service/impl/BoxForNotificationServiceImpl.java

@ -168,10 +168,24 @@ public class BoxForNotificationServiceImpl implements BoxForNotificationService
//---*批号的物料可以通吃 //---*批号的物料可以通吃
if(!"*".equals(stock.getBatchNo())) { if(!"*".equals(stock.getBatchNo())) {
// 校验批次号只要有一行partNo和batchNo都匹配即可
// 校验批次号outBatchNo可能是多个号码用";"拼接如A001;B002;C003
String rollBatchNo = stock.getBatchNo();
boolean batchNoMatch = checkPartNo.stream() boolean batchNoMatch = checkPartNo.stream()
.filter(detail -> detail.getPartNo() != null && detail.getPartNo().equals(stock.getPartNo())) .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) { if (!batchNoMatch) {
throw new RuntimeException("该卷的批次号与销售发货单中的批次号不匹配"); throw new RuntimeException("该卷的批次号与销售发货单中的批次号不匹配");
} }

Loading…
Cancel
Save