导出excel
parent
8941a4e9f4
commit
053807da69
@ -0,0 +1,73 @@
|
||||
package com.anjiplus.template.gaea.business.enums;
|
||||
|
||||
/**
|
||||
* @author zhouhang
|
||||
* @description EXCEL居中方式
|
||||
* @date 2021/4/26
|
||||
*/
|
||||
public enum ExcelCenterStyleEnum {
|
||||
/**
|
||||
* 左对齐
|
||||
*/
|
||||
LEFT((short) 1, 1, "左对齐"),
|
||||
/**
|
||||
* 右对齐
|
||||
*/
|
||||
RIGHT((short) 3, 2, "右对齐"),
|
||||
/**
|
||||
* 居中
|
||||
*/
|
||||
CENTER((short) 2, 0, "居中"),
|
||||
;
|
||||
|
||||
/**
|
||||
* excel居中code
|
||||
*/
|
||||
private final short excelCode;
|
||||
|
||||
/**
|
||||
* 在线文档居中code
|
||||
*/
|
||||
private final Integer onlineExcelCode;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
|
||||
public Integer getOnlineExcelCode() {
|
||||
return onlineExcelCode;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public short getExcelCode() {
|
||||
return excelCode;
|
||||
}
|
||||
|
||||
ExcelCenterStyleEnum(short excelCode, Integer onlineExcelCode, String name) {
|
||||
this.excelCode = excelCode;
|
||||
this.onlineExcelCode = onlineExcelCode;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param code excel居中样式code
|
||||
* @return Enum_ExcelCenterStyle
|
||||
* @description 根据excel居中样式获取在线文档居中样式
|
||||
* @author zhouhang
|
||||
* @date 2021/4/26
|
||||
*/
|
||||
public static ExcelCenterStyleEnum getExcelCenterStyleByExcelCenterCode(short code) {
|
||||
for (ExcelCenterStyleEnum value : ExcelCenterStyleEnum.values()) {
|
||||
if (code == value.getExcelCode()) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return CENTER;
|
||||
}
|
||||
|
||||
}
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue