package com.ruoyi.mxjb.domain;

import com.google.common.collect.Sets;
import com.ruoyi.common.utils.StringUtils;

import java.util.Set;

public class MxjbContants {
    public static final String FormTypeAddClassMaster = "AddClassMaster"; // 1
    public static final String FormTypeUpdateClassMaster = "UpdateClassMaster"; // 2
    public static final String FormTypeDelClassMaster = "DelClassMaster"; // 3
    public static final String FormTypeAddClass = "AddClass"; // 11
    public static final String FormTypeUpdateClass = "UpdateClass"; // 12
    public static final String FormTypeDelClass = "DelClass"; // 13

    public static final String FormAuditAuto = "Auto";
    public static final String FormAuditSystem = "System";
    public static final String FormAuditHeadMaster = "HeadMaster";


    public static String FormStatusNone = "0";
    public static String FormStatusAccept = "1";
    public static String FormStatusReject = "2";
    public static String FormStatusRecall = "3";


    public static String ScoringTypeSelf = "1";
    public static String ScoringTypeTeacher = "2";
    public static String ScoringTypeAuto = "3";

    public static String RoleKey_frontMaster = "frontMaster";
    public static String RoleKey_frontTeacher = "frontTeacher";
    public static String RoleKey_frontStudent = "frontStudent";

    public static Integer User_None = 0;
    public static Integer User_ClassMaster = 1;
    public static Integer User_Teacher = 2;
    public static Integer User_Student = 3;
    public static Integer User_Competition = 12;

    public static String Period_Primary = "primary";
    public static String Period_Junior = "junior";
    public static String Period_Senior = "senior";

    public static Double ScoreRateLimit = 0.8;
    public static Double ScoreRateSeg1 = 0.3;
    public static Double ScoreRateSeg2 = 0.6;
    public static Double ScoreRateSeg3 = 0.8;

    public static Integer ScoreRatePSeg1 = 30;
    public static Integer ScoreRatePSeg2 = 60;
    public static Integer ScoreRatePSeg3 = 80;

    public static String ScoreLevelRight = "R";
    public static String ScoreLevelWrong = "W";
    public static String ScoreLevelEmpty = "E";

    public static String QuestionTypeChoose = "1";
    public static String QuestionTypeMultiChoose = "3"; //
    public static String QuestionTypeSubjective = "2";
    public static String QuestionTypeMultiTotal = "4";
    public static String QuestionTypeMultiScore = "5";
    public static String QuestionTypeChooseCount = "6";
    public static String QuestionTypeChooseScore = "7";
    public static Long QuestionScoreWrong = 0L;
    public static Long QuestionScoreRight = 1L;
    public static Long QuestionScoreNone = 1L;

    public static String CompQuesTypeQuestion = "question";
    public static String CompQuesTypeVideo = "video";
    public static String ExamineeTypeCompetitor = "competitor";
    public static String ExamineeTypeEvaluation = "evaluation";
    public static String ExamineeTypeAi = "ai";
    public static String ExamineeTypeTest = "test";
    public static String ExamineeTypeHomework = "homework";
    public static String ExamineeTypeIe = "ie";

    public static String ExamineeTypeEvalKey = "E";
    public static String ExamineeTypeCompKey = "C";
    public static String ExamineeTypeAiKey = "A";
    public static String ExamineeTypeTestKey = "T";
    public static String ExamineeTypeHomeworkKey = "H";
    public static String ExamineeTypeIeKey = "I";
    public static Integer ExamineeTypeEvalValue = 1;
    public static Integer ExamineeTypeCompValue = 2;
    public static Integer ExamineeTypeAiValue = 3;
    public static Integer ExamineeTypeTestValue = 4;
    public static Integer ExamineeTypeHomeworkValue = 5;
    public static Integer ExamineeTypeIeValue = 6;

    public static String StateTypeExaminee = "examinee_status";
    public static String StateTypeEvaluation = "evaluation_status";

    public static Long EvaluationClassTest = 1L;    // 未发布
    public static Long EvaluationPersonTest = 3L;    // 个人测评

    public static Long EvaluationStatusEdit = 1L;    // 未发布
    public static Long EvaluationStatusPublish = 2L; // 已发布
    public static Long EvaluationStatusOpen = 3L;    // 开启
    public static Long EvaluationStatusSigning = 4L;
    public static Long EvaluationStatusExamining = 5L;
    public static Long EvaluationStatusScoring = 6L;
    public static Long EvaluationStatusPublishScore = 7L;  // 发布成绩
    public static Long EvaluationStatusClose = 8L; // 关闭

    public static Long ExamineeStatusInit = 1L;
    public static Long ExamineeStatusSign = 2L;
    public static Long ExamineeStatusExamine = 3L;
    public static Long ExamineeStatusCommit = 4L;
    public static Long ExamineeStatusReview = 5L;
    public static Long ExamineeStatusPublish = 6L;
    public static Long ExamineeStatusClose = 7L;

    public static String PaperTypeStandard = "standard";
    public static String PaperTypeCustom = "custom";

    public static String SubjectTypeSingle = "Single";
    public static String SubjectTypeCombine = "Combine";

    public static String SubjectLang = "L"; // 语
    public static String SubjectMath = "M"; // 数
    public static String SubjectEng = "E"; // 英
    public static String SubjectPhy = "S"; // 物/理 Science
    public static String SubjectChem = "C"; // 化
    public static String SubjectBio = "B"; // 生
    public static String SubjectGeo = "G"; // 地
    public static String SubjectPolitics = "P"; // 政
    public static String SubjectHistory = "H"; // 历

    public static Integer Ali_Id_dezhi = 1;                 //
    public static Integer Ali_Id_sygh = 2;                  //
    public static Integer Ali_Id_mxapp =3;                  // app视频
    public static Integer Ali_Id_question = 4;              // 题视频
    public static Integer Ali_Id_resource_person = 5;       // 个人资源库
    public static Integer Ali_Id_resource_school = 6;       // 学校资源库
    public static Integer Ali_Id_resource_cloud = 7;        // 云资源库
    public static Integer Ali_Id_resource_board = 8;        // 班级board
    public static Integer Ali_Id_resource_student = 9;      // 学生资源
    public static Integer Ali_Id_resource_ai = 10;      // AI视频
    public static Integer Ali_Id_voluntary_course = 11;      // 志愿课堂

    public static final Set<String> InvalidScoreLevelSet = Sets.newHashSet(MxjbContants.ScoreLevelEmpty, MxjbContants.ScoreLevelWrong);

    public static String getExamineeTypeKey(Integer examineeType) {
        if (ExamineeTypeCompValue.equals(examineeType)) {
            return ExamineeTypeCompKey;
        } else if (ExamineeTypeAiValue.equals(examineeType)) {
            return ExamineeTypeAiKey;
        } else if (ExamineeTypeTestValue.equals(examineeType)) {
            return ExamineeTypeTestKey;
        } else if (ExamineeTypeHomeworkValue.equals(examineeType)) {
            return ExamineeTypeHomeworkKey;
        } else if (ExamineeTypeIeValue.equals(examineeType)) {
            return ExamineeTypeIeKey;
        }
        return ExamineeTypeEvalKey;
    }

    public static String getExamineeTypeKey(String examineeType) {
        if (ExamineeTypeCompetitor.equals(examineeType)) {
            return ExamineeTypeCompKey;
        } else if (ExamineeTypeAi.equals(examineeType)) {
            return ExamineeTypeAiKey;
        } else if (ExamineeTypeTest.equals(examineeType)) {
            return ExamineeTypeTestKey;
        } else if (ExamineeTypeHomework.equals(examineeType)) {
            return ExamineeTypeHomeworkKey;
        } else if (ExamineeTypeIe.equals(examineeType)) {
            return ExamineeTypeIeKey;
        }
        return ExamineeTypeEvalKey;
    }

    public static String getNormalAnswer(String answer, String defValue) {
        return StringUtils.isNotBlank(answer) ? StringUtils.splitByWholeSeparatorPreserveAllTokens(answer, "$@")[0] : defValue;
    }
}
