package cn.teammodel.model.vo.appraise;

import cn.teammodel.common.FiveEducations;
import cn.teammodel.model.entity.appraise.AchievementRule;
import cn.teammodel.model.entity.appraise.AppraiseRecordItem;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 学生个人评价 vo
 * @author winter
 * @create 2023-12-04 15:26
 */
@Data
@Builder
public class StudentReportVo {
    @ApiModelProperty("学生名字")
    private String name;

    @ApiModelProperty("学生id")
    private String studentId;

    @ApiModelProperty("班级名称")
    private String className;

    @ApiModelProperty("学生表扬总数")
    private Integer praiseCount;
    @ApiModelProperty("学生批评总数")
    private Integer criticizeCount;

    @ApiModelProperty("学生总分")
    private Integer score;

    @ApiModelProperty("表扬数据超越了全班多少人")
    private Float beyondPercent;

    @ApiModelProperty("表扬最多的老师")
    private Teacher topPraiseTeacher;

    @ApiModelProperty("批评最多的老师")
    private Teacher topCriticalTeacher;

    @ApiModelProperty("最多的表扬指标")
    private String topPraiseNode;

    @ApiModelProperty("最多的批评指标")
    private String topCriticalNode;

    @ApiModelProperty("五育表扬分布图")
    private Map<String, Integer> praiseDistribution;

    @ApiModelProperty("五育待改进分布图")
    private Map<String, Integer> criticalDistribution;

    @ApiModelProperty("学生当前成就")
    private AchievementRule curAchievement;

    @ApiModelProperty("学生当前成就 x N")
    private int achievementN;

    @ApiModelProperty("学生本学期的所有评价数据")
    private List<AppraiseRecordItem> records;

    public static Map<String, Integer> ofFiveEducation() {
        Map<String, Integer> initialMap = new HashMap<>();
        FiveEducations.codes().forEach(item -> {
            initialMap.put(item, 0);
        });

        return initialMap;
    }

    @Data
    @AllArgsConstructor
    public static class Teacher {
        String id;
        String name;
    }

}
