package com.sa.ibiz.demo.demoapp.controller.demo.vo;

import java.sql.Timestamp;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonProperty.Access;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import lombok.Data;
import org.springframework.util.StringUtils;
import com.sa.ibiz.demo.demo.domain.OrgUser;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.util.Map;
import java.util.Date;
import org.springframework.cglib.beans.BeanCopier;
import javax.validation.constraints.Size;
import java.util.UUID;
import org.springframework.cglib.beans.BeanCopier;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.sa.ibiz.demo.ibizutil.security.AuthenticationUser;
import java.math.BigInteger;
import com.alibaba.fastjson.JSONObject;

@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class OrgUser_EditForm_Main2{

    @JsonProperty(access=Access.WRITE_ONLY)
    private Map<String,String> srfparentdata;
    @JsonIgnore
    private Timestamp updatedate;
    @JsonProperty(access=Access.WRITE_ONLY)
    private String srforikey;
    @JsonIgnore
    private String orguserid;
    @JsonIgnore
    private String orgusername;
    @JsonIgnore
    private String srftempmode;
    @JsonProperty
    private String srfuf;
    @JsonProperty
    private String srfdeid;
    @JsonProperty(access=Access.WRITE_ONLY)
    private String srfsourcekey;
    @JsonIgnore
    private String orgname;
    @JsonIgnore
    private String orgsectorname;
    @JsonIgnore
    private String usercode;
    @JsonIgnore
    private String orgsecusertypename;
    @JsonIgnore
    private String titlename;
    @JsonIgnore
    private Integer validflag;
    @JsonIgnore
    private String orguserlevelname;
    @JsonIgnore
    private Integer ordervalue;
    @JsonIgnore
    private String memo;
    @JsonIgnore
    private String reserver;
    @JsonIgnore
    private String createman;
    @JsonIgnore
    private Timestamp createdate;
    @JsonIgnore
    private String updateman;
    @JsonIgnore
    private String orgsectorid;
    @JsonIgnore
    private String orgsecusertypeid;
    @JsonIgnore
    private String orgid;
    @JsonIgnore
    private String orguserlevelid;

    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
    @JsonProperty(value = "srfupdatedate")
    public Timestamp getSrfupdatedate(){
        return updatedate;
    }
    @JsonProperty(value = "srfupdatedate")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
    public void setSrfupdatedate(Timestamp updatedate){
        this.updatedate = updatedate;
    }

    @JsonProperty(value = "srforikey")
    public String getSrforikey(){
        return srforikey;
    }
    @JsonProperty(value = "srforikey")
    public void setSrforikey(String srforikey){
        this.srforikey = srforikey;
    }

    @Size(min = 0, max = 100, message = "[组织人员标识]长度必须在[100]以内!")
    @JsonProperty(value = "srfkey")
    public String getSrfkey(){
        return orguserid;
    }
    @JsonProperty(value = "srfkey")
    public void setSrfkey(String orguserid){
        this.orguserid = orguserid;
    }

    @Size(min = 0, max = 200, message = "[人员名称]长度必须在[200]以内!")
    @JsonProperty(value = "srfmajortext")
    public String getSrfmajortext(){
        return orgusername;
    }

    @JsonProperty(value = "srftempmode")
    public String getSrftempmode(){
        return srftempmode;
    }
    @JsonProperty(value = "srftempmode")
    public void setSrftempmode(String srftempmode){
        this.srftempmode = srftempmode;
    }

    @JsonProperty(value = "srfdeid")
    public String getSrfdeid(){
        return srfdeid;
    }
    @JsonProperty(value = "srfdeid")
    public void setSrfdeid(String srfdeid){
        this.srfdeid = srfdeid;
    }

    @NotBlank(message = "[所属组织]不允许为空!")
    @Size(min = 0, max = 200, message = "[所属组织]长度必须在[200]以内!")
    @JsonProperty(value = "orgname")
    public String getOrgname(){
        return orgname;
    }
    @JsonProperty(value = "orgname")
    public void setOrgname(String orgname){
        this.orgname = orgname;
    }

    @NotBlank(message = "[所属部门]不允许为空!")
    @Size(min = 0, max = 200, message = "[所属部门]长度必须在[200]以内!")
    @JsonProperty(value = "orgsectorname")
    public String getOrgsectorname(){
        return orgsectorname;
    }
    @JsonProperty(value = "orgsectorname")
    public void setOrgsectorname(String orgsectorname){
        this.orgsectorname = orgsectorname;
    }

    @NotBlank(message = "[人员名称]不允许为空!")
    @Size(min = 0, max = 200, message = "[人员名称]长度必须在[200]以内!")
    @JsonProperty(value = "orgusername")
    public String getOrgusername(){
        return orgusername;
    }
    @JsonProperty(value = "orgusername")
    public void setOrgusername(String orgusername){
        this.orgusername = orgusername;
    }

    @Size(min = 0, max = 100, message = "[用户编号]长度必须在[100]以内!")
    @JsonProperty(value = "usercode")
    public String getUsercode(){
        return usercode;
    }
    @JsonProperty(value = "usercode")
    public void setUsercode(String usercode){
        this.usercode = usercode;
    }

    @Size(min = 0, max = 200, message = "[部门人员关系]长度必须在[200]以内!")
    @JsonProperty(value = "orgsecusertypename")
    public String getOrgsecusertypename(){
        return orgsecusertypename;
    }
    @JsonProperty(value = "orgsecusertypename")
    public void setOrgsecusertypename(String orgsecusertypename){
        this.orgsecusertypename = orgsecusertypename;
    }

    @Size(min = 0, max = 200, message = "[头衔名称]长度必须在[200]以内!")
    @JsonProperty(value = "titlename")
    public String getTitlename(){
        return titlename;
    }
    @JsonProperty(value = "titlename")
    public void setTitlename(String titlename){
        this.titlename = titlename;
    }

    @NotNull(message = "[启用标志]不允许为空!")
    @JsonProperty(value = "validflag")
    public Integer getValidflag(){
        return validflag;
    }
    @JsonProperty(value = "validflag")
    public void setValidflag(Integer validflag){
        this.validflag = validflag;
    }

    @Size(min = 0, max = 200, message = "[人员级别]长度必须在[200]以内!")
    @JsonProperty(value = "orguserlevelname")
    public String getOrguserlevelname(){
        return orguserlevelname;
    }
    @JsonProperty(value = "orguserlevelname")
    public void setOrguserlevelname(String orguserlevelname){
        this.orguserlevelname = orguserlevelname;
    }

    @JsonProperty(value = "ordervalue")
    public Integer getOrdervalue(){
        return ordervalue;
    }
    @JsonProperty(value = "ordervalue")
    public void setOrdervalue(Integer ordervalue){
        this.ordervalue = ordervalue;
    }

    @Size(min = 0, max = 4000, message = "[备注]长度必须在[4000]以内!")
    @JsonProperty(value = "memo")
    public String getMemo(){
        return memo;
    }
    @JsonProperty(value = "memo")
    public void setMemo(String memo){
        this.memo = memo;
    }

    @Size(min = 0, max = 100, message = "[电话]长度必须在[100]以内!")
    @JsonProperty(value = "reserver")
    public String getReserver(){
        return reserver;
    }
    @JsonProperty(value = "reserver")
    public void setReserver(String reserver){
        this.reserver = reserver;
    }

    @Size(min = 0, max = 60, message = "[建立人]长度必须在[60]以内!")
    @JsonProperty(value = "createman")
    public String getCreateman(){
        return createman;
    }
    @JsonProperty(value = "createman")
    public void setCreateman(String createman){
        this.createman = createman;
    }

    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
    @JsonProperty(value = "createdate")
    public Timestamp getCreatedate(){
        return createdate;
    }
    @JsonProperty(value = "createdate")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
    public void setCreatedate(Timestamp createdate){
        this.createdate = createdate;
    }

    @Size(min = 0, max = 60, message = "[更新人]长度必须在[60]以内!")
    @JsonProperty(value = "updateman")
    public String getUpdateman(){
        return updateman;
    }
    @JsonProperty(value = "updateman")
    public void setUpdateman(String updateman){
        this.updateman = updateman;
    }

    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
    @JsonProperty(value = "updatedate")
    public Timestamp getUpdatedate(){
        return updatedate;
    }
    @JsonProperty(value = "updatedate")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
    public void setUpdatedate(Timestamp updatedate){
        this.updatedate = updatedate;
    }

    @Size(min = 0, max = 100, message = "[组织人员标识]长度必须在[100]以内!")
    @JsonProperty(value = "orguserid")
    public String getOrguserid(){
        return orguserid;
    }
    @JsonProperty(value = "orguserid")
    public void setOrguserid(String orguserid){
        this.orguserid = orguserid;
    }

    @Size(min = 0, max = 100, message = "[所属部门]长度必须在[100]以内!")
    @JsonProperty(value = "orgsectorid")
    public String getOrgsectorid(){
        //输出获取外键值方法-用于通过parentdata关系填充外键值id
        if(StringUtils.isEmpty(orgsectorid) && this.getSrfparentdata() != null)
        {
            if(this.getSrfparentdata().containsKey("srfparentmode")&& this.getSrfparentdata().get("srfparentmode").equals("DER1N_ORGUSER_ORGSECTOR_ORGSECTORID"))
                this.orgsectorid=this.getSrfparentdata().get("srfparentkey");
        }
        return orgsectorid;
    }
    @JsonProperty(value = "orgsectorid")
    public void setOrgsectorid(String orgsectorid){
        this.orgsectorid = orgsectorid;
    }

    @Size(min = 0, max = 100, message = "[部门人员关系]长度必须在[100]以内!")
    @JsonProperty(value = "orgsecusertypeid")
    public String getOrgsecusertypeid(){
        //输出获取外键值方法-用于通过parentdata关系填充外键值id
        if(StringUtils.isEmpty(orgsecusertypeid) && this.getSrfparentdata() != null)
        {
            if(this.getSrfparentdata().containsKey("srfparentmode")&& this.getSrfparentdata().get("srfparentmode").equals("DER1N_ORGUSER_ORGSECUSERTYPE_ORGSECUSERTYPEID"))
                this.orgsecusertypeid=this.getSrfparentdata().get("srfparentkey");
        }
        return orgsecusertypeid;
    }
    @JsonProperty(value = "orgsecusertypeid")
    public void setOrgsecusertypeid(String orgsecusertypeid){
        this.orgsecusertypeid = orgsecusertypeid;
    }

    @Size(min = 0, max = 100, message = "[所属组织]长度必须在[100]以内!")
    @JsonProperty(value = "orgid")
    public String getOrgid(){
        //输出获取外键值方法-用于通过parentdata关系填充外键值id
        if(StringUtils.isEmpty(orgid) && this.getSrfparentdata() != null)
        {
            if(this.getSrfparentdata().containsKey("srfparentmode")&& this.getSrfparentdata().get("srfparentmode").equals("DER1N_ORGUSER_ORG_ORGID"))
                this.orgid=this.getSrfparentdata().get("srfparentkey");
        }
        return orgid;
    }
    @JsonProperty(value = "orgid")
    public void setOrgid(String orgid){
        this.orgid = orgid;
    }

    @Size(min = 0, max = 100, message = "[人员级别]长度必须在[100]以内!")
    @JsonProperty(value = "orguserlevelid")
    public String getOrguserlevelid(){
        //输出获取外键值方法-用于通过parentdata关系填充外键值id
        if(StringUtils.isEmpty(orguserlevelid) && this.getSrfparentdata() != null)
        {
            if(this.getSrfparentdata().containsKey("srfparentmode")&& this.getSrfparentdata().get("srfparentmode").equals("DER1N_ORGUSER_ORGUSERLEVEL_ORGUSERLEVELID"))
                this.orguserlevelid=this.getSrfparentdata().get("srfparentkey");
        }
        return orguserlevelid;
    }
    @JsonProperty(value = "orguserlevelid")
    public void setOrguserlevelid(String orguserlevelid){
        this.orguserlevelid = orguserlevelid;
    }

    public  void fromOrgUser(OrgUser sourceEntity)  {
        this.fromOrgUser(sourceEntity,true);
    }

     /**
	 * do转换为vo
	 * @param sourceEntity do数据对象
	 * @return
	 */
    public  void fromOrgUser(OrgUser sourceEntity,boolean reset)  {
      BeanCopier copier=BeanCopier.create(OrgUser.class, OrgUser_EditForm_Main2.class, false);
      copier.copy(sourceEntity,this,  null);
      this.toString();
	}

    /**
	 * vo转换为do
	 * @param
	 * @return
	 */
    public  OrgUser toOrgUser()  {
        OrgUser targetEntity =new OrgUser();
        BeanCopier copier=BeanCopier.create(OrgUser_EditForm_Main2.class, OrgUser.class, false);
        copier.copy(this, targetEntity, null);
        return targetEntity;
	}

     /**
	 * 新建
	 * @param
	 * @return
	 */
    private boolean isCreate()
    {
    	if((StringUtils.isEmpty(this.srfuf))||this.srfuf.equals("0"))
	    	return true;
    	else
    	    return false;
    }
     /**
	 * 更新
	 * @param
	 * @return
	 */
    private boolean isUpdate()
    {
    	if((!StringUtils.isEmpty(this.srfuf))&&this.srfuf.equals("1"))
	    	return true;
    	else
    	    return false;
    }

}
