This commit is contained in:
2026-08-12 10:59:39 +08:00
parent 91c6ebca5c
commit 4d0c245b60
16 changed files with 1368 additions and 12 deletions
@@ -124,12 +124,21 @@ public class CartonMeasurementService {
if (!repository.updateItem(item)) {
throw concurrentModification();
}
recalculateMeasurement(measurement, repository.listItems(tenantId, measurement.getId()));
List<InboundMeasurementItemEntity> items = repository.listItems(tenantId, measurement.getId());
recalculateMeasurement(measurement, items);
if (!repository.updateMeasurement(measurement)) {
throw concurrentModification();
}
// 提交审核后仍允许平台人工修正代表箱数,但订单原始总箱数不可被测量汇总覆盖。
if ("MEASURE_PENDING".equals(inbound.getProcessStatus())) {
BigDecimal totalWeight = items.stream()
.map(InboundMeasurementItemEntity::getTotalWeightKg)
.filter(java.util.Objects::nonNull)
.reduce(BigDecimal.ZERO, BigDecimal::add)
.setScale(3, RoundingMode.CEILING);
if (positive(totalWeight)) {
inbound.setActualGrossWeightKg(totalWeight);
}
inbound.setActualVolumeCbm(measurement.getTotalVolumeCbm());
inbound.setVolumeWeightKg(measurement.getVolumeWeightKg());
if (!repository.updateInbound(inbound)) {