package com.sckw.fleet.model.vo;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.sckw.excel.annotation.ExcelContext;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

/**
 * @author zk
 * @desc 司机档案
 * @date 2023/7/7 0007
 */
@Data
@Accessors(chain = true)
@ExcelContext(fileName = "司机信息", sheetName = "司机信息")
public class KwfDriverVo implements Serializable {
    @Serial
    private static final long serialVersionUID = -7951209824419412386L;

    /**
     * 司机主键id
     */
    @ExcelIgnore
    private String id;

    /**
     * 司机姓名
     */
    @ExcelProperty(value = "司机姓名", index = 0)
    private String name;

    /**
     * 电话
     */
    @ExcelProperty(value = "电话", index = 1)
    private String phone;

    /**
     * 认证状态
     */
    @ExcelProperty(value = "状态", index = 2)
    private String authStatusName;

    /**
     * 身份证号
     */
    @ExcelProperty(value = "身份证号", index = 3)
    private String idcard;

    /**
     * 身份证有效时间
     */
    @ExcelProperty(value = "身份证有效时间", index = 4)
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd")
    private Date idcardExpireTime;

    /**
     * 身份证住址
     */
    @ExcelProperty(value = "身份证住址", index = 5)
    private String address;

    /**
     * 驾驶证编号
     */
    @ExcelProperty(value = "驾驶证编号", index = 6)
    private String driverNo;

    /**
     * 准驾车型
     */
    @ExcelProperty(value = "准驾车型", index = 7)
    private String licenseType;

    /**
     * 准驾车型
     */
    @ExcelIgnore
    private String licenseTypeName;

    /**
     * 驾驶证有效期至
     */
    @ExcelProperty(value = "驾驶证有效期至", index = 8)
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd")
    private Date licenseExpireTime;

    /**
     * 驾驶证发证机关
     */
    @ExcelProperty(value = "驾驶证发证机关", index = 9)
    private String licenseGrantUnit;

    /**
     * 从业资格证号
     */
    @ExcelProperty(value = "从业资格证号", index = 10)
    private String qualiNo;

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

    /**
     * 企业主键ID
     */
    @ExcelIgnore
    private String entId;

    /**
     * 企业名称
     */
    @ExcelProperty(value = "企业名称", index = 12)
    private String firmName;

    /**
     * 车队班组
     */
    @ExcelIgnore
    private String fleetId;

    /**
     * 车队班组
     */
    @ExcelProperty(value = "车队班组", index = 13)
    private String fleetName;

    /**
     * 创建人
     */
    @ExcelIgnore
    private String createBy;

    /**
     * 创建人
     */
    @ExcelProperty(value = "创建人", index = 14)
    private String createByName;

    /**
     * 创建时间
     */
    @ExcelProperty(value = "创建时间", index = 15)
    private String createTime;

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

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

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

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

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