package com.prolog.eis.enums.base;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @program: eis-dsl-parent
 * @description: 通用状态
 * @author: Xiong
 * @create: 2021-12-30 17:28
 **/
@Getter
@AllArgsConstructor
public enum BaseTypeEnum {

    STATUS_INIT(0, "未开始"),
    INBOUND_TYPE(10, "入库"),
    OUTBOUND_TYPE(20, "出库"),
    INVENTORY_TYPE(30, "盘点"),
    MERGE_TYPE(55, "合托"),
    STATUS_FINISH(2, "完成"),
    CALLBACK_FINISH(4, "回告成功"),
    ;
    private Integer code;
    private String msg;

    public static BaseTypeEnum getByCode(Integer code) {
        BaseTypeEnum statusEnum = null;

        for (BaseTypeEnum value : values()) {
            if (value.getCode().equals(code)) {
                statusEnum = value;
            }
        }
        return statusEnum;
    }
}
