package com.hw.nativeapp.config.enums;

public enum AllotStatusEnum {

    //调拨状态  0-审核中 1-未通过 2-未发货 3-在途 4-部分到货 5-完成
    TYPE_EXAMINE(0, "审核中"),
    TYPE_FAILED(1, "未通过"),
    TYPE_UNSHIPPED(2, "未发货"),
    TYPE_INTRANSIT(3, "在途"),
    TYPE_PART(4, "部分到货"),
    TYPE_COMPLETE(5, "完成"),
    TYPE_UNKNOW(6, "未知");

    AllotStatusEnum(Integer type, String name){
        this.type = type;
        this.name = name;
    }

    public static String getNameByType(Integer type){
        for (AllotStatusEnum item : AllotStatusEnum.values()){
            if (item.type.equals(type)){
                return item.getName();
            }
        }
        return AllotStatusEnum.TYPE_UNKNOW.getName();
    }

    private Integer type;
    private String name;

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
