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

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qmth.teachcloud.common.contant.SystemConstant;

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

/**
 * @Description: 有效的作答记录
 * @Author: CaoZixuan
 * @Date: 2021-07-21改
 */
public class ValidAnswerDetailDto {
    @JsonSerialize(using = ToStringSerializer.class)
    private Long answerId;

    @JsonSerialize(using = ToStringSerializer.class)
    private Long examRecordId;
    private String numberType;
    private String mainNumber;
    private String subNumber;
    private BigDecimal score;

    @JsonSerialize(using = ToStringSerializer.class)
    private Long taExamRecordId;

    @JsonSerialize(using = ToStringSerializer.class)
    private Long inspectCollegeId;

    @JsonSerialize(using = ToStringSerializer.class)
    private Long teacherId;
    private int percentGrade;

    @JsonSerialize(using = ToStringSerializer.class)
    private Long paperId;
    private String paperType;
    private int rank;

    public Long getAnswerId() {
        return answerId;
    }

    public void setAnswerId(Long answerId) {
        this.answerId = answerId;
    }

    public Long getExamRecordId() {
        return examRecordId;
    }

    public void setExamRecordId(Long examRecordId) {
        this.examRecordId = examRecordId;
    }

    public String getNumberType() {
        return numberType;
    }

    public void setNumberType(String numberType) {
        this.numberType = numberType;
    }

    public String getMainNumber() {
        return mainNumber;
    }

    public void setMainNumber(String mainNumber) {
        this.mainNumber = mainNumber;
    }

    public String getSubNumber() {
        return subNumber;
    }

    public void setSubNumber(String subNumber) {
        this.subNumber = subNumber;
    }

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

    public void setScore(BigDecimal score) {
        this.score = score;
    }

    public Long getTaExamRecordId() {
        return taExamRecordId;
    }

    public void setTaExamRecordId(Long taExamRecordId) {
        this.taExamRecordId = taExamRecordId;
    }

    public int getPercentGrade() {
        return percentGrade;
    }

    public void setPercentGrade(int percentGrade) {
        this.percentGrade = percentGrade;
    }

    public Long getPaperId() {
        return paperId;
    }

    public void setPaperId(Long paperId) {
        this.paperId = paperId;
    }

    public String getPaperType() {
        return paperType;
    }

    public void setPaperType(String paperType) {
        this.paperType = paperType;
    }

    public int getRank() {
        return rank;
    }

    public void setRank(int rank) {
        this.rank = rank;
    }

    public Long getInspectCollegeId() {
        return inspectCollegeId;
    }

    public void setInspectCollegeId(Long inspectCollegeId) {
        this.inspectCollegeId = inspectCollegeId;
    }

    public Long getTeacherId() {
        return teacherId;
    }

    public void setTeacherId(Long teacherId) {
        this.teacherId = teacherId;
    }
}
