File was renamed from pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/excel/ReportExportCellWriteHandler.java |
| | |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-08-26 14:18 |
| | | * @LastEditTime 2024-08-26 14:18 |
| | | * @Description |
| | | * @date 2024-10-12 11:40 |
| | | * @LastEditTime 2024-10-12 11:40 |
| | | * @Description 总账表格设置 |
| | | */ |
| | | |
| | | public class ReportExportCellWriteHandler extends AbstractVerticalCellStyleStrategy { |
| | | public class CellWriteHandler extends AbstractVerticalCellStyleStrategy { |
| | | private String title; |
| | | |
| | | PropertyPlaceholderHelper propertyPlaceholderHelper = new PropertyPlaceholderHelper("${", "}"); |
| | | |
| | | public ReportExportCellWriteHandler(String title) { |
| | | public CellWriteHandler(String title) { |
| | | this.title = title; |
| | | } |
| | | |
| | |
| | | |
| | | if (cell.getRowIndex() >= 2){ |
| | | ((XSSFCellStyle) originCellStyle).setFillForegroundColor(new XSSFColor(new java.awt.Color(237, 237, 237), new DefaultIndexedColorMap())); |
| | | // 票面总价 |
| | | |
| | | //if (cell.getColumnIndex() == 10){ |
| | | // int actualCellRowNum = context.getCell().getRowIndex() + 1; |
| | | // context.getCell().setCellFormula("I" + actualCellRowNum +"+J" + actualCellRowNum); |
| | | // System.out.println("第" + context.getCell().getRowIndex() + "行,第" + context.getCell().getColumnIndex() + "票面总价写入公式完成"); |
| | | //}else if (cell.getColumnIndex() == 12){ |
| | | // // 支付票款 |
| | | // int actualCellRowNum = context.getCell().getRowIndex() + 1; |
| | | // context.getCell().setCellFormula("K" + actualCellRowNum +"-L" + actualCellRowNum); |
| | | // System.out.println("第" + context.getCell().getRowIndex() + "行,第" + context.getCell().getColumnIndex() + "支付票款写入公式完成"); |
| | | //}else if (cell.getColumnIndex() == 15){ |
| | | // // 支付总额 |
| | | // int actualCellRowNum = context.getCell().getRowIndex() + 1; |
| | | // context.getCell().setCellFormula("M" + actualCellRowNum +"+N" + actualCellRowNum +"+O" + actualCellRowNum); |
| | | // System.out.println("第" + context.getCell().getRowIndex() + "行,第" + context.getCell().getColumnIndex() + "支付总额写入公式完成"); |
| | | //}else if (cell.getColumnIndex() == 17){ |
| | | // // 实际利润 |
| | | // int actualCellRowNum = context.getCell().getRowIndex() + 1; |
| | | // context.getCell().setCellFormula("L" + actualCellRowNum +"+Q" + actualCellRowNum); |
| | | // System.out.println("第" + context.getCell().getRowIndex() + "行,第" + context.getCell().getColumnIndex() + "实际利润写入公式完成"); |
| | | //}else if (cell.getColumnIndex() == 18){ |
| | | // // 应收款 |
| | | // int actualCellRowNum = context.getCell().getRowIndex() + 1; |
| | | // context.getCell().setCellFormula("P" + actualCellRowNum +"+R" + actualCellRowNum); |
| | | // System.out.println("第" + context.getCell().getRowIndex() + "行,第" + context.getCell().getColumnIndex() + "应收款写入公式完成"); |
| | | //}else if (cell.getColumnIndex() == 20){ |
| | | // // 未收款 |
| | | // int actualCellRowNum = context.getCell().getRowIndex() + 1; |
| | | // context.getCell().setCellFormula("S" + actualCellRowNum +"-T" + actualCellRowNum); |
| | | // System.out.println("第" + context.getCell().getRowIndex() + "行,第" + context.getCell().getColumnIndex() + "未收款写入公式完成"); |
| | | //}else if (cell.getColumnIndex() >= 2){ |
| | | // ((XSSFCellStyle) originCellStyle).setFillForegroundColor(new XSSFColor(new java.awt.Color(189, 215, 238), new DefaultIndexedColorMap())); |
| | | //}else if (cell.getColumnIndex() < 2){ |
| | | // ((XSSFCellStyle) originCellStyle).setFillForegroundColor(new XSSFColor(new java.awt.Color(255, 192, 0), new DefaultIndexedColorMap())); |
| | | //} |
| | | } |
| | | |
| | |
| | | |
| | | cellData.getWriteCellStyle().setWriteFont(headWriteFont); |
| | | } |
| | | } |
| | | |
| | | } |