Skip to content

Commit

Permalink
🔖 Releasing / Version tags. 1.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
lbw committed May 27, 2022
1 parent f9bf0ab commit 9b720b2
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 213 deletions.
202 changes: 0 additions & 202 deletions LICENSE

This file was deleted.

1 change: 1 addition & 0 deletions .springjavaformatconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
java-baseline=8
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ EasyExcel是一个基于Java的简单、省内存的读写Excel的开源项目
<dependency>
<groupId>com.pig4cloud.excel</groupId>
<artifactId>excel-spring-boot-starter</artifactId>
<version>1.2.1</version>
<version>1.2.2</version>
</dependency>
```

Expand Down Expand Up @@ -46,7 +46,7 @@ public class Demo {
@ExcelProperty(index = 1)
private String password;
}
```RequestExcel
```

- 测试表格

Expand Down Expand Up @@ -82,6 +82,7 @@ public @interface ResponseExcel {
### 基础用法

- 返回单 `sheet`, 全部字段导出
-
```java
@ResponseExcel(name = "test", sheets = @Sheet(sheetName = "testSheet1"))
@GetMapping("/e1")
Expand Down
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.7</version>
<version>2.7.0</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.pig4cloud.excel</groupId>
<artifactId>excel-spring-boot-starter</artifactId>
<version>1.2.1</version>
<version>1.2.2</version>
<name>excel-spring-boot-starter</name>
<description>easy and high performance excel</description>
<url>https://pig4cloud.com</url>
Expand All @@ -37,8 +37,8 @@
<properties>
<java.version>1.8</java.version>
<easyexcel.version>3.1.0</easyexcel.version>
<mica.version>2.2.2</mica.version>
<spring.checkstyle.plugin>0.0.29</spring.checkstyle.plugin>
<mica.version>2.3.0</mica.version>
<spring.checkstyle.plugin>0.0.32</spring.checkstyle.plugin>
<git.commit.plugin>2.2.5</git.commit.plugin>
</properties>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
import com.pig4cloud.plugin.excel.processor.NameProcessor;
import com.pig4cloud.plugin.excel.processor.NameSpelExpressionProcessor;
import lombok.RequiredArgsConstructor;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.method.support.HandlerMethodReturnValueHandler;
Expand All @@ -27,8 +27,8 @@
* 配置初始化
*/
@Import(ExcelHandlerConfiguration.class)
@AutoConfiguration
@RequiredArgsConstructor
@Configuration(proxyBeanMethods = false)
@EnableConfigurationProperties(ExcelConfigProperties.class)
public class ResponseExcelAutoConfiguration {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,10 @@
*/
boolean i18nHeader() default false;

/**
* 填充模式
* @return
*/
boolean fill() default false;

}
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,14 @@ public void write(Object obj, HttpServletResponse response, ResponseExcel respon
Class<?> dataClass = eleList.get(0).getClass();
// 创建sheet
sheet = this.sheet(sheets[i], dataClass, responseExcel.template(), responseExcel.headGenerator());
// 写入sheet
excelWriter.write(eleList, sheet);
// 填充 sheet
if (responseExcel.fill()) {
excelWriter.fill(eleList, sheet);
}
else {
// 写入sheet
excelWriter.write(eleList, sheet);
}
}
excelWriter.finish();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,15 @@ public void write(Object obj, HttpServletResponse response, ResponseExcel respon
Class<?> dataClass = list.get(0).getClass();
WriteSheet sheet = this.sheet(responseExcel.sheets()[0], dataClass, responseExcel.template(),
responseExcel.headGenerator());
excelWriter.write(list, sheet);

// 填充 sheet
if (responseExcel.fill()) {
excelWriter.fill(list, sheet);
}
else {
// 写入sheet
excelWriter.write(list, sheet);
}
excelWriter.finish();
}

Expand Down
11 changes: 11 additions & 0 deletions src/test/java/com/pig4cloud/plugin/excel/FillExcelTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.pig4cloud.plugin.excel;

/**
* fill 填充测试
*
* @author lengleng
* @date 2022/5/27
*/
public class FillExcelTest {

}
Binary file added src/test/resources/tmp/fill.xlsx
Binary file not shown.

0 comments on commit 9b720b2

Please sign in to comment.