package com.yanzuoguang.excel; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; /** * 订单导出数据配置信息,需要注意,多线程导出时配置不能共用同一个对象 * * @author 颜佐光 */ @ApiModel(description = "订单导出数据配置信息,需要注意,多线程导出时配置不能共用同一个对象") public class ExportData { @ApiModelProperty(notes = "普通导出模式") public static final int EXPORT_TYPE_COMMON = 0; @ApiModelProperty(notes = "等待下载") public static final int EXPORT_TYPE_WAIT = 1; @ApiModelProperty(notes = "下载文件") public static final int EXPORT_TYPE_DOWN = 2; @ApiModelProperty(notes = "行默认高度") public static final short ROW_HEIGHT_UNIT = 10; @ApiModelProperty(notes = "标题默认高度") public static final short TITLE_HEIGHT = 80; @ApiModelProperty(notes = "子标题默认高度") public static final short SUB_TITLE_HEIGHT = 40; @ApiModelProperty(notes = "头默认高度") public static final short HEAD_HEIGHT = 40; @ApiModelProperty(notes = "行默认高度") public static final short ROW_HEIGHT = 30; @ApiModelProperty(notes = "列默认宽度") public static final short COLUMN_WIDTH = 100; /** * 服务器保存路径 */ @ApiModelProperty(notes = "服务器保存路径") private String serverPath; /** * 文件名 */ @ApiModelProperty(notes = "文件名,在为实时导出时,可以不传输文件名.在为等待下载模式时,第一次保存时可以不传文件名,会自动生成,但是后续需要传输文件名") private String fileName; /** * 下载文件名 */ @ApiModelProperty(notes = "下载文件名") private String downFileName; /** * 标题 */ @ApiModelProperty(notes = "标题") private String title; /** * 标题高度 */ @ApiModelProperty(notes = "标题高度") private short titleHeight; /** * 子标题 */ @ApiModelProperty(notes = "子标题") private String subTitle; /** * 子标题高度 */ @ApiModelProperty(notes = "子标题高度") private short subTitleHeight; /** * 列标题高度 */ @ApiModelProperty(notes = "列标题高度") private short headHeight; /** * 行高度 */ @ApiModelProperty(notes = "行高度") private short rowHeight; /** * 自动换行 */ @ApiModelProperty(notes = "自动换行") private boolean line; /** * 数据开始自定义行 */ @ApiModelProperty(notes = "数据开始自定义行") private List<ExcelDefineRow> startRows = new ArrayList<>(); /** * 包含列 */ @ApiModelProperty(notes = "包含列") private List<ExportColumn> columns = new ArrayList<>(); /** * 数据结束自定义行 */ @ApiModelProperty(notes = "数据结束自定义行") private List<ExcelDefineRow> endRows = new ArrayList<>(); public String getServerPath() { return serverPath; } public void setServerPath(String serverPath) { this.serverPath = serverPath; } public String getFileName() { return fileName; } public void setFileName(String fileName) { this.fileName = fileName; } public String getDownFileName() { return downFileName; } public void setDownFileName(String downFileName) { this.downFileName = downFileName; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public short getTitleHeight() { if (titleHeight < 1) { return TITLE_HEIGHT; } return titleHeight; } public void setTitleHeight(short titleHeight) { this.titleHeight = titleHeight; } public String getSubTitle() { return subTitle; } public void setSubTitle(String subTitle) { this.subTitle = subTitle; } public short getSubTitleHeight() { if (subTitleHeight < 1) { return SUB_TITLE_HEIGHT; } return subTitleHeight; } public void setSubTitleHeight(short subTitleHeight) { this.subTitleHeight = subTitleHeight; } public short getHeadHeight() { if (headHeight < 1) { return HEAD_HEIGHT; } return headHeight; } public void setHeadHeight(short headHeight) { this.headHeight = headHeight; } public short getRowHeight() { if (rowHeight < 1) { return ROW_HEIGHT; } return rowHeight; } public void setRowHeight(short rowHeight) { this.rowHeight = rowHeight; } public boolean isLine() { return line; } public void setLine(boolean line) { this.line = line; } public List<ExcelDefineRow> getStartRows() { return startRows; } public void setStartRows(List<ExcelDefineRow> startRows) { this.startRows = startRows; } public List<ExportColumn> getColumns() { return columns; } public void setColumns(List<ExportColumn> columns) { this.columns = columns; } public List<ExcelDefineRow> getEndRows() { return endRows; } public void setEndRows(List<ExcelDefineRow> endRows) { this.endRows = endRows; } }