package com.prolog.rdc.tms.constant.enums;

import com.google.common.collect.Maps;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Map;

/**
 * 装车扫描单号类型枚举
 * @author hongbo.pan
 * @date 2022/12/7
 */
@AllArgsConstructor
@Getter
public enum LoadingScanOrderTypeEnum {

    LOADING_NO("1", "派车单号"),
    SHIP_NO("2", "运单号"),
    ITEM_NO("3", "运单商品编号"),
    ;
    public static final String MESSAGE_TYPE = "MESSAGE_TYPE";
    private static Map<String, LoadingScanOrderTypeEnum> enumMap = Maps.newHashMap();
    private String code;
    private String desc;

    static {
        for(LoadingScanOrderTypeEnum as : LoadingScanOrderTypeEnum.values()) {
            enumMap.put(as.code, as);
        }
    }

    public static LoadingScanOrderTypeEnum getByCode(String code) {
        return  enumMap.get(code);
    }

}
