From ffc02c97fcec58eabfc951db6bf9ab971da56992 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chhk=E2=80=9D?= <“hhk@mail.com”> Date: Tue, 6 Aug 2024 17:00:24 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=BD=A6=E8=BE=86=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E7=BB=91=E5=AE=9A=E5=AE=A2=E6=88=B7=E5=8F=AF=E7=94=A8=EF=BC=9B?= =?UTF-8?q?=E8=B0=83=E4=BC=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/admin/CarMainController.java | 17 +++- .../module/custom/mapper/CarMainMapper.java | 9 +- .../custom/mapper/CustomerCarMapper.java | 21 +++++ .../module/custom/service/CarMainService.java | 8 ++ .../service/impl/CarMainServiceImpl.java | 57 +++++++++++- .../service/impl/CustomerCarServiceImpl.java | 10 ++- .../service/impl/CustomerMainServiceImpl.java | 5 +- .../yudao/module/custom/vo/CarBrandReqVO.java | 4 + .../yudao/module/custom/vo/CarMainRespVO.java | 76 ++-------------- .../yudao/module/custom/vo/CarModelReqVO.java | 4 + .../module/custom/vo/CustomerMainRespVO.java | 3 + .../custom/vo/CustomerMainSaveReqVO.java | 2 + .../resources/mapper/custom/CarMainMapper.xml | 15 +--- .../mapper/custom/CustomerCarMapper.xml | 88 +++++++++++++++++++ .../mapper/custom/CustomerMainMapper.xml | 6 ++ 15 files changed, 228 insertions(+), 97 deletions(-) diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CarMainController.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CarMainController.java index 613be64a..4010dcdb 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CarMainController.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CarMainController.java @@ -4,6 +4,7 @@ import cn.iocoder.yudao.module.custom.entity.CarMain; import cn.iocoder.yudao.module.custom.service.CarMainService; import cn.iocoder.yudao.module.custom.vo.CarMainReqVO; import cn.iocoder.yudao.module.custom.vo.CarMainRespVO; +import cn.iocoder.yudao.module.custom.vo.CustomerMainSaveReqVO; import com.baomidou.mybatisplus.core.metadata.IPage; import org.springframework.web.bind.annotation.*; @@ -121,7 +122,7 @@ public class CarMainController { */ @GetMapping("/export-excel") @Operation(summary = "导出车辆信息 Excel") - @PreAuthorize("@ss.hasPermission('base:car-main:export')") + @PreAuthorize("@ss.hasPermission('base:car-main:customer')") @ApiAccessLog(operateType = EXPORT) public void exportCarMainExcel(CarMainReqVO pageReqVO, HttpServletResponse response) throws IOException { pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); @@ -131,4 +132,18 @@ public class CarMainController { BeanUtils.toBean(list, CarMainRespVO.class)); } + /** + * 绑定用户 + * + * @param saveReqVO CustomerMainSaveReqVO + * @return cn.iocoder.yudao.framework.common.pojo.CommonResult + **/ + @PostMapping("/bindCustomerCar") + @Operation(summary = "绑定用户") + @PreAuthorize("@ss.hasPermission('base:car-main:bindCustomer')") + public CommonResult bindCustomerCar(@RequestBody CustomerMainSaveReqVO saveReqVO) { + carMainService.bindCustomAndCar(saveReqVO); + return success(true); + } + } \ No newline at end of file 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 ee4fdf9c..e69e856f 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 @@ -29,14 +29,7 @@ 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); + /** * 车牌号,车架号,发动机号码 查重 diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/CustomerCarMapper.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/CustomerCarMapper.java index 5cd2e5cb..852e89e3 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/CustomerCarMapper.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/mapper/CustomerCarMapper.java @@ -1,8 +1,13 @@ package cn.iocoder.yudao.module.custom.mapper; import cn.iocoder.yudao.module.custom.entity.CustomerCar; +import cn.iocoder.yudao.module.custom.vo.CarMainRespVO; +import cn.iocoder.yudao.module.custom.vo.CustomerMainRespVO; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 客户车辆管理关联Mapper @@ -12,5 +17,21 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface CustomerCarMapper extends BaseMapper { + /** + * 通过客户id查询车辆信息 + * @author PQZ + * @date 15:19 2024/8/3 + * @param cusId 客户id + * @return java.util.List + **/ + List selectCarListByCusId(@Param("cusId") String cusId); + + /** + * 通过车辆id查询客户信息 + * + * @param carId 车辆id + * @return java.util.List + **/ + List selectCusListByCarId(@Param("carId") String carId); } \ No newline at end of file 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 1b48753e..8dbf9ec2 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 @@ -7,6 +7,7 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.module.custom.entity.CarMain; import cn.iocoder.yudao.module.custom.vo.CarMainReqVO; import cn.iocoder.yudao.module.custom.vo.CarMainRespVO; +import cn.iocoder.yudao.module.custom.vo.CustomerMainSaveReqVO; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; @@ -58,4 +59,11 @@ public interface CarMainService extends IService { IPage getCarMainPage(CarMainReqVO pageReqVO); + /** + * 绑定车辆信息 + * + * @param saveReqVO CustomerMainSaveReqVO实体 + * @return void + **/ + void bindCustomAndCar(CustomerMainSaveReqVO saveReqVO); } \ 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 2d218ada..2e801f00 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 @@ -1,21 +1,37 @@ package cn.iocoder.yudao.module.custom.service.impl; import cn.hutool.core.util.ObjectUtil; +import cn.hutool.json.JSONUtil; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; import cn.iocoder.yudao.module.custom.entity.CarMain; +import cn.iocoder.yudao.module.custom.entity.CustomerCar; +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.CustomerCarMapper; import cn.iocoder.yudao.module.custom.service.CarMainService; +import cn.iocoder.yudao.module.custom.service.CustomerCarService; import cn.iocoder.yudao.module.custom.vo.CarMainReqVO; import cn.iocoder.yudao.module.custom.vo.CarMainRespVO; +import cn.iocoder.yudao.module.custom.vo.CustomerMainRespVO; +import cn.iocoder.yudao.module.custom.vo.CustomerMainSaveReqVO; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import javax.annotation.Resource; +import java.util.ArrayList; import java.util.List; +import static cn.iocoder.yudao.common.BaseConstants.CUS_SIGN_CAR; +import static cn.iocoder.yudao.common.BaseConstants.CUS_SIGN_CUSTOMER; + /** * 车辆信息 Service 实现类 * @@ -24,6 +40,12 @@ import java.util.List; @Service public class CarMainServiceImpl extends ServiceImpl implements CarMainService{ + @Autowired + private CustomerCarMapper customerCarMapper; + + @Autowired + private CustomerCarService customerCarService; + /** * 创建车辆信息 * @@ -97,9 +119,16 @@ public class CarMainServiceImpl extends ServiceImpl impl * @return */ @Override - public CarMain getCarMain(String id) { + public CarMainRespVO getCarMain(String id) { //数据单查 - return baseMapper.selectById(id); + CarMain carMain = baseMapper.selectById(id); + CarMainRespVO result = BeanUtils.toBean(carMain, CarMainRespVO.class); + + //联查客户信息 + List cusList = customerCarMapper.selectCusListByCarId(id); + result.setCusList(cusList); + + return result; } /** @@ -116,6 +145,29 @@ public class CarMainServiceImpl extends ServiceImpl impl return baseMapper.findPage(page,pageReqVO); } + /** + * 绑定客户信息 + * + * @param saveReqVO CustomerMainSaveReqVO实体 + * @return void + **/ + @Override + public void bindCustomAndCar(CustomerMainSaveReqVO saveReqVO) { + List customerCars = new ArrayList<>(); + List cusList = saveReqVO.getCusList(); + if (ObjectUtil.isNotEmpty(cusList)){ + //组装数据 + cusList.forEach(item -> { + CustomerCar customerCar = new CustomerCar(); + customerCar.setCarId(saveReqVO.getId()); + customerCar.setCusId(item.getId()); + customerCar.setIsOwner(item.getIsOwner()); + customerCars.add(customerCar); + }); + } + customerCarService.bindCustomerCar(saveReqVO.getId(),CUS_SIGN_CAR,customerCars); + } + /** * 车牌号,车架号,发动机号码 查重 * @param reqVO @@ -192,4 +244,5 @@ public class CarMainServiceImpl extends ServiceImpl impl } + } \ No newline at end of file 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 aa3cda8d..015b7c9b 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 @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.custom.service.impl; +import cn.hutool.core.util.ObjectUtil; import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; import cn.iocoder.yudao.module.custom.entity.CustomerCar; import cn.iocoder.yudao.module.custom.mapper.CustomerCarMapper; @@ -11,6 +12,7 @@ import org.springframework.validation.annotation.Validated; import java.util.List; +import static cn.iocoder.yudao.common.BaseConstants.CUS_SIGN_CAR; import static cn.iocoder.yudao.common.BaseConstants.CUS_SIGN_CUSTOMER; /** @@ -41,13 +43,15 @@ public class CustomerCarServiceImpl extends ServiceImpl { //防止主键重复 item.setId(null); 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 1053528a..67ee6709 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 @@ -9,6 +9,7 @@ import cn.iocoder.yudao.module.custom.entity.CustomerCar; 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.CustomerCarMapper; import cn.iocoder.yudao.module.custom.mapper.CustomerMainMapper; import cn.iocoder.yudao.module.custom.service.CarMainService; import cn.iocoder.yudao.module.custom.service.CustomerCarService; @@ -50,7 +51,7 @@ public class CustomerMainServiceImpl extends ServiceImpl itemList = customerItemService.list(lambdaQueryWrapper); /*3、车辆信息*/ - List carList = carMainMapper.selectListByCusId(id); + List carList = customerCarMapper.selectCarListByCusId(id); CustomerMainRespVO result = JSONUtil.toBean(JSONUtil.parseObj(main).toJSONString(0), CustomerMainRespVO.class); result.setItemList(itemList); result.setCarList(carList); diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CarBrandReqVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CarBrandReqVO.java index 77f85f80..129f2082 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CarBrandReqVO.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CarBrandReqVO.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.custom.vo; +import com.alibaba.excel.annotation.ExcelProperty; import lombok.*; import java.util.*; import io.swagger.v3.oas.annotations.media.Schema; @@ -16,6 +17,9 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ @ToString(callSuper = true) public class CarBrandReqVO extends PageParam { + @Schema(description = "主键标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "8714") + private String id; + @Schema(description = "品牌名称", example = "李四") private String brandName; diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CarMainRespVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CarMainRespVO.java index a3f8fd0e..49e46ca5 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CarMainRespVO.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CarMainRespVO.java @@ -1,6 +1,7 @@ package cn.iocoder.yudao.module.custom.vo; import cn.iocoder.yudao.module.custom.entity.CarMain; +import cn.iocoder.yudao.module.custom.entity.CustomerMain; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import java.util.*; @@ -15,79 +16,20 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ @ExcelIgnoreUnannotated public class CarMainRespVO extends CarMain { - @Schema(description = "主键标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "8714") - @ExcelProperty("主键标识") - private String id; - - @Schema(description = "发动机号码", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("发动机号码") - private String engineNumber; - - @Schema(description = "车架号", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("车架号") - private String vin; - - @Schema(description = "车牌号", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("车牌号") - private String licenseNumber; - - @Schema(description = "车辆型号") - @ExcelProperty("车辆型号") - private String carModel; - - @Schema(description = "保养日期") - @ExcelProperty("保养日期") - private LocalDateTime maintenanceDate; - - @Schema(description = "保养里程") - @ExcelProperty("保养里程") - private String maintenanceMileage; - - @Schema(description = "年检日期", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("年检日期") - private LocalDateTime inspectionDate; - - @Schema(description = "保险日期") - @ExcelProperty("保险日期") - private LocalDateTime insuranceDate; - - @Schema(description = "二级维护时间") - @ExcelProperty("二级维护时间") - private LocalDateTime checkDate; - - @Schema(description = "车辆品牌", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("车辆品牌") - private String carBrand; - - @Schema(description = "车辆性质:营运 非营运等", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("车辆性质") - private String carNature; - - @Schema(description = "车辆类别:私家车 货车 教练车 公务车 出租车") - @ExcelProperty("车辆类别") - private String carCategory; - - @Schema(description = "车辆注册日期", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("车辆注册日期") - private LocalDateTime carRegisterDate; - - @Schema(description = "行驶证图片") - @ExcelProperty("行驶证图片") - private String carLicenseImg; - - @Schema(description = "最近办理业务") - @ExcelProperty("最近办理业务") - private String recentlyHandledBusiness; - - @Schema(description = "最近办理业务的时间") - @ExcelProperty("最近办理业务的时间") - private LocalDateTime recentlyHandleBusinessTime; @Schema(description = "创建时间") @ExcelProperty("创建时间") private LocalDateTime createTime; /**是否车主(0否1是)*/ + @Schema(description = "是否车主(0否1是)") private String isOwner; + @Schema(description = "创建时间") + private List cusList; + + + + + } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CarModelReqVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CarModelReqVO.java index 52c64c77..1781f598 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CarModelReqVO.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CarModelReqVO.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.custom.vo; +import com.alibaba.excel.annotation.ExcelProperty; import lombok.*; import java.util.*; import io.swagger.v3.oas.annotations.media.Schema; @@ -16,6 +17,9 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ @ToString(callSuper = true) public class CarModelReqVO extends PageParam { + @Schema(description = "主键标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "8714") + private String id; + @Schema(description = "排序") private Integer sort; 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 4d8af54b..792a9d1a 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 @@ -24,4 +24,7 @@ public class CustomerMainRespVO extends CustomerMain { /**经办人信息集合*/ List attnList; + /**是否车主(0否1是)*/ + private String isOwner; + } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerMainSaveReqVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerMainSaveReqVO.java index 0cb5b069..1675c3ec 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerMainSaveReqVO.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerMainSaveReqVO.java @@ -15,5 +15,7 @@ public class CustomerMainSaveReqVO extends CustomerMain { private List itemList; /**客户绑定车辆信息*/ private List carList; + /**客户绑定车辆信息*/ + private List cusList; } \ 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 9f6a472f..f9fd3c5a 100644 --- a/dl-module-base/src/main/resources/mapper/custom/CarMainMapper.xml +++ b/dl-module-base/src/main/resources/mapper/custom/CarMainMapper.xml @@ -89,18 +89,5 @@ - + \ No newline at end of file diff --git a/dl-module-base/src/main/resources/mapper/custom/CustomerCarMapper.xml b/dl-module-base/src/main/resources/mapper/custom/CustomerCarMapper.xml index 9351a626..7ecdf257 100644 --- a/dl-module-base/src/main/resources/mapper/custom/CustomerCarMapper.xml +++ b/dl-module-base/src/main/resources/mapper/custom/CustomerCarMapper.xml @@ -2,4 +2,92 @@ + + tbcarm.id, + tbcarm.engine_number, + tbcarm.vin, + tbcarm.license_number, + tbcarm.car_model, + tbcarm.maintenance_date, + tbcarm.maintenance_mileage, + tbcarm.inspection_date, + tbcarm.insurance_date, + tbcarm.check_date, + tbcarm.next_maintenance_date, + tbcarm.next_maintenance_mileage, + tbcarm.next_inspection_date, + tbcarm.insurance_expiry_date, + tbcarm.next_check_date, + tbcarm.car_brand, + tbcarm.car_nature, + tbcarm.car_category, + tbcarm.car_register_date, + tbcarm.car_license_img, + tbcarm.recently_handled_business, + tbcarm.recently_handle_business_time, + tbcarm.deleted, + tbcarm.creator, + tbcarm.create_time, + tbcarm.updater, + tbcarm.update_time + + + + tbcusm.id, + tbcusm.user_id, + tbcusm.type_code, + tbcusm.dept_code, + tbcusm.cus_name, + tbcusm.phone_number, + tbcusm.birthday, + tbcusm.address, + tbcusm.sex, + tbcusm.id_card, + tbcusm.id_card_image, + tbcusm.data_from, + tbcusm.near_do_time, + tbcusm.near_do_content, + tbcusm.inviter, + tbcusm.inviter_type, + tbcusm.status, + tbcusm.tenant_id, + tbcusm.deleted, + tbcusm.creator, + tbcusm.create_time, + tbcusm.updater, + tbcusm.update_time + + + + + + \ No newline at end of file diff --git a/dl-module-base/src/main/resources/mapper/custom/CustomerMainMapper.xml b/dl-module-base/src/main/resources/mapper/custom/CustomerMainMapper.xml index e6064cb1..0d48b8a8 100644 --- a/dl-module-base/src/main/resources/mapper/custom/CustomerMainMapper.xml +++ b/dl-module-base/src/main/resources/mapper/custom/CustomerMainMapper.xml @@ -50,6 +50,12 @@ AND item.system_code = #{entity.systemCode} + + AND main.phoneNumber LIKE concat('%',#{entity.phoneNumber},'%') + + + AND main.idCard LIKE concat('%',#{entity.idCard},'%') + GROUP BY main.id ORDER BY main.create_time DESC From c5e357a16c97eecdf96f93d6794e6deb39d64823 Mon Sep 17 00:00:00 2001 From: PQZ Date: Tue, 6 Aug 2024 17:12:51 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iocoder/yudao/common/BaseConstants.java | 2 ++ .../admin/CustomerMainController.java | 19 +++++++++++++++++++ .../service/impl/CustomerMainServiceImpl.java | 7 +++++++ .../module/custom/vo/CustomerMainRespVO.java | 3 +++ .../custom/vo/CustomerMainSaveReqVO.java | 3 +++ .../yudao/module/label/entity/BusiLabel.java | 2 ++ 6 files changed, 36 insertions(+) diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/common/BaseConstants.java b/dl-module-base/src/main/java/cn/iocoder/yudao/common/BaseConstants.java index 422197ef..0ec319f4 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/common/BaseConstants.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/common/BaseConstants.java @@ -11,4 +11,6 @@ public class BaseConstants { public static final String CUS_SIGN_CUSTOMER = "customer"; /**车辆标识*/ public static final String CUS_SIGN_CAR = "car"; + /**客户信息表名称*/ + public static final String TABLE_BASE_CUSTOMER_MAIN = "base_customer_main"; } diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CustomerMainController.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CustomerMainController.java index 8b3b1d4d..8d2336eb 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CustomerMainController.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/controller/admin/CustomerMainController.java @@ -6,6 +6,7 @@ import cn.iocoder.yudao.module.custom.service.CustomerMainService; import cn.iocoder.yudao.module.custom.vo.CustomerMainPageReqVO; import cn.iocoder.yudao.module.custom.vo.CustomerMainRespVO; import cn.iocoder.yudao.module.custom.vo.CustomerMainSaveReqVO; +import cn.iocoder.yudao.module.label.service.BusiLabelService; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import io.swagger.v3.oas.annotations.Operation; @@ -20,6 +21,7 @@ import javax.validation.Valid; import java.util.List; +import static cn.iocoder.yudao.common.BaseConstants.TABLE_BASE_CUSTOMER_MAIN; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; /** @@ -35,6 +37,8 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; public class CustomerMainController { @Resource private CustomerMainService customerMainService; + @Resource + private BusiLabelService busiLabelService; /** * 客户管理分页列表查询 @@ -153,4 +157,19 @@ public class CustomerMainController { return success(true); } + /** + * 设置标签 + * + * @param saveReqVO CustomerMainSaveReqVO + * @return cn.iocoder.yudao.framework.common.pojo.CommonResult + * @author PQZ + * @date 16:35 2024/8/6 + **/ + @PostMapping("/setLabel") + @Operation(summary = "设置标签") + public CommonResult setLabel(@Valid @RequestBody CustomerMainSaveReqVO saveReqVO) { + busiLabelService.saveBusiLable(saveReqVO.getId(), TABLE_BASE_CUSTOMER_MAIN, saveReqVO.getLabelList()); + return success(true); + } + } \ 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 1053528a..87a137b5 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 @@ -18,6 +18,8 @@ import cn.iocoder.yudao.module.custom.vo.CarMainRespVO; import cn.iocoder.yudao.module.custom.vo.CustomerMainPageReqVO; import cn.iocoder.yudao.module.custom.vo.CustomerMainRespVO; import cn.iocoder.yudao.module.custom.vo.CustomerMainSaveReqVO; +import cn.iocoder.yudao.module.label.entity.BusiLabel; +import cn.iocoder.yudao.module.label.service.BusiLabelService; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -51,6 +53,8 @@ public class CustomerMainServiceImpl extends ServiceImpl labelList = busiLabelService.listByMainId(id); + result.setLabelList(labelList); 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 4d8af54b..ae99f744 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 @@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.custom.vo; import cn.iocoder.yudao.module.custom.entity.CustomerItem; import cn.iocoder.yudao.module.custom.entity.CustomerMain; +import cn.iocoder.yudao.module.label.entity.BusiLabel; import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @@ -23,5 +24,7 @@ public class CustomerMainRespVO extends CustomerMain { List carList; /**经办人信息集合*/ List attnList; + /**标签信息*/ + List labelList; } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerMainSaveReqVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerMainSaveReqVO.java index 0cb5b069..1989cd30 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerMainSaveReqVO.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerMainSaveReqVO.java @@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.custom.vo; import cn.iocoder.yudao.module.custom.entity.CustomerItem; import cn.iocoder.yudao.module.custom.entity.CustomerMain; +import cn.iocoder.yudao.module.label.entity.BusiLabel; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @@ -15,5 +16,7 @@ public class CustomerMainSaveReqVO extends CustomerMain { private List itemList; /**客户绑定车辆信息*/ private List carList; + /**标签信息*/ + List labelList; } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/label/entity/BusiLabel.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/label/entity/BusiLabel.java index 091e6f60..8a4458ad 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/label/entity/BusiLabel.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/label/entity/BusiLabel.java @@ -49,5 +49,7 @@ public class BusiLabel extends TenantBaseDO { * 系统标识 */ private String systemCode; + /**标签库类型*/ + private String labelType; } \ No newline at end of file