package com.njcn.device.pq.pojo.vo.common;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author wr
 * @description
 * @date 2025/11/26 11:00
 */

@Data
public class DeviceOnlineRate {

    @ApiModelProperty("总终端数量")
    private Integer totalNum;

    @ApiModelProperty("低于90终端数据")
    private Integer belowNum;

    @ApiModelProperty("总终端在线率")
    private BigDecimal totalOnlineRate;

    @ApiModelProperty("统计信息")
    List<CitDetail> citDetailList;

    @Data
    public static class CitDetail {

        @ApiModelProperty("地市")
        private String citName;

        @ApiModelProperty("总终端数量")
        private Integer citTotalNum;

        @ApiModelProperty("低于90终端数据")
        private Integer citBelowNum;

        @ApiModelProperty("总终端在线率")
        private BigDecimal citTotalOnlineRate;

        @ApiModelProperty("统计信息")
        List<?> detailList;
    }


    @Data
    public static class Detail {

        @ApiModelProperty("地市")
        private String cit;

        @ApiModelProperty("供电公司")
        private String company;

        @ApiModelProperty("变电站")
        private String subStation;

        @ApiModelProperty("终端ID")
        private String deviceId;

        @ApiModelProperty("终端名称")
        private String deviceName;

        @ApiModelProperty("终端厂家")
        private String manufacturer;

        @ApiModelProperty("终端IP")
        private String ip;

        @ApiModelProperty("终端运行状态（0：运行；1：检修；2：停运；3：调试；4：退运）")
        private String runFlag;

        @ApiModelProperty("终端通讯状态（0：中断；1：正常）")
        private String comFlag;

        @ApiModelProperty("最新数据时间")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private LocalDateTime timeID;

        @ApiModelProperty("在线率")
        private BigDecimal onlineRate;
    }

    @Data
    public static class LineDetail {

        @ApiModelProperty("地市")
        private String cit;

        @ApiModelProperty("供电公司")
        private String company;

        @ApiModelProperty("变电站")
        private String subStation;

        @ApiModelProperty("终端ID")
        private String deviceId;

        @ApiModelProperty("终端名称")
        private String deviceName;

        @ApiModelProperty("终端厂家")
        private String manufacturer;

        @ApiModelProperty("终端IP")
        private String ip;

        @ApiModelProperty("监测点id")
        private String lineId;

        @ApiModelProperty("监测点名称")
        private String lineName;

        @ApiModelProperty("监测对象")
        private String objName;

        @ApiModelProperty("监测点运行状态")
        private String runFlag;

        @ApiModelProperty("最新数据时间")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private LocalDateTime latestTime;

        @ApiModelProperty("数据完整性")
        private BigDecimal integrity;
    }

}
