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_HRCONTRACT",resultMap = "HRContractResultMap")
public class HRContract extends EntityMP implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 建立人
     */
    @DEField(preType = DEPredefinedFieldType.CREATEMAN)
    @TableField(value = "createman" , fill = FieldFill.INSERT)
    @JSONField(name = "createman")
    @JsonProperty("createman")
    private String createman;
    /**
     * 合同信息标识
     */
    @DEField(isKeyField=true)
    @TableId(value= "hrcontractid",type=IdType.ASSIGN_UUID)
    @JSONField(name = "hrcontractid")
    @JsonProperty("hrcontractid")
    private String hrcontractid;
    /**
     * 合同信息名称
     */
    @TableField(value = "hrcontractname")
    @JSONField(name = "hrcontractname")
    @JsonProperty("hrcontractname")
    private String hrcontractname;
    /**
     * 建立时间
     */
    @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(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.UPDATEMAN)
    @TableField(value = "updateman")
    @JSONField(name = "updateman")
    @JsonProperty("updateman")
    private String updateman;
    /**
     * 员工标识
     */
    @TableField(value = "hremployeeid")
    @JSONField(name = "hremployeeid")
    @JsonProperty("hremployeeid")
    private String hremployeeid;
    /**
     * 员工姓名
     */
    @TableField(exist = false)
    @JSONField(name = "hremployeename")
    @JsonProperty("hremployeename")
    private String hremployeename;
    /**
     * 合同编号
     */
    @TableField(value = "contractcode")
    @JSONField(name = "contractcode")
    @JsonProperty("contractcode")
    private String contractcode;
    /**
     * 合同类别
     */
    @TableField(value = "contractmode")
    @JSONField(name = "contractmode")
    @JsonProperty("contractmode")
    private String contractmode;
    /**
     * 合同类型
     */
    @TableField(value = "contracttype")
    @JSONField(name = "contracttype")
    @JsonProperty("contracttype")
    private String contracttype;
    /**
     * 开始日期
     */
    @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 = "contractstate")
    @JSONField(name = "contractstate")
    @JsonProperty("contractstate")
    private String contractstate;
    /**
     * 合同管理单位ID
     */
    @TableField(value = "mgrorganizationid")
    @JSONField(name = "mgrorganizationid")
    @JsonProperty("mgrorganizationid")
    private String mgrorganizationid;
    /**
     * 合同管理单位
     */
    @TableField(exist = false)
    @JSONField(name = "mgrorganizationname")
    @JsonProperty("mgrorganizationname")
    private String mgrorganizationname;
    /**
     * 合同签约单位ID
     */
    @TableField(value = "signorganizationid")
    @JSONField(name = "signorganizationid")
    @JsonProperty("signorganizationid")
    private String signorganizationid;
    /**
     * 合同签约单位
     */
    @TableField(exist = false)
    @JSONField(name = "signorganizationname")
    @JsonProperty("signorganizationname")
    private String signorganizationname;
    /**
     * 试用期
     */
    @TableField(value = "probationtime")
    @JsonFormat(pattern="yyyy-MM-dd", locale = "zh" , timezone="GMT+8")
    @JSONField(name = "probationtime" , format="yyyy-MM-dd")
    @JsonProperty("probationtime")
    private Timestamp probationtime;
    /**
     * 签订类型
     */
    @TableField(value = "contractsigntype")
    @JSONField(name = "contractsigntype")
    @JsonProperty("contractsigntype")
    private String contractsigntype;
    /**
     * 备注
     */
    @TableField(value = "memo")
    @JSONField(name = "memo")
    @JsonProperty("memo")
    private String memo;
    /**
     * 合同签订次数
     */
    @TableField(value = "contractsignnum")
    @JSONField(name = "contractsignnum")
    @JsonProperty("contractsignnum")
    private BigInteger contractsignnum;
    /**
     * 附件
     */
    @TableField(value = "attachment")
    @JSONField(name = "attachment")
    @JsonProperty("attachment")
    private String attachment;
    /**
     * 单位
     */
    @TableField(exist = false)
    @JSONField(name = "organizationname")
    @JsonProperty("organizationname")
    private String organizationname;
    /**
     * 员工状态
     */
    @TableField(exist = false)
    @JSONField(name = "empstate")
    @JsonProperty("empstate")
    private String empstate;
    /**
     * 到本单位时间
     */
    @TableField(exist = false)
    @JsonFormat(pattern="yyyy-MM-dd", locale = "zh" , timezone="GMT+8")
    @JSONField(name = "startorgtime" , format="yyyy-MM-dd")
    @JsonProperty("startorgtime")
    private Timestamp startorgtime;
    /**
     * 员工编号
     */
    @TableField(exist = false)
    @JSONField(name = "employeecode")
    @JsonProperty("employeecode")
    private String employeecode;
    /**
     * 工作内容
     */
    @TableField(value = "workcontent")
    @JSONField(name = "workcontent")
    @JsonProperty("workcontent")
    private String workcontent;

    /**
     * 员工
     */
    @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.base.domain.HROrganization mgrorganization;

    /**
     * 合同签约单位
     */
    @JsonIgnore
    @JSONField(serialize = false)
    @TableField(exist = false)
    private cn.ibizlab.humanresource.core.base.domain.HROrganization signorganization;



    /**
     * 设置 [合同信息名称]
     */
    public void setHrcontractname(String hrcontractname){
        this.hrcontractname = hrcontractname ;
        this.modify("hrcontractname",hrcontractname);
    }

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

    /**
     * 设置 [合同编号]
     */
    public void setContractcode(String contractcode){
        this.contractcode = contractcode ;
        this.modify("contractcode",contractcode);
    }

    /**
     * 设置 [合同类别]
     */
    public void setContractmode(String contractmode){
        this.contractmode = contractmode ;
        this.modify("contractmode",contractmode);
    }

    /**
     * 设置 [合同类型]
     */
    public void setContracttype(String contracttype){
        this.contracttype = contracttype ;
        this.modify("contracttype",contracttype);
    }

    /**
     * 设置 [开始日期]
     */
    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 setContractstate(String contractstate){
        this.contractstate = contractstate ;
        this.modify("contractstate",contractstate);
    }

    /**
     * 设置 [合同管理单位ID]
     */
    public void setMgrorganizationid(String mgrorganizationid){
        this.mgrorganizationid = mgrorganizationid ;
        this.modify("mgrorganizationid",mgrorganizationid);
    }

    /**
     * 设置 [合同签约单位ID]
     */
    public void setSignorganizationid(String signorganizationid){
        this.signorganizationid = signorganizationid ;
        this.modify("signorganizationid",signorganizationid);
    }

    /**
     * 设置 [试用期]
     */
    public void setProbationtime(Timestamp probationtime){
        this.probationtime = probationtime ;
        this.modify("probationtime",probationtime);
    }

    /**
     * 格式化日期 [试用期]
     */
    public String formatProbationtime(){
        if (this.probationtime == null) {
            return null;
        }
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        return sdf.format(probationtime);
    }
    /**
     * 设置 [签订类型]
     */
    public void setContractsigntype(String contractsigntype){
        this.contractsigntype = contractsigntype ;
        this.modify("contractsigntype",contractsigntype);
    }

    /**
     * 设置 [备注]
     */
    public void setMemo(String memo){
        this.memo = memo ;
        this.modify("memo",memo);
    }

    /**
     * 设置 [合同签订次数]
     */
    public void setContractsignnum(BigInteger contractsignnum){
        this.contractsignnum = contractsignnum ;
        this.modify("contractsignnum",contractsignnum);
    }

    /**
     * 设置 [附件]
     */
    public void setAttachment(String attachment){
        this.attachment = attachment ;
        this.modify("attachment",attachment);
    }

    /**
     * 设置 [工作内容]
     */
    public void setWorkcontent(String workcontent){
        this.workcontent = workcontent ;
        this.modify("workcontent",workcontent);
    }


}


