From 50751d18aebbd596615c626a3e47c8aba47bc76a Mon Sep 17 00:00:00 2001 From: kongdeqiang <kongdeqiang960204@163.com> Date: 星期日, 24 三月 2024 00:54:33 +0800 Subject: [PATCH] 提交更新 --- src/main/java/com/boying/controller/TicketBlackController.java | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/boying/controller/TicketBlackController.java b/src/main/java/com/boying/controller/TicketBlackController.java index 3a4aaf5..c71476c 100644 --- a/src/main/java/com/boying/controller/TicketBlackController.java +++ b/src/main/java/com/boying/controller/TicketBlackController.java @@ -46,8 +46,7 @@ public Object findPage(Page page, TicketBlack ticket){ QueryWrapper<TicketBlack> wrapper = new QueryWrapper<>(); wrapper.lambda() - .eq(TicketBlack::getBlackType,0) - .eq(StringUtils.isNotBlank(ticket.getCarNo()),TicketBlack::getCarNo,ticket.getCarNo()) + .like(StringUtils.isNotBlank(ticket.getCarNo()),TicketBlack::getCarNo,ticket.getCarNo()) .eq(ticket.getIsActive() != null,TicketBlack::getIsActive,ticket.getIsActive()) .orderByDesc(TicketBlack::getCreateTime); return R.ok(ticketBlackService.page(page, wrapper)); @@ -84,8 +83,14 @@ @PostMapping("/delete") public Object delete(Long id){ TicketBlack ticket =ticketBlackService.getById(id); - ticketBlackService.saveOrUpdate(ticket); - return R.ok("鎿嶄綔鎴愬姛"); + if(ticket!=null){ + if(ticket.getViolationCount() >0 ){ + return R.failed("璇峰厛瑙e喅杩濈珷"); + } + ticketBlackService.removeById(ticket); + return R.ok("鎿嶄綔鎴愬姛"); + } + return R.failed("鏈壘鍒拌杞�"); } @PostMapping("/updateById") -- Gitblit v1.9.1