springboot-poi
码云地址:https://gitee.com/fashionbrot/springboot-poi
介绍
Springboot poi上传并处理百万级数据 excel
软件架构
springboot poi 上传 excel 高效处理方式
@RequestMapping("/test")
@ResponseBody
public String test(@RequestParam(value = "file",required = false) MultipartFile file){
LargeExcelFileReadUtil example = new LargeExcelFileReadUtil();
LinkedHashMap<String, String> rowMap=null;
try {
example.processOneSheet(file.getInputStream());
rowMap = example.getRowContents();
} catch (Exception e) {
log.error("upload readExcel error",e);
}
if (CollectionUtils.isEmpty(rowMap)){
throw new RuntimeException("读取:"+file.getOriginalFilename()+"失败&