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;
import java.util.List;

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

    @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;

    @ApiModelProperty(value = "知识点集合")
    private List<DimensionDto> dimensionList;

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

    @ApiModelProperty(value = "评价方式集合")
    private List<ReportEvaluationDto> evaluationList;

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

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

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

    public CourseTargetWebDto() {

    }

    public CourseTargetWebDto(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 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 BigDecimal getEvaluationValue() {
        return evaluationValue;
    }

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

    public List<ReportEvaluationDto> getEvaluationList() {
        return evaluationList;
    }

    public void setEvaluationList(List<ReportEvaluationDto> evaluationList) {
        this.evaluationList = evaluationList;
    }

    public List<DimensionDto> getDimensionList() {
        return dimensionList;
    }

    public void setDimensionList(List<DimensionDto> dimensionList) {
        this.dimensionList = dimensionList;
    }

    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 String getGraduationRequirement() {
        return graduationRequirement;
    }

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

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