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.YCSQ;
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 YCSQ_EditForm_MobForm10{

    @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 ycsqid;
    @JsonIgnore
    private String ycsqname;
    @JsonIgnore
    private String srftempmode;
    @JsonProperty
    private String srfuf;
    @JsonProperty
    private String srfdeid;
    @JsonProperty(access=Access.WRITE_ONLY)
    private String srfsourcekey;
    @JsonIgnore
    private Timestamp ycrq;
    @JsonIgnore
    private Integer ycrs;
    @JsonIgnore
    private String mdd;
    @JsonIgnore
    private Integer sfxysj;
    @JsonIgnore
    private String ycsm;

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

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

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

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

    @JsonProperty(value = "ycrs")
    public Integer getYcrs(){
        return ycrs;
    }
    @JsonProperty(value = "ycrs")
    public void setYcrs(Integer ycrs){
        this.ycrs = ycrs;
    }

    @Size(min = 0, max = 100, message = "[目的地]长度必须在[100]以内!")
    @JsonProperty(value = "mdd")
    public String getMdd(){
        return mdd;
    }
    @JsonProperty(value = "mdd")
    public void setMdd(String mdd){
        this.mdd = mdd;
    }

    @JsonProperty(value = "sfxysj")
    public Integer getSfxysj(){
        return sfxysj;
    }
    @JsonProperty(value = "sfxysj")
    public void setSfxysj(Integer sfxysj){
        this.sfxysj = sfxysj;
    }

    @Size(min = 0, max = 100, message = "[用车说明]长度必须在[100]以内!")
    @JsonProperty(value = "ycsm")
    public String getYcsm(){
        return ycsm;
    }
    @JsonProperty(value = "ycsm")
    public void setYcsm(String ycsm){
        this.ycsm = ycsm;
    }

    @Size(min = 0, max = 200, message = "[用车申请名称]长度必须在[200]以内!")
    @JsonProperty(value = "ycsqname")
    public String getYcsqname(){
        if(StringUtils.isEmpty(ycsqname)){
        if(isCreate()){
            this.ycsqname="单位车辆申请";
        }
        }
        return ycsqname;
    }
    @JsonProperty(value = "ycsqname")
    public void setYcsqname(String ycsqname){
        this.ycsqname = ycsqname;
    }

    @Size(min = 0, max = 100, message = "[用车申请标识]长度必须在[100]以内!")
    @JsonProperty(value = "ycsqid")
    public String getYcsqid(){
        return ycsqid;
    }
    @JsonProperty(value = "ycsqid")
    public void setYcsqid(String ycsqid){
        this.ycsqid = ycsqid;
    }

    public  void fromYCSQ(YCSQ sourceEntity)  {
        this.fromYCSQ(sourceEntity,true);
    }

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

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

}
