| | |
| | | @ApiOperation(value = "故障报修-添加", notes = "故障报修-添加") |
| | | @PostMapping(value = "/add") |
| | | public Result<?> add(@RequestBody EamReportRepair eamReportRepair) { |
| | | eamReportRepair.setReportStatus(ReportRepairEnum.WAIT_REPAIR.name()); |
| | | eamReportRepair.setDelFlag(CommonConstant.DEL_FLAG_0); |
| | | if (eamReportRepair.getImageFilesResult() != null) { |
| | | List<FileUploadResult> imageFilesResult = eamReportRepair.getImageFilesResult(); |
| | | ObjectMapper mapper = new ObjectMapper(); |
| | | try { |
| | | String referenceFile = mapper.writeValueAsString(imageFilesResult); |
| | | eamReportRepair.setImageFiles(referenceFile); |
| | | } catch (JsonProcessingException e) { |
| | | return Result.OK("添加失败!"); |
| | | EamReportRepair b = eamReportRepairService.add(eamReportRepair); |
| | | if(b == null) { |
| | | return Result.error("添加失败!"); |
| | | } |
| | | } |
| | | eamReportRepairService.save(eamReportRepair); |
| | | return Result.OK("添加成功!"); |
| | | } |
| | | |