| | |
| | | Row row7 = sheet.createRow(7); |
| | | row7.createCell(0).setCellValue("货物详细信息:"); |
| | | |
| | | // 表头:共四联 + 虚线 |
| | | int tableStart = 8; |
| | | Row headerRow = sheet.createRow(tableStart); |
| | | String[] headers = {"序号", "物料编号", "品名/规格", "单位", "数量", "订单号", "共四联"}; |
| | |
| | | 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); |
| | |
| | | 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) { |
| | |
| | | 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); |
| | | } |
| | |
| | | |
| | | } catch (Exception e) { |
| | | log.error("批量导出送货单异常", e); |
| | | throw new BaseException("批量导出失败"); |
| | | throw new BaseException("导出失败"); |
| | | } |
| | | } |
| | | |