From 1f7e9962353b331476674ad3a1c9560184ddb88c Mon Sep 17 00:00:00 2001 From: chen <2710907404@qq.com> Date: Thu, 10 Jul 2025 14:26:55 +0800 Subject: [PATCH] =?UTF-8?q?20250710=20=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EntrustAlterApplyController.java | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/src/main/java/digital/laboratory/platform/entrustment/controller/EntrustAlterApplyController.java b/src/main/java/digital/laboratory/platform/entrustment/controller/EntrustAlterApplyController.java index ea0233f..b406fd6 100644 --- a/src/main/java/digital/laboratory/platform/entrustment/controller/EntrustAlterApplyController.java +++ b/src/main/java/digital/laboratory/platform/entrustment/controller/EntrustAlterApplyController.java @@ -59,57 +59,49 @@ public class EntrustAlterApplyController { @PutMapping("/update") @PreAuthorize("@pms.hasPermission('EntrustAlterApplyEdit')") // 委托申请修改消息修改权限 public R update(@RequestBody @Valid EntrustAlterApplyDTO dto) { - Boolean success = null; try { - success = entrustAlterApplyService.update(dto); + return entrustAlterApplyService.update(dto) ? R.ok(true,"修改成功") : R.failed(false,"修改失败"); } catch (ValidateCodeException e) { e.printStackTrace(); return R.failed(e.getMessage()); } - return R.ok(success).setMsg(success ? "修改成功" : "修改失败"); } @ApiOperation(value = "审核提交委托申请修改消息", notes = "审核提交委托申请修改消息") @PutMapping("/approve") @PreAuthorize("@pms.hasPermission('EntrustAlterApplyApprove')") // 委托申请修改消息审核权限 public R approve(@RequestBody @Valid EntrustAlterApplyApproveDTO approveDTO) { - Boolean success = null; try { - success = entrustAlterApplyService.approve(approveDTO); + return entrustAlterApplyService.approve(approveDTO) ? R.ok(true,"操作成功") : R.failed(false,"操作成功"); } catch (ValidateCodeException e) { e.printStackTrace(); return R.failed(e.getMessage()); } - return R.ok(success).setMsg(success ? "审核成功" : "审核失败"); } @ApiOperation(value = "删除委托申请修改消息", notes = "删除委托申请修改消息, 只能删除为提交状态的消息") @PostMapping("/delete") @PreAuthorize("@pms.hasPermission('EntrustAlterApplyDelete')") // 委托申请修改消息删除权限 public R delete(@RequestBody List ids) { - Boolean success = null; try { - success = entrustAlterApplyService.delete(ids); + return entrustAlterApplyService.delete(ids) ? R.ok(true, "操作成功") : R.failed(false,"操作失败"); } catch (ValidateCodeException e) { e.printStackTrace(); return R.failed(e.getMessage()); } - return R.ok(success).setMsg(success ? "审核成功" : "审核失败"); } @ApiOperation(value = "审核通过后,调用该接口修改委托案件简要、鉴定要求,x", notes = "审核通过后,调用该接口修改委托案件简要、鉴定要求") @PutMapping("/updateEntrust") @PreAuthorize("@pms.hasPermission('EntrustAlterApplyUpdateEntrust')") // 委托申请修改消息修改委托案件简要、鉴定要求权限 public R updateEntrust(@Valid @RequestBody ApprovedUpdateEntrustDTO dto) { - Boolean success = entrustAlterApplyService.updateEntrust(dto); - return R.ok(success).setMsg(success ? "修改成功" : "修改失败"); + return entrustAlterApplyService.updateEntrust(dto) ? R.ok(true, "操作成功") : R.failed(false,"操作失败"); } @ApiOperation(value = "判断当前委托是否在申请中的状态", notes = "判断当前委托是否在申请中的状态") @GetMapping("/isApplying") public R isApplying(@RequestParam("entrustId") String entrustId) { - Boolean success = entrustAlterApplyService.isApplying(entrustId); - return R.ok(success).setMsg(success ? "当前委托在申请修改中!" : "当前委托在未申请修改!"); + return entrustAlterApplyService.isApplying(entrustId) ? R.ok(true, "当前委托在申请修改中!") : R.failed(false, "当前委托在未申请修改!"); } }