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

import com.fasterxml.jackson.annotation.JsonFormat;
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.time.LocalDateTime;

/**
 * 运行异常信息详情 VO
 * <p>
 * 重过载和电压越限共用，不适用字段留 null。
 *
 * @author lsl
 * @since 2026-07-23
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ApiModel(description = "运行异常信息详情")
public class SeAlarmDetailVO implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "告警事件ID")
    private Long alarmEventId;

    @ApiModelProperty(value = "告警类型: current_heavy/current_overload/voltage_over/voltage_under")
    private String alarmType;

    @ApiModelProperty(value = "告警类别: overload=重过载, voltage=电压越限")
    private String alarmCategory;

    @ApiModelProperty(value = "所属区县")
    private String countyName;

    @ApiModelProperty(value = "线路名称")
    private String feederName;

    @ApiModelProperty(value = "告警开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime alarmStartTime;

    @ApiModelProperty(value = "告警结束时间(最后断面时间)")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime alarmEndTime;

    // === 重过载专用 ===

    @ApiModelProperty(value = "最大负载率(%) — 重过载用")
    private BigDecimal maxLoadRate;

    // === 电压越限专用 ===

    @ApiModelProperty(value = "异常指标: 线路电压越下限/线路电压越上限/台区电压越下限/台区电压越上限")
    private String abnormalIndicator;

    @ApiModelProperty(value = "线路最高电压(kV)")
    private BigDecimal maxVoltage;

    @ApiModelProperty(value = "线路最低电压(kV)")
    private BigDecimal minVoltage;

    @ApiModelProperty(value = "越上限台区数(与线路同时段告警满1小时)")
    private Integer overUpperMvtransCount;

    @ApiModelProperty(value = "越下限台区数(与线路同时段告警满1小时)")
    private Integer overLowerMvtransCount;

    @ApiModelProperty(value = "重构方案状态:0=未触发 1=生成中 2=有方案 3=无方案 -1=失败")
    private Integer reconStatus;
}