package com.goafanti.common.model;

import org.apache.commons.lang3.StringUtils;

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

public class OrgTechAchievement {
    private String id;

    private String uid;

    /**
    * 成果名称
    */
    private String achievementName;

    /**
    * 来源
    */
    private String source;

    /**
    * 转化方式
    */
    private Integer conversionForm;

    /**
    * 转化结果
    */
    private String conversionResult;

    /**
    * 转化年份
    */
    private Integer year;

    /**
    * 证明材料附件URL
    */
    private String enclosureUrl;

    /**
    * 删除标记
    */
    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 getAchievementName() {
        return achievementName;
    }

    public void setAchievementName(String achievementName) {
        this.achievementName = achievementName;
    }

    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }
    
    @JsonFormat(shape = Shape.STRING)
    public Integer getConversionForm() {
        return conversionForm;
    }

    public void setConversionForm(Integer conversionForm) {
        this.conversionForm = conversionForm;
    }

    public String getConversionResult() {
        return conversionResult;
    }

    public void setConversionResult(String conversionResult) {
        this.conversionResult = conversionResult;
    }

    public Integer getYear() {
        return year;
    }

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

    public String getEnclosureUrl() {
        return enclosureUrl;
    }

    public void setEnclosureUrl(String enclosureUrl) {
        this.enclosureUrl = enclosureUrl;
    }
    
    @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 FileUtils.getDownloadFileName(this.enclosureUrl);
		}
	}
	
	public void setEnclosureDownloadFileName(String enclosureDownloadFileName){
		
	}
}