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

    NOT_SIGN("N", "未签收"),
    PART("P", "部分签收"),
    SIGN("S", "已签收"),
    ;

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

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

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

}
