package com.dbnt.faisp.util;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

import java.util.List;

@Getter
@Setter
@NoArgsConstructor
@ToString
public class Excel {
    private String[] headers;
    private String[] headerNames;
    private String[] headerNames2;
    private String[] headerNames3;
    private String[] columnType;
    private String sheetName;
    private String excelFileName;
    private List<ParamMap> list;
    private String outputFileName;
    private Row row;

    private Row headerRow;
    private Sheet sheet;
    private CellStyle cellStyle1; //쉼표들어간 숫자 양식
    private CellStyle cellStyle2; //숫자양식
    private CellStyle headerStyle; //숫자양식
    private CellStyle headerStyle2;
    private CellStyle headerStyle3;


    public void defalutConfig(XSSFWorkbook wb){
        this.setSheet(wb.createSheet(this.sheetName));
        this.setHeaderRow(this.sheet.createRow(0));
        this.setCellStyle1(wb.createCellStyle());
        this.setCellStyle2(wb.createCellStyle());
        this.setHeaderStyle(wb.createCellStyle());
        this.setHeaderStyle2(wb.createCellStyle());
        this.setHeaderStyle3(wb.createCellStyle());
    }
}
