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

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.*;

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

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
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.validated.SaveValidated;
import com.gci.boot.common.validated.UpdateValidated;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Size;

/**
 * <p>
 * 事件进度信息
 * </p>
 *
 * @author 2464
 * @since 2023-09-13
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("tb_accident_progress")
@ApiModel(value = "TbAccidentProgress对象", description = "事件进度信息")
public class TbAccidentProgress implements Serializable {

    private static final long serialVersionUID = 1L;

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

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

    @ApiModelProperty("创建时间")
    private Date createTime;

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

    @ApiModelProperty("更新时间")
    private Date updateTime;

    @ApiModelProperty("更新人")
    private String updateBy;

    @ApiModelProperty("事故信息主表id")
    private String infoId;

    @ApiModelProperty("是否结案")
    @Dict(dicCode = "yes_no")
    @Excel(name = "是否结案",dict = "yes_no",groupName = "案件进度",orderNum = "40")
    private String caseClosed;

    @ApiModelProperty("结案时间")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    @Excel(name = "结案时间",format = "yyyy-MM-dd",groupName = "案件进度",orderNum = "41")
    private Date closingTime;

    @ApiModelProperty("备注")
    @Size(max = 512,message = "备注不能超过512位字符！",groups = {SaveValidated.class, UpdateValidated.class})
    @Excel(name = "备注",groupName = "案件进度",orderNum = "42")
    private String remarks;

    @ApiModelProperty("事故认定书")
//    @Size(max = 5000,message = "事故认定书图片文件名过长请修改！",groups = {SaveValidated.class, UpdateValidated.class})
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    @JsonDeserialize(using = FileUrlHandle.class)
    @FileUrl
    private String accidentCertificatePhoto;

    @ApiModelProperty("赔偿协议书")
//    @Size(max = 5000,message = "赔偿协议书图片文件名过长请修改！",groups = {SaveValidated.class, UpdateValidated.class})
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    @JsonDeserialize(using = FileUrlHandle.class)
    @FileUrl
    private String compensationAgreementPhoto;

    @ApiModelProperty("定损单")
//    @Size(max = 5000,message = "定损单图片文件名过长请修改！",groups = {SaveValidated.class, UpdateValidated.class})
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    @JsonDeserialize(using = FileUrlHandle.class)
    @FileUrl
    private String lossAssessmentPhoto;

    @ApiModelProperty("其他")
//    @Size(max = 5000,message = "其他图片文件名过长请修改！",groups = {SaveValidated.class, UpdateValidated.class})
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    @JsonDeserialize(using = FileUrlHandle.class)
    @FileUrl
    private String otherPhoto;


}
