|
@@ -156,6 +156,7 @@ public class ExcelUtil {
|
|
throw ExceptionResultEnum.ERROR.exception("导入文件和模版不一致");
|
|
throw ExceptionResultEnum.ERROR.exception("导入文件和模版不一致");
|
|
}
|
|
}
|
|
boolean extend = fields[fields.length - 1].getName().contains(SystemConstant.EXTEND_COLUMN);
|
|
boolean extend = fields[fields.length - 1].getName().contains(SystemConstant.EXTEND_COLUMN);
|
|
|
|
+ int emptyRowSum = 0;
|
|
for (int j = firstcell; j < lastcell; j++) {
|
|
for (int j = firstcell; j < lastcell; j++) {
|
|
//获取第j列
|
|
//获取第j列
|
|
Cell cell = row.getCell(j);
|
|
Cell cell = row.getCell(j);
|
|
@@ -164,6 +165,9 @@ public class ExcelUtil {
|
|
} else {
|
|
} else {
|
|
if (Objects.nonNull(cell)) {
|
|
if (Objects.nonNull(cell)) {
|
|
Object obj = convert(cell);
|
|
Object obj = convert(cell);
|
|
|
|
+ if (StringUtils.isBlank(obj.toString().trim())) {
|
|
|
|
+ emptyRowSum++;
|
|
|
|
+ }
|
|
if (extend) {
|
|
if (extend) {
|
|
if (j < fields.length - 1) {
|
|
if (j < fields.length - 1) {
|
|
fields[j].setAccessible(true);
|
|
fields[j].setAccessible(true);
|
|
@@ -202,7 +206,7 @@ public class ExcelUtil {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if (i > 0) {
|
|
|
|
|
|
+ if (i > 0 && emptyRowSum - (lastcell - firstcell) != 0) {
|
|
oList.add(y, o);
|
|
oList.add(y, o);
|
|
}
|
|
}
|
|
}
|
|
}
|