| | |
| | | |
| | | int tableStart = 10; |
| | | Row headerRow = sheet.createRow(tableStart); |
| | | headerRow.setHeightInPoints((short)18); |
| | | headerRow.setHeightInPoints((short) 18); |
| | | |
| | | String[] headers = {"序号", "物料编号", "品名/规格", "单位", "数量", "订单号", "共四联"}; |
| | | for (int i = 0; i < headers.length; i++) { |
| | |
| | | for (int i = 0; i < productList.size(); i++) { |
| | | SalesLedgerProduct p = productList.get(i); |
| | | Row dataRow = sheet.createRow(currentRow++); |
| | | dataRow.setHeightInPoints((short)18); |
| | | dataRow.setHeightInPoints((short) 18); |
| | | |
| | | String materialCode = ""; |
| | | if (p.getProductModelId() != null) { |
| | |
| | | for (int i = 0; i < needEmpty; i++) { |
| | | int seq = productList.size() + i; |
| | | Row dataRow = sheet.createRow(currentRow++); |
| | | dataRow.setHeightInPoints((short)18); |
| | | dataRow.setHeightInPoints((short) 18); |
| | | |
| | | for (int c = 0; c <= 5; c++) dataRow.createCell(c).setCellStyle(dataCenterStyle); |
| | | |
| | |
| | | |
| | | // 合计 |
| | | Row totalRow = sheet.createRow(currentRow); |
| | | totalRow.setHeightInPoints((short)18); |
| | | totalRow.setHeightInPoints((short) 18); |
| | | |
| | | // 合计放在第二列,不合并单元格 |
| | | totalRow.createCell(1).setCellValue("合计"); |
| | | totalRow.createCell(4).setCellValue(totalQuantity.doubleValue()); |
| | | |
| | | |
| | | // 设置样式 |
| | | for (int c = 0; c <= 5; c++) { |
| | | Cell cell = totalRow.getCell(c) != null ? totalRow.getCell(c) : totalRow.createCell(c); |
| | |
| | | salesLedgerProduct.setNoInvoiceAmount(salesLedgerProduct.getTaxInclusiveTotalPrice()); |
| | | salesLedgerProduct.setPendingInvoiceTotal(salesLedgerProduct.getTaxInclusiveTotalPrice()); |
| | | salesLedgerProductMapper.insert(salesLedgerProduct); |
| | | |
| | | } |
| | | } |
| | | if (isProduce) { |
| | | for (SalesLedgerProduct salesLedgerProduct : products) { |
| | | // 添加生产数据 |
| | | if (isProduce) { |
| | | salesLedgerProductServiceImpl.addProductionData(salesLedgerProduct); |
| | | } |
| | | salesLedgerProductServiceImpl.addProductionData(salesLedgerProduct); |
| | | } |
| | | } |
| | | } |