package com.ningdatech.carapi.car.position.model.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.LocalDateTime;
import java.util.Objects;

/**
 * @author liuxinxin
 * @date 2022/10/8 下午2:30
 */

@ApiModel(description = "实时监控gis车辆详情")
@Data
public class ResRealTimeMonitorVehicleGisDetailVO {


    @ApiModelProperty("记录id")
    private String recordId;

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

    @ApiModelProperty("经度")
    private BigDecimal carLongitude;

    @ApiModelProperty("纬度")
    private BigDecimal carLatitude;

    @ApiModelProperty("海拔高度")
    private BigDecimal carAltitude;

    @ApiModelProperty("行驶速度")
    private BigDecimal carVelocity;

    @ApiModelProperty("行驶方向")
    private String carDirection;

    @ApiModelProperty("上传时间")
    private LocalDateTime uploadTime;

    @ApiModelProperty("在线状态")
    private String onlineStatus;

    @ApiModelProperty("运营商名称")
    private String operatorName;

    @ApiModelProperty("运营商id")
    private String operatorId;

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

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

    public BigDecimal getCarLatitude(){
        if(Objects.nonNull(this.carLatitude)){
            this.carLatitude = this.carLatitude.setScale(BigDecimal.ROUND_HALF_EVEN, RoundingMode.HALF_UP);
            return this.carLatitude;
        }
        return this.carLatitude;
    }

    public BigDecimal getCarLongitude(){
        if(Objects.nonNull(this.carLongitude)){
            this.carLongitude = this.carLongitude.setScale(BigDecimal.ROUND_HALF_EVEN, RoundingMode.HALF_UP);
            return this.carLongitude;
        }
        return this.carLongitude;
    }

    public BigDecimal getCarAltitude(){
        if(Objects.nonNull(this.carAltitude)){
            this.carAltitude = this.carAltitude.setScale(BigDecimal.ROUND_HALF_EVEN, RoundingMode.HALF_UP);
            return this.carAltitude;
        }
        return this.carAltitude;
    }

    public BigDecimal getCarVelocity(){
        if(Objects.nonNull(this.carVelocity)){
            this.carVelocity = this.carVelocity.setScale(BigDecimal.ROUND_HALF_EVEN, RoundingMode.HALF_UP);
            return this.carVelocity;
        }
        return this.carVelocity;
    }
}
