package com.yida.data.common.core.entity.applyForm;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yida.data.common.core.entity.user.EduStaff;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 填报用户表单审核流程记录表(具体的审核信息)
 *
 * @author ZYJ
 * @date 2023/11/24
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("core_apply_form_fill_user_approval_process_record")
public class CoreApplyFormFillUserApprovalProcessRecord implements Serializable {

    private static final long serialVersionUID = -7325624862092619821L;

    /**
     * 主键id
     */
    @ApiModelProperty("主键id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 是否删除，1删除0未删除，默认0
     */
    @ApiModelProperty("是否删除，1删除0未删除，默认0")
    @TableField("del_flag")
    @TableLogic(value = "0", delval = "1")
    private Integer delFlag;

    /**
     * 创建时间
     */
    @ApiModelProperty("创建时间")
    @TableField(value = "create_date", fill = FieldFill.INSERT)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createDate;

    /**
     * 创建人id
     */
    @ApiModelProperty("创建人id")
    @TableField(value = "create_id", fill = FieldFill.INSERT)
    private Long createId;

    /**
     * 最后修改时间
     */
    @ApiModelProperty("最后修改时间")
    @TableField(value = "update_date", fill = FieldFill.UPDATE)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateDate;

    /**
     * 最后修改人id
     */
    @ApiModelProperty("最后修改人id")
    @TableField(value = "update_id", fill = FieldFill.UPDATE)
    private Long updateId;

    @ApiModelProperty("学校id")
    private Long schoolId;

    /**
     * 表单id
     */
    @ApiModelProperty("表单id")
    @TableField("apply_form_id")
    private Long applyFormId;

    @ApiModelProperty("用户填报信息id")
    @TableField("fill_user_id")
    private Long fillUserId;

    @ApiModelProperty("用户审核流程节点id")
    private Long userProcessId;

    /**
     * 审核人ID
     */
    @ApiModelProperty(value = "审核人ID")
    @TableField("approval_id")
    private Long approvalId;

    /**
     * 审核人姓名，记录方便展示
     */
    @ApiModelProperty(value = "审核人姓名，记录方便展示")
    @TableField("approval_name")
    private String approvalName;

    /**
     * 审核结果：2=审核不通过,1=通过，0=待审核，默认0
     */
    @ApiModelProperty(value = "审核结果：2=审核不通过,1=通过，0=待审核，默认0")
    @TableField("approval_result")
    private Integer approvalResult;

    /**
     * 审核不通过的原因
     */
    @ApiModelProperty(value = "审核不通过的原因")
    @TableField("approval_reason")
    private String approvalReason;

    /**
     * 审核顺序
     */
    @ApiModelProperty(value = "审核顺序")
    @TableField("sort")
    private Integer sort;

    @ApiModelProperty(value = "审核时间")
    @TableField(value = "audit_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime auditTime;

    @ApiModelProperty("签名图片")
    private String signPic;

    @ApiModelProperty(value = "审核人信息")
    private transient EduStaff approvalInfo;
}
