package cn.superdesk.uniorder.common.enums.invoice.customer;

import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;

/**
 * @Description: // 寄票状态:0-未寄票;1-已寄票
 * @Author: linjinyu
 * @CreateDate: 2021/5/26 下午7:08
 * @UpdateUser: linjinyu
 * @UpdateDate: 2021/5/26 下午7:08
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
public enum InvoiceApplyCustomerMailTickStatusEnum {

//    未寄票(0, "未寄票"),
//    已寄票(1, "已寄票"),


    /**************************************** mark by linjinyu at 20220419 start ****************************************/

//    【【结算中心-测试环境】积分结算-发票管理-筛选查询-【寄票状态】里面内容文案有误，应该为“未寄票/已寄票”】https://www.tapd.cn/33003868/bugtrace/bugs/view?bug_id=1133003868001004978
//	未邮寄(0, "未邮寄"),
//	已邮寄(1, "已邮寄"),
    // 修改回这
    未寄票(0, "未寄票"),
    已寄票(1, "已寄票"),

    /**************************************** mark by linjinyu at 20220419   end ****************************************/

    ;

    private Integer key;
    private String  desc;

    InvoiceApplyCustomerMailTickStatusEnum(Integer key, String desc) {
        this.key = key;
        this.desc = desc;
    }

    public Integer getKey() {
        return key;
    }

    public String getDesc() {
        return desc;
    }

    public static String getDesc(Integer key) {
        for (InvoiceApplyCustomerMailTickStatusEnum c : InvoiceApplyCustomerMailTickStatusEnum.values()) {
            if (c.key.equals(key)) {
                return c.getDesc();
            }
        }

        return "未知状态";
    }

    private static final Map<Integer, InvoiceApplyCustomerMailTickStatusEnum> LOOKUP = new HashMap<>();

    static {
        for (InvoiceApplyCustomerMailTickStatusEnum s : EnumSet.allOf(InvoiceApplyCustomerMailTickStatusEnum.class)) {
            LOOKUP.put(s.getKey(), s);
        }
    }

    public static InvoiceApplyCustomerMailTickStatusEnum get(Integer key) {
        return LOOKUP.get(key);
    }
}
