package com.gxwebsoft.ai.constants;

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

/**
 * 支出情况表常量类
 */
public class AuditContent1ExpenseConstants {
    
    // 支出类型分类
    public static final String EXPENSE_TYPE_RECEPTION = "公务接待";
    public static final String EXPENSE_TYPE_OVERSEAS = "出国";
    public static final String EXPENSE_TYPE_VEHICLE = "公车运行维护";
    public static final String EXPENSE_TYPE_MEETING = "会议培训费";
    
    // 年度范围 - 根据知识库动态确定，这里提供默认起始年份
    public static final int DEFAULT_START_YEAR = 2020;
    public static final int DEFAULT_END_YEAR = 2023;
    
    // 分类描述
    public static final Map<String, String> EXPENSE_DESCRIPTIONS = new HashMap<>();
    static {
        EXPENSE_DESCRIPTIONS.put(EXPENSE_TYPE_RECEPTION, "公务接待费用支出情况");
        EXPENSE_DESCRIPTIONS.put(EXPENSE_TYPE_OVERSEAS, "出国（出境）费用支出情况");
        EXPENSE_DESCRIPTIONS.put(EXPENSE_TYPE_VEHICLE, "公车运行维护费用支出情况");
        EXPENSE_DESCRIPTIONS.put(EXPENSE_TYPE_MEETING, "会议、培训费用支出情况");
    }
    
    // 数据格式要求 - 简化版
    public static final String DATA_FORMAT_REQUIREMENT = 
        "请严格按照以下JSON格式生成数据，每类支出每个年度至少1条记录，总共至少16条记录：\n" +
        "[\n" +
        "  {\n" +
        "    \"expenseType\": \"公务接待/出国/公车运行维护/会议培训费\",\n" +
        "    \"year\": \"具体年份（根据知识库中的连续四个完整年度）\",\n" +
        "    \"finalStatementAmount\": \"决算报表数\",\n" +
        "    \"initialBudgetAmount\": \"年初预算数\",\n" +
        "    \"changePercentage\": \"增减百分比\",\n" +
        "    \"budgetRatio\": \"占年初预算比例\",\n" +
        "    \"remark\": \"备注信息\",\n" +
        "    \"dataSource\": \"数据来源文件\",\n" +
//        "    \"workPaperIndex\": [\"FileId1\", \"FileId2\"]\n" +
        "    \"workPaperIndex\": [\"实际存在的完整文件名1||FileUrl1\", \"实际存在的完整文件名2||FileUrl2\"]\n" +
        "  }\n" +
        "]";
    
    // 关键词权重 - 增强工程类排除
    public static final Map<String, Integer> KEYWORD_WEIGHTS = new HashMap<>();
    static {
        // 高优先级：直接支出关键词
        KEYWORD_WEIGHTS.put("公务接待", 15);
        KEYWORD_WEIGHTS.put("出国", 15);
        KEYWORD_WEIGHTS.put("公车运行维护", 15);
        KEYWORD_WEIGHTS.put("会议培训费", 15);
        KEYWORD_WEIGHTS.put("三公经费", 14);
        KEYWORD_WEIGHTS.put("接待费", 13);
        KEYWORD_WEIGHTS.put("差旅费", 12);
        KEYWORD_WEIGHTS.put("车辆费", 12);
        KEYWORD_WEIGHTS.put("会务费", 12);
        KEYWORD_WEIGHTS.put("培训费", 12);
        
        // 中优先级：财务文档
        KEYWORD_WEIGHTS.put("决算报表", 10);
        KEYWORD_WEIGHTS.put("预算报表", 10);
        KEYWORD_WEIGHTS.put("财务报表", 9);
        KEYWORD_WEIGHTS.put("部门决算", 9);
        KEYWORD_WEIGHTS.put("部门预算", 9);
        KEYWORD_WEIGHTS.put("预算执行", 8);
        
        // 年份关键词（中等优先级，用于识别年度）
        KEYWORD_WEIGHTS.put("年度", 7);
        KEYWORD_WEIGHTS.put("年报表", 7);
        KEYWORD_WEIGHTS.put("年度决算", 8);
        KEYWORD_WEIGHTS.put("年度预算", 8);
        
        // 低优先级：通用财务
        KEYWORD_WEIGHTS.put("支出", 7);
        KEYWORD_WEIGHTS.put("费用", 6);
        KEYWORD_WEIGHTS.put("年度报告", 6);
        
        // 排除工程类（负权重）
        KEYWORD_WEIGHTS.put("工程造价", -20);
        KEYWORD_WEIGHTS.put("概预算", -20);
        KEYWORD_WEIGHTS.put("工程款", -15);
        KEYWORD_WEIGHTS.put("施工", -15);
        KEYWORD_WEIGHTS.put("项目投资", -15);
        KEYWORD_WEIGHTS.put("基建", -15);
    }
    
    // 需要排除的工程类关键词
    public static final String[] ENGINEERING_EXCLUDE_KEYWORDS = {
        "工程造价", "概预算", "工程概算", "工程预算", "工程结算",
        "施工合同", "工程款", "项目投资", "基建", "工程项目"
    };
    
    // 年份正则表达式，用于从知识库中提取年份
    public static final String YEAR_PATTERN = "20\\d{2}";
    
    // 最近几年范围（用于查询构建）
    public static final int RECENT_YEARS_COUNT = 4;
    
    private AuditContent1ExpenseConstants() {
        // 防止实例化
    }
}