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.math.BigDecimal;
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.*;

/**
 * <p>
 * 事故保险信息
 * </p>
 *
 * @author 2464
 * @since 2023-09-13
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("tb_accident_insurance_info")
@ApiModel(value = "TbAccidentInsuranceInfo对象", description = "事故保险信息")
public class TbAccidentInsuranceInfo 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("交案回执单号")
    @Size(max = 32,message = "交案回执单号不能超过32位字符！",groups = {SaveValidated.class, UpdateValidated.class})
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    @Excel(name = "交案回执单号",groupName = "保险信息",orderNum = "22")
    private String caseReceiptNumber;

    @ApiModelProperty("确认事故责任")
    @Dict(dicCode = "liability_type")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    @Excel(name = "确认事故责任",dict = "liability_type",groupName = "保险信息",orderNum = "23")
    private String liabilityConfirm;

    @ApiModelProperty("确认事故性质")
    @Dict(dicCode = "nature_type")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    @Excel(name = "确认事故性质",dict = "nature_type",groupName = "保险信息",orderNum = "27")
    private String natureConfirm;

    @ApiModelProperty("标的车损失金额")
    @Digits(integer = 9,fraction = 2,message = "标的车损失金额整数部分不能大于9位，小数部分不能大于2位",groups = {SaveValidated.class, UpdateValidated.class})
    @Excel(name = "标的车损失金额",groupName = "保险信息",orderNum = "28")
    private BigDecimal vehicleLossAmount;

    @ApiModelProperty("标的车人伤金额")
    @Digits(integer = 9,fraction = 2,message = "标的车人伤金额整数部分不能大于9位，小数部分不能大于2位",groups = {SaveValidated.class, UpdateValidated.class})
    @Min(value = 0,message = "标的车人伤金额最小值为0！",groups = {SaveValidated.class,UpdateValidated.class})
    @Excel(name = "标的车人伤金额",groupName = "保险信息",orderNum = "29")
    private BigDecimal vehiclePersonalInjuryAmount;

    @ApiModelProperty("第三方物损金额")
    @Digits(integer = 9,fraction = 2,message = "第三方物损金额整数部分不能大于9位，小数部分不能大于2位",groups = {SaveValidated.class, UpdateValidated.class})
    @Min(value = 0,message = "第三方物损金额最小值为0！",groups = {SaveValidated.class,UpdateValidated.class})
    @Excel(name = "第三方物损金额",groupName = "保险信息",orderNum = "30")
    private BigDecimal thirdPropertyDamageAmount;

    @ApiModelProperty("第三方人伤金额")
    @Digits(integer = 9,fraction = 2,message = "第三方人伤金额整数部分不能大于9位，小数部分不能大于2位",groups = {SaveValidated.class, UpdateValidated.class})
    @Min(value = 0,message = "第三方人伤金额最小值为0！",groups = {SaveValidated.class,UpdateValidated.class})
    @Excel(name = "第三方人伤金额",groupName = "保险信息",orderNum = "31")
    private BigDecimal thirdPersonalInjuryAmount;

    @ApiModelProperty("预估损失总金额")
    @Digits(integer = 10,fraction = 2,message = "预估损失总金额整数部分不能大于10位，小数部分不能大于2位",groups = {SaveValidated.class, UpdateValidated.class})
    @Min(value = 0,message = "预估损失总金额最小值为0！",groups = {SaveValidated.class,UpdateValidated.class})
    @Excel(name = "预估损失总金额",groupName = "保险信息",orderNum = "32")
    private BigDecimal estimatedTotalLossAmount;

    @ApiModelProperty("理赔至公司账户日期")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @Excel(name = "理赔至公司账户日期",format = "yyyy-MM-dd",groupName = "保险信息",orderNum = "33")
    private Date claimToCompanyAccountDate;

    @ApiModelProperty("理赔至公司账户金额")
    @Digits(integer = 9,fraction = 2,message = "理赔至公司账户金额整数部分不能大于9位，小数部分不能大于2位",groups = {SaveValidated.class, UpdateValidated.class})
    @Min(value = 0,message = "理赔至公司账户金额最小值为0！",groups = {SaveValidated.class,UpdateValidated.class})
    @Excel(name = "理赔至公司账户金额",groupName = "保险信息",orderNum = "34")
    private BigDecimal claimToCompanyAccountAmount;

    @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 = "35")
    private Date claimToThirdAccountDate;

    @ApiModelProperty("理赔至第三方账户金额")
    @Digits(integer = 9,fraction = 2,message = "理赔至第三方账户金额整数部分不能大于9位，小数部分不能大于2位",groups = {SaveValidated.class, UpdateValidated.class})
    @Min(value = 0,message = "理赔至第三方账户金额最小值为0！",groups = {SaveValidated.class,UpdateValidated.class})
    @Excel(name = "理赔至第三方账户金额",groupName = "保险信息",orderNum = "36")
    private BigDecimal claimToThirdAccountAmount;

    @ApiModelProperty("赔偿单据图片")
    @JsonDeserialize(using = FileUrlHandle.class)
    @FileUrl
    private String documentImage;

    @ApiModelProperty("出险赔偿总金额")
    @Digits(integer = 10,fraction = 2,message = "出险赔偿总金额部分不能大于10位，小数部分不能大于2位",groups = {SaveValidated.class, UpdateValidated.class})
    @Min(value = 0,message = "出险赔偿总金额最小值为0！",groups = {SaveValidated.class,UpdateValidated.class})
    @Excel(name = "出险赔偿总金额",groupName = "保险信息",orderNum = "37")
    private BigDecimal totalCompensationAmount;

    @ApiModelProperty("出险未赔偿金额")
    @Digits(integer = 9,fraction = 2,message = "出险未赔偿金额整数部分不能大于9位，小数部分不能大于2位",groups = {SaveValidated.class, UpdateValidated.class})
    @Min(value = 0,message = "出险未赔偿金额最小值为0！",groups = {SaveValidated.class,UpdateValidated.class})
    @Excel(name = "出险未赔偿金额",groupName = "保险信息",orderNum = "38")
    private BigDecimal uncompensatedAmount;

    @ApiModelProperty("案件实际发生总金额")
    @Digits(integer = 10,fraction = 2,message = "案件实际发生总金额整数部分不能大于10位，小数部分不能大于2位",groups = {SaveValidated.class, UpdateValidated.class})
    @Min(value = 0,message = "案件实际发生总金额最小值为0！",groups = {SaveValidated.class,UpdateValidated.class})
    @Excel(name = "案件实际发生总金额",groupName = "保险信息",orderNum = "39")
    private BigDecimal totalAmountActuallyIncurred;

    @ApiModelProperty("是否同步出险")
    @Dict(dicCode = "yes_no")
    @NotNull(message = "是否同步出险不能为空！",groups = {SaveValidated.class,UpdateValidated.class})
    @Excel(name = "是否同步出险",dict = "yes_no",groupName = "保险信息",orderNum = "24")
    private String isRecord;

    @ApiModelProperty("保险公司")
    @Dict(dictTable = "tb_insurance_company_archives", dicText = "name", dicCode = "id")
    @Excel(name = "保险公司",dict = "tb_insurance_company_archives,name,id",groupName = "保险信息",orderNum = "25")
    private String companyId;

    @ApiModelProperty("出险日期")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @Excel(name = "出险日期",format = "yyyy-MM-dd",groupName = "保险信息",orderNum = "26")
    private Date insuranceDate;
}
