package com.qmth.paper.library.common.enums;

import java.util.Objects;

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

    ORG_IMPORT("组织架构导入"),
    USER_IMPORT("用户导入"),
    EXAM_STUDENT_IMPORT("考生导入"),
    PAPER_DOWNLOAD("批量下载"),
    PICTURE_DOWNLOAD("图片下载"),
    STUDENT_PDF_GENERATE("考生试卷生成pdf");

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