package org.enfi.modules.visitor.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;

import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;

/**
 * <p>
 * (申请)邀请来访记录表
 * </p>
 *
 * @author WANG HAO
 * @since 2021-11-13
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("visitor_apply_for")
@ApiModel(value = "ApplyFor对象", description = "(申请)邀请来访记录表")
public class ApplyFor extends Model<ApplyFor> {

    private static final long serialVersionUID = 1L;

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

    @ApiModelProperty(value = "申请人姓名")
    @TableField("applicant_name")
    @NotBlank(message = "申请人姓名不能为空")
    private String applicantName;

    @ApiModelProperty(value = "申请人性别")
    @TableField("applicant_sex")
    @NotBlank(message = "申请人性别不能为空")
    private String applicantSex;

    @ApiModelProperty(value = "申请人手机号")
    @TableField("applicant_phone")
    @Pattern(regexp = "^[1]\\d{10}$", message = "申请人手机号格式不正确")
    private String applicantPhone;

    @ApiModelProperty(value = "申请人单位(来访单位)")
    @TableField("applicant_dept")
    @NotBlank(message = "申请人单位(来访单位)不能为空")
    private String applicantDept;

    @ApiModelProperty(value = "申请人证件号")
    @TableField("applicant_id_card")
    @Pattern(regexp = "^\\d{15}|\\d{18}$", message = "申请人证件号格式不正确")
    private String applicantIdCard;

    @ApiModelProperty(value = "申请人人脸照片")
    @TableField("applicant_face_image")
    private String applicantFaceImage;

    @ApiModelProperty(value = "申请人健康宝,行程码照片")
    @TableField("applicant_health_route_images")
    @NotBlank(message = "申请人健康宝,行程码照片不能为空")
    private String applicantHealthRouteImage;

    @ApiModelProperty(value = "(申请)邀请id")
    @TableField("invite_id")
    @NotBlank(message = "邀请id不能为空")
    private String inviteId;

    @ApiModelProperty(value = "(申请)邀请人id")
    @TableField("inviter_id")
    private String inviterId;

    @ApiModelProperty(value = "(申请)邀请人姓名")
    @TableField("inviter_name")
    private String inviterName;

    @ApiModelProperty(value = "(申请)邀请人邮箱")
    @TableField("inviter_email")
    private String inviterEmail;

    @ApiModelProperty(value = "(申请)邀请人部门id")
    @TableField("inviter_dept_id")
    private String inviterDeptId;

    @ApiModelProperty(value = "(申请)邀请人部门名称")
    @TableField("inviter_dept_name")
    private String inviterDeptName;

    @ApiModelProperty(value = "来访原因")
    @TableField("visit_the_reason")
    private String visitTheReason;

    @ApiModelProperty(value = "来访部门")
    @TableField("visit_dept_name")
    private String visitDeptName;

    @ApiModelProperty(value = "接待地点")
    @TableField("reception_site")
    private String receptionSite;

    @ApiModelProperty(value = "微信用户标识OpenId")
    @TableField("wx_openid")
    @NotBlank(message = "OpenId不能为空")
    private String wxOpenid;

    @ApiModelProperty(value = "开始时间(邀请申请人到来时间)")
    @TableField("begin_time")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm",timezone="GMT+8")
    private Date beginTime;

    @ApiModelProperty(value = "开始时间(邀请申请人离开时间)")
    @TableField("end_time")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm",timezone="GMT+8")
    private Date endTime;

    @ApiModelProperty(value = "审核状态 1未审核 2审核通过 3审核拒绝")
    @TableField("status")
    private Integer status;

    @ApiModelProperty(value = "拒绝原因")
    @TableField("refusal_cause")
    private String refusalCause;

    @ApiModelProperty(value = "随申码")
    @TableField(exist = false)
    private String suiShenCode;

    @ApiModelProperty(value = "创建人")
    @TableField("create_by")
    private String createBy;

    @ApiModelProperty(value = "创建时间")
    @TableField("create_time")
    private Date createTime;

    @ApiModelProperty(value = "更新人")
    @TableField("update_by")
    private String updateBy;

    @ApiModelProperty(value = "更新时间")
    @TableField("update_time")
    private Date updateTime;

    @Override
    public Serializable pkVal() {
        return this.id;
    }

}
