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 com.qmth.distributed.print.business.bean.dto.CourseWeightDetailDto;
import io.swagger.annotations.ApiModelProperty;
import org.jetbrains.annotations.NotNull;

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

/**
 * @Description: 报告评价方式dto
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2024/2/26
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ReportEvaluationDto implements Serializable, Comparable<ReportEvaluationDto> {

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

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "评价方式id")
    private Long evaluationId;

    @ApiModelProperty(value = "评价方式")
    private String evaluation;

    @ApiModelProperty(value = "评价方式描述")
    private String evaluationDesc;

    @ApiModelProperty(value = "权重")
    private BigDecimal targetWeight;

    @ApiModelProperty(value = "目标分值")
    private BigDecimal targetScore;

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

    @ApiModelProperty(value = "卷面分")
    private Double score;

    @ApiModelProperty(value = "原始目标分")
    private Double originalTargetScore;

    @ApiModelProperty(value = "原始目标权重")
    private BigDecimal originalTargetWeight;

    public ReportEvaluationDto() {

    }

    public ReportEvaluationDto(Long targetId, CourseWeightDetailDto courseWeightDetailDto, BigDecimal targetWeight, Double score, Double originalTargetScore) {
        this.targetId = targetId;
        this.evaluationId = courseWeightDetailDto.getEvaluationId();
        this.evaluation = courseWeightDetailDto.getEvaluationName();
        this.evaluationDesc = courseWeightDetailDto.getEvaluationDesc();
        this.targetWeight = targetWeight;
        this.targetScore = courseWeightDetailDto.getTargetScore();
        this.score = score;
        this.originalTargetWeight = courseWeightDetailDto.getWeight();
        this.originalTargetScore = originalTargetScore;
    }

    public Double getOriginalTargetScore() {
        return originalTargetScore;
    }

    public void setOriginalTargetScore(Double originalTargetScore) {
        this.originalTargetScore = originalTargetScore;
    }

    public BigDecimal getOriginalTargetWeight() {
        return originalTargetWeight;
    }

    public void setOriginalTargetWeight(BigDecimal originalTargetWeight) {
        this.originalTargetWeight = originalTargetWeight;
    }

    public Double getScore() {
        return score;
    }

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

    public Double getTargetAvgScore() {
        return targetAvgScore;
    }

    public void setTargetAvgScore(Double targetAvgScore) {
        this.targetAvgScore = targetAvgScore;
    }

    public Long getTargetId() {
        return targetId;
    }

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

    public Long getEvaluationId() {
        return evaluationId;
    }

    public void setEvaluationId(Long evaluationId) {
        this.evaluationId = evaluationId;
    }

    public String getEvaluation() {
        return evaluation;
    }

    public void setEvaluation(String evaluation) {
        this.evaluation = evaluation;
    }

    public String getEvaluationDesc() {
        return evaluationDesc;
    }

    public void setEvaluationDesc(String evaluationDesc) {
        this.evaluationDesc = evaluationDesc;
    }

    public BigDecimal getTargetWeight() {
        return targetWeight;
    }

    public void setTargetWeight(BigDecimal targetWeight) {
        this.targetWeight = targetWeight;
    }

    public BigDecimal getTargetScore() {
        return targetScore;
    }

    public void setTargetScore(BigDecimal targetScore) {
        this.targetScore = targetScore;
    }

    @Override
    public int compareTo(@NotNull ReportEvaluationDto o) {
        return this.getEvaluation().compareTo(o.getEvaluation());
    }
}
