package com.simuwang.daq.components.report.parser;

import cn.hutool.core.map.MapUtil;
import com.simuwang.base.common.enums.ReportParserFileType;
import com.simuwang.base.common.enums.ReportType;

import java.util.Map;

/**
 * @author wangzaijun
 * @date 2024/9/29 13:39
 * @description 报告解析的bean名称关系配置
 */
public final class ReportParserConstant {
    public static final Map<ReportType, Map<ReportParserFileType, String>> REPORT_PARSER_BEAN_MAP = MapUtil.newHashMap(8);

    public static final String PARSER_PDF_MONTHLY = "report-parser:pdf:monthly";
    public static final String PARSER_DOC_MONTHLY = "report-parser:doc:monthly";
    public static final String PARSER_DOCX_MONTHLY = "report-parser:docx:monthly";
    public static final String PARSER_XLSX_MONTHLY = "report-parser:xlsx:monthly";
    public static final String PARSER_XLS_MONTHLY = "report-parser:xls:monthly";
    public static final String PARSER_PYTHON_MONTHLY = "report-parser:python:monthly";

    public static final String PARSER_PDF_QUARTERLY = "report-parser:pdf:quarterly";
    public static final String PARSER_DOC_QUARTERLY = "report-parser:doc:quarterly";
    public static final String PARSER_DOCX_QUARTERLY = "report-parser:docx:quarterly";
    public static final String PARSER_XLSX_QUARTERLY = "report-parser:xlsx:quarterly";
    public static final String PARSER_XLS_QUARTERLY = "report-parser:xls:quarterly";
    public static final String PARSER_PYTHON_QUARTERLY = "report-parser:python:quarterly";

    public static final String PARSER_PDF_ANNUALLY = "report-parser:pdf:annually";
    public static final String PARSER_DOC_ANNUALLY = "report-parser:doc:annually";
    public static final String PARSER_DOCX_ANNUALLY = "report-parser:docx:annually";
    public static final String PARSER_XLSX_ANNUALLY = "report-parser:xlsx:annually";
    public static final String PARSER_XLS_ANNUALLY = "report-parser:xls:annually";
    public static final String PARSER_PYTHON_ANNUALLY = "report-parser:python:annually";

    static {
        REPORT_PARSER_BEAN_MAP.put(ReportType.MONTHLY,
                Map.of(ReportParserFileType.PDF, PARSER_PDF_MONTHLY,
                        ReportParserFileType.DOC, PARSER_DOC_MONTHLY,
                        ReportParserFileType.DOCX, PARSER_DOCX_MONTHLY,
                        ReportParserFileType.XLSX, PARSER_XLSX_MONTHLY,
                        ReportParserFileType.XLS, PARSER_XLS_MONTHLY,

                        ReportParserFileType.PYTHON, PARSER_PYTHON_MONTHLY
                ));

        REPORT_PARSER_BEAN_MAP.put(ReportType.QUARTERLY,
                Map.of(ReportParserFileType.PDF, PARSER_PDF_QUARTERLY,
                        ReportParserFileType.DOC, PARSER_DOC_QUARTERLY,
                        ReportParserFileType.DOCX, PARSER_DOCX_QUARTERLY,
                        ReportParserFileType.XLSX, PARSER_XLSX_QUARTERLY,
                        ReportParserFileType.XLS, PARSER_XLS_QUARTERLY,

                        ReportParserFileType.PYTHON, PARSER_PYTHON_QUARTERLY
                ));

        REPORT_PARSER_BEAN_MAP.put(ReportType.ANNUALLY,
                Map.of(ReportParserFileType.PDF, PARSER_PDF_ANNUALLY,
                        ReportParserFileType.DOC, PARSER_DOC_ANNUALLY,
                        ReportParserFileType.DOCX, PARSER_DOCX_ANNUALLY,
                        ReportParserFileType.XLSX, PARSER_XLSX_ANNUALLY,
                        ReportParserFileType.XLS, PARSER_XLS_ANNUALLY,

                        ReportParserFileType.PYTHON, PARSER_PYTHON_ANNUALLY
                ));
    }
}
