Commit a774c7b4 authored by neo's avatar neo

[bugfix] excel upload file content lost last row

parent 13d5d8dd
...@@ -79,10 +79,12 @@ public class NPOIHelper { ...@@ -79,10 +79,12 @@ public class NPOIHelper {
if (topRowNumber > 0) { if (topRowNumber > 0) {
//第一行为列头的话就多输出一行 //第一行为列头的话就多输出一行
int topNum = haveHeader ? topRowNumber + 1 : topRowNumber; int startIndex = (haveHeader ? topRowNumber + 1 : topRowNumber)-1;
int endIndex=dataImportModel.getDataList().size() - 1;
if (topNum < dataImportModel.getDataList().size()) if (startIndex < dataImportModel.getDataList().size()) {
dataImportModel.setDataList(dataImportModel.getDataList().subList(0, topNum)); dataImportModel.setDataList(dataImportModel.getDataList().subList(startIndex, endIndex));
}
// dataImportModel.setDataList(dataImportModel.getDataList().subList(0,topRowNumber)); // dataImportModel.setDataList(dataImportModel.getDataList().subList(0,topRowNumber));
} }
return dataImportModel; return dataImportModel;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment