package com.mortals.xhx.module.staff.model;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.annotation.desensitization.IdCardDesensitize;
import com.mortals.framework.annotation.desensitization.MobileDesensitize;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.staff.model.vo.StaffVo;
import lombok.Data;
/**
 * 员工基本信息实体对象
 *
 * @author zxfei
 * @date 2023-07-18
 */
@Data
public class StaffEntity extends StaffVo {
    private static final long serialVersionUID = 1L;

    /**
     * 员工姓名
     */
    @Excel(name = "员工姓名")
    private String name;
    /**
     * 性别(1.男,2.女)
     */
    @Excel(name = "性别", readConverterExp = "1=男,2.女")
    private Integer gender;
    /**
     * 出生日期
     */
    private Date birthday;
    /**
     * 照片
     */
    private String photoPath;
    /**
     * 联系电话
     */
    @Excel(name = "联系电话")
    @MobileDesensitize
    private String phoneNumber;
    /**
     * 身份证号码
     */
    @Excel(name = "身份证号码")
    @IdCardDesensitize
    private String idCard;
    /**
     * 工号
     */
    @Excel(name = "工号")
    private String workNum;
    /**
     * 政治面貌 (1.中共党员，2.中共预备党员，3.共青团员，4.群众，5.其它)
     */
    private Integer politicalstatus;
    /**
     * 所属部门
     */
    private Long deptId;
    /**
     * 所属部门名称
     */
    @Excel(name = "所属部门名称")
    private String deptName;
    /**
     * 职位ID
     */
    private Long positionId;
    /**
     * 职位名称
     */
    @Excel(name = "职位名称")
    private String positionName;
    /**
     * 员工类型（1.全职,2.兼职,3.实习)
     */
    @Excel(name = "员工类型", readConverterExp = "1=全职,2=兼职,3=实习")
    private Integer staffType;
    /**
     * 员工状态(1.正式,2.试用,3.离职)
     */
    @Excel(name = "员工状态", readConverterExp = "1=正式,2=试用,3=离职")
    private Integer status;
    /**
     * 员工来源(1.外部,2.内部)
     */
    private Integer source;
    /**
     * 入职登记表
     */
    private String registerPath;
    /**
     * 入职时间
     */
    @Excel(name = "入职时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date entryDate;
    /**
     * 转正时间
     */
    private Date regularDate;
    /**
     * 离职时间
     */
    private Date leaveDate;
    /**
     * 备注
     */
    private String remark;
    /**
     * 备注
     */
    private String remarkId;
    /**
     * 相对图片pic
     */
    private String picUri;
    /**
     * 图片资源唯一标识
     */
    private String serverIndexCode;
    /**
     * 绩效分数
     */
    private BigDecimal score;
    /**
     * 员工登录名
     */
    private String loginName;
    /**
     * 员工登录密码
     */
    private String loginPwd;
    /**
     * 最后登录时间
     */
    private Date lastLoginTime;
    @Override
    public int hashCode() {
        return this.getId().hashCode();
    }
    @Override
    public boolean equals(Object obj) {
        if (obj == null) return false;
        if (obj instanceof StaffEntity) {
            StaffEntity tmp = (StaffEntity) obj;
            if (this.getId() == tmp.getId()) {
                return true;
            }
        }
        return false;
    }

    public void initAttrValue(){

        this.name = "";

        this.gender = 1;

        this.birthday = null;

        this.photoPath = "";

        this.phoneNumber = "";

        this.idCard = "";

        this.workNum = "";

        this.politicalstatus = 1;

        this.deptId = null;

        this.deptName = "";

        this.positionId = null;

        this.positionName = "";

        this.staffType = 1;

        this.status = 1;

        this.source = 1;

        this.registerPath = "";

        this.entryDate = null;

        this.regularDate = null;

        this.leaveDate = null;

        this.remark = "";

        this.remarkId = "";

        this.picUri = "";

        this.serverIndexCode = "";

        this.score = new BigDecimal(0);

        this.loginName = "";

        this.loginPwd = "";

        this.lastLoginTime = null;
    }
}