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;
import java.math.BigDecimal;

/**
 * @Description: 报告课程考核成绩评价明细结果-考生-目标dto
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2024/2/26
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ReportExamStudentTargetDto implements Serializable, Comparable<ReportExamStudentTargetDto> {

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

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

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

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

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

    @ApiModelProperty(value = "各课程目标平均分")
    private Double targetMatrixAvgScore;

    @ApiModelProperty(value = "个人达成度")
    private BigDecimal matrixDegree;

    @ApiModelProperty(value = "期末成绩")
    private ReportExamStudentFinalScoreDto finalScore;

    @ApiModelProperty(value = "平时成绩")
    private ReportExamStudentUsualScoreDto usualScore;

    public ReportExamStudentTargetDto() {

    }

    public ReportExamStudentTargetDto(CourseTargetWordDto courseTargetWordDto, ReportExamStudentFinalScoreDto finalScore, ReportExamStudentUsualScoreDto usualScore, BigDecimal matrixDegree) {
        this.targetId = courseTargetWordDto.getTargetId();
        this.targetName = courseTargetWordDto.getTargetName();
        this.graduationRequirement = courseTargetWordDto.getGraduationRequirement();
        this.targetSumWeight = courseTargetWordDto.getTargetSumWeight();
        this.finalScore = finalScore;
        this.usualScore = usualScore;
        this.matrixDegree = matrixDegree;
    }

//    public ReportExamStudentTargetDto(ReportExamStudentTargetDto reportExamStudentTargetDto) {
//        this.targetId = reportExamStudentTargetDto.getTargetId();
//        this.targetName = reportExamStudentTargetDto.getTargetName();
//        this.graduationRequirement = reportExamStudentTargetDto.getGraduationRequirement();
//        this.evaluationValue = reportExamStudentTargetDto.getEvaluationValue();
//        this.targetMatrixAvgScore = reportExamStudentTargetDto.getTargetMatrixAvgScore();
//        this.targetSumWeight = reportExamStudentTargetDto.getTargetSumWeight();
//        this.finalScore = reportExamStudentTargetDto.getFinalScore();
//        this.usualScore = reportExamStudentTargetDto.getUsualScore();
//    }

    public BigDecimal getMatrixDegree() {
        return matrixDegree;
    }

    public void setMatrixDegree(BigDecimal matrixDegree) {
        this.matrixDegree = matrixDegree;
    }

    public Double getTargetMatrixAvgScore() {
        return targetMatrixAvgScore;
    }

    public void setTargetMatrixAvgScore(Double targetMatrixAvgScore) {
        this.targetMatrixAvgScore = targetMatrixAvgScore;
    }

    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 ReportExamStudentFinalScoreDto getFinalScore() {
        return finalScore;
    }

    public void setFinalScore(ReportExamStudentFinalScoreDto finalScore) {
        this.finalScore = finalScore;
    }

    public ReportExamStudentUsualScoreDto getUsualScore() {
        return usualScore;
    }

    public void setUsualScore(ReportExamStudentUsualScoreDto usualScore) {
        this.usualScore = usualScore;
    }

    public String getGraduationRequirement() {
        return graduationRequirement;
    }

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

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

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