liding
2026-04-15 a97eb69a7233fc36a794832210fb1b0de037f2bb
src/main/java/com/ruoyi/procurementrecord/utils/StockUtils.java
@@ -38,12 +38,15 @@
     * @param recordType
     * @param recordId
     */
    public void addUnStock(Long productModelId, BigDecimal quantity, String recordType,Long recordId) {
    public void addUnStock(Long productModelId, BigDecimal quantity, String recordType,Long recordId, String batchNo, String customer, LocalDate productionDate) {
        StockUninventoryDto stockUninventoryDto = new StockUninventoryDto();
        stockUninventoryDto.setRecordId(recordId);
        stockUninventoryDto.setRecordType(String.valueOf(recordType));
        stockUninventoryDto.setQualitity(quantity);
        stockUninventoryDto.setProductModelId(productModelId);
        stockUninventoryDto.setBatchNo(batchNo);
        stockUninventoryDto.setCustomer(customer);
        stockUninventoryDto.setProductionDate(productionDate);
        stockUninventoryService.addStockUninventory(stockUninventoryDto);
    }
@@ -115,13 +118,13 @@
                .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>()
@@ -129,12 +132,12 @@
                .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));
    }
}