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

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

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

    @ApiModelProperty(value = "全体平均分-赋分前")
    private BigDecimal avgScoreBefore;

    @ApiModelProperty(value = "全体不及格率-赋分前")
    private BigDecimal notPassRateBefore;

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

    @ApiModelProperty(value = "应届不及格率-赋分前")
    private BigDecimal currentNotPassRateBefore;

    @ApiModelProperty(value = "全体平均分-赋分后")
    private BigDecimal avgScoreAfter;

    @ApiModelProperty(value = "全体不及格率-赋分后")
    private BigDecimal notPassRateAfter;

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

    @ApiModelProperty(value = "应届不及格率-赋分后")
    private BigDecimal currentNotPassRateAfter;

    @ApiModelProperty(value = "不通过人数(赋分前)")
    private Integer notPassCountBefore;

    @ApiModelProperty(value = "应届不通过人数(赋分前)")
    private Integer currentNotPassCountBefore;

    @ApiModelProperty(value = "不通过人数(赋分后)")
    private Integer notPassCountAfter;

    @ApiModelProperty(value = "应届不通过人数(赋分后)")
    private Integer currentNotPassCountAfter;

    @ApiModelProperty(value = "发布状态（UN_COMPUTE：未计算、UN_PUBLISH：未发布、PUBLISH：已发布）")
    private PublishStatusEnum status;

    @ApiModelProperty(value = "发布状态（UN_COMPUTE：未计算、UN_PUBLISH：未发布、PUBLISH：已发布）")
    private String publishStatus;

    public Integer getNotPassCountBefore() {
        return notPassCountBefore;
    }

    public void setNotPassCountBefore(Integer notPassCountBefore) {
        this.notPassCountBefore = notPassCountBefore;
    }

    public Integer getCurrentNotPassCountBefore() {
        return currentNotPassCountBefore;
    }

    public void setCurrentNotPassCountBefore(Integer currentNotPassCountBefore) {
        this.currentNotPassCountBefore = currentNotPassCountBefore;
    }

    public Integer getNotPassCountAfter() {
        return notPassCountAfter;
    }

    public void setNotPassCountAfter(Integer notPassCountAfter) {
        this.notPassCountAfter = notPassCountAfter;
    }

    public Integer getCurrentNotPassCountAfter() {
        return currentNotPassCountAfter;
    }

    public void setCurrentNotPassCountAfter(Integer currentNotPassCountAfter) {
        this.currentNotPassCountAfter = currentNotPassCountAfter;
    }

    public PublishStatusEnum getStatus() {
        return status;
    }

    public void setStatus(PublishStatusEnum status) {
        this.status = status;
    }

    public String getPublishStatus() {
        if (Objects.nonNull(status)) {
            return status.getTitle();
        } else {
            return publishStatus;
        }
    }

    public void setPublishStatus(String publishStatus) {
        this.publishStatus = publishStatus;
    }

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

    public void setAvgScoreBefore(BigDecimal avgScoreBefore) {
        this.avgScoreBefore = avgScoreBefore;
    }

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

    public void setNotPassRateBefore(BigDecimal notPassRateBefore) {
        this.notPassRateBefore = notPassRateBefore;
    }

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

    public void setCurrentNotPassRateBefore(BigDecimal currentNotPassRateBefore) {
        this.currentNotPassRateBefore = currentNotPassRateBefore;
    }

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

    public void setAvgScoreAfter(BigDecimal avgScoreAfter) {
        this.avgScoreAfter = avgScoreAfter;
    }

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

    public void setNotPassRateAfter(BigDecimal notPassRateAfter) {
        this.notPassRateAfter = notPassRateAfter;
    }

    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;
    }

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

    public void setCurrentNotPassRateAfter(BigDecimal currentNotPassRateAfter) {
        this.currentNotPassRateAfter = currentNotPassRateAfter;
    }
}
