| @@ -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> | ||||
| @@ -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> | ||||
| @@ -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); | |||||
| } | |||||
| } | } | ||||
| @@ -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; | |||||
| /** | /** | ||||
| * 校验处理接口 | * 校验处理接口 | ||||
| */ | */ | ||||
| @@ -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; | ||||
| } | } | ||||
| @@ -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()); | |||||
| } | } | ||||
| } | } | ||||
| @@ -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(); | ||||
| } | } | ||||
| @@ -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> | ||||
| @@ -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> | ||||