lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamReportRepairController.java
@@ -97,7 +97,10 @@ @ApiOperation(value = "故障报修-编辑", notes = "故障报修-编辑") @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) public Result<?> edit(@RequestBody EamReportRepair eamReportRepair) { eamReportRepairService.updateById(eamReportRepair); boolean b = eamReportRepairService.edit(eamReportRepair); if(!b) { return Result.error("编辑失败!"); } return Result.OK("编辑成功!"); } lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IEamReportRepairService.java
@@ -46,4 +46,12 @@ * @return */ EamReportRepair add(EamReportRepair eamReportRepair); /** * 编辑 * @param eamReportRepair * @return */ boolean edit(EamReportRepair eamReportRepair); } lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamReportRepairServiceImpl.java
@@ -139,4 +139,24 @@ eamEquipmentExtendService.updateEquipmentRepairStatus(eamReportRepair.getEquipmentId(), EquipmentRepairStatus.WAIT_REPAIR.name()); return eamReportRepair; } @Override @Transactional(rollbackFor = Exception.class) public boolean edit(EamReportRepair eamReportRepair) { // 附件处理 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 false; } } else { eamReportRepair.setImageFiles(null); } this.baseMapper.updateById(eamReportRepair); return true; } }