package com.qmth.sop.common.enums;

import java.util.Objects;

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

    USER_ARCHIVES_IMPORT("人员档案导入"),

    USER_ARCHIVES_EXPORT("人员档案导出"),

    CUSTOM_IMPORT("客户导入"),

    MESSAGE_EXPORT("回执明细导出"),

    DING_COUNT_EXPORT("考勤打卡统计导出"),

    DING_ATTENDANCE_EXPORT("考勤明细导出"),

    DING_SUBMIT_EXPORT("考勤提交导出"),

    DEVICE_IMPORT("设备导入"),

    CRM_SYNC("派单同步"),

    RTZF_USER_PUSH_SYNC("软通智服用户推送同步任务"),

    RTZF_USER_UPDATE_SYNC("软通智服用户更新同步任务");

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