package com.mortals.xhx.module.device.model;

import java.util.Date;
import java.util.List;
import java.util.ArrayList;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.base.framework.CustomJsonDateDeserializer;
import com.mortals.xhx.module.device.model.vo.DeviceVo;
/**
 * 设备实体对象
 *
 * @author zxfei
 * @date 2022-07-11
 */

public class DeviceEntity extends DeviceVo {
    private static final long serialVersionUID = 1L;

    /**
     * 设备名称
     */
    @Excel(name = "设备名称")
    private String deviceName;

    /**
     * 设备SN码
     */
    @Excel(name = "设备SN码")
    private String deviceSN;

    /**
     * 设备编码，默认为MAC地址
     */
    @Excel(name = "设备编码")
    private String deviceCode;
    /**
     * 设备的MAC地址
     */
    @Excel(name = "Mac地址",type = Excel.Type.EXPORT)
    private String deviceMac;
    /**
     * 站点Id，来源基础服务平台
     */
    private Long siteId;
    /**
     * 站点编号，来源基础服务平台
     */
    private String siteCode;
    /**
     * 站点名称
     */
    private String siteName;
    /**
     * 平台系统Id
     */
    private Long platformId;
    /**
     * 平台系统名称
     */
    private String platformName;
    /**
     * 产品Id
     */
    private Long productId;
    /**
     * 产品名称
     */
    private String productName;
    /**
     * 设备生产厂商ID
     */
    private Long deviceFirmId;
    /**
     * 设备生产厂商名称
     */
    private String deviceFirmname;
    /**
     * 设备来源(0.子设备，1.网关设备，2.直连设备)
     */
    private Integer deviceSrc;
    /**
     * 数据获取方式(0.主动上报，1.被动拉取)
     */
    private Integer deviceDataSourceWay;
    /**
     * 经度
     */
    private String lon;
    /**
     * 经度
     */
    private String lati;
    /**
     * 所属楼栋
     */
    private Integer deviceInBuilding;
    /**
     * 所属楼层
     */
    private Integer deviceInFloor;
    /**
     * 保修期至
     */
    @JsonDeserialize(using = CustomJsonDateDeserializer.class)
    private Date defectsLiabilityPeriod;
    /**
     * 负责人
     */
    private String leadingOfficial;
    /**
     * 联系电话
     */
    private String leadingOfficialTelephone;
    /**
     * 是否接收异常短(0.否，1.是)
     */
    private Integer isReceiveMess;
    /**
     * 设备图片
     */
    @Excel(name = "设备图片",height = 90, type = Excel.Type.EXPORT, cellType = Excel.ColumnType.IMAGE)
    private String devicePhotoPath;
    /**
     * 设备访问ip
     */
    private String ip;
    /**
     * 中心设备编码
     */
    private String centernum;
    /**
     * 端口
     */
    private String port;
    /**
     * 设备topic信息
     */
    private String deviceTopic;
    /**
     * 设备状态 (0.未激活，1.离线,2.在线)
     */
    private Integer deviceStatus;
    /**
     * 启用状态 (0.停止，1.启用)
     */
    private Integer enabled;
    /**
     * 设备授权码
     */
    private String deviceAuthCode;
    /**
     * 备注
     */
    private String deviceRemark;
    /**
     * 最近上线时间
     */
    private Date onlineTime;
    /**
     * 最近离线时间
     */
    private Date offlineTime;
    /**
     * 是否删除(0.否，1.是)
     */
    private Integer deleted;
    /**
     * 设备来源(0.旧设备，1.新设备)
     */
    private Integer source;

    /**
     * 皮肤id
     */
    private Long skinId;
    /**
     * 皮肤名称
     */
    private String skinName;
    /**
     * 首页地址
     */
    private String homeUrl;

    /**
     * 设备版本
     */
    private String deviceVersion;



    public DeviceEntity(){}
    /**
     * 获取 设备名称
     * @return String
     */
    public String getDeviceName(){
        return deviceName;
    }
    /**
     * 设置 设备名称
     * @param deviceName
     */
    public void setDeviceName(String deviceName){
        this.deviceName = deviceName;
    }
    /**
     * 获取 设备编码,SN码等，默认为MAC地址
     * @return String
     */
    public String getDeviceCode(){
        return deviceCode;
    }
    /**
     * 设置 设备编码,SN码等，默认为MAC地址
     * @param deviceCode
     */
    public void setDeviceCode(String deviceCode){
        this.deviceCode = deviceCode;
    }
    /**
     * 获取 设备的MAC地址
     * @return String
     */
    public String getDeviceMac(){
        return deviceMac;
    }
    /**
     * 设置 设备的MAC地址
     * @param deviceMac
     */
    public void setDeviceMac(String deviceMac){
        this.deviceMac = deviceMac;
    }
    /**
     * 获取 站点Id，来源基础服务平台
     * @return Long
     */
    public Long getSiteId(){
        return siteId;
    }
    /**
     * 设置 站点Id，来源基础服务平台
     * @param siteId
     */
    public void setSiteId(Long siteId){
        this.siteId = siteId;
    }
    /**
     * 获取 站点编号，来源基础服务平台
     * @return String
     */
    public String getSiteCode(){
        return siteCode;
    }
    /**
     * 设置 站点编号，来源基础服务平台
     * @param siteCode
     */
    public void setSiteCode(String siteCode){
        this.siteCode = siteCode;
    }
    /**
     * 获取 站点名称
     * @return String
     */
    public String getSiteName(){
        return siteName;
    }
    /**
     * 设置 站点名称
     * @param siteName
     */
    public void setSiteName(String siteName){
        this.siteName = siteName;
    }
    /**
     * 获取 平台系统Id
     * @return Long
     */
    public Long getPlatformId(){
        return platformId;
    }
    /**
     * 设置 平台系统Id
     * @param platformId
     */
    public void setPlatformId(Long platformId){
        this.platformId = platformId;
    }
    /**
     * 获取 平台系统名称
     * @return String
     */
    public String getPlatformName(){
        return platformName;
    }
    /**
     * 设置 平台系统名称
     * @param platformName
     */
    public void setPlatformName(String platformName){
        this.platformName = platformName;
    }
    /**
     * 获取 产品Id
     * @return Long
     */
    public Long getProductId(){
        return productId;
    }
    /**
     * 设置 产品Id
     * @param productId
     */
    public void setProductId(Long productId){
        this.productId = productId;
    }
    /**
     * 获取 产品名称
     * @return String
     */
    public String getProductName(){
        return productName;
    }
    /**
     * 设置 产品名称
     * @param productName
     */
    public void setProductName(String productName){
        this.productName = productName;
    }
    /**
     * 获取 设备生产厂商ID
     * @return Long
     */
    public Long getDeviceFirmId(){
        return deviceFirmId;
    }
    /**
     * 设置 设备生产厂商ID
     * @param deviceFirmId
     */
    public void setDeviceFirmId(Long deviceFirmId){
        this.deviceFirmId = deviceFirmId;
    }
    /**
     * 获取 设备生产厂商名称
     * @return String
     */
    public String getDeviceFirmname(){
        return deviceFirmname;
    }
    /**
     * 设置 设备生产厂商名称
     * @param deviceFirmname
     */
    public void setDeviceFirmname(String deviceFirmname){
        this.deviceFirmname = deviceFirmname;
    }
    /**
     * 获取 设备来源(0.子设备，1.网关设备，2.直连设备)
     * @return Integer
     */
    public Integer getDeviceSrc(){
        return deviceSrc;
    }
    /**
     * 设置 设备来源(0.子设备，1.网关设备，2.直连设备)
     * @param deviceSrc
     */
    public void setDeviceSrc(Integer deviceSrc){
        this.deviceSrc = deviceSrc;
    }
    /**
     * 获取 数据获取方式(0.主动上报，1.被动拉取)
     * @return Integer
     */
    public Integer getDeviceDataSourceWay(){
        return deviceDataSourceWay;
    }
    /**
     * 设置 数据获取方式(0.主动上报，1.被动拉取)
     * @param deviceDataSourceWay
     */
    public void setDeviceDataSourceWay(Integer deviceDataSourceWay){
        this.deviceDataSourceWay = deviceDataSourceWay;
    }
    /**
     * 获取 经度
     * @return String
     */
    public String getLon(){
        return lon;
    }
    /**
     * 设置 经度
     * @param lon
     */
    public void setLon(String lon){
        this.lon = lon;
    }
    /**
     * 获取 经度
     * @return String
     */
    public String getLati(){
        return lati;
    }
    /**
     * 设置 经度
     * @param lati
     */
    public void setLati(String lati){
        this.lati = lati;
    }
    /**
     * 获取 所属楼栋
     * @return Integer
     */
    public Integer getDeviceInBuilding(){
        return deviceInBuilding;
    }
    /**
     * 设置 所属楼栋
     * @param deviceInBuilding
     */
    public void setDeviceInBuilding(Integer deviceInBuilding){
        this.deviceInBuilding = deviceInBuilding;
    }
    /**
     * 获取 所属楼层
     * @return Integer
     */
    public Integer getDeviceInFloor(){
        return deviceInFloor;
    }
    /**
     * 设置 所属楼层
     * @param deviceInFloor
     */
    public void setDeviceInFloor(Integer deviceInFloor){
        this.deviceInFloor = deviceInFloor;
    }
    /**
     * 获取 保修期至
     * @return Date
     */
    public Date getDefectsLiabilityPeriod(){
        return defectsLiabilityPeriod;
    }
    /**
     * 设置 保修期至
     * @param defectsLiabilityPeriod
     */
    public void setDefectsLiabilityPeriod(Date defectsLiabilityPeriod){
        this.defectsLiabilityPeriod = defectsLiabilityPeriod;
    }
    /**
     * 获取 负责人
     * @return String
     */
    public String getLeadingOfficial(){
        return leadingOfficial;
    }
    /**
     * 设置 负责人
     * @param leadingOfficial
     */
    public void setLeadingOfficial(String leadingOfficial){
        this.leadingOfficial = leadingOfficial;
    }
    /**
     * 获取 联系电话
     * @return String
     */
    public String getLeadingOfficialTelephone(){
        return leadingOfficialTelephone;
    }
    /**
     * 设置 联系电话
     * @param leadingOfficialTelephone
     */
    public void setLeadingOfficialTelephone(String leadingOfficialTelephone){
        this.leadingOfficialTelephone = leadingOfficialTelephone;
    }
    /**
     * 获取 是否接收异常短(0.否，1.是)
     * @return Integer
     */
    public Integer getIsReceiveMess(){
        return isReceiveMess;
    }
    /**
     * 设置 是否接收异常短(0.否，1.是)
     * @param isReceiveMess
     */
    public void setIsReceiveMess(Integer isReceiveMess){
        this.isReceiveMess = isReceiveMess;
    }
    /**
     * 获取 设备图片
     * @return String
     */
    public String getDevicePhotoPath(){
        return devicePhotoPath;
    }
    /**
     * 设置 设备图片
     * @param devicePhotoPath
     */
    public void setDevicePhotoPath(String devicePhotoPath){
        this.devicePhotoPath = devicePhotoPath;
    }
    /**
     * 获取 设备访问ip
     * @return String
     */
    public String getIp(){
        return ip;
    }
    /**
     * 设置 设备访问ip
     * @param ip
     */
    public void setIp(String ip){
        this.ip = ip;
    }
    /**
     * 获取 中心设备编码
     * @return String
     */
    public String getCenternum(){
        return centernum;
    }
    /**
     * 设置 中心设备编码
     * @param centernum
     */
    public void setCenternum(String centernum){
        this.centernum = centernum;
    }
    /**
     * 获取 端口
     * @return String
     */
    public String getPort(){
        return port;
    }
    /**
     * 设置 端口
     * @param port
     */
    public void setPort(String port){
        this.port = port;
    }
    /**
     * 获取 设备topic信息
     * @return String
     */
    public String getDeviceTopic(){
        return deviceTopic;
    }
    /**
     * 设置 设备topic信息
     * @param deviceTopic
     */
    public void setDeviceTopic(String deviceTopic){
        this.deviceTopic = deviceTopic;
    }
    /**
     * 获取 设备状态 (0.未激活，1.离线,2.在线)
     * @return Integer
     */
    public Integer getDeviceStatus(){
        return deviceStatus;
    }
    /**
     * 设置 设备状态 (0.未激活，1.离线,2.在线)
     * @param deviceStatus
     */
    public void setDeviceStatus(Integer deviceStatus){
        this.deviceStatus = deviceStatus;
    }
    /**
     * 获取 启用状态 (0.停止，1.启用)
     * @return Integer
     */
    public Integer getEnabled(){
        return enabled;
    }
    /**
     * 设置 启用状态 (0.停止，1.启用)
     * @param enabled
     */
    public void setEnabled(Integer enabled){
        this.enabled = enabled;
    }
    /**
     * 获取 设备授权码
     * @return String
     */
    public String getDeviceAuthCode(){
        return deviceAuthCode;
    }
    /**
     * 设置 设备授权码
     * @param deviceAuthCode
     */
    public void setDeviceAuthCode(String deviceAuthCode){
        this.deviceAuthCode = deviceAuthCode;
    }
    /**
     * 获取 备注
     * @return String
     */
    public String getDeviceRemark(){
        return deviceRemark;
    }
    /**
     * 设置 备注
     * @param deviceRemark
     */
    public void setDeviceRemark(String deviceRemark){
        this.deviceRemark = deviceRemark;
    }
    /**
     * 获取 最近上线时间
     * @return Date
     */
    public Date getOnlineTime(){
        return onlineTime;
    }
    /**
     * 设置 最近上线时间
     * @param onlineTime
     */
    public void setOnlineTime(Date onlineTime){
        this.onlineTime = onlineTime;
    }
    /**
     * 获取 最近离线时间
     * @return Date
     */
    public Date getOfflineTime(){
        return offlineTime;
    }
    /**
     * 设置 最近离线时间
     * @param offlineTime
     */
    public void setOfflineTime(Date offlineTime){
        this.offlineTime = offlineTime;
    }
    /**
     * 获取 是否删除(0.否，1.是)
     * @return Integer
     */
    public Integer getDeleted(){
        return deleted;
    }
    /**
     * 设置 是否删除(0.否，1.是)
     * @param deleted
     */
    public void setDeleted(Integer deleted){
        this.deleted = deleted;
    }
    /**
     * 获取 收不来源(0.旧设备，1.新设备)
     * @return Integer
     */
    public Integer getSource(){
        return source;
    }
    /**
     * 设置 收不来源(0.旧设备，1.新设备)
     * @param source
     */
    public void setSource(Integer source){
        this.source = source;
    }


    public Long getSkinId() {
        return skinId;
    }

    public void setSkinId(Long skinId) {
        this.skinId = skinId;
    }

    public String getSkinName() {
        return skinName;
    }

    public void setSkinName(String skinName) {
        this.skinName = skinName;
    }

    public String getHomeUrl() {
        return homeUrl;
    }

    public void setHomeUrl(String homeUrl) {
        this.homeUrl = homeUrl;
    }

    public String getDeviceSN() {
        return deviceSN;
    }

    public void setDeviceSN(String deviceSN) {
        this.deviceSN = deviceSN;
    }

    public String getDeviceVersion() {
        return deviceVersion;
    }

    public void setDeviceVersion(String deviceVersion) {
        this.deviceVersion = deviceVersion;
    }

    @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 String toString(){
        StringBuilder sb = new StringBuilder("");
        sb.append(",deviceName:").append(getDeviceName());
        sb.append(",deviceCode:").append(getDeviceCode());
        sb.append(",deviceMac:").append(getDeviceMac());
        sb.append(",siteId:").append(getSiteId());
        sb.append(",siteCode:").append(getSiteCode());
        sb.append(",siteName:").append(getSiteName());
        sb.append(",platformId:").append(getPlatformId());
        sb.append(",platformName:").append(getPlatformName());
        sb.append(",productId:").append(getProductId());
        sb.append(",productName:").append(getProductName());
        sb.append(",deviceFirmId:").append(getDeviceFirmId());
        sb.append(",deviceFirmname:").append(getDeviceFirmname());
        sb.append(",deviceSrc:").append(getDeviceSrc());
        sb.append(",deviceDataSourceWay:").append(getDeviceDataSourceWay());
        sb.append(",lon:").append(getLon());
        sb.append(",lati:").append(getLati());
        sb.append(",deviceInBuilding:").append(getDeviceInBuilding());
        sb.append(",deviceInFloor:").append(getDeviceInFloor());
        sb.append(",defectsLiabilityPeriod:").append(getDefectsLiabilityPeriod());
        sb.append(",leadingOfficial:").append(getLeadingOfficial());
        sb.append(",leadingOfficialTelephone:").append(getLeadingOfficialTelephone());
        sb.append(",isReceiveMess:").append(getIsReceiveMess());
        sb.append(",devicePhotoPath:").append(getDevicePhotoPath());
        sb.append(",ip:").append(getIp());
        sb.append(",centernum:").append(getCenternum());
        sb.append(",port:").append(getPort());
        sb.append(",deviceTopic:").append(getDeviceTopic());
        sb.append(",deviceStatus:").append(getDeviceStatus());
        sb.append(",enabled:").append(getEnabled());
        sb.append(",deviceAuthCode:").append(getDeviceAuthCode());
        sb.append(",deviceRemark:").append(getDeviceRemark());
        sb.append(",onlineTime:").append(getOnlineTime());
        sb.append(",offlineTime:").append(getOfflineTime());
        sb.append(",deleted:").append(getDeleted());
        sb.append(",source:").append(getSource());
        return sb.toString();
    }

    public void initAttrValue(){

        this.deviceName = "";

        this.deviceCode = "";

        this.deviceSN = "";

        this.deviceMac = "";

        this.siteId = null;

        this.siteCode = "";

        this.siteName = "";

        this.platformId = null;

        this.platformName = "";

        this.productId = null;

        this.productName = "";

        this.deviceFirmId = null;

        this.deviceFirmname = "";

        this.deviceSrc = 2;

        this.deviceDataSourceWay = 0;

        this.lon = "";

        this.lati = "";

        this.deviceInBuilding = null;

        this.deviceInFloor = null;

        this.defectsLiabilityPeriod = null;

        this.leadingOfficial = "";

        this.leadingOfficialTelephone = "";

        this.isReceiveMess = 0;

        this.devicePhotoPath = "";

        this.ip = "";

        this.centernum = "";

        this.port = "";

        this.deviceTopic = "";

        this.deviceStatus = 0;

        this.enabled = 0;

        this.deviceAuthCode = "";

        this.deviceRemark = "";

        this.onlineTime = null;

        this.offlineTime = null;

        this.deleted = 0;

        this.source = 1;

        this.skinId = null;

        this.skinName = "";

        this.deviceVersion = "";

        this.homeUrl = "";
    }
}