fix: 处理 excel 数据

This commit is contained in:
taojinlong 2021-12-01 21:41:59 +08:00
parent 9ea9443722
commit 897eb69a80

View File

@ -384,9 +384,14 @@ public class ExcelXlsxReader extends DefaultHandler {
String sstIndex = value.toString();
try {
int idx = Integer.parseInt(sstIndex);
XSSFRichTextString rtss = new XSSFRichTextString(sst.getEntryAt(idx));//根据idx索引值获取内容值
thisStr = rtss.toString();
rtss = null;
if(sst != null){
XSSFRichTextString rtss = new XSSFRichTextString(sst.getEntryAt(idx));//根据idx索引值获取内容值
thisStr = rtss.toString();
rtss = null;
}else {
thisStr = value.toString();
}
} catch (NumberFormatException ex) {
thisStr = value.toString();
}