package cn.ibizlab.humanresource.core.humanresource.domain;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.util.ObjectUtils;
import org.springframework.util.DigestUtils;
import cn.ibizlab.humanresource.util.domain.EntityBase;
import cn.ibizlab.humanresource.util.annotation.DEField;
import cn.ibizlab.humanresource.util.enums.DEPredefinedFieldType;
import cn.ibizlab.humanresource.util.enums.DEFieldDefaultValueType;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
import cn.ibizlab.humanresource.util.annotation.Audit;


import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.humanresource.util.domain.EntityMP;

/**
 * 实体[工作人员分配]
 */
@Getter
@Setter
@NoArgsConstructor
@JsonIgnoreProperties(value = "handler")
@TableName(value = "T_HRDISTRIBUTION",resultMap = "HRDistributionResultMap")
public class HRDistribution extends EntityMP implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 更新人
     */
    @DEField(preType = DEPredefinedFieldType.UPDATEMAN)
    @TableField(value = "updateman")
    @JSONField(name = "updateman")
    @JsonProperty("updateman")
    private String updateman;
    /**
     * 工作人员分配名称
     */
    @TableField(value = "hrdistributionname")
    @JSONField(name = "hrdistributionname")
    @JsonProperty("hrdistributionname")
    private String hrdistributionname;
    /**
     * 建立时间
     */
    @DEField(preType = DEPredefinedFieldType.CREATEDATE)
    @TableField(value = "createdate" , fill = FieldFill.INSERT)
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
    @JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
    @JsonProperty("createdate")
    private Timestamp createdate;
    /**
     * 工作人员分配标识
     */
    @DEField(isKeyField=true)
    @TableId(value= "hrdistributionid",type=IdType.ASSIGN_UUID)
    @JSONField(name = "hrdistributionid")
    @JsonProperty("hrdistributionid")
    private String hrdistributionid;
    /**
     * 更新时间
     */
    @DEField(preType = DEPredefinedFieldType.UPDATEDATE)
    @TableField(value = "updatedate")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
    @JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
    @JsonProperty("updatedate")
    private Timestamp updatedate;
    /**
     * 建立人
     */
    @DEField(preType = DEPredefinedFieldType.CREATEMAN)
    @TableField(value = "createman" , fill = FieldFill.INSERT)
    @JSONField(name = "createman")
    @JsonProperty("createman")
    private String createman;
    /**
     * 员工标识
     */
    @TableField(value = "hremployeeid")
    @JSONField(name = "hremployeeid")
    @JsonProperty("hremployeeid")
    private String hremployeeid;
    /**
     * 员工姓名
     */
    @TableField(exist = false)
    @JSONField(name = "hremployeename")
    @JsonProperty("hremployeename")
    private String hremployeename;
    /**
     * 入职时间
     */
    @TableField(value = "begintime")
    @JsonFormat(pattern="yyyy-MM-dd", locale = "zh" , timezone="GMT+8")
    @JSONField(name = "begintime" , format="yyyy-MM-dd")
    @JsonProperty("begintime")
    private Timestamp begintime;
    /**
     * 离职时间
     */
    @TableField(value = "endtime")
    @JsonFormat(pattern="yyyy-MM-dd", locale = "zh" , timezone="GMT+8")
    @JSONField(name = "endtime" , format="yyyy-MM-dd")
    @JsonProperty("endtime")
    private Timestamp endtime;
    /**
     * 职位标识
     */
    @TableField(value = "hrpostid")
    @JSONField(name = "hrpostid")
    @JsonProperty("hrpostid")
    private String hrpostid;
    /**
     * 职位
     */
    @TableField(exist = false)
    @JSONField(name = "hrpostname")
    @JsonProperty("hrpostname")
    private String hrpostname;
    /**
     * 部门
     */
    @TableField(exist = false)
    @JSONField(name = "hrorganizationname")
    @JsonProperty("hrorganizationname")
    private String hrorganizationname;
    /**
     * 职务
     */
    @TableField(value = "hrdutyname")
    @JSONField(name = "hrdutyname")
    @JsonProperty("hrdutyname")
    private String hrdutyname;

    /**
     * 员工
     */
    @JsonIgnore
    @JSONField(serialize = false)
    @TableField(exist = false)
    private cn.ibizlab.humanresource.core.humanresource.domain.HREmployee hremployee;

    /**
     * 职位
     */
    @JsonIgnore
    @JSONField(serialize = false)
    @TableField(exist = false)
    private cn.ibizlab.humanresource.core.humanresource.domain.HRPost hrpost;



    /**
     * 设置 [工作人员分配名称]
     */
    public void setHrdistributionname(String hrdistributionname){
        this.hrdistributionname = hrdistributionname ;
        this.modify("hrdistributionname",hrdistributionname);
    }

    /**
     * 设置 [员工标识]
     */
    public void setHremployeeid(String hremployeeid){
        this.hremployeeid = hremployeeid ;
        this.modify("hremployeeid",hremployeeid);
    }

    /**
     * 设置 [入职时间]
     */
    public void setBegintime(Timestamp begintime){
        this.begintime = begintime ;
        this.modify("begintime",begintime);
    }

    /**
     * 格式化日期 [入职时间]
     */
    public String formatBegintime(){
        if (this.begintime == null) {
            return null;
        }
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        return sdf.format(begintime);
    }
    /**
     * 设置 [离职时间]
     */
    public void setEndtime(Timestamp endtime){
        this.endtime = endtime ;
        this.modify("endtime",endtime);
    }

    /**
     * 格式化日期 [离职时间]
     */
    public String formatEndtime(){
        if (this.endtime == null) {
            return null;
        }
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        return sdf.format(endtime);
    }
    /**
     * 设置 [职位标识]
     */
    public void setHrpostid(String hrpostid){
        this.hrpostid = hrpostid ;
        this.modify("hrpostid",hrpostid);
    }

    /**
     * 设置 [职务]
     */
    public void setHrdutyname(String hrdutyname){
        this.hrdutyname = hrdutyname ;
        this.modify("hrdutyname",hrdutyname);
    }


}


