package com.gyee.runeconomy.dto.response;

import lombok.Data;

import java.math.BigDecimal;

/**
 * 经济运行首页指标率响应类
 */
@Data
public class EconHomePagePointRateDTO {

    //    curr
    //    ring
    //    with
    /**
     * 故障损失率
     */
    private BigDecimal currGzsll;
    private BigDecimal ringGzslzzl;
    private BigDecimal withGzslzzl;

    /**
     * 检修损失率
     */
    private BigDecimal currJxsll;
    private BigDecimal ringJxslzzl;
    private BigDecimal withJxslzzl;


    /**
     * 限电损失率
     */
    private BigDecimal currXdsll;
    private BigDecimal ringXdslzzl;
    private BigDecimal withXdslzzl;

    /**
     * 受累损失率
     */
    private BigDecimal currSlsll;
    private BigDecimal ringSlslzzl;
    private BigDecimal withSlslzzl;


    /**
     * 性能损失率
     */
    private BigDecimal currXNsll;
    private BigDecimal ringXnslzzl;
    private BigDecimal withXnslzzl;


    /**
     * 复位及时率/综合效率
     */
    private BigDecimal currFwjsl;
    private BigDecimal ringFwjszzl;
    private BigDecimal withFwjszzl;

    /**
     * 状态转换率/离散率
     */
    private BigDecimal currZtzhl;
    private BigDecimal ringZtzhzzl;
    private BigDecimal withZtzhzzl;

    /**
     * 消缺及时率/转换效率
     */
    private BigDecimal currXqjsl;
    private BigDecimal ringXqjszzl;
    private BigDecimal withXqjszzl;

    /**
     * 综合常用电率
     */
    private BigDecimal currZhcydl;
    private BigDecimal ringZhcydzzl;
    private BigDecimal withZhcydzzl;
    /**
     * 功率曲线符合率
     */
    private BigDecimal currGlqxfhl;
    private BigDecimal ringGlqxfhzzl;
    private BigDecimal withGlqxfhzzl;

    /**
     * 设备可利用率
     */
    private BigDecimal currSbklyl;
    private BigDecimal ringSbklyzzl;
    private BigDecimal withSbklyzzl;

    public BigDecimal getCurrGzsll() {
        if (null == currGzsll) {
            return new BigDecimal(0.00);
        }
        currGzsll = compare100(currGzsll);
        return currGzsll;
    }

    public BigDecimal getRingGzslzzl() {
        if (null == ringGzslzzl) {
            return new BigDecimal(0.00);
        }
        ringGzslzzl = compare100(ringGzslzzl);
        return ringGzslzzl;
    }

    public BigDecimal getWithGzslzzl() {
        if (null == withGzslzzl) {
            return new BigDecimal(0.00);
        }
        withGzslzzl = compare100(withGzslzzl);
        return withGzslzzl;
    }

    public BigDecimal getCurrJxsll() {
        if (null == currJxsll) {
            return new BigDecimal(0.00);
        }
        currJxsll = compare100(currJxsll);
        return currJxsll;
    }

    public BigDecimal getRingJxslzzl() {
        if (null == ringJxslzzl) {
            return new BigDecimal(0.00);
        }
        ringJxslzzl = compare100(ringJxslzzl);
        return ringJxslzzl;
    }

    public BigDecimal getWithJxslzzl() {
        if (null == withJxslzzl) {
            return new BigDecimal(0.00);
        }
        withJxslzzl = compare100(withJxslzzl);
        return withJxslzzl;
    }

    public BigDecimal getCurrXdsll() {
        if (null == currXdsll) {
            return new BigDecimal(0.00);
        }
        currXdsll = compare100(currXdsll);
        return currXdsll;
    }

    public BigDecimal getRingXdslzzl() {
        if (null == ringXdslzzl) {
            return new BigDecimal(0.00);
        }
        ringXdslzzl = compare100(ringXdslzzl);
        return ringXdslzzl;
    }

    public BigDecimal getWithXdslzzl() {
        if (null == withXdslzzl) {
            return new BigDecimal(0.00);
        }
        withXdslzzl = compare100(withXdslzzl);
        return withXdslzzl;
    }

    public BigDecimal getCurrSlsll() {
        if (null == currSlsll) {
            return new BigDecimal(0.00);
        }
        currSlsll = compare100(currSlsll);
        return currSlsll;
    }

    public BigDecimal getRingSlslzzl() {
        if (null == ringSlslzzl) {
            return new BigDecimal(0.00);
        }
        ringSlslzzl = compare100(ringSlslzzl);
        return ringSlslzzl;
    }

    public BigDecimal getWithSlslzzl() {
        if (null == withSlslzzl) {
            return new BigDecimal(0.00);
        }
        withSlslzzl = compare100(withSlslzzl);
        return withSlslzzl;
    }

    public BigDecimal getCurrXNsll() {
        if (null == currXNsll) {
            return new BigDecimal(0.00);
        }
        currXNsll = compare100(currXNsll);
        return currXNsll;
    }

    public BigDecimal getRingXnslzzl() {
        if (null == ringXnslzzl) {
            return new BigDecimal(0.00);
        }
        ringXnslzzl = compare100(ringXnslzzl);
        return ringXnslzzl;
    }

    public BigDecimal getWithXnslzzl() {
        if (null == withXnslzzl) {
            return new BigDecimal(0.00);
        }
        withXnslzzl = compare100(withXnslzzl);
        return withXnslzzl;
    }

    public BigDecimal getCurrFwjsl() {
        if (null == currFwjsl) {
            return new BigDecimal(0.00);
        }
        currFwjsl = compare100(currFwjsl);
        return currFwjsl;
    }

    public BigDecimal getRingFwjszzl() {
        if (null == ringFwjszzl) {
            return new BigDecimal(0.00);
        }
        ringFwjszzl = compare100(ringFwjszzl);
        return ringFwjszzl;
    }

    public BigDecimal getWithFwjszzl() {
        if (null == withFwjszzl) {
            return new BigDecimal(0.00);
        }
        withFwjszzl = compare100(withFwjszzl);
        return withFwjszzl;
    }

    public BigDecimal getCurrZtzhl() {
        if (null == currZtzhl) {
            return new BigDecimal(0.00);
        }
        currZtzhl = compare100(currZtzhl);
        return currZtzhl;
    }

    public BigDecimal getRingZtzhzzl() {
        if (null == ringZtzhzzl) {
            return new BigDecimal(0.00);
        }
        ringZtzhzzl = compare100(ringZtzhzzl);
        return ringZtzhzzl;
    }

    public BigDecimal getWithZtzhzzl() {
        if (null == withZtzhzzl) {
            return new BigDecimal(0.00);
        }
        withZtzhzzl = compare100(withZtzhzzl);
        return withZtzhzzl;
    }

    public BigDecimal getCurrXqjsl() {
        if (null == currXqjsl) {
            return new BigDecimal(0.00);
        }
        currXqjsl = compare100(currXqjsl);
        return currXqjsl;
    }

    public BigDecimal getRingXqjszzl() {
        if (null == ringXqjszzl) {
            return new BigDecimal(0.00);
        }
        ringXqjszzl = compare100(ringXqjszzl);
        return ringXqjszzl;
    }

    public BigDecimal getWithXqjszzl() {
        if (null == withXqjszzl) {
            return new BigDecimal(0.00);
        }
        withXqjszzl = compare100(withXqjszzl);
        return withXqjszzl;
    }

    public BigDecimal getCurrZhcydl() {
        if (null == currZhcydl) {
            return new BigDecimal(0.00);
        }
        currZhcydl = compare100(currZhcydl);
        return currZhcydl;
    }

    public BigDecimal getRingZhcydzzl() {
        if (null == ringZhcydzzl) {
            return new BigDecimal(0.00);
        }
        ringZhcydzzl = compare100(ringZhcydzzl);
        return ringZhcydzzl;
    }

    public BigDecimal getWithZhcydzzl() {
        if (null == withZhcydzzl) {
            return new BigDecimal(0.00);
        }
        withZhcydzzl = compare100(withZhcydzzl);
        return withZhcydzzl;
    }

    public BigDecimal getCurrGlqxfhl() {
        if (null == currGlqxfhl) {
            return new BigDecimal(0.00);
        }
        currGlqxfhl = compare100(currGlqxfhl);
        return currGlqxfhl;
    }

    public BigDecimal getRingGlqxfhzzl() {
        if (null == ringGlqxfhzzl) {
            return new BigDecimal(0.00);
        }
        ringGlqxfhzzl = compare100(ringGlqxfhzzl);
        return ringGlqxfhzzl;
    }

    public BigDecimal getWithGlqxfhzzl() {
        if (null == withGlqxfhzzl) {
            return new BigDecimal(0.00);
        }
        withGlqxfhzzl = compare100(withGlqxfhzzl);
        return withGlqxfhzzl;
    }

    public BigDecimal getCurrSbklyl() {
        if (null == currSbklyl) {
            return new BigDecimal(0.00);
        }
        currSbklyl = compare100(currSbklyl);
        return currSbklyl;
    }

    public BigDecimal getRingSbklyzzl() {
        if (null == ringSbklyzzl) {
            return new BigDecimal(0.00);
        }
        ringSbklyzzl = compare100(ringSbklyzzl);
        return ringSbklyzzl;
    }

    public BigDecimal getWithSbklyzzl() {
        if (null == withSbklyzzl) {
            return new BigDecimal(0.00);
        }
        withSbklyzzl = compare100(withSbklyzzl);
        return withSbklyzzl;
    }

    private BigDecimal compare100(BigDecimal a) {
        BigDecimal b = new BigDecimal(100);
        if (b.compareTo(a) == -1) {
            a = new BigDecimal(100);
        }

        if (a.compareTo(BigDecimal.ZERO) == -1) {
            a = new BigDecimal(0);
        }
        return a;

    }
}
