package com.qmth.teachcloud.common.enums;

import java.util.Objects;

/**
 * @Description: 任务类型enum
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2021/3/29
 */
public enum TaskTypeEnum {

    USER_IMPORT("用户导入"),

    STUDENT_IMPORT("学生导入"),

    COURSE_IMPORT("课程导入"),

    CLAZZ_IMPORT("班级导入"),

    QUESTION_MISSION_BATCH_CREATE("批量新建命题任务"),

    SAMPLE_EXPORT("导出审核样本"),

    EXAMINATION_IMPORT("考务数据导入"),

    EXAMINATION_EXPORT("考务数据导出"),

    PRINT_PDF_DOWNLOAD("批量下载pdf"),

    PAPER_AND_CARD_PDF_DOWNLOAD("卷库查询管理试卷、空白题卡批量下载pdf"),

    CREATE_PDF("生成pdf"),

    DATA_CALCULATE("数据计算"),

    CREATE_TASK_PRINT("发布印刷任务"),

    STATISTICS_IMPORT("命题统计导入"),

    SCORE_EXPORT("成绩导出"),

    SCORE_DOWNLOAD("成绩轨迹下载"),

    DOWNLOAD_PAPER_FILE_BATCH("批量下载试卷文件");

    private String title;

    private TaskTypeEnum(String title) {
        this.title = title;
    }

    public String getTitle() {
        return title;
    }

    /**
     * 状态转换 toName
     *
     * @param title
     * @return
     */
    public static String convertToName(String title) {
        for (TaskTypeEnum e : TaskTypeEnum.values()) {
            if (Objects.equals(title, e.getTitle())) {
                return e.name();
            }
        }
        return null;
    }
}
