类 ExcelTemplateService
java.lang.Object
com.sh.wf.design.service.BaseService
com.sh.wf.design.service.ExcelTemplateService
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明protected StringconvertCellValue(String cellValue) 转换单元格值,主要是将回车换行的转换为 特殊字符protected StringconvertToExcelColumn(int columnNumber) 将数字转换为Excel列名getModule(DesignHttpServletRequest request, DesignHttpServletResponse response, org.springframework.web.multipart.MultipartFile file) 按照上传的excel生成模板getTable(DesignHttpServletRequest request, DesignHttpServletResponse response, org.springframework.web.multipart.MultipartFile file) 获取表格组件protected voidprocessBorder(org.apache.poi.ss.usermodel.CellStyle cellStyle, com.sh.wf.design.service.ColorInfo bgColor, StringBuilder builder) protected voidprocessCell(int rowIndex, int columnIndex, org.apache.poi.ss.usermodel.Cell cell, List<org.apache.poi.ss.util.CellRangeAddress> mergeCellList, String cellValue, StringBuilder builder) 处理单元格protected voidprocessStyle(org.apache.poi.ss.usermodel.Cell cell, int rowSpan, int colSpan, StringBuilder builder) 单元格样式
-
构造器详细资料
-
ExcelTemplateService
public ExcelTemplateService()
-
-
方法详细资料
-
getModule
public String getModule(DesignHttpServletRequest request, DesignHttpServletResponse response, org.springframework.web.multipart.MultipartFile file) 按照上传的excel生成模板- 参数:
request-response-- 返回:
-
getTable
public String getTable(DesignHttpServletRequest request, DesignHttpServletResponse response, org.springframework.web.multipart.MultipartFile file) 获取表格组件- 参数:
request-response-file-- 返回:
-
processCell
protected void processCell(int rowIndex, int columnIndex, org.apache.poi.ss.usermodel.Cell cell, List<org.apache.poi.ss.util.CellRangeAddress> mergeCellList, String cellValue, StringBuilder builder) 处理单元格- 参数:
cell- 有可能为空builder-
-
processStyle
protected void processStyle(org.apache.poi.ss.usermodel.Cell cell, int rowSpan, int colSpan, StringBuilder builder) 单元格样式- 参数:
cell-builder-
-
processBorder
protected void processBorder(org.apache.poi.ss.usermodel.CellStyle cellStyle, com.sh.wf.design.service.ColorInfo bgColor, StringBuilder builder) -
convertToExcelColumn
将数字转换为Excel列名- 参数:
columnNumber- 从1开始- 返回:
-
convertCellValue
转换单元格值,主要是将回车换行的转换为 特殊字符- 参数:
cellValue-- 返回:
-