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.AttendanceRecordDetailVo;
import lombok.Data;
/**
 * 考勤打卡记录详细信息实体对象
 *
 * @author zxfei
 * @date 2023-07-27
 */
@Data
public class AttendanceRecordDetailEntity extends AttendanceRecordDetailVo {
    private static final long serialVersionUID = 1L;

    /**
     * 考勤记录ID
     */
    private Long recordId;
    /**
     * 班次ID
     */
    private Long shiftsId;
    /**
     * 班次名称
     */
    @Excel(name = "班次名称")
    private String shiftsName;
    /**
     * 上班打卡时间
     */
    @Excel(name = "上班打卡时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date goWorkDate;
    /**
     * 上班打卡结果(1.正常,2.请假,3.缺卡,4.迟到,5.早退)
     */
    @Excel(name = "上班打卡结果", readConverterExp = "1=正常,2=请假,3=缺卡,4=迟到,5=早退")
    private Integer goWorkResult;
    /**
     * 下班打卡时间
     */
    @Excel(name = "下班打卡时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date offWorkDate;
    /**
     * 下班打卡结果(1.正常,2.请假,3.缺卡,4.迟到,5.早退)
     */
    @Excel(name = "下班打卡结果", readConverterExp = "1=正常,2=请假,3=缺卡,4=迟到,5=早退")
    private Integer offWorkResult;
    /**
     * 排序字段
     */
    private Integer orderNum;
    /**
     * 备注
     */
    private String remark;
    @Override
    public int hashCode() {
        return this.getId().hashCode();
    }
    @Override
    public boolean equals(Object obj) {
        if (obj == null) return false;
        if (obj instanceof AttendanceRecordDetailEntity) {
            AttendanceRecordDetailEntity tmp = (AttendanceRecordDetailEntity) obj;
            if (this.getId() == tmp.getId()) {
                return true;
            }
        }
        return false;
    }

    public void initAttrValue(){
        this.recordId = 0L;
        this.shiftsId = 0L;
        this.shiftsName = "";
        this.goWorkDate = new Date();
        this.goWorkResult = 0;
        this.offWorkDate = new Date();
        this.offWorkResult = 0;
        this.orderNum = 1;
        this.remark = "";
    }
}