diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/handoverTaskOrder/service/HandoverTaskOrderDomainService.java b/mhd_wms/src/main/java/com/mhd/wms/domain/handoverTaskOrder/service/HandoverTaskOrderDomainService.java index c7ef7ca8e..065580e24 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/handoverTaskOrder/service/HandoverTaskOrderDomainService.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/handoverTaskOrder/service/HandoverTaskOrderDomainService.java @@ -196,10 +196,13 @@ public class HandoverTaskOrderDomainService { MaterialInventory materialInventoryPO = materialInventoryMapper.selectById(materialInventoryId); if (materialInventoryPO != null) { //更新库存数量 + //库存数量 BigDecimal oldInventoryQuantity = materialInventoryPO.getInventoryQuantity(); + oldInventoryQuantity = oldInventoryQuantity != null ? oldInventoryQuantity : BigDecimal.ZERO; //冻结数量 BigDecimal oldFreezeQuantity = materialInventoryPO.getFreezeQuantity(); + oldFreezeQuantity = oldFreezeQuantity != null ? oldFreezeQuantity : BigDecimal.ZERO; //分配后库存数量 BigDecimal newInventoryQuantity = oldInventoryQuantity.subtract(checkQuantity); //分配后冻结数量 diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/stockShelfOrder/service/StockShelfOrderDomainService.java b/mhd_wms/src/main/java/com/mhd/wms/domain/stockShelfOrder/service/StockShelfOrderDomainService.java index 16d33a87b..c641472fb 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/stockShelfOrder/service/StockShelfOrderDomainService.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/stockShelfOrder/service/StockShelfOrderDomainService.java @@ -541,10 +541,14 @@ public class StockShelfOrderDomainService { BigDecimal shelvesQuantity = shelfMaterialDetail.getShelvesQuantity(); shelvesQuantity = shelvesQuantity != null ? shelvesQuantity : BigDecimal.ZERO; MaterialInventoryPO materialInventoryPO = materialInventoryPOS.get(0); - BigDecimal newInventoryQuantity = materialInventoryPO.getInventoryQuantity().add(shelvesQuantity); + BigDecimal oldInventoryQuantity = materialInventoryPO.getInventoryQuantity(); - BigDecimal newAllocationQuantity = materialInventoryPO.getAllocationQuantity().add(shelvesQuantity); + oldInventoryQuantity = oldInventoryQuantity != null ? oldInventoryQuantity : BigDecimal.ZERO; + BigDecimal newInventoryQuantity = oldInventoryQuantity.add(shelvesQuantity); + BigDecimal oldAllocationQuantity = materialInventoryPO.getAllocationQuantity(); + oldAllocationQuantity = oldAllocationQuantity != null ? oldAllocationQuantity : BigDecimal.ZERO; + BigDecimal newAllocationQuantity = oldAllocationQuantity.add(shelvesQuantity); BigDecimal oldArea = materialInventoryPO.getArea(); oldArea = oldArea != null ? oldArea : BigDecimal.ZERO;