瀏覽代碼

升级到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>
<groupId>cn.afterturn</groupId>
<artifactId>easypoi</artifactId>
<version>4.1.1</version>
<version>4.1.2</version>
</parent>
<artifactId>easypoi-annotation</artifactId>
<description>基础注解类,解耦合</description>

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

@@ -4,7 +4,7 @@
<parent>
<groupId>cn.afterturn</groupId>
<artifactId>easypoi</artifactId>
<version>4.1.1</version>
<version>4.1.2</version>
</parent>
<artifactId>easypoi-base</artifactId>
<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;
}
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
*/
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.verfiyFail = verfiyFail;
this.verifyFail = verifyFail;
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) {
Row row = sheet.getRow(index) == null ? sheet.createRow(index) : sheet.getRow(index);
int rows = getRowNums(excelParams, true);
row.setHeight((short)title.getHeaderHeight());
row.setHeight(title.getHeaderHeight());
Row listRow = null;
if (rows >= 2) {
listRow = sheet.getRow(index + 1);
if (listRow == null) {
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());
try {
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.setVerfiyFail(verifyFail);
importResult.setVerifyFail(verifyFail);
} finally {
successIs.close();
}


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

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


+ 2
- 2
pom.xml 查看文件

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


Loading…
取消
儲存