package com.qmth.teachcloud.report.business.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qmth.teachcloud.common.contant.SystemConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

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

/**
 * <p>
 * 试卷结构表
 * </p>
 *
 * @author wangliang
 * @since 2021-06-01
 */
@ApiModel(value = "TBPaperStruct对象", description = "试卷结构表")
public class TBPaperStruct implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "试卷id")
    @JsonSerialize(using = ToStringSerializer.class)
    @TableId(value = "id")
    private Long id;

    @ApiModelProperty(value = "试卷基础表id")
    @JsonSerialize(using = ToStringSerializer.class)
    @TableField(value = "paper_id")
    private Long paperId;

    @ApiModelProperty(value = "大题名称")
    @TableField(value = "question_name")
    private String questionName;

    @ApiModelProperty(value = "题号类型（客观题、主观题）")
    @TableField(value = "number_type")
    private String numberType;

    @ApiModelProperty(value = "大题号")
    @TableField(value = "big_question_number")
    private String bigQuestionNumber;

    @ApiModelProperty(value = "小题号(每一课程试卷的唯一标识)")
    @TableField(value = "small_question_number")
    private String smallQuestionNumber;

    @ApiModelProperty(value = "题目类型")
    @TableField(value = "question_type")
    private String questionType;

    @ApiModelProperty(value = "满分")
    @TableField(value = "full_score")
    private BigDecimal fullScore;

    @ApiModelProperty(value = "计分规则")
    @TableField(value = "score_rules")
    private String scoreRules;

    @ApiModelProperty(value = "规则说明")
    @TableField(value = "rules_desc")
    private String rulesDesc;

    @ApiModelProperty(value = "知识维度")
    @TableField(value = "knowledge_dimension")
    private String knowledgeDimension;

    @ApiModelProperty(value = "能力维度")
    @TableField(value = "ability_dimension")
    private String abilityDimension;

    @ApiModelProperty(value = "素养维度")
    @TableField(value = "literacy_dimension")
    private String literacyDimension;

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getPaperId() {
        return paperId;
    }

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

    public String getQuestionName() {
        return questionName;
    }

    public void setQuestionName(String questionName) {
        this.questionName = questionName;
    }

    public String getNumberType() {
        return numberType;
    }

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

    public String getBigQuestionNumber() {
        return bigQuestionNumber;
    }

    public void setBigQuestionNumber(String bigQuestionNumber) {
        this.bigQuestionNumber = bigQuestionNumber;
    }

    public String getSmallQuestionNumber() {
        return smallQuestionNumber;
    }

    public void setSmallQuestionNumber(String smallQuestionNumber) {
        this.smallQuestionNumber = smallQuestionNumber;
    }

    public String getQuestionType() {
        return questionType;
    }

    public void setQuestionType(String questionType) {
        this.questionType = questionType;
    }

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

    public void setFullScore(BigDecimal fullScore) {
        this.fullScore = fullScore;
    }

    public String getScoreRules() {
        return scoreRules;
    }

    public void setScoreRules(String scoreRules) {
        this.scoreRules = scoreRules;
    }

    public String getRulesDesc() {
        return rulesDesc;
    }

    public void setRulesDesc(String rulesDesc) {
        this.rulesDesc = rulesDesc;
    }

    public String getKnowledgeDimension() {
        return knowledgeDimension;
    }

    public void setKnowledgeDimension(String knowledgeDimension) {
        this.knowledgeDimension = knowledgeDimension;
    }

    public String getAbilityDimension() {
        return abilityDimension;
    }

    public void setAbilityDimension(String abilityDimension) {
        this.abilityDimension = abilityDimension;
    }

    public String getLiteracyDimension() {
        return literacyDimension;
    }

    public void setLiteracyDimension(String literacyDimension) {
        this.literacyDimension = literacyDimension;
    }
}
