git的地址:
https://github.com/hyberbin/J-Excel
代码:
public static void main(String[] args) throws FileNotFoundException, IOException, JSONException {
Workbook workbook = new HSSFWorkbook(
new FileInputStream("F:\\coding\\git\\J-Excel\\src\\main\\resources\\xx - 副本.xls"));
Sheet sheet = workbook.getSheet("aaa");
ImportTableService tableService = new ImportTableService(sheet);
tableService.setStartRow(1);
tableService.doImport();
List<ZxBusiTemplateVo> read = tableService.read(new String[] { "id", "customerId", "sheetNo", "productCode",
"city", "marketingCenter", "area", "installedAddr", "cpeDeviceCode", "cpeType", "managerName",
"managerPhone", "upBandwidth", "downBandwidth", "ipNum", "IP" }, ZxBusiTemplateVo.class);
Sheet sheet2 = workbook.getSheet("bbb");
ImportTableService tableService2 = new ImportTableService(sheet2);
tableService2.setStartRow(1);
tableService2.doImport();
List<UserTemplateVO> read2 = tableService2.read(new String[] { "customerName", "customerId", "userId",
"linkName", "linkPhone", "userIdNo", "account", "userName", "phone", "password" },
UserTemplateVO.class);