package com.goafanti.common.model;

import java.util.Date;

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

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.goafanti.common.constant.AFTConstants;
import com.goafanti.common.enums.NoticeStatus;

public class Notice {
	private String	id;

	private String	aid;

	/**
	 * 通知类型
	 */
	private Integer	noticeType;

	/**
	 * 通知内容
	 */
	private String	content;

	/**
	 * 创建时间
	 */
	private Date	createTime;
	
	/**
	 * 已读标记
	 */
	private Integer	readed;
	
	/**
	 * 用户id
	 */
	private String uid;
	
	/**
	 * 录入公司信息业务员ID
	 */
	private String pid;
	
	/**
	 * 业务记录ID
	 */
	private String rid;
	
	/**
	 * 高企记录申请年份
	 */
	private Integer year;
	
	

	public Integer getYear() {
		return year;
	}

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

	public String getId() {
		return id;
	}

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

	public String getAid() {
		return aid;
	}

	public void setAid(String aid) {
		this.aid = aid;
	}


	public Integer getNoticeType() {
		return noticeType;
	}

	public void setNoticeType(Integer noticeType) {
		this.noticeType = noticeType;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@JsonIgnore
	public Integer getReaded() {
		return readed;
	}

	public void setReaded(Integer readed) {
		this.readed = readed;
	}
	
	
	public String getUid() {
		return uid;
	}

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

	

	public String getPid() {
		return pid;
	}

	public void setPid(String pid) {
		this.pid = pid;
	}

	public String getRid() {
		return rid;
	}

	public void setRid(String rid) {
		this.rid = rid;
	}

	public String getNoticeTypeName(){
		if (null == this.noticeType){
			return null;
		} else {
			if (NoticeStatus.PATENTINFO.getCode() == this.noticeType){
				return NoticeStatus.PATENTINFO.getDesc();
			} 
			if (NoticeStatus.COGNIZANCE.getCode() == this.noticeType){
				return NoticeStatus.COGNIZANCE.getDesc();
			}
			if (NoticeStatus.COPYRIGHT.getCode() == this.noticeType){
				return NoticeStatus.COPYRIGHT.getDesc();
			}
			if (NoticeStatus.TECHPROJECT.getCode() == this.noticeType){
				return NoticeStatus.TECHPROJECT.getDesc();
			}
			if (NoticeStatus.PERSONALCERTIFY.getCode() == this.noticeType){
				return NoticeStatus.PERSONALCERTIFY.getDesc();
			}
			if (NoticeStatus.ORGANIZATIONCERTIFY.getCode() == this.noticeType){
				return NoticeStatus.ORGANIZATIONCERTIFY.getDesc();
			}
			if (NoticeStatus.CONTRACT.getCode() == this.noticeType){
				return NoticeStatus.CONTRACT.getDesc();
			}
			return NoticeStatus.OTHER.getDesc();
		}
	}
    
	public void setNoticeTypeName(Integer noticeType){
		
	}
	
	public String getCreateTimeFormattedDate() {
		if (this.createTime == null) {
			return null;
		} else {
			return DateFormatUtils.format(this.getCreateTime(), AFTConstants.YYYYMMDDHHMMSS);
		}
	}

	public void setCreateTimeFormattedDate(String createTimeFormattedDate) {

	}
	
	
}