库存操作判空处理;
This commit is contained in:
+3
@@ -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);
|
||||
//分配后冻结数量
|
||||
|
||||
+6
-2
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user