我的车辆

This commit is contained in:
zhaotianfeng 2024-09-24 19:50:08 +08:00
parent 491e3d9e6e
commit 2d111bd7b1
8 changed files with 56 additions and 63 deletions

View File

@ -0,0 +1,32 @@
package cn.iocoder.yudao.module.app.car.controller;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.custom.entity.CarBrand;
import cn.iocoder.yudao.module.custom.service.CarBrandService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Tag(name = "小程序 - 车辆品牌维护")
@RestController
@RequestMapping("/userClient/base/carBrand")
@Validated
public class AppCarBrandController {
@Resource
private CarBrandService carBrandService;
@GetMapping("/list")
@Operation(summary = "获得全部车辆品牌")
public CommonResult<List<CarBrand>> getCarBrandList() {
List<CarBrand> carBrandList = carBrandService.getCarBrandList();
return success(carBrandList);
}
}

View File

@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.app.car.controller;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.app.car.entity.AppCarMain;
import cn.iocoder.yudao.module.app.car.service.AppCarMainService;
import cn.iocoder.yudao.module.app.car.vo.AppCarMainResVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
@ -71,9 +72,9 @@ public class AppCarMainController {
@GetMapping("/get")
@Operation(summary = "获得车辆信息")
// @PreAuthorize("@ss.hasPermission('base:car-main:query')")
public CommonResult<List<AppCarMain>> getCarMain() {
public CommonResult<List<AppCarMainResVo>> getCarMain() {
List<AppCarMain> carMain = carMainService.getCarMain();
List<AppCarMainResVo> carMain = carMainService.getCarMain();
return CommonResult.success(carMain);
}

View File

@ -1,52 +0,0 @@
package cn.iocoder.yudao.module.app.car.controller;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.module.custom.entity.CarModel;
import cn.iocoder.yudao.module.custom.service.CarModelService;
import cn.iocoder.yudao.module.custom.vo.CarModelReqVO;
import cn.iocoder.yudao.module.custom.vo.CarModelRespVO;
import cn.iocoder.yudao.module.custom.vo.CascaderOptionsVO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - 车辆品牌型号")
@RestController
@RequestMapping("/userClient/base/carModel")
@Validated
public class AppCarModelController {
@Autowired
private CarModelService carModelService;
/**
* 获得全部车辆品牌
*
* @return
*/
@GetMapping("/list")
@Operation(summary = "查询车辆品牌")
public CommonResult<List<CarModel>> getList() {
List<CarModel> carModelList = carModelService.getCarModelList();
return success(carModelList);
}
}

View File

@ -7,13 +7,9 @@ import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
/**
* 车辆信息 DO
@ -109,7 +105,7 @@ public class AppCarMain extends TenantBaseDO {
/**
* 车辆注册日期
*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
private Date carRegisterDate;
/**
* 行驶证图片

View File

@ -1,6 +1,7 @@
package cn.iocoder.yudao.module.app.car.mapper;
import cn.iocoder.yudao.module.app.car.entity.AppCarMain;
import cn.iocoder.yudao.module.app.car.vo.AppCarMainResVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -12,6 +13,6 @@ public interface AppCarMainMapper extends BaseMapper<AppCarMain> {
// 查询当前用户的所有车辆
List<AppCarMain> getUserCarMain(@Param("userId") Long userId);
List<AppCarMainResVo> getUserCarMain(@Param("userId") Long userId);
}

View File

@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.app.car.service;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.app.car.entity.AppCarMain;
import cn.iocoder.yudao.module.app.car.vo.AppCarMainResVo;
import cn.iocoder.yudao.module.custom.vo.CarMainRespVO;
import com.baomidou.mybatisplus.extension.service.IService;
@ -41,7 +42,7 @@ public interface AppCarMainService extends IService<AppCarMain> {
*
* @return 车辆信息
*/
List<AppCarMain> getCarMain();
List<AppCarMainResVo> getCarMain();

View File

@ -8,6 +8,7 @@ import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.app.car.entity.AppCarMain;
import cn.iocoder.yudao.module.app.car.mapper.AppCarMainMapper;
import cn.iocoder.yudao.module.app.car.service.AppCarMainService;
import cn.iocoder.yudao.module.app.car.vo.AppCarMainResVo;
import cn.iocoder.yudao.module.custom.entity.CustomerCar;
import cn.iocoder.yudao.module.custom.entity.CustomerMain;
import cn.iocoder.yudao.module.custom.mapper.CustomerCarMapper;
@ -99,9 +100,9 @@ public class AppCarMainServiceImpl extends ServiceImpl<AppCarMainMapper, AppCarM
* @return
*/
@Override
public List<AppCarMain> getCarMain() {
public List<AppCarMainResVo> getCarMain() {
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
List<AppCarMain> userCarMain = super.baseMapper.getUserCarMain(loginUser.getId());
List<AppCarMainResVo> userCarMain = super.baseMapper.getUserCarMain(loginUser.getId());
return userCarMain;

View File

@ -0,0 +1,13 @@
package cn.iocoder.yudao.module.app.car.vo;
import cn.iocoder.yudao.module.app.car.entity.AppCarMain;
import lombok.Data;
@Data
public class AppCarMainResVo extends AppCarMain {
// 品牌名称
private String brandName;
// 品牌图片路径
private String logoImg;
}