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

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

import java.util.Map;

/**
 * 消息配置单据类型枚举
 * @author hongbo.pan
 * @date 2022/11/16
 */
@AllArgsConstructor
@Getter
public enum MessageOrderTypeEnum {

    ORDER_NO("1", "订单号"),
    SHIP_NO("2", "运单号"),
    WMS_NO("3", "WMS单号"),
    LOADING_NO("4", "派车单号"),
    APPOINTMENT_NO("5", "预约单号"),
    ;
    public static final String MESSAGE_ORDER_TYPE = "MESSAGE_ORDER_TYPE";
    private static Map<String, MessageOrderTypeEnum> enumMap = Maps.newHashMap();
    private String code;
    private String desc;

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

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

}
