liyong
2026-04-15 a69fd0e2119b8088dbd5f8d7a3ccd9ac4c713ec8
style(utils): 调整StockUtils 库存操作代码
已修改1个文件
6 ■■■■■ 文件已修改
src/main/java/com/ruoyi/procurementrecord/utils/StockUtils.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/procurementrecord/utils/StockUtils.java
@@ -106,7 +106,6 @@
                .eq(StockInRecord::getRecordType, recordType));
        if (ObjectUtils.isNotEmpty(one)) {
            stockInRecordService.batchDelete(Collections.singletonList(one.getId()));
        }
        //将库存减回来
        StockInventoryDto stockInventoryDto = new StockInventoryDto();
        stockInventoryDto.setRecordId(recordId);
@@ -114,13 +113,14 @@
        stockInventoryDto.setQualitity(one.getStockInNum());
        stockInventoryMapper.updateSubtractStockInventory((stockInventoryDto));
    }
    }
    public void deleteStockOutRecord(Long recordId, String recordType) {
        StockOutRecord one = stockOutRecordService.getOne(new QueryWrapper<StockOutRecord>()
                .lambda().eq(StockOutRecord::getRecordId, recordId)
                .eq(StockOutRecord::getRecordType, recordType));
        if (ObjectUtils.isNotEmpty(one)) {
            stockOutRecordService.batchDelete(Collections.singletonList(one.getId()));
        }
        //将库存加回来
        StockInventoryDto stockInventoryDto = new StockInventoryDto();
        stockInventoryDto.setRecordId(recordId);
@@ -128,4 +128,6 @@
        stockInventoryDto.setQualitity(one.getStockOutNum());
        stockInventoryMapper.updateAddStockInventory((stockInventoryDto));
    }
    }
}