package com.qmth.teachcloud.report.business.bean.result;

import com.qmth.teachcloud.common.contant.SystemConstant;

import java.math.BigDecimal;
import java.util.Objects;

/**
 * @Description: 试算结果
 * @Author: CaoZixuan
 * @Date: 2021-06-16
 */
public class TrialCalculationResult {
    private int totalCount;
    private int currentCount;
    // 赋分前-总体
    private BigDecimal avgScore;
    private BigDecimal failRate;
    private int failCount;
    // 赋分前-应届
    private BigDecimal currentAvgScore;
    private BigDecimal currentFailRate;
    private int currentFailCount;
    // 赋分后-总体
    private BigDecimal avgScoreAssign;
    private BigDecimal failRateAssign;
    private int failCountAssign;
    // 赋分后-应届
    private BigDecimal currentAvgScoreAssign;
    private BigDecimal currentFailRateAssign;
    private int currentFailCountAssign;

    public int getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(int totalCount) {
        this.totalCount = totalCount;
    }

    public int getCurrentCount() {
        return currentCount;
    }

    public void setCurrentCount(int currentCount) {
        this.currentCount = currentCount;
    }

    public BigDecimal getAvgScore() {
        if (Objects.nonNull(avgScore)) {
            return avgScore.setScale(SystemConstant.FINAL_SCALE, BigDecimal.ROUND_HALF_UP);
        } else {
            return avgScore;
        }
    }

    public void setAvgScore(BigDecimal avgScore) {
        this.avgScore = avgScore;
    }

    public BigDecimal getFailRate() {
        if (Objects.nonNull(failRate)) {
            return failRate.setScale(SystemConstant.CALCULATE_SCALE, BigDecimal.ROUND_HALF_UP);
        } else {
            return failRate;
        }
    }

    public void setFailRate(BigDecimal failRate) {
        this.failRate = failRate;
    }

    public int getFailCount() {
        return failCount;
    }

    public void setFailCount(int failCount) {
        this.failCount = failCount;
    }

    public BigDecimal getCurrentAvgScore() {
        if (Objects.nonNull(currentAvgScore)) {
            return currentAvgScore.setScale(SystemConstant.FINAL_SCALE, BigDecimal.ROUND_HALF_UP);
        } else {
            return currentAvgScore;
        }
    }

    public void setCurrentAvgScore(BigDecimal currentAvgScore) {
        this.currentAvgScore = currentAvgScore;
    }

    public BigDecimal getCurrentFailRate() {
        if (Objects.nonNull(currentFailRate)) {
            return currentFailRate.setScale(SystemConstant.CALCULATE_SCALE, BigDecimal.ROUND_HALF_UP);
        } else {
            return currentFailRate;
        }
    }

    public void setCurrentFailRate(BigDecimal currentFailRate) {
        this.currentFailRate = currentFailRate;
    }

    public int getCurrentFailCount() {
        return currentFailCount;
    }

    public void setCurrentFailCount(int currentFailCount) {
        this.currentFailCount = currentFailCount;
    }

    public BigDecimal getAvgScoreAssign() {
        if (Objects.nonNull(avgScoreAssign)) {
            return avgScoreAssign.setScale(SystemConstant.FINAL_SCALE, BigDecimal.ROUND_HALF_UP);
        } else {
            return avgScoreAssign;
        }
    }

    public void setAvgScoreAssign(BigDecimal avgScoreAssign) {
        this.avgScoreAssign = avgScoreAssign;
    }

    public BigDecimal getFailRateAssign() {
        if (Objects.nonNull(failRateAssign)) {
            return failRateAssign.setScale(SystemConstant.CALCULATE_SCALE, BigDecimal.ROUND_HALF_UP);
        } else {
            return failRateAssign;
        }
    }

    public void setFailRateAssign(BigDecimal failRateAssign) {
        this.failRateAssign = failRateAssign;
    }

    public int getFailCountAssign() {
        return failCountAssign;
    }

    public void setFailCountAssign(int failCountAssign) {
        this.failCountAssign = failCountAssign;
    }

    public BigDecimal getCurrentAvgScoreAssign() {
        if (Objects.nonNull(currentAvgScoreAssign)) {
            return currentAvgScoreAssign.setScale(SystemConstant.FINAL_SCALE, BigDecimal.ROUND_HALF_UP);
        } else {
            return currentAvgScoreAssign;
        }
    }

    public void setCurrentAvgScoreAssign(BigDecimal currentAvgScoreAssign) {
        this.currentAvgScoreAssign = currentAvgScoreAssign;
    }

    public BigDecimal getCurrentFailRateAssign() {
        if (Objects.nonNull(currentFailRateAssign)) {
            return currentFailRateAssign.setScale(SystemConstant.CALCULATE_SCALE, BigDecimal.ROUND_HALF_UP);
        } else {
            return currentFailRateAssign;
        }
    }

    public void setCurrentFailRateAssign(BigDecimal currentFailRateAssign) {
        this.currentFailRateAssign = currentFailRateAssign;
    }

    public int getCurrentFailCountAssign() {
        return currentFailCountAssign;
    }

    public void setCurrentFailCountAssign(int currentFailCountAssign) {
        this.currentFailCountAssign = currentFailCountAssign;
    }
}
