package org.dromara.elevator.domain.vo;

import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

/**
 * 电梯综合统计
 *
 * @author ym
 * @version 1.0.0
 * @date 2024-09-13 16:00
 */
@Data
public class EElevatorComprehensiveStatisticsVo implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    // 数量统计
    /**
     * 电梯总数
     */
    private Integer total;
    /**
     * 正常电梯总数
     */
    private Integer normalTotal;
    /**
     * 故障电梯数
     */
    private Integer faultTotal;
    /**
     * 异常电梯数
     */
    private Integer exceptionFaultTotal;

    /**
     * 故障列表
     */
    private List<FaultInfo> faultList;

    /**
     * 异常故障列表
     */
    private List<FaultInfo> exceptionFaultList;

    /**
     * 维保计划列表
     */
    private List<MaintenancePlanInfo> maintenancePlanList;

    /**
     * 未年检电梯数
     */
    private Integer unInspectAnnuallyTotal;

    /**
     * 年检电梯数
     */
    private Integer inspectAnnuallyTotal;

    /**
     * 维保电梯总数
     */
    private Integer maintenanceTotal;

    // 故障率
    /**
     * 总故障发生率
     */
    private BigDecimal faultTotalRatio;

    /**
     * 总异常发生率
     */
    private BigDecimal exceptionFaultRatio;

    /**
     * 维修率
     */
    private BigDecimal repairRatio;

    /**
     * 维保率
     */
    private BigDecimal  maintenanceRatio;

    /**
     * 工作评价率
     */
    private BigDecimal workEvaluateRatio;

    /**
     * 好评率
     */
    private BigDecimal favorableRatio;

    public EElevatorComprehensiveStatisticsVo() {
        this.favorableRatio = BigDecimal.ZERO;
        this.workEvaluateRatio = BigDecimal.ZERO;
        this.repairRatio = BigDecimal.ZERO;
        this.maintenanceRatio = BigDecimal.ZERO;
        this.exceptionFaultRatio = BigDecimal.ZERO;
        this.faultTotalRatio = BigDecimal.ZERO;
        this.inspectAnnuallyTotal = 0;
        this.unInspectAnnuallyTotal = 0;
        this.maintenanceTotal = 0;
        this.exceptionFaultTotal = 0;
        this.faultTotal = 0;
        this.normalTotal = 0;
        this.total = 0;
        this.faultList = new ArrayList<>();
        this.exceptionFaultList = new ArrayList<>();
        this.maintenancePlanList = new ArrayList<>();
    }

    /**
     * 故障信息
     */
    @Data
    public static class FaultInfo {
        /**
         * 故障编号
         */
        private String faultCode;
        /**
         * 故障名称
         */
        private String faultName;
        /**
         * 故障电梯数
         */
        private Integer faultElevatorTotal;
        /**
         * 故障率
         */
        private BigDecimal faultRatio;

        public FaultInfo() {
            this.faultElevatorTotal = 0;
            this.faultRatio = BigDecimal.ZERO;
        }
    }

    /**
     * 维保计划信息
     */
    @Data
    public static class MaintenancePlanInfo {
        /**
         * 维保类型
         */
        private Integer maintenanceType;
        /**
         * 维保类型名称
         */
        private String maintenanceName;
        /**
         * 维保电梯数
         */
        private Integer maintenanceElevatorTotal;

        public MaintenancePlanInfo() {
            this.maintenanceElevatorTotal = 0;
        }
    }

}
