package com.sckw.order.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @desc: 订单状态枚举
 * @author: yzc
 * @date: 2023-09-18 15:32
 */
@Getter
@AllArgsConstructor
public enum OrderStatusEnum {

    /**
     * 订单状态枚举
     */
    SAVED(0, "已保存"),
    WAIT_ACCEPTED(1, "待受理"),
    RETURNED(2, "已退回"),
    WAIT_SIGNED(3, "待签约"),
    EXECUTING(4, "执行中"),
    FINISHED(5, "已完结"),
    RECONCILED(6, "已对账"),
    SETTLED(7, "已结算");

    private final Integer code;
    private final String msg;

    public static String getMsg(Integer code) {
        for (OrderStatusEnum ele : OrderStatusEnum.values()) {
            if (ele.getCode().equals(code)) {
                return ele.getMsg();
            }
        }
        return null;
    }

}
