liding
2026-04-20 caef916e9102b0236ce8021be1b9a985a7577bed
src/main/java/com/ruoyi/procurementrecord/utils/StockUtils.java
@@ -106,13 +106,14 @@
                .eq(StockInRecord::getRecordType, recordType));
        if (ObjectUtils.isNotEmpty(one)) {
            stockInRecordService.batchDelete(Collections.singletonList(one.getId()));
            //将库存减回来
            StockInventoryDto stockInventoryDto = new StockInventoryDto();
            stockInventoryDto.setRecordId(recordId);
            stockInventoryDto.setRecordType(recordType);
            stockInventoryDto.setQualitity(one.getStockInNum());
            stockInventoryMapper.updateSubtractStockInventory((stockInventoryDto));
        }
        //将库存减回来
        StockInventoryDto stockInventoryDto = new StockInventoryDto();
        stockInventoryDto.setRecordId(recordId);
        stockInventoryDto.setRecordType(recordType);
        stockInventoryDto.setQualitity(one.getStockInNum());
        stockInventoryMapper.updateSubtractStockInventory((stockInventoryDto));
    }
    public void deleteStockOutRecord(Long recordId, String recordType) {
        StockOutRecord one = stockOutRecordService.getOne(new QueryWrapper<StockOutRecord>()
@@ -120,12 +121,13 @@
                .eq(StockOutRecord::getRecordType, recordType));
        if (ObjectUtils.isNotEmpty(one)) {
            stockOutRecordService.batchDelete(Collections.singletonList(one.getId()));
            //将库存加回来
            StockInventoryDto stockInventoryDto = new StockInventoryDto();
            stockInventoryDto.setRecordId(recordId);
            stockInventoryDto.setRecordType(recordType);
            stockInventoryDto.setQualitity(one.getStockOutNum());
            stockInventoryMapper.updateAddStockInventory((stockInventoryDto));
        }
        //将库存加回来
        StockInventoryDto stockInventoryDto = new StockInventoryDto();
        stockInventoryDto.setRecordId(recordId);
        stockInventoryDto.setRecordType(recordType);
        stockInventoryDto.setQualitity(one.getStockOutNum());
        stockInventoryMapper.updateAddStockInventory((stockInventoryDto));
    }
}