由于该楼层涉嫌违规,系统将其折叠并隐藏,以显示该楼层
publiclistgetbanklistbyexcel (inputstream in,String fileName ) throws Exception{ ) )。
list list=空;
//创建Excel工作簿
workbook work=this.get workbook (in,fileName );
if (空值==work ) {
thrownewexception('excel工作簿创建为空!' );
}
sheet sheet=空;
Row row=null;
小区=空;
list=new ArrayList (;
遍历Excel中的所有工作表
for(intI=0; i work.getNumberOfSheets (; I ) {
sheet=work.getsheetat(I;
if(sheet==null ) {continue; }
//遍历当前shell中的所有行
for(intj=sheet.getfirstrownum ); j sheet.getLastRowNum (; j ) {
row=sheet.getrow(j );
if (row==null|| row.getfirstcellnum (==j ) {continue; }
//巡视所有列
List li=new ArrayList (;
for(inty=row.getfirstcellnum ); y row.getLastCellNum (; y ) {
cell=row.getcell(y;
Li.add(this.getcellvalue(cell ) );
}
list.add(Li;
}
}
work.close (;
返回列表;
}
最后work.close ()方法没有错的理由是什么? 怎么改