|
|
@@ -4516,9 +4516,9 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
stockDesc.setStoreInventory(stockDesc.getBalanceQuantity());
|
|
|
BigDecimal inventoryAmount = item.getSendNum().multiply(stockOne.getInventoryCostPrice());
|
|
|
BigDecimal rebateInventoryAmount = item.getSendNum().multiply(stockOne.getRebatePrice());
|
|
|
- stockDesc.setInventoryAmount(stockOne.getInventoryAmount().add(inventoryAmount));
|
|
|
- stockDesc.setRebateInventoryAmount(stockOne.getRebateInventoryAmount().add(rebateInventoryAmount));
|
|
|
- stockDesc.setInventoryCostPrice(stockDesc.getInventoryAmount().divide(stockDesc.getBalanceQuantity(), RoundingMode.DOWN).setScale(2, RoundingMode.DOWN));
|
|
|
+ stockDesc.setInventoryAmount(inventoryAmount.compareTo(BigDecimal.ZERO) == 0 ? item.getSendNum().multiply(item.getCostpriePrice()) : stockOne.getInventoryAmount().add(inventoryAmount));
|
|
|
+ stockDesc.setRebateInventoryAmount(inventoryAmount.compareTo(BigDecimal.ZERO) == 0 ? item.getSendNum().multiply(item.getRebatePrice()) : stockOne.getRebateInventoryAmount().add(rebateInventoryAmount));
|
|
|
+ stockDesc.setInventoryCostPrice(inventoryAmount.compareTo(BigDecimal.ZERO) == 0 ? item.getCostpriePrice() : stockDesc.getInventoryAmount().divide(stockDesc.getBalanceQuantity(), RoundingMode.DOWN).setScale(2, RoundingMode.DOWN));
|
|
|
stockDesc.setVersion(stockOne.getVersion());
|
|
|
pjStockDescArrayListUpdate.add(stockDesc);
|
|
|
}
|