|
@@ -17,6 +17,7 @@ import java.util.Map.Entry;
|
|
|
|
|
|
import org.apache.commons.beanutils.NestedNullException;
|
|
import org.apache.commons.beanutils.NestedNullException;
|
|
import org.apache.commons.beanutils.PropertyUtils;
|
|
import org.apache.commons.beanutils.PropertyUtils;
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.poi.hssf.usermodel.HSSFCell;
|
|
import org.apache.poi.hssf.usermodel.HSSFCell;
|
|
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
|
|
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
|
|
import org.apache.poi.hssf.usermodel.HSSFFont;
|
|
import org.apache.poi.hssf.usermodel.HSSFFont;
|
|
@@ -478,6 +479,7 @@ public class POIUtil {
|
|
rowIter = sheet.iterator();
|
|
rowIter = sheet.iterator();
|
|
while (rowIter.hasNext()) {
|
|
while (rowIter.hasNext()) {
|
|
Map<String, Object> obj = null;
|
|
Map<String, Object> obj = null;
|
|
|
|
+ boolean hasVal = false;
|
|
// 获取当前行
|
|
// 获取当前行
|
|
row = rowIter.next();
|
|
row = rowIter.next();
|
|
if (row != null) {
|
|
if (row != null) {
|
|
@@ -511,11 +513,14 @@ public class POIUtil {
|
|
cell = cellIter.next();
|
|
cell = cellIter.next();
|
|
cell.setCellType(Cell.CELL_TYPE_STRING);
|
|
cell.setCellType(Cell.CELL_TYPE_STRING);
|
|
String fieldValue = cell.getStringCellValue();
|
|
String fieldValue = cell.getStringCellValue();
|
|
|
|
+ if(StringUtils.isNotBlank(fieldValue)){
|
|
|
|
+ hasVal = true;
|
|
|
|
+ }
|
|
obj.put(fieldsName[currentCellNum], fieldValue);
|
|
obj.put(fieldsName[currentCellNum], fieldValue);
|
|
currentCellNum++;
|
|
currentCellNum++;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if (obj != null)
|
|
|
|
|
|
+ if (obj != null && hasVal)
|
|
datas.add(obj);
|
|
datas.add(obj);
|
|
|
|
|
|
}
|
|
}
|