liding
2026-05-22 94ec4e9e9214cb5dc28aef4a7f38be462cfda728
src/main/java/com/ruoyi/stock/service/impl/StockInventoryServiceImpl.java
@@ -263,6 +263,11 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public Boolean subtractStockInventory(StockInventoryDto stockInventoryDto) {
        if (stockInventoryDto.getQualitity() != null
                && stockInventoryDto.getQualitity().compareTo(BigDecimal.ZERO) == 0) {
            return true;
        }
        StockOutRecordDto stockOutRecordDto = new StockOutRecordDto();
        stockOutRecordDto.setRecordId(stockInventoryDto.getRecordId());
        stockOutRecordDto.setRecordType(stockInventoryDto.getRecordType());
@@ -298,7 +303,7 @@
                throw new RuntimeException("产品库存不存在");
            }
            BigDecimal remainingQty = stockInventoryDto.getQualitity();
            BigDecimal remainingQty = stockInventoryDto.getQualitity() == null ? BigDecimal.ZERO : stockInventoryDto.getQualitity();
            for (StockInventory stockInventory : stockInventories) {
                BigDecimal lockedQty = defaultDecimal(stockInventory.getLockedQuantity());
                BigDecimal availableQty = defaultDecimal(stockInventory.getQualitity()).subtract(lockedQty);