package com.sckw.transport.model.vo;

import com.sckw.transport.model.dto.TruckDto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;


/**
 * @author PC
 */
@Data
public class TruckInfoVo implements Serializable {
    @Serial
    private static final long serialVersionUID = -1005206382530999253L;
    /**
     * 运单号
     */
    @Schema(description = "运单号")
    private String orderNo;
    /**
     * 车牌号
     */
    @Schema(description = "车牌号")
    private String truckNo;
    /**
     * 车辆id
     */
    @Schema(description = "车辆id")
    private String truckId;
    /**
     * 司机id
     */
    @Schema(description = "司机id")
    private String driveId;
    /**
     * 司机名称
     */
    @Schema(description = "司机名称")
    private String driveName;
    /**
     * 承运单位
     */
    @Schema(description = "承运单位")
    private String  carrier ;

    /**
     * 司机手机号
     */
    @Schema(description = "司机手机号")
    private String drivePhone;
    /**
     * 运单状态
     */
    @Schema(description = "运单状态")

    private String taskStatus;

    /**
     * GPS状态
     */
    @Schema(description = "GPS状态(车速)")
    private String gpsStatus;
    /**
     * 经度
     */
    @Schema(description = "经度")
    private String longitude;
    /**
     * 纬度
     */
    @Schema(description = "纬度")
    private String latitude;


    /**
     * 定位时间
     */
    @Schema(description = "定位时间")
    private String locationTime;
    /**
     * 关联任务号
     */
    @Schema(description = "关联任务号")
    private String logicOrderNo;
    /**
     * 任务地点
     */
    @Schema(description = "任务地点")
    private String taskAddress;
    /**
     * 商品名称
     */
    @Schema(description = "商品名称")
    private String goodsName;

    /**
     * 轴数
     */
    @Schema(description = "轴数")
    private String axleNum;

    public static TruckInfoVo getInstance() {
        return new TruckInfoVo();
    }
    public static TruckInfoVo toTruckInfoVo(TruckDto truckDto ) {
        TruckInfoVo truckInfoVo = TruckInfoVo.getInstance();
        truckInfoVo.setOrderNo(truckDto.getWOrderNo());
        truckInfoVo.setTruckNo(truckDto.getTruckNo());
        truckInfoVo.setGpsStatus(truckDto.getGpsStatus());
        truckInfoVo.setLongitude(truckDto.getLongitude());
        truckInfoVo.setLatitude(truckDto.getLatitude());
        truckInfoVo.setLocationTime(truckDto.getLocationTime());
        truckInfoVo.setLogicOrderNo(truckDto.getLOrderNo());
        truckInfoVo.setTaskAddress(truckDto.getTaskAddress());
        return truckInfoVo;
    }
}
