package com.casic.PgInterface.patroler.dto;

import com.casic.PgInterface.patroler.domain.PgInPgStatus;

import java.text.SimpleDateFormat;

/**
 * Created by yxw on 2018/4/2.
 */
public class PgInPgStatusDto {

    private String id;
    private String inTime;//入廊时间
    private String outTime;//出廊时间

    public String getId() {
        return id;
    }

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

    public String getInTime() {
        return inTime;
    }

    public void setInTime(String inTime) {
        this.inTime = inTime;
    }

    public String getOutTime() {
        return outTime;
    }

    public void setOutTime(String outTime) {
        this.outTime = outTime;
    }

    public PgInPgStatusDto(PgInPgStatus pgInPgStatus) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

        this.setId(String.valueOf(pgInPgStatus.getId()));
        if (pgInPgStatus.getInTime() != null)
            this.setInTime(sdf.format(pgInPgStatus.getInTime()));
        else
            this.setInTime("");
        if (pgInPgStatus.getOutTime() != null)
            this.setOutTime(sdf.format(pgInPgStatus.getOutTime()));
        else
            this.setOutTime("");
    }

}
