package com.ningdatech.carapi.car.vehicle.model.po;

import java.util.Objects;

import org.apache.commons.lang3.StringUtils;

import com.ningdatech.carapi.common.constant.VehicleTypeEnum;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Classname VehicleCompanyPO
 * @Description
 * @Date 2022/10/26 11:05
 * @Created by PoffyZhang
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class VehicleCompanyPO {

    @ApiModelProperty("公司id")
    private Long companyId;

    @ApiModelProperty("使用企业id")
    private Long useCompanyId;

    @ApiModelProperty("公司名称")
    private String companyName;

    @ApiModelProperty("车牌号")
    private String carPlate;

    @ApiModelProperty("自编号")
    private String selfNo;

    @ApiModelProperty("状态")
    private Integer status;

    @ApiModelProperty("是否行驶")
    private Integer moving;

    @ApiModelProperty("车辆类型")
    private Integer vehicleType;

    @ApiModelProperty("车辆类型名")
    private String vehicleTypeName;

    @ApiModelProperty("运营商ID")
    private Long operatorId;

    public String getVechileTypeName(){
        if(Objects.nonNull(this.vehicleType)){
            this.vehicleTypeName = VehicleTypeEnum.getDescByCode(this.vehicleType);
            return this.vehicleTypeName;
        }
        return StringUtils.EMPTY;
    }
}
