Skip to content

Excel 导入导出(forge-starter-excel)

工程位置:forge-server/forge-framework/forge-starter-parent/forge-starter-excel。Maven artifactIdforge-starter-excelsrc/main/java 里有 26 个 Java 文件。

引入

xml
<dependency>
    <groupId>com.mdframe.forge</groupId>
    <artifactId>forge-starter-excel</artifactId>
</dependency>

自动装配

META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports 登记了:

  • com.mdframe.forge.starter.excel.config.ExcelAutoConfiguration

注解

@ExcelExport

com.mdframe.forge.starter.excel.annotation.ExcelExport

成员类型默认值说明
sheetNameString"Sheet1"标记实体类支持Excel导出 配置类级别的导出属性
autoTransbooleantrue标记实体类支持Excel导出 配置类级别的导出属性
filterNullbooleanfalse标记实体类支持Excel导出 配置类级别的导出属性

@ExcelColumn

com.mdframe.forge.starter.excel.annotation.ExcelColumn

成员类型默认值说明
valueString""Excel导出字段配置注解 标注在实体字段上,配置导出行为
widthint20Excel导出字段配置注解 标注在实体字段上,配置导出行为
orderintInteger.MAX_VALUEExcel导出字段配置注解 标注在实体字段上,配置导出行为
exportbooleantrueExcel导出字段配置注解 标注在实体字段上,配置导出行为
dateFormatString"yyyy-MM-dd HH:mm:ss"Excel导出字段配置注解 标注在实体字段上,配置导出行为
numberFormatString""Excel导出字段配置注解 标注在实体字段上,配置导出行为
dictTypeString""Excel导出字段配置注解 标注在实体字段上,配置导出行为
needTransbooleanfalseExcel导出字段配置注解 标注在实体字段上,配置导出行为

源码类型清单

下面只列 forge-starter-excel 自己的公开类型。

接口

  • com.mdframe.forge.starter.excel.service.AsyncExportService
  • com.mdframe.forge.starter.excel.service.ExcelImportService
  • com.mdframe.forge.starter.excel.spi.ExcelConfigProvider
  • com.mdframe.forge.starter.excel.spi.ExcelMetadataProvider

枚举

  • AsyncExportStatus

  • AsyncExportServiceImpl
  • AsyncExportTask
  • DynamicExportEngine
  • ExcelAutoConfiguration
  • ExcelColumnConfig
  • ExcelEnhancedController
  • ExcelExportConfig
  • ExcelExportMetadata
  • ExcelExporter
  • ExcelImportServiceImpl
  • ExcelImportTemplateWriter
  • ExcelTemplateExporter
  • ExcelUtils
  • GenericExportController
  • GenericRowData
  • GenericRowDataListener
  • ImportErrorRecord
  • ImportResult

相关文档