package com.hdkj.lt.bf.entity.vo;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.hdkj.lt.base.serializer.BigDecimalSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * 电压质量指标 VO
 * <p>
 * 今日：从 fhzg_se_alarm_event 查（馈线+台区，不分级别），展示当前越限数
 * 历史（当月/全年）：从 ads_mrt_voltage_over_limit_daily_result 查（8维度×4级别=16字段）
 *
 * @author lsl
 * @since 2026-07-23
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ApiModel(description = "电压质量指标")
public class SeVoltageDashboardVO implements Serializable {

    private static final long serialVersionUID = 1L;

    // ============================================================
    // 今日（查 alarm_event，不分一般/严重）
    // ============================================================

    @ApiModelProperty(value = "今日越上限台区数")
    private Integer todayOverUpperAreaCount;

    @ApiModelProperty(value = "今日越下限台区数")
    private Integer todayOverLowerAreaCount;

    @ApiModelProperty(value = "今日越上限馈线数")
    private Integer todayOverUpperFeederCount;

    @ApiModelProperty(value = "今日越下限馈线数")
    private Integer todayOverLowerFeederCount;

    // ============================================================
    // 历史（当月/全年，查中台T-2 ads_mrt_voltage_over_limit_daily_result）
    // 8维度 × 4级别
    // ============================================================
    // 维度: 台区(tg) / 用户(cust) / 馈线(feeder) / 母线(generatrix)
    // 级别: 越上限严重(overUpperSevere) / 越上限一般(overUpperMild)
    //       越下限严重(overLowerSevere) / 越下限一般(overLowerMild)

    // --- 越上限-严重 ---
    @ApiModelProperty(value = "越上限台区数-严重")
    private Integer overUpperSevereTgCount;
    @ApiModelProperty(value = "越上限户数-严重")
    private Integer overUpperSevereCustCount;
    @ApiModelProperty(value = "越上限馈线数-严重")
    private Integer overUpperSevereFeederCount;
    @ApiModelProperty(value = "越上限母线数-严重")
    private Integer overUpperSevereGeneratrixCount;

    // --- 越上限-一般 ---
    @ApiModelProperty(value = "越上限台区数-一般")
    private Integer overUpperMildTgCount;
    @ApiModelProperty(value = "越上限户数-一般")
    private Integer overUpperMildCustCount;
    @ApiModelProperty(value = "越上限馈线数-一般")
    private Integer overUpperMildFeederCount;
    @ApiModelProperty(value = "越上限母线数-一般")
    private Integer overUpperMildGeneratrixCount;

    // --- 越下限-严重 ---
    @ApiModelProperty(value = "越下限台区数-严重")
    private Integer overLowerSevereTgCount;
    @ApiModelProperty(value = "越下限户数-严重")
    private Integer overLowerSevereCustCount;
    @ApiModelProperty(value = "越下限馈线数-严重")
    private Integer overLowerSevereFeederCount;
    @ApiModelProperty(value = "越下限母线数-严重")
    private Integer overLowerSevereGeneratrixCount;

    // --- 越下限-一般 ---
    @ApiModelProperty(value = "越下限台区数-一般")
    private Integer overLowerMildTgCount;
    @ApiModelProperty(value = "越下限户数-一般")
    private Integer overLowerMildCustCount;
    @ApiModelProperty(value = "越下限馈线数-一般")
    private Integer overLowerMildFeederCount;
    @ApiModelProperty(value = "越下限母线数-一般")
    private Integer overLowerMildGeneratrixCount;

    @ApiModelProperty(value = "越限总时长(小时)")
    @JsonSerialize(using = BigDecimalSerializer.StripTrailingZerosSerializer.class)
    private BigDecimal totalOverLimitHours;
}