package com.jsowell.common.enums.uniapp;

/**
 * 占桩订单enum
 *
 * @author Lemon
 * @Date 2023/8/18 9:41
 */
public enum OccupyOrderStatusEnum {
    OCCUPIED("0", "占桩中"),
    ORDER_COMPLETE("1", "订单完成"),
    ORDER_HANG_UP("2", "订单挂起"),
    DRAFT_ORDER("9", "草稿单"),
    ;

    private String code;
    private String value;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    OccupyOrderStatusEnum(String code, String value) {
        this.code = code;
        this.value = value;
    }

    /**
     * 根据code获取value
     * @param code
     * @return
     */
    public static String getValueByCode(String code) {
        for (OccupyOrderStatusEnum item : OccupyOrderStatusEnum.values()) {
            if (item.getCode().equals(code)) {
                return item.getValue();
            }
        }
        return null;
    }
}
