package com.sa.ibiz.demo.mob.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.XM;
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 XM_EditForm_MobForm{

    @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 xmid;
    @JsonIgnore
    private String xmname;
    @JsonIgnore
    private String srftempmode;
    @JsonProperty
    private String srfuf;
    @JsonProperty
    private String srfdeid;
    @JsonProperty(access=Access.WRITE_ONLY)
    private String srfsourcekey;
    @JsonIgnore
    private Timestamp qdsj;
    @JsonIgnore
    private String xmzq;
    @JsonIgnore
    private Double xmje;
    @JsonIgnore
    private String bz;
    @JsonIgnore
    private String fj;

    @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 xmid;
    }
    @JsonProperty(value = "srfkey")
    public void setSrfkey(String xmid){
        this.xmid = xmid;
    }

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

    @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;
    }

    @Size(min = 0, max = 200, message = "[项目名称]长度必须在[200]以内!")
    @JsonProperty(value = "xmname")
    public String getXmname(){
        return xmname;
    }
    @JsonProperty(value = "xmname")
    public void setXmname(String xmname){
        this.xmname = xmname;
    }

    @JsonFormat(pattern="yyyy-MM-dd", locale = "zh" , timezone="GMT+8")
    @JsonProperty(value = "qdsj")
    public Timestamp getQdsj(){
        return qdsj;
    }
    @JsonProperty(value = "qdsj")
    @JsonFormat(pattern="yyyy-MM-dd", locale = "zh" , timezone="GMT+8")
    public void setQdsj(Timestamp qdsj){
        this.qdsj = qdsj;
    }

    @Size(min = 0, max = 100, message = "[项目周期]长度必须在[100]以内!")
    @JsonProperty(value = "xmzq")
    public String getXmzq(){
        return xmzq;
    }
    @JsonProperty(value = "xmzq")
    public void setXmzq(String xmzq){
        this.xmzq = xmzq;
    }

    @JsonProperty(value = "xmje")
    public Double getXmje(){
        return xmje;
    }
    @JsonProperty(value = "xmje")
    public void setXmje(Double xmje){
        this.xmje = xmje;
    }

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

    @Size(min = 0, max = 1000, message = "[附件]长度必须在[1000]以内!")
    @JsonProperty(value = "fj")
    public String getFj(){
        return fj;
    }
    @JsonProperty(value = "fj")
    public void setFj(String fj){
        this.fj = fj;
    }

    @Size(min = 0, max = 100, message = "[项目标识]长度必须在[100]以内!")
    @JsonProperty(value = "xmid")
    public String getXmid(){
        return xmid;
    }
    @JsonProperty(value = "xmid")
    public void setXmid(String xmid){
        this.xmid = xmid;
    }

    public  void fromXM(XM sourceEntity)  {
        this.fromXM(sourceEntity,true);
    }

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

    /**
	 * vo转换为do
	 * @param
	 * @return
	 */
    public  XM toXM()  {
        XM targetEntity =new XM();
        BeanCopier copier=BeanCopier.create(XM_EditForm_MobForm.class, XM.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;
    }

}
