package com.hdkj.lt.core.bizms.modle.po.operationAbnormality;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.hdkj.lt.base.serializer.BigDecimalSerializer;
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;
import java.util.Date;

/**
 * 运行异常转供异常信息
 *
 * @author lihao
 * @since 2025-07-05
 */
@TableName("fhzg_grid_operation_abnormality")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class FhzgGridOperationAbnormality implements Serializable {

    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty(value = "主键ID")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long id;

    private String eventId;

    private Integer reason;

    private String psrType;

    @ApiModelProperty(value = "异常馈线ID")
    @TableField("line_id")
    private String lineId;

    @ApiModelProperty(value = "异常馈线ID")
    @TableField("line_name")
    private String lineName;

    @ApiModelProperty(value = "告警开始时间")
    @TableField("alarm_start_time")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date alarmStartTime;

    @ApiModelProperty(value = "告警结束时间")
    @TableField("alarm_end_time")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date alarmEndTime;

    @ApiModelProperty(value = "告警持续时长(H)")
    @TableField("alarm_sustained_time")
    @JsonSerialize(using = BigDecimalSerializer.StripTrailingZerosSerializer.class)
    private BigDecimal alarmSustainedTime;

    @ApiModelProperty(value = "线路负载情况")
    @TableField("load_condition")
    private String loadCondition;

    @ApiModelProperty(value = "预测最大负载率")
    @TableField("max_load_factor")
    @JsonSerialize(using = BigDecimalSerializer.StripTrailingZerosSerializer.class)
    private BigDecimal maxLoadFactor;

    /**
     * 调优类型 0-重过载 1-电压越限
     */
    private String loadAlarmType;

    /**
     * 线路负荷最低电压
     */
    private String minVol;

    /**
     * 线路负荷最高电压
     */
    private String maxVol;

    @ApiModelProperty(value = "最大负载率时刻")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("max_load_factor_time")
    private Date maxLoadFactorTime;

    @ApiModelProperty(value = "线路额定电流")
    @TableField("rated_current")
    @JsonSerialize(using = BigDecimalSerializer.StripTrailingZerosSerializer.class)
    private BigDecimal ratedCurrent;

    @ApiModelProperty(value = "调优时间")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("optimization_time")
    private Date optimizationTime;

    @ApiModelProperty(value = "创建人")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @TableField("file_id")
    private Long fileId;

    @ApiModelProperty(value = "创建人")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @TableField("creator")
    private Long creator;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("create_time")
    private Date createTime;

    @ApiModelProperty(value = "最后一次修改人")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @TableField("last_editor")
    private Long lastEditor;

    @ApiModelProperty(value = "最后一次修改时间")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("last_time")
    private Date lastTime;

    @ApiModelProperty(value = "触发时间")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("date_time")
    private LocalDateTime dateTime;
}

