|
|
@@ -328,6 +328,8 @@ public class FilesUtil {
|
|
|
for(int i=firstrow; i<rownum; i++){
|
|
|
Row row = sheet.getRow(i);
|
|
|
Map<String,String> map = new HashMap<String,String>();
|
|
|
+ // 是否存在全为空的一行数据
|
|
|
+ boolean allIsNull = true;
|
|
|
for(int j=0; j<titleKey.length; j++){
|
|
|
System.out.println(i+":"+j);
|
|
|
Cell cell = row.getCell(j);
|
|
|
@@ -364,9 +366,15 @@ public class FilesUtil {
|
|
|
cellValue = "未知类型";
|
|
|
break;
|
|
|
}
|
|
|
+ if (!CommonUtil.isEmpty(cellValue)) {
|
|
|
+ allIsNull = false;
|
|
|
+ }
|
|
|
}
|
|
|
map.put(titleKey[j], cellValue);
|
|
|
}
|
|
|
+ if (allIsNull) {
|
|
|
+ break;
|
|
|
+ }
|
|
|
list.add(map);
|
|
|
}
|
|
|
return list;
|
|
|
@@ -394,11 +402,13 @@ public class FilesUtil {
|
|
|
throw new BusinessCodeException("PBIM2800");//提示数据格式不正确
|
|
|
}
|
|
|
DecimalFormat df = new DecimalFormat("#");
|
|
|
-
|
|
|
+ // 是否存在全为空的一行数据
|
|
|
+ boolean allIsNull = true;
|
|
|
for(int i=firstrow; i<rownum; i++){
|
|
|
Row row = sheet.getRow(i);
|
|
|
short rowNum = row.getLastCellNum();
|
|
|
List<String> childList = new ArrayList<String>();
|
|
|
+
|
|
|
for (short j = 0; j < rowNum; j ++) {
|
|
|
Cell cell = row.getCell(j);
|
|
|
String cellValue = "";
|
|
|
@@ -434,9 +444,15 @@ public class FilesUtil {
|
|
|
cellValue = "未知类型";
|
|
|
break;
|
|
|
}
|
|
|
+ if (!CommonUtil.isEmpty(cellValue)) {
|
|
|
+ allIsNull = false;
|
|
|
+ }
|
|
|
}
|
|
|
childList.add(cellValue);
|
|
|
}
|
|
|
+ if (allIsNull) {
|
|
|
+ break;
|
|
|
+ }
|
|
|
list.add(childList);
|
|
|
}
|
|
|
return list;
|