liyong
2026-05-12 a122cfc45d18b6e679029a88eb342e9081df6595
src/main/java/com/ruoyi/stock/service/impl/StockOutRecordServiceImpl.java
@@ -57,6 +57,9 @@
    public Long add(StockOutRecordDto stockOutRecordDto) {
        String no = OrderUtils.countTodayByCreateTime(stockOutRecordMapper, "CK","outbound_batches");
        stockOutRecordDto.setOutboundBatches(no);
        if (StockOutQualifiedRecordTypeEnum.SALE_SHIP_STOCK_OUT.getCode().equals(stockOutRecordDto.getRecordType())){
            stockOutRecordDto.setApprovalStatus(3);
        }
        StockInRecord stockInRecord = new StockInRecord();
        BeanUtils.copyProperties(stockOutRecordDto, stockInRecord);
        stockOutRecordMapper.insert(stockOutRecordDto);
@@ -128,7 +131,7 @@
            if (stockInRecordExportData.getType().equals("0")) {
                stockInRecordExportData.setRecordType(EnumUtil.fromCode(StockOutQualifiedRecordTypeEnum.class, Integer.parseInt(stockInRecordExportData.getRecordType())).getValue());
            }else {
                stockInRecordExportData.setRecordType(EnumUtil.fromCode(StockInUnQualifiedRecordTypeEnum.class, Integer.parseInt(stockInRecordExportData.getRecordType())).getValue());
                stockInRecordExportData.setRecordType(EnumUtil.fromCode(StockInQualifiedRecordTypeEnum.class, Integer.parseInt(stockInRecordExportData.getRecordType())).getValue());
            }
        }
        ExcelUtil<StockOutRecordExportData> util = new ExcelUtil<>(StockOutRecordExportData.class);
@@ -177,6 +180,9 @@
                    if (stockInventory == null) {
                        throw new BaseException("合格库存记录不存在,出库批次:" + stockOutRecord.getOutboundBatches());
                    }
                    if (stockInventory.getLocked().equals( true)&&!stockOutRecord.getRecordType().equals(StockOutQualifiedRecordTypeEnum.INVENTORY_CHECK_STOCK_OUT.getCode())) {
                        throw new BaseException("正在库存盘点,无法出库,出库批次:" + stockOutRecord.getOutboundBatches());
                    }
                    StockInventoryDto stockInventoryDto = new StockInventoryDto();
                    stockInventoryDto.setProductModelId(stockOutRecord.getProductModelId());
                    stockInventoryDto.setBatchNo(stockOutRecord.getBatchNo());