package com.gci.boot.modules.vehicles.vo;

import java.io.Serializable;
import java.util.Date;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.gci.boot.annotation.Query.SelectQuery;
import com.gci.boot.annotation.fileUrl.FileUrl;
import com.gci.boot.annotation.fileUrl.handle.FileUrlHandle;
import com.gci.boot.common.dict.annotation.Dict;
import com.gci.boot.common.dict.excel.DictConverter;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

/**
 * <p>
 * 保险信息
 * </p>
 *
 * @author xushuhan
 * @since 2023-09-21
 */
@Getter
@Setter
@TableName("tb_insurance")
@ApiModel(value = "TbInsurance对象", description = "保险信息")
@ColumnWidth(20)
public class TbInsuranceRemindVo implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @ExcelIgnore
    private String id;

    @ApiModelProperty("所属车辆")
    @ExcelProperty(value = "车牌号", converter = DictConverter.class, index = 1)
    @Dict(dictTable = "tb_vehicle", dicText = "plate_number", dicCode = "id")
    @SelectQuery(Type = SelectQuery.SelectType.EQ)
    private String vehicleId;

    @ApiModelProperty("所属项目")
    @ExcelProperty(value = "所属项目", converter = DictConverter.class, index = 0)
    @Dict(dictTable = "tb_projects", dicText = "project_name", dicCode = "id")
    @SelectQuery(Type = SelectQuery.SelectType.EQ)
    private String projectId;

    @ApiModelProperty("是否购买交强险（0,1）")
    @ExcelIgnore
    private String hasCompulsoryInsurance;

    @ApiModelProperty("交强险保险单号")
    @SelectQuery
    @ExcelIgnore
    private String compulsoryInsuranceNo;

    @ApiModelProperty("交强险办理日期")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat("yyyy-MM-dd")
    @ExcelIgnore
    private Date compulsoryCreateDate;

    @ApiModelProperty("交强险保险公司")
    @Dict(dictTable = "tb_insurance_company_archives", dicText = "name", dicCode = "id")
    @SelectQuery(Type = SelectQuery.SelectType.EQ)
    @ExcelIgnore
    private String compulsoryCompanyId;

    @ApiModelProperty("交强险保险金额")
    @ExcelIgnore
    private Double compulsoryPrice;

    @ApiModelProperty("车船税")
    @ExcelIgnore
    private Double vehicleVesselTax;

    @ApiModelProperty("交强险起保日期")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat("yyyy-MM-dd")
    @ExcelIgnore
    private Date compulsoryStartTime;

    @ApiModelProperty("交强险有效日期")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat("yyyy-MM-dd")
    @ExcelProperty(value = "交强险有效日期", index = 3)
    private Date compulsoryValidTime;

    @ApiModelProperty("交强险附件")
    @ExcelIgnore
    @JsonDeserialize(using = FileUrlHandle.class)
    @FileUrl
    private String compulsoryUrl;

    @ApiModelProperty("是否购买商业保险（0,1）")
    @ExcelIgnore
    private String hasCommercialInsurance;

    @ApiModelProperty("商业保险单号")
    @SelectQuery
    @ExcelIgnore
    private String commercialInsuranceNo;

    @ApiModelProperty("商业保险办理日期")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat("yyyy-MM-dd")
    @ExcelIgnore
    private Date commercialCreateDate;

    @ApiModelProperty("商业保险公司")
    @Dict(dictTable = "tb_insurance_company_archives", dicText = "name", dicCode = "id")
    @SelectQuery(Type = SelectQuery.SelectType.EQ)
    @ExcelIgnore
    private String commercialCompanyId;

    @ApiModelProperty("商业保险费合计")
    @ExcelIgnore
    private Double commercialPrice;

    @ApiModelProperty("商业保险起保日期")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat("yyyy-MM-dd")
    @ExcelIgnore
    private Date commercialStartTime;

    @ApiModelProperty("商业保险有效日期")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat("yyyy-MM-dd")
    @ExcelProperty(value = "商业保险有效日期", index = 6)
    private Date commercialValidTime;

    @ApiModelProperty("商业保险附件")
    @ExcelIgnore
    @JsonDeserialize(using = FileUrlHandle.class)
    @FileUrl
    private String commercialUrl;
    
    @ApiModelProperty("备注")
    @ExcelIgnore
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String remark;

    @ApiModelProperty("所属机构")
    @ExcelIgnore
    private String sysOrgCode;

    @ApiModelProperty("创建时间")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    @ExcelIgnore
    private Date createTime;

    @ApiModelProperty("更新时间")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    @ExcelIgnore
    private Date updateTime;

    @ApiModelProperty("创建人")
    @ExcelIgnore
    private String createBy;

    @ApiModelProperty("更新人")
    @ExcelIgnore
    private String updateBy;
    
    @ExcelIgnore
    @ApiModelProperty("删除标志")
    private Integer delFlag;
    

    @ApiModelProperty("车辆型号")
    //@ExcelProperty(value = "车辆型号", index = 2)
    @ExcelIgnore
    @SelectQuery
    private String vehicleModel;

    @ApiModelProperty("车辆种类")
    @Dict(dicCode = "vehicle_type")
    @SelectQuery(Type = SelectQuery.SelectType.EQ)
    @ExcelProperty(value = "车辆种类", converter = DictConverter.class, index = 2)
    private String vehicleType;
    
    @TableField(exist = false)
    @ExcelProperty(value = "交强险到期天数", index = 4)
    public String compulsorySurplusDay = "-";
    
    @TableField(exist = false)
    @ExcelProperty(value = "交强险逾期天数", index = 5)
    public String compulsoryOverDay = "-";
    
    @TableField(exist = false)
    @ExcelProperty(value = "商业保险到期天数", index = 7)
    public String commercialSurplusDay = "-";
    
    @TableField(exist = false)
    @ExcelProperty(value = "商业保险逾期天数", index = 8)
    public String commercialOverDay = "-";

    
}
