package com.smppw.modaq.application.components.report.parser;

import cn.hutool.core.map.MapUtil;
import com.smppw.modaq.common.enums.ReportParserFileType;
import com.smppw.modaq.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_AI_OTHER = "report-parser:ai:other";

    // 周报
    public static final String PARSER_AI_WEEKLY = "report-parser:ai:weekly";

    // 交易流水确认函解析
    public static final String PARSER_PDF_LETTER = "report-parser:pdf:letter";
    public static final String PARSER_AI_LETTER = "report-parser:ai:letter";

    public static final String PARSER_PDF_MONTHLY = "report-parser:pdf:monthly";
    public static final String PARSER_EXCEL_MONTHLY = "report-parser:excel:monthly";
    public static final String PARSER_AI_MONTHLY = "report-parser:ai:monthly";

    public static final String PARSER_PDF_QUARTERLY = "report-parser:pdf:quarterly";
    public static final String PARSER_EXCEL_QUARTERLY = "report-parser:excel:quarterly";
    public static final String PARSER_AI_QUARTERLY = "report-parser:ai:quarterly";

    public static final String PARSER_PDF_ANNUALLY = "report-parser:pdf:annually";
    public static final String PARSER_EXCEL_ANNUALLY = "report-parser:excel:annually";
    public static final String PARSER_AI_ANNUALLY = "report-parser:ai:annually";

    static {
        // 其他报告解析
        REPORT_PARSER_BEAN_MAP.put(ReportType.OTHER,
                Map.of(
                        ReportParserFileType.AI, PARSER_AI_OTHER,
                        ReportParserFileType.IMG, PARSER_AI_OTHER,
                        ReportParserFileType.WORD, PARSER_AI_OTHER
                )
        );

        // 周报
        REPORT_PARSER_BEAN_MAP.put(ReportType.WEEKLY,
                Map.of(
                        ReportParserFileType.AI, PARSER_AI_WEEKLY,
                        ReportParserFileType.IMG, PARSER_AI_WEEKLY,
                        ReportParserFileType.WORD, PARSER_AI_WEEKLY
                )
        );

        // 交易流水确认函解析
        REPORT_PARSER_BEAN_MAP.put(ReportType.LETTER,
                Map.of(
                        ReportParserFileType.PDF, PARSER_PDF_LETTER,
                        ReportParserFileType.AI, PARSER_AI_LETTER
                ));

        // 月度报告
        REPORT_PARSER_BEAN_MAP.put(ReportType.MONTHLY,
                Map.of(
                        ReportParserFileType.PDF, PARSER_PDF_MONTHLY,
//                        ReportParserFileType.EXCEL, PARSER_EXCEL_MONTHLY,
                        ReportParserFileType.AI, PARSER_AI_MONTHLY,
                        ReportParserFileType.IMG, PARSER_AI_MONTHLY,
                        ReportParserFileType.WORD, PARSER_AI_MONTHLY
                ));

        // 季度报告
        REPORT_PARSER_BEAN_MAP.put(ReportType.QUARTERLY,
                Map.of(
                        ReportParserFileType.PDF, PARSER_PDF_QUARTERLY,
//                        ReportParserFileType.EXCEL, PARSER_EXCEL_QUARTERLY,
                        ReportParserFileType.AI, PARSER_AI_QUARTERLY,
                        ReportParserFileType.WORD, PARSER_AI_QUARTERLY
                ));

        // 年度报告
        REPORT_PARSER_BEAN_MAP.put(ReportType.ANNUALLY,
                Map.of(
                        ReportParserFileType.PDF, PARSER_PDF_ANNUALLY,
//                        ReportParserFileType.EXCEL, PARSER_EXCEL_ANNUALLY,
                        ReportParserFileType.AI, PARSER_AI_ANNUALLY,
                        ReportParserFileType.WORD, PARSER_AI_ANNUALLY
                ));
    }
}
