| | |
| | | @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("编辑成功!"); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "故障报修-作废", notes = "故障报修-作废") |
| | | @DeleteMapping(value = "/abolish") |
| | | public Result<?> abolish(@RequestParam(name = "id", required = true) String id) { |
| | | eamReportRepairService.update(new LambdaUpdateWrapper<EamReportRepair>().set(EamReportRepair::getReportStatus, ReportRepairEnum.ABOLISH.name()).eq(EamReportRepair::getId, id)); |
| | | eamReportRepairService.update(new LambdaUpdateWrapper<EamReportRepair>().set(EamReportRepair::getReportStatus, ReportRepairEnum.ABOLISH.name()).eq(EamReportRepair::getId, id).eq(EamReportRepair::getReportStatus, ReportRepairEnum.WAIT_REPAIR.name())); |
| | | return Result.OK("作废成功!"); |
| | | } |
| | | |
| | |
| | | @DeleteMapping(value = "/abolishBatch") |
| | | public Result<?> abolishBatch(@RequestParam(name = "ids", required = true) String ids) { |
| | | List<EamReportRepair> eamReportRepairs = eamReportRepairService.listByIds(Arrays.asList(ids.split(","))); |
| | | eamReportRepairs.forEach(eamReportRepair -> eamReportRepair.setReportStatus(ReportRepairEnum.ABOLISH.name())); |
| | | eamReportRepairs.forEach(eamReportRepair -> { |
| | | if(ReportRepairEnum.ABOLISH.name().equals(eamReportRepair.getReportStatus())) { |
| | | eamReportRepair.setReportStatus(ReportRepairEnum.ABOLISH.name()); |
| | | } |
| | | }); |
| | | this.eamReportRepairService.updateBatchById(eamReportRepairs); |
| | | return Result.OK("批量作废成功!"); |
| | | } |