package com.goafanti.common.model;

import java.util.Date;

import org.apache.commons.lang3.StringUtils;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonFormat.Shape;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.goafanti.common.utils.FileUtils;

public class OrgHonorDatum {
    private String id;

    private String uid;

    /**
    * 荣誉或证明材料名称
    */
    private String name;
    
    /**
     * 发证机构
     */
    private String issuingMechanism;

    /**
    * 发证时间
    */
    private Date issuingTime;

    /**
    * 附件材料URL
    */
    private String enclosureUrl;
    
    /**
     * 荣誉及其他证明材料获取年份
     */
    private Integer year;

    /**
    * 删除标记
    */
    private Integer deletedSign;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
    
    public String getIssuingMechanism() {
		return issuingMechanism;
	}

	public void setIssuingMechanism(String issuingMechanism) {
		this.issuingMechanism = issuingMechanism;
	}
	
	@JsonIgnore
	public Date getIssuingTime() {
        return issuingTime;
    }

    public void setIssuingTime(Date issuingTime) {
        this.issuingTime = issuingTime;
    }

    public String getEnclosureUrl() {
        return enclosureUrl;
    }

    public void setEnclosureUrl(String enclosureUrl) {
        this.enclosureUrl = enclosureUrl;
    }
    
    
    @JsonFormat(shape = Shape.STRING)
    public Integer getYear() {
		return year;
	}

	public void setYear(Integer year) {
		this.year = year;
	}

	@JsonIgnore
    public Integer getDeletedSign() {
        return deletedSign;
    }

    public void setDeletedSign(Integer deletedSign) {
        this.deletedSign = deletedSign;
    }
    
	
	//附件
	public String getEnclosureDownloadFileName(){
		if (StringUtils.isBlank(this.enclosureUrl)){
			return null;
		} else {
			return (null == this.name ? "" : this.name )+ FileUtils.getDownloadFileName(this.enclosureUrl);
		}
	}
		
	public void setEnclosureDownloadFileName(String enclosureDownloadFileName){
			
	}
}