| | |
| | | throw new BadRequestException("上传失败"); |
| | | } |
| | | |
| | | ExcelReader reader = ExcelUtil.getReader(FileUtil.toFile(file)); |
| | | File uploadFile = FileUtil.toFile(file); |
| | | ExcelReader reader = ExcelUtil.getReader(uploadFile); |
| | | List<Map<String,Object>> readAll = reader.readAll(); |
| | | if (ObjectUtil.isNull(readAll)) { |
| | | throw new BadRequestException("Excel解析失败"); |
| | |
| | | } catch (Exception e){ |
| | | e.printStackTrace(); |
| | | throw new BadRequestException("数据保存失败"); |
| | | } finally { |
| | | if (uploadFile.exists()) { |
| | | uploadFile.deleteOnExit(); |
| | | } |
| | | } |
| | | |
| | | return finalMap; |