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.AttendanceLeaveRecordVo;
import lombok.Data;
/**
 * 请假记录信息实体对象
 *
 * @author zxfei
 * @date 2024-01-11
 */
@Data
public class AttendanceLeaveRecordEntity extends AttendanceLeaveRecordVo {
    private static final long serialVersionUID = 1L;

    /**
     * 请假人id
     */
    private Long leavePersonId;
    /**
     * 请假人
     */
    @Excel(name = "请假人")
    private String leavePerson;
    /**
     * 所属部门id
     */
    private Long deptId;
    /**
     * 所属部门
     */
    @Excel(name = "部门")
    private String deptName;
    /**
     * 电话号码
     */
    @Excel(name = "电话号码")
    private String phoneNumber;
    /**
     * 请假类型(1.事假,2.调休,3.病假,4.年假,5.产假,6.陪产假,7.婚假,8.例假,9.哺乳假,10.丧假,11.回单位,12.因公请假,13.外出勘验,14.值班补班,15.体检,16.隔离,17.因公外出,18.公休,19.育儿假,20.调回单位,21.探亲假,22.其他)
     */
    @Excel(name = "请假类型", readConverterExp = "1=事假,2=调休,3=病假,4=年假,5=产假,6=陪产假,7=婚假,8=例假,9=哺乳假,10=丧假,11=回单位,12=因公请假,13=外出勘验,14=值班补班,15=体检,16=隔离,17=因公外出,18=公休,19=育儿假,20=调回单位,21=探亲假,22=其他")
    private Integer leaveType;
    /**
     * 开始时间
     */
    @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date startTime;
    /**
     * 结束时间
     */
    @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;
    /**
     * 时长,单位秒
     */
    private Integer duration;
    /**
     * 请假事由
     */
    @Excel(name = "请假事由")
    private String reason;
    /**
     * 审批负责人Id
     */
    private Long approverId;
    /**
     * 审批负责人
     */
    private String approver;
    /**
     * 附件
     */
    private String attachment;
    /**
     * 附件路径
     */
    private String attachmentPath;
    /**
     * 备注
     */
    private String remark;
    /**
     * 申请时间
     */
    private Date appealTime;
    /**
     * 审核结果(1.申请通过,2.申请不通过)
     */
    @Excel(name = "审核结果", readConverterExp = "1=申请通过,2=申请不通过,3=撤销审批中,4=撤销审批通过")
    private Integer auditResult;
    /**
     * 审核说明
     */
    @Excel(name = "审核说明")
    private String auditDesc;
    /**
     * 审核时间
     */
    @Excel(name = "审核时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date auditTime;
    /**
     * 处理状态
     */
    private Integer processStatus;
    /**
     * 钉钉原始请假时间记录
     */
    @Excel(name = "请假时间")
    private String sourceDingTime;
    /**
     * 所属大厅
     */
    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 AttendanceLeaveRecordEntity) {
            AttendanceLeaveRecordEntity tmp = (AttendanceLeaveRecordEntity) obj;
            if (this.getId() == tmp.getId()) {
                return true;
            }
        }
        return false;
    }

    public void initAttrValue(){
        this.leavePersonId = 0L;
        this.leavePerson = "";
        this.deptId = null;
        this.deptName = "";
        this.phoneNumber = "";
        this.leaveType = null;
        this.startTime = new Date();
        this.endTime = new Date();
        this.duration = 0;
        this.reason = "";
        this.approverId = null;
        this.approver = "";
        this.attachment = "";
        this.attachmentPath = "";
        this.remark = "";
        this.appealTime = new Date();
        this.auditResult = 0;
        this.auditDesc = "";
        this.auditTime = new Date();
        this.processStatus = 1;
        this.sourceDingTime = "";
        this.salaId = null;
        this.salaName = "";
    }
}