# -*- coding: utf-8 -*-
"""
@File    : config.py
@Date    : 2024-04-03
"""

COMPANY_INFO_KEY_MAP = {
    "股票名称": "stock_name",
    "股票代码": "stock_code",
    "最新价": "last_price",
    "涨跌额": "change_value",
    "涨跌幅": "change_rate",
    "所属行业": "industry",
    "今开": "open_price",
    "最高": "high_price",
    "平均价": "average_price",
    "市盈率": "pe_ratio",
    "成交量": "volume",
    "总市值": "total_market_value",
    "昨收": "prev_close_price",
    "最低": "low_price",
    "换手率": "turnover_rate",
    "市净率": "pb_ratio",
    "成交额": "turnover",
    "流通市值": "circular_market_value",
    "公司名称": "company_name",
    "公司网址": "company_website",
    "公司电话": "company_phone",
    "董秘": "company_secretary",
    "董秘Email": "company_secretary_email",
    "董秘电话": "company_secretary_phone",
    "法人": "legal_representative",
    "主办券商": "broker",
    "交易方式": "transaction_method",
    "挂牌日期": "listing_date",
    "成立日期": "establish_date",
    "做市日期": "making_date",
    "注册资本": "registered_capital",
    "所属地区": "area",
    "办公地址": "company_address",
    "公司简介": "company_introduction",
    "主营业务": "main_business",
    "经营范围": "business_scope",
    "融资状态": "financing_status",
    "实际募资净额": "financing_actual_net_amount",
    "融资成功率": "financing_success_rate",
    "融资排名": "financing_ranking",
    "股本": {
        'value': "equity",
        'children': {
            "总股本": "total_equity",
            "流通股本": "flow_equity",
            "股东户数": "shareholders_number",
            "统计日期": "date"
        }
    },
    "股东结构": {
        'value': "shareholder_list",
        'children': {
            "股东名称": "shareholder_name",
            "持股数": "shares_number",
            "持股比例": "shareholding_ratio"
        }
    },
    "高管介绍": {
        'value': "manager_list",
        'children': {
            "姓名": "name",
            "职位": "position",
            "最高学历": "highest_education",
            "任期开始日期": "term_start_date",
            "简介": "introduction"
        }
    },
    "新闻资讯": {
        'value': "news_list",
        'children': {
            "标题": "title",
            "摘要": "summary",
            "地址": "url",
            "来源": "source",
            "时间": "publish_time"
        }
    }
}

# 利润表
# ref:
# 财务实用英语词汇：利润表和资产负债表 https://zhuanlan.zhihu.com/p/34316347
INCOME_STATEMENT_KEY_MAP = {
    "利润表": "income_statement",
    "报告期": "report_date",
    "营业总收入": "total_sales_revenue",
    "营业收入": "sales_revenue",
    "营业总成本": "total_sales_cost",
    "营业成本": "sales_cost",
    "营业税金及附加": "additional_tax",
    "销售费用": "selling_expenses",
    "管理费用": "management_expenses",
    "财务费用": "financial_expenses",
    "资产减值损失": "asset_impairment_loss",
    "加:投资收益": "investment_income",
    "其中:对联营企业和合营企业的投资收益": "investment_income_from_associates_and_joint_ventures",
    "营业利润": "sales_profit",
    "加:营业外收入": "non_operating_income",
    "减:营业外支出": "non_operating_expenses",
    "其中:非流动资产处置净损失": "net_loss_from_disposal_of_non_current_assets",
    "利润总额": "total_profit",
    "减:所得税费用": "income_tax_expenses",
    "净利润": "net_profit",
    "归属于母公司股东的净利润": "net_profit_attributable_to_shareholders_of_the_parent_company",
    "综合收益总额": "total_comprehensive_income",
    "归属于母公司所有者的综合收益总额": "total_comprehensive_income_attributable_to_the_owners_of_the_parent_company",
    "基本每股收益": "basic_earnings_per_share",
    "公告日期": "publish_date"
}

# 资产负债表
# ref: https://zhuanlan.zhihu.com/p/34316347
# https://mp.weixin.qq.com/s/5gKV0I7TxgCapUacNaN0OQ
# https://mp.weixin.qq.com/s/aHWVOgtQd2dQzdIdvMe6vQ
# 干货分享收藏—财务术语中英文对照表 https://zhuanlan.zhihu.com/p/633517119
BALANCE_SHEET_KEY_MAP = {
    "资产负债表": "balance_sheet",
    "报告期": "report_date",
    "货币资金": "cash_and_bank",
    "应收票据": "notes_receivable",
    "应收账款": "accounts_receivable",
    "预付款项": "advance_payment",
    "其他应收款": "other_receivable",
    "存货": "inventory",
    "其他流动资产": "other_current_assets",
    "流动资产合计": "total_current_assets",
    "可供出售金融资产": "financial_assets_available_for_sale",
    "长期股权投资": "long_term_equity_investments",
    "投资性房地产": "investment_real_estate",
    "固定资产": "fixed_asset",
    "无形资产": "intangible_asset",
    "长期待摊费用": "long_term_deferred_expenses",
    "递延所得税资产": "deferred_income_tax_asset",
    "非流动资产合计": "non_current_asset",
    "资产总计": "total_assets",
    "应付票据": "notes_payable",
    "应付账款": "accounts_payable",
    "预收款项": "deposit_received",
    "应付职工薪酬": "salary_payable",
    "应交税费": "tax_payable",
    "应付股利": "dividend_payable",
    "其他应付款": "other_payable",
    "流动负债合计": "total_current_liabilities",
    "其他非流动负债": "other_non_current_liabilities",
    "非流动负债合计": "total_non_current_liabilities ",
    "负债合计": "total_liabilities",
    "实收资本(或股本)": "paid_in_capital",
    "资本公积": "capital_reserve",
    "盈余公积": "earned_surplus",
    "未分配利润": "undistributed_profit",
    "外币报表折算差额": "translation_difference_of_foreign_currency_statements",
    "归属于母公司股东权益合计": "total_equity_attributable_to_shareholders_of_the_parent_company",
    "股东权益合计": "total_equity",
    "负债和股东权益合计": "total_liabilities_and_shareholder_equity",
    "公告日期": "publish_date"
}

# 现金流量表
CASH_FLOWS_STATEMENT_KEY_MAP = {
    "现金流量表": "2022年报",
    "报告期": "2022-12-31",
    "销售商品、提供劳务收到的现金": "2.68亿",
    "收到的税费返还": "733.11万",
    "收到其他与经营活动有关的现金": "1,085.65万",
    "经营活动现金流入小计": "2.86亿",
    "购买商品、接受劳务支付的现金": "1.65亿",
    "支付给职工以及为职工支付的现金": "5,186.84万",
    "支付的各项税费": "564.16万",
    "支付其他与经营活动有关的现金": "688.15万",
    "经营活动现金流出小计": "2.29亿",
    "经营活动产生的现金流量净额": "5,675.70万",
    "收回投资收到的现金": "",
    "取得投资收益收到的现金": "2.07万",
    "处置固定资产、无形资产和其他长期资产收回的现金净额": "4,189.57万",
    "处置子公司及其他营业单位收到的现金净额": "",
    "收到其他与投资活动有关的现金": "1,000.00万",
    "投资活动现金流入小计": "5,191.64万",
    "购建固定资产、无形资产和其他长期资产支付的现金": "1.62亿",
    "投资活动现金流出小计": "1.73亿",
    "投资活动产生的现金流量净额": "-1.21亿",
    "筹资活动现金流入小计": "7,643.50万",
    "筹资活动现金流出小计": "1,068.14万",
    "汇率变动对现金的影响": "-5.71万",
    "现金及现金等价物净增加额": "138.34万",
    "期初现金及现金等价物余额": "5,092.93万",
    "期末现金及现金等价物余额": "5,231.27万",
    "净利润": "7,318.44万",
    "加: 资产减值准备": "123.86万",
    "固定资产折旧、油气资产折耗、生产性生物资产折旧": "1,668.24万",
    "无形资产摊销": "84.65万",
    "长期待摊费用摊销": "1.92万",
    "处置固定资产、无形资产和其他长期资产的损失": "-3,945.93万",
    "财务费用": "101.14万",
    "投资损失": "-2.07万",
    "递延所得税资产减少": "-11.12万",
    "存货的减少": "-442.89万",
    "经营性应收项目的减少": "-695.99万",
    "经营性应付项目的增加": "863.24万",
    "其他": "",
    "现金的期末余额": "5,231.27万",
    "减:现金的期初余额": "5,092.93万",
    "公告日期": "2022-12-31"
}

# 财务分析表
FINANCIAL_ANALYSIS_KEY_MAP = {
    "财务分析": "2022年报",
    "报告期": "2022-12-31",
    "每股收益-基本(元)": "0.56",
    "每股收益-稀释(元)": "0.56",
    "每股收益-扣除/基本(元)": "0.20",
    "每股收益-扣除/稀释(元)": "0.20",
    "每股净资产(元)": "2.99",
    "每股经营活动产生的现金流量净额(元)": "0.43",
    "每股收益-期末股本摊薄(元)": "0.56",
    "每股营业总收入(元)": "1.91",
    "每股营业收入(元)": "1.91",
    "每股息税前利润(元)": "0.60",
    "每股资本公积(元)": "0.63",
    "每股盈余公积(元)": "0.22",
    "每股未分配利润(元)": "1.14",
    "每股留存收益(元)": "1.36",
    "每股现金流量净额(元)": "0.01",
    "每股企业自由现金流量(元)": "-0.52",
    "每股股东自由现金流量(元)": "-0.00",
    "净资产收益率-摊薄(%)": "18.62",
    "净资产收益率-加权(%)": "20.53",
    "净资产收益率-扣除/摊薄(%)": "6.85",
    "净资产收益率-扣除/加权(%)": "7.55",
    "净资产收益率-年化(%)": "20.53",
    "总资产报酬率(%)": "18.41",
    "总资产报酬率-年化(%)": "18.41",
    "总资产净利率(%)": "16.93",
    "总资产净利率-年化(%)": "16.93",
    "投入资本回报率(%)": "18.49",
    "销售净利率(%)": "29.08",
    "销售毛利率(%)": "30.69",
    "销售成本率(%)": "69.31",
    "销售期间费用率(%)": "17.64",
    "净利润/营业总收入(%)": "29.08",
    "营业利润/营业总收入(%)": "28.77",
    "营业总成本/营业总收入(%)": "87.69",
    "营业费用/营业总收入(%)": "3.31",
    "管理费用/营业总收入(%)": "14.46",
    "财务费用/营业总收入(%)": "-0.14",
    "资产减值损失/营业总收入(%)": "-0.49",
    "经营活动净收益/利润总额(%)": "39.23",
    "价值变动净收益/利润总额(%)": "0.01",
    "营业外支出净额/利润总额(%)": "8.30",
    "所得税/利润总额(%)": "7.32",
    "扣除非经常性损益的净利润/净利润(%)": "36.78",
    "资产负债率(%)": "21.87",
    "权益乘数(%)": "1.28",
    "流动资产/总资产(%)": "34.32",
    "非流动资产/总资产(%)": "65.68",
    "有形资产/总资产(%)": "71.37",
    "归属母公司股东的权益/全部投入资本(%)": "83.70",
    "带息负债/全部投入资本(%)": "16.30",
    "流动负债/负债合计(%)": "49.13",
    "非流动负债/负债合计(%)": "50.87",
    "流动比率": "3.19",
    "速动比率": "2.32",
    "保守速动比率": "2.22",
    "产权比率": "0.28",
    "归属母公司股东的权益/负债合计": "3.57",
    "归属母公司股东的权益/带息债务": "5.14",
    "有形资产/负债合计": "3.26",
    "有形资产/带息债务": "4.69",
    "有形资产/净债务": "15.25",
    "息税折旧摊销前利润/负债合计": "0.88",
    "经营活动产生的现金流量净额/负债合计": "0.52",
    "经营活动产生的现金流量净额/带息债务": "0.74",
    "经营活动产生的现金流量净额/流动负债": "1.05",
    "经营活动产生的现金流量净额/净债务": "2.41",
    "已获利息倍数": "129.38",
    "长期债务与营运资金比率": "0.47",
    "营业周期(天)": "188.18",
    "存货周转天数(天)": "94.27",
    "应收账款周转天数(天)": "93.91",
    "存货周转率(次)": "3.82",
    "应收账款周转率(次)": "3.83",
    "流动资产周转率(次)": "1.50",
    "固定资产周转率(次)": "1.50",
    "总资产周转率(次)": "0.58",
    "营业总收入同比增长率(%)": "-4.41",
    "营业收入同比增长率(%)": "-4.41",
    "销售商品提供劳务收到的现金/营业收入(%)": "106.33",
    "经营活动产生的现金流量净额/营业收入(%)": "22.55",
    "经营活动产生的现金流量净额/经营活动净收益(%)": "183.22",
    "资本支出/折旧摊销(%)": "922.48"
}
