From 76fbb7828ac9ffd1f42d69af0d7408b7245f96e7 Mon Sep 17 00:00:00 2001 From: zhuangjiaju Date: Fri, 2 Aug 2019 17:57:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=AF=BB=E5=86=99=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/alibaba/excel/ExcelWriter.java | 7 +- .../annotation/write/style/ColumnWidth.java | 6 +- .../excel/context/AnalysisContextImpl.java | 8 +- .../alibaba/excel/metadata/TableStyle.java | 4 +- .../metadata/holder/ReadWorkbookHolder.java | 16 +++ .../alibaba/excel/support/ExcelTypeEnum.java | 2 +- .../com/alibaba/excel/util/StyleUtil.java | 2 + .../alibaba/excel/write/ExcelBuilderImpl.java | 4 +- .../write/builder/ExcelWriterBuilder.java | 5 +- .../handler/DefaultWriteHandlerLoader.java | 4 +- .../excel/write/metadata/WriteSheet.java | 4 +- .../excel/write/metadata/WriteTable.java | 6 +- .../metadata/holder/AbstractWriteHolder.java | 19 +-- .../property/ExcelWriteHeadProperty.java | 3 + ...=> AbstractVerticalCellStyleStrategy.java} | 2 +- ....java => HorizontalCellStyleStrategy.java} | 6 +- .../AbstractHeadColumnWidthStyleStrategy.java | 7 +- .../SimpleColumnWidthStyleStrategy.java | 4 +- .../test/core/annotation/AnnotationData.java | 2 +- .../compatibility/AnnotationDataListener.java | 42 ++++++ .../core/compatibility/CompatibilityData.java | 17 +++ .../compatibility/CompatibilityDataTest.java | 133 ++++++++++++++++++ .../test/core/repetition/RepetitionData.java | 14 ++ .../repetition/RepetitionDataListener.java | 34 +++++ .../core/repetition/RepetitionDataTest.java | 88 ++++++++++++ .../easyexcel/test/core/style/StyleData.java | 16 +++ .../test/core/style/StyleDataListener.java | 34 +++++ .../test/core/style/StyleDataTest.java | 84 +++++++++++ .../test/core/template/TemplateData.java | 16 +++ .../core/template/TemplateDataListener.java | 34 +++++ .../test/core/template/TemplateDataTest.java | 69 +++++++++ src/test/resources/template/template03.xls | Bin 0 -> 18944 bytes src/test/resources/template/template07.xlsx | Bin 0 -> 9994 bytes 33 files changed, 648 insertions(+), 44 deletions(-) rename src/main/java/com/alibaba/excel/write/style/{AbstractColumnCellStyleStrategy.java => AbstractVerticalCellStyleStrategy.java} (96%) rename src/main/java/com/alibaba/excel/write/style/{RowCellStyleStrategy.java => HorizontalCellStyleStrategy.java} (86%) create mode 100644 src/test/java/com/alibaba/easyexcel/test/core/compatibility/AnnotationDataListener.java create mode 100644 src/test/java/com/alibaba/easyexcel/test/core/compatibility/CompatibilityData.java create mode 100644 src/test/java/com/alibaba/easyexcel/test/core/compatibility/CompatibilityDataTest.java create mode 100644 src/test/java/com/alibaba/easyexcel/test/core/repetition/RepetitionData.java create mode 100644 src/test/java/com/alibaba/easyexcel/test/core/repetition/RepetitionDataListener.java create mode 100644 src/test/java/com/alibaba/easyexcel/test/core/repetition/RepetitionDataTest.java create mode 100644 src/test/java/com/alibaba/easyexcel/test/core/style/StyleData.java create mode 100644 src/test/java/com/alibaba/easyexcel/test/core/style/StyleDataListener.java create mode 100644 src/test/java/com/alibaba/easyexcel/test/core/style/StyleDataTest.java create mode 100644 src/test/java/com/alibaba/easyexcel/test/core/template/TemplateData.java create mode 100644 src/test/java/com/alibaba/easyexcel/test/core/template/TemplateDataListener.java create mode 100644 src/test/java/com/alibaba/easyexcel/test/core/template/TemplateDataTest.java create mode 100644 src/test/resources/template/template03.xls create mode 100644 src/test/resources/template/template07.xlsx diff --git a/src/main/java/com/alibaba/excel/ExcelWriter.java b/src/main/java/com/alibaba/excel/ExcelWriter.java index 84a3b25c..54fd2a3e 100644 --- a/src/main/java/com/alibaba/excel/ExcelWriter.java +++ b/src/main/java/com/alibaba/excel/ExcelWriter.java @@ -21,12 +21,12 @@ import com.alibaba.excel.write.metadata.WriteWorkbook; /** * Excel Writer This tool is used to write value out to Excel via POI. This object can perform the following two * functions. - * + * *
  *    1. Create a new empty Excel workbook, write the value to the stream after the value is filled.
  *    2. Edit existing Excel, write the original Excel file, or write it to other places.}
  * 
- * + * * @author jipengfei */ public class ExcelWriter { @@ -34,7 +34,7 @@ public class ExcelWriter { /** * Create new writer - * + * * @param writeWorkbook */ public ExcelWriter(WriteWorkbook writeWorkbook) { @@ -197,6 +197,7 @@ public class ExcelWriter { writeSheet.setClazz(sheet.getClazz()); writeSheet.setHead(sheet.getHead()); writeSheet.setTableStyle(sheet.getTableStyle()); + writeSheet.setRelativeHeadRowIndex(sheet.getHeadLineMun()); writeSheet.setColumnWidthMap(sheet.getColumnWidthMap()); } diff --git a/src/main/java/com/alibaba/excel/annotation/write/style/ColumnWidth.java b/src/main/java/com/alibaba/excel/annotation/write/style/ColumnWidth.java index 8661add5..e9161314 100644 --- a/src/main/java/com/alibaba/excel/annotation/write/style/ColumnWidth.java +++ b/src/main/java/com/alibaba/excel/annotation/write/style/ColumnWidth.java @@ -8,7 +8,7 @@ import java.lang.annotation.Target; /** * Set the width of the table - * + * * @author zhuangjiaju */ @Target({ElementType.FIELD, ElementType.TYPE}) @@ -16,9 +16,7 @@ import java.lang.annotation.Target; @Inherited public @interface ColumnWidth { /** - * Using the Calibri font as an example, the maximum digit width of 11 point font size is 7 pixels (at 96 dpi). If - * you set a column width to be 8 characters wide, e.g. 8*256 - * + * Column width *

* -1 mean the auto set width */ diff --git a/src/main/java/com/alibaba/excel/context/AnalysisContextImpl.java b/src/main/java/com/alibaba/excel/context/AnalysisContextImpl.java index 031ef6b2..d9d7ded5 100644 --- a/src/main/java/com/alibaba/excel/context/AnalysisContextImpl.java +++ b/src/main/java/com/alibaba/excel/context/AnalysisContextImpl.java @@ -55,11 +55,15 @@ public class AnalysisContextImpl implements AnalysisContext { @Override public void currentSheet(ExcelExecutor excelExecutor, ReadSheet readSheet) { if (readSheet == null) { - throw new IllegalArgumentException("Sheet argument cannot be null"); + throw new IllegalArgumentException("Sheet argument cannot be null."); } readSheetHolder = new ReadSheetHolder(readSheet, readWorkbookHolder); currentReadHolder = readSheetHolder; selectSheet(excelExecutor); + if (readWorkbookHolder.getHasReadSheet().contains(readSheetHolder.getSheetNo())) { + throw new ExcelAnalysisException("Cannot read sheet repeatedly."); + } + readWorkbookHolder.getHasReadSheet().add(readSheetHolder.getSheetNo()); if (LOGGER.isDebugEnabled()) { LOGGER.debug("Began to read:{}", readSheetHolder); } @@ -135,7 +139,7 @@ public class AnalysisContextImpl implements AnalysisContext { @Override public ReadHolder currentReadHolder() { - return readSheetHolder; + return currentReadHolder; } @Override diff --git a/src/main/java/com/alibaba/excel/metadata/TableStyle.java b/src/main/java/com/alibaba/excel/metadata/TableStyle.java index ef3b9eb3..fa8905c5 100644 --- a/src/main/java/com/alibaba/excel/metadata/TableStyle.java +++ b/src/main/java/com/alibaba/excel/metadata/TableStyle.java @@ -2,11 +2,11 @@ package com.alibaba.excel.metadata; import org.apache.poi.ss.usermodel.IndexedColors; -import com.alibaba.excel.write.style.RowCellStyleStrategy; +import com.alibaba.excel.write.style.HorizontalCellStyleStrategy; /** * @author jipengfei - * @deprecated please use {@link RowCellStyleStrategy} + * @deprecated please use {@link HorizontalCellStyleStrategy} */ @Deprecated public class TableStyle { diff --git a/src/main/java/com/alibaba/excel/read/metadata/holder/ReadWorkbookHolder.java b/src/main/java/com/alibaba/excel/read/metadata/holder/ReadWorkbookHolder.java index c2a9407a..18c4d12d 100644 --- a/src/main/java/com/alibaba/excel/read/metadata/holder/ReadWorkbookHolder.java +++ b/src/main/java/com/alibaba/excel/read/metadata/holder/ReadWorkbookHolder.java @@ -2,6 +2,8 @@ package com.alibaba.excel.read.metadata.holder; import java.io.File; import java.io.InputStream; +import java.util.HashSet; +import java.util.Set; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -76,6 +78,11 @@ public class ReadWorkbookHolder extends AbstractReadHolder { @Deprecated private Boolean convertAllFiled; + /** + * Prevent repeating sheet + */ + private Set hasReadSheet; + public ReadWorkbookHolder(ReadWorkbook readWorkbook) { super(readWorkbook, null, readWorkbook.getConvertAllFiled()); this.readWorkbook = readWorkbook; @@ -107,6 +114,7 @@ public class ReadWorkbookHolder extends AbstractReadHolder { if (readCache != null && ExcelTypeEnum.XLS == excelType) { LOGGER.warn("Xls not support 'readCache'!"); } + this.hasReadSheet = new HashSet(); } public ReadWorkbook getReadWorkbook() { @@ -189,6 +197,14 @@ public class ReadWorkbookHolder extends AbstractReadHolder { this.convertAllFiled = convertAllFiled; } + public Set getHasReadSheet() { + return hasReadSheet; + } + + public void setHasReadSheet(Set hasReadSheet) { + this.hasReadSheet = hasReadSheet; + } + @Override public HolderEnum holderType() { return HolderEnum.WORKBOOK; diff --git a/src/main/java/com/alibaba/excel/support/ExcelTypeEnum.java b/src/main/java/com/alibaba/excel/support/ExcelTypeEnum.java index 4bbda760..5cd3a93f 100644 --- a/src/main/java/com/alibaba/excel/support/ExcelTypeEnum.java +++ b/src/main/java/com/alibaba/excel/support/ExcelTypeEnum.java @@ -29,7 +29,7 @@ public enum ExcelTypeEnum { public static ExcelTypeEnum valueOf(File file, InputStream inputStream) { try { - FileMagic fileMagic = null; + FileMagic fileMagic; if (file != null) { fileMagic = FileMagic.valueOf(file); if (!FileMagic.OLE2.equals(fileMagic) && !FileMagic.OOXML.equals(fileMagic)) { diff --git a/src/main/java/com/alibaba/excel/util/StyleUtil.java b/src/main/java/com/alibaba/excel/util/StyleUtil.java index 0cd8c2ac..3031048e 100644 --- a/src/main/java/com/alibaba/excel/util/StyleUtil.java +++ b/src/main/java/com/alibaba/excel/util/StyleUtil.java @@ -29,8 +29,10 @@ public class StyleUtil { newCellStyle.setLocked(true); newCellStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); newCellStyle.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex()); + newCellStyle.setBorderTop(BorderStyle.THIN); newCellStyle.setBorderBottom(BorderStyle.THIN); newCellStyle.setBorderLeft(BorderStyle.THIN); + newCellStyle.setBorderRight(BorderStyle.THIN); return newCellStyle; } diff --git a/src/main/java/com/alibaba/excel/write/ExcelBuilderImpl.java b/src/main/java/com/alibaba/excel/write/ExcelBuilderImpl.java index faa93d4f..566ca848 100644 --- a/src/main/java/com/alibaba/excel/write/ExcelBuilderImpl.java +++ b/src/main/java/com/alibaba/excel/write/ExcelBuilderImpl.java @@ -68,9 +68,9 @@ public class ExcelBuilderImpl implements ExcelBuilder { lastRowNum--; } if (!data.isEmpty()) { - context.writeSheetHolder().setWriteLastRowType(WriteLastRowType.HAVE_DATA); + writeSheetHolder.setWriteLastRowType(WriteLastRowType.HAVE_DATA); } - if (context.currentWriteHolder().isNew()) { + if (writeSheetHolder.isNew() && !writeSheetHolder.getExcelWriteHeadProperty().hasHead()) { lastRowNum += context.currentWriteHolder().relativeHeadRowIndex(); } for (int relativeRowIndex = 0; relativeRowIndex < data.size(); relativeRowIndex++) { diff --git a/src/main/java/com/alibaba/excel/write/builder/ExcelWriterBuilder.java b/src/main/java/com/alibaba/excel/write/builder/ExcelWriterBuilder.java index 0d84e0a6..673e81cb 100644 --- a/src/main/java/com/alibaba/excel/write/builder/ExcelWriterBuilder.java +++ b/src/main/java/com/alibaba/excel/write/builder/ExcelWriterBuilder.java @@ -193,14 +193,15 @@ public class ExcelWriterBuilder { } public ExcelWriterSheetBuilder sheet(Integer sheetNo, String sheetName) { - ExcelWriterSheetBuilder excelWriterSheetBuilder = new ExcelWriterSheetBuilder(build()); + ExcelWriter excelWriter = build(); + ExcelWriterSheetBuilder excelWriterSheetBuilder = new ExcelWriterSheetBuilder(excelWriter); if (sheetNo != null) { excelWriterSheetBuilder.sheetNo(sheetNo); } if (sheetName != null) { excelWriterSheetBuilder.sheetName(sheetName); } - return new ExcelWriterSheetBuilder(build()); + return new ExcelWriterSheetBuilder(excelWriter); } } diff --git a/src/main/java/com/alibaba/excel/write/handler/DefaultWriteHandlerLoader.java b/src/main/java/com/alibaba/excel/write/handler/DefaultWriteHandlerLoader.java index 147ccf73..c8772b42 100644 --- a/src/main/java/com/alibaba/excel/write/handler/DefaultWriteHandlerLoader.java +++ b/src/main/java/com/alibaba/excel/write/handler/DefaultWriteHandlerLoader.java @@ -7,7 +7,7 @@ import org.apache.poi.ss.usermodel.IndexedColors; import com.alibaba.excel.write.metadata.style.WriteCellStyle; import com.alibaba.excel.write.metadata.style.WriteFont; -import com.alibaba.excel.write.style.RowCellStyleStrategy; +import com.alibaba.excel.write.style.HorizontalCellStyleStrategy; /** * Load default handler @@ -30,7 +30,7 @@ public class DefaultWriteHandlerLoader { headWriteFont.setFontHeightInPoints((short)14); headWriteFont.setBold(true); headWriteCellStyle.setWriteFont(headWriteFont); - handlerList.add(new RowCellStyleStrategy(headWriteCellStyle, new ArrayList())); + handlerList.add(new HorizontalCellStyleStrategy(headWriteCellStyle, new ArrayList())); return handlerList; } diff --git a/src/main/java/com/alibaba/excel/write/metadata/WriteSheet.java b/src/main/java/com/alibaba/excel/write/metadata/WriteSheet.java index fa5c1baf..62fac752 100644 --- a/src/main/java/com/alibaba/excel/write/metadata/WriteSheet.java +++ b/src/main/java/com/alibaba/excel/write/metadata/WriteSheet.java @@ -4,7 +4,7 @@ import java.util.HashMap; import java.util.Map; import com.alibaba.excel.metadata.TableStyle; -import com.alibaba.excel.write.style.RowCellStyleStrategy; +import com.alibaba.excel.write.style.HorizontalCellStyleStrategy; import com.alibaba.excel.write.style.column.SimpleColumnWidthStyleStrategy; /** @@ -30,7 +30,7 @@ public class WriteSheet extends WriteBasicParameter { private Map columnWidthMap = new HashMap(); /** * - * @deprecated please use{@link RowCellStyleStrategy} + * @deprecated please use{@link HorizontalCellStyleStrategy} */ @Deprecated private TableStyle tableStyle; diff --git a/src/main/java/com/alibaba/excel/write/metadata/WriteTable.java b/src/main/java/com/alibaba/excel/write/metadata/WriteTable.java index 12217123..ec7933c0 100644 --- a/src/main/java/com/alibaba/excel/write/metadata/WriteTable.java +++ b/src/main/java/com/alibaba/excel/write/metadata/WriteTable.java @@ -1,11 +1,11 @@ package com.alibaba.excel.write.metadata; import com.alibaba.excel.metadata.TableStyle; -import com.alibaba.excel.write.style.RowCellStyleStrategy; +import com.alibaba.excel.write.style.HorizontalCellStyleStrategy; /** * table - * + * * @author jipengfei */ public class WriteTable extends WriteBasicParameter { @@ -15,7 +15,7 @@ public class WriteTable extends WriteBasicParameter { private Integer tableNo; /** * - * @deprecated please use{@link RowCellStyleStrategy} + * @deprecated please use{@link HorizontalCellStyleStrategy} */ @Deprecated private TableStyle tableStyle; diff --git a/src/main/java/com/alibaba/excel/write/metadata/holder/AbstractWriteHolder.java b/src/main/java/com/alibaba/excel/write/metadata/holder/AbstractWriteHolder.java index 24d9c758..bb6f2be0 100644 --- a/src/main/java/com/alibaba/excel/write/metadata/holder/AbstractWriteHolder.java +++ b/src/main/java/com/alibaba/excel/write/metadata/holder/AbstractWriteHolder.java @@ -8,6 +8,7 @@ import java.util.Map; import java.util.Set; import java.util.TreeMap; +import org.apache.poi.ss.usermodel.FillPatternType; import org.apache.poi.ss.usermodel.IndexedColors; import com.alibaba.excel.converters.Converter; @@ -34,7 +35,7 @@ import com.alibaba.excel.write.metadata.WriteTable; import com.alibaba.excel.write.metadata.style.WriteCellStyle; import com.alibaba.excel.write.metadata.style.WriteFont; import com.alibaba.excel.write.property.ExcelWriteHeadProperty; -import com.alibaba.excel.write.style.RowCellStyleStrategy; +import com.alibaba.excel.write.style.HorizontalCellStyleStrategy; import com.alibaba.excel.write.style.column.AbstractHeadColumnWidthStyleStrategy; import com.alibaba.excel.write.style.row.SimpleRowHeightStyleStrategy; @@ -102,12 +103,8 @@ public abstract class AbstractWriteHolder extends AbstractHolder implements Writ compatibleOldCode(writeBasicParameter); // Set writeHandlerMap - List handlerList; - if (parentAbstractWriteHolder == null) { - handlerList = DefaultWriteHandlerLoader.loadDefaultHandler(); - } else { - handlerList = new ArrayList(); - } + List handlerList = new ArrayList(); + // Initialization Annotation initAnnotationConfig(handlerList); @@ -119,7 +116,10 @@ public abstract class AbstractWriteHolder extends AbstractHolder implements Writ Map, List> parentWriteHandlerMap = null; if (parentAbstractWriteHolder != null) { parentWriteHandlerMap = parentAbstractWriteHolder.getWriteHandlerMap(); + } else { + handlerList.addAll(DefaultWriteHandlerLoader.loadDefaultHandler()); } + this.writeHandlerMap = sortAndClearUpHandler(handlerList, parentWriteHandlerMap); // Set converterMap @@ -166,7 +166,7 @@ public abstract class AbstractWriteHolder extends AbstractHolder implements Writ writeBasicParameter.setCustomWriteHandlerList(new ArrayList()); } writeBasicParameter.getCustomWriteHandlerList() - .add(new RowCellStyleStrategy( + .add(new HorizontalCellStyleStrategy( buildWriteCellStyle(tableStyle.getTableHeadFont(), tableStyle.getTableHeadBackGroundColor()), buildWriteCellStyle(tableStyle.getTableContentFont(), tableStyle.getTableContentBackGroundColor()))); } @@ -175,6 +175,7 @@ public abstract class AbstractWriteHolder extends AbstractHolder implements Writ private WriteCellStyle buildWriteCellStyle(Font font, IndexedColors indexedColors) { WriteCellStyle writeCellStyle = new WriteCellStyle(); if (indexedColors != null) { + writeCellStyle.setFillPatternType(FillPatternType.SOLID_FOREGROUND); writeCellStyle.setFillForegroundColor(indexedColors.getIndex()); } if (font != null) { @@ -199,7 +200,7 @@ public abstract class AbstractWriteHolder extends AbstractHolder implements Writ @Override protected Integer columnWidth(Head head) { if (columnWidthMap.containsKey(head.getColumnIndex())) { - columnWidthMap.get(head.getColumnIndex()); + return columnWidthMap.get(head.getColumnIndex()) / 256; } return 20; } diff --git a/src/main/java/com/alibaba/excel/write/property/ExcelWriteHeadProperty.java b/src/main/java/com/alibaba/excel/write/property/ExcelWriteHeadProperty.java index 736611b0..b4d43e15 100644 --- a/src/main/java/com/alibaba/excel/write/property/ExcelWriteHeadProperty.java +++ b/src/main/java/com/alibaba/excel/write/property/ExcelWriteHeadProperty.java @@ -109,6 +109,9 @@ public class ExcelWriteHeadProperty extends ExcelHeadProperty { endY = k; alreadyRangeSet.addAll(tempAlreadyRangeSet); } + if (j == endY && i == endX) { + continue; + } cellRangeList.add(new CellRange(j, endY, i, endX)); } } diff --git a/src/main/java/com/alibaba/excel/write/style/AbstractColumnCellStyleStrategy.java b/src/main/java/com/alibaba/excel/write/style/AbstractVerticalCellStyleStrategy.java similarity index 96% rename from src/main/java/com/alibaba/excel/write/style/AbstractColumnCellStyleStrategy.java rename to src/main/java/com/alibaba/excel/write/style/AbstractVerticalCellStyleStrategy.java index 343336d6..c8513d54 100644 --- a/src/main/java/com/alibaba/excel/write/style/AbstractColumnCellStyleStrategy.java +++ b/src/main/java/com/alibaba/excel/write/style/AbstractVerticalCellStyleStrategy.java @@ -17,7 +17,7 @@ import com.alibaba.excel.write.metadata.style.WriteCellStyle; * * @author zhuangjiaju */ -public abstract class AbstractColumnCellStyleStrategy extends AbstractCellStyleStrategy { +public abstract class AbstractVerticalCellStyleStrategy extends AbstractCellStyleStrategy { private Workbook workbook; private Map headCellStyleCache = new HashMap(); diff --git a/src/main/java/com/alibaba/excel/write/style/RowCellStyleStrategy.java b/src/main/java/com/alibaba/excel/write/style/HorizontalCellStyleStrategy.java similarity index 86% rename from src/main/java/com/alibaba/excel/write/style/RowCellStyleStrategy.java rename to src/main/java/com/alibaba/excel/write/style/HorizontalCellStyleStrategy.java index 1d65f9f8..d96bfa06 100644 --- a/src/main/java/com/alibaba/excel/write/style/RowCellStyleStrategy.java +++ b/src/main/java/com/alibaba/excel/write/style/HorizontalCellStyleStrategy.java @@ -17,7 +17,7 @@ import com.alibaba.excel.write.metadata.style.WriteCellStyle; * * @author zhuangjiaju */ -public class RowCellStyleStrategy extends AbstractCellStyleStrategy { +public class HorizontalCellStyleStrategy extends AbstractCellStyleStrategy { private WriteCellStyle headWriteCellStyle; private List contentWriteCellStyleList; @@ -25,12 +25,12 @@ public class RowCellStyleStrategy extends AbstractCellStyleStrategy { private CellStyle headCellStyle; private List contentCellStyleList; - public RowCellStyleStrategy(WriteCellStyle headWriteCellStyle, List contentWriteCellStyleList) { + public HorizontalCellStyleStrategy(WriteCellStyle headWriteCellStyle, List contentWriteCellStyleList) { this.headWriteCellStyle = headWriteCellStyle; this.contentWriteCellStyleList = contentWriteCellStyleList; } - public RowCellStyleStrategy(WriteCellStyle headWriteCellStyle, WriteCellStyle contentWriteCellStyle) { + public HorizontalCellStyleStrategy(WriteCellStyle headWriteCellStyle, WriteCellStyle contentWriteCellStyle) { this.headWriteCellStyle = headWriteCellStyle; contentWriteCellStyleList = new ArrayList(); contentWriteCellStyleList.add(contentWriteCellStyle); diff --git a/src/main/java/com/alibaba/excel/write/style/column/AbstractHeadColumnWidthStyleStrategy.java b/src/main/java/com/alibaba/excel/write/style/column/AbstractHeadColumnWidthStyleStrategy.java index a295cf9f..f88bacef 100644 --- a/src/main/java/com/alibaba/excel/write/style/column/AbstractHeadColumnWidthStyleStrategy.java +++ b/src/main/java/com/alibaba/excel/write/style/column/AbstractHeadColumnWidthStyleStrategy.java @@ -18,7 +18,8 @@ public abstract class AbstractHeadColumnWidthStyleStrategy extends AbstractColum } Integer width = columnWidth(head); if (width != null) { - sheet.setColumnWidth(cell.getColumnIndex(), columnWidth(head)); + width = width * 256; + sheet.setColumnWidth(cell.getColumnIndex(), width); } } @@ -29,9 +30,7 @@ public abstract class AbstractHeadColumnWidthStyleStrategy extends AbstractColum * * @param head * Nullable - * @return the width in units of 1/256th of a character width . Using the Calibri font as an example, the maximum - * digit width of 11 point font size is 7 pixels (at 96 dpi). If you set a column width to be eight - * characters wide, e.g. you need return 8*256 + * @return */ protected abstract Integer columnWidth(Head head); } diff --git a/src/main/java/com/alibaba/excel/write/style/column/SimpleColumnWidthStyleStrategy.java b/src/main/java/com/alibaba/excel/write/style/column/SimpleColumnWidthStyleStrategy.java index 45983009..48ac0607 100644 --- a/src/main/java/com/alibaba/excel/write/style/column/SimpleColumnWidthStyleStrategy.java +++ b/src/main/java/com/alibaba/excel/write/style/column/SimpleColumnWidthStyleStrategy.java @@ -11,11 +11,9 @@ public class SimpleColumnWidthStyleStrategy extends AbstractHeadColumnWidthStyle private Integer columnWidth; /** - * Using the Calibri font as an example, the maximum digit width of 11 point font size is 7 pixels (at 96 dpi). * If - * you set a column width to be eight characters wide, e.g. SimpleColumnWidthStyleStrategy( 8*256), * * @param columnWidth - * the width in units of 1/256th of a character width + * */ public SimpleColumnWidthStyleStrategy(Integer columnWidth) { this.columnWidth = columnWidth; diff --git a/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationData.java b/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationData.java index d10f87e0..cabd3e38 100644 --- a/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationData.java +++ b/src/test/java/com/alibaba/easyexcel/test/core/annotation/AnnotationData.java @@ -17,7 +17,7 @@ import lombok.Data; * @author zhuangjiaju */ @Data -@ColumnWidth(30 * 256) +@ColumnWidth(30) @HeadRowHeight(15) @ContentRowHeight(20) public class AnnotationData { diff --git a/src/test/java/com/alibaba/easyexcel/test/core/compatibility/AnnotationDataListener.java b/src/test/java/com/alibaba/easyexcel/test/core/compatibility/AnnotationDataListener.java new file mode 100644 index 00000000..35acfa78 --- /dev/null +++ b/src/test/java/com/alibaba/easyexcel/test/core/compatibility/AnnotationDataListener.java @@ -0,0 +1,42 @@ +package com.alibaba.easyexcel.test.core.compatibility; + +import java.text.ParseException; +import java.util.ArrayList; +import java.util.List; + +import org.junit.Assert; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.alibaba.easyexcel.test.core.annotation.AnnotationData; +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.event.AnalysisEventListener; +import com.alibaba.excel.exception.ExcelCommonException; +import com.alibaba.excel.util.DateUtils; +import com.alibaba.fastjson.JSON; + +/** + * @author zhuangjiaju + */ +public class AnnotationDataListener extends AnalysisEventListener { + private static final Logger LOGGER = LoggerFactory.getLogger(AnnotationDataListener.class); + List list = new ArrayList(); + + @Override + public void invoke(AnnotationData data, AnalysisContext context) { + list.add(data); + } + + @Override + public void doAfterAllAnalysed(AnalysisContext context) { + Assert.assertEquals(list.size(), 1); + AnnotationData data = list.get(0); + try { + Assert.assertEquals(data.getDate(), DateUtils.parseDate("2020-01-01 01:01:01")); + } catch (ParseException e) { + throw new ExcelCommonException("Test Exception", e); + } + Assert.assertEquals(data.getNumber(), 99.99, 0.00); + LOGGER.debug("First row:{}", JSON.toJSONString(list.get(0))); + } +} diff --git a/src/test/java/com/alibaba/easyexcel/test/core/compatibility/CompatibilityData.java b/src/test/java/com/alibaba/easyexcel/test/core/compatibility/CompatibilityData.java new file mode 100644 index 00000000..8d971155 --- /dev/null +++ b/src/test/java/com/alibaba/easyexcel/test/core/compatibility/CompatibilityData.java @@ -0,0 +1,17 @@ +package com.alibaba.easyexcel.test.core.compatibility; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.metadata.BaseRowModel; + +import lombok.Data; + +/** + * @author zhuangjiaju + */ +@Data +public class CompatibilityData extends BaseRowModel { + @ExcelProperty("字符串标题0") + private String string0; + @ExcelProperty("字符串标题1") + private String string1; +} diff --git a/src/test/java/com/alibaba/easyexcel/test/core/compatibility/CompatibilityDataTest.java b/src/test/java/com/alibaba/easyexcel/test/core/compatibility/CompatibilityDataTest.java new file mode 100644 index 00000000..9122822a --- /dev/null +++ b/src/test/java/com/alibaba/easyexcel/test/core/compatibility/CompatibilityDataTest.java @@ -0,0 +1,133 @@ +package com.alibaba.easyexcel.test.core.compatibility; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.OutputStream; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.poi.ss.usermodel.IndexedColors; +import org.junit.BeforeClass; +import org.junit.Test; + +import com.alibaba.easyexcel.test.util.TestFileUtil; +import com.alibaba.excel.EasyExcelFactory; +import com.alibaba.excel.ExcelWriter; +import com.alibaba.excel.metadata.Font; +import com.alibaba.excel.metadata.Sheet; +import com.alibaba.excel.metadata.Table; +import com.alibaba.excel.metadata.TableStyle; + +/** + * + * @author zhuangjiaju + */ +public class CompatibilityDataTest { + + private static File file07; + private static File file03; + + @BeforeClass + public static void init() { + file07 = TestFileUtil.createNewFile("compatibility07.xlsx"); + file03 = TestFileUtil.createNewFile("compatibility03.xls"); + } + + @Test + public void T01ReadAndWrite07() throws Exception { + readAndWrite(file07); + } + + @Test + public void T02ReadAndWrite03() throws Exception { + readAndWrite(file03); + } + + private void readAndWrite(File file) throws Exception { + OutputStream out = new FileOutputStream(file); + ExcelWriter writer = EasyExcelFactory.getWriter(out); + // sheet1 width,string head,stirng data + Sheet sheet1 = new Sheet(1, 3); + sheet1.setSheetName("第一个sheet"); + Map columnWidth = new HashMap(); + columnWidth.put(0, 10000); + columnWidth.put(1, 50000); + sheet1.setColumnWidthMap(columnWidth); + sheet1.setHead(head()); + writer.write1(listData(), sheet1); + + // sheet2 style,class head + Sheet sheet2 = new Sheet(2, 3, CompatibilityData.class, "第二个sheet", null); + sheet2.setTableStyle(style()); + writer.write(data(), sheet2); + + // sheet3 table + Sheet sheet3 = new Sheet(3, 0); + sheet3.setSheetName("第三个sheet"); + + Table table1 = new Table(1); + table1.setHead(head()); + writer.write1(listData(), sheet3, table1); + + Table table2 = new Table(2); + table2.setClazz(CompatibilityData.class); + writer.write(data(), sheet3, table2); + + writer.finish(); + out.close(); + + // EasyExcelFactory.write(file, AnnotationData.class).sheet().doWrite(data()).finish(); + // EasyExcelFactory.read(file, AnnotationData.class, new AnnotationDataListener()).sheet().doRead().finish(); + } + + private List> head() { + List> list = new ArrayList>(); + List head0 = new ArrayList(); + head0.add("字符串标题0"); + List head1 = new ArrayList(); + head1.add("字符串标题1"); + list.add(head0); + list.add(head1); + return list; + } + + private List> listData() { + List> list = new ArrayList>(); + List data0 = new ArrayList(); + data0.add("字符串0"); + data0.add(1); + list.add(data0); + return list; + } + + private List data() { + List list = new ArrayList(); + for (int i = 0; i < 10; i++) { + CompatibilityData data = new CompatibilityData(); + data.setString0("字符串0" + i); + data.setString1("字符串1" + i); + list.add(data); + } + return list; + } + + public TableStyle style() { + TableStyle tableStyle = new TableStyle(); + Font headFont = new Font(); + headFont.setBold(true); + headFont.setFontHeightInPoints((short)22); + headFont.setFontName("楷体"); + tableStyle.setTableHeadFont(headFont); + tableStyle.setTableHeadBackGroundColor(IndexedColors.BLUE); + + Font contentFont = new Font(); + contentFont.setBold(true); + contentFont.setFontHeightInPoints((short)22); + contentFont.setFontName("黑体"); + tableStyle.setTableContentFont(contentFont); + tableStyle.setTableContentBackGroundColor(IndexedColors.GREEN); + return tableStyle; + } +} diff --git a/src/test/java/com/alibaba/easyexcel/test/core/repetition/RepetitionData.java b/src/test/java/com/alibaba/easyexcel/test/core/repetition/RepetitionData.java new file mode 100644 index 00000000..191af175 --- /dev/null +++ b/src/test/java/com/alibaba/easyexcel/test/core/repetition/RepetitionData.java @@ -0,0 +1,14 @@ +package com.alibaba.easyexcel.test.core.repetition; + +import com.alibaba.excel.annotation.ExcelProperty; + +import lombok.Data; + +/** + * @author zhuangjiaju + */ +@Data +public class RepetitionData { + @ExcelProperty("字符串") + private String string; +} diff --git a/src/test/java/com/alibaba/easyexcel/test/core/repetition/RepetitionDataListener.java b/src/test/java/com/alibaba/easyexcel/test/core/repetition/RepetitionDataListener.java new file mode 100644 index 00000000..263514e9 --- /dev/null +++ b/src/test/java/com/alibaba/easyexcel/test/core/repetition/RepetitionDataListener.java @@ -0,0 +1,34 @@ +package com.alibaba.easyexcel.test.core.repetition; + +import java.util.ArrayList; +import java.util.List; + +import org.junit.Assert; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.alibaba.easyexcel.test.core.simple.SimpleDataListener; +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.event.AnalysisEventListener; +import com.alibaba.fastjson.JSON; + +/** + * @author zhuangjiaju + */ +public class RepetitionDataListener extends AnalysisEventListener { + private static final Logger LOGGER = LoggerFactory.getLogger(SimpleDataListener.class); + List list = new ArrayList(); + + @Override + public void invoke(RepetitionData data, AnalysisContext context) { + list.add(data); + } + + @Override + public void doAfterAllAnalysed(AnalysisContext context) { + Assert.assertEquals(list.size(), 2); + Assert.assertEquals(list.get(0).getString(), "字符串0"); + Assert.assertEquals(list.get(1).getString(), "字符串0"); + LOGGER.debug("First row:{}", JSON.toJSONString(list.get(0))); + } +} diff --git a/src/test/java/com/alibaba/easyexcel/test/core/repetition/RepetitionDataTest.java b/src/test/java/com/alibaba/easyexcel/test/core/repetition/RepetitionDataTest.java new file mode 100644 index 00000000..446d68c1 --- /dev/null +++ b/src/test/java/com/alibaba/easyexcel/test/core/repetition/RepetitionDataTest.java @@ -0,0 +1,88 @@ +package com.alibaba.easyexcel.test.core.repetition; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; + +import org.junit.BeforeClass; +import org.junit.FixMethodOrder; +import org.junit.Test; +import org.junit.runners.MethodSorters; + +import com.alibaba.easyexcel.test.util.TestFileUtil; +import com.alibaba.excel.EasyExcelFactory; +import com.alibaba.excel.ExcelReader; +import com.alibaba.excel.ExcelWriter; +import com.alibaba.excel.read.metadata.ReadSheet; +import com.alibaba.excel.write.metadata.WriteSheet; +import com.alibaba.excel.write.metadata.WriteTable; + +/** + * + * @author zhuangjiaju + */ +@FixMethodOrder(MethodSorters.NAME_ASCENDING) +public class RepetitionDataTest { + + private static File file07; + private static File file03; + private static File fileTable07; + private static File fileTable03; + + @BeforeClass + public static void init() { + file07 = TestFileUtil.createNewFile("repetition07.xlsx"); + file03 = TestFileUtil.createNewFile("repetition03.xls"); + fileTable07 = TestFileUtil.createNewFile("repetitionTable07.xlsx"); + fileTable03 = TestFileUtil.createNewFile("repetitionTable03.xls"); + } + + @Test + public void T01ReadAndWrite07() { + readAndWrite(file07); + } + + @Test + public void T02ReadAndWrite03() { + readAndWrite(file03); + } + + private void readAndWrite(File file) { + ExcelWriter excelWriter = EasyExcelFactory.write(file, RepetitionData.class).build(); + WriteSheet writeSheet = EasyExcelFactory.writerSheet(0).build(); + excelWriter.write(data(), writeSheet).write(data(), writeSheet).finish(); + ExcelReader excelReader = + EasyExcelFactory.read(file, RepetitionData.class, new RepetitionDataListener()).build(); + ReadSheet readSheet = EasyExcelFactory.readSheet(0).build(); + excelReader.read(readSheet).finish(); + } + + @Test + public void T03ReadAndWriteTable07() { + readAndWriteTable(fileTable07); + } + + @Test + public void T04ReadAndWriteTable03() { + readAndWriteTable(fileTable03); + } + + private void readAndWriteTable(File file) { + ExcelWriter excelWriter = EasyExcelFactory.write(file, RepetitionData.class).build(); + WriteSheet writeSheet = EasyExcelFactory.writerSheet(0).build(); + WriteTable writeTable = EasyExcelFactory.writerTable(0).build(); + excelWriter.write(data(), writeSheet, writeTable).write(data(), writeSheet, writeTable).finish(); + ExcelReader excelReader = + EasyExcelFactory.read(file, RepetitionData.class, new RepetitionDataListener()).build(); + ReadSheet readSheet = EasyExcelFactory.readSheet(0).headRowNumber(2).build(); + excelReader.read(readSheet).finish(); + } + + private List data() { + List list = new ArrayList(); + RepetitionData data = new RepetitionData(); + data.setString("字符串0"); + list.add(data); + return list; + } +} diff --git a/src/test/java/com/alibaba/easyexcel/test/core/style/StyleData.java b/src/test/java/com/alibaba/easyexcel/test/core/style/StyleData.java new file mode 100644 index 00000000..d8699f5f --- /dev/null +++ b/src/test/java/com/alibaba/easyexcel/test/core/style/StyleData.java @@ -0,0 +1,16 @@ +package com.alibaba.easyexcel.test.core.style; + +import com.alibaba.excel.annotation.ExcelProperty; + +import lombok.Data; + +/** + * @author zhuangjiaju + */ +@Data +public class StyleData { + @ExcelProperty("字符串") + private String string; + @ExcelProperty("字符串1") + private String string1; +} diff --git a/src/test/java/com/alibaba/easyexcel/test/core/style/StyleDataListener.java b/src/test/java/com/alibaba/easyexcel/test/core/style/StyleDataListener.java new file mode 100644 index 00000000..bc169f43 --- /dev/null +++ b/src/test/java/com/alibaba/easyexcel/test/core/style/StyleDataListener.java @@ -0,0 +1,34 @@ +package com.alibaba.easyexcel.test.core.style; + +import java.util.ArrayList; +import java.util.List; + +import org.junit.Assert; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.alibaba.easyexcel.test.core.simple.SimpleDataListener; +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.event.AnalysisEventListener; +import com.alibaba.fastjson.JSON; + +/** + * @author zhuangjiaju + */ +public class StyleDataListener extends AnalysisEventListener { + private static final Logger LOGGER = LoggerFactory.getLogger(SimpleDataListener.class); + List list = new ArrayList(); + + @Override + public void invoke(StyleData data, AnalysisContext context) { + list.add(data); + } + + @Override + public void doAfterAllAnalysed(AnalysisContext context) { + Assert.assertEquals(list.size(), 2); + Assert.assertEquals(list.get(0).getString(), "字符串0"); + Assert.assertEquals(list.get(1).getString(), "字符串1"); + LOGGER.debug("First row:{}", JSON.toJSONString(list.get(0))); + } +} diff --git a/src/test/java/com/alibaba/easyexcel/test/core/style/StyleDataTest.java b/src/test/java/com/alibaba/easyexcel/test/core/style/StyleDataTest.java new file mode 100644 index 00000000..37e6659c --- /dev/null +++ b/src/test/java/com/alibaba/easyexcel/test/core/style/StyleDataTest.java @@ -0,0 +1,84 @@ +package com.alibaba.easyexcel.test.core.style; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; + +import org.apache.poi.ss.usermodel.FillPatternType; +import org.apache.poi.ss.usermodel.IndexedColors; +import org.junit.BeforeClass; +import org.junit.FixMethodOrder; +import org.junit.Test; +import org.junit.runners.MethodSorters; + +import com.alibaba.easyexcel.test.util.TestFileUtil; +import com.alibaba.excel.EasyExcelFactory; +import com.alibaba.excel.write.metadata.style.WriteCellStyle; +import com.alibaba.excel.write.metadata.style.WriteFont; +import com.alibaba.excel.write.style.HorizontalCellStyleStrategy; +import com.alibaba.excel.write.style.column.SimpleColumnWidthStyleStrategy; +import com.alibaba.excel.write.style.row.SimpleRowHeightStyleStrategy; + +/** + * + * @author zhuangjiaju + */ +@FixMethodOrder(MethodSorters.NAME_ASCENDING) +public class StyleDataTest { + + private static File file07; + private static File file03; + + @BeforeClass + public static void init() { + file07 = TestFileUtil.createNewFile("style07.xlsx"); + file03 = TestFileUtil.createNewFile("style03.xls"); + } + + @Test + public void T01ReadAndWrite07() { + readAndWrite(file07); + } + + @Test + public void T02ReadAndWrite03() { + readAndWrite(file03); + } + + private void readAndWrite(File file) { + SimpleColumnWidthStyleStrategy simpleColumnWidthStyleStrategy = new SimpleColumnWidthStyleStrategy(50); + SimpleRowHeightStyleStrategy simpleRowHeightStyleStrategy = + new SimpleRowHeightStyleStrategy((short)40, (short)50); + + WriteCellStyle headWriteCellStyle = new WriteCellStyle(); + headWriteCellStyle.setFillForegroundColor(IndexedColors.RED.getIndex()); + WriteFont headWriteFont = new WriteFont(); + headWriteFont.setFontHeightInPoints((short)20); + headWriteCellStyle.setWriteFont(headWriteFont); + WriteCellStyle contentWriteCellStyle = new WriteCellStyle(); + contentWriteCellStyle.setFillPatternType(FillPatternType.SOLID_FOREGROUND); + contentWriteCellStyle.setFillForegroundColor(IndexedColors.GREEN.getIndex()); + WriteFont contentWriteFont = new WriteFont(); + contentWriteFont.setFontHeightInPoints((short)20); + headWriteCellStyle.setWriteFont(contentWriteFont); + HorizontalCellStyleStrategy horizontalCellStyleStrategy = + new HorizontalCellStyleStrategy(headWriteCellStyle, contentWriteCellStyle); + EasyExcelFactory.write(file, StyleData.class).registerWriteHandler(simpleColumnWidthStyleStrategy) + .registerWriteHandler(simpleRowHeightStyleStrategy).registerWriteHandler(horizontalCellStyleStrategy) + .sheet().doWrite(data()).finish(); + EasyExcelFactory.read(file, StyleData.class, new StyleDataListener()).sheet().doRead().finish(); + } + + private List data() { + List list = new ArrayList(); + StyleData data = new StyleData(); + data.setString("字符串0"); + data.setString1("字符串01"); + StyleData data1 = new StyleData(); + data1.setString("字符串1"); + data1.setString1("字符串11"); + list.add(data); + list.add(data1); + return list; + } +} diff --git a/src/test/java/com/alibaba/easyexcel/test/core/template/TemplateData.java b/src/test/java/com/alibaba/easyexcel/test/core/template/TemplateData.java new file mode 100644 index 00000000..fb776d2a --- /dev/null +++ b/src/test/java/com/alibaba/easyexcel/test/core/template/TemplateData.java @@ -0,0 +1,16 @@ +package com.alibaba.easyexcel.test.core.template; + +import com.alibaba.excel.annotation.ExcelProperty; + +import lombok.Data; + +/** + * @author zhuangjiaju + */ +@Data +public class TemplateData { + @ExcelProperty("字符串0") + private String string0; + @ExcelProperty("字符串1") + private String string1; +} diff --git a/src/test/java/com/alibaba/easyexcel/test/core/template/TemplateDataListener.java b/src/test/java/com/alibaba/easyexcel/test/core/template/TemplateDataListener.java new file mode 100644 index 00000000..9a08ca89 --- /dev/null +++ b/src/test/java/com/alibaba/easyexcel/test/core/template/TemplateDataListener.java @@ -0,0 +1,34 @@ +package com.alibaba.easyexcel.test.core.template; + +import java.util.ArrayList; +import java.util.List; + +import org.junit.Assert; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.alibaba.easyexcel.test.core.simple.SimpleDataListener; +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.event.AnalysisEventListener; +import com.alibaba.fastjson.JSON; + +/** + * @author zhuangjiaju + */ +public class TemplateDataListener extends AnalysisEventListener { + private static final Logger LOGGER = LoggerFactory.getLogger(SimpleDataListener.class); + List list = new ArrayList(); + + @Override + public void invoke(TemplateData data, AnalysisContext context) { + list.add(data); + } + + @Override + public void doAfterAllAnalysed(AnalysisContext context) { + Assert.assertEquals(list.size(), 2); + Assert.assertEquals(list.get(0).getString0(), "字符串0"); + Assert.assertEquals(list.get(1).getString0(), "字符串1"); + LOGGER.debug("First row:{}", JSON.toJSONString(list.get(0))); + } +} diff --git a/src/test/java/com/alibaba/easyexcel/test/core/template/TemplateDataTest.java b/src/test/java/com/alibaba/easyexcel/test/core/template/TemplateDataTest.java new file mode 100644 index 00000000..15aea6b0 --- /dev/null +++ b/src/test/java/com/alibaba/easyexcel/test/core/template/TemplateDataTest.java @@ -0,0 +1,69 @@ +package com.alibaba.easyexcel.test.core.template; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; + +import org.junit.BeforeClass; +import org.junit.FixMethodOrder; +import org.junit.Test; +import org.junit.runners.MethodSorters; + +import com.alibaba.easyexcel.test.util.TestFileUtil; +import com.alibaba.excel.EasyExcelFactory; + +/** + * + * @author zhuangjiaju + */ +@FixMethodOrder(MethodSorters.NAME_ASCENDING) +public class TemplateDataTest { + + private static File file07; + private static File file03; + + @BeforeClass + public static void init() { + file07 = TestFileUtil.createNewFile("template07.xlsx"); + file03 = TestFileUtil.createNewFile("template03.xls"); + } + + @Test + public void T01ReadAndWrite07() { + readAndWrite07(file07); + } + + @Test + public void T02ReadAndWrite03() { + readAndWrite03(file03); + } + + private void readAndWrite07(File file) { + EasyExcelFactory.write(file, TemplateData.class) + .withTemplate(TestFileUtil.readFile("template" + File.separator + "template07.xlsx")).sheet() + .doWrite(data()).finish(); + EasyExcelFactory.read(file, TemplateData.class, new TemplateDataListener()).headRowNumber(2).sheet().doRead() + .finish(); + } + + private void readAndWrite03(File file) { + EasyExcelFactory.write(file, TemplateData.class) + .withTemplate(TestFileUtil.readFile("template" + File.separator + "template03.xls")).sheet().doWrite(data()) + .finish(); + EasyExcelFactory.read(file, TemplateData.class, new TemplateDataListener()).headRowNumber(2).sheet().doRead() + .finish(); + } + + private List data() { + List list = new ArrayList(); + TemplateData data = new TemplateData(); + data.setString0("字符串0"); + data.setString1("字符串01"); + TemplateData data1 = new TemplateData(); + data1.setString0("字符串1"); + data1.setString1("字符串11"); + list.add(data); + list.add(data1); + return list; + } +} diff --git a/src/test/resources/template/template03.xls b/src/test/resources/template/template03.xls new file mode 100644 index 0000000000000000000000000000000000000000..e8b1631e6387228ce499d2f27dbff46f41fc7bc4 GIT binary patch literal 18944 zcmeHP2V7Lg)}IB01*It+rAd>b6e$L!DG?Pch(-b`2ura+z@VZ8EX0CQ5Jf~(Y_Wh? zBAO^hj0FoQqNs=k#2O_Enjkj5bMEEtF1vU4VP3xP_wv5X{^pi5XZ~}}nKLtYX71g} z%j$Jo4(Qbrk>E~b$;UQDA}>Vez%@oHs1afa7kK}%t*wnF5(1b1gujsmK7gzyPE9z=bJ zJt6jjXaEs?2BR@t_ZGVU8=3CELeu~f3%^;!i1?71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