package com.yonyou.hrcloud.attend.model;

import com.yonyou.hrcloud.adder.generic.DBIgnore;
import com.yonyou.hrcloud.berry.model.TenantEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

/**
 * 考勤档案
 *
 * @author zhouyuh
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class AttendStaff extends TenantEntity {

    /**
     * 考勤档案实体
     */
    private static final long serialVersionUID = 1L;
    public static final String TABLE_NAME = "ts_attend_staff";
    private String staffId;
    private String staffjobId;
    private String orgId;
    private String deptId;
    private String psnclId;           //人员类别ID

    private String workPlace;         //工作地
    private boolean joinAttend;       //考勤类型 是或否
    private String attendType;        //考勤方式：正常考勤、不考勤、免签卡      0全部，1：正常考勤，2：不考勤，3：免签卡
    private String shiftId;
    private String cardCode;          //考勤卡号
    private Date begindate;
    private Date enddate;

    private String attendRuleId;      //考勤规则
    private String leaveRuleId;       //休假规则
    private String overtimeRuleId;    //加班规则
    private String awayRuleId;        //出差规则

    private String staffCode;         //员工编码
    private String staffName;         //员工名称
    private String orgName;
    private String deptName;
    private Integer islast;           //当前任职是否结束 //是否是最新的一条, 1是， 0否

    private Date employedDate;        //入职日期
    private String psnclName;         //人员类别名称

    private String attendRuleName;    //考勤规则
    private String leaveRuleName;     //休假规则
    private String overtimeRuleName;  //加班规则
    private String awayRuleName;      //出差规则
    
    private String busiorg;           //有权限的组织id
    private String busiorgname;       //有权限的组织名称
    private Date joinworkdate;        // 参加工作的时间
    private String jobId;             //职位id
    private String jobName;             //职位名称

    private Integer endFlag;           //当前任职是否是已结束  1为结束标志
    private Integer lastFlag;           //是否为最新一条 1为最新一条
    private Integer mainJob;           //是否为主职
    private Date lasteDate;           //休假额度的延长时长
    private String updateflag;   //是否手动修改
    
    //add by chenzf@添加字段 2021-9-30 17:38:50 begin
    private Double adjustTime;
    //add by chenzf@添加字段 2021-9-30 17:38:50 end
    
    @DBIgnore
    public Date getLasteDate(){
        return this.lasteDate;
    }
    @DBIgnore
    public String getjobName(){
        return this.jobName;
    }
    @DBIgnore
    public String getBusiorgname(){
        return this.busiorgname;
    }
    
    @DBIgnore
    public String getAttendRuleName(){
        return this.attendRuleName;
    }
    @DBIgnore
    public String getLeaveRuleName(){
        return this.leaveRuleName;
    }
    @DBIgnore
    public String getOvertimeRuleName(){
        return this.overtimeRuleName;
    }
    @DBIgnore
    public String getAwayRuleName(){
        return this.awayRuleName;
    }
    @DBIgnore
    public Date getEmployedDate(){return this.employedDate;}
    @DBIgnore
    public Date getJoinworkdate(){
        return this.joinworkdate;
    }
	@DBIgnore
    public String getupdateflag(){
        return this.updateflag;
    }

    /**
     * @描述   :  是否需要签卡
     * @参数   : 【attendStaff】       :attendStaff
     * @返回值 : boolean
     * @日期   : 2020/3/5 14:03
     * @作者   : sunshh
     */
    public static boolean needSign(AttendStaff attendStaff){
        return !"3".equals(attendStaff.getAttendType());
    }
}
