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