| | |
| | | for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) { |
| | | MultipartFile file = entity.getValue(); |
| | | String fileName = file.getOriginalFilename(); |
| | | Result<?> importResult=eamMaintenanceStandardService.importPointInspectionExcel(file); |
| | | Result<?> importResult=eamMaintenanceStandardService.importPointInspectionExcel(file,null); |
| | | if (importResult.isSuccess()) { |
| | | successCount++; |
| | | } else { |
| | |
| | | for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) { |
| | | MultipartFile file = entity.getValue(); |
| | | String fileName = file.getOriginalFilename(); |
| | | Result<?> importResult=eamMaintenanceStandardService.importMaintenanceStandard(file, "SECOND"); |
| | | Result<?> importResult=eamMaintenanceStandardService.importMaintenanceStandard(file, "SECOND",null); |
| | | if (importResult.isSuccess()) { |
| | | successCount++; |
| | | } else { |
| | |
| | | for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) { |
| | | MultipartFile file = entity.getValue(); |
| | | String fileName = file.getOriginalFilename(); |
| | | Result<?> importResult= eamMaintenanceStandardService.importMaintenanceStandard(file, "THIRD"); |
| | | Result<?> importResult= eamMaintenanceStandardService.importMaintenanceStandard(file, "THIRD",null); |
| | | if (importResult.isSuccess()) { |
| | | successCount++; |
| | | } else { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 升版导入 |
| | | * @param id,file |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "升版导入", notes = "升版导入") |
| | | @PostMapping(value = "/importUpgrade") |
| | | public Result<?> importUpgrade(String id,MultipartFile file) { |
| | | EamMaintenanceStandard eamMaintenanceStandard=eamMaintenanceStandardService.getById(id); |
| | | if (eamMaintenanceStandard==null) { |
| | | return Result.error("请选择需要升版的保养标准"); |
| | | }else { |
| | | switch (eamMaintenanceStandard.getMaintenanceCategory()){ |
| | | case "POINT_INSPECTION": |
| | | //点检升版导入 |
| | | return eamMaintenanceStandardService.importPointInspectionExcel(file,id); |
| | | case "SECOND_MAINTENANCE": |
| | | //二保升版导入 |
| | | return eamMaintenanceStandardService.importMaintenanceStandard(file, "SECOND",id); |
| | | case "THIRD_MAINTENANCE": |
| | | //三保升版导入 |
| | | return eamMaintenanceStandardService.importMaintenanceStandard(file, "THIRD",id); |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | return Result.error("升版导入失败"); |
| | | } |
| | | |
| | | private Result<?> getResult(Map<String, String> results, int fileCount, int successCount, int failureCount) { |
| | | List<String> response = new ArrayList<>(); |
| | | response.add("总文件数:" + fileCount); |