库存操作判空处理;
This commit is contained in:
+3
@@ -196,10 +196,13 @@ public class HandoverTaskOrderDomainService {
|
|||||||
MaterialInventory materialInventoryPO = materialInventoryMapper.selectById(materialInventoryId);
|
MaterialInventory materialInventoryPO = materialInventoryMapper.selectById(materialInventoryId);
|
||||||
if (materialInventoryPO != null) {
|
if (materialInventoryPO != null) {
|
||||||
//更新库存数量
|
//更新库存数量
|
||||||
|
|
||||||
//库存数量
|
//库存数量
|
||||||
BigDecimal oldInventoryQuantity = materialInventoryPO.getInventoryQuantity();
|
BigDecimal oldInventoryQuantity = materialInventoryPO.getInventoryQuantity();
|
||||||
|
oldInventoryQuantity = oldInventoryQuantity != null ? oldInventoryQuantity : BigDecimal.ZERO;
|
||||||
//冻结数量
|
//冻结数量
|
||||||
BigDecimal oldFreezeQuantity = materialInventoryPO.getFreezeQuantity();
|
BigDecimal oldFreezeQuantity = materialInventoryPO.getFreezeQuantity();
|
||||||
|
oldFreezeQuantity = oldFreezeQuantity != null ? oldFreezeQuantity : BigDecimal.ZERO;
|
||||||
//分配后库存数量
|
//分配后库存数量
|
||||||
BigDecimal newInventoryQuantity = oldInventoryQuantity.subtract(checkQuantity);
|
BigDecimal newInventoryQuantity = oldInventoryQuantity.subtract(checkQuantity);
|
||||||
//分配后冻结数量
|
//分配后冻结数量
|
||||||
|
|||||||
+6
-2
@@ -541,10 +541,14 @@ public class StockShelfOrderDomainService {
|
|||||||
BigDecimal shelvesQuantity = shelfMaterialDetail.getShelvesQuantity();
|
BigDecimal shelvesQuantity = shelfMaterialDetail.getShelvesQuantity();
|
||||||
shelvesQuantity = shelvesQuantity != null ? shelvesQuantity : BigDecimal.ZERO;
|
shelvesQuantity = shelvesQuantity != null ? shelvesQuantity : BigDecimal.ZERO;
|
||||||
MaterialInventoryPO materialInventoryPO = materialInventoryPOS.get(0);
|
MaterialInventoryPO materialInventoryPO = materialInventoryPOS.get(0);
|
||||||
BigDecimal newInventoryQuantity = materialInventoryPO.getInventoryQuantity().add(shelvesQuantity);
|
|
||||||
BigDecimal oldInventoryQuantity = materialInventoryPO.getInventoryQuantity();
|
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();
|
BigDecimal oldAllocationQuantity = materialInventoryPO.getAllocationQuantity();
|
||||||
|
oldAllocationQuantity = oldAllocationQuantity != null ? oldAllocationQuantity : BigDecimal.ZERO;
|
||||||
|
BigDecimal newAllocationQuantity = oldAllocationQuantity.add(shelvesQuantity);
|
||||||
|
|
||||||
BigDecimal oldArea = materialInventoryPO.getArea();
|
BigDecimal oldArea = materialInventoryPO.getArea();
|
||||||
oldArea = oldArea != null ? oldArea : BigDecimal.ZERO;
|
oldArea = oldArea != null ? oldArea : BigDecimal.ZERO;
|
||||||
|
|||||||
Reference in New Issue
Block a user