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.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonFormat.Shape;
import com.goafanti.common.utils.FileUtils;

public class OrgStandard {
	private String	id;

	private String	uid;

	/**
	 * 标准名称
	 */
	private String	standardName;

	/**
	 * 标准编号
	 */
	private String	standardNumber;

	/**
	 * 标准级别
	 */
	private Integer	standardLevel;

	/**
	 * 参与方式
	 */
	private Integer	participateWay;

	/**
	 * 创建时间
	 */
	private Date	createTime;

	/**
	 * 年份
	 */
	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 getStandardName() {
		return standardName;
	}

	public void setStandardName(String standardName) {
		this.standardName = standardName;
	}

	public String getStandardNumber() {
		return standardNumber;
	}

	public void setStandardNumber(String standardNumber) {
		this.standardNumber = standardNumber;
	}

	public Integer getStandardLevel() {
		return standardLevel;
	}

	public void setStandardLevel(Integer standardLevel) {
		this.standardLevel = standardLevel;
	}

	public Integer getParticipateWay() {
		return participateWay;
	}

	public void setParticipateWay(Integer participateWay) {
		this.participateWay = participateWay;
	}

	@JsonIgnore
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	
	@JsonFormat(shape = Shape.STRING)
	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 getStandardDownloadFileName() {
		if (StringUtils.isBlank(this.enclosureUrl)) {
			return null;
		} else {
			return FileUtils.getDownloadFileName(this.enclosureUrl);
		}
	}

	public void setStandardDownloadFileName(String standardDownloadFileName) {

	}
}