package com.qmth.teachcloud.report.business.bean.result;

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

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

/**
 * @Description: 维度bean
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2020/12/7
 */
public class DimensionResult implements Serializable {

    @ApiModelProperty(value = "简介")
    private List<String> define = Arrays.asList("测试");

    @ApiModelProperty(value = "我的分数")
    private BigDecimal myScore;

    @ApiModelProperty(value = "熟练度")
    private BigDecimal masteryRate;

    @ApiModelProperty(value = "知识维度总分")
    private BigDecimal dioFullScore;

    @ApiModelProperty(value = "维度详情")
    private List<DimensionDetailResult> subDios;

    @ApiModelProperty(value = "熟练度等级")
    private List<DimensionMasterysResult> masterys;

    public List<String> getDefine() {
        return define;
    }

    public void setDefine(List<String> define) {
        this.define = define;
    }

    public BigDecimal getMyScore() {
        if (Objects.nonNull(myScore)) {
            return myScore.setScale(SystemConstant.FINAL_SCALE, BigDecimal.ROUND_HALF_UP);
        } else {
            return new BigDecimal(0);
        }
    }

    public void setMyScore(BigDecimal myScore) {
        this.myScore = myScore;
    }

    public BigDecimal getMasteryRate() {
        if (Objects.nonNull(masteryRate)) {
            return masteryRate.setScale(SystemConstant.FINAL_SCALE, BigDecimal.ROUND_HALF_UP);
        } else {
            return new BigDecimal(0);
        }
    }

    public void setMasteryRate(BigDecimal masteryRate) {
        this.masteryRate = masteryRate;
    }

    public BigDecimal getDioFullScore() {
        if (Objects.nonNull(dioFullScore)) {
            return dioFullScore.setScale(SystemConstant.FINAL_SCALE, BigDecimal.ROUND_HALF_UP);
        } else {
            return new BigDecimal(0);
        }
    }

    public void setDioFullScore(BigDecimal dioFullScore) {
        this.dioFullScore = dioFullScore;
    }

    public List<DimensionDetailResult> getSubDios() {
        return subDios;
    }

    public void setSubDios(List<DimensionDetailResult> subDios) {
        this.subDios = subDios;
    }

    public List<DimensionMasterysResult> getMasterys() {
        return masterys;
    }

    public void setMasterys(List<DimensionMasterysResult> masterys) {
        this.masterys = masterys;
    }
}
