|
|
@ -33,6 +33,7 @@ import com.alibaba.excel.context.AnalysisContext; |
|
|
|
import com.alibaba.excel.exception.ExcelAnalysisException; |
|
|
|
import com.alibaba.excel.exception.ExcelAnalysisException; |
|
|
|
import com.alibaba.excel.read.metadata.ReadSheet; |
|
|
|
import com.alibaba.excel.read.metadata.ReadSheet; |
|
|
|
import com.alibaba.excel.read.metadata.holder.ReadWorkbookHolder; |
|
|
|
import com.alibaba.excel.read.metadata.holder.ReadWorkbookHolder; |
|
|
|
|
|
|
|
import com.alibaba.excel.util.CollectionUtils; |
|
|
|
import com.alibaba.excel.util.FileUtils; |
|
|
|
import com.alibaba.excel.util.FileUtils; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -60,14 +61,18 @@ public class XlsxSaxAnalyser implements ExcelExecutor { |
|
|
|
|
|
|
|
|
|
|
|
OPCPackage pkg = readOpcPackage(readWorkbookHolder, decryptedStream); |
|
|
|
OPCPackage pkg = readOpcPackage(readWorkbookHolder, decryptedStream); |
|
|
|
readWorkbookHolder.setOpcPackage(pkg); |
|
|
|
readWorkbookHolder.setOpcPackage(pkg); |
|
|
|
PackagePart sharedStringsTablePackagePart = |
|
|
|
|
|
|
|
pkg.getPartsByContentType(XSSFRelation.SHARED_STRINGS.getContentType()).get(0); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Specify default cache
|
|
|
|
ArrayList<PackagePart> packageParts = pkg.getPartsByContentType(XSSFRelation.SHARED_STRINGS.getContentType()); |
|
|
|
defaultReadCache(readWorkbookHolder, sharedStringsTablePackagePart); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Analysis sharedStringsTable.xml
|
|
|
|
if (!CollectionUtils.isEmpty(packageParts)) { |
|
|
|
analysisSharedStringsTable(sharedStringsTablePackagePart.getInputStream(), readWorkbookHolder); |
|
|
|
PackagePart sharedStringsTablePackagePart = packageParts.get(0); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Specify default cache
|
|
|
|
|
|
|
|
defaultReadCache(readWorkbookHolder, sharedStringsTablePackagePart); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Analysis sharedStringsTable.xml
|
|
|
|
|
|
|
|
analysisSharedStringsTable(sharedStringsTablePackagePart.getInputStream(), readWorkbookHolder); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
XSSFReader xssfReader = new XSSFReader(pkg); |
|
|
|
XSSFReader xssfReader = new XSSFReader(pkg); |
|
|
|
analysisUse1904WindowDate(xssfReader, readWorkbookHolder); |
|
|
|
analysisUse1904WindowDate(xssfReader, readWorkbookHolder); |
|
|
|