车辆管理相关

This commit is contained in:
PQZ 2024-08-14 16:25:30 +08:00
parent 1f753ffa37
commit 8e2586a0e5
7 changed files with 103 additions and 9 deletions

View File

@ -120,14 +120,30 @@ public class CarMainController {
return success(pageResult);
}
/**
* 保险/年检/保养提醒列表
*
* @param pageReqVO CarMainReqVO入参
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<com.baomidou.mybatisplus.core.metadata.IPage < cn.iocoder.yudao.module.custom.vo.CarMainRespVO>>
* @author PQZ
* @date 11:01 2024/8/14
**/
@GetMapping("/remindCarMainPage")
@Operation(summary = "获得车辆信息分页")
public CommonResult<IPage<CarMainRespVO>> remindCarMainPage(CarMainReqVO pageReqVO) {
IPage<CarMainRespVO> pageResult = carMainService.remindCarMainPage(pageReqVO);
return success(pageResult);
}
/**
* 测算车辆下一次保养/检测/保险时间
* @author PQZ
* @date 11:48 2024/8/13
*
* @param pageReqVO CarMainReqVO
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<cn.iocoder.yudao.module.custom.vo.CarMainRespVO>
**/
* @author PQZ
* @date 11:48 2024/8/13
**/
@PostMapping("/compute")
@Operation(summary = "测算车辆下一次保养/检测/保险时间")
public CommonResult<CarMainRespVO> compute(@RequestBody CarMainReqVO pageReqVO) {
@ -135,6 +151,7 @@ public class CarMainController {
return success(result);
}
/**
* 导出车辆信息
*

View File

@ -29,6 +29,17 @@ public interface CarMainMapper extends BaseMapper<CarMain> {
*/
IPage<CarMainRespVO> findPage(Page<CarMainReqVO> page, @Param("dto") CarMainReqVO pageReqVO);
/**
* 保险/年检/保养提醒列表
*
* @param page Page<CarMainReqVO>
* @param pageReqVO CarMainReqVO
* @return com.baomidou.mybatisplus.core.metadata.IPage<cn.iocoder.yudao.module.custom.vo.CarMainRespVO>
* @author PQZ
* @date 9:12 2024/8/14
**/
IPage<CarMainRespVO> remindCarMainPage(Page<CarMainReqVO> page, @Param("entity") CarMainReqVO pageReqVO);
/**
* 获得车辆信息分页
*
@ -38,7 +49,6 @@ public interface CarMainMapper extends BaseMapper<CarMain> {
CarMainRespVO findOne(@Param("id") String id);
/**
* 车牌号车架号发动机号码 查重
*

View File

@ -60,6 +60,15 @@ public interface CarMainService extends IService<CarMain> {
*/
IPage<CarMainRespVO> getCarMainPage(CarMainReqVO pageReqVO);
/**
* 保险/年检/保养提醒列表
* @author PQZ
* @date 9:08 2024/8/14
* @param pageReqVO 查询条件
* @return com.baomidou.mybatisplus.core.metadata.IPage<cn.iocoder.yudao.module.custom.vo.CarMainRespVO>
**/
IPage<CarMainRespVO> remindCarMainPage(CarMainReqVO pageReqVO);
/**
* 绑定车辆信息

View File

@ -190,6 +190,20 @@ public class CarMainServiceImpl extends ServiceImpl<CarMainMapper, CarMain> impl
return baseMapper.findPage(page, pageReqVO);
}
/**
* 保险/年检/保养提醒列表
*
* @param pageReqVO 查询条件
* @return com.baomidou.mybatisplus.core.metadata.IPage<cn.iocoder.yudao.module.custom.vo.CarMainRespVO>
* @author PQZ
* @date 9:08 2024/8/14
**/
@Override
public IPage<CarMainRespVO> remindCarMainPage(CarMainReqVO pageReqVO) {
Page<CarMainReqVO> page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
return baseMapper.remindCarMainPage(page,pageReqVO);
}
/**
* 绑定客户信息
*

View File

@ -41,4 +41,8 @@ public class CarMainReqVO extends CarMain {
List<BusiLabel> labelList;
/**车辆品牌型号数组*/
List<String> brandAndModel;
/**客户名称*/
String cusName;
/**查询标识(01:年检临期02保养临期03保险临期)*/
String selectSign;
}

View File

@ -17,9 +17,6 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
@ExcelIgnoreUnannotated
public class CarMainRespVO extends CarMain {
/**是否车主0否1是*/
@Schema(description = "是否车主0否1是")
private String isOwner;
@ -33,8 +30,16 @@ public class CarMainRespVO extends CarMain {
String brandStr;
/**型号字符*/
String modelStr;
/**客户名称*/
String cusName;
/**电话号码*/
String phoneNumber;
/**年检剩余*/
String njCont;
/**保险剩余*/
String byCont;
/**保险剩余*/
String bxCont;
/**车辆品牌型号数组*/
List<String> brandAndModel;

View File

@ -109,5 +109,40 @@
</if>
</select>
<select id="remindCarMainPage" resultType="cn.iocoder.yudao.module.custom.vo.CarMainRespVO">
SELECT
<include refid="baseCarMainColumn"></include>,
bcc.is_owner AS isOwner,
bcm.cus_name AS cusName,
bcm.phone_number AS phoneNumber,
bcb.brand_name AS brandStr,
bcmm.model_name AS modelStr,
DATEDIFF(tbcm.next_inspection_date, CURDATE()) AS njCont,
DATEDIFF(tbcm.next_maintenance_date, CURDATE()) AS byCont,
DATEDIFF(tbcm.insurance_expiry_date, CURDATE()) AS bxCont
FROM
base_car_main tbcm
LEFT JOIN base_customer_car bcc ON tbcm.id = bcc.car_id AND bcc.deleted = 0
LEFT JOIN base_customer_main bcm ON bcc.cus_id = bcm.id AND bcm.deleted = 0
LEFT JOIN base_car_brand bcb ON bcb.deleted = 0 AND tbcm.car_brand = bcb.id
LEFT JOIN base_car_model bcmm ON bcmm.deleted = 0 AND tbcm.car_model = bcmm.id
WHERE
tbcm.deleted = 0
<if test="entity.licenseNumber != null and entity.licenseNumber != ''">
AND tbcm.license_number LIKE CONCAT('%',#{entity.licenseNumber},'%')
</if>
<if test="entity.cusName != null and entity.cusName != ''">
AND bcm.cus_name LIKE CONCAT('%',#{entity.cusName},'%')
</if>
<if test="entity.selectSign == '01'">
AND tbcm.next_inspection_date BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 3 MONTH)
</if>
<if test="entity.selectSign == '02'">
AND tbcm.next_maintenance_date BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 6 MONTH)
</if>
<if test="entity.selectSign == '03'">
AND tbcm.insurance_expiry_date BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 45 DAY)
</if>
</select>
</mapper>