package com.sckw.fleet.model.vo;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.sckw.excel.annotation.ExcelContext;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serial;
import java.io.Serializable;

/**
 * @desc 车辆上报
 * @author zk
 * @date 2023/7/15
 */
@Data
@Accessors(chain = true)
@ExcelContext(fileName = "车辆上报信息", sheetName = "车辆上报信息")
public class KwfTruckReportVo implements Serializable {
    @Serial
    private static final long serialVersionUID = -7951209824419412486L;

    /**
     * 车辆主键id
     */
    @ExcelIgnore
    private Long id;

    /**
     * 车辆主键id
     */
    @ExcelIgnore
    private Long truckId;

    /**
     * 车牌号
     */
    @ExcelProperty(value = "车牌号")
    private String truckNo;

    /**
     * 状态(0正常、1锁定)
     */
    @ExcelIgnore
    private int status;

    /**
     * 认证状态（1认证、2临时、3异常）
     */
    @ExcelIgnore
    private Integer truckAuthStatus;

    /**
     * 认证状态
     */
    @ExcelProperty(value = "状态")
    private String truckAuthStatusName;

    /**
     * 司机主键id
     */
    @ExcelIgnore
    private Long driverId;

    /**
     * 司机姓名
     */
    @ExcelProperty(value = "司机姓名")
    private String driverName;

    /**
     * 司机电话
     */
    @ExcelProperty(value = "司机电话")
    private String driverPhone;

    /**
     * 司机身份证
     */
    @ExcelProperty(value = "司机身份证")
    private String driverIdcard;

    /**
     * 司机归档企业主键id
     */
    @ExcelIgnore
    private String driverEntId;

    /**
     * 司机归档企业
     */
    @ExcelProperty(value = "司机归档企业")
    private String driverFirmName;

    /**
     * 认证状态（1认证、2临时、3异常）
     */
    @ExcelIgnore
    private Integer driverAuthStatus;

    /**
     * 认证状态
     */
    @ExcelIgnore
    private String driverAuthStatusName;

    /**
     * 车辆归档企业主键id
     */
    @ExcelIgnore
    private String truckEntId;

    /**
     * 车辆归档企业
     */
    @ExcelProperty(value = "车辆归档企业")
    private String truckFirmName;

    /**
     * 车队班组主键id
     */
    @ExcelIgnore
    private String truckFleetId;

    /**
     * 车队班组
     */
    @ExcelProperty(value = "车队班组")
    private String truckFleetName;

    /**
     * 车辆类型
     */
    @ExcelIgnore
    private String truckType;

    /**
     * 车辆类型
     */
    @ExcelProperty(value = "车辆类型")
    private String truckTypeName;

    /**
     * 核载质量/吨
     */
    @ExcelProperty(value = "核载质量/吨")
    private double actualWeight;

    /**
     * 车牌颜色
     */
    @ExcelIgnore
    private String color;

    /**
     * 车牌颜色
     */
    @ExcelProperty(value = "车牌颜色")
    private String colorName;

    /**
     * 挂车号
     */
    @ExcelProperty(value = "挂车号")
    private String trailerNo;

    /**
     * 上报人
     */
    @ExcelIgnore
    private String createBy;

    /**
     * 上报人
     */
    @ExcelProperty(value = "上报人")
    private String createByName;

    /**
     * 上报时间
     */
    @ExcelProperty(value = "上报时间")
    private String createTime;

    /**
     * 更新时间
     */
    @ExcelProperty(value = "更新时间")
    private String updateTime;

    /**
     * 备注
     */
    @ExcelProperty(value = "备注")
    private String remark;


    public String getTruckAuthStatusName() {
        return truckAuthStatus == 1 ? "正常" : truckAuthStatus == 2 ? "临时" : "异常";
    }

    public String getDriverAuthStatusName() {
        return driverAuthStatus == 1 ? "正常" : driverAuthStatus == 2 ? "临时" : "异常";
    }
}
