package com.hdkj.fhzg.optimization.response;

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

/**
 * @author rj
 * @date 2026/6/2 14:47
 * @description
 */
@Data
@Accessors(chain = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class StationGridMetrics {
    private OperationStatusAssessment operationStatusAssessment; // 运行状态评估
    private StandardizedGrid standardizedGrid;                   // 标准化网架
    private UnreasonableConnection unreasonableConnection;       // 联络不合理
    private CapacityAbnormal capacityAbnormal;                   // 容量异常
    private UnreasonableStructure unreasonableStructure;         // 结构不合理


    // 运行状态评估
    @Data
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public static class OperationStatusAssessment {
        private Integer totalScore;                       // 总评分
        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 StandardizedGrid {
        private Integer totalScore;                       // 总评分
        private Integer connectionStandardizationRate;    // 10kV接线标准化率
        private Integer mainSectionStandardizationRate;   // 主干线截面标准化率
        private Integer excessivePowerSupplyRadiusCount;  // 供电半径过长
        private Integer unreasonableSegmentCount;          // 分段数不合理线路数
        private Integer distributionAutomationInsufficientCount; // 配电自动化有效覆盖不足
    }

    // 联络不合理
    @Data
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public static class UnreasonableConnection {
        private Integer totalScore;                       // 总评分
        private Integer lineNoConnectionRate;              // 线路无联络
        private Integer noInterstationConnectionCount;     // 站间无联络线路数
        private Integer unreasonableConnectionPointCount;  // 联络点设置不合理
        private Integer feederSameBusConnectionCount;      // 馈线同母线联络
        private Integer excessiveConnectionPointCount;     // 联络点过多
    }

    // 容量异常
    @Data
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public static class CapacityAbnormal {
        private Integer totalScore;                       // 总评
        private Integer lineExceedStandardCapacityRate;    // 线路装接容量超标准
        private Integer loadGroupCapacityAbnormalRate;     // 负荷组容量异常
    }

    // 结构不合理
    @Data
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public static class UnreasonableStructure {
        private Integer totalScore;                       // 总评分
        private Integer lineSingleRadiationRate;           // 线路单辐射
        private Integer feederMainLampHangingCount;        // 馈线主干"挂灯笼"
        private Integer feederLargeBranchCount;            // 馈线存在大分支
        private Integer mainChokePointCount;               // 主干卡脖子
        private Integer overlengthFeederCount;             // 超长馈线
    }
}


