package com.mortals.xhx.module.device.model;
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.DeviceMessageStatVo;
import lombok.Data;
/**
* 设备消息统计实体对象
*
* @author zxfei
* @date 2024-03-26
*/
@Data
public class DeviceMessageStatEntity extends DeviceMessageStatVo {
    private static final long serialVersionUID = 1L;

    /**
    * 站点Id，来源基础服务平台
    */
    private Long siteId;
    /**
    * 产品Id
    */
    private Long productId;
    /**
    * 产品编码
    */
    private String productCode;
    /**
    * 产品名称
    */
    private String productName;
    /**
    * 今日告警数量
    */
    private Integer alarmTotalCount;
    /**
    * 今日消息推送数量
    */
    private Integer pushTotalCount;
    /**
    * 今日上行消息数量
    */
    private Integer uploadMessageTotalCount;
    /**
    * 今日下行消息数量
    */
    private Integer downloadMessageTotalCount;
    /**
    * 年
    */
    private Integer year;
    /**
    * 月
    */
    private Integer month;
    /**
    * 日
    */
    private Integer day;
    @Override
    public int hashCode() {
         return this.getId().hashCode();
    }
    @Override
    public boolean equals(Object obj) {
        if (obj == null) return false;
        if (obj instanceof DeviceMessageStatEntity) {
            DeviceMessageStatEntity tmp = (DeviceMessageStatEntity) obj;
            if (this.getId() == tmp.getId()) {
                 return true;
            }
        }
        return false;
    }

    public void initAttrValue(){
            this.siteId = null;
            this.productId = null;
            this.productCode = "";
            this.productName = "";
            this.alarmTotalCount = 0;
            this.pushTotalCount = 0;
            this.uploadMessageTotalCount = 0;
            this.downloadMessageTotalCount = 0;
            this.year = DateUtil.year(new Date());
            this.month = DateUtil.month(new Date())+1;
            this.day = DateUtil.dayOfMonth(new Date());
    }
}