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

import com.fasterxml.jackson.annotation.JsonInclude;
import com.qmth.teachcloud.common.contant.SystemConstant;
import com.qmth.teachcloud.report.business.entity.TAExamCourse;
import com.qmth.teachcloud.report.business.entity.TBExamCourse;
import io.swagger.annotations.ApiModelProperty;

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

/**
 * @Description: SurveyTeacherExamCourseResult
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2021/6/15
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class SurveyTeacherExamCourseResult implements Serializable {

    @ApiModelProperty(value = "总体平均分")
    private BigDecimal avgScore;

    @ApiModelProperty(value = "总体不及格率")
    private BigDecimal notPassRate;

    @ApiModelProperty(value = "应届平均分")
    private BigDecimal currentAvgScore;

    @ApiModelProperty(value = "应届不及格率")
    private BigDecimal currentNotPassRate;

    public SurveyTeacherExamCourseResult() {

    }

    public SurveyTeacherExamCourseResult(BigDecimal avgScore, BigDecimal notPassRate, BigDecimal currentAvgScore, BigDecimal currentNotPassRate) {
        this.avgScore = avgScore;
        this.notPassRate = notPassRate;
        this.currentAvgScore = currentAvgScore;
        this.currentNotPassRate = currentNotPassRate;
    }

    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 getNotPassRate() {
        if (Objects.nonNull(notPassRate)) {
            return notPassRate.setScale(SystemConstant.FINAL_SCALE, BigDecimal.ROUND_HALF_UP);
        } else {
            return notPassRate;
        }
    }

    public void setNotPassRate(BigDecimal notPassRate) {
        this.notPassRate = notPassRate;
    }

    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 getCurrentNotPassRate() {
        if (Objects.nonNull(currentNotPassRate)) {
            return currentNotPassRate.setScale(SystemConstant.FINAL_SCALE, BigDecimal.ROUND_HALF_UP);
        } else {
            return currentNotPassRate;
        }
    }

    public void setCurrentNotPassRate(BigDecimal currentNotPassRate) {
        this.currentNotPassRate = currentNotPassRate;
    }
}
