Commit e16e9b6c by 钟明宏

增加工作薄大小的额方法

parent 9bee2e7b
......@@ -48,6 +48,16 @@ public class DefaultExcelImport {
return sheet.getData(index, workbook);
}
public int getSheetSize() {
int size = 0;
Iterator<Sheet> iterator = workbook.sheetIterator();
while (iterator.hasNext()) {
iterator.next();
size++;
}
return size;
}
public static class ImportSheet<T> {
private ModelPropertyDescriptor<T> modelPropertyDescriptor;
......
......@@ -120,6 +120,9 @@ public class DefaultExcelImportTest {
excelExport.writeData(new DefaultExcelExport.ExportSheet(UserModel.class, "用户表-郑瀚", list_5));
excelExport.writeFile("E:\\tmp\\avatar\\用户表-郑瀚.xlsx");
defaultExcelImport = new DefaultExcelImport("E:\\tmp\\avatar\\运营用户表.xlsx");
System.out.println(defaultExcelImport.getSheetSize());
}
public void setRealAvatar(List<UserModel> list, String prefix) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment