package com.goafanti.common.model;

import java.util.Date;

import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.goafanti.common.constant.AFTConstants;
import com.goafanti.common.utils.FileUtils;

public class OrgTechCenterDetail {
    private String id;

    private String cid;

    /**
    * 产学研时间
    */
    private Date projectTime;

    /**
    * 产学研名称
    */
    private String projectName;

    /**
    * 期限开始时间
    */
    private Date termStartTime;
    
    /**
     * 期限结束时间
     */
    private Date termEndTime;

    /**
    * 大学机构
    */
    private String institution;

    /**
    * 协议URL
    */
    private String protocolUrl;

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

    public String getId() {
        return id;
    }

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

    public String getCid() {
        return cid;
    }

    public void setCid(String cid) {
        this.cid = cid;
    }

    public Date getProjectTime() {
        return projectTime;
    }

    public void setProjectTime(Date projectTime) {
        this.projectTime = projectTime;
    }

    public String getProjectName() {
        return projectName;
    }

    public void setProjectName(String projectName) {
        this.projectName = projectName;
    }


    public Date getTermStartTime() {
		return termStartTime;
	}

	public void setTermStartTime(Date termStartTime) {
		this.termStartTime = termStartTime;
	}

	public Date getTermEndTime() {
		return termEndTime;
	}

	public void setTermEndTime(Date termEndTime) {
		this.termEndTime = termEndTime;
	}

	public String getInstitution() {
        return institution;
    }

    public void setInstitution(String institution) {
        this.institution = institution;
    }

    public String getProtocolUrl() {
        return protocolUrl;
    }

    public void setProtocolUrl(String protocolUrl) {
        this.protocolUrl = protocolUrl;
    }
    
    @JsonIgnore
    public Integer getDeletedSign() {
        return deletedSign;
    }

    public void setDeletedSign(Integer deletedSign) {
        this.deletedSign = deletedSign;
    }
    
    public String getProjectTimeFormattedDate(){
		if (this.projectTime == null) {
			return null;
		} else {
			return DateFormatUtils.format(this.getProjectTime(), AFTConstants.YYYYMMDD);
		}
	}
	
	public void setProjectTimeFormattedDate(String projectTimeFormattedDate){
		
	}
	
	public String getTermStartTimeFormattedDate(){
		if (this.termStartTime == null) {
			return null;
		} else {
			return DateFormatUtils.format(this.getTermStartTime(), AFTConstants.YYYYMMDD);
		}
	}
	
	
	public void setTermStartTimeFormattedDate(String termStartTimeFormattedDate){
		
	}
	
	public String getTermEndTimeFormattedDate(){
		if (this.termEndTime == null) {
			return null;
		} else {
			return DateFormatUtils.format(this.getTermEndTime(), AFTConstants.YYYYMMDD);
		}
	}
	
	
	public void setTermEndTimeFormattedDate(String termEndTimeFormattedDate){
		
	}
	
	//技术协议名称
	public String getProtocolDownloadFileName(){
		if (StringUtils.isBlank(this.protocolUrl)){
			return null;
		} else {
			return (null == this.projectName) ? "" : this.projectName  + FileUtils.getDownloadFileName(this.protocolUrl);
		}
	}
	
	public void setProtocolDownloadFileName(String protocolDownloadFileName){
		
	}
	
	
}