package com.hw.nativeapp.config.enums;

/**
 * 出库单状态
 */
public enum StockStatusEnum {
    //状态  0:待审核  1：审核未通过   2:待入库/待出库   3：已入库/已出库
    STATUS_WAITAUDI(0, "待审核"),
    STATUS_AUDIFAIL(1, "审核未通过"),
    STATUS_WAITOUT(2, "待出库"),
    STATUS_OUTSUCCESS(3, "已出库"),
    STATUS_UNKNOW(99, "未知状态");

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

    public static String getNameByType(Integer type){
        for (StockStatusEnum item : StockStatusEnum.values()){
            if (item.type.equals(type)){
                return item.getName();
            }
        }
        return STATUS_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;
    }
}
