Newer
Older
PgInterface / src / main / java / com / casic / PgInterface / devData / dto / PgSenseDevDto.java
xiaowei on 9 Nov 2017 2 KB first commit
package com.casic.PgInterface.devData.dto;

import com.casic.PgInterface.devData.domain.PgSenseDev;

import java.io.Serializable;
import java.text.SimpleDateFormat;

/**
 * Created by yxw on 2017/11/2.
 */
public class PgSenseDevDto implements Serializable {

    private String id;
    private String deviceName;//设备
    private String upTime;//上传时间
    private String temperature;//温度
    private String o2;//氧气
    private String sh;//硫化氢
    private String ch4;//甲烷
    private String co;//一氧化碳

    public String getId() {
        return id;
    }

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

    public String getDeviceName() {
        return deviceName;
    }

    public void setDeviceName(String deviceName) {
        this.deviceName = deviceName;
    }

    public String getUpTime() {
        return upTime;
    }

    public void setUpTime(String upTime) {
        this.upTime = upTime;
    }

    public String getTemperature() {
        return temperature;
    }

    public void setTemperature(String temperature) {
        this.temperature = temperature;
    }

    public String getO2() {
        return o2;
    }

    public void setO2(String o2) {
        this.o2 = o2;
    }

    public String getSh() {
        return sh;
    }

    public void setSh(String sh) {
        this.sh = sh;
    }

    public String getCh4() {
        return ch4;
    }

    public void setCh4(String ch4) {
        this.ch4 = ch4;
    }

    public String getCo() {
        return co;
    }

    public void setCo(String co) {
        this.co = co;
    }

    public PgSenseDevDto(PgSenseDev pgSenseDev)
    {
        SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

        this.setId(String.valueOf(pgSenseDev.getId()));
        this.setDeviceName(pgSenseDev.getPgDeviceId().getDevName());
        this.setUpTime(sdf.format(pgSenseDev.getUpTime()));
        this.setTemperature(pgSenseDev.getTemperature());
        this.setCh4(pgSenseDev.getCh4());
        this.setCo(pgSenseDev.getCo());
        this.setO2(pgSenseDev.getO2());
        this.setSh(pgSenseDev.getSh());
    }

}