demand: 分批逻辑修复

This commit is contained in:
aike 2025-12-12 13:35:01 +08:00
parent cbcae37f23
commit e332b01163

View File

@ -234,22 +234,22 @@ public class EmisTmsSiteBatchDtlServiceImpl implements IEmisTmsSiteBatchDtlServi
boolean hasMatchingSupplier = existingBatches.stream()
.anyMatch(batch -> supplierCodeList.contains(batch.getSupplierCode()));
if (hasMatchingSupplier) {
// 找到匹配的批次,检查重量、体积、件数是否一致
EmisTmsSiteBatch matchingBatch = existingBatches.stream()
.filter(batch -> supplierCodeList.contains(batch.getSupplierCode()))
.findFirst()
.orElse(null);
if (Objects.nonNull(matchingBatch)) {
result.setBatchParcelQty(
matchingBatch.getTotalParcelQty() != null ? matchingBatch.getTotalParcelQty() : 0);
result.setBatchWeight(
matchingBatch.getTotalWeight() != null ? matchingBatch.getTotalWeight() : BigDecimal.ZERO);
result.setBatchVolume(
matchingBatch.getTotalVolume() != null ? matchingBatch.getTotalVolume() : BigDecimal.ZERO);
return result;
}
}
// if (hasMatchingSupplier) {
// // 找到匹配的批次,检查重量、体积、件数是否一致
// EmisTmsSiteBatch matchingBatch = existingBatches.stream()
// .filter(batch -> supplierCodeList.contains(batch.getSupplierCode()))
// .findFirst()
// .orElse(null);
// if (Objects.nonNull(matchingBatch)) {
// result.setBatchParcelQty(
// matchingBatch.getTotalParcelQty() != null ? matchingBatch.getTotalParcelQty() : 0);
// result.setBatchWeight(
// matchingBatch.getTotalWeight() != null ? matchingBatch.getTotalWeight() : BigDecimal.ZERO);
// result.setBatchVolume(
// matchingBatch.getTotalVolume() != null ? matchingBatch.getTotalVolume() : BigDecimal.ZERO);
// return result;
// }
// }
}
// 先过滤出包含多个供应商编码的rules