huminmin
2026-04-23 ef755a24517a15e602b137820a3c60e19b288a9d
导出销售台账送货单
已修改1个文件
17 ■■■■■ 文件已修改
src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java
@@ -292,6 +292,7 @@
                Row row7 = sheet.createRow(7);
                row7.createCell(0).setCellValue("货物详细信息:");
                // 表头:共四联 + 虚线
                int tableStart = 8;
                Row headerRow = sheet.createRow(tableStart);
                String[] headers = {"序号", "物料编号", "品名/规格", "单位", "数量", "订单号", "共四联"};
@@ -299,13 +300,12 @@
                    Cell hc = headerRow.createCell(i);
                    hc.setCellValue(headers[i]);
                    if (i == 6) {
                        hc.setCellStyle(dashStyle);
                        hc.setCellStyle(dashStyle); // 共四联 → 虚线
                    } else {
                        hc.setCellStyle(headerStyle);
                    }
                }
                // 查询商品
                SalesLedgerProduct cond = new SalesLedgerProduct();
                cond.setSalesLedgerId(ledger.getId());
                List<SalesLedgerProduct> productList = salesLedgerProductServiceImpl.selectSalesLedgerProductList(cond);
@@ -324,7 +324,7 @@
                    SalesLedgerProduct p = i < productList.size() ? productList.get(i) : null;
                    Row dataRow = sheet.createRow(currentRow);
                    // 前6列
                    // 前6列赋值
                    if (p != null) {
                        String materialCode = "";
                        if (p.getProductModelId() != null) {
@@ -350,11 +350,16 @@
                        dataRow.getCell(c).setCellStyle(dataCenterStyle);
                    }
                    // 第7列:共四联区域
                    // 共四联列
                    Cell fourCell = dataRow.createCell(6);
                    if (i < fourNames.length) {
                        fourCell.setCellValue(fourNames[i]);
                        fourCell.setCellStyle(dashStyle);
                        if (i == 0 || i == 1 || i == 2) {
                            fourCell.setCellStyle(dashStyle);
                        } else {
                            fourCell.setCellStyle(noBorder);
                        }
                    } else {
                        fourCell.setCellStyle(noBorder);
                    }
@@ -392,7 +397,7 @@
        } catch (Exception e) {
            log.error("批量导出送货单异常", e);
            throw new BaseException("批量导出失败");
            throw new BaseException("导出失败");
        }
    }