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

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 java.io.Serializable;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

/**
 * <p>
 * 保险提醒
 * </p>
 *
 * @author xushuhan
 * @since 2023-11-07
 */
@Getter
@Setter
@TableName("tb_insurance_remind")
@ApiModel(value = "TbInsuranceRemind对象", description = "保险提醒")
@ColumnWidth(20)
public class TbInsuranceRemind implements Serializable {

    private static final long serialVersionUID = 1L;

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

    @ApiModelProperty("所属车辆")
    @ExcelIgnore
    @SelectQuery(Type = SelectQuery.SelectType.EQ)
    private String vehicleId;

    @ExcelProperty(value = "车牌号", index = 1)
    @SelectQuery
    private String plateNumber;

    @ApiModelProperty("所属项目")
    @ExcelIgnore
    @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 compulsoryStartTime;

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

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

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

    @ApiModelProperty("提醒保险id")
    @ExcelIgnore
    private String insuranceId;

    @ApiModelProperty("提醒状态（0已过期，1提醒中）")
    @ExcelProperty(value = "提醒状态", converter = DictConverter.class, index = 6)
    @Dict(dicCode = "remind_status")
    @SelectQuery(Type = SelectQuery.SelectType.EQ)
    private String status;

    @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;

    @ApiModelProperty("车架号")
    @SelectQuery
    @ExcelIgnore
    private String frameNumber;

    @ApiModelProperty("所属合同")
    @ExcelProperty(value = "所属合同", converter = DictConverter.class, index = 0)
    @SelectQuery(Type = SelectQuery.SelectType.EQ)
    @Dict(dictTable = "tb_contract", dicText = "name", dicCode = "id")
    private String contractId;

    @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 occurrenceNum;

    @TableField(exist = false)
    @ExcelProperty(value = "本期保费(元)", index = 8)
    public String currentPremium;

    @TableField(exist = false)
    @ExcelProperty(value = "下期保费(元)", index = 9)
    public String nextPremium;

    @TableField(exist = false)
    @ExcelIgnore
    public String commercialSurplusDay = "-";

    @TableField(exist = false)
    @ExcelIgnore
    public String commercialOverDay = "-";

    @ApiModelProperty("交强险有效日期开始")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @org.springframework.format.annotation.DateTimeFormat(pattern="yyyy-MM-dd")
    @TableField(exist = false)
    @ExcelIgnore
    private Date compulsoryValidTimeStart;

    @ApiModelProperty("交强险有效日期结束")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @org.springframework.format.annotation.DateTimeFormat(pattern="yyyy-MM-dd")
    @TableField(exist = false)
    @ExcelIgnore
    private Date compulsoryValidTimeEnd;

    @ApiModelProperty("商业保险有效日期开始")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @org.springframework.format.annotation.DateTimeFormat(pattern="yyyy-MM-dd")
    @TableField(exist = false)
    @ExcelIgnore
    private Date commercialValidTimeStart;

    @ApiModelProperty("商业保险有效日期结束")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @org.springframework.format.annotation.DateTimeFormat(pattern="yyyy-MM-dd")
    @TableField(exist = false)
    @ExcelIgnore
    private Date commercialValidTimeEnd;
    //1将逾期，2已逾期
    @TableField(exist = false)
    @ExcelIgnore
    private String isOverTime;
}
