`
方块石
  • 浏览: 59970 次
  • 来自: ...
社区版块
存档分类
最新评论

fadsf

阅读更多
private String readExcel(FormFile excel) throws Exception { String contractIds = ""; int fileSize = excel.getFileSize(); if (fileSize < 1024*1024*2) { Workbook workbook = Workbook.getWorkbook(excel.getInputStream()); Sheet sheet = workbook.getSheet(0); int rowCount = sheet.getRows(); if (rowCount >= 1000) { throw new Exception("EXCEL 超过1000行!"); } for (int i = 0; i < rowCount; i++) { Cell c2 = sheet.getCell(0,i); String stringc2 = c2.getContents(); if ("".equals(contractIds)) { if (stringc2 != null) contractIds = stringc2.trim(); } else { if (stringc2 != null) contractIds = contractIds +","+ stringc2.trim(); } } } else { contractIds = "EXCEL_TOO_LARGE"; } return contractIds; }
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics