fix: 解析excel失败

This commit is contained in:
taojinlong 2021-08-13 17:31:18 +08:00
parent 19d08770a9
commit 9623c15d01

View File

@ -19,8 +19,6 @@ import org.xml.sax.helpers.XMLReaderFactory;
import java.io.InputStream; import java.io.InputStream;
import java.util.*; import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/** /**
* @author y * @author y
@ -251,8 +249,10 @@ public class ExcelXlsxReader extends DefaultHandler {
String value = this.getDataValue(lastIndex.trim(), "");//根据索引值获取对应的单元格值 String value = this.getDataValue(lastIndex.trim(), "");//根据索引值获取对应的单元格值
if (preRef == null) { if (preRef == null) {
preRef = "A" + curRow; preRef = "A" + curRow;
cellList.add(curCol, ""); if(!preRef.equalsIgnoreCase(ref)){
curCol++; cellList.add(curCol, "");
curCol++;
}
} }
//补全单元格之间的空单元格 //补全单元格之间的空单元格