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.CourseWeightDto;
import io.swagger.annotations.ApiModelProperty;
import org.jetbrains.annotations.NotNull;

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

/**
 * @Description: 课程目标word dto
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2024/2/26
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class CourseTargetWordDto implements Serializable, Comparable<CourseTargetWordDto> {

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

    @ApiModelProperty(value = "课程目标名称")
    private String targetName;

    @ApiModelProperty(value = "毕业要求")
    private String graduationRequirement;

    @ApiModelProperty(value = "毕业要求指标点")
    private String graduationRequirementPoint;

    @ApiModelProperty(value = "目标整体权重")
    private BigDecimal targetSumWeight = new BigDecimal(0);

    @ApiModelProperty(value = "换算平均分")
    private Double matrixAvgScore = 0.0d;

    @ApiModelProperty(value = "目标达成评价值")
    private BigDecimal evaluationValue = new BigDecimal(0);

    @ApiModelProperty(value = "平时成绩信息")
    private UsualScoreWordDto usualScoreDto;

    @ApiModelProperty(value = "期末成绩信息")
    private FinalScoreWordDto finalScoreDto;

    @ApiModelProperty(value = "知识点卷面总分")
    private Double dimensionScoreSum = 0.0d;

    @ApiModelProperty(value = "知识点集合")
    private String dimensionPoint;

    @ApiModelProperty(value = "期末成绩小题卷面总分")
    private Double finalScoreQuestionScoreSum = 0.0d;

    public CourseTargetWordDto() {

    }

    public CourseTargetWordDto(CourseWeightDto courseWeightDto) {
        this.targetId = courseWeightDto.getCourseTargetId();
        this.targetName = courseWeightDto.getCourseTargetName();
        this.graduationRequirement = courseWeightDto.getDegreeRequirement();
        this.graduationRequirementPoint = courseWeightDto.getDimensionStr();
        this.targetSumWeight = courseWeightDto.getTotalWeight();
    }

    public Double getFinalScoreQuestionScoreSum() {
        return finalScoreQuestionScoreSum;
    }

    public void setFinalScoreQuestionScoreSum(Double finalScoreQuestionScoreSum) {
        this.finalScoreQuestionScoreSum = finalScoreQuestionScoreSum;
    }

    public String getDimensionPoint() {
        return dimensionPoint;
    }

    public void setDimensionPoint(String dimensionPoint) {
        this.dimensionPoint = dimensionPoint;
    }

    public Double getDimensionScoreSum() {
        return dimensionScoreSum;
    }

    public void setDimensionScoreSum(Double dimensionScoreSum) {
        this.dimensionScoreSum = dimensionScoreSum;
    }

    public BigDecimal getEvaluationValue() {
        return evaluationValue;
    }

    public void setEvaluationValue(BigDecimal evaluationValue) {
        this.evaluationValue = evaluationValue;
    }

    public String getGraduationRequirement() {
        return graduationRequirement;
    }

    public void setGraduationRequirement(String graduationRequirement) {
        this.graduationRequirement = graduationRequirement;
    }

    public String getGraduationRequirementPoint() {
        return graduationRequirementPoint;
    }

    public void setGraduationRequirementPoint(String graduationRequirementPoint) {
        this.graduationRequirementPoint = graduationRequirementPoint;
    }

    public BigDecimal getTargetSumWeight() {
        return targetSumWeight;
    }

    public void setTargetSumWeight(BigDecimal targetSumWeight) {
        this.targetSumWeight = targetSumWeight;
    }

    public Long getTargetId() {
        return targetId;
    }

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

    public String getTargetName() {
        return targetName;
    }

    public void setTargetName(String targetName) {
        this.targetName = targetName;
    }

    public UsualScoreWordDto getUsualScoreDto() {
        return usualScoreDto;
    }

    public void setUsualScoreDto(UsualScoreWordDto usualScoreDto) {
        this.usualScoreDto = usualScoreDto;
    }

    public FinalScoreWordDto getFinalScoreDto() {
        return finalScoreDto;
    }

    public void setFinalScoreDto(FinalScoreWordDto finalScoreDto) {
        this.finalScoreDto = finalScoreDto;
    }

    public Double getMatrixAvgScore() {
        return matrixAvgScore;
    }

    public void setMatrixAvgScore(Double matrixAvgScore) {
        this.matrixAvgScore = matrixAvgScore;
    }

    @Override
    public int compareTo(@NotNull CourseTargetWordDto o) {
        if (o.getTargetId().longValue() < this.getTargetId().longValue()) {
            return 1;
        } else if (o.getTargetId().longValue() > this.getTargetId().longValue()) {
            return -1;
        } else {
            return 0;
        }
    }
}
