Newer
Older
PgInterface / src / main / java / com / casic / PgInterface / devTable / dto / PgPipeLineDto.java
T440 on 24 Aug 2019 3 KB 整理管线部分
package com.casic.PgInterface.devTable.dto;

import com.casic.PgInterface.devTable.domain.PgPipeLine;
import com.casic.PgInterface.devTable.manager.PgPartitionManager;
import com.casic.PgInterface.devTable.manager.PipeGalleryManager;

import java.text.SimpleDateFormat;

/**
 * Created by yxw on 2017/10/30.
 */
public class PgPipeLineDto{

    private String id;
    private String lineName;//管线唯一编号
    private String lineType;//管线类型
    private String ownerUnit;//权属单位
    private String enterDate;//入廊时间
    private String layerNum;//所在层数
    private String diameter;//管径
    private String pipeLength;//管线长度
    private String pipeGallery;//仓位
    private String partition;//分区
    private String active;//状态位

    public String getId() {
        return id;
    }

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

    public String getLineName() {
        return lineName;
    }

    public void setLineName(String lineName) {
        this.lineName = lineName;
    }

    public String getLineType() {
        return lineType;
    }

    public void setLineType(String lineType) {
        this.lineType = lineType;
    }

    public String getOwnerUnit() {
        return ownerUnit;
    }

    public void setOwnerUnit(String ownerUnit) {
        this.ownerUnit = ownerUnit;
    }

    public String getEnterDate() {
        return enterDate;
    }

    public void setEnterDate(String enterDate) {
        this.enterDate = enterDate;
    }

    public String getLayerNum() {
        return layerNum;
    }

    public void setLayerNum(String layerNum) {
        this.layerNum = layerNum;
    }

    public String getDiameter() {
        return diameter;
    }

    public void setDiameter(String diameter) {
        this.diameter = diameter;
    }

    public String getPipeGallery() {
        return pipeGallery;
    }

    public void setPipeGallery(String pipeGallery) {
        this.pipeGallery = pipeGallery;
    }

    public String getPipeLength() {
        return pipeLength;
    }

    public void setPipeLength(String pipeLength) {
        this.pipeLength = pipeLength;
    }

    public String getPartition() {
        return partition;
    }

    public void setPartition(String partition) {
        this.partition = partition;
    }

    public String getActive() {
        return active;
    }

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

    public PgPipeLineDto(PgPipeLine pgPipeLine, PgPartitionManager pgPartitionManager, PipeGalleryManager pipeGalleryManager) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");

        this.setId(String.valueOf(pgPipeLine.getId()));
        this.setLineName(pgPipeLine.getLineName());
        this.setLineType(pgPipeLine.getLineType());
        this.setOwnerUnit(pgPipeLine.getOwnerUnit());
        if (pgPipeLine.getEnterDate() != null)
            this.setEnterDate(sdf.format(pgPipeLine.getEnterDate()));
        else
            this.setEnterDate("");
        this.setLayerNum(pgPipeLine.getLayerNum());
        this.setDiameter(pgPipeLine.getDiameter());
        this.setPipeLength(String.valueOf(pgPipeLine.getPipeLength()));
        this.setActive(String.valueOf(pgPipeLine.getActive()));

        if(pgPipeLine.getPipeGalleryId()==null||pipeGalleryManager.get(pgPipeLine.getPipeGalleryId())==null)
            this.setPipeGallery("");
        else
            this.setPipeGallery(pipeGalleryManager.get(pgPipeLine.getPipeGalleryId()).getPgName());

        if(pgPipeLine.getPartitionId()==null||pgPartitionManager.get(pgPipeLine.getPartitionId())==null)
            this.setPartition("");
        else
            this.setPartition(pgPartitionManager.get(pgPipeLine.getPartitionId()).getParName());

    }
}