浏览代码

升级到4.1.2版本,修复下表头问题

4.1.3.A
jueyue 5 年前
父节点
当前提交
c20d19bb1d
共有 9 个文件被更改,包括 38 次插入13 次删除
  1. +1
    -1
      easypoi-annotation/pom.xml
  2. +1
    -1
      easypoi-base/pom.xml
  3. +17
    -0
      easypoi-base/src/main/java/cn/afterturn/easypoi/excel/entity/ExportParams.java
  4. +4
    -0
      easypoi-base/src/main/java/cn/afterturn/easypoi/excel/entity/ImportParams.java
  5. +3
    -3
      easypoi-base/src/main/java/cn/afterturn/easypoi/excel/entity/result/ExcelImportResult.java
  6. +2
    -2
      easypoi-base/src/main/java/cn/afterturn/easypoi/excel/export/ExcelExportService.java
  7. +7
    -3
      easypoi-base/src/main/java/cn/afterturn/easypoi/excel/imports/ExcelImportService.java
  8. +1
    -1
      easypoi-web/pom.xml
  9. +2
    -2
      pom.xml

+ 1
- 1
easypoi-annotation/pom.xml 查看文件

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>cn.afterturn</groupId> <groupId>cn.afterturn</groupId>
<artifactId>easypoi</artifactId> <artifactId>easypoi</artifactId>
<version>4.1.1</version>
<version>4.1.2</version>
</parent> </parent>
<artifactId>easypoi-annotation</artifactId> <artifactId>easypoi-annotation</artifactId>
<description>基础注解类,解耦合</description> <description>基础注解类,解耦合</description>

+ 1
- 1
easypoi-base/pom.xml 查看文件

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>cn.afterturn</groupId> <groupId>cn.afterturn</groupId>
<artifactId>easypoi</artifactId> <artifactId>easypoi</artifactId>
<version>4.1.1</version>
<version>4.1.2</version>
</parent> </parent>
<artifactId>easypoi-base</artifactId> <artifactId>easypoi-base</artifactId>
<dependencies> <dependencies>


+ 17
- 0
easypoi-base/src/main/java/cn/afterturn/easypoi/excel/entity/ExportParams.java 查看文件

@@ -144,4 +144,21 @@ public class ExportParams extends ExcelBaseParams {
this.sheetName = sheetName; this.sheetName = sheetName;
} }
public short getSecondTitleHeight() {
return (short) (secondTitleHeight * 50);
}
public short getTitleHeight() {
return (short) (titleHeight * 50);
}
public short getHeight() {
return height == -1 ? -1 : (short) (height * 50);
}
public short getHeaderHeight() {
return (short) (titleHeight * 50);
}
} }

+ 4
- 0
easypoi-base/src/main/java/cn/afterturn/easypoi/excel/entity/ImportParams.java 查看文件

@@ -69,6 +69,10 @@ public class ImportParams extends ExcelBaseParams {
* 是否需要校验上传的Excel,默认为false * 是否需要校验上传的Excel,默认为false
*/ */
private boolean needVerify = false; private boolean needVerify = false;
/**
* 返回文件是否分割,默认是分割
*/
private boolean verifyFileSplit = true;
/** /**
* 校验处理接口 * 校验处理接口
*/ */


+ 3
- 3
easypoi-base/src/main/java/cn/afterturn/easypoi/excel/entity/result/ExcelImportResult.java 查看文件

@@ -42,7 +42,7 @@ public class ExcelImportResult<T> {
/** /**
* 是否存在校验失败 * 是否存在校验失败
*/ */
private boolean verfiyFail;
private boolean verifyFail;
/** /**
* 数据源 * 数据源
@@ -59,9 +59,9 @@ public class ExcelImportResult<T> {
} }
public ExcelImportResult(List<T> list, boolean verfiyFail, Workbook workbook) {
public ExcelImportResult(List<T> list, boolean verifyFail, Workbook workbook) {
this.list = list; this.list = list;
this.verfiyFail = verfiyFail;
this.verifyFail = verifyFail;
this.workbook = workbook; this.workbook = workbook;
} }


+ 2
- 2
easypoi-base/src/main/java/cn/afterturn/easypoi/excel/export/ExcelExportService.java 查看文件

@@ -66,13 +66,13 @@ public class ExcelExportService extends BaseExportService {
List<ExcelExportEntity> excelParams, int cellIndex) { List<ExcelExportEntity> excelParams, int cellIndex) {
Row row = sheet.getRow(index) == null ? sheet.createRow(index) : sheet.getRow(index); Row row = sheet.getRow(index) == null ? sheet.createRow(index) : sheet.getRow(index);
int rows = getRowNums(excelParams, true); int rows = getRowNums(excelParams, true);
row.setHeight((short)title.getHeaderHeight());
row.setHeight(title.getHeaderHeight());
Row listRow = null; Row listRow = null;
if (rows >= 2) { if (rows >= 2) {
listRow = sheet.getRow(index + 1); listRow = sheet.getRow(index + 1);
if (listRow == null) { if (listRow == null) {
listRow = sheet.createRow(index + 1); listRow = sheet.createRow(index + 1);
listRow.setHeight((short)(short)title.getHeaderHeight());
listRow.setHeight(title.getHeaderHeight());


} }
} }


+ 7
- 3
easypoi-base/src/main/java/cn/afterturn/easypoi/excel/imports/ExcelImportService.java 查看文件

@@ -478,10 +478,14 @@ public class ExcelImportService extends ImportBaseService {
InputStream successIs = new ByteArrayInputStream(baos.toByteArray()); InputStream successIs = new ByteArrayInputStream(baos.toByteArray());
try { try {
Workbook successBook = WorkbookFactory.create(successIs); Workbook successBook = WorkbookFactory.create(successIs);
importResult.setWorkbook(removeSuperfluousRows(successBook, failRow, params));
importResult.setFailWorkbook(removeSuperfluousRows(book, successRow, params));
if (params.isVerifyFileSplit()){
importResult.setWorkbook(removeSuperfluousRows(successBook, failRow, params));
importResult.setFailWorkbook(removeSuperfluousRows(book, successRow, params));
} else {
importResult.setWorkbook(successBook);
}
importResult.setFailList(failCollection); importResult.setFailList(failCollection);
importResult.setVerfiyFail(verifyFail);
importResult.setVerifyFail(verifyFail);
} finally { } finally {
successIs.close(); successIs.close();
} }


+ 1
- 1
easypoi-web/pom.xml 查看文件

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>cn.afterturn</groupId> <groupId>cn.afterturn</groupId>
<artifactId>easypoi</artifactId> <artifactId>easypoi</artifactId>
<version>4.1.1</version>
<version>4.1.2</version>
</parent> </parent>
<artifactId>easypoi-web</artifactId> <artifactId>easypoi-web</artifactId>
<dependencies> <dependencies>


+ 2
- 2
pom.xml 查看文件

@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>cn.afterturn</groupId> <groupId>cn.afterturn</groupId>
<artifactId>easypoi</artifactId> <artifactId>easypoi</artifactId>
<version>4.1.1</version>
<version>4.1.2</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>easypoi</name> <name>easypoi</name>
<modules> <modules>
@@ -45,7 +45,7 @@
</organization> </organization>
<properties> <properties>
<sub.version>4.1.1</sub.version>
<sub.version>4.1.2</sub.version>
<poi.version>4.1.0</poi.version> <poi.version>4.1.0</poi.version>
<xerces.version>2.9.1</xerces.version> <xerces.version>2.9.1</xerces.version>
<guava.version>16.0.1</guava.version> <guava.version>16.0.1</guava.version>


正在加载...
取消
保存