From 5465de62942589bf950a29e900c7274eabd1cab5 Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Fri, 15 Oct 2021 13:09:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=A1=AB=E5=85=85=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/alibaba/excel/metadata/Head.java | 91 +---- .../com/alibaba/excel/util/FieldUtils.java | 17 +- .../com/alibaba/excel/util/StyleUtil.java | 22 +- .../executor/AbstractExcelWriteExecutor.java | 1 - .../write/executor/ExcelWriteAddExecutor.java | 4 +- .../executor/ExcelWriteFillExecutor.java | 7 +- .../impl/FillStyleCellWriteHandler.java | 2 +- .../metadata/holder/AbstractWriteHolder.java | 11 +- .../metadata/holder/WriteWorkbookHolder.java | 22 +- .../AbstractVerticalCellStyleStrategy.java | 28 +- .../test/core/fill/FillDataTest.java | 35 +- .../fill/style/FillStyleAnnotatedData.java | 29 ++ .../fill/style/FillStyleAnnotatedTest.java | 325 ++++++++++++++++ .../test/core/fill/style/FillStyleData.java | 16 + .../core/fill/style/FillStyleDataTest.java | 346 ++++++++++++++++++ .../easyexcel/test/temp/poi/PoiWriteTest.java | 17 +- src/test/resources/fill/simple.csv | 2 + src/test/resources/fill/style.xls | Bin 0 -> 27648 bytes src/test/resources/fill/style.xlsx | Bin 0 -> 11114 bytes update.md | 1 + 20 files changed, 836 insertions(+), 140 deletions(-) create mode 100644 src/test/java/com/alibaba/easyexcel/test/core/fill/style/FillStyleAnnotatedData.java create mode 100644 src/test/java/com/alibaba/easyexcel/test/core/fill/style/FillStyleAnnotatedTest.java create mode 100644 src/test/java/com/alibaba/easyexcel/test/core/fill/style/FillStyleData.java create mode 100644 src/test/java/com/alibaba/easyexcel/test/core/fill/style/FillStyleDataTest.java create mode 100644 src/test/resources/fill/simple.csv create mode 100644 src/test/resources/fill/style.xls create mode 100644 src/test/resources/fill/style.xlsx diff --git a/src/main/java/com/alibaba/excel/metadata/Head.java b/src/main/java/com/alibaba/excel/metadata/Head.java index c150fe02..2f98a14b 100644 --- a/src/main/java/com/alibaba/excel/metadata/Head.java +++ b/src/main/java/com/alibaba/excel/metadata/Head.java @@ -9,11 +9,14 @@ import com.alibaba.excel.metadata.property.FontProperty; import com.alibaba.excel.metadata.property.LoopMergeProperty; import com.alibaba.excel.metadata.property.StyleProperty; +import lombok.Data; + /** * excel head * * @author Jiaju Zhuang **/ +@Data public class Head { /** * Column index of head @@ -77,92 +80,4 @@ public class Head { this.forceIndex = forceIndex; this.forceName = forceName; } - - public Integer getColumnIndex() { - return columnIndex; - } - - public void setColumnIndex(Integer columnIndex) { - this.columnIndex = columnIndex; - } - - public String getFieldName() { - return fieldName; - } - - public void setFieldName(String fieldName) { - this.fieldName = fieldName; - } - - public List getHeadNameList() { - return headNameList; - } - - public void setHeadNameList(List headNameList) { - this.headNameList = headNameList; - } - - public ColumnWidthProperty getColumnWidthProperty() { - return columnWidthProperty; - } - - public void setColumnWidthProperty(ColumnWidthProperty columnWidthProperty) { - this.columnWidthProperty = columnWidthProperty; - } - - public Boolean getForceIndex() { - return forceIndex; - } - - public void setForceIndex(Boolean forceIndex) { - this.forceIndex = forceIndex; - } - - public Boolean getForceName() { - return forceName; - } - - public void setForceName(Boolean forceName) { - this.forceName = forceName; - } - - public LoopMergeProperty getLoopMergeProperty() { - return loopMergeProperty; - } - - public void setLoopMergeProperty(LoopMergeProperty loopMergeProperty) { - this.loopMergeProperty = loopMergeProperty; - } - - public StyleProperty getHeadStyleProperty() { - return headStyleProperty; - } - - public void setHeadStyleProperty(StyleProperty headStyleProperty) { - this.headStyleProperty = headStyleProperty; - } - - public StyleProperty getContentStyleProperty() { - return contentStyleProperty; - } - - public void setContentStyleProperty(StyleProperty contentStyleProperty) { - this.contentStyleProperty = contentStyleProperty; - } - - public FontProperty getHeadFontProperty() { - return headFontProperty; - } - - public void setHeadFontProperty(FontProperty headFontProperty) { - this.headFontProperty = headFontProperty; - } - - public FontProperty getContentFontProperty() { - return contentFontProperty; - } - - public void setContentFontProperty(FontProperty contentFontProperty) { - this.contentFontProperty = contentFontProperty; - } } diff --git a/src/main/java/com/alibaba/excel/util/FieldUtils.java b/src/main/java/com/alibaba/excel/util/FieldUtils.java index a5c75731..367c6e55 100644 --- a/src/main/java/com/alibaba/excel/util/FieldUtils.java +++ b/src/main/java/com/alibaba/excel/util/FieldUtils.java @@ -5,7 +5,6 @@ import java.lang.reflect.Modifier; import java.util.Map; import com.alibaba.excel.metadata.NullObject; -import com.alibaba.excel.write.metadata.RowData; import net.sf.cglib.beans.BeanMap; @@ -20,19 +19,17 @@ public class FieldUtils { private static final int START_RESOLVE_FIELD_LENGTH = 2; - public static Class getFieldClass(Map dataMap, String filedName) { + public static Class getFieldClass(Map dataMap, String filedName, Object value) { if (dataMap instanceof BeanMap) { - return ((BeanMap)dataMap).getPropertyType(filedName); - } - Object value = dataMap.get(filedName); - if (value != null) { - return value.getClass(); + Class fieldClass = ((BeanMap)dataMap).getPropertyType(filedName); + if (fieldClass != null) { + return fieldClass; + } } - return nullObjectClass; + return getFieldClass(value); } - public static Class getFieldClass(RowData rowData, int dataIndex) { - Object value = rowData.get(dataIndex); + public static Class getFieldClass(Object value) { if (value != null) { return value.getClass(); } diff --git a/src/main/java/com/alibaba/excel/util/StyleUtil.java b/src/main/java/com/alibaba/excel/util/StyleUtil.java index 7481d6a5..93ae6577 100644 --- a/src/main/java/com/alibaba/excel/util/StyleUtil.java +++ b/src/main/java/com/alibaba/excel/util/StyleUtil.java @@ -10,6 +10,7 @@ import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder; import com.alibaba.excel.write.metadata.style.WriteCellStyle; import com.alibaba.excel.write.metadata.style.WriteFont; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.poi.common.usermodel.HyperlinkType; import org.apache.poi.hssf.usermodel.HSSFFont; @@ -27,6 +28,7 @@ import org.apache.poi.xssf.usermodel.XSSFRichTextString; /** * @author jipengfei */ +@Slf4j public class StyleUtil { private StyleUtil() {} @@ -123,6 +125,9 @@ public class StyleUtil { return dataFormatData.getIndex(); } if (StringUtils.isNotBlank(dataFormatData.getFormat())) { + if (log.isDebugEnabled()) { + log.info("create new data fromat:{}", dataFormatData); + } DataFormat dataFormatCreate = workbook.createDataFormat(); return dataFormatCreate.getFormat(dataFormatData.getFormat()); } @@ -130,8 +135,14 @@ public class StyleUtil { } public static Font buildFont(Workbook workbook, Font originFont, WriteFont writeFont) { - Font font = createFont(workbook, originFont); - if (writeFont == null || font == null) { + if (log.isDebugEnabled()) { + log.info("create new font:{},{}", writeFont, originFont); + } + if (writeFont == null && originFont == null) { + return null; + } + Font font = createFont(workbook, originFont, writeFont); + if (writeFont == null) { return font; } if (writeFont.getFontName() != null) { @@ -164,7 +175,7 @@ public class StyleUtil { return font; } - private static Font createFont(Workbook workbook, Font originFont) { + private static Font createFont(Workbook workbook, Font originFont, WriteFont writeFont) { Font font = workbook.createFont(); if (originFont == null) { return font; @@ -176,7 +187,10 @@ public class StyleUtil { xssfFont.setFontHeightInPoints(xssfOriginFont.getFontHeightInPoints()); xssfFont.setItalic(xssfOriginFont.getItalic()); xssfFont.setStrikeout(xssfOriginFont.getStrikeout()); - xssfFont.setColor(new XSSFColor(xssfOriginFont.getXSSFColor().getRGB(), null)); + // Colors cannot be overwritten + if (writeFont == null || writeFont.getColor() == null) { + xssfFont.setColor(new XSSFColor(xssfOriginFont.getXSSFColor().getRGB(), null)); + } xssfFont.setTypeOffset(xssfOriginFont.getTypeOffset()); xssfFont.setUnderline(xssfOriginFont.getUnderline()); xssfFont.setCharSet(xssfOriginFont.getCharSet()); diff --git a/src/main/java/com/alibaba/excel/write/executor/AbstractExcelWriteExecutor.java b/src/main/java/com/alibaba/excel/write/executor/AbstractExcelWriteExecutor.java index 3c2d21db..ecc34b55 100644 --- a/src/main/java/com/alibaba/excel/write/executor/AbstractExcelWriteExecutor.java +++ b/src/main/java/com/alibaba/excel/write/executor/AbstractExcelWriteExecutor.java @@ -104,7 +104,6 @@ public abstract class AbstractExcelWriteExecutor implements ExcelWriteExecutor { } - private void fillFormula(Cell cell, FormulaData formulaData) { if (formulaData == null) { return; diff --git a/src/main/java/com/alibaba/excel/write/executor/ExcelWriteAddExecutor.java b/src/main/java/com/alibaba/excel/write/executor/ExcelWriteAddExecutor.java index e053d81f..866f6378 100644 --- a/src/main/java/com/alibaba/excel/write/executor/ExcelWriteAddExecutor.java +++ b/src/main/java/com/alibaba/excel/write/executor/ExcelWriteAddExecutor.java @@ -115,7 +115,7 @@ public class ExcelWriteAddExecutor extends AbstractExcelWriteExecutor { WriteHandlerUtils.afterCellCreate(writeContext, cell, head, relativeRowIndex, Boolean.FALSE); Object value = oneRowData.get(dataIndex); WriteCellData cellData = converterAndSet(writeContext.currentWriteHolder(), - FieldUtils.getFieldClass(oneRowData, dataIndex), null, cell, value, null, head, relativeRowIndex); + FieldUtils.getFieldClass(value), null, cell, value, null, head, relativeRowIndex); WriteHandlerUtils.afterCellDispose(writeContext, cellData, cell, head, relativeRowIndex, Boolean.FALSE); } @@ -173,7 +173,7 @@ public class ExcelWriteAddExecutor extends AbstractExcelWriteExecutor { Cell cell = WorkBookUtil.createCell(row, maxCellIndex++); WriteHandlerUtils.afterCellCreate(writeContext, cell, null, relativeRowIndex, Boolean.FALSE); WriteCellData cellData = converterAndSet(currentWriteHolder, - FieldUtils.getFieldClass(beanMap, filedName), null, cell, value, null, null, relativeRowIndex); + FieldUtils.getFieldClass(beanMap, filedName, value), null, cell, value, null, null, relativeRowIndex); WriteHandlerUtils.afterCellDispose(writeContext, cellData, cell, null, relativeRowIndex, Boolean.FALSE); } } diff --git a/src/main/java/com/alibaba/excel/write/executor/ExcelWriteFillExecutor.java b/src/main/java/com/alibaba/excel/write/executor/ExcelWriteFillExecutor.java index 57315ac6..70e28e77 100644 --- a/src/main/java/com/alibaba/excel/write/executor/ExcelWriteFillExecutor.java +++ b/src/main/java/com/alibaba/excel/write/executor/ExcelWriteFillExecutor.java @@ -200,7 +200,7 @@ public class ExcelWriteFillExecutor extends AbstractExcelWriteExecutor { } Object value = dataMap.get(variable); WriteCellData cellData = converterAndSet(writeSheetHolder, - FieldUtils.getFieldClass(dataMap, variable), + FieldUtils.getFieldClass(dataMap, variable, value), null, cell, value, fieldNameContentPropertyMap.get(variable), null, relativeRowIndex); // Restyle @@ -221,8 +221,9 @@ public class ExcelWriteFillExecutor extends AbstractExcelWriteExecutor { continue; } Object value = dataMap.get(variable); - WriteCellData cellData = convert(writeSheetHolder, value == null ? null : value.getClass(), - CellDataTypeEnum.STRING, cell, value, fieldNameContentPropertyMap.get(variable)); + WriteCellData cellData = convert(writeSheetHolder, + FieldUtils.getFieldClass(dataMap, variable, value), CellDataTypeEnum.STRING, cell, value, + fieldNameContentPropertyMap.get(variable)); cellDataList.add(cellData); CellDataTypeEnum type = cellData.getType(); if (type != null) { diff --git a/src/main/java/com/alibaba/excel/write/handler/impl/FillStyleCellWriteHandler.java b/src/main/java/com/alibaba/excel/write/handler/impl/FillStyleCellWriteHandler.java index de7977ff..faf39ad7 100644 --- a/src/main/java/com/alibaba/excel/write/handler/impl/FillStyleCellWriteHandler.java +++ b/src/main/java/com/alibaba/excel/write/handler/impl/FillStyleCellWriteHandler.java @@ -29,7 +29,7 @@ public class FillStyleCellWriteHandler implements CellWriteHandler { @Override public void afterCellDispose(CellWriteHandlerContext context) { List> cellDataList = context.getCellDataList(); - if (CollectionUtils.isEmpty(cellDataList) || cellDataList.size() > 1) { + if (CollectionUtils.isEmpty(cellDataList)) { return; } WriteCellData cellData = cellDataList.get(0); 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 d6921681..8028e4bd 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 @@ -27,6 +27,7 @@ import com.alibaba.excel.write.handler.RowWriteHandler; import com.alibaba.excel.write.handler.SheetWriteHandler; import com.alibaba.excel.write.handler.WorkbookWriteHandler; import com.alibaba.excel.write.handler.WriteHandler; +import com.alibaba.excel.write.handler.context.CellWriteHandlerContext; import com.alibaba.excel.write.merge.LoopMergeStrategy; import com.alibaba.excel.write.merge.OnceAbsoluteMergeStrategy; import com.alibaba.excel.write.metadata.WriteBasicParameter; @@ -242,13 +243,15 @@ public abstract class AbstractWriteHolder extends AbstractHolder implements Writ } @Override - protected WriteCellStyle headCellStyle(Head head) { - return WriteCellStyle.build(head.getHeadStyleProperty(), head.getHeadFontProperty()); + protected WriteCellStyle headCellStyle(CellWriteHandlerContext context) { + //return WriteCellStyle.build(head.getHeadStyleProperty(), head.getHeadFontProperty()); + return null; } @Override - protected WriteCellStyle contentCellStyle(Head head) { - return WriteCellStyle.build(head.getContentStyleProperty(), head.getContentFontProperty()); + protected WriteCellStyle contentCellStyle(CellWriteHandlerContext context) { + //return WriteCellStyle.build(head.getContentStyleProperty(), head.getContentFontProperty()); + return null; } }; handlerList.add(styleStrategy); diff --git a/src/main/java/com/alibaba/excel/write/metadata/holder/WriteWorkbookHolder.java b/src/main/java/com/alibaba/excel/write/metadata/holder/WriteWorkbookHolder.java index 2c392f0c..494473dc 100644 --- a/src/main/java/com/alibaba/excel/write/metadata/holder/WriteWorkbookHolder.java +++ b/src/main/java/com/alibaba/excel/write/metadata/holder/WriteWorkbookHolder.java @@ -24,6 +24,7 @@ import com.alibaba.excel.write.metadata.style.WriteCellStyle; import com.alibaba.excel.write.metadata.style.WriteFont; import lombok.Data; +import lombok.extern.slf4j.Slf4j; import org.apache.poi.hssf.usermodel.HSSFCellStyle; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.ss.usermodel.CellStyle; @@ -39,6 +40,7 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook; * @author Jiaju Zhuang */ @Data +@Slf4j public class WriteWorkbookHolder extends AbstractWriteHolder { /*** * Current poi Workbook.This is only for writing, and there may be no data in version 07 when template data needs to @@ -254,7 +256,7 @@ public class WriteWorkbookHolder extends AbstractWriteHolder { short styleIndex = -1; Font originFont = null; - boolean useCache = false; + boolean useCache = true; if (originCellStyle != null) { styleIndex = originCellStyle.getIndex(); if (originCellStyle instanceof XSSFCellStyle) { @@ -262,7 +264,7 @@ public class WriteWorkbookHolder extends AbstractWriteHolder { } else if (originCellStyle instanceof HSSFCellStyle) { originFont = ((HSSFCellStyle)originCellStyle).getFont(workbook); } - useCache = true; + useCache = false; } Map cellStyleMap = cellStyleIndexMap.computeIfAbsent(styleIndex, @@ -271,9 +273,18 @@ public class WriteWorkbookHolder extends AbstractWriteHolder { if (cellStyle != null) { return cellStyle; } + if (log.isDebugEnabled()) { + log.info("create new style:{},{}", writeCellStyle, originCellStyle); + } cellStyle = StyleUtil.buildCellStyle(workbook, originCellStyle, writeCellStyle); - cellStyle.setDataFormat(createDataFormat(writeCellStyle.getDataFormatData(), useCache)); - cellStyle.setFont(createFont(writeCellStyle.getWriteFont(), originFont, useCache)); + Short dataFormat = createDataFormat(writeCellStyle.getDataFormatData(), useCache); + if (dataFormat != null) { + cellStyle.setDataFormat(dataFormat); + } + Font font = createFont(writeCellStyle.getWriteFont(), originFont, useCache); + if (font != null) { + cellStyle.setFont(font); + } cellStyleMap.put(writeCellStyle, cellStyle); return cellStyle; } @@ -307,6 +318,9 @@ public class WriteWorkbookHolder extends AbstractWriteHolder { * @return */ public Short createDataFormat(DataFormatData dataFormatData, boolean useCache) { + if (dataFormatData == null) { + return null; + } if (!useCache) { return StyleUtil.buildDataFormat(workbook, dataFormatData); } diff --git a/src/main/java/com/alibaba/excel/write/style/AbstractVerticalCellStyleStrategy.java b/src/main/java/com/alibaba/excel/write/style/AbstractVerticalCellStyleStrategy.java index e37987bb..f9d76f7f 100644 --- a/src/main/java/com/alibaba/excel/write/style/AbstractVerticalCellStyleStrategy.java +++ b/src/main/java/com/alibaba/excel/write/style/AbstractVerticalCellStyleStrategy.java @@ -18,12 +18,12 @@ public abstract class AbstractVerticalCellStyleStrategy extends AbstractCellStyl return; } WriteCellData cellData = context.getFirstCellData(); - WriteCellStyle.merge(headCellStyle(context.getHeadData()), cellData.getOrCreateStyle()); + WriteCellStyle.merge(headCellStyle(context), cellData.getOrCreateStyle()); } @Override protected void setContentCellStyle(CellWriteHandlerContext context) { - if (stopProcessing(context)) { + if (context.getFirstCellData() == null) { return; } WriteCellData cellData = context.getFirstCellData(); @@ -31,13 +31,13 @@ public abstract class AbstractVerticalCellStyleStrategy extends AbstractCellStyl } /** - * Returns the column width corresponding to each column head. + * Returns the column width corresponding to each column head * * @param context * @return */ - protected WriteCellStyle contentCellStyle(CellWriteHandlerContext context) { - return contentCellStyle(context.getHeadData()); + protected WriteCellStyle headCellStyle(CellWriteHandlerContext context) { + return headCellStyle(context.getHeadData()); } /** @@ -46,7 +46,19 @@ public abstract class AbstractVerticalCellStyleStrategy extends AbstractCellStyl * @param head Nullable * @return */ - protected abstract WriteCellStyle headCellStyle(Head head); + protected WriteCellStyle headCellStyle(Head head) { + return null; + } + + /** + * Returns the column width corresponding to each column head. + * + * @param context + * @return + */ + protected WriteCellStyle contentCellStyle(CellWriteHandlerContext context) { + return contentCellStyle(context.getHeadData()); + } /** * Returns the column width corresponding to each column head @@ -55,9 +67,7 @@ public abstract class AbstractVerticalCellStyleStrategy extends AbstractCellStyl * @return */ protected WriteCellStyle contentCellStyle(Head head) { - throw new UnsupportedOperationException( - "One of the two methods 'contentCellStyle(Cell cell, Head head, Integer relativeRowIndex)' and " - + "'contentCellStyle(Head head)' must be implemented."); + return null; } protected boolean stopProcessing(CellWriteHandlerContext context) { diff --git a/src/test/java/com/alibaba/easyexcel/test/core/fill/FillDataTest.java b/src/test/java/com/alibaba/easyexcel/test/core/fill/FillDataTest.java index 3df12b1c..6cd629f6 100644 --- a/src/test/java/com/alibaba/easyexcel/test/core/fill/FillDataTest.java +++ b/src/test/java/com/alibaba/easyexcel/test/core/fill/FillDataTest.java @@ -6,23 +6,23 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.junit.Assert; -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.EasyExcel; import com.alibaba.excel.ExcelWriter; import com.alibaba.excel.enums.WriteDirectionEnum; +import com.alibaba.excel.exception.ExcelGenerateException; import com.alibaba.excel.write.merge.LoopMergeStrategy; import com.alibaba.excel.write.metadata.WriteSheet; import com.alibaba.excel.write.metadata.fill.FillConfig; import com.alibaba.excel.write.metadata.fill.FillWrapper; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.FixMethodOrder; +import org.junit.Test; +import org.junit.runners.MethodSorters; + /** - * * @author Jiaju Zhuang */ @FixMethodOrder(MethodSorters.NAME_ASCENDING) @@ -30,8 +30,10 @@ public class FillDataTest { private static File file07; private static File file03; + private static File fileCsv; private static File simpleTemplate07; private static File simpleTemplate03; + private static File simpleTemplateCsv; private static File fileComplex07; private static File complexFillTemplate07; private static File fileComplex03; @@ -53,8 +55,10 @@ public class FillDataTest { public static void init() { file07 = TestFileUtil.createNewFile("fill07.xlsx"); file03 = TestFileUtil.createNewFile("fill03.xls"); + fileCsv = TestFileUtil.createNewFile("fill.csv"); simpleTemplate07 = TestFileUtil.readFile("fill" + File.separator + "simple.xlsx"); simpleTemplate03 = TestFileUtil.readFile("fill" + File.separator + "simple.xls"); + simpleTemplateCsv = TestFileUtil.readFile("fill" + File.separator + "simple.csv"); fileComplex07 = TestFileUtil.createNewFile("fillComplex07.xlsx"); complexFillTemplate07 = TestFileUtil.readFile("fill" + File.separator + "complex.xlsx"); fileComplex03 = TestFileUtil.createNewFile("fillComplex03.xls"); @@ -83,6 +87,13 @@ public class FillDataTest { fill(file03, simpleTemplate03); } + @Test + public void t03FillCsv() { + ExcelGenerateException excelGenerateException = Assert.assertThrows(ExcelGenerateException.class, + () -> fill(fileCsv, simpleTemplateCsv)); + Assert.assertEquals("Calling the 'fill' method must use a template.", excelGenerateException.getMessage()); + } + @Test public void t03ComplexFill07() { complexFill(fileComplex07, complexFillTemplate07); @@ -147,11 +158,11 @@ public class FillDataTest { excelWriter.finish(); List list = EasyExcel.read(file).ignoreEmptyRow(false).sheet().headRowNumber(0).doReadSync(); - Map map0 = (Map) list.get(0); + Map map0 = (Map)list.get(0); Assert.assertEquals("张三", map0.get(21)); - Map map27 = (Map) list.get(27); + Map map27 = (Map)list.get(27); Assert.assertEquals("张三", map27.get(0)); - Map map29 = (Map) list.get(29); + Map map29 = (Map)list.get(29); Assert.assertEquals("张三", map29.get(3)); } @@ -168,7 +179,7 @@ public class FillDataTest { List list = EasyExcel.read(file).sheet().headRowNumber(0).doReadSync(); Assert.assertEquals(list.size(), 5L); - Map map0 = (Map) list.get(0); + Map map0 = (Map)list.get(0); Assert.assertEquals("张三", map0.get(2)); } @@ -185,7 +196,7 @@ public class FillDataTest { excelWriter.finish(); List list = EasyExcel.read(file).sheet().headRowNumber(3).doReadSync(); Assert.assertEquals(list.size(), 21L); - Map map19 = (Map) list.get(19); + Map map19 = (Map)list.get(19); Assert.assertEquals("张三", map19.get(0)); } diff --git a/src/test/java/com/alibaba/easyexcel/test/core/fill/style/FillStyleAnnotatedData.java b/src/test/java/com/alibaba/easyexcel/test/core/fill/style/FillStyleAnnotatedData.java new file mode 100644 index 00000000..f5984a1e --- /dev/null +++ b/src/test/java/com/alibaba/easyexcel/test/core/fill/style/FillStyleAnnotatedData.java @@ -0,0 +1,29 @@ +package com.alibaba.easyexcel.test.core.fill.style; + +import java.util.Date; + +import com.alibaba.excel.annotation.write.style.ContentFontStyle; +import com.alibaba.excel.annotation.write.style.ContentStyle; +import com.alibaba.excel.enums.BooleanEnum; +import com.alibaba.excel.enums.poi.FillPatternTypeEnum; + +import lombok.Data; + +/** + * @author Jiaju Zhuang + */ +@Data +public class FillStyleAnnotatedData { + @ContentStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 13) + @ContentFontStyle(bold = BooleanEnum.TRUE, color = 19) + private String name; + @ContentStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 10) + @ContentFontStyle(bold = BooleanEnum.TRUE, color = 16) + private Double number; + @ContentStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 17) + @ContentFontStyle(bold = BooleanEnum.TRUE, color = 18) + private Date date; + @ContentStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 12) + @ContentFontStyle(bold = BooleanEnum.TRUE, color = 18) + private String empty; +} diff --git a/src/test/java/com/alibaba/easyexcel/test/core/fill/style/FillStyleAnnotatedTest.java b/src/test/java/com/alibaba/easyexcel/test/core/fill/style/FillStyleAnnotatedTest.java new file mode 100644 index 00000000..d1d45322 --- /dev/null +++ b/src/test/java/com/alibaba/easyexcel/test/core/fill/style/FillStyleAnnotatedTest.java @@ -0,0 +1,325 @@ +package com.alibaba.easyexcel.test.core.fill.style; + +import java.io.File; +import java.io.FileInputStream; +import java.util.List; + +import com.alibaba.easyexcel.test.core.fill.FillData; +import com.alibaba.easyexcel.test.util.TestFileUtil; +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.metadata.Head; +import com.alibaba.excel.util.DateUtils; +import com.alibaba.excel.util.ListUtils; +import com.alibaba.excel.write.handler.context.CellWriteHandlerContext; +import com.alibaba.excel.write.metadata.style.WriteCellStyle; +import com.alibaba.excel.write.metadata.style.WriteFont; +import com.alibaba.excel.write.style.AbstractVerticalCellStyleStrategy; + +import org.apache.poi.hssf.usermodel.HSSFCell; +import org.apache.poi.hssf.usermodel.HSSFRow; +import org.apache.poi.hssf.usermodel.HSSFSheet; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.ss.usermodel.FillPatternType; +import org.apache.poi.ss.usermodel.IndexedColors; +import org.apache.poi.xssf.usermodel.XSSFCell; +import org.apache.poi.xssf.usermodel.XSSFRow; +import org.apache.poi.xssf.usermodel.XSSFSheet; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.FixMethodOrder; +import org.junit.Test; +import org.junit.runners.MethodSorters; + +/** + * @author Jiaju Zhuang + */ +@FixMethodOrder(MethodSorters.NAME_ASCENDING) +public class FillStyleAnnotatedTest { + + private static File FillStyleAnnotated07; + private static File FillStyleAnnotated03; + private static File fileStyleTemplate07; + private static File fileStyleTemplate03; + + @BeforeClass + public static void init() { + FillStyleAnnotated07 = TestFileUtil.createNewFile("FillStyleAnnotated07.xlsx"); + FillStyleAnnotated03 = TestFileUtil.createNewFile("FillStyleAnnotated03.xls"); + fileStyleTemplate07 = TestFileUtil.readFile("fill" + File.separator + "style.xlsx"); + fileStyleTemplate03 = TestFileUtil.readFile("fill" + File.separator + "style.xls"); + } + + @Test + public void t01Fill07() throws Exception { + fill(FillStyleAnnotated07, fileStyleTemplate07); + XSSFWorkbook workbook = new XSSFWorkbook(new FileInputStream(FillStyleAnnotated07)); + XSSFSheet sheet = workbook.getSheetAt(0); + t01Fill07check(sheet.getRow(1)); + t01Fill07check(sheet.getRow(2)); + } + + private void t01Fill07check(XSSFRow row) { + XSSFCell cell0 = row.getCell(0); + Assert.assertEquals("张三", cell0.getStringCellValue()); + Assert.assertEquals(49, cell0.getCellStyle().getDataFormat()); + Assert.assertEquals("FF00B050", cell0.getCellStyle().getFillForegroundColorColor().getARGBHex()); + Assert.assertEquals("FF7030A0", cell0.getCellStyle().getFont().getXSSFColor().getARGBHex()); + Assert.assertTrue(cell0.getCellStyle().getFont().getBold()); + + XSSFCell cell1 = row.getCell(1); + Assert.assertEquals("5", cell1.getStringCellValue()); + Assert.assertEquals(0, cell1.getCellStyle().getDataFormat()); + Assert.assertEquals("FF92D050", cell1.getCellStyle().getFillForegroundColorColor().getARGBHex()); + Assert.assertEquals("FF4BACC6", cell1.getCellStyle().getFont().getXSSFColor().getARGBHex()); + Assert.assertFalse(cell1.getCellStyle().getFont().getBold()); + + XSSFCell cell2 = row.getCell(2); + Assert.assertEquals("2020-01-01 01:01:01", DateUtils.format(cell2.getDateCellValue(), "yyyy-MM-dd HH:mm:ss")); + Assert.assertEquals("yyyy-MM-dd HH:mm:ss", cell2.getCellStyle().getDataFormatString()); + Assert.assertEquals("FFFFC000", cell2.getCellStyle().getFillForegroundColorColor().getARGBHex()); + Assert.assertEquals("FFC0504D", cell2.getCellStyle().getFont().getXSSFColor().getARGBHex()); + Assert.assertTrue(cell2.getCellStyle().getFont().getBold()); + + XSSFCell cell3 = row.getCell(3); + Assert.assertEquals("张三今年5岁了", cell3.getStringCellValue()); + Assert.assertEquals(0, cell3.getCellStyle().getDataFormat()); + Assert.assertEquals("FFFF0000", cell3.getCellStyle().getFillForegroundColorColor().getARGBHex()); + Assert.assertEquals("FFEEECE1", cell3.getCellStyle().getFont().getXSSFColor().getARGBHex()); + Assert.assertTrue(cell3.getCellStyle().getFont().getBold()); + + XSSFCell cell4 = row.getCell(4); + Assert.assertEquals("{.name}忽略,张三", cell4.getStringCellValue()); + Assert.assertEquals(0, cell4.getCellStyle().getDataFormat()); + Assert.assertEquals("FFC00000", cell4.getCellStyle().getFillForegroundColorColor().getARGBHex()); + Assert.assertEquals("FF000000", cell4.getCellStyle().getFont().getXSSFColor().getARGBHex()); + Assert.assertFalse(cell4.getCellStyle().getFont().getBold()); + + XSSFCell cell5 = row.getCell(5); + Assert.assertEquals("空", cell5.getStringCellValue()); + Assert.assertEquals(0, cell5.getCellStyle().getDataFormat()); + Assert.assertEquals("FFF79646", cell5.getCellStyle().getFillForegroundColorColor().getARGBHex()); + Assert.assertEquals("FF8064A2", cell5.getCellStyle().getFont().getXSSFColor().getARGBHex()); + Assert.assertFalse(cell5.getCellStyle().getFont().getBold()); + } + + @Test + public void t02Fill03() throws Exception { + fill(FillStyleAnnotated03, fileStyleTemplate03); + HSSFWorkbook workbook = new HSSFWorkbook(new FileInputStream(FillStyleAnnotated03)); + HSSFSheet sheet = workbook.getSheetAt(0); + t02Fill03check(workbook, sheet.getRow(1)); + t02Fill03check(workbook, sheet.getRow(2)); + } + + private void t02Fill03check(HSSFWorkbook workbook, HSSFRow row) { + HSSFCell cell0 = row.getCell(0); + Assert.assertEquals("张三", cell0.getStringCellValue()); + Assert.assertEquals(49, cell0.getCellStyle().getDataFormat()); + Assert.assertEquals("0:8080:0", cell0.getCellStyle().getFillForegroundColorColor().getHexString()); + Assert.assertEquals("8080:0:8080", cell0.getCellStyle().getFont(workbook).getHSSFColor(workbook) + .getHexString()); + Assert.assertTrue(cell0.getCellStyle().getFont(workbook).getBold()); + + HSSFCell cell1 = row.getCell(1); + Assert.assertEquals("5", cell1.getStringCellValue()); + Assert.assertEquals(0, cell1.getCellStyle().getDataFormat()); + Assert.assertEquals("9999:CCCC:0", cell1.getCellStyle().getFillForegroundColorColor().getHexString()); + Assert.assertEquals("0:8080:8080", cell1.getCellStyle().getFont(workbook).getHSSFColor(workbook) + .getHexString()); + Assert.assertFalse(cell1.getCellStyle().getFont(workbook).getBold()); + + HSSFCell cell2 = row.getCell(2); + Assert.assertEquals("2020-01-01 01:01:01", DateUtils.format(cell2.getDateCellValue(), "yyyy-MM-dd HH:mm:ss")); + Assert.assertEquals("yyyy-MM-dd HH:mm:ss", cell2.getCellStyle().getDataFormatString()); + Assert.assertEquals("FFFF:CCCC:0", cell2.getCellStyle().getFillForegroundColorColor().getHexString()); + Assert.assertEquals("8080:0:0", cell2.getCellStyle().getFont(workbook).getHSSFColor(workbook).getHexString()); + Assert.assertTrue(cell2.getCellStyle().getFont(workbook).getBold()); + + HSSFCell cell3 = row.getCell(3); + Assert.assertEquals("张三今年5岁了", cell3.getStringCellValue()); + Assert.assertEquals(0, cell3.getCellStyle().getDataFormat()); + Assert.assertEquals("FFFF:0:0", cell3.getCellStyle().getFillForegroundColorColor().getHexString()); + Assert.assertEquals("FFFF:FFFF:9999", cell3.getCellStyle().getFont(workbook).getHSSFColor(workbook) + .getHexString()); + Assert.assertTrue(cell3.getCellStyle().getFont(workbook).getBold()); + + HSSFCell cell4 = row.getCell(4); + Assert.assertEquals("{.name}忽略,张三", cell4.getStringCellValue()); + Assert.assertEquals(0, cell4.getCellStyle().getDataFormat()); + Assert.assertEquals("9999:3333:0", cell4.getCellStyle().getFillForegroundColorColor().getHexString()); + Assert.assertEquals("3333:3333:3333", cell4.getCellStyle().getFont(workbook).getHSSFColor(workbook) + .getHexString()); + Assert.assertFalse(cell4.getCellStyle().getFont(workbook).getBold()); + + HSSFCell cell5 = row.getCell(5); + Assert.assertEquals("空", cell5.getStringCellValue()); + Assert.assertEquals(0, cell5.getCellStyle().getDataFormat()); + Assert.assertEquals("9999:3333:0", cell5.getCellStyle().getFillForegroundColorColor().getHexString()); + Assert.assertEquals("CCCC:9999:FFFF", cell5.getCellStyle().getFont(workbook).getHSSFColor(workbook) + .getHexString()); + Assert.assertFalse(cell5.getCellStyle().getFont(workbook).getBold()); + } + + private void fill(File file, File template) throws Exception { + EasyExcel.write(file, FillStyleAnnotatedData.class).withTemplate(template).sheet().doFill(data()); + } + + + private void t11FillStyleHandler07check(XSSFRow row) { + XSSFCell cell0 = row.getCell(0); + Assert.assertEquals("张三", cell0.getStringCellValue()); + Assert.assertEquals(49, cell0.getCellStyle().getDataFormat()); + Assert.assertEquals("FFFFFF00", cell0.getCellStyle().getFillForegroundColorColor().getARGBHex()); + Assert.assertEquals("FF808000", cell0.getCellStyle().getFont().getXSSFColor().getARGBHex()); + Assert.assertTrue(cell0.getCellStyle().getFont().getBold()); + + XSSFCell cell1 = row.getCell(1); + Assert.assertEquals("5", cell1.getStringCellValue()); + Assert.assertEquals(0, cell1.getCellStyle().getDataFormat()); + Assert.assertEquals("FFFF0000", cell1.getCellStyle().getFillForegroundColorColor().getARGBHex()); + Assert.assertEquals("FF800000", cell1.getCellStyle().getFont().getXSSFColor().getARGBHex()); + Assert.assertTrue(cell1.getCellStyle().getFont().getBold()); + + XSSFCell cell2 = row.getCell(2); + Assert.assertEquals("2020-01-01 01:01:01", DateUtils.format(cell2.getDateCellValue(), "yyyy-MM-dd HH:mm:ss")); + Assert.assertEquals("yyyy-MM-dd HH:mm:ss", cell2.getCellStyle().getDataFormatString()); + Assert.assertEquals("FF008000", cell2.getCellStyle().getFillForegroundColorColor().getARGBHex()); + Assert.assertEquals("FF003300", cell2.getCellStyle().getFont().getXSSFColor().getARGBHex()); + Assert.assertTrue(cell2.getCellStyle().getFont().getBold()); + + XSSFCell cell3 = row.getCell(3); + Assert.assertEquals("张三今年5岁了", cell3.getStringCellValue()); + Assert.assertEquals(0, cell3.getCellStyle().getDataFormat()); + Assert.assertEquals("FF0000FF", cell3.getCellStyle().getFillForegroundColorColor().getARGBHex()); + Assert.assertEquals("FF000080", cell3.getCellStyle().getFont().getXSSFColor().getARGBHex()); + Assert.assertTrue(cell3.getCellStyle().getFont().getBold()); + + XSSFCell cell4 = row.getCell(4); + Assert.assertEquals("{.name}忽略,张三", cell4.getStringCellValue()); + Assert.assertEquals(0, cell4.getCellStyle().getDataFormat()); + Assert.assertEquals("FFFFFF00", cell4.getCellStyle().getFillForegroundColorColor().getARGBHex()); + Assert.assertEquals("FF808000", cell4.getCellStyle().getFont().getXSSFColor().getARGBHex()); + Assert.assertTrue(cell4.getCellStyle().getFont().getBold()); + + XSSFCell cell5 = row.getCell(5); + Assert.assertEquals("空", cell5.getStringCellValue()); + Assert.assertEquals(0, cell5.getCellStyle().getDataFormat()); + Assert.assertEquals("FF008080", cell5.getCellStyle().getFillForegroundColorColor().getARGBHex()); + Assert.assertEquals("FF003366", cell5.getCellStyle().getFont().getXSSFColor().getARGBHex()); + Assert.assertTrue(cell5.getCellStyle().getFont().getBold()); + } + + + private void t12FillStyleHandler03check(HSSFWorkbook workbook, HSSFRow row) { + HSSFCell cell0 = row.getCell(0); + Assert.assertEquals("张三", cell0.getStringCellValue()); + Assert.assertEquals(49, cell0.getCellStyle().getDataFormat()); + Assert.assertEquals("FFFF:FFFF:0", cell0.getCellStyle().getFillForegroundColorColor().getHexString()); + Assert.assertEquals("8080:8080:0", cell0.getCellStyle().getFont(workbook).getHSSFColor(workbook) + .getHexString()); + Assert.assertTrue(cell0.getCellStyle().getFont(workbook).getBold()); + + HSSFCell cell1 = row.getCell(1); + Assert.assertEquals("5", cell1.getStringCellValue()); + Assert.assertEquals(0, cell1.getCellStyle().getDataFormat()); + Assert.assertEquals("FFFF:0:0", cell1.getCellStyle().getFillForegroundColorColor().getHexString()); + Assert.assertEquals("8080:0:0", cell1.getCellStyle().getFont(workbook).getHSSFColor(workbook) + .getHexString()); + Assert.assertTrue(cell1.getCellStyle().getFont(workbook).getBold()); + + HSSFCell cell2 = row.getCell(2); + Assert.assertEquals("2020-01-01 01:01:01", DateUtils.format(cell2.getDateCellValue(), "yyyy-MM-dd HH:mm:ss")); + Assert.assertEquals("yyyy-MM-dd HH:mm:ss", cell2.getCellStyle().getDataFormatString()); + Assert.assertEquals("0:8080:0", cell2.getCellStyle().getFillForegroundColorColor().getHexString()); + Assert.assertEquals("0:3333:0", cell2.getCellStyle().getFont(workbook).getHSSFColor(workbook).getHexString()); + Assert.assertTrue(cell2.getCellStyle().getFont(workbook).getBold()); + + HSSFCell cell3 = row.getCell(3); + Assert.assertEquals("张三今年5岁了", cell3.getStringCellValue()); + Assert.assertEquals(0, cell3.getCellStyle().getDataFormat()); + Assert.assertEquals("0:0:FFFF", cell3.getCellStyle().getFillForegroundColorColor().getHexString()); + Assert.assertEquals("0:0:8080", cell3.getCellStyle().getFont(workbook).getHSSFColor(workbook) + .getHexString()); + Assert.assertTrue(cell3.getCellStyle().getFont(workbook).getBold()); + + HSSFCell cell4 = row.getCell(4); + Assert.assertEquals("{.name}忽略,张三", cell4.getStringCellValue()); + Assert.assertEquals(0, cell4.getCellStyle().getDataFormat()); + Assert.assertEquals("FFFF:FFFF:0", cell4.getCellStyle().getFillForegroundColorColor().getHexString()); + Assert.assertEquals("8080:8080:0", cell4.getCellStyle().getFont(workbook).getHSSFColor(workbook) + .getHexString()); + Assert.assertTrue(cell4.getCellStyle().getFont(workbook).getBold()); + + HSSFCell cell5 = row.getCell(5); + Assert.assertEquals("空", cell5.getStringCellValue()); + Assert.assertEquals(0, cell5.getCellStyle().getDataFormat()); + Assert.assertEquals("0:8080:8080", cell5.getCellStyle().getFillForegroundColorColor().getHexString()); + Assert.assertEquals("0:3333:6666", cell5.getCellStyle().getFont(workbook).getHSSFColor(workbook) + .getHexString()); + Assert.assertTrue(cell5.getCellStyle().getFont(workbook).getBold()); + } + + private void fillStyleHandler(File file, File template) throws Exception { + EasyExcel.write(file, FillData.class).withTemplate(template).sheet() + .registerWriteHandler(new AbstractVerticalCellStyleStrategy() { + + @Override + protected WriteCellStyle contentCellStyle(CellWriteHandlerContext context) { + WriteCellStyle writeCellStyle = new WriteCellStyle(); + WriteFont writeFont = new WriteFont(); + writeCellStyle.setWriteFont(writeFont); + writeCellStyle.setFillPatternType(FillPatternType.SOLID_FOREGROUND); + writeFont.setBold(true); + if (context.getColumnIndex() == 0) { + writeCellStyle.setFillForegroundColor(IndexedColors.YELLOW.getIndex()); + writeFont.setColor(IndexedColors.DARK_YELLOW.getIndex()); + } + if (context.getColumnIndex() == 1) { + writeCellStyle.setFillForegroundColor(IndexedColors.RED.getIndex()); + writeFont.setColor(IndexedColors.DARK_RED.getIndex()); + } + if (context.getColumnIndex() == 2) { + writeCellStyle.setFillForegroundColor(IndexedColors.GREEN.getIndex()); + writeFont.setColor(IndexedColors.DARK_GREEN.getIndex()); + } + if (context.getColumnIndex() == 3) { + writeCellStyle.setFillForegroundColor(IndexedColors.BLUE.getIndex()); + writeFont.setColor(IndexedColors.DARK_BLUE.getIndex()); + } + if (context.getColumnIndex() == 4) { + writeCellStyle.setFillForegroundColor(IndexedColors.YELLOW.getIndex()); + writeFont.setColor(IndexedColors.DARK_YELLOW.getIndex()); + } + if (context.getColumnIndex() == 5) { + writeCellStyle.setFillForegroundColor(IndexedColors.TEAL.getIndex()); + writeFont.setColor(IndexedColors.DARK_TEAL.getIndex()); + } + return writeCellStyle; + } + + @Override + protected WriteCellStyle headCellStyle(Head head) { + return null; + } + + }) + .doFill(data()); + } + + private List data() throws Exception { + List list = ListUtils.newArrayList(); + for (int i = 0; i < 10; i++) { + FillStyleAnnotatedData fillData = new FillStyleAnnotatedData(); + list.add(fillData); + fillData.setName("张三"); + fillData.setNumber(5.2); + fillData.setDate(DateUtils.parseDate("2020-01-01 01:01:01")); + if (i == 5) { + fillData.setName(null); + } + } + return list; + } + +} diff --git a/src/test/java/com/alibaba/easyexcel/test/core/fill/style/FillStyleData.java b/src/test/java/com/alibaba/easyexcel/test/core/fill/style/FillStyleData.java new file mode 100644 index 00000000..98c29fb2 --- /dev/null +++ b/src/test/java/com/alibaba/easyexcel/test/core/fill/style/FillStyleData.java @@ -0,0 +1,16 @@ +package com.alibaba.easyexcel.test.core.fill.style; + +import java.util.Date; + +import lombok.Data; + +/** + * @author Jiaju Zhuang + */ +@Data +public class FillStyleData { + private String name; + private Double number; + private Date date; + private String empty; +} diff --git a/src/test/java/com/alibaba/easyexcel/test/core/fill/style/FillStyleDataTest.java b/src/test/java/com/alibaba/easyexcel/test/core/fill/style/FillStyleDataTest.java new file mode 100644 index 00000000..e8af2e34 --- /dev/null +++ b/src/test/java/com/alibaba/easyexcel/test/core/fill/style/FillStyleDataTest.java @@ -0,0 +1,346 @@ +package com.alibaba.easyexcel.test.core.fill.style; + +import java.io.File; +import java.io.FileInputStream; +import java.util.List; + +import com.alibaba.easyexcel.test.core.fill.FillData; +import com.alibaba.easyexcel.test.util.TestFileUtil; +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.metadata.Head; +import com.alibaba.excel.util.DateUtils; +import com.alibaba.excel.util.ListUtils; +import com.alibaba.excel.write.handler.context.CellWriteHandlerContext; +import com.alibaba.excel.write.metadata.style.WriteCellStyle; +import com.alibaba.excel.write.metadata.style.WriteFont; +import com.alibaba.excel.write.style.AbstractVerticalCellStyleStrategy; + +import org.apache.poi.hssf.usermodel.HSSFCell; +import org.apache.poi.hssf.usermodel.HSSFRow; +import org.apache.poi.hssf.usermodel.HSSFSheet; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.ss.usermodel.FillPatternType; +import org.apache.poi.ss.usermodel.IndexedColors; +import org.apache.poi.xssf.usermodel.XSSFCell; +import org.apache.poi.xssf.usermodel.XSSFRow; +import org.apache.poi.xssf.usermodel.XSSFSheet; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.FixMethodOrder; +import org.junit.Test; +import org.junit.runners.MethodSorters; + +/** + * @author Jiaju Zhuang + */ +@FixMethodOrder(MethodSorters.NAME_ASCENDING) +public class FillStyleDataTest { + + private static File fileStyle07; + private static File fileStyle03; + private static File fileStyleHandler07; + private static File fileStyleHandler03; + private static File fileStyleTemplate07; + private static File fileStyleTemplate03; + + @BeforeClass + public static void init() { + fileStyle07 = TestFileUtil.createNewFile("fileStyle07.xlsx"); + fileStyle03 = TestFileUtil.createNewFile("fileStyle03.xls"); + fileStyleHandler07 = TestFileUtil.createNewFile("fileStyleHandler07.xlsx"); + fileStyleHandler03 = TestFileUtil.createNewFile("fileStyleHandler03.xls"); + fileStyleTemplate07 = TestFileUtil.readFile("fill" + File.separator + "style.xlsx"); + fileStyleTemplate03 = TestFileUtil.readFile("fill" + File.separator + "style.xls"); + } + + @Test + public void t01Fill07() throws Exception { + fill(fileStyle07, fileStyleTemplate07); + XSSFWorkbook workbook = new XSSFWorkbook(new FileInputStream(fileStyle07)); + XSSFSheet sheet = workbook.getSheetAt(0); + t01Fill07check(sheet.getRow(1)); + t01Fill07check(sheet.getRow(2)); + } + + private void t01Fill07check(XSSFRow row) { + XSSFCell cell0 = row.getCell(0); + Assert.assertEquals("张三", cell0.getStringCellValue()); + Assert.assertEquals(49, cell0.getCellStyle().getDataFormat()); + Assert.assertEquals("FF00B050", cell0.getCellStyle().getFillForegroundColorColor().getARGBHex()); + Assert.assertEquals("FF7030A0", cell0.getCellStyle().getFont().getXSSFColor().getARGBHex()); + Assert.assertTrue(cell0.getCellStyle().getFont().getBold()); + + XSSFCell cell1 = row.getCell(1); + Assert.assertEquals("5", cell1.getStringCellValue()); + Assert.assertEquals(0, cell1.getCellStyle().getDataFormat()); + Assert.assertEquals("FF92D050", cell1.getCellStyle().getFillForegroundColorColor().getARGBHex()); + Assert.assertEquals("FF4BACC6", cell1.getCellStyle().getFont().getXSSFColor().getARGBHex()); + Assert.assertFalse(cell1.getCellStyle().getFont().getBold()); + + XSSFCell cell2 = row.getCell(2); + Assert.assertEquals("2020-01-01 01:01:01", DateUtils.format(cell2.getDateCellValue(), "yyyy-MM-dd HH:mm:ss")); + Assert.assertEquals("yyyy-MM-dd HH:mm:ss", cell2.getCellStyle().getDataFormatString()); + Assert.assertEquals("FFFFC000", cell2.getCellStyle().getFillForegroundColorColor().getARGBHex()); + Assert.assertEquals("FFC0504D", cell2.getCellStyle().getFont().getXSSFColor().getARGBHex()); + Assert.assertTrue(cell2.getCellStyle().getFont().getBold()); + + XSSFCell cell3 = row.getCell(3); + Assert.assertEquals("张三今年5岁了", cell3.getStringCellValue()); + Assert.assertEquals(0, cell3.getCellStyle().getDataFormat()); + Assert.assertEquals("FFFF0000", cell3.getCellStyle().getFillForegroundColorColor().getARGBHex()); + Assert.assertEquals("FFEEECE1", cell3.getCellStyle().getFont().getXSSFColor().getARGBHex()); + Assert.assertTrue(cell3.getCellStyle().getFont().getBold()); + + XSSFCell cell4 = row.getCell(4); + Assert.assertEquals("{.name}忽略,张三", cell4.getStringCellValue()); + Assert.assertEquals(0, cell4.getCellStyle().getDataFormat()); + Assert.assertEquals("FFC00000", cell4.getCellStyle().getFillForegroundColorColor().getARGBHex()); + Assert.assertEquals("FF000000", cell4.getCellStyle().getFont().getXSSFColor().getARGBHex()); + Assert.assertFalse(cell4.getCellStyle().getFont().getBold()); + + XSSFCell cell5 = row.getCell(5); + Assert.assertEquals("空", cell5.getStringCellValue()); + Assert.assertEquals(0, cell5.getCellStyle().getDataFormat()); + Assert.assertEquals("FFF79646", cell5.getCellStyle().getFillForegroundColorColor().getARGBHex()); + Assert.assertEquals("FF8064A2", cell5.getCellStyle().getFont().getXSSFColor().getARGBHex()); + Assert.assertFalse(cell5.getCellStyle().getFont().getBold()); + } + + @Test + public void t02Fill03() throws Exception { + fill(fileStyle03, fileStyleTemplate03); + HSSFWorkbook workbook = new HSSFWorkbook(new FileInputStream(fileStyle03)); + HSSFSheet sheet = workbook.getSheetAt(0); + t02Fill03check(workbook, sheet.getRow(1)); + t02Fill03check(workbook, sheet.getRow(2)); + } + + private void t02Fill03check(HSSFWorkbook workbook, HSSFRow row) { + HSSFCell cell0 = row.getCell(0); + Assert.assertEquals("张三", cell0.getStringCellValue()); + Assert.assertEquals(49, cell0.getCellStyle().getDataFormat()); + Assert.assertEquals("0:8080:0", cell0.getCellStyle().getFillForegroundColorColor().getHexString()); + Assert.assertEquals("8080:0:8080", cell0.getCellStyle().getFont(workbook).getHSSFColor(workbook) + .getHexString()); + Assert.assertTrue(cell0.getCellStyle().getFont(workbook).getBold()); + + HSSFCell cell1 = row.getCell(1); + Assert.assertEquals("5", cell1.getStringCellValue()); + Assert.assertEquals(0, cell1.getCellStyle().getDataFormat()); + Assert.assertEquals("9999:CCCC:0", cell1.getCellStyle().getFillForegroundColorColor().getHexString()); + Assert.assertEquals("0:8080:8080", cell1.getCellStyle().getFont(workbook).getHSSFColor(workbook) + .getHexString()); + Assert.assertFalse(cell1.getCellStyle().getFont(workbook).getBold()); + + HSSFCell cell2 = row.getCell(2); + Assert.assertEquals("2020-01-01 01:01:01", DateUtils.format(cell2.getDateCellValue(), "yyyy-MM-dd HH:mm:ss")); + Assert.assertEquals("yyyy-MM-dd HH:mm:ss", cell2.getCellStyle().getDataFormatString()); + Assert.assertEquals("FFFF:CCCC:0", cell2.getCellStyle().getFillForegroundColorColor().getHexString()); + Assert.assertEquals("8080:0:0", cell2.getCellStyle().getFont(workbook).getHSSFColor(workbook).getHexString()); + Assert.assertTrue(cell2.getCellStyle().getFont(workbook).getBold()); + + HSSFCell cell3 = row.getCell(3); + Assert.assertEquals("张三今年5岁了", cell3.getStringCellValue()); + Assert.assertEquals(0, cell3.getCellStyle().getDataFormat()); + Assert.assertEquals("FFFF:0:0", cell3.getCellStyle().getFillForegroundColorColor().getHexString()); + Assert.assertEquals("FFFF:FFFF:9999", cell3.getCellStyle().getFont(workbook).getHSSFColor(workbook) + .getHexString()); + Assert.assertTrue(cell3.getCellStyle().getFont(workbook).getBold()); + + HSSFCell cell4 = row.getCell(4); + Assert.assertEquals("{.name}忽略,张三", cell4.getStringCellValue()); + Assert.assertEquals(0, cell4.getCellStyle().getDataFormat()); + Assert.assertEquals("9999:3333:0", cell4.getCellStyle().getFillForegroundColorColor().getHexString()); + Assert.assertEquals("3333:3333:3333", cell4.getCellStyle().getFont(workbook).getHSSFColor(workbook) + .getHexString()); + Assert.assertFalse(cell4.getCellStyle().getFont(workbook).getBold()); + + HSSFCell cell5 = row.getCell(5); + Assert.assertEquals("空", cell5.getStringCellValue()); + Assert.assertEquals(0, cell5.getCellStyle().getDataFormat()); + Assert.assertEquals("9999:3333:0", cell5.getCellStyle().getFillForegroundColorColor().getHexString()); + Assert.assertEquals("CCCC:9999:FFFF", cell5.getCellStyle().getFont(workbook).getHSSFColor(workbook) + .getHexString()); + Assert.assertFalse(cell5.getCellStyle().getFont(workbook).getBold()); + } + + private void fill(File file, File template) throws Exception { + EasyExcel.write(file, FillData.class).withTemplate(template).sheet().doFill(data()); + } + + @Test + public void t11FillStyleHandler07() throws Exception { + fillStyleHandler(fileStyleHandler07, fileStyleTemplate07); + XSSFWorkbook workbook = new XSSFWorkbook(new FileInputStream(fileStyleHandler07)); + XSSFSheet sheet = workbook.getSheetAt(0); + t11FillStyleHandler07check(sheet.getRow(1)); + t11FillStyleHandler07check(sheet.getRow(2)); + } + + private void t11FillStyleHandler07check(XSSFRow row) { + XSSFCell cell0 = row.getCell(0); + Assert.assertEquals("张三", cell0.getStringCellValue()); + Assert.assertEquals(49, cell0.getCellStyle().getDataFormat()); + Assert.assertEquals("FFFFFF00", cell0.getCellStyle().getFillForegroundColorColor().getARGBHex()); + Assert.assertEquals("FF808000", cell0.getCellStyle().getFont().getXSSFColor().getARGBHex()); + Assert.assertTrue(cell0.getCellStyle().getFont().getBold()); + + XSSFCell cell1 = row.getCell(1); + Assert.assertEquals("5", cell1.getStringCellValue()); + Assert.assertEquals(0, cell1.getCellStyle().getDataFormat()); + Assert.assertEquals("FFFF0000", cell1.getCellStyle().getFillForegroundColorColor().getARGBHex()); + Assert.assertEquals("FF800000", cell1.getCellStyle().getFont().getXSSFColor().getARGBHex()); + Assert.assertTrue(cell1.getCellStyle().getFont().getBold()); + + XSSFCell cell2 = row.getCell(2); + Assert.assertEquals("2020-01-01 01:01:01", DateUtils.format(cell2.getDateCellValue(), "yyyy-MM-dd HH:mm:ss")); + Assert.assertEquals("yyyy-MM-dd HH:mm:ss", cell2.getCellStyle().getDataFormatString()); + Assert.assertEquals("FF008000", cell2.getCellStyle().getFillForegroundColorColor().getARGBHex()); + Assert.assertEquals("FF003300", cell2.getCellStyle().getFont().getXSSFColor().getARGBHex()); + Assert.assertTrue(cell2.getCellStyle().getFont().getBold()); + + XSSFCell cell3 = row.getCell(3); + Assert.assertEquals("张三今年5岁了", cell3.getStringCellValue()); + Assert.assertEquals(0, cell3.getCellStyle().getDataFormat()); + Assert.assertEquals("FF0000FF", cell3.getCellStyle().getFillForegroundColorColor().getARGBHex()); + Assert.assertEquals("FF000080", cell3.getCellStyle().getFont().getXSSFColor().getARGBHex()); + Assert.assertTrue(cell3.getCellStyle().getFont().getBold()); + + XSSFCell cell4 = row.getCell(4); + Assert.assertEquals("{.name}忽略,张三", cell4.getStringCellValue()); + Assert.assertEquals(0, cell4.getCellStyle().getDataFormat()); + Assert.assertEquals("FFFFFF00", cell4.getCellStyle().getFillForegroundColorColor().getARGBHex()); + Assert.assertEquals("FF808000", cell4.getCellStyle().getFont().getXSSFColor().getARGBHex()); + Assert.assertTrue(cell4.getCellStyle().getFont().getBold()); + + XSSFCell cell5 = row.getCell(5); + Assert.assertEquals("空", cell5.getStringCellValue()); + Assert.assertEquals(0, cell5.getCellStyle().getDataFormat()); + Assert.assertEquals("FF008080", cell5.getCellStyle().getFillForegroundColorColor().getARGBHex()); + Assert.assertEquals("FF003366", cell5.getCellStyle().getFont().getXSSFColor().getARGBHex()); + Assert.assertTrue(cell5.getCellStyle().getFont().getBold()); + } + + + @Test + public void t12FillStyleHandler03() throws Exception { + fillStyleHandler(fileStyleHandler03, fileStyleTemplate03); + HSSFWorkbook workbook = new HSSFWorkbook(new FileInputStream(fileStyleHandler03)); + HSSFSheet sheet = workbook.getSheetAt(0); + t12FillStyleHandler03check(workbook, sheet.getRow(1)); + t12FillStyleHandler03check(workbook, sheet.getRow(2)); + } + + private void t12FillStyleHandler03check(HSSFWorkbook workbook, HSSFRow row) { + HSSFCell cell0 = row.getCell(0); + Assert.assertEquals("张三", cell0.getStringCellValue()); + Assert.assertEquals(49, cell0.getCellStyle().getDataFormat()); + Assert.assertEquals("FFFF:FFFF:0", cell0.getCellStyle().getFillForegroundColorColor().getHexString()); + Assert.assertEquals("8080:8080:0", cell0.getCellStyle().getFont(workbook).getHSSFColor(workbook) + .getHexString()); + Assert.assertTrue(cell0.getCellStyle().getFont(workbook).getBold()); + + HSSFCell cell1 = row.getCell(1); + Assert.assertEquals("5", cell1.getStringCellValue()); + Assert.assertEquals(0, cell1.getCellStyle().getDataFormat()); + Assert.assertEquals("FFFF:0:0", cell1.getCellStyle().getFillForegroundColorColor().getHexString()); + Assert.assertEquals("8080:0:0", cell1.getCellStyle().getFont(workbook).getHSSFColor(workbook) + .getHexString()); + Assert.assertTrue(cell1.getCellStyle().getFont(workbook).getBold()); + + HSSFCell cell2 = row.getCell(2); + Assert.assertEquals("2020-01-01 01:01:01", DateUtils.format(cell2.getDateCellValue(), "yyyy-MM-dd HH:mm:ss")); + Assert.assertEquals("yyyy-MM-dd HH:mm:ss", cell2.getCellStyle().getDataFormatString()); + Assert.assertEquals("0:8080:0", cell2.getCellStyle().getFillForegroundColorColor().getHexString()); + Assert.assertEquals("0:3333:0", cell2.getCellStyle().getFont(workbook).getHSSFColor(workbook).getHexString()); + Assert.assertTrue(cell2.getCellStyle().getFont(workbook).getBold()); + + HSSFCell cell3 = row.getCell(3); + Assert.assertEquals("张三今年5岁了", cell3.getStringCellValue()); + Assert.assertEquals(0, cell3.getCellStyle().getDataFormat()); + Assert.assertEquals("0:0:FFFF", cell3.getCellStyle().getFillForegroundColorColor().getHexString()); + Assert.assertEquals("0:0:8080", cell3.getCellStyle().getFont(workbook).getHSSFColor(workbook) + .getHexString()); + Assert.assertTrue(cell3.getCellStyle().getFont(workbook).getBold()); + + HSSFCell cell4 = row.getCell(4); + Assert.assertEquals("{.name}忽略,张三", cell4.getStringCellValue()); + Assert.assertEquals(0, cell4.getCellStyle().getDataFormat()); + Assert.assertEquals("FFFF:FFFF:0", cell4.getCellStyle().getFillForegroundColorColor().getHexString()); + Assert.assertEquals("8080:8080:0", cell4.getCellStyle().getFont(workbook).getHSSFColor(workbook) + .getHexString()); + Assert.assertTrue(cell4.getCellStyle().getFont(workbook).getBold()); + + HSSFCell cell5 = row.getCell(5); + Assert.assertEquals("空", cell5.getStringCellValue()); + Assert.assertEquals(0, cell5.getCellStyle().getDataFormat()); + Assert.assertEquals("0:8080:8080", cell5.getCellStyle().getFillForegroundColorColor().getHexString()); + Assert.assertEquals("0:3333:6666", cell5.getCellStyle().getFont(workbook).getHSSFColor(workbook) + .getHexString()); + Assert.assertTrue(cell5.getCellStyle().getFont(workbook).getBold()); + } + + private void fillStyleHandler(File file, File template) throws Exception { + EasyExcel.write(file, FillData.class).withTemplate(template).sheet() + .registerWriteHandler(new AbstractVerticalCellStyleStrategy() { + + @Override + protected WriteCellStyle contentCellStyle(CellWriteHandlerContext context) { + WriteCellStyle writeCellStyle = new WriteCellStyle(); + WriteFont writeFont = new WriteFont(); + writeCellStyle.setWriteFont(writeFont); + writeCellStyle.setFillPatternType(FillPatternType.SOLID_FOREGROUND); + writeFont.setBold(true); + if (context.getColumnIndex() == 0) { + writeCellStyle.setFillForegroundColor(IndexedColors.YELLOW.getIndex()); + writeFont.setColor(IndexedColors.DARK_YELLOW.getIndex()); + } + if (context.getColumnIndex() == 1) { + writeCellStyle.setFillForegroundColor(IndexedColors.RED.getIndex()); + writeFont.setColor(IndexedColors.DARK_RED.getIndex()); + } + if (context.getColumnIndex() == 2) { + writeCellStyle.setFillForegroundColor(IndexedColors.GREEN.getIndex()); + writeFont.setColor(IndexedColors.DARK_GREEN.getIndex()); + } + if (context.getColumnIndex() == 3) { + writeCellStyle.setFillForegroundColor(IndexedColors.BLUE.getIndex()); + writeFont.setColor(IndexedColors.DARK_BLUE.getIndex()); + } + if (context.getColumnIndex() == 4) { + writeCellStyle.setFillForegroundColor(IndexedColors.YELLOW.getIndex()); + writeFont.setColor(IndexedColors.DARK_YELLOW.getIndex()); + } + if (context.getColumnIndex() == 5) { + writeCellStyle.setFillForegroundColor(IndexedColors.TEAL.getIndex()); + writeFont.setColor(IndexedColors.DARK_TEAL.getIndex()); + } + return writeCellStyle; + } + + @Override + protected WriteCellStyle headCellStyle(Head head) { + return null; + } + + }) + .doFill(data()); + } + + private List data() throws Exception { + List list = ListUtils.newArrayList(); + for (int i = 0; i < 10; i++) { + FillStyleData fillData = new FillStyleData(); + list.add(fillData); + fillData.setName("张三"); + fillData.setNumber(5.2); + fillData.setDate(DateUtils.parseDate("2020-01-01 01:01:01")); + if (i == 5) { + fillData.setName(null); + } + } + return list; + } + +} diff --git a/src/test/java/com/alibaba/easyexcel/test/temp/poi/PoiWriteTest.java b/src/test/java/com/alibaba/easyexcel/test/temp/poi/PoiWriteTest.java index fa417049..59330bbd 100644 --- a/src/test/java/com/alibaba/easyexcel/test/temp/poi/PoiWriteTest.java +++ b/src/test/java/com/alibaba/easyexcel/test/temp/poi/PoiWriteTest.java @@ -1,10 +1,15 @@ package com.alibaba.easyexcel.test.temp.poi; +import java.io.BufferedInputStream; import java.io.FileOutputStream; import java.io.IOException; +import java.io.InputStream; import java.math.BigDecimal; +import java.net.URL; import java.util.regex.Pattern; +import com.alibaba.fastjson.JSON; + import org.apache.poi.xssf.streaming.SXSSFCell; import org.apache.poi.xssf.streaming.SXSSFRow; import org.apache.poi.xssf.streaming.SXSSFSheet; @@ -14,8 +19,6 @@ import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.alibaba.fastjson.JSON; - /** * 测试poi * @@ -104,4 +107,14 @@ public class PoiWriteTest { } + @Test + public void part4() throws IOException { + //URL url=new URL("http://120.55.161.4/group1/M00/00/00/i8QJ8WFfwMiAXKYrAAACqC1MFiY641.png"); + URL url=new URL("https://img-blog.csdn.net/20160729002743309?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center"); + + InputStream in = new BufferedInputStream(url.openStream()); + + + } + } diff --git a/src/test/resources/fill/simple.csv b/src/test/resources/fill/simple.csv new file mode 100644 index 00000000..a5153481 --- /dev/null +++ b/src/test/resources/fill/simple.csv @@ -0,0 +1,2 @@ +姓名,数字,复杂,忽略,空 +{name},{number},{name}今年{number}岁了,\{name\}忽略,{name},空{.empty} \ No newline at end of file diff --git a/src/test/resources/fill/style.xls b/src/test/resources/fill/style.xls new file mode 100644 index 0000000000000000000000000000000000000000..9e7ca73971419c9ef6aba3643a8b5fbc236ff734 GIT binary patch literal 27648 zcmeHQ30O_r+h6B&s?#J5(m)-ll+v6cDMJ)x9QI;CGh*Q-s`y7(vF7CWM41j7m;QNs3Js^^T2A7$p`BOc5uG{zIWNB||h1WvBqd z3*c!H9?&#MK3t861tpy^bv2=`JE^hhWP~F{h;Z_+BiO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kR#fWNQhV3Cj>v;sD#1=`-mY8 z2JXpZG<>0la!`LZg30=>U-%z@r2J8a@2Uiag3y@-K@+~w#4iNLz?XyA_E6A5EF}|C zQsJx3B%r7cj=&$s5RRYk<=+zFaPUCTgm*2I$S6t%G1UVNlgIDB(SB!ST*v>v0FDxi Ay#N3J literal 0 HcmV?d00001 diff --git a/src/test/resources/fill/style.xlsx b/src/test/resources/fill/style.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..234c3b30852827f436ef2d7157903f8b69f8cda4 GIT binary patch literal 11114 zcmeHtbyQsWvUTI`8r+@6Aq001(6}VHySuv+G`LG}2ol_#pn)L4Nq`_7g8S=a?)@f{ znfLww*1cz~bGm!=slATus`~A!Qc-|`#Rb3v5CH%HC18WG<%J6r06+>40N?-+q4gvj z>|M?5T@BQ|9L-!_06pz&DGFhs8S(+pkn{h${RcmRiIf*MeeAg5V1!!?+LofYXM`r& zor}Yt=_c+2tN5FGeP7|^Jly6;lbX0jGuZN>**ULW?#q2gA7(CkOAD($nO0?RrVZch z3|i6|T`N_-W*uioW)5@5mv4qQ-Jbb8=-74<_(VgGMF*#-dz+*ZKDMXNtBzZ(-B7al zBm4GCbr%j8;k|Qv&(F57#HWkabu-_ftm~&aeDr5_(c}PeEbZ$oww>~H9Um*OU&&t2 zj*$be7Yg#n8sUjQpG310f?X{w{P`9aI#q0flM;SH=FHv8^YTfOQHibH1S zn<_-xtc}WH;BElo#xR(1z*%j=g2Q;9gaF-GL9~0WkjBUK(1abrJDm6fk*!GAhoG|E zeZ3@8bX&ks6TILhhhkwwHZhiH*N~{3lY1a|`S$4^nNsknY!vp!74VR%sCrTeNh}h% zOT6gdyB|M@DCd*A<>~Wa!G(5RL)R~+w{eOQ{K}icH?RP}<0A|}M zowEC%^ zNyFEPRNiwBPRb$*xWE(&Uv*q}@bW3uT8(=!f9J{45fgz*Uz0cbN+suGK(zIcjFgahY51+y{b`(pw-~@cikoMhW@8HBJ)3#?D zExhEY7c!aDn&QKrTx+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!4-&^<^8AN?oWP*5d)8Y7p`Q>WRbu{1KO;xS|FZAj+=IleWHEb4S5)c}&KV)- z_I1Mx*f22;h9q1a?s6!BrMDkOsN|EOEvOcS6!>1??xD4PwIj+O-jfw4X_ez!eLwMd zf3UzgM#z|HSG0s=T~BN^{z&0kt^rzb9_`1oCVy%@C*ZFD%l6gTGkoHFi|9i zLs(EKsyI9-j57;$JWq}I>p+8zJOg&iBib61eP)f9dWbX@UjB4OGMMrV%2^WmgxCbE z_YRg%?1m#e4*dFibUW>cz*UsOC0$OuQn7eud_!%bSO>R zf2v63Ap>6Fv~iM&jg|$q!OvAYSm}#b>*_WdGM1vQTD;s)G$lt9N6?I1ps|4FFti}f z?7Bb$&0>gj-QQe)zWfN5ZxEiiakeG>c-)kG2@i~qd(qR=+sCoF{0iYtg;lALAaK`Y zBiE>h)KQZMpfv1@F#9s|UXMt2xa{lYfNua+r^hDF8t;Lp6(Sjdzo2^MG7ZCZJUW3h zVY$tk+xHhEQg(gtV=_}N1wITO{pvx3T1;d{Rlw|*S9Y5v6?ss3 z0Ju;90ROOL{2k!0D}`SHYN>t&_}9AOck{nS`d`g~w7;1DEAFc(z(J_`qX&ToP=c@> Jf#Jum{{ex!y0!oS literal 0 HcmV?d00001 diff --git a/update.md b/update.md index c1a7efd8..ca31cb5b 100644 --- a/update.md +++ b/update.md @@ -1,6 +1,7 @@ # 3.0.1 * 升级到正式版 * 修复填充样式可能丢失的问题 [Issue #2124](https://github.com/alibaba/easyexcel/issues/2124) +* 修复填充数据为空 可能NPE的bug # 3.0.0-beta3