package com.qmth.distributed.print.business.bean.dto.report;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModelProperty;
import org.jetbrains.annotations.NotNull;

import java.io.Serializable;

/**
 * @Description: 课程知识点dto
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2024/2/26
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class DimensionDto implements Serializable, Comparable<DimensionDto> {

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "课程目标id")
    private Long targetId;

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "知识点id")
    private Long dimensionId;

    @ApiModelProperty(value = "知识点编码")
    private String dimensionCode;

    @ApiModelProperty(value = "知识点名称")
    private String dimensionName;

    @ApiModelProperty(value = "知识点分数")
    private Double dimensionScore;

    @ApiModelProperty(value = "换算分数")
    private Double dimensionMatrixScore;

    @ApiModelProperty(value = "换算平均分")
    private Double dimensionMatrixAvgScore;

    public DimensionDto() {

    }

    public DimensionDto(DimensionDto dimensionDto) {
        this.targetId = dimensionDto.getTargetId();
        this.dimensionId = dimensionDto.getDimensionId();
        this.dimensionCode = dimensionDto.getDimensionCode();
        this.dimensionName = dimensionDto.getDimensionName();
        this.dimensionScore = dimensionDto.getDimensionScore();
        this.dimensionMatrixScore = dimensionDto.getDimensionMatrixScore();
        this.dimensionMatrixAvgScore = dimensionDto.getDimensionMatrixAvgScore();
    }

    public DimensionDto(Long targetId, DimensionDto dimensionDto, Double dimensionScore) {
        this.targetId = targetId;
        this.dimensionId = dimensionDto.getDimensionId();
        this.dimensionCode = dimensionDto.getDimensionCode();
        this.dimensionName = dimensionDto.getDimensionName();
        this.dimensionScore = dimensionScore;
    }

    public DimensionDto(Long targetId, DimensionDto dimensionDto, Double dimensionScore, Double dimensionMatrixScore) {
        this.targetId = targetId;
        this.dimensionId = dimensionDto.getDimensionId();
        this.dimensionCode = dimensionDto.getDimensionCode();
        this.dimensionName = dimensionDto.getDimensionName();
        this.dimensionScore = dimensionScore;
        this.dimensionMatrixScore = dimensionMatrixScore;
    }
    public Double getDimensionMatrixScore() {
        return dimensionMatrixScore;
    }

    public void setDimensionMatrixScore(Double dimensionMatrixScore) {
        this.dimensionMatrixScore = dimensionMatrixScore;
    }

    public Double getDimensionMatrixAvgScore() {
        return dimensionMatrixAvgScore;
    }

    public void setDimensionMatrixAvgScore(Double dimensionMatrixAvgScore) {
        this.dimensionMatrixAvgScore = dimensionMatrixAvgScore;
    }

    public Long getTargetId() {
        return targetId;
    }

    public void setTargetId(Long targetId) {
        this.targetId = targetId;
    }

    public Long getDimensionId() {
        return dimensionId;
    }

    public void setDimensionId(Long dimensionId) {
        this.dimensionId = dimensionId;
    }

    public String getDimensionCode() {
        return dimensionCode;
    }

    public void setDimensionCode(String dimensionCode) {
        this.dimensionCode = dimensionCode;
    }

    public String getDimensionName() {
        return dimensionName;
    }

    public void setDimensionName(String dimensionName) {
        this.dimensionName = dimensionName;
    }

    public Double getDimensionScore() {
        return dimensionScore;
    }

    public void setDimensionScore(Double dimensionScore) {
        this.dimensionScore = dimensionScore;
    }

    @Override
    public int compareTo(@NotNull DimensionDto o) {
        return this.getDimensionCode().compareTo(o.getDimensionCode());
    }
}
