package com.sa.ibiz.demo.demo.domain;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonProperty.Access;
import lombok.Data;
import org.springframework.beans.BeanUtils;
import org.springframework.cglib.beans.BeanMap;
import org.springframework.cglib.beans.BeanGenerator;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.FieldFill;
import java.util.Map;
import java.util.HashMap;
import org.springframework.util.StringUtils;
import com.sa.ibiz.demo.ibizutil.security.AuthenticationUser;
import java.util.Date;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import org.springframework.util.DigestUtils;
import org.springframework.util.StringUtils;
import java.util.UUID;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import org.springframework.cglib.beans.BeanCopier;
import com.sa.ibiz.demo.ibizutil.annotation.Dict;
import com.sa.ibiz.demo.ibizutil.domain.EntityBase;
import java.io.Serializable;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import java.math.BigInteger;
import com.sa.ibiz.demo.ibizutil.enums.FillMode;
import com.sa.ibiz.demo.ibizutil.enums.PredefinedType;
import com.sa.ibiz.demo.ibizutil.annotation.PreField;
import com.alibaba.fastjson.annotation.JSONField;

import com.sa.ibiz.demo.demo.domain.WFInstance;
import com.sa.ibiz.demo.demo.domain.WFStep;

/**
 * 实体[WFStepInst] 数据对象
 */
@TableName(value = "T_SRFWFSTEPINST",resultMap = "WFStepInstResultMap")
@JsonIgnoreProperties(ignoreUnknown = true)
@Data
public class WFStepInst extends EntityBase implements Serializable{

    @JSONField(serialize = false)
    @JsonIgnore
    @TableField(exist = false)//关系主表数据
    private WFInstance wfinstance;
    @JSONField(serialize = false)
    @JsonIgnore
    @TableField(exist = false)//关系主表数据
    private WFStep wfstep;
    private Integer closeflag;
    @PreField(fill= FillMode.INSERT,preType = PredefinedType.CREATEDATE)
    private Timestamp createdate;
    @PreField(fill= FillMode.INSERT,preType = PredefinedType.CREATEMAN)
    @Dict(dictName = "ionicdemo_SysOperatorCodeList")
    private String createman;
    private String returndata;
    @PreField(fill= FillMode.INSERT_UPDATE,preType = PredefinedType.UPDATEDATE)
    private Timestamp updatedate;
    @PreField(fill= FillMode.INSERT_UPDATE,preType = PredefinedType.UPDATEMAN)
    @Dict(dictName = "ionicdemo_SysOperatorCodeList")
    private String updateman;
    private String wfinstanceid;
    private String wfinstancename;
    private String wfstepid;
    @TableId(value= "wfstepinstid",type=IdType.UUID)//指定主键生成策略
    private String wfstepinstid;
    private String wfstepinstname;
    private String wfsteplanrestag;
    private String wfstepname;
    /**
     *  设置属性值[实例关闭标志]
     *  @param closeflag
     */
    public void setCloseflag(Integer closeflag){
        this.closeflag = closeflag;
        this.set("closeflagdirtyflag",true);
    }
    /**
     *  获取属性值[实例关闭标志]
     */
    public Integer getCloseflag(){
        return this.closeflag;
    }
    /**
     *  重置属性值[实例关闭标志]
     */
    public void resetCloseflag(){
        this.set("closeflagdirtyflag",false);
        this.closeflag = null;
    }
    /**
     *  设置属性值[建立时间]
     *  @param createdate
     */
    public void setCreatedate(Timestamp createdate){
        this.createdate = createdate;
        this.set("createdatedirtyflag",true);
    }
    /**
     *  获取属性值[建立时间]
     */
    public Timestamp getCreatedate(){
        return this.createdate;
    }
    /**
     *  重置属性值[建立时间]
     */
    public void resetCreatedate(){
        this.set("createdatedirtyflag",false);
        this.createdate = null;
    }
    /**
     *  设置属性值[建立人]
     *  @param createman
     */
    public void setCreateman(String createman){
        if(StringUtils.isEmpty(createman))
            createman=null;
        this.createman = createman;
        this.set("createmandirtyflag",true);
    }
    /**
     *  获取属性值[建立人]
     */
    public String getCreateman(){
        return this.createman;
    }
    /**
     *  重置属性值[建立人]
     */
    public void resetCreateman(){
        this.set("createmandirtyflag",false);
        this.createman = null;
    }
    /**
     *  设置属性值[流程返回值]
     *  @param returndata
     */
    public void setReturndata(String returndata){
        if(StringUtils.isEmpty(returndata))
            returndata=null;
        this.returndata = returndata;
        this.set("returndatadirtyflag",true);
    }
    /**
     *  获取属性值[流程返回值]
     */
    public String getReturndata(){
        return this.returndata;
    }
    /**
     *  重置属性值[流程返回值]
     */
    public void resetReturndata(){
        this.set("returndatadirtyflag",false);
        this.returndata = null;
    }
    /**
     *  设置属性值[更新时间]
     *  @param updatedate
     */
    public void setUpdatedate(Timestamp updatedate){
        this.updatedate = updatedate;
        this.set("updatedatedirtyflag",true);
    }
    /**
     *  获取属性值[更新时间]
     */
    public Timestamp getUpdatedate(){
        return this.updatedate;
    }
    /**
     *  重置属性值[更新时间]
     */
    public void resetUpdatedate(){
        this.set("updatedatedirtyflag",false);
        this.updatedate = null;
    }
    /**
     *  设置属性值[更新人]
     *  @param updateman
     */
    public void setUpdateman(String updateman){
        if(StringUtils.isEmpty(updateman))
            updateman=null;
        this.updateman = updateman;
        this.set("updatemandirtyflag",true);
    }
    /**
     *  获取属性值[更新人]
     */
    public String getUpdateman(){
        return this.updateman;
    }
    /**
     *  重置属性值[更新人]
     */
    public void resetUpdateman(){
        this.set("updatemandirtyflag",false);
        this.updateman = null;
    }
    /**
     *  设置属性值[子流程实例]
     *  @param wfinstanceid
     */
    public void setWfinstanceid(String wfinstanceid){
        if(StringUtils.isEmpty(wfinstanceid))
            wfinstanceid=null;
        this.wfinstanceid = wfinstanceid;
        this.set("wfinstanceiddirtyflag",true);
    }
    /**
     *  获取属性值[子流程实例]
     */
    public String getWfinstanceid(){
        return this.wfinstanceid;
    }
    /**
     *  重置属性值[子流程实例]
     */
    public void resetWfinstanceid(){
        this.set("wfinstanceiddirtyflag",false);
        this.wfinstanceid = null;
    }
    /**
     *  设置属性值[子流程实例]
     *  @param wfinstancename
     */
    public void setWfinstancename(String wfinstancename){
        if(StringUtils.isEmpty(wfinstancename))
            wfinstancename=null;
        this.wfinstancename = wfinstancename;
        this.set("wfinstancenamedirtyflag",true);
    }
    /**
     *  获取属性值[子流程实例]
     */
    public String getWfinstancename(){
        //填充物理化的外键值附加数据
        if(StringUtils.isEmpty(this.wfinstancename)&&(!StringUtils.isEmpty(this.getWfinstanceid())) && this.getWfinstance()!=null)
        {
            this.wfinstancename = this.getWfinstance().getWfinstancename();
            this.set("wfinstancenamedirtyflag",true);
        }
        return this.wfinstancename;
    }
    /**
     *  重置属性值[子流程实例]
     */
    public void resetWfinstancename(){
        this.set("wfinstancenamedirtyflag",false);
        this.wfinstancename = null;
    }
    /**
     *  设置属性值[工作流步骤]
     *  @param wfstepid
     */
    public void setWfstepid(String wfstepid){
        if(StringUtils.isEmpty(wfstepid))
            wfstepid=null;
        this.wfstepid = wfstepid;
        this.set("wfstepiddirtyflag",true);
    }
    /**
     *  获取属性值[工作流步骤]
     */
    public String getWfstepid(){
        return this.wfstepid;
    }
    /**
     *  重置属性值[工作流步骤]
     */
    public void resetWfstepid(){
        this.set("wfstepiddirtyflag",false);
        this.wfstepid = null;
    }
    /**
     *  设置属性值[工作流步骤子实例标识]
     *  @param wfstepinstid
     */
    public void setWfstepinstid(String wfstepinstid){
        if(StringUtils.isEmpty(wfstepinstid))
            wfstepinstid=null;
        this.wfstepinstid = wfstepinstid;
        this.set("wfstepinstiddirtyflag",true);
    }
    /**
     *  获取属性值[工作流步骤子实例标识]
     */
    public String getWfstepinstid(){
        return this.wfstepinstid;
    }
    /**
     *  重置属性值[工作流步骤子实例标识]
     */
    public void resetWfstepinstid(){
        this.set("wfstepinstiddirtyflag",false);
        this.wfstepinstid = null;
    }
    /**
     *  设置属性值[工作流步骤子实例名称]
     *  @param wfstepinstname
     */
    public void setWfstepinstname(String wfstepinstname){
        if(StringUtils.isEmpty(wfstepinstname))
            wfstepinstname=null;
        this.wfstepinstname = wfstepinstname;
        this.set("wfstepinstnamedirtyflag",true);
    }
    /**
     *  获取属性值[工作流步骤子实例名称]
     */
    public String getWfstepinstname(){
        return this.wfstepinstname;
    }
    /**
     *  重置属性值[工作流步骤子实例名称]
     */
    public void resetWfstepinstname(){
        this.set("wfstepinstnamedirtyflag",false);
        this.wfstepinstname = null;
    }
    /**
     *  设置属性值[步骤语言资源]
     *  @param wfsteplanrestag
     */
    public void setWfsteplanrestag(String wfsteplanrestag){
        if(StringUtils.isEmpty(wfsteplanrestag))
            wfsteplanrestag=null;
        this.wfsteplanrestag = wfsteplanrestag;
        this.set("wfsteplanrestagdirtyflag",true);
    }
    /**
     *  获取属性值[步骤语言资源]
     */
    public String getWfsteplanrestag(){
        return this.wfsteplanrestag;
    }
    /**
     *  重置属性值[步骤语言资源]
     */
    public void resetWfsteplanrestag(){
        this.set("wfsteplanrestagdirtyflag",false);
        this.wfsteplanrestag = null;
    }
    /**
     *  设置属性值[工作流步骤]
     *  @param wfstepname
     */
    public void setWfstepname(String wfstepname){
        if(StringUtils.isEmpty(wfstepname))
            wfstepname=null;
        this.wfstepname = wfstepname;
        this.set("wfstepnamedirtyflag",true);
    }
    /**
     *  获取属性值[工作流步骤]
     */
    public String getWfstepname(){
        //填充物理化的外键值附加数据
        if(StringUtils.isEmpty(this.wfstepname)&&(!StringUtils.isEmpty(this.getWfstepid())) && this.getWfstep()!=null)
        {
            this.wfstepname = this.getWfstep().getWfplogicname();
            this.set("wfstepnamedirtyflag",true);
        }
        return this.wfstepname;
    }
    /**
     *  重置属性值[工作流步骤]
     */
    public void resetWfstepname(){
        this.set("wfstepnamedirtyflag",false);
        this.wfstepname = null;
    }
     /**
     *  获取主实体关联数据[WFInstance]
     */
    public WFInstance getWfinstance() {
        return wfinstance;
    }
    /**
     *  设置主实体关联数据[WFInstance]
     */
    public void setWfinstance(WFInstance wfinstance) {
        this.wfinstance = wfinstance;
    }

     /**
     *  获取主实体关联数据[WFStep]
     */
    public WFStep getWfstep() {
        return wfstep;
    }
    /**
     *  设置主实体关联数据[WFStep]
     */
    public void setWfstep(WFStep wfstep) {
        this.wfstep = wfstep;
    }

    /**
     * 重置当前数据对象属性值
     */
    public  void reset(){
        resetCloseflag();
        resetCreatedate();
        resetCreateman();
        resetReturndata();
        resetUpdatedate();
        resetUpdateman();
        resetWfinstanceid();
        resetWfinstancename();
        resetWfstepid();
        resetWfstepinstid();
        resetWfstepinstname();
        resetWfsteplanrestag();
        resetWfstepname();
    }
     /**
     * 获取数据主键（普通主键与联合主键）
     * @return
     */
    @JsonIgnore
    public Serializable getDefaultPrimaryKey()
    {
    	//联合主键
        String primaryKey ="";
        primaryKey+=this.getWfinstanceid();
        primaryKey+="||";
        primaryKey+=this.getWfstepid();
        return  DigestUtils.md5DigestAsHex(primaryKey.getBytes());
    }
     /**
     * 复制当前对象数据到目标对象(粘贴重置)
     *
     * @throws Exception
     */
    public WFStepInst copyTo(WFStepInst targetEntity)
	{
		BeanCopier copier=BeanCopier.create(WFStepInst.class, WFStepInst.class, false);
		copier.copy(this, targetEntity, null);
        targetEntity.resetWfstepinstid();
		return targetEntity;
	}
}