mirror of https://gitee.com/y_project/RuoYi.git
update ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java.
parent
fba8008c81
commit
3f874d04ed
|
@ -170,18 +170,8 @@ public class ExcelUtil<T>
|
|||
this.type = Type.IMPORT;
|
||||
this.wb = WorkbookFactory.create(is);
|
||||
List<T> list = new ArrayList<T>();
|
||||
Sheet sheet = null;
|
||||
if (StringUtils.isNotEmpty(sheetName))
|
||||
{
|
||||
// 如果指定sheet名,则取指定sheet中的内容.
|
||||
sheet = wb.getSheet(sheetName);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 如果传入的sheet名不存在则默认指向第1个sheet.
|
||||
sheet = wb.getSheetAt(0);
|
||||
}
|
||||
|
||||
// 如果指定sheet名,则取指定sheet中的内容 否则默认指向第1个sheet
|
||||
Sheet sheet = StringUtils.isNotEmpty(sheetName) ? wb.getSheet(sheetName) : wb.getSheetAt(0);
|
||||
if (sheet == null)
|
||||
{
|
||||
throw new IOException("文件sheet不存在");
|
||||
|
|
Loading…
Reference in New Issue