package com.njcn.event.pojo.vo;

import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;

import java.io.Serializable;
import java.util.Collections;
import java.util.List;

/**
 * 暂降区域统计信息
 *
 * @author : zhaojun
 * @version : 1.0.0
 * @date : 2022年06月24日 11:02
 */
@Data
@Builder
public class AreaStatisticalVO implements Serializable {
    private static final long serialVersionUID = -1761181131122017671L;
    
    
    @ApiModelProperty(name = "areaStatistics", value = "区域统计")
    private AreaStatisticsVO areaStatistics;
    
    @ApiModelProperty(name = "voltageStatistics", value = "电压统计")
    private VoltageStatisticsVO voltageStatistics;
    
    @ApiModelProperty(name = "monthlyStatistics", value = "月统计")
    private MonthlyStatisticsVO monthlyStatistics;
    
    public static AreaStatisticalVO empty() {
        return buildVO(AreaStatisticsVO.empty(), VoltageStatisticsVO.empty(), MonthlyStatisticsVO.empty());
    }
    
    public static AreaStatisticalVO buildVO(AreaStatisticsVO areaStatistics, VoltageStatisticsVO voltageStatistics,
                                            MonthlyStatisticsVO monthlyStatistics) {
        return AreaStatisticalVO.builder()
                .areaStatistics(areaStatistics)
                .voltageStatistics(voltageStatistics)
                .monthlyStatistics(monthlyStatistics)
                .build();
    }
    
    /**
     * 区域统计
     *
     * @author : zhaojun
     * @version : 1.0.0
     * @date : 2022年07月08日 8:56
     */
    @Data
    @Builder
    public static class AreaStatisticsVO implements Serializable {
        private static final long serialVersionUID = 5966376367805740029L;
        
        @ApiModelProperty(name = "areaCalculation", value = "图表数据")
        private List<AreaCalculationVO> areaCalculation;
        
        @ApiModelProperty(name = "frequencySum", value = "总暂降次数")
        private Long frequencySum;
        
        @ApiModelProperty(name = "monitoringPointSum", value = "总监测点数")
        private Integer monitoringPointSum;
        
        public static AreaStatisticsVO empty() {
            return buildVO(0L, 0, Collections.emptyList());
        }
        
        public static AreaStatisticsVO buildVO(Long frequencySum, Integer monitoringPointSum,
                                               List<AreaCalculationVO> areaCalculation) {
            return AreaStatisticsVO.builder()
                    .frequencySum(frequencySum)
                    .monitoringPointSum(monitoringPointSum)
                    .areaCalculation(areaCalculation)
                    .build();
        }
        
    }
    
    /**
     * 电压等级
     *
     * @author : zhaojun
     * @version : 1.0.0
     * @date : 2022年07月08日 8:56
     */
    @Data
    @Builder
    public static class VoltageStatisticsVO implements Serializable {
        private static final long serialVersionUID = -1529419462716002278L;
        
        @ApiModelProperty(name = "voltageLevelCalculation", value = "图表数据")
        private List<VoltageLevelCalculationVO> voltageLevelCalculation;
        
        @ApiModelProperty(name = "frequencySum", value = "总暂降次数")
        private Long frequencySum;
        
        @ApiModelProperty(name = "monitoringPointSum", value = "总监测点数")
        private Integer monitoringPointSum;
        
        public static VoltageStatisticsVO empty() {
            return buildVO(0L, 0, Collections.emptyList());
        }
        
        public static VoltageStatisticsVO buildVO(Long frequencySum, Integer monitoringPointSum,
                                                  List<VoltageLevelCalculationVO> voltageLevelCalculation) {
            return VoltageStatisticsVO.builder()
                    .frequencySum(frequencySum)
                    .monitoringPointSum(monitoringPointSum)
                    .voltageLevelCalculation(voltageLevelCalculation)
                    .build();
        }
    }
    
    /**
     * 月统计
     *
     * @author : zhaojun
     * @version : 1.0.0
     * @date : 2022年07月08日 8:56
     */
    @Data
    @Builder
    public static class MonthlyStatisticsVO implements Serializable {
        private static final long serialVersionUID = -1373543779591652398L;
        
        @ApiModelProperty(name = "monthCalculation", value = "图表数据")
        private List<MonthCalculationVO> monthCalculation;
        
        @ApiModelProperty(name = "frequencySum", value = "总暂降次数")
        private Long frequencySum;
        
        public static MonthlyStatisticsVO empty() {
            return buildVO(0L, Collections.emptyList());
        }
        
        public static MonthlyStatisticsVO buildVO(Long frequencySum, List<MonthCalculationVO> monthCalculation) {
            return MonthlyStatisticsVO.builder()
                    .frequencySum(frequencySum)
                    .monthCalculation(monthCalculation)
                    .build();
        }
        
    }
}
