From a2c3f20553fd6bf522201828add8c07a6ff41770 Mon Sep 17 00:00:00 2001 From: PQZ Date: Sat, 3 Aug 2024 16:16:37 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=91=E5=AE=9A=E8=BD=A6=E8=BE=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yudao/module/custom/mapper/CarMainMapper.java | 10 ++++++++++ .../custom/service/impl/CustomerMainServiceImpl.java | 11 +++++++++++ .../yudao/module/custom/vo/CustomerMainRespVO.java | 3 +++ .../main/resources/mapper/custom/CarMainMapper.xml | 9 +++++++++ 4 files changed, 33 insertions(+) diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/CarMainMapper.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/CarMainMapper.java index 0aaef5bc..355a6ca6 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/CarMainMapper.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/CarMainMapper.java @@ -10,6 +10,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * 车辆信息 Mapper * @@ -21,4 +23,12 @@ public interface CarMainMapper extends BaseMapper { IPage findPage(Page page, @Param("dto") CarMainReqVO pageReqVO); + /** + * 通过客户id查询车辆信息 + * @author PQZ + * @date 15:19 2024/8/3 + * @param cusId 客户id + * @return java.util.List + **/ + List selectListByCusId( @Param("cusId") String cusId); } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerMainServiceImpl.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerMainServiceImpl.java index 43837569..6a78ab5e 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerMainServiceImpl.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerMainServiceImpl.java @@ -4,9 +4,13 @@ import cn.hutool.json.JSONUtil; import cn.iocoder.yudao.framework.common.exception.ServiceException; import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants; import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; +import cn.iocoder.yudao.module.custom.entity.CarMain; import cn.iocoder.yudao.module.custom.entity.CustomerItem; import cn.iocoder.yudao.module.custom.entity.CustomerMain; +import cn.iocoder.yudao.module.custom.mapper.CarMainMapper; import cn.iocoder.yudao.module.custom.mapper.CustomerMainMapper; +import cn.iocoder.yudao.module.custom.service.CarMainService; +import cn.iocoder.yudao.module.custom.service.CustomerCarService; import cn.iocoder.yudao.module.custom.service.CustomerItemService; import cn.iocoder.yudao.module.custom.service.CustomerMainService; import cn.iocoder.yudao.module.custom.vo.CustomerMainPageReqVO; @@ -39,6 +43,10 @@ public class CustomerMainServiceImpl extends ServiceImpl lambdaQueryWrapper = new LambdaQueryWrapper<>(); lambdaQueryWrapper.eq(BaseDO::getDeleted, 0).eq(CustomerItem::getCusId, id); List itemList = customerItemService.list(lambdaQueryWrapper); + /*3、车辆信息*/ + List carList = carMainMapper.selectListByCusId(id); CustomerMainRespVO result = JSONUtil.toBean(JSONUtil.parseObj(main).toJSONString(0), CustomerMainRespVO.class); result.setItemList(itemList); + result.setCarList(carList); return result; } diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerMainRespVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerMainRespVO.java index 4d4e22c8..89595c93 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerMainRespVO.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerMainRespVO.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.custom.vo; +import cn.iocoder.yudao.module.custom.entity.CarMain; import cn.iocoder.yudao.module.custom.entity.CustomerItem; import cn.iocoder.yudao.module.custom.entity.CustomerMain; import io.swagger.v3.oas.annotations.media.Schema; @@ -20,5 +21,7 @@ public class CustomerMainRespVO extends CustomerMain { private Integer carCount; /**扩展信息*/ List itemList; + /**客户绑定车辆信息*/ + List carList; } \ No newline at end of file diff --git a/dl-module-base/src/main/resources/mapper/custom/CarMainMapper.xml b/dl-module-base/src/main/resources/mapper/custom/CarMainMapper.xml index fcefc423..a1da41da 100644 --- a/dl-module-base/src/main/resources/mapper/custom/CarMainMapper.xml +++ b/dl-module-base/src/main/resources/mapper/custom/CarMainMapper.xml @@ -68,4 +68,13 @@ + \ No newline at end of file