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

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

import java.util.Map;

/**
 * 运单类型枚举
 * @author hongbo.pan
 * @date 2022/10/8
 */
@AllArgsConstructor
@Getter
public enum ShipBillTypeEnum {

    NORMAL("N", "正常运单"),
    RETURN("R", "退货运单"),
    ;

    private static Map<String, ShipBillTypeEnum> enumMap = Maps.newHashMap();
    private String code;
    private String desc;

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

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

}
