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

import cn.hutool.core.util.NumberUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

/**
 * 主网运行指标统计返回实体类（用于主网运行指标统计业务）
 * @Title ROperatingIndexCommonVO
 * @Package com.njcn.device.pms.pojo.vo
 * @Author jianghaifei
 * @Date 2022-11-09 20:03
 * @Version V1.0
 */

@Data
public class ROperatingIndexCommonVO {
    /**
     * 单位ID
     */
    @ApiModelProperty(name = "orgNo", value = "单位ID")
    private String orgNo;

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

    private Integer sort;
    /**
     * 时间
     */
    @ApiModelProperty(name = "dataDate", value = "时间")
    private Date dataDate;
    /**
     * 在运监测点数
     */
    @ApiModelProperty(name = " measurementRunPoints", value = "在运监测点数(监测点数)")
    private Integer measurementRunPoints;
    /**
     * 在线监测点数
     */
    @ApiModelProperty(name = " transitMeasurementPoints", value = "在线监测点数")
    private Integer transitMeasurementPoints;

    @ApiModelProperty(name = " transitMeasurementRate", value = "在线监测率")
    private Double transitMeasurementRate;

    @ApiModelProperty(name = "onlineMeasurementPoints", value = "监测终端数")
    private Integer onlineMeasurementPoints;
    /**
     * 在线终端数
     */
    @ApiModelProperty(name = " onlineMeasurementCount", value = "在线终端数")
    private Integer onlineMeasurementCount;
    /**
     * 应设点数
     */
    @ApiModelProperty(name = " shouldCount", value = "应设点数")
    private Integer shouldCount;

    /**
     * 数据完整率
     */
    @ApiModelProperty(name = "dataIntegrityRate", value = "数据完整率")
    private Double dataIntegrityRate;
    /**
     * 数据准确率
     */
    @ApiModelProperty(name = "dataRightRate", value = "数据准确率")
    private Double dataRightRate;

    /**
     * 应设点覆盖率
     */
    @ApiModelProperty(name = "shouldPointCoverage", value = "应设点覆盖率")
    private Double shouldPointCoverage;
    /**
     * 指标完整率
     */
    @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 setDataRightRate(Double dataRightRate) {
        this.dataRightRate = NumberUtil.round(dataRightRate*100,2).doubleValue();;
    }

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