package com.hdkj.fhzg.optimization.response;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;

/**
 * @author rj
 * @date 2026/6/2 14:44
 * @description
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class OperationMetrics {

    private PowerReliability powerReliability;      // 供电可靠性
    private VoltageQuality voltageQuality;          // 电压质量
    private PowerSupplyCapacity powerSupplyCapacity; // 供电能力
    private GridStructure gridStructure;            // 网架结构问题

    // 供电可靠性
    @Data
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public static class PowerReliability {
        private Integer totalScore;                     // 总评分
        private Integer theoreticalReliability;         // 理论可靠性
        private Integer lineConnectionRate;             // 10kV线路联络率
        private Integer lineN1PassRate;                 // 10kV线路N-1通过率
        private Integer mainTransformerNFailCount;      // 主变N-1不通过数量
        private Integer feederNFailCount;               // 馈线N-1不通过数量
    }

    // 电压质量
    @Data
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public static class VoltageQuality {
        private Integer totalScore;                         // 总评分
        private Integer voltageViolationNodeCount;          // 电压越限节点数
        private Integer voltageDeviationExceedIecCount;     // 电压偏差超出IEC标准用户数
    }

    // 供电能力
    @Data
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public static class PowerSupplyCapacity {
        private Integer totalScore;                         // 总评分
        private Integer regionalMaxLoadRate;                // 区域最大负载率
        private Integer regionalAvgLoadRate;                // 区域平均负载率
        private Integer overloadLineCount;                  // 10kV线路重过载条数
        private Integer lineLossComplianceRate;             // 网损达标率
        private Integer lineLossNonComplianceCount;         // 网损不达标线路数
        private Integer powerFactorNonComplianceCount;      // 功率因数不达标线路数
    }

    // 网架结构问题
    @Data
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public static class GridStructure {
        private Integer totalScore;                         // 总评分
        private GridStructureItem standardizedGrid;         // 标准化网架
        private GridStructureItem unreasonableConnection;   // 联络不合理
        private GridStructureItem capacityAbnormal;         // 容量异常
        private GridStructureItem unreasonableStructure;    // 结构不合理
    }

    // 网架结构问题项
    @Data
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public static class GridStructureItem {
        private Integer issueCount;   // 问题项数量
        private Integer score;        // 评分
    }

}

