src/main/java/com/whyc/controller/BattRealdataController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/whyc/controller/StandardFeatureCurveController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/whyc/service/BattRealdataService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/whyc/controller/BattRealdataController.java
@@ -34,13 +34,13 @@ @ApiOperation("excel解析") @PostMapping("excelParse") public Response excelParse(@RequestParam MultipartFile file) throws IOException, InvalidFormatException { public Response excelParse(@RequestPart MultipartFile file) throws IOException, InvalidFormatException { return service.excelParse(file); } @ApiOperation("ABE文件解析") @PostMapping("ABEParse") public Response aBEParse(@RequestParam MultipartFile file) throws IOException { public Response aBEParse(@RequestPart MultipartFile file) throws IOException { return service.aBEParse(file); } src/main/java/com/whyc/controller/StandardFeatureCurveController.java
@@ -2,7 +2,6 @@ import com.whyc.dto.Response; import com.whyc.dto.StandardFeatureCurve; import com.whyc.pojo.PwrdevAlarmHistory; import com.whyc.service.StandardFeatureCurveService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -36,10 +35,10 @@ @ApiOperation("数据导入") @PostMapping("excelImport") public Response excelImport(@RequestParam MultipartFile file) throws IOException, InvalidFormatException { public Response excelImport(@RequestPart MultipartFile file) throws IOException, InvalidFormatException { Response<Object> response = new Response<>(); String name=file.getOriginalFilename(); if(!name.substring(name.length()-4).equals(".xls") && !name.substring(name.length()-5).equals(".xlsx")){ if(!name.endsWith(".xls") && !name.endsWith(".xlsx")){ response.set(1,false,"文件类型错误"); }else{ InputStream is=file.getInputStream(); src/main/java/com/whyc/service/BattRealdataService.java
@@ -191,6 +191,10 @@ } public Response excelParse(MultipartFile file) throws IOException, InvalidFormatException { String name=file.getOriginalFilename(); if(!name.endsWith(".xls") && !name.endsWith(".xlsx")) { return new Response<>().set(1, false, "文件类型错误"); } List dataList = new LinkedList(); Workbook workbook = null; InputStream inputStream = file.getInputStream();