Newer
Older
PgInterface / src / main / java / com / casic / PgInterface / construction / dto / PgConstructionDto.java
T440 on 8 Dec 2019 3 KB 整改施工信息
package com.casic.PgInterface.construction.dto;

import com.casic.PgInterface.construction.domain.PgConstruction;
import com.casic.PgInterface.construction.manager.PgConstructionTypeManager;

import java.text.SimpleDateFormat;
/**
 * Created by zxh on 2018/3/23.
 */
public class PgConstructionDto{

    private String id;
    private String cs_name;//项目名称
    private String cs_detail;//施工内容
    private String cs_beginTime;//施工开始时间
    private String cs_endTime;//施工结束时间
    private String cs_charge;//施工负责人
    private String cs_phone;//联系方式
    private String cs_type;//工程类别
    private String ConstructionType;//施工状态
    private String parName;//所属仓

    public String getId() {
        return id;
    }

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

    public String getCs_name() {
        return cs_name;
    }

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

    public String getCs_detail() {
        return cs_detail;
    }

    public void setCs_detail(String cs_detail) {
        this.cs_detail = cs_detail;
    }

    public String getCs_beginTime() {
        return cs_beginTime;
    }

    public void setCs_beginTime(String cs_beginTime) {
        this.cs_beginTime = cs_beginTime;
    }

    public String getCs_endTime() {
        return cs_endTime;
    }

    public void setCs_endTime(String cs_endTime) {
        this.cs_endTime = cs_endTime;
    }

    public String getCs_charge() {
        return cs_charge;
    }

    public void setCs_charge(String cs_charge) {
        this.cs_charge = cs_charge;
    }

    public String getCs_phone() {
        return cs_phone;
    }

    public void setCs_phone(String cs_phone) {
        this.cs_phone = cs_phone;
    }

    public String getCs_type() {
        return cs_type;
    }

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

    public String getConstructionType() {
        return ConstructionType;
    }

    public void setConstructionType(String constructionType) {
        ConstructionType = constructionType;
    }

    public String getParName() {
        return parName;
    }

    public void setParName(String parName) {
        this.parName = parName;
    }

    public PgConstructionDto(){}

    public PgConstructionDto(PgConstruction pgConstruction, PgConstructionTypeManager pgConstructionTypeManager) {

        if (pgConstruction == null) {
            return;
        } else {
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

            this.setId(String.valueOf(pgConstruction.getId()));
            this.setCs_name(pgConstruction.getCs_name());
            this.setCs_detail(pgConstruction.getCs_detail());
            if (pgConstruction.getCs_beginTime() != null)
                this.setCs_beginTime(sdf.format(pgConstruction.getCs_beginTime()));
            else
                this.setCs_beginTime("");
            if (pgConstruction.getCs_endTime() != null)
                this.setCs_endTime(sdf.format(pgConstruction.getCs_endTime()));
            else
                this.setCs_endTime("");
            this.setCs_charge(pgConstruction.getCs_charge());
            this.setCs_phone(pgConstruction.getCs_phone());
            this.setCs_type(pgConstruction.getCs_type());

            if(pgConstruction.getPgConstructionTypeId()==null||pgConstructionTypeManager.get(pgConstruction.getPgConstructionTypeId())==null)
                this.setConstructionType("");
            else
                this.setConstructionType(pgConstructionTypeManager.get(pgConstruction.getPgConstructionTypeId()).getTypeName());

            this.setParName(pgConstruction.getParName());
        }
    }

}