package com.mortals.xhx.module.attendance.model;
import java.util.Date;
import java.util.List;
import java.util.ArrayList;
import java.math.BigDecimal;
import cn.hutool.core.date.DateUtil;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.attendance.model.vo.AttendanceRecordVo;
import lombok.Data;
/**
 * 考勤打卡记录信息实体对象
 *
 * @author zxfei
 * @date 2024-01-11
 */
@Data
public class AttendanceRecordEntity extends AttendanceRecordVo {
    private static final long serialVersionUID = 1L;

    /**
     * 员工ID
     */
    private Long staffId;
    /**
     * 员工姓名
     */
    @Excel(name = "员工姓名")
    private String staffName;
    /**
     * 工号
     */
    @Excel(name = "工号")
    private String workNum;
    /**
     * 所属部门
     */
    private Long deptId;
    /**
     * 所属部门名称
     */
    @Excel(name = "所属部门名称")
    private String deptName;
    /**
     * 职位ID
     */
    private Long positionId;
    /**
     * 职位名称
     */
    @Excel(name = "职位名称")
    private String positionName;
    /**
     * 所属考勤组ID
     */
    private Long attendanceGroupId;
    /**
     * 所属考勤组名称
     */
    @Excel(name = "所属考勤组名称")
    private String attendanceGroupName;
    /**
     * 打卡日期
     */
    @Excel(name = "打卡日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date attendanceDate;
    /**
     * 备注
     */
    private String remark;
    /**
     * 签到结果(0.否,1.是)
     */
    @Excel(name = "签到结果", readConverterExp = "0=否,1=是")
    private Integer signInResult;
    /**
     * 签退结果(0.否,1.是)
     */
    @Excel(name = "签退结果", readConverterExp = "0=否,1=是")
    private Integer signOutResult;
    /**
     * 考勤类型
     */
    private String attendType;
    /**
     * 打卡结果(0.否,1.是)
     */
    @Excel(name = "打卡结果", readConverterExp = "0=否,1=是")
    private Integer punchResult;
    /**
     * 班次ID
     */
    private Long classId;
    /**
     * 班次名称
     */
    private String className;
    /**
     * 所属大厅
     */
    private Long salaId;
    /**
     * 所属大厅名称
     */
    private String salaName;
    @Override
    public int hashCode() {
        return this.getId().hashCode();
    }
    @Override
    public boolean equals(Object obj) {
        if (obj == null) return false;
        if (obj instanceof AttendanceRecordEntity) {
            AttendanceRecordEntity tmp = (AttendanceRecordEntity) obj;
            if (this.getId() == tmp.getId()) {
                return true;
            }
        }
        return false;
    }

    public void initAttrValue(){
        this.staffId = 0L;
        this.staffName = "";
        this.workNum = "";
        this.deptId = 0L;
        this.deptName = "";
        this.positionId = 0L;
        this.positionName = "";
        this.attendanceGroupId = 0L;
        this.attendanceGroupName = "";
        this.attendanceDate = new Date();
        this.remark = "";
        this.signInResult = 0;
        this.signOutResult = 0;
        this.attendType = "";
        this.punchResult = 0;
        this.classId = 0L;
        this.className = "";
        this.salaId = null;
        this.salaName = "";
    }
}