package org.springblade.modules.app.common.enums;

public enum WaybillStateEnum {

    UNCHECK(0, "待确认"),
    PASS(1, "待审批"),
    REJECT(-1, "已驳回"),
    TRANSPORT(2, "调运中"),
    FINISH(3, "已完成"),
    WAYBILL_SLAUGHTER(4, "待屠宰场确认"),
    WAYBILL_SLAUGHTER_REJECT(-5, "屠宰场驳回"),
    UNPASS(-2, "未通过"),
    CANCEL(-3, "撤销"),
    CLOSE(-4, "关闭"),
    ;
    private int code;
    private String text;

    WaybillStateEnum(int code, String text) {
        this.code = code;
        this.text = text;
    }

    public int getCode() {
        return code;
    }

    public String getText() {
        return text;
    }

    public static WaybillStateEnum findByCode(int code) {
        for (WaybillStateEnum demoEnum : values()) {
            if (code == demoEnum.getCode()) {
                return demoEnum;
            }
        }
        return null;
    }

}
