package com.casic.PgInterface.devTable.dto;

import com.casic.PgInterface.devTable.domain.PgDevice;

import java.text.SimpleDateFormat;

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

    private String id;
    private String pipeGallery;//仓位
    private String partition;//分区
    private String road;//路名
    private String position;//设备位置
    private String devType;//设备类型
    private String devCode;//设备编号
    private String assetName;//资产名称
    private String assetCode;//资产编号
    private String assetBarCode;//资产条码
    private String ip;//IP地址
    private String modBus;//modBus地址
    private String mome;//备注
    private String isOpen;//设备开启状态
    private String active;//状态位

    public String getId() {
        return id;
    }

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

    public String getPartition() {
        return partition;
    }

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

    public String getPipeGallery() {
        return pipeGallery;
    }

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

    public String getRoad() {
        return road;
    }

    public void setRoad(String road) {
        this.road = road;
    }

    public String getPosition() {
        return position;
    }

    public void setPosition(String position) {
        this.position = position;
    }

    public String getDevType() {
        return devType;
    }

    public void setDevType(String devType) {
        this.devType = devType;
    }

    public String getDevCode() {
        return devCode;
    }

    public void setDevCode(String devCode) {
        this.devCode = devCode;
    }

    public String getAssetName() {
        return assetName;
    }

    public void setAssetName(String assetName) {
        this.assetName = assetName;
    }

    public String getAssetCode() {
        return assetCode;
    }

    public void setAssetCode(String assetCode) {
        this.assetCode = assetCode;
    }

    public String getAssetBarCode() {
        return assetBarCode;
    }

    public void setAssetBarCode(String assetBarCode) {
        this.assetBarCode = assetBarCode;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getModBus() {
        return modBus;
    }

    public void setModBus(String modBus) {
        this.modBus = modBus;
    }

    public String getMome() {
        return mome;
    }

    public void setMome(String mome) {
        this.mome = mome;
    }

    public String getIsOpen() {
        return isOpen;
    }

    public void setIsOpen(String isOpen) {
        this.isOpen = isOpen;
    }

    public String getActive() {
        return active;
    }

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

    public PgDeviceDto(PgDevice pgDevice) {

        if (pgDevice == null)
            return;

        SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");

        this.setId(String.valueOf(pgDevice.getId()));
        this.setPipeGallery(pgDevice.getPipeGallery());
        this.setPartition(pgDevice.getPartition());
        this.setRoad(pgDevice.getRoad());
        this.setPosition(pgDevice.getPosition());
        this.setDevType(pgDevice.getDevType());
        this.setDevCode(pgDevice.getDevCode());
        this.setAssetName(pgDevice.getAssetName());
        this.setAssetCode(pgDevice.getAssetCode());
        this.setAssetBarCode(pgDevice.getAssetBarCode());
        this.setIp(pgDevice.getIp());
        this.setModBus(pgDevice.getModBus());
        this.setMome(pgDevice.getMome());
        this.setIsOpen(String.valueOf(pgDevice.getIsOpen()));
        this.setActive(String.valueOf(pgDevice.getActive()));

    }

}