From 8c697950a53e97e772b07d5fbfbfb5e66bc1871e Mon Sep 17 00:00:00 2001 From: zhuangjiaju Date: Mon, 19 Aug 2019 16:39:13 +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/ExcelReader.java | 2 +- .../excel/analysis/ExcelAnalyserImpl.java | 16 +- .../excel/analysis/v03/XlsSaxAnalyser.java | 3 + .../v03/handlers/NumberRecordHandler.java | 2 + .../v07/SharedStringsTableHandler.java | 21 ++- .../analysis/v07/XlsxHandlerFactory.java | 8 +- .../excel/analysis/v07/XlsxRowHandler.java | 5 +- .../excel/analysis/v07/XlsxSaxAnalyser.java | 13 +- .../v07/handlers/DefaultCellHandler.java | 26 +++- .../excel/constant/ExcelXmlConstants.java | 4 + .../excel/context/WriteContextImpl.java | 35 +++-- .../string/StringNumberConverter.java | 14 ++ .../com/alibaba/excel/metadata/CellData.java | 26 ++++ .../alibaba/excel/write/ExcelBuilderImpl.java | 4 +- .../core/converter/ConverterDataTest.java | 2 +- .../core/converter/ReadAllConverterData.java | 1 + .../ReadAllConverterDataListener.java | 1 + .../easyexcel/test/temp/StyleTest.java | 138 ++++++++++++++++++ .../test/temp/poi/PoiFormatTest.java | 53 +++++++ src/test/resources/converter/converter03.xls | Bin 20480 -> 20992 bytes src/test/resources/converter/converter07.xlsx | Bin 10692 -> 10693 bytes src/test/resources/simple/simple07.xlsx | Bin 10048 -> 10144 bytes update.md | 1 + 23 files changed, 342 insertions(+), 33 deletions(-) create mode 100644 src/test/java/com/alibaba/easyexcel/test/temp/StyleTest.java create mode 100644 src/test/java/com/alibaba/easyexcel/test/temp/poi/PoiFormatTest.java diff --git a/src/main/java/com/alibaba/excel/ExcelReader.java b/src/main/java/com/alibaba/excel/ExcelReader.java index 07378d2..4fcb3ca 100644 --- a/src/main/java/com/alibaba/excel/ExcelReader.java +++ b/src/main/java/com/alibaba/excel/ExcelReader.java @@ -285,7 +285,7 @@ public class ExcelReader { } try { excelAnalyser.finish(); - } catch (Exception e) { + } catch (Throwable e) { LOGGER.warn("Destroy object failed", e); } } diff --git a/src/main/java/com/alibaba/excel/analysis/ExcelAnalyserImpl.java b/src/main/java/com/alibaba/excel/analysis/ExcelAnalyserImpl.java index b24a182..c081818 100644 --- a/src/main/java/com/alibaba/excel/analysis/ExcelAnalyserImpl.java +++ b/src/main/java/com/alibaba/excel/analysis/ExcelAnalyserImpl.java @@ -1,7 +1,5 @@ package com.alibaba.excel.analysis; -import java.io.IOException; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -34,7 +32,7 @@ public class ExcelAnalyserImpl implements ExcelAnalyser { } catch (RuntimeException e) { finish(); throw e; - } catch (Exception e) { + } catch (Throwable e) { finish(); throw new ExcelAnalysisException(e); } @@ -72,7 +70,7 @@ public class ExcelAnalyserImpl implements ExcelAnalyser { } catch (RuntimeException e) { finish(); throw e; - } catch (Exception e) { + } catch (Throwable e) { finish(); throw new ExcelAnalysisException(e); } @@ -88,14 +86,22 @@ public class ExcelAnalyserImpl implements ExcelAnalyser { if (readWorkbookHolder.getReadCache() != null) { readWorkbookHolder.getReadCache().destroy(); } + } catch (Throwable e) { + throw new ExcelAnalysisException("Can not close IO", e); + } + try { if (analysisContext.readWorkbookHolder().getAutoCloseStream() && readWorkbookHolder.getInputStream() != null) { readWorkbookHolder.getInputStream().close(); } + } catch (Throwable e) { + throw new ExcelAnalysisException("Can not close IO", e); + } + try { if (readWorkbookHolder.getTempFile() != null) { FileUtils.delete(readWorkbookHolder.getTempFile()); } - } catch (IOException e) { + } catch (Throwable e) { throw new ExcelAnalysisException("Can not close IO", e); } } diff --git a/src/main/java/com/alibaba/excel/analysis/v03/XlsSaxAnalyser.java b/src/main/java/com/alibaba/excel/analysis/v03/XlsSaxAnalyser.java index 9275436..8df8bfd 100644 --- a/src/main/java/com/alibaba/excel/analysis/v03/XlsSaxAnalyser.java +++ b/src/main/java/com/alibaba/excel/analysis/v03/XlsSaxAnalyser.java @@ -14,7 +14,10 @@ import org.apache.poi.hssf.eventusermodel.HSSFListener; import org.apache.poi.hssf.eventusermodel.HSSFRequest; import org.apache.poi.hssf.eventusermodel.MissingRecordAwareHSSFListener; import org.apache.poi.hssf.eventusermodel.dummyrecord.LastCellOfRowDummyRecord; +import org.apache.poi.hssf.record.ExtendedFormatRecord; import org.apache.poi.hssf.record.Record; +import org.apache.poi.hssf.record.StyleRecord; +import org.apache.poi.hssf.usermodel.HSSFCellStyle; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.poifs.filesystem.POIFSFileSystem; diff --git a/src/main/java/com/alibaba/excel/analysis/v03/handlers/NumberRecordHandler.java b/src/main/java/com/alibaba/excel/analysis/v03/handlers/NumberRecordHandler.java index b18a89e..23aff5a 100644 --- a/src/main/java/com/alibaba/excel/analysis/v03/handlers/NumberRecordHandler.java +++ b/src/main/java/com/alibaba/excel/analysis/v03/handlers/NumberRecordHandler.java @@ -30,6 +30,8 @@ public class NumberRecordHandler extends AbstractXlsRecordHandler { this.row = numrec.getRow(); this.column = numrec.getColumn(); this.cellData = new CellData(numrec.getValue()); + this.cellData.setDataFormat(formatListener.getFormatIndex(numrec)); + this.cellData.setDataFormatString(formatListener.getFormatString(numrec)); } @Override diff --git a/src/main/java/com/alibaba/excel/analysis/v07/SharedStringsTableHandler.java b/src/main/java/com/alibaba/excel/analysis/v07/SharedStringsTableHandler.java index de924c9..9d228d2 100644 --- a/src/main/java/com/alibaba/excel/analysis/v07/SharedStringsTableHandler.java +++ b/src/main/java/com/alibaba/excel/analysis/v07/SharedStringsTableHandler.java @@ -1,5 +1,6 @@ package com.alibaba.excel.analysis.v07; +import org.xml.sax.Attributes; import org.xml.sax.helpers.DefaultHandler; import com.alibaba.excel.cache.ReadCache; @@ -11,22 +12,40 @@ import com.alibaba.excel.cache.ReadCache; */ public class SharedStringsTableHandler extends DefaultHandler { private static final String T_TAG = "t"; + private static final String SI_TAG = "si"; + /** + * The final piece of data + */ private String currentData; + /** + * Current element data + */ + private String currentElementData; + private ReadCache readCache; public SharedStringsTableHandler(ReadCache readCache) { this.readCache = readCache; } + @Override + public void startElement(String uri, String localName, String name, Attributes attributes) { + if (SI_TAG.equals(name)) { + currentData = ""; + } + } + @Override public void endElement(String uri, String localName, String name) { if (T_TAG.equals(name)) { + currentData += currentElementData; + } else if (SI_TAG.equals(name)) { readCache.put(currentData); } } @Override public void characters(char[] ch, int start, int length) { - currentData = new String(ch, start, length); + currentElementData = new String(ch, start, length); } } diff --git a/src/main/java/com/alibaba/excel/analysis/v07/XlsxHandlerFactory.java b/src/main/java/com/alibaba/excel/analysis/v07/XlsxHandlerFactory.java index 7fd1dc1..82f7d2c 100644 --- a/src/main/java/com/alibaba/excel/analysis/v07/XlsxHandlerFactory.java +++ b/src/main/java/com/alibaba/excel/analysis/v07/XlsxHandlerFactory.java @@ -3,6 +3,8 @@ package com.alibaba.excel.analysis.v07; import java.util.ArrayList; import java.util.List; +import org.apache.poi.xssf.model.StylesTable; + import com.alibaba.excel.analysis.v07.handlers.CountRowCellHandler; import com.alibaba.excel.analysis.v07.handlers.DefaultCellHandler; import com.alibaba.excel.analysis.v07.handlers.ProcessResultCellHandler; @@ -10,14 +12,14 @@ import com.alibaba.excel.context.AnalysisContext; /** * Build handler - * + * * @author Dan Zheng */ public class XlsxHandlerFactory { - public static List buildCellHandlers(AnalysisContext analysisContext) { + public static List buildCellHandlers(AnalysisContext analysisContext, StylesTable stylesTable) { List result = new ArrayList(); result.add(new CountRowCellHandler(analysisContext)); - DefaultCellHandler defaultCellHandler = new DefaultCellHandler(analysisContext); + DefaultCellHandler defaultCellHandler = new DefaultCellHandler(analysisContext, stylesTable); result.add(defaultCellHandler); result.add(new ProcessResultCellHandler(analysisContext, defaultCellHandler)); return result; diff --git a/src/main/java/com/alibaba/excel/analysis/v07/XlsxRowHandler.java b/src/main/java/com/alibaba/excel/analysis/v07/XlsxRowHandler.java index 1a1bbee..8306fc1 100644 --- a/src/main/java/com/alibaba/excel/analysis/v07/XlsxRowHandler.java +++ b/src/main/java/com/alibaba/excel/analysis/v07/XlsxRowHandler.java @@ -2,6 +2,7 @@ package com.alibaba.excel.analysis.v07; import java.util.List; +import org.apache.poi.xssf.model.StylesTable; import org.xml.sax.Attributes; import org.xml.sax.SAXException; import org.xml.sax.helpers.DefaultHandler; @@ -17,8 +18,8 @@ public class XlsxRowHandler extends DefaultHandler { private List cellHandlers; private XlsxRowResultHolder rowResultHolder; - public XlsxRowHandler(AnalysisContext analysisContext) { - this.cellHandlers = XlsxHandlerFactory.buildCellHandlers(analysisContext); + public XlsxRowHandler(AnalysisContext analysisContext, StylesTable stylesTable) { + this.cellHandlers = XlsxHandlerFactory.buildCellHandlers(analysisContext, stylesTable); for (XlsxCellHandler cellHandler : cellHandlers) { if (cellHandler instanceof XlsxRowResultHolder) { this.rowResultHolder = (XlsxRowResultHolder)cellHandler; diff --git a/src/main/java/com/alibaba/excel/analysis/v07/XlsxSaxAnalyser.java b/src/main/java/com/alibaba/excel/analysis/v07/XlsxSaxAnalyser.java index d7aaea9..bda0e76 100644 --- a/src/main/java/com/alibaba/excel/analysis/v07/XlsxSaxAnalyser.java +++ b/src/main/java/com/alibaba/excel/analysis/v07/XlsxSaxAnalyser.java @@ -15,6 +15,7 @@ import javax.xml.parsers.SAXParserFactory; import org.apache.poi.openxml4j.opc.OPCPackage; import org.apache.poi.openxml4j.opc.PackagePart; import org.apache.poi.xssf.eventusermodel.XSSFReader; +import org.apache.poi.xssf.model.StylesTable; import org.apache.poi.xssf.usermodel.XSSFRelation; import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorkbook; import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorkbookPr; @@ -47,6 +48,10 @@ public class XlsxSaxAnalyser implements ExcelExecutor { private AnalysisContext analysisContext; private List sheetList; private Map sheetMap; + /** + * Current style information + */ + private StylesTable stylesTable; public XlsxSaxAnalyser(AnalysisContext analysisContext) throws Exception { this.analysisContext = analysisContext; @@ -64,9 +69,9 @@ public class XlsxSaxAnalyser implements ExcelExecutor { analysisSharedStringsTable(sharedStringsTablePackagePart.getInputStream(), readWorkbookHolder); XSSFReader xssfReader = new XSSFReader(pkg); - analysisUse1904WindowDate(xssfReader, readWorkbookHolder); + stylesTable = xssfReader.getStylesTable(); sheetList = new ArrayList(); sheetMap = new HashMap(); XSSFReader.SheetIterator ite = (XSSFReader.SheetIterator)xssfReader.getSheetsData(); @@ -94,12 +99,12 @@ public class XlsxSaxAnalyser implements ExcelExecutor { } if (size < USE_MAP_CACHE_SIZE) { if (LOGGER.isDebugEnabled()) { - LOGGER.info("Use map cache.size:{}", size); + LOGGER.debug("Use map cache.size:{}", size); } readWorkbookHolder.setReadCache(new MapCache()); } else { if (LOGGER.isDebugEnabled()) { - LOGGER.info("Use ehcache.size:{}", size); + LOGGER.debug("Use ehcache.size:{}", size); } readWorkbookHolder.setReadCache(new Ehcache()); } @@ -178,7 +183,7 @@ public class XlsxSaxAnalyser implements ExcelExecutor { @Override public void execute() { parseXmlSource(sheetMap.get(analysisContext.readSheetHolder().getSheetNo()), - new XlsxRowHandler(analysisContext)); + new XlsxRowHandler(analysisContext, stylesTable)); } } diff --git a/src/main/java/com/alibaba/excel/analysis/v07/handlers/DefaultCellHandler.java b/src/main/java/com/alibaba/excel/analysis/v07/handlers/DefaultCellHandler.java index ba890bd..671693b 100644 --- a/src/main/java/com/alibaba/excel/analysis/v07/handlers/DefaultCellHandler.java +++ b/src/main/java/com/alibaba/excel/analysis/v07/handlers/DefaultCellHandler.java @@ -1,5 +1,6 @@ package com.alibaba.excel.analysis.v07.handlers; +import static com.alibaba.excel.constant.ExcelXmlConstants.CELL_DATA_FORMAT_TAG; import static com.alibaba.excel.constant.ExcelXmlConstants.CELL_FORMULA_TAG; import static com.alibaba.excel.constant.ExcelXmlConstants.CELL_INLINE_STRING_VALUE_TAG; import static com.alibaba.excel.constant.ExcelXmlConstants.CELL_TAG; @@ -9,6 +10,9 @@ import static com.alibaba.excel.constant.ExcelXmlConstants.CELL_VALUE_TYPE_TAG; import java.util.Map; import java.util.TreeMap; +import org.apache.poi.ss.usermodel.BuiltinFormats; +import org.apache.poi.xssf.model.StylesTable; +import org.apache.poi.xssf.usermodel.XSSFCellStyle; import org.apache.poi.xssf.usermodel.XSSFRichTextString; import org.xml.sax.Attributes; @@ -36,9 +40,14 @@ public class DefaultCellHandler implements XlsxCellHandler, XlsxRowResultHolder private int curCol; private Map curRowContent = new TreeMap(); private CellData currentCellData; + /** + * Current style information + */ + private StylesTable stylesTable; - public DefaultCellHandler(AnalysisContext analysisContext) { + public DefaultCellHandler(AnalysisContext analysisContext, StylesTable stylesTable) { this.analysisContext = analysisContext; + this.stylesTable = stylesTable; } @Override @@ -75,6 +84,21 @@ public class DefaultCellHandler implements XlsxCellHandler, XlsxRowResultHolder // t is null ,it's means Empty or Number CellDataTypeEnum type = CellDataTypeEnum.buildFromCellType(attributes.getValue(CELL_VALUE_TYPE_TAG)); currentCellData = new CellData(type); + + // Put in data transformation information + String dateFormatIndex = attributes.getValue(CELL_DATA_FORMAT_TAG); + if (dateFormatIndex != null) { + int dateFormatIndexInteger = Integer.parseInt(dateFormatIndex); + XSSFCellStyle xssfCellStyle = stylesTable.getStyleAt(dateFormatIndexInteger); + int dataFormat = xssfCellStyle.getDataFormat(); + String dataFormatString = xssfCellStyle.getDataFormatString(); + currentCellData.setDataFormat(dataFormat); + if (dataFormatString == null) { + currentCellData.setDataFormatString(BuiltinFormats.getBuiltinFormat(dataFormat)); + } else { + currentCellData.setDataFormatString(dataFormatString); + } + } } // cell is formula if (CELL_FORMULA_TAG.equals(name)) { diff --git a/src/main/java/com/alibaba/excel/constant/ExcelXmlConstants.java b/src/main/java/com/alibaba/excel/constant/ExcelXmlConstants.java index 55d522f..f01a33b 100644 --- a/src/main/java/com/alibaba/excel/constant/ExcelXmlConstants.java +++ b/src/main/java/com/alibaba/excel/constant/ExcelXmlConstants.java @@ -11,6 +11,10 @@ public class ExcelXmlConstants { public static final String ROW_TAG = "row"; public static final String CELL_TAG = "c"; public static final String CELL_VALUE_TYPE_TAG = "t"; + /** + * Number formatted label + */ + public static final String CELL_DATA_FORMAT_TAG = "s"; public static final String CELL_FORMULA_TAG = "f"; public static final String CELL_VALUE_TAG = "v"; /** diff --git a/src/main/java/com/alibaba/excel/context/WriteContextImpl.java b/src/main/java/com/alibaba/excel/context/WriteContextImpl.java index ff2215e..ebe0d26 100644 --- a/src/main/java/com/alibaba/excel/context/WriteContextImpl.java +++ b/src/main/java/com/alibaba/excel/context/WriteContextImpl.java @@ -1,6 +1,5 @@ package com.alibaba.excel.context; -import java.io.IOException; import java.io.OutputStream; import java.util.List; import java.util.Map; @@ -347,19 +346,29 @@ public class WriteContextImpl implements WriteContext { try { writeWorkbookHolder.getWorkbook().write(writeWorkbookHolder.getOutputStream()); writeWorkbookHolder.getWorkbook().close(); - if (writeWorkbookHolder.getAutoCloseStream()) { - if (writeWorkbookHolder.getOutputStream() != null) { - writeWorkbookHolder.getOutputStream().close(); - } - if (writeWorkbookHolder.getTemplateInputStream() != null) { - writeWorkbookHolder.getTemplateInputStream().close(); - } - } else { - if (writeWorkbookHolder.getFile() != null && writeWorkbookHolder.getOutputStream() != null) { - writeWorkbookHolder.getOutputStream().close(); - } + } catch (Throwable e) { + throw new ExcelGenerateException("Can not close IO", e); + } + try { + if (writeWorkbookHolder.getAutoCloseStream() && writeWorkbookHolder.getOutputStream() != null) { + writeWorkbookHolder.getOutputStream().close(); + } + } catch (Throwable e) { + throw new ExcelGenerateException("Can not close IO", e); + } + try { + if (writeWorkbookHolder.getAutoCloseStream() && writeWorkbookHolder.getTemplateInputStream() != null) { + writeWorkbookHolder.getTemplateInputStream().close(); + } + } catch (Throwable e) { + throw new ExcelGenerateException("Can not close IO", e); + } + try { + if (!writeWorkbookHolder.getAutoCloseStream() && writeWorkbookHolder.getFile() != null + && writeWorkbookHolder.getOutputStream() != null) { + writeWorkbookHolder.getOutputStream().close(); } - } catch (IOException e) { + } catch (Throwable e) { throw new ExcelGenerateException("Can not close IO", e); } if (LOGGER.isDebugEnabled()) { diff --git a/src/main/java/com/alibaba/excel/converters/string/StringNumberConverter.java b/src/main/java/com/alibaba/excel/converters/string/StringNumberConverter.java index 934135e..62b2523 100644 --- a/src/main/java/com/alibaba/excel/converters/string/StringNumberConverter.java +++ b/src/main/java/com/alibaba/excel/converters/string/StringNumberConverter.java @@ -1,6 +1,7 @@ package com.alibaba.excel.converters.string; import org.apache.poi.hssf.usermodel.HSSFDateUtil; +import org.apache.poi.ss.usermodel.DateUtil; import com.alibaba.excel.converters.Converter; import com.alibaba.excel.enums.CellDataTypeEnum; @@ -38,6 +39,19 @@ public class StringNumberConverter implements Converter { contentProperty.getDateTimeFormatProperty().getFormat()); } // If there are "NumberFormat", read as number + if (contentProperty != null && contentProperty.getNumberFormatProperty() != null) { + return NumberUtils.format(cellData.getDoubleValue(), contentProperty); + } + // Excel defines formatting + if (cellData.getDataFormat() != null) { + if (DateUtil.isADateFormat(cellData.getDataFormat(), cellData.getDataFormatString())) { + return DateUtils.format(HSSFDateUtil.getJavaDate(cellData.getDoubleValue(), + globalConfiguration.getUse1904windowing(), null)); + } else { + return NumberUtils.format(cellData.getDoubleValue(), contentProperty); + } + } + // Default conversion number return NumberUtils.format(cellData.getDoubleValue(), contentProperty); } diff --git a/src/main/java/com/alibaba/excel/metadata/CellData.java b/src/main/java/com/alibaba/excel/metadata/CellData.java index 03fee7a..e03a883 100644 --- a/src/main/java/com/alibaba/excel/metadata/CellData.java +++ b/src/main/java/com/alibaba/excel/metadata/CellData.java @@ -23,6 +23,14 @@ public class CellData { private Boolean booleanValue; private Boolean formula; private String formulaValue; + /** + * The number formatting + */ + private Integer dataFormat; + /** + * The string of number formatting + */ + private String dataFormatString; public CellData(CellData other) { this.type = other.type; @@ -31,6 +39,8 @@ public class CellData { this.booleanValue = other.booleanValue; this.formula = other.formula; this.formulaValue = other.formulaValue; + this.dataFormat = other.dataFormat; + this.dataFormatString = other.dataFormatString; } public CellData(String stringValue) { @@ -123,6 +133,22 @@ public class CellData { this.formulaValue = formulaValue; } + public Integer getDataFormat() { + return dataFormat; + } + + public void setDataFormat(Integer dataFormat) { + this.dataFormat = dataFormat; + } + + public String getDataFormatString() { + return dataFormatString; + } + + public void setDataFormatString(String dataFormatString) { + this.dataFormatString = dataFormatString; + } + @Override public String toString() { switch (type) { diff --git a/src/main/java/com/alibaba/excel/write/ExcelBuilderImpl.java b/src/main/java/com/alibaba/excel/write/ExcelBuilderImpl.java index 25dee19..970fd3c 100644 --- a/src/main/java/com/alibaba/excel/write/ExcelBuilderImpl.java +++ b/src/main/java/com/alibaba/excel/write/ExcelBuilderImpl.java @@ -51,7 +51,7 @@ public class ExcelBuilderImpl implements ExcelBuilder { } catch (RuntimeException e) { finish(); throw e; - } catch (Exception e) { + } catch (Throwable e) { finish(); throw new ExcelGenerateException(e); } @@ -88,7 +88,7 @@ public class ExcelBuilderImpl implements ExcelBuilder { } catch (RuntimeException e) { finish(); throw e; - } catch (Exception e) { + } catch (Throwable e) { finish(); throw new ExcelGenerateException(e); } diff --git a/src/test/java/com/alibaba/easyexcel/test/core/converter/ConverterDataTest.java b/src/test/java/com/alibaba/easyexcel/test/core/converter/ConverterDataTest.java index 5e6978e..85f5f39 100644 --- a/src/test/java/com/alibaba/easyexcel/test/core/converter/ConverterDataTest.java +++ b/src/test/java/com/alibaba/easyexcel/test/core/converter/ConverterDataTest.java @@ -53,7 +53,7 @@ public class ConverterDataTest { } @Test - public void T03ReadAllConverter03() { + public void T04ReadAllConverter03() { readAllConverter("converter" + File.separator + "converter03.xls"); } diff --git a/src/test/java/com/alibaba/easyexcel/test/core/converter/ReadAllConverterData.java b/src/test/java/com/alibaba/easyexcel/test/core/converter/ReadAllConverterData.java index 6ff280e..4f758a0 100644 --- a/src/test/java/com/alibaba/easyexcel/test/core/converter/ReadAllConverterData.java +++ b/src/test/java/com/alibaba/easyexcel/test/core/converter/ReadAllConverterData.java @@ -42,4 +42,5 @@ public class ReadAllConverterData { private String stringError; private String stringFormulaNumber; private String stringFormulaString; + private String stringNumberDate; } diff --git a/src/test/java/com/alibaba/easyexcel/test/core/converter/ReadAllConverterDataListener.java b/src/test/java/com/alibaba/easyexcel/test/core/converter/ReadAllConverterDataListener.java index d756a69..f4f0a1e 100644 --- a/src/test/java/com/alibaba/easyexcel/test/core/converter/ReadAllConverterDataListener.java +++ b/src/test/java/com/alibaba/easyexcel/test/core/converter/ReadAllConverterDataListener.java @@ -64,6 +64,7 @@ public class ReadAllConverterDataListener extends AnalysisEventListener list = EasyExcel.read("D:\\test\\styleTest.xls").sheet().headRowNumber(0).doReadSync(); + for (Object data : list) { + LOGGER.info("返回数据:{}", JSON.toJSONString(data)); + } + } + + @Test + public void poi() throws Exception { + InputStream is = new FileInputStream("D:\\test\\styleTest.xls"); + HSSFWorkbook hssfWorkbook = new HSSFWorkbook(is); + HSSFSheet hssfSheet = hssfWorkbook.getSheetAt(0); + HSSFRow hssfRow = hssfSheet.getRow(0); + System.out.println(hssfRow.getCell(0).getCellStyle().getDataFormatString()); + DataFormatter formatter = new DataFormatter(); + System.out.println(hssfRow.getCell(0).getNumericCellValue()); + System.out.println(hssfRow.getCell(1).getNumericCellValue()); + System.out.println(hssfRow.getCell(2).getNumericCellValue()); + System.out.println(hssfRow.getCell(0).getCellStyle().getDataFormatString()); + System.out.println(hssfRow.getCell(1).getCellStyle().getDataFormatString()); + System.out.println(hssfRow.getCell(2).getCellStyle().getDataFormatString()); + + } + + @Test + public void poi07() throws Exception { + InputStream is = new FileInputStream("D:\\test\\styleTest.xlsx"); + Workbook workbook = WorkbookFactory.create(is); // 这种方式 Excel 2003/2007/2010 都是可以处理的 + Sheet sheet = workbook.getSheetAt(0); + Row hssfRow = sheet.getRow(0); + System.out.println(hssfRow.getCell(0).getCellStyle().getDataFormatString()); + DataFormatter formatter = new DataFormatter(); + System.out.println(hssfRow.getCell(0).getNumericCellValue()); + System.out.println(hssfRow.getCell(1).getNumericCellValue()); + System.out.println(hssfRow.getCell(2).getNumericCellValue()); + System.out.println(hssfRow.getCell(0).getCellStyle().getDataFormat()); + System.out.println(hssfRow.getCell(1).getCellStyle().getDataFormat()); + System.out.println(hssfRow.getCell(2).getCellStyle().getDataFormat()); + System.out.println(hssfRow.getCell(3).getCellStyle().getDataFormat()); + System.out.println(hssfRow.getCell(0).getCellStyle().getDataFormatString()); + System.out.println(hssfRow.getCell(1).getCellStyle().getDataFormatString()); + System.out.println(hssfRow.getCell(2).getCellStyle().getDataFormatString()); + System.out.println(hssfRow.getCell(3).getCellStyle().getDataFormatString()); + isDate(hssfRow.getCell(0)); + isDate(hssfRow.getCell(1)); + isDate(hssfRow.getCell(2)); + isDate(hssfRow.getCell(3)); + + } + + @Test + public void poi0701() throws Exception { + InputStream is = new FileInputStream("D:\\test\\f1.xlsx"); + Workbook workbook = WorkbookFactory.create(is); // 这种方式 Excel 2003/2007/2010 都是可以处理的 + Sheet sheet = workbook.getSheetAt(0); + print(sheet.getRow(0).getCell(0)); + print(sheet.getRow(1).getCell(0)); + print(sheet.getRow(2).getCell(0)); + print(sheet.getRow(3).getCell(0)); + } + + private void print(Cell cell) { + System.out.println( + DateUtil.isADateFormat(cell.getCellStyle().getDataFormat(), cell.getCellStyle().getDataFormatString())); + System.out.println(cell.getCellStyle().getDataFormat()); + System.out.println(cell.getCellStyle().getDataFormatString()); + DataFormatter f = new DataFormatter(); + System.out.println(f.formatCellValue(cell)); + if (cell.getCellStyle().getDataFormatString() != null) { + + } + ExcelStyleDateFormatter ff = new ExcelStyleDateFormatter(cell.getCellStyle().getDataFormatString()); + + } + + @Test + public void testFormatter() throws Exception { + ExcelStyleDateFormatter ff = new ExcelStyleDateFormatter("yyyy年m月d日"); + + System.out.println(ff.format(new Date())); + } + + private void isDate(Cell cell) { + System.out.println( + DateUtil.isADateFormat(cell.getCellStyle().getDataFormat(), cell.getCellStyle().getDataFormatString())); + System.out.println(HSSFDateUtil.isCellDateFormatted(cell)); + DataFormatter f = new DataFormatter(); + System.out.println(f.formatCellValue(cell)); + + } + + @Test + public void testBuiltinFormats() throws Exception { + System.out.println(BuiltinFormats.getBuiltinFormat(48)); + System.out.println(BuiltinFormats.getBuiltinFormat(57)); + System.out.println(BuiltinFormats.getBuiltinFormat(28)); + + } + +} diff --git a/src/test/java/com/alibaba/easyexcel/test/temp/poi/PoiFormatTest.java b/src/test/java/com/alibaba/easyexcel/test/temp/poi/PoiFormatTest.java new file mode 100644 index 0000000..99885fa --- /dev/null +++ b/src/test/java/com/alibaba/easyexcel/test/temp/poi/PoiFormatTest.java @@ -0,0 +1,53 @@ +package com.alibaba.easyexcel.test.temp.poi; + +import java.io.File; +import java.io.IOException; + +import org.apache.poi.ss.usermodel.DateUtil; +import org.apache.poi.xssf.streaming.SXSSFRow; +import org.apache.poi.xssf.streaming.SXSSFSheet; +import org.apache.poi.xssf.streaming.SXSSFWorkbook; +import org.apache.poi.xssf.usermodel.XSSFRow; +import org.apache.poi.xssf.usermodel.XSSFSheet; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.junit.Ignore; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.alibaba.easyexcel.test.util.TestFileUtil; + +/** + * 测试poi + * + * @author Jiaju Zhuang + **/ +@Ignore +public class PoiFormatTest { + private static final Logger LOGGER = LoggerFactory.getLogger(PoiFormatTest.class); + + @Test + public void lastRowNum() throws IOException { + String file = TestFileUtil.getPath() + "demo" + File.separator + "demo.xlsx"; + SXSSFWorkbook xssfWorkbook = new SXSSFWorkbook(new XSSFWorkbook(file)); + SXSSFSheet xssfSheet = xssfWorkbook.getSheetAt(0); + LOGGER.info("一共行数:{}", xssfSheet.getLastRowNum()); + SXSSFRow row = xssfSheet.getRow(0); + LOGGER.info("第一行数据:{}", row); + xssfSheet.createRow(20); + LOGGER.info("一共行数:{}", xssfSheet.getLastRowNum()); + } + + @Test + public void lastRowNumXSSF() throws IOException { + String file = TestFileUtil.getPath() + "demo" + File.separator + "demo.xlsx"; + XSSFWorkbook xssfWorkbook = new XSSFWorkbook(file); + LOGGER.info("一共:{}个sheet", xssfWorkbook.getNumberOfSheets()); + XSSFSheet xssfSheet = xssfWorkbook.getSheetAt(0); + LOGGER.info("一共行数:{}", xssfSheet.getLastRowNum()); + XSSFRow row = xssfSheet.getRow(0); + LOGGER.info("第一行数据:{}", row); + xssfSheet.createRow(20); + LOGGER.info("一共行数:{}", xssfSheet.getLastRowNum()); + } +} diff --git a/src/test/resources/converter/converter03.xls b/src/test/resources/converter/converter03.xls index 6ae32b9a24c20306a248bcc00380caadbb9ae717..3373d81ee35119586d3f2bd033893082c0f67776 100644 GIT binary patch delta 948 zcma)5T}V_>5T3dFcU|?~-RtV=;?G@OSHfUz1u=7VcNLXw(LhLO$rStvin0(xBsAy; z63TX70}Fzl3gVJMJtQIYAY?`=M4&;6M>>OP>)G66Tj$1xj;~;V*?AhbPT~svV2sna zZ33Ofo~;%e0Wy;_$X~$qh=kLr?yf`N5$1pJbXN|NPc9_Q;h|Nzm@YaBDa`geM?qTl zQG(UyOxMHC4Q@d`Wn5l#(o4mQDuvwp5hLy)k(+ZYE8etLXBO(vN=@>hAZcdb zqIoT>h(ux_aDfqet9fyhwzXn=EA*~?)(mH!RiPTM#&@!-mzr9Ov8z8Sk`C0 zGa|z6*bS#)kmo3b;Tk7B*-T3f7aT28HM=W~_9Hu(Cj<7Rf)nA+t79XBJ*myXvSA8G zS}m3Ek;Wsn(saal%y-;;8FE1935p65SOFwO6k%NqKZ`8!c1>L|e+@v@fj)|(bF z`xiLb&>;>wJ&abNpOzTQ>6@vS#mcaPnqz_=Hu1KJ&rDo5(Gjo00EOZ=+AX{R{@Y4Q79TdPsh;g;M#`#0DLz^lj&PP&qe yQ8aPi_Oy>*6m2Cwq?4m|(X{~5ax!5oBpZ=xtX5h$+L-PR@%VnRYtl49bA zNP^gFTq+t@E+jaH1u@!%iKq)*Xo#$2VPbS4AwuFp>z#@2jPK=~xu0|IdpGl@@8k3W z&Ua$nQr8Q_1`>sw|5veCG!X`XMuz1t4W7ij{d5`3#a~XP-(x)|rfJfiL!ckbF`5)F zpv%}6TXByL#oRoy0RD#X9~#{jI?!LC_)k-mA; ztZ7%H|Ijr5(d1OK&!XBxb>*rf1vBaFTVrpz-D51&Uat@?wNpz+Af$BhA>hCvI0Ywo zk3$SD^POh8>1f9}=Wd~i(_!O7$5*7au3lRhGF08&DlB(WN$(cziz`tOJZ29NEY_JN zfrsR!gU9;IfU*@c9o@JYe~ok|8AhG*$q3fcN-|QbbIQhz5L}Ri@J`k6#^|TSPjGX@ z4GE|tAr;|@CW{YSeBR=F7QbSyr>)f0wl$F8yA61T0(J{3EIar@+yUS?!(3G$gG~lM zo5&_xexuOix8?Wi4d!EZbE1S%$}oL%Jegq*NlX$ B)%5@X diff --git a/src/test/resources/converter/converter07.xlsx b/src/test/resources/converter/converter07.xlsx index a210bbc2fd942981c41d71f992460a37946ab690..92b93e20f4b822c9f121af369693f166c5b5305f 100644 GIT binary patch delta 4980 zcmZ9QXE5At)W%mAthRdHD63?Ny1M9A@4ZK`qD7DT4?^^|dhfjpi5>*eMehU=EeH}J z%A4nTXWnP#JsW={OZ)1)!=0LDfRC=ILIbtI(GmP6 z9+{AYVBKN);8fMkEZq0D?ySD?+f1-yiA8I(qd8$w)#cXaLh-%^Ds)ghQ6LaPLJnv{W3M>@nIBwb{;sJNO80~yUpEgYPn4aVm*?YuFaCdaGtO|- zV+BF6=393Ep(xvDIgy;ptV#JeFFAl&7I;h{#_`gS zQ57=e(()^pVupw-LjI1G0UqzD5CJzWV}nG$Mq?9x>M@?`Tx^h<2#$0cbbsKxwxg%! zUXjRS1$3Olds38gDB)B-A9a;Wf8C_vO@#PN3i&I|LJgy@`UL=-k7DMost|5zgM~FV zg^v&|lQf@9YM+$a=86Zi$Knb^Y2nuUq=d1d!9Q_$+a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y__icKG8@sr1vh4WCapuR^7;sWKTXrxzHlCZ6d#ch3D^DZt zkaJk~=%vBDJ+~rWi^I6}Z#p!%XKK(YO!iA9<8C4FcGi}UEgUwso?l}1l$wzzSXzatX=%yPU#0fGKu?|uBu?{2Mbvlg1T$ zxhcM%2A!(Fel97I(m8nI`62p$tnII;E~*=nu2Sb>J*wp;nv4cGGYDO{WiBn>wYG=4 zU^t9kwYA?VrZMdh*yRGk=A%l6#mT}~6zSI)pV4b~(Xx8`%vGjsUw0`d&+%9pz2PF0 zRk)@|rK#9#La&?f!MEkuJZU#P7bRGsV$R(cEBCSBPk3le)uV@uT%-5({ob0iK{<>rB=o~l>!SeRbBbOC?2 zPH`vqSR6aM*$f9u$zO`^9X;75=@>HbG&g|#wjsOgaSW*UFoF6<+Z#s8gZbBARGJD1 z*JU@CyCr1yL%xB(fT9^dxExVm0zQ4l=ga*R;q zNg5CcPRslXj!cX9;yITf1kkev^atL?2uJx3odwrm5+?u0t2{pIf#0mov-L7;?_GYcR})4@&YDBw=ac;x@TX8s!>51!76JIpaU){{f%pRdoOW diff --git a/src/test/resources/simple/simple07.xlsx b/src/test/resources/simple/simple07.xlsx index f01c4460b032536ed1a21a8dc9c3f30964c3afcd..3d25fcd8c7bb009e5347b61119a23e145148d0ff 100644 GIT binary patch delta 4435 zcmZ9QcQhPK+s4<%vWT)u5JXwMKZxF=NAE2}@7?OMQDO(mtDfX?=|-{~PsaUQ`Hp7sdR#Oz1j z7Oc**Zz?qp2jtfw?{&p3^RX^8*}ltQo!;fPk`A7zSkyY%Tgd8x+f2h?h4@KJ;YX|2 z?a|j}8IlwE{;30Cy(A`lR*W(W2Sk#Ac$VL{!A8GEwU>hgbEl(84`W2tdh&oY*!)E$> zRLri<;l;s5(W5af`$irT&QHIQLLM;z=_|NjZ=`QNhgwR@2zbG*GDw@_C;niX&&X~| z6uY)_aZEbzgTJ-YSB88-)}yZMCdZRifBf}gmax90UoN4+ zgjOmvLPspYO~LZ)=HkyGweHh*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