package com.njcn.device.pms.pojo.vo;

import cn.hutool.core.util.NumberUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 主网运行指标统计返回前端实体类
 *
 * @author yzh
 * @date 2022/11/1
 */
@Data
public class ROperatingIndexVO implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 单位ID
     */
    @ApiModelProperty(name = "orgNo", value = "单位ID")
    private String orgNo;

    /**
     * 单位名称
     */
    @ApiModelProperty(name = "orgName", value = "单位名称")
    private String orgName;

    /**
     * 时间
     */
    @ApiModelProperty(name = "dataDate", value = "时间")
    private Date dataDate;

    /**
     * 监测点数量
     */
    @ApiModelProperty(name = "measurementCount", value = "监测点数量")
    private Integer measurementCount;

    /**
     * 有效接入监测点数量
     */
    @ApiModelProperty(name = " effectiveAccessMeasurementCount", value = "有效接入监测点数量")
    private Integer effectiveAccessMeasurementCount;
    /**
     * 有效接入率【有效接入监测点数量/在运监测点数】
     */
    @ApiModelProperty(name = "effectiveAccessRate", value = "有效接入率【有效接入监测点数量/在运监测点数】")
    private Double effectiveAccessRate;
    /**
     * 数据完整率
     */
    @ApiModelProperty(name = "dataIntegrityRate", value = "数据完整率")
    private Double dataIntegrityRate;
    /**
     * 指标完整率
     */
    @ApiModelProperty(name = "indexIntegrityRate", value = "指标完整率")
    private Double indexIntegrityRate;
    /**
     * 数据是否异常(0:正常 1:异常)
     */
    @ApiModelProperty(name = " isUnusual", value = "数据是否异常(0:正常 1:异常)")
    private Integer isUnusual;

    public void setDataIntegrityRate(Double dataIntegrityRate) {
        this.dataIntegrityRate = NumberUtil.round(dataIntegrityRate*100,2).doubleValue();;
    }

    public void setIndexIntegrityRate(Double indexIntegrityRate) {
        this.indexIntegrityRate = NumberUtil.round(indexIntegrityRate*100,2).doubleValue();;
    }
}





