提交 db06fc50 编写于 作者: J jipengfei.jpf

修复从第一行模型转换的BUG

上级 b31f1257
......@@ -33,7 +33,6 @@ import org.xml.sax.helpers.DefaultHandler;
/**
* @author jipengfei
*
*/
public class SaxAnalyserV07 extends BaseSaxAnalyser {
......@@ -67,7 +66,7 @@ public class SaxAnalyserV07 extends BaseSaxAnalyser {
try {
Sheet sheet = analysisContext.getCurrentSheet();
if (!isAnalysisAllSheets(sheet)) {
if (this.sheetSourceList.size() <= sheet.getSheetNo()) {
if (this.sheetSourceList.size() < sheet.getSheetNo() || sheet.getSheetNo() == 0) {
return;
}
InputStream sheetInputStream = this.sheetSourceList.get(sheet.getSheetNo() - 1).getInputStream();
......@@ -93,7 +92,7 @@ public class SaxAnalyserV07 extends BaseSaxAnalyser {
if (sheet == null) {
return true;
}
if (sheet.getSheetNo() <= 0) {
if (sheet.getSheetNo() < 0) {
return true;
}
return false;
......@@ -139,7 +138,6 @@ public class SaxAnalyserV07 extends BaseSaxAnalyser {
return sheets;
}
private void start() throws IOException, XmlException, ParserConfigurationException, SAXException {
createTmpFile();
......@@ -175,7 +173,7 @@ public class SaxAnalyserV07 extends BaseSaxAnalyser {
if (attrs.getLocalName(i).toLowerCase(Locale.US).equals("name")) {
name = attrs.getValue(i);
} else if (attrs.getLocalName(i).toLowerCase(Locale.US).equals("r:id")) {
id = Integer.parseInt(attrs.getValue(i).replaceAll("rId",""));
id = Integer.parseInt(attrs.getValue(i).replaceAll("rId", ""));
try {
InputStream inputStream = new FileInputStream(XMLTempFile.getSheetFilePath(path, id));
sheetSourceList.add(new SheetSource(id, name, inputStream));
......@@ -270,5 +268,4 @@ public class SaxAnalyserV07 extends BaseSaxAnalyser {
}
}
}
......@@ -15,7 +15,7 @@ public class Sheet {
private int headLineMun;
/**
* sheet序号
* sheet序号 从0开始
*/
private int sheetNo;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册