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/11/14
 */
@AllArgsConstructor
@Getter
public enum DispatchSelfPickHandleTypeEnum {

    NO_VALID_AND_NO_QTY("1", "不做库存校验且不输入调度、自提数量"),
    VALID("2", "仅库存校验"),
    QTY("3", "仅输入调度、自提数量"),
    VALID_AND_QTY("4", "库存校验且输入调度、自提数量"),
    ;

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

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

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

}
