package com.chinaweal.aiccs.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 定时统计数据模块划分枚举
 **/
@Getter
@AllArgsConstructor
public enum StatisticsModuleEnum {

    ALL_REGION_COMPANY("all_region_company", "所有区域的风险企业量"),
    ALL_REGION_ABN("all_region_abn", "全市各区的经营异常主体情况"),
    YEAR_ABN("year_abn", "按年统计全市"),
    MONTH_ABN("month_abn", "按月统计全市"),
    WEEK_ABN("week_abn", "按周统计全市"),
    IN_ABN("in_abn", "经营异常列入统计全市"),
    OUT_ABN("out_abn", "经营异常移出统计全市"),
    ALL_REGION_ILL("all_region_ill", "全市各区的严重违法主体情况"),
    YEAR_ILL("year_ill", "按年统计严重违法主体情况"),
    IN_ILL("in_ill", "按列入原因统计严重违法主体情况"),
    OUT_REGION_ILL("out_region_ill", "按移出原因统计各区严重违法主体情况"),
    ALL_REGION_REV("all_region_rev", "批量吊销主体分布"),
    YEAR_REV("year_rev", "批量吊销增长分析(年)"),
    ALL_REGION_LOCK("all_region_lock", "联合惩戒主体分布"),
    IN_LOCK("in_lock", "联合惩戒来源分析"),
    ALL_REGION_FRAUD("all_region_fraud", "撤销登记主体分布"),
    YEAR_FRAUD("year_fraud", "撤销登记增长分析"),
    TYPE_FRAUD("type_fraud", "撤销登记涉嫌登记类型分析"),
    ALL_REGION_USUA("all_region_usua", "协同监管主体分布"),
    RESULT_USUA("result_usua", "协同监管结果分析"),
    ;

    /**
     * 标签
     */
    private final String tag;

    /**
     * 标签名/标签含义
     */
    private final String name;

    /**
     * 通过标签获取标签枚举
     *
     * @param moduleTag 标签
     * @return 枚举
     * @author lroyia
     * @since 2020年8月5日 16:33:41
     */
    public static StatisticsModuleEnum getEnumByModuleTag(String moduleTag) {
        for (StatisticsModuleEnum each : StatisticsModuleEnum.values()) {
            if (each.tag.equals(moduleTag)) return each;
        }
        return null;
    }
}
