|
|
@ -1,8 +1,5 @@ |
|
|
|
package com.alibaba.excel.analysis.v07.handlers; |
|
|
|
package com.alibaba.excel.analysis.v07.handlers; |
|
|
|
|
|
|
|
|
|
|
|
import org.apache.poi.xssf.usermodel.XSSFCellStyle; |
|
|
|
|
|
|
|
import org.xml.sax.Attributes; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.excel.constant.BuiltinFormats; |
|
|
|
import com.alibaba.excel.constant.BuiltinFormats; |
|
|
|
import com.alibaba.excel.constant.ExcelXmlConstants; |
|
|
|
import com.alibaba.excel.constant.ExcelXmlConstants; |
|
|
|
import com.alibaba.excel.context.xlsx.XlsxReadContext; |
|
|
|
import com.alibaba.excel.context.xlsx.XlsxReadContext; |
|
|
@ -12,6 +9,10 @@ import com.alibaba.excel.read.metadata.holder.xlsx.XlsxReadSheetHolder; |
|
|
|
import com.alibaba.excel.util.PositionUtils; |
|
|
|
import com.alibaba.excel.util.PositionUtils; |
|
|
|
import com.alibaba.excel.util.StringUtils; |
|
|
|
import com.alibaba.excel.util.StringUtils; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.apache.poi.xssf.model.StylesTable; |
|
|
|
|
|
|
|
import org.apache.poi.xssf.usermodel.XSSFCellStyle; |
|
|
|
|
|
|
|
import org.xml.sax.Attributes; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Cell Handler |
|
|
|
* Cell Handler |
|
|
|
* |
|
|
|
* |
|
|
@ -46,8 +47,11 @@ public class CellTagHandler extends AbstractXlsxTagHandler { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
dateFormatIndexInteger = Integer.parseInt(dateFormatIndex); |
|
|
|
dateFormatIndexInteger = Integer.parseInt(dateFormatIndex); |
|
|
|
} |
|
|
|
} |
|
|
|
XSSFCellStyle xssfCellStyle = |
|
|
|
StylesTable stylesTable = xlsxReadContext.xlsxReadWorkbookHolder().getStylesTable(); |
|
|
|
xlsxReadContext.xlsxReadWorkbookHolder().getStylesTable().getStyleAt(dateFormatIndexInteger); |
|
|
|
if (stylesTable == null) { |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
XSSFCellStyle xssfCellStyle = stylesTable.getStyleAt(dateFormatIndexInteger); |
|
|
|
int dataFormat = xssfCellStyle.getDataFormat(); |
|
|
|
int dataFormat = xssfCellStyle.getDataFormat(); |
|
|
|
xlsxReadSheetHolder.getTempCellData().setDataFormat(dataFormat); |
|
|
|
xlsxReadSheetHolder.getTempCellData().setDataFormat(dataFormat); |
|
|
|
xlsxReadSheetHolder.getTempCellData().setDataFormatString(BuiltinFormats.getBuiltinFormat(dataFormat, |
|
|
|
xlsxReadSheetHolder.getTempCellData().setDataFormatString(BuiltinFormats.getBuiltinFormat(dataFormat, |
|
|
|