package com.mortals.xhx.module.device.model;
import java.util.Date;
import java.util.List;
import java.util.ArrayList;
import java.math.BigDecimal;
import cn.hutool.core.date.DateUtil;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.device.model.vo.DeviceVo;
import lombok.Data;
/**
* 设备管理实体对象
*
* @author zxfei
* @date 2023-12-04
*/
@Data
public class DeviceEntity extends DeviceVo {
    private static final long serialVersionUID = 1L;

    /**
    * 设备名称
    */
    @Excel(name = "设备名称")
    private String deviceName;
    /**
    * 所属房间id
    */
    private Long roomId;
    /**
    * 所属房间名称
    */
    private String roomName;
    /**
    * 设备编码,SN码等，默认为MAC地址
    */
    @Excel(name = "设备编码,SN码等，默认为MAC地址")
    private String deviceCode;
    /**
    * 设备的MAC地址
    */
    private String deviceMac;
    /**
    * 站点Id，来源基础服务平台
    */
    private Long siteId;
    /**
    * 站点编号，来源基础服务平台
    */
    private String siteCode;
    /**
    * 站点名称
    */
    private String siteName;
    /**
    * 产品编码
    */
    private String productCode;
    /**
    * 产品名称
    */
    private String productName;
    /**
    * 设备生产厂商名称
    */
    @Excel(name = "设备生产厂商名称")
    private String deviceFirmname;
    /**
    * 分辨率(0.1920*1080,1.1366*768,2.1080*1920)
    */
    private Integer resolution;
    /**
    * 所属楼栋
    */
    private Integer deviceInBuilding;
    /**
    * 所属楼层
    */
    private Integer deviceInFloor;
    /**
    * 保修期至
    */
    private Date defectsLiabilityPeriod;
    /**
    * 负责人
    */
    private String leadingOfficial;
    /**
    * 设备位置
    */
    private String deviceAddr;
    /**
    * 联系电话
    */
    private String leadingOfficialTelephone;
    /**
    * 设备图片
    */
    private String devicePhotoPath;
    /**
    * 设备访问ip
    */
    private String ip;
    /**
    * 中心设备编码
    */
    private String centernum;
    /**
    * 端口
    */
    private String port;
    /**
    * 设备状态 (0.未激活，1.离线,2.在线)
    */
    private Integer deviceStatus;
    /**
    * 启用状态 (0.停止，1.启用)
    */
    private Integer enabled;
    /**
    * 备注
    */
    private String deviceRemark;
    /**
    * 最近上线时间
    */
    private Date onlineTime;
    /**
    * 最近离线时间
    */
    private Date offlineTime;
    @Override
    public int hashCode() {
         return this.getId().hashCode();
    }
    @Override
    public boolean equals(Object obj) {
        if (obj == null) return false;
        if (obj instanceof DeviceEntity) {
            DeviceEntity tmp = (DeviceEntity) obj;
            if (this.getId() == tmp.getId()) {
                 return true;
            }
        }
        return false;
    }

    public void initAttrValue(){
            this.deviceName = "";
            this.roomId = null;
            this.roomName = "";
            this.deviceCode = "";
            this.deviceMac = "";
            this.siteCode = "";
            this.siteName = "";
            this.productCode = "";
            this.productName = "";
            this.deviceFirmname = "";
            this.resolution = 0;
            this.deviceInBuilding = 0;
            this.deviceInFloor = 0;
            this.defectsLiabilityPeriod = new Date();
            this.leadingOfficial = "";
            this.deviceAddr = "";
            this.leadingOfficialTelephone = "";
            this.devicePhotoPath = "";
            this.ip = "";
            this.centernum = "";
            this.port = "";
            this.deviceStatus = 0;
            this.enabled = 1;
            this.deviceRemark = "";
            this.onlineTime = new Date();
            this.offlineTime = new Date();
    }
}