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