package com.casic.PgInterface.devTable.dto;

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

import java.text.SimpleDateFormat;

/**
 * Created by yxw on 2018/9/3.
 */

public class PgEquipmentDto{

    private long id;
    private String eqName;//名称
    private String eqCode;//编号
    private String eqType;//类型
    private String ownerUnit;//权属单位
    private String enterDate;//入库时间
    private String curUser;//当前使用人

    public long getId() {
        return id;
    }

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

    public String getEqName() {
        return eqName;
    }

    public void setEqName(String eqName) {
        this.eqName = eqName;
    }

    public String getEqCode() {
        return eqCode;
    }

    public void setEqCode(String eqCode) {
        this.eqCode = eqCode;
    }

    public String getEqType() {
        return eqType;
    }

    public void setEqType(String eqType) {
        this.eqType = eqType;
    }

    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 getCurUser() {
        return curUser;
    }

    public void setCurUser(String curUser) {
        this.curUser = curUser;
    }

    public PgEquipmentDto(PgEquipment equipment) {
        if (equipment == null) return;

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

        this.setId(equipment.getId());
        this.setEqName(equipment.getEqName());
        this.setEqCode(equipment.getEqCode());
        this.setCurUser(equipment.getCurUser());
        this.setEqType(equipment.getEqType());
        this.setOwnerUnit(equipment.getOwnerUnit());
        this.setEnterDate(sdf.format(equipment.getEnterDate()));

    }

}
