From 43420aa8b2539392505389aac6fc78a5c45cde86 Mon Sep 17 00:00:00 2001 From: Vinjor Date: Wed, 13 Nov 2024 14:48:14 +0800 Subject: [PATCH] 1 --- .../module/custom/service/CarMainService.java | 9 +++ .../service/impl/CarMainServiceImpl.java | 22 +++++++ .../service/impl/CustomerCarServiceImpl.java | 63 ++++++++++++++----- 3 files changed, 78 insertions(+), 16 deletions(-) diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CarMainService.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CarMainService.java index 9dc07ff2..673fb00d 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CarMainService.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CarMainService.java @@ -100,5 +100,14 @@ public interface CarMainService extends IService { **/ CarMainRespVO compute(CarMainReqVO reqVO); + /** + * 根据客户信息+车牌号查这个客户是否已有这个车 + * @author vinjor-M + * @date 14:41 2024/11/13 + * @param userId 用户id + * @param carNumber 车牌号 + * @return cn.iocoder.yudao.module.custom.entity.CarMain + **/ + CarMain selectByUserIdAndCarNumber(Long userId,String carNumber); } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CarMainServiceImpl.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CarMainServiceImpl.java index e0b3901d..74cc104c 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CarMainServiceImpl.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CarMainServiceImpl.java @@ -309,6 +309,28 @@ public class CarMainServiceImpl extends ServiceImpl impl return respVO; } + /** + * 根据客户信息+车牌号查这个客户是否已有这个车 + * + * @param userId 用户id + * @param carNumber 车牌号 + * @return cn.iocoder.yudao.module.custom.entity.CarMain + * @author vinjor-M + * @date 14:41 2024/11/13 + **/ + @Override + public CarMain selectByUserIdAndCarNumber(Long userId, String carNumber) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper() + .eq(CarMain::getUserId,userId) + .eq(CarMain::getLicenseNumber,carNumber); + List rtnList = this.list(queryWrapper); + if(rtnList.isEmpty()){ + return null; + }else{ + return rtnList.get(0); + } + } + /** * 根据品牌型号获取保养规则 * diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerCarServiceImpl.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerCarServiceImpl.java index 5484f799..985f6e72 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerCarServiceImpl.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerCarServiceImpl.java @@ -95,11 +95,12 @@ public class CustomerCarServiceImpl extends ServiceImpl