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 OrgTechCenter {
    private String id;

    private String uid;
    
    /**
     * 技术中心新名称
     */
    private String centerName;

    /**
    * 成立时间
    */
    private Date foundingTime;

    /**
    * 负责人
    */
    private String principal;
    
    /**
     * 备注
     */
    private String comment;

    /**
    * 制度目录URL
    */
    private String systemUrl;

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

    /**
    * 制度目录
    */
    private String systemCatalog;

    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 getCenterName() {
		return centerName;
	}

	public void setCenterName(String centerName) {
		this.centerName = centerName;
	}

	public Date getFoundingTime() {
        return foundingTime;
    }

    public void setFoundingTime(Date foundingTime) {
        this.foundingTime = foundingTime;
    }

    public String getPrincipal() {
        return principal;
    }

    public void setPrincipal(String principal) {
        this.principal = principal;
    }

    public String getSystemUrl() {
        return systemUrl;
    }

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

    public void setDeletedSign(Integer deletedSign) {
        this.deletedSign = deletedSign;
    }

    public String getSystemCatalog() {
        return systemCatalog;
    }

    public void setSystemCatalog(String systemCatalog) {
        this.systemCatalog = systemCatalog;
    }
    
    
    public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	public String getFoundingTimeFormattedDate(){
		if (this.foundingTime == null) {
			return null;
		} else {
			return DateFormatUtils.format(this.getFoundingTime(), AFTConstants.YYYYMMDDHHMMSS);
		}
	}
	
	public void setFoundingTimeFormattedDate(String foundingTimeFormattedDate){
		
	}
	
	//制度目录
	public String getSystemDownloadFileName(){
		if (StringUtils.isBlank(this.systemUrl)){
			return null;
		} else {
			return (null == this.centerName) ? "" : this.centerName +FileUtils.getDownloadFileName(this.systemUrl);
		}
	}
	
	public void setSystemDownloadFileName(String systemDownloadFileName){
		
	}
}