package com.qmth.teachcloud.report.business.bean.dto.excel;

import com.qmth.teachcloud.common.annotation.ExcelProperty;
import com.qmth.teachcloud.common.contant.SystemConstant;
import io.swagger.annotations.ApiModelProperty;

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

/**
 * @Description: TAExamCourseDto
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2021/6/17
 */
public class TAExamCourseDto implements Serializable {

    @ExcelProperty(name = "课程(代码)", width = 40, index = 1)
    private String courseNameCode;

    @ExcelProperty(name = "开课学院", width = 30, index = 2)
    private String teachCollegeName;

    @ExcelProperty(name = "考查学院", width = 30, index = 3)
    private Integer inspectCollegeCount;

    @ExcelProperty(name = "有效人数", width = 30, index = 4)
    private Integer realityCount;

    @ExcelProperty(name = "应届占比(人数)", width = 50, index = 5)
    private String currentRealityRate;

    @ExcelProperty(name = "非应届占比(人数)", width = 50, index = 6)
    private String pastRealityRate;

    @ExcelProperty(name = "总体平均分", width = 30, index = 7)
    private BigDecimal avgScore;

    @ExcelProperty(name = "不及格率(人数)", width = 40, index = 8)
    private String notPassRate;

    @ExcelProperty(name = "缺考", width = 30, index = 9)
    private Integer absentCount;

    @ExcelProperty(name = "应届平均分", width = 30, index = 10)
    private BigDecimal paperCurrentAvgScore;

    @ExcelProperty(name = "应届不及格率(人数)", width = 50, index = 11)
    private String currentNotPassRate;

    @ApiModelProperty(value = "科目编码")
    private String courseCode;

    @ApiModelProperty(value = "科目名称")
    private String courseName;

    @ApiModelProperty(value = "应届实际考试人数")
    private Integer currentRealityCount;

    @ApiModelProperty(value = "不通过人数")
    private Integer notPassCount;

    @ApiModelProperty(value = "应届不通过人数")
    private Integer currentNotPassCount;

    @ApiModelProperty(value = "往届实际考试人数")
    private Integer pastRealityCount;

    public Integer getPastRealityCount() {
        return pastRealityCount;
    }

    public void setPastRealityCount(Integer pastRealityCount) {
        this.pastRealityCount = pastRealityCount;
    }

    public Integer getNotPassCount() {
        return notPassCount;
    }

    public void setNotPassCount(Integer notPassCount) {
        this.notPassCount = notPassCount;
    }

    public Integer getCurrentNotPassCount() {
        return currentNotPassCount;
    }

    public void setCurrentNotPassCount(Integer currentNotPassCount) {
        this.currentNotPassCount = currentNotPassCount;
    }

    public Integer getCurrentRealityCount() {
        return currentRealityCount;
    }

    public void setCurrentRealityCount(Integer currentRealityCount) {
        this.currentRealityCount = currentRealityCount;
    }

    public String getCourseCode() {
        return courseCode;
    }

    public void setCourseCode(String courseCode) {
        this.courseCode = courseCode;
    }

    public String getCourseName() {
        return courseName;
    }

    public void setCourseName(String courseName) {
        this.courseName = courseName;
    }

    public String getCourseNameCode() {
        if (Objects.nonNull(courseCode) && Objects.nonNull(courseName)) {
            return courseName + "(" + courseCode + ")";
        } else {
            return courseNameCode;
        }
    }

    public void setCourseNameCode(String courseNameCode) {
        this.courseNameCode = courseNameCode;
    }

    public String getTeachCollegeName() {
        return teachCollegeName;
    }

    public void setTeachCollegeName(String teachCollegeName) {
        this.teachCollegeName = teachCollegeName;
    }

    public Integer getInspectCollegeCount() {
        return inspectCollegeCount;
    }

    public void setInspectCollegeCount(Integer inspectCollegeCount) {
        this.inspectCollegeCount = inspectCollegeCount;
    }

    public Integer getRealityCount() {
        return realityCount;
    }

    public void setRealityCount(Integer realityCount) {
        this.realityCount = realityCount;
    }

    public String getCurrentRealityRate() {
        if (Objects.nonNull(currentRealityRate)) {
            return new BigDecimal(currentRealityRate).setScale(SystemConstant.FINAL_SCALE, BigDecimal.ROUND_HALF_UP) + "(" + currentRealityCount + ")";
        } else {
            return currentRealityRate;
        }
    }

    public void setCurrentRealityRate(String currentRealityRate) {
        this.currentRealityRate = currentRealityRate;
    }

    public String getPastRealityRate() {
        if (Objects.nonNull(pastRealityRate)) {
            return new BigDecimal(pastRealityRate).setScale(SystemConstant.FINAL_SCALE, BigDecimal.ROUND_HALF_UP) + "(" + pastRealityCount + ")";
        } else {
            return pastRealityRate;
        }
    }

    public void setPastRealityRate(String pastRealityRate) {
        this.pastRealityRate = pastRealityRate;
    }

    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 String getNotPassRate() {
        return notPassRate + "(" + notPassCount + ")";
    }

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

    public Integer getAbsentCount() {
        return absentCount;
    }

    public void setAbsentCount(Integer absentCount) {
        this.absentCount = absentCount;
    }

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

    public void setPaperCurrentAvgScore(BigDecimal paperCurrentAvgScore) {
        this.paperCurrentAvgScore = paperCurrentAvgScore;
    }

    public String getCurrentNotPassRate() {
        return currentNotPassRate + "(" + currentNotPassCount + ")";
    }

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