package com.sundot.airport.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 考核组枚举
 */
@Getter
@AllArgsConstructor
public enum AssessmentTeamEnum {

    SUPERVISOR("SUPERVISOR", "主管"),
    TEAM_LEADER("TEAM_LEADER", "班组长"),
    SECURITY_INSPECTOR_AND_X_RAY_PASSENGER_INSPECTION_STAFF("SECURITY_INSPECTOR_AND_X_RAY_PASSENGER_INSPECTION_STAFF", "安检员兼X光机操作员（旅检、员工）"),
    SECURITY_INSPECTOR_PASSENGER_INSPECTION_STAFF("SECURITY_INSPECTOR_PASSENGER_INSPECTION_STAFF", "安检员（旅检、员工）"),
    LUGGAGE_INSPECTION("LUGGAGE_INSPECTION", "行检"),
    SECURITY_INSPECTOR_AND_X_RAY_CROSSING("SECURITY_INSPECTOR_AND_X_RAY_CROSSING", "安检员兼X光机操作员（道口）"),
    SECURITY_INSPECTOR_CROSSING("SECURITY_INSPECTOR_CROSSING", "安检员（道口）"),
    SECURITY_INSPECTOR_AND_X_RAY_FREIGHT("SECURITY_INSPECTOR_AND_X_RAY_FREIGHT", "安检员兼X光机操作员（货运）"),
    SECURITY_INSPECTOR_FREIGHT("SECURITY_INSPECTOR_FREIGHT", "安检员（货运）"),
    DORMITORY_MANAGEMENT("DORMITORY_MANAGEMENT", "宿舍管理"),
    GENERAL_ADMINISTRATION("GENERAL_ADMINISTRATION", "综管"),
    QUALITY_CONTROL("QUALITY_CONTROL", "品控"),
    TRAINING("TRAINING", "培训"),
    EQUIPMENT("EQUIPMENT", "设备");

    private final String code;
    private final String desc;

    public static AssessmentTeamEnum getByCode(String code) {
        for (AssessmentTeamEnum itemEnum : values()) {
            if (itemEnum.getCode().equals(code)) {
                return itemEnum;
            }
        }
        return null;
    }

    public static AssessmentTeamEnum getByDesc(String desc) {
        for (AssessmentTeamEnum itemEnum : values()) {
            if (itemEnum.getDesc().equals(desc)) {
                return itemEnum;
            }
        }
        return null;
    }

}
