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

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.hdkj.lt.base.serializer.BigDecimalSerializer;
import com.hdkj.lt.bf.entity.dto.AlarmIndicatorDTO;
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.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 馈线告警列表 VO（前端展示用，中文化）
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ApiModel(description = "馈线告警列表")
public class AlarmFeederVO implements Serializable {

    private static final long serialVersionUID = 1L;

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

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

    @ApiModelProperty(value = "异常线路")
    private String feederId;

    @ApiModelProperty(value = "异常线路")
    private String feederName;

    @ApiModelProperty(value = "异常指标标签（中文，红色标签展示）")
    private List<String> alarmLabels;

    @ApiModelProperty(value = "异常指标（中文标签+数值拼接）")
    private List<AlarmIndicatorDTO> alarmIndicators;

    @ApiModelProperty(value = "最大负载率(%)")
    @JsonSerialize(using = BigDecimalSerializer.StripTrailingZerosSerializer.class)
    private BigDecimal maxLoadRatePct;

    @ApiModelProperty(value = "告警次数")
    private Integer alarmCount;

    @ApiModelProperty(value = "告警日期")
    private LocalDate alarmDate;

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

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

    @ApiModelProperty(value = "状态（中文）")
    private String statusName;

    @ApiModelProperty(value = "关联指标结果ID")
    private Long indicatorResultId;

    @ApiModelProperty(value = "健康度")
    private String healthScore;


}
