package com.yanzhu.jh.project.domain.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.yanzhu.jh.project.domain.SurProjectPlan;
import org.apache.poi.ss.usermodel.HorizontalAlignment;

import java.util.Date;

/**
 * 城建项目计划
 */
public class UrbanPlanExport {
    @Excel(name = "编号(不要修改)", width = 20,prompt = "不要修改修改此列")
    private Long id;

    /** 项目名称 */
    @Excel(name = "项目名称", width = 30,align = HorizontalAlignment.LEFT)
    private String projectName;

    /** 建设规模及主要建设内容 */
    @Excel(name = "建设规模及主要工程内容", width = 40,align = HorizontalAlignment.LEFT)
    private String content;

    /** 建设性质 */
    @Excel(name = "建设性质（新建/续建/前期）")
    private String buildType;

    /** 包抓部门 */
    @Excel(name = "包抓部门")
    private String dept;

    /** 开工日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "开工时限", dateFormat = "yyyy.MM")
    private String startDate;

    /** 完工日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "建成时限", dateFormat = "yyyy.MM")
    private String endDate;

    /** 总投资（万元） */
    @Excel(name = "总投资（万元）")
    private Long totalInvestment;

    /** 年度投资（万元） */
    @Excel(name = "年度投资（万元）")
    private Long yearInvestment;

    public static UrbanPlanExport convert(SurProjectPlan it) {
        UrbanPlanExport p=new UrbanPlanExport();
        p.id=it.getId();
        p.buildType=it.getBuildType();
        p.content=it.getContent();
        p.dept=it.getDept();
        p.endDate=it.getEndDate();
        p.startDate=it.getStartDate();
        p.projectName=it.getProjectName();
        p.totalInvestment=it.getTotalInvestment();
        p.yearInvestment=it.getYearInvestment();
        return p;
    }

    public Long getId() {
        return id;
    }

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

    public String getProjectName() {
        return projectName;
    }

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

    public String getContent() {
        return content;
    }

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

    public String getBuildType() {
        return buildType;
    }

    public void setBuildType(String buildType) {
        this.buildType = buildType;
    }

    public String getDept() {
        return dept;
    }

    public void setDept(String dept) {
        this.dept = dept;
    }

    public String getStartDate() {
        return startDate;
    }

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

    public String getEndDate() {
        return endDate;
    }

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

    public Long getTotalInvestment() {
        return totalInvestment;
    }

    public void setTotalInvestment(Long totalInvestment) {
        this.totalInvestment = totalInvestment;
    }

    public Long getYearInvestment() {
        return yearInvestment;
    }

    public void setYearInvestment(Long yearInvestment) {
        this.yearInvestment = yearInvestment;
    }

    public void setValue(SurProjectPlan it) {
        it.setContent(this.content);
        it.setDept(this.dept);
        it.setProjectName(this.projectName);
        it.setBuildType(this.buildType);
        it.setStartDate(this.startDate);
        it.setEndDate(this.endDate);
        it.setTotalInvestment(this.totalInvestment);
        it.setYearInvestment(this.yearInvestment);
    }

    public SurProjectPlan toPlan() {
        SurProjectPlan p=new SurProjectPlan();
        p.setPlanType(0l);
        p.setYearInvestment(this.yearInvestment);
        p.setDept(this.dept);
        p.setTotalInvestment(this.totalInvestment);
        p.setEndDate(this.endDate);
        p.setStartDate(this.startDate);
        p.setBuildType(this.buildType);
        p.setProjectName(this.projectName);
        p.setContent(this.content);
        p.setIsDel(0l);
        return p;
    }
}
