From acf352921487e857810a943b008121e33404e9ae Mon Sep 17 00:00:00 2001
From: kongdeqiang <kongdeqiang960204@163.com>
Date: 星期二, 15 四月 2025 16:56:50 +0800
Subject: [PATCH] fix:白名单新增bug
---
src/main/java/com/boying/controller/TicketBlackController.java | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/main/java/com/boying/controller/TicketBlackController.java b/src/main/java/com/boying/controller/TicketBlackController.java
index 4dc166f..c71476c 100644
--- a/src/main/java/com/boying/controller/TicketBlackController.java
+++ b/src/main/java/com/boying/controller/TicketBlackController.java
@@ -46,7 +46,7 @@
public Object findPage(Page page, TicketBlack ticket){
QueryWrapper<TicketBlack> wrapper = new QueryWrapper<>();
wrapper.lambda()
- .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));
@@ -83,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