huminmin
13 小时以前 61e45a2a7c94d845de5b9ace90bfee4bc9af4fd2
src/main/java/com/ruoyi/purchase/service/impl/PurchaseLedgerServiceImpl.java
@@ -290,11 +290,13 @@
            Long productId = product.getProductId();
            if (productId != null && productMap.containsKey(productId)) {
                product.setProductCategory(productMap.get(productId));
                product.setProductId(productId);
            }
            Long productModelId = product.getProductModelId();
            if (productModelId != null && modelMap.containsKey(productModelId)) {
                product.setSpecificationModel(modelMap.get(productModelId));
                product.setProductModelId(productModelId);
            }
        }
@@ -511,6 +513,11 @@
        productWrapper.eq(SalesLedgerProduct::getSalesLedgerId, purchaseLedger.getId())
                .eq(SalesLedgerProduct::getType, purchaseLedgerDto.getType());
        List<SalesLedgerProduct> products = salesLedgerProductMapper.selectList(productWrapper);
        for (SalesLedgerProduct product : products) {
            ProductModel productModel = productModelMapper.selectById(product.getProductModelId());
            product.setMaterialCode(productModel.getMaterialCode());
        }
        // 3.查询上传文件
        LambdaQueryWrapper<CommonFile> salesLedgerFileWrapper = new LambdaQueryWrapper<>();
@@ -778,6 +785,10 @@
        productWrapper.eq(SalesLedgerProduct::getSalesLedgerId, purchaseLedger.getId())
                .eq(SalesLedgerProduct::getType, 2);
        List<SalesLedgerProduct> products = salesLedgerProductMapper.selectList(productWrapper);
        for (SalesLedgerProduct product : products) {
            ProductModel productModel = productModelMapper.selectById(product.getProductModelId());
            product.setMaterialCode(productModel != null ? productModel.getMaterialCode() : "");
        }
        // 4. 转换 DTO
        PurchaseLedgerDto resultDto = new PurchaseLedgerDto();