# AutoPoi
**Repository Path**: lifuping_net/auto-poi
## Basic Information
- **Project Name**: AutoPoi
- **Description**: AutoPoi 学习
- **Primary Language**: Java
- **License**: Apache-2.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2021-04-22
- **Last Updated**: 2022-06-17
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# AutoPoi
#### 介绍
AutoPoi 学习
参考文档:https://www.kancloud.cn/zhangdaiscott/autopoi/1624233
#### AutoPOI的主要特点
```js
1.设计精巧,使用简单
2.接口丰富,扩展简单
3.默认值多,write less do more
4.AbstractView 支持,web导出可以简单明了
```
#### AutoPOI的几个入口工具类
```js
1.ExcelExportUtil Excel导出(普通导出,模板导出)
2.ExcelImportUtil Excel导入
3.WordExportUtil Word导出(只支持docx ,doc版本poi存在图片的bug,暂不支持)
```
#### 关于Excel导出XLS和XLSX区别
```js
1.导出时间XLS比XLSX快2-3倍
2.导出大小XLS是XLSX的2-3倍或者更多
3.导出需要综合网速和本地速度做考虑^~^
```
#### maven
```xml
org.jeecgframework
autopoi-web
1.3
```
| **1.3**.x | [1.3](https://mvnrepository.com/artifact/org.jeecgframework/autopoi-web/1.3) | [Central](https://mvnrepository.com/repos/central) | [3](https://mvnrepository.com/artifact/org.jeecgframework/autopoi-web/1.3/usages) | Mar, 2021 |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | --------- |
| **1.2**.x | [1.2.5](https://mvnrepository.com/artifact/org.jeecgframework/autopoi-web/1.2.5) | [Central](https://mvnrepository.com/repos/central) | [2](https://mvnrepository.com/artifact/org.jeecgframework/autopoi-web/1.2.5/usages) | Jan, 2021 |
| [1.2.4](https://mvnrepository.com/artifact/org.jeecgframework/autopoi-web/1.2.4) | [Central](https://mvnrepository.com/repos/central) | 0 | Jan, 2021 | |
| [1.2.3](https://mvnrepository.com/artifact/org.jeecgframework/autopoi-web/1.2.3) | [Central](https://mvnrepository.com/repos/central) | [1](https://mvnrepository.com/artifact/org.jeecgframework/autopoi-web/1.2.3/usages) | Dec, 2020 | |
| [1.2.2](https://mvnrepository.com/artifact/org.jeecgframework/autopoi-web/1.2.2) | [Central](https://mvnrepository.com/repos/central) | [1](https://mvnrepository.com/artifact/org.jeecgframework/autopoi-web/1.2.2/usages) | Nov, 2020 | |
| [1.2.1](https://mvnrepository.com/artifact/org.jeecgframework/autopoi-web/1.2.1) | [Central](https://mvnrepository.com/repos/central) | 0 | Aug, 2020 | |
| [1.2](https://mvnrepository.com/artifact/org.jeecgframework/autopoi-web/1.2) | [Central](https://mvnrepository.com/repos/central) | [1](https://mvnrepository.com/artifact/org.jeecgframework/autopoi-web/1.2/usages) | Jul, 2020 | |
| **1.1**.x | [1.1.2](https://mvnrepository.com/artifact/org.jeecgframework/autopoi-web/1.1.2) | [Central](https://mvnrepository.com/repos/central) | 0 | Jul, 2020 |
| **1.0**.x | [1.0.3](https://mvnrepository.com/artifact/org.jeecgframework/autopoi-web/1.0.3) | [Central](https://mvnrepository.com/repos/central) | [1](https://mvnrepository.com/artifact/org.jeecgframework/autopoi-web/1.0.3/usages) | May, 2019 |
| [1.0.2](https://mvnrepository.com/artifact/org.jeecgframework/autopoi-web/1.0.2) | [Central](https://mvnrepository.com/repos/central) | 0 | Apr, 2019 | |
| [1.0.1](https://mvnrepository.com/artifact/org.jeecgframework/autopoi-web/1.0.1) | [Central](https://mvnrepository.com/repos/central) | 0 | Apr, 2019 | |
| [1.0.0](https://mvnrepository.com/artifact/org.jeecgframework/autopoi-web/1.0.0) | [Central](https://mvnrepository.com/repos/central) | | | |
#### AutoPoi导出实例
1.注解,导入导出都是基于注解的,实体上做上注解,标示导出对象,同时可以做一些操作
```java
@ExcelTarget("courseEntity")
public class CourseEntity implements java.io.Serializable {
/** 主键 */
private String id;
/** 课程名称 */
@Excel(name = "课程名称", orderNum = "1", needMerge = true)
private String name;
/** 老师主键 */
@ExcelEntity(id = "yuwen")
@ExcelVerify()
private TeacherEntity teacher;
/** 老师主键 */
@ExcelEntity(id = "shuxue")
private TeacherEntity shuxueteacher;
@ExcelCollection(name = "选课学生", orderNum = "4")
private List students;
```
2.基础导出
传入导出参数,导出对象,以及对象列表即可完成导出
```java
HSSFWorkbook workbook = ExcelExportUtil.exportExcel(new ExportParams(
"2412312", "测试", "测试"), CourseEntity.class, list);
```
```java
HSSFWorkbook workbook = ExcelExportUtil.exportExcel(new ExportParams(
"2412312", "测试", "测试"), CourseEntity.class, list,exportFields);
```
3.基础导出,带有索引
在到处参数设置一个值,就可以在导出列增加索引
```java
ExportParams params = new ExportParams("2412312", "测试", "测试");
params.setAddIndex(true);//设置索引
HSSFWorkbook workbook = ExcelExportUtil.exportExcel(params,
TeacherEntity.class, telist);
```
4.导出Map
创建类似注解的集合,即可完成Map的导出**`,略有麻烦`**
```java
List entity = new ArrayList();
entity.add(new ExcelExportEntity("姓名", "name"));
entity.add(new ExcelExportEntity("性别", "sex"));
List