src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java
@@ -429,6 +429,10 @@
                for (SalesLedgerProductImportDto salesLedgerProductImportDto : salesLedgerProductImportDtos) {
                    SalesLedgerProduct salesLedgerProduct = new SalesLedgerProduct();
                    List<StockInventory> stockInventories = stockInventoryMapper.selectList(new LambdaQueryWrapper<StockInventory>().in(StockInventory::getBatchNo, salesLedgerProductImportDto.getBatchNo()));
                    if (CollectionUtils.isEmpty(stockInventories)) {
                        throw new RuntimeException("产品批号:" + salesLedgerProductImportDto.getBatchNo() + ",库存无对应产品数据!");
                    }
                    BeanUtils.copyProperties(salesLedgerProductImportDto, salesLedgerProduct);
                    salesLedgerProduct.setSalesLedgerId(salesLedger.getId());
                    salesLedgerProduct.setType(1);
@@ -458,16 +462,13 @@
                    salesLedgerProduct.setApproveStatus(0);
                    salesLedgerProduct.setPendingInvoiceTotal(salesLedgerProductImportDto.getTaxInclusiveTotalPrice());
                    salesLedgerProductMapper.insert(salesLedgerProduct);
                    // 添加生产数据
                    salesLedgerProductServiceImpl.addProductionData(salesLedgerProduct);
                }
            }
            return AjaxResult.success("导入成功");
        } catch (Exception e) {
            e.printStackTrace();
            throw new RuntimeException(e.getMessage());
        }
        return AjaxResult.success("导入失败");
    }
    @Override