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

    AUTO_CREATE("1", "自动生成一个退回运单并调度当前司机"),
    ;

    public static final String ENUM_NAME = "ARRIVE_NOTEQUAL_DELIVERY_HANDLETYPE";
    private static Map<String, ArriveNotequalDeliveryHandleTypeEnum> enumMap = Maps.newHashMap();
    private String code;
    private String desc;

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

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

}
