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

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

/**
 * @Description: 需修正标记:0-正常;1-修正;
 * @Author: linjinyu
 * @CreateDate: 2022/3/18 1:03 下午
 * @UpdateUser: linjinyu
 * @UpdateDate: 2022/3/18 1:03 下午
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
public enum CommonNeedReviseMarkEnum {

    正常(0, "正常"),
    修正(1, "修正"), // AccountingOrderScoreCustomerListItemVo patchNeedReviseMarkStatistics
                                // AccountingOrderUnifiedSupplierListItemVo patchReviseMark
                                // InvoiceApplyCustomerPageVo patchReviseMark


    修数据_20220502(20220502, "修数据_20220502"),
    修数据_20220503(20220503, "修数据_20220503"),
    修数据_20220504(20220504, "修数据_20220504"),
    修数据_20220505(20220505, "修数据_20220505"), // AccountingOrderScoreCustomerListItemVo patchNeedReviseMarkMailTickStatus
    修数据_20220518(20220518, "修数据_20220518"), // AccountingOrderScoreCustomerListItemVo patchNeedReviseMarkInvoiceStatus
    修数据_20220519(20220519, "修数据_20220519"), // AccountingOrderScoreCustomerListItemVo patchNeedReviseMarkServiceNoSourceFrom

    ;

    private Integer key;
    private String  desc;

    CommonNeedReviseMarkEnum(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 (CommonNeedReviseMarkEnum c : CommonNeedReviseMarkEnum.values()) {
            if (c.key.equals(key)) {
                return c.getDesc();
            }
        }
        return null;
    }

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

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

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