code: public static List<?> workbook2List(ExcelConfig config, Workbook wb) throws Exception {
          String[] names = config.getNames();
          String[] types = config.getTypes();
          Field key = config.getKey();
  
          List<Object> list = new ArrayList<Object>();
          Sheet sheet = wb.getSheet(config.getSheetNum());
          int length = sheet.getColumns() < names.length ? sheet.getColumns() : names.length;
          //计算行数
          int rowLength = sheet.getRows() < config.getMaxRow() ?
                  sheet.getRows() : (config.getMaxRow() > 0 ? (config.getMaxRow() + config.getStartRow()) : sheet.getRows());
  
          for (int i = config.getStartRow(); i < rowLength; i++) {
              //Map类型要特殊处理
              Class clazz = Class.forName(config.getClazz());
              Object obj = null;
              if (Map.class.isAssignableFrom(clazz)) {
                  obj = new HashMap();
              } else {
                  obj = clazz.newInstance();
              }
              for (int j = 0; j < length; j++) {
                  setValue(obj, names[j], types[j], sheet.getCell(j, i));
              }
              //checkKey
              if (key != null) {
                  //当主键为空时，不在继续读取excel
                  if (key.get(obj) == null || "".equals(String.valueOf(key.get(obj)))) {
                      break;
                  }
              }
              list.add(obj);
          }
          return list;
      }
docs: workbook转换为list
  
  @param config 配置
  @param wb     excel
  @return
  @throws Exception