// 校验文件格式
String originalFileName = file.getOriginalFilename();
String fileType = originalFileName.substring(Objects.requireNonNull(originalFileName).lastIndexOf("."));
if (!".txt".equals(fileType)) {
return JsonData.buildResult(BizCodeEnum.MAINBOARD_IMEI_FILE_FORMAT_ERROR);
}
// 读取每行数据到List 1.MultipartFile 2.File
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(file.getInputStream()));
//BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
String imeiTxt;
List<String> imeiList = new ArrayList<>();
while ((imeiTxt = bufferedReader.readLine()) != null) {
imeiList.add(imeiTxt);
}