package com.casic.PgInterface.construction.dto;

import com.casic.PgInterface.construction.domain.PgCsDocument;

import java.text.SimpleDateFormat;

/**
 * Created by zxh on 2018/3/28.
 */
public class PgCsDocumentDto{

    private String id;
    private String list_name;//表单名称
    private String doc_name;//文档名称
    private String cs_name;//项目名称
    private String cs_type;//工程类别
    private String cs_time;//施工时间
    private String construct_doc;//施工文档
    private String active;//状态位

    public String getId() {
        return id;
    }

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

    public String getList_name() {
        return list_name;
    }

    public void setList_name(String list_name) {
        this.list_name = list_name;
    }

    public String getDoc_name(){ return doc_name; }

    public void setDoc_name(String doc_name){ this.doc_name = doc_name; }

    public String getCs_name() {
        return cs_name;
    }

    public void setCs_name(String cs_name) {
        this.cs_name = cs_name;
    }

    public String getCs_type() {
        return cs_type;
    }

    public void setCs_type(String cs_type) {
        this.cs_type = cs_type;
    }

    public String getCs_time() {
        return cs_time;
    }

    public void setCs_time(String cs_time) {
        this.cs_time = cs_time;
    }

    public String getConstruct_doc(){ return construct_doc; }

    public void setConstruct_doc(String construct_doc){ this.construct_doc = construct_doc; }

    public String getActive(){ return active; }

    public void setActive(String active){ this.active = active; }

    public PgCsDocumentDto(){}

    public PgCsDocumentDto (PgCsDocument pgCsDocument)
    {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");

        this.setId(String.valueOf(pgCsDocument.getId()));
        this.setList_name(pgCsDocument.getList_name());
        this.setDoc_name(pgCsDocument.getDoc_name());
        this.setCs_name(pgCsDocument.getPgConstructionId().getCs_name());
        this.setCs_type(pgCsDocument.getPgConstructionId().getCs_type());
        if(pgCsDocument.getPgConstructionId().getCs_beginTime()!=null)
        this.setCs_time(sdf.format(pgCsDocument.getPgConstructionId().getCs_beginTime()));
        else
        this.setCs_time("");
        this.setConstruct_doc(pgCsDocument.getConstruct_doc());
        this.setActive(String.valueOf(pgCsDocument.getActive()));

    }
}
