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.DF;
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 DF_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 dfid;
    @JsonIgnore
    private String dfname;
    @JsonIgnore
    private String srftempmode;
    @JsonProperty
    private String srfuf;
    @JsonProperty
    private String srfdeid;
    @JsonProperty(access=Access.WRITE_ONLY)
    private String srfsourcekey;
    @JsonIgnore
    private String nd;
    @JsonIgnore
    private Timestamp jfrq;
    @JsonIgnore
    private Integer sqds;
    @JsonIgnore
    private Integer bqs;
    @JsonIgnore
    private Integer ydl;
    @JsonIgnore
    private Double ydfy;
    @JsonIgnore
    private String sfdj;

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

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

    @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 = 60, message = "[年度]长度必须在[60]以内!")
    @JsonProperty(value = "nd")
    public String getNd(){
        return nd;
    }
    @JsonProperty(value = "nd")
    public void setNd(String nd){
        this.nd = nd;
    }

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

    @JsonProperty(value = "sqds")
    public Integer getSqds(){
        return sqds;
    }
    @JsonProperty(value = "sqds")
    public void setSqds(Integer sqds){
        this.sqds = sqds;
    }

    @JsonProperty(value = "bqs")
    public Integer getBqs(){
        return bqs;
    }
    @JsonProperty(value = "bqs")
    public void setBqs(Integer bqs){
        this.bqs = bqs;
    }

    @JsonProperty(value = "ydl")
    public Integer getYdl(){
        return ydl;
    }
    @JsonProperty(value = "ydl")
    public void setYdl(Integer ydl){
        this.ydl = ydl;
    }

    @JsonProperty(value = "ydfy")
    public Double getYdfy(){
        return ydfy;
    }
    @JsonProperty(value = "ydfy")
    public void setYdfy(Double ydfy){
        this.ydfy = ydfy;
    }

    @Size(min = 0, max = 500, message = "[收费单据]长度必须在[500]以内!")
    @JsonProperty(value = "sfdj")
    public String getSfdj(){
        return sfdj;
    }
    @JsonProperty(value = "sfdj")
    public void setSfdj(String sfdj){
        this.sfdj = sfdj;
    }

    @Size(min = 0, max = 100, message = "[电费标识]长度必须在[100]以内!")
    @JsonProperty(value = "dfid")
    public String getDfid(){
        return dfid;
    }
    @JsonProperty(value = "dfid")
    public void setDfid(String dfid){
        this.dfid = dfid;
    }

    public  void fromDF(DF sourceEntity)  {
        this.fromDF(sourceEntity,true);
    }

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

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

}
