package com.goafanti.common.model;

import java.math.BigDecimal;
import java.util.Date;

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

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

public class OrgActivity {
    private String id;

    private String uid;

    /**
    * 研发活动编号
    */
    private String activityNumber;

    /**
    * 研发活动名称
    */
    private String activityName;

    /**
    * 开始日期
    */
    private Date startDate;

    /**
    * 结束日期
    */
    private Date endDate;
    
    /**
     * 参与人员
     */
    private String participant;
    
    /**
     * 是否是内部立项
     */
    private Integer projectMode;

    /**
    * 技术领域1st select
    */
    private String technicalField1;

    /**
    * 技术领域2nd select
    */
    private String technicalField2;

    /**
    * 技术领域3rd select
    */
    private String technicalField3;

    /**
    * 技术来源
    */
    private Integer technicalSource;

    /**
    * 知识产权编号
    */
    private String intellectualPropertyNumber;

    /**
    * 研发经费总预算(万元)
    */
    private BigDecimal budget;

    /**
    * 第一年研发经费支出(万元)
    */
    private BigDecimal firstYearExpenditure;

    /**
    * 第二年研发经费支出(万元)
    */
    private BigDecimal secondYearExpenditure;

    /**
    * 第三年研发经费支出(万元)
    */
    private BigDecimal thirdYearExpenditure;

    /**
    * 目的及组织实施方式
    */
    private String implement;

    /**
    * 核心技术及创新点
    */
    private String technologyInnovation;

    /**
    * 取得的阶段性成果
    */
    private String achievement;
    
    /**
     * 立项证明材料URL
     */
    private String proofUrl;
    
    /**
     * 删除标记
     */
    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 getActivityNumber() {
        return activityNumber;
    }

    public void setActivityNumber(String activityNumber) {
        this.activityNumber = activityNumber;
    }

    public String getActivityName() {
        return activityName;
    }

    public void setActivityName(String activityName) {
        this.activityName = activityName;
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public Date getEndDate() {
        return endDate;
    }
    
    public String getParticipant() {
		return participant;
	}

	public void setParticipant(String participant) {
		this.participant = participant;
	}

	public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public String getTechnicalField1() {
        return technicalField1;
    }

    public void setTechnicalField1(String technicalField1) {
        this.technicalField1 = technicalField1;
    }

    public String getTechnicalField2() {
        return technicalField2;
    }

    public void setTechnicalField2(String technicalField2) {
        this.technicalField2 = technicalField2;
    }

    public String getTechnicalField3() {
        return technicalField3;
    }

    public void setTechnicalField3(String technicalField3) {
        this.technicalField3 = technicalField3;
    }

    public Integer getTechnicalSource() {
        return technicalSource;
    }

    public void setTechnicalSource(Integer technicalSource) {
        this.technicalSource = technicalSource;
    }

    public String getIntellectualPropertyNumber() {
        return intellectualPropertyNumber;
    }

    public void setIntellectualPropertyNumber(String intellectualPropertyNumber) {
        this.intellectualPropertyNumber = intellectualPropertyNumber;
    }


    public String getImplement() {
        return implement;
    }

    public void setImplement(String implement) {
        this.implement = implement;
    }

    public String getTechnologyInnovation() {
        return technologyInnovation;
    }

    public void setTechnologyInnovation(String technologyInnovation) {
        this.technologyInnovation = technologyInnovation;
    }

    public String getAchievement() {
        return achievement;
    }

    public void setAchievement(String achievement) {
        this.achievement = achievement;
    }
    
    
    
    public BigDecimal getBudget() {
		return budget;
	}

	public void setBudget(BigDecimal budget) {
		this.budget = budget;
	}

	public BigDecimal getFirstYearExpenditure() {
		return firstYearExpenditure;
	}

	public void setFirstYearExpenditure(BigDecimal firstYearExpenditure) {
		this.firstYearExpenditure = firstYearExpenditure;
	}

	public BigDecimal getSecondYearExpenditure() {
		return secondYearExpenditure;
	}

	public void setSecondYearExpenditure(BigDecimal secondYearExpenditure) {
		this.secondYearExpenditure = secondYearExpenditure;
	}

	public BigDecimal getThirdYearExpenditure() {
		return thirdYearExpenditure;
	}

	public void setThirdYearExpenditure(BigDecimal thirdYearExpenditure) {
		this.thirdYearExpenditure = thirdYearExpenditure;
	}
	
	@JsonFormat(shape = Shape.STRING)
	public Integer getProjectMode() {
		return projectMode;
	}

	public void setProjectMode(Integer projectMode) {
		this.projectMode = projectMode;
	}

	public String getProofUrl() {
		return proofUrl;
	}

	public void setProofUrl(String proofUrl) {
		this.proofUrl = proofUrl;
	}

	@JsonIgnore
	public Integer getDeletedSign() {
		return deletedSign;
	}

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

	public String getStartDateFormattedDate(){
		if (this.startDate == null) {
			return null;
		} else {
			return DateFormatUtils.format(this.getStartDate(), AFTConstants.YYYYMMDD);
		}
	}
	
	public void setStartDateFormattedDate(String startDateFormattedDate){
		
	}
	
	public String getEndDateFormattedDate(){
		if (this.endDate == null) {
			return null;
		} else {
			return DateFormatUtils.format(this.getEndDate(), AFTConstants.YYYYMMDD);
		}
	}
	
	public void setEndDateFormattedDate(String endDateFormattedDate){
		
	}
	
	//立项证明材料
	public String getProofDownloadFileName(){
		if (StringUtils.isBlank(this.proofUrl)){
			return null;
		} else {
			return (null == this.activityName) ? "" : this.activityName +FileUtils.getDownloadFileName(this.proofUrl);
		}
	}
	
	public void setProofDownloadFileName(String proofDownloadFileName){
		
	}
}