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.TAExamCourseCollegeTeacher;
import io.swagger.annotations.ApiModelProperty;

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

/**
 * @Description: TAExamCourseCollegeTeacherResult
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2021/6/16
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class TAExamCourseCollegeTeacherResult extends TAExamCourseCollegeTeacher implements Serializable {

    @ApiModelProperty(value = "应届平均分赋分前")
    private BigDecimal currentAvgScoreBefore;

    @ApiModelProperty(value = "应届平均分赋分后")
    private BigDecimal currentAvgScoreAfter;

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

    public void setCurrentAvgScoreBefore(BigDecimal currentAvgScoreBefore) {
        this.currentAvgScoreBefore = currentAvgScoreBefore;
    }

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

    public void setCurrentAvgScoreAfter(BigDecimal currentAvgScoreAfter) {
        this.currentAvgScoreAfter = currentAvgScoreAfter;
    }
}
