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 ShipBillReturnTypeEnum {

    S("S", "送达自动退运单"),
    Q("Q", "签收自动退运单"),
    ;

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

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

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

}
