上架入库数据判空(上架保存失败);

This commit is contained in:
王奎兴
2026-02-07 13:23:46 +08:00
parent 44d295f702
commit 5b85d5c3e1
@@ -545,19 +545,24 @@ public class StockShelfOrderDomainService {
BigDecimal oldInventoryQuantity = materialInventoryPO.getInventoryQuantity(); BigDecimal oldInventoryQuantity = materialInventoryPO.getInventoryQuantity();
BigDecimal newAllocationQuantity = materialInventoryPO.getAllocationQuantity().add(shelvesQuantity); BigDecimal newAllocationQuantity = materialInventoryPO.getAllocationQuantity().add(shelvesQuantity);
BigDecimal oldAllocationQuantity = materialInventoryPO.getAllocationQuantity(); BigDecimal oldAllocationQuantity = materialInventoryPO.getAllocationQuantity();
BigDecimal oldArea = materialInventoryPO.getArea(); BigDecimal oldArea = materialInventoryPO.getArea();
oldArea = oldArea != null ? oldArea : BigDecimal.ZERO;
BigDecimal totalArea = shelfMaterialDetail.getTotalArea(); BigDecimal totalArea = shelfMaterialDetail.getTotalArea();
totalArea = totalArea != null ? totalArea : BigDecimal.ZERO; totalArea = totalArea != null ? totalArea : BigDecimal.ZERO;
BigDecimal newArea = oldArea.add(totalArea); BigDecimal newArea = oldArea.add(totalArea);
BigDecimal oldVolume = materialInventoryPO.getVolume(); BigDecimal oldVolume = materialInventoryPO.getVolume();
oldVolume = oldVolume != null ? oldVolume : BigDecimal.ZERO;
BigDecimal totalVolume = shelfMaterialDetail.getTotalVolume(); BigDecimal totalVolume = shelfMaterialDetail.getTotalVolume();
totalVolume = totalVolume != null ? totalVolume : BigDecimal.ZERO; totalVolume = totalVolume != null ? totalVolume : BigDecimal.ZERO;
BigDecimal newVolume = oldVolume.add(totalVolume); BigDecimal newVolume = oldVolume.add(totalVolume);
BigDecimal oldGrossWeight = materialInventoryPO.getGrossWeight(); BigDecimal oldGrossWeight = materialInventoryPO.getGrossWeight();
oldGrossWeight = oldGrossWeight != null ? oldGrossWeight : BigDecimal.ZERO;
BigDecimal totalGrossWeight = shelfMaterialDetail.getTotalGrossWeight(); BigDecimal totalGrossWeight = shelfMaterialDetail.getTotalGrossWeight();
totalGrossWeight = totalGrossWeight != null ? totalGrossWeight : BigDecimal.ZERO; totalGrossWeight = totalGrossWeight != null ? totalGrossWeight : BigDecimal.ZERO;
BigDecimal newGrossWeight = oldGrossWeight.add(totalGrossWeight); BigDecimal newGrossWeight = oldGrossWeight.add(totalGrossWeight);
BigDecimal oldNetWeight = materialInventoryPO.getNetWeight(); BigDecimal oldNetWeight = materialInventoryPO.getNetWeight();
oldNetWeight = oldNetWeight != null ? oldNetWeight : BigDecimal.ZERO;
BigDecimal totalNetWeight = shelfMaterialDetail.getTotalNetWeight(); BigDecimal totalNetWeight = shelfMaterialDetail.getTotalNetWeight();
totalNetWeight = totalNetWeight != null ? totalNetWeight : BigDecimal.ZERO; totalNetWeight = totalNetWeight != null ? totalNetWeight : BigDecimal.ZERO;
BigDecimal newNetWeight = oldNetWeight.add(totalNetWeight); BigDecimal newNetWeight = oldNetWeight.add(totalNetWeight);