package com.sckw.payment.model.constant;

import java.util.Objects;

/**
 * 物流、贸易
 * 对账单状态枚举
 *
 * @author xucaiqin
 * @date 2023-07-11 12:00:52
 */
public enum LedgerEnum {
    ALL(0, "全部"),
    SAVE(1, "已保存"),
    TO_LEDGER(2, "待对账"),
    LEDGERED(3, "已对账"),
    SUCCESS(4, "已完成"),
    BACK(5, "已退回"),
    REVOCATION(6, "已撤回");

    private int status;
    private String desc;

    LedgerEnum(int status, String desc) {
        this.status = status;
        this.desc = desc;
    }

    public static String getDesc(Integer status) {
        if (Objects.isNull(status)) {
            return "";
        }
        for (LedgerEnum value : values()) {
            if (status == value.getStatus()) {
                return value.getDesc();
            }
        }
        return "";
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
