guarantee-admin-api-v0.2/Modules/Company/CompanyObject.py

837 lines
52 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from Utils.ObjUtil import SpecObject
from Utils.ValidateUtil import ValidateAttr, Validate
TOKEN = "uzdq51N4!I0%HY4sCaQ!aeCSIDIVIdAM"
class BasicBusinessInfo(SpecObject):
"""工商信息"""
class ShareholderInformation(SpecObject):
"""股东信息"""
name = ValidateAttr(field="name", type=str)
ratio = ValidateAttr(field="ratio", type=[str, int, float], default=None)
nature = ValidateAttr(field="nature", type=str, default=None)
quantity = ValidateAttr(field="quantity", type=[int, float, str], default=None)
fields_map = {
"name": "股东名称",
"ratio": "持股比例",
"nature": "股东性质",
"quantity": "持股数量(股)"
}
class ExecutiveInformation(SpecObject):
"""高管信息"""
name = ValidateAttr(field="name", type=str)
position = ValidateAttr(field="position", type=str, default=None)
education = ValidateAttr(field="education", type=str, default=None)
birth_data = ValidateAttr(field="birth_data", type=str, default=None)
political_status = ValidateAttr(field="political_status", type=str, default=None)
industry_experience = ValidateAttr(field="industry_experience", type=[str, float, int], default=None)
fields_map = {
"name": "姓名",
"position": "职务",
"education": "学历",
"birth_data": "出生日期",
"political_status": "政治面貌",
"industry_experience": "行业经验"
}
class EmployeeEducation(SpecObject):
"""员工学历"""
college_degree = ValidateAttr(field='college_degree', type=int)
bachelor_degree = ValidateAttr(field='bachelor_degree', type=int)
postgraduate_degree = ValidateAttr(field='postgraduate_degree', type=int)
fields_map = {
"college_degree": "大专及以下",
"bachelor_degree": "本科",
"postgraduate_degree": "研究生"
}
cid = ValidateAttr(field="cid", type=str)
company_name = ValidateAttr(field="company_name", type=str)
enterprise_abbreviation = ValidateAttr(field="enterprise_abbreviation", type=str, default=None)
type_of_enterprise = ValidateAttr(field="type_of_enterprise", type=str, default=None)
nature_of_enterprise = ValidateAttr(field="nature_of_enterprise", type=str, default=None)
warranty_type = ValidateAttr(field="warranty_type", type=str, default=None)
unified_social_credit_code = ValidateAttr(field="unified_social_credit_code", type=str, default=None)
organization_code = ValidateAttr(field="organization_code", type=str, default=None)
date_of_establishment = ValidateAttr(field="date_of_establishment", type=str, default=None)
registered_capital = ValidateAttr(field="registered_capital", type=[float, int], default=None)
paid_in_capital = ValidateAttr(field="paid_in_capital", type=[float, int], default=None)
business_scope = ValidateAttr(field="business_scope", type=str, default=None)
province = ValidateAttr(field="province", type=str, default=None)
city = ValidateAttr(field="city", type=str, default=None)
registered_address = ValidateAttr(field="registered_address", type=str, default=None)
contact_address = ValidateAttr(field="contact_address", type=str, default=None)
e_mail = ValidateAttr(field="e_mail", type=str, default=None)
contact_number = ValidateAttr(field="contact_number", type=str, default=None)
number_of_participants = ValidateAttr(field="number_of_participants", type=int, default=None)
number_of_employees = ValidateAttr(field="number_of_employees", type=int, default=None)
company_positioning = ValidateAttr(field="company_positioning", type=str, default=None)
legal_representative = ValidateAttr(field="legal_representative", type=str, default=None)
the_actual_controller = ValidateAttr(field="the_actual_controller", type=str, default=None)
shareholder_information = ValidateAttr(field="shareholder_information", instance_list=ShareholderInformation)
executive_information = ValidateAttr(field="executive_information", instance_list=ExecutiveInformation)
employee_education = ValidateAttr(field="employee_education", type=EmployeeEducation)
fields_map = {
"cid": "企业ID",
"company_name": "企业名称",
"enterprise_abbreviation": "企业简称",
"type_of_enterprise": "企业类型",
"nature_of_enterprise": "企业性质",
"warranty_type": "担保类型",
"unified_social_credit_code": "统一社会信用代码",
"organization_code": "组织代码",
"date_of_establishment": "成立日期",
"registered_capital": "注册资本(万元)",
"paid_in_capital": "实缴资本(万元)",
"business_scope": "经营范围",
"province": "所在省份",
"city": "所在城市",
"registered_address": "注册地址",
"contact_address": "通信地址",
"e_mail": "电子邮箱",
"contact_number": "联系电话",
"number_of_participants": "参保人数",
"number_of_employees": "从业人员总数",
"company_positioning": "公司定位",
"legal_representative": "法定代表人",
"the_actual_controller": "实际控制人",
"shareholder_information": "股东信息",
"executive_information": "高管信息",
"employee_education": "员工学历",
}
class CompanyOverviewInfo(SpecObject):
"""公司概览信息"""
cid = ValidateAttr(field="cid", type=str)
company_name = ValidateAttr(field="company_name", type=str)
credit_level = ValidateAttr(field="credit_level", type=str, default=None)
rating_date = ValidateAttr(field="rating_date", default=None)
province = ValidateAttr(field="province", type=str)
city = ValidateAttr(field="city", type=str)
label = ValidateAttr(field="label", type=list)
update_time = ValidateAttr(field="update_time", func=Validate.date_format)
fields_map = {
"cid": "企业ID",
"company_name": "企业名称",
"credit_level": "信用评级",
"rating_date": "评级日期",
"province": "所在省份",
"city": "所在城市",
"label": "公司标签",
"update_time": "更新时间"
}
class FinancialData(SpecObject):
"""财务数据"""
class BalanceSheet(SpecObject):
"""资产负债表"""
class CurrentAssets(SpecObject):
"""流动资产"""
money_funds = ValidateAttr(field="money_funds", type=[float, int], default=None)
deposit_margin = ValidateAttr(field="deposit_margin", type=[float, int], default=None)
trading_financial_assets = ValidateAttr(field="trading_financial_assets", type=[float, int], default=None)
bills_receivable = ValidateAttr(field="bills_receivable", type=[float, int], default=None)
accounts_receivable = ValidateAttr(field="accounts_receivable", type=[float, int], default=None)
prepayment = ValidateAttr(field="prepayment", type=[float, int], default=None)
dividends_receivable = ValidateAttr(field="dividends_receivable", type=[float, int], default=None)
interest_receivable = ValidateAttr(field="interest_receivable", type=[float, int], default=None)
reimbursement_receivable = ValidateAttr(field="reimbursement_receivable", type=[float, int], default=None)
other_receivables = ValidateAttr(field="other_receivables", type=[float, int], default=None)
internal_dealings = ValidateAttr(field="internal_dealings", type=[float, int], default=None)
stock = ValidateAttr(field="stock", type=[float, int], default=None)
entrusted_loan = ValidateAttr(field="entrusted_loan", type=[float, int], default=None)
loan = ValidateAttr(field="loan", type=[float, int], default=None)
non_current_assets_due_within_one_year = ValidateAttr(field="non_current_assets_due_within_one_year",
type=[float, int], default=None)
other_current_assets = ValidateAttr(field="other_current_assets", type=[float, int], default=None)
total_current_assets = ValidateAttr(field="total_current_assets", type=[float, int], default=None)
fields_map = {
"money_funds": "货币资金",
"deposit_margin": "存出保证金",
"trading_financial_assets": "交易性金融资产",
"bills_receivable": "应收票据",
"accounts_receivable": "应收账款",
"prepayment": "预付款项",
"dividends_receivable": "应收股利",
"interest_receivable": "应收利息",
"reimbursement_receivable": "应收代偿款",
"other_receivables": "其他应收款",
"internal_dealings": "内部往来",
"stock": "存货",
"entrusted_loan": "委托贷款",
"loan": "贷款",
"non_current_assets_due_within_one_year": "一年内到期的非流动资产",
"other_current_assets": "其他流动资产",
"total_current_assets": "流动资产合计"
}
class NonCurrentAssets(SpecObject):
"""非流动资产"""
available_for_sale_financial_assets = ValidateAttr(field="available_for_sale_financial_assets",
type=[float, int], default=None),
held_to_maturity_investments = ValidateAttr(field="held_to_maturity_investments", type=[float, int],
default=None),
long_term_receivables = ValidateAttr(field="long_term_receivables", type=[float, int], default=None),
long_term_equity_investment = ValidateAttr(field="long_term_equity_investment", type=[float, int],
default=None),
investment_real_estate = ValidateAttr(field="investment_real_estate", type=[float, int], default=None),
fixed_assets = ValidateAttr(field="fixed_assets", type=[float, int], default=None),
construction_in_progress = ValidateAttr(field="construction_in_progress", type=[float, int], default=None),
engineer_material = ValidateAttr(field="engineer_material", type=[float, int], default=None),
foreclosed_assets = ValidateAttr(field="foreclosed_assets", type=[float, int], default=None),
fixed_assets_clearing = ValidateAttr(field="fixed_assets_clearing", type=[float, int], default=None),
intangible_assets = ValidateAttr(field="intangible_assets", type=[float, int], default=None),
development_expenditure = ValidateAttr(field="development_expenditure", type=[float, int], default=None),
goodwill = ValidateAttr(field="goodwill", type=[float, int], default=None),
long_term_prepaid_expenses = ValidateAttr(field="long_term_prepaid_expenses", type=[float, int],
default=None),
deferred_tax_assets = ValidateAttr(field="deferred_tax_assets", type=[float, int], default=None),
other_non_current_assets = ValidateAttr(field="other_non_current_assets", type=[float, int], default=None),
total_non_current_assets = ValidateAttr(field="total_non_current_assets", type=[float, int], default=None),
fields_map = {
"available_for_sale_financial_assets": "可供出售金融资产",
"held_to_maturity_investments": "持有至到期投资",
"long_term_receivables": "长期应收款",
"long_term_equity_investment": "长期股权投资",
"investment_real_estate": "投资性房地产",
"fixed_assets": "固定资产",
"construction_in_progress": "在建工程",
"engineer_material": "工程物资",
"foreclosed_assets": "抵债资产",
"fixed_assets_clearing": "固定资产清理",
"intangible_assets": "无形资产",
"development_expenditure": "开发支出",
"goodwill": "商誉",
"long_term_prepaid_expenses": "长期待摊费用",
"deferred_tax_assets": "递延所得税资产",
"other_non_current_assets": "其他非流动资产",
"total_non_current_assets": "非流动资产合计"
}
class CurrentLiabilities(SpecObject):
"""流动负债"""
short_term_loan = ValidateAttr(field="short_term_loan", type=[float, int], default=None),
deposit_margin = ValidateAttr(field="deposit_margin", type=[float, int], default=None),
trading_financial_liabilities = ValidateAttr(field="trading_financial_liabilities", type=[float, int],
default=None),
bill_receivable = ValidateAttr(field="bill_receivable", type=[float, int], default=None),
accounts_payable = ValidateAttr(field="accounts_payable", type=[float, int], default=None),
prepayments = ValidateAttr(field="prepayments", type=[float, int], default=None),
employee_compensation_payable = ValidateAttr(field="employee_compensation_payable", type=[float, int],
default=None),
taxes_payable = ValidateAttr(field="taxes_payable", type=[float, int], default=None),
interest_payable = ValidateAttr(field="interest_payable", type=[float, int], default=None),
dividends_payable = ValidateAttr(field="dividends_payable", type=[float, int], default=None),
other_payables = ValidateAttr(field="other_payables", type=[float, int], default=None),
non_current_liabilities_due_within_one_year = ValidateAttr(
field="non_current_liabilities_due_within_one_year", type=[float, int], default=None),
other_current_liabilities = ValidateAttr(field="other_current_liabilities", type=[float, int],
default=None),
total_current_liabilities = ValidateAttr(field="total_current_liabilities", type=[float, int], default=None)
fields_map = {
"short_term_loan": "短期借款",
"deposit_margin": "存入保证金",
"trading_financial_liabilities": "交易性金融负债",
"bill_receivable": "应付票据",
"accounts_payable": "应付账款",
"prepayments": "预收款项",
"employee_compensation_payable": "应付职工薪酬",
"taxes_payable": "应交税费",
"interest_payable": "应付利息",
"dividends_payable": "应付股利",
"other_payables": "其他应付款",
"non_current_liabilities_due_within_one_year": "一年内到期的非流动负债",
"other_current_liabilities": "其他流动负债",
"total_current_liabilities": "流动负债合计"
}
class NonCurrentLiabilities(SpecObject):
"""非流动负债"""
long_term_loan = ValidateAttr(field="long_term_loan", type=[float, int], default=None),
bonds_payable = ValidateAttr(field="bonds_payable", type=[float, int], default=None),
long_term_payables = ValidateAttr(field="long_term_payables", type=[float, int], default=None),
long_term_employee_compensation_payable = ValidateAttr(field="long_term_employee_compensation_payable",
type=[float, int], default=None),
special_payables = ValidateAttr(field="special_payables", type=[float, int], default=None),
unexpired_liability_reserve = ValidateAttr(field="unexpired_liability_reserve", type=[float, int],
default=None),
guarantee_compensation_reserve = ValidateAttr(field="guarantee_compensation_reserve", type=[float, int],
default=None),
expected_liabilities = ValidateAttr(field="expected_liabilities", type=[float, int], default=None),
deferred_income = ValidateAttr(field="deferred_income", type=[float, int], default=None),
deferred_tax_liabilities = ValidateAttr(field="deferred_tax_liabilities", type=[float, int], default=None),
other_non_current_liabilities = ValidateAttr(field="other_non_current_liabilities", type=[float, int],
default=None),
total_non_current_liabilities = ValidateAttr(field="total_non_current_liabilities", type=[float, int],
default=None)
fields_map = {
"long_term_loan": "长期借款",
"bonds_payable": "应付债券",
"long_term_payables": "长期应付款",
"long_term_employee_compensation_payable": "长期应付职工薪酬",
"special_payables": "专项应付款",
"unexpired_liability_reserve": "未到期责任准备金",
"guarantee_compensation_reserve": "担保赔偿准备金",
"expected_liabilities": "预计负债",
"deferred_income": "递延收益",
"deferred_tax_liabilities": "递延所得税负债",
"other_non_current_liabilities": "其他非流动负债",
"total_non_current_liabilities": "非流动负债合计",
}
class OwnerEquity(SpecObject):
"""所有者权益"""
paid_in_capital = ValidateAttr(field="paid_in_capital", type=[float, int], default=None),
capital_reserve = ValidateAttr(field="capital_reserve", type=[float, int], default=None),
treasury_stock = ValidateAttr(field="treasury_stock", type=[float, int], default=None),
general_risk_reserve = ValidateAttr(field="general_risk_reserve", type=[float, int], default=None),
surplus_reserve = ValidateAttr(field="surplus_reserve", type=[float, int], default=None),
undistributed_profit = ValidateAttr(field="undistributed_profit", type=[float, int], default=None),
total_owner_equity_attributable = ValidateAttr(field="total_owner_equity_attributable", type=[float, int],
default=None),
minority_shareholders_equity = ValidateAttr(field="minority_shareholders_equity", type=[float, int],
default=None),
total_owner_equity = ValidateAttr(field="total_owner_equity", type=[float, int], default=None),
total_liabilities_owner_equity = ValidateAttr(field="total_liabilities_owner_equity", type=[float, int],
default=None)
fields_map = {
"paid_in_capital": "实收资本(股本)",
"capital_reserve": "资本公积",
"treasury_stock": "减:库存股",
"general_risk_reserve": "一般风险准备金",
"surplus_reserve": "盈余公积",
"undistributed_profit": "未分配利润",
"total_owner_equity_attributable": "归属于母公司所有者权益合计",
"minority_shareholders'_equity": "少数股东权益",
"total_owner_equity": "所有者权益合计",
"total_liabilities_owner_equity": "负债和所有者权益总计"
}
current_assets = ValidateAttr(field="current_assets", type=CurrentAssets)
non_current_assets = ValidateAttr(field="non_current_assets", type=NonCurrentAssets)
total_assets = ValidateAttr(field="total_assets", type=[float, int], default=None),
current_liabilities = ValidateAttr(field="current_liabilities", type=CurrentLiabilities)
non_current_liabilities = ValidateAttr(field="non_current_liabilities", type=NonCurrentLiabilities)
total_liabilities = ValidateAttr(field="total_liabilities", type=[float, int], default=None),
owner_equity = ValidateAttr(field="owner_equity", type=OwnerEquity)
fields_map = {
"current_assets": "流动资产",
"non_current_assets": "非流动资产",
"total_assets": "资产总计",
"current_liabilities": "流动负债",
"non_current_liabilities": "非流动负债",
"total_liabilities": "负债合计",
"owner_equity": "所有者权益"
}
class IncomeSheet(SpecObject):
"""利润表"""
total_profit = ValidateAttr(field="total_profit", type=[float, int], default=None)
income_tax_expense = ValidateAttr(field="income_tax_expense", type=[float, int], default=None)
total_operating_cost = ValidateAttr(field="total_operating_cost", type=[float, int], default=None)
main_business_cost = ValidateAttr(field="main_business_cost", type=[float, int], default=None)
guarantee_compensation_reserve = ValidateAttr(field="guarantee_compensation_reserve", type=[float, int],
default=None)
guarantee_compensation_expenses = ValidateAttr(field="guarantee_compensation_expenses", type=[float, int],
default=None)
category_guarantee = ValidateAttr(field="category_guarantee", type=[float, int], default=None)
entrusted_loan = ValidateAttr(field="entrusted_loan", type=[float, int], default=None)
other_business_expenses = ValidateAttr(field="other_business_expenses", type=[float, int], default=None)
taxes_and_surcharges = ValidateAttr(field="taxes_and_surcharges", type=[float, int], default=None)
sales_expense = ValidateAttr(field="sales_expense", type=[float, int], default=None)
business_administrative_expenses = ValidateAttr(field="business_administrative_expenses", type=[float, int],
default=None)
finance_charge = ValidateAttr(field="finance_charge", type=[float, int], default=None)
interest_expense = ValidateAttr(field="interest_expense", type=[float, int], default=None)
interest_income = ValidateAttr(field="interest_income", type=[float, int], default=None)
asset_impairment_loss = ValidateAttr(field="asset_impairment_loss", type=[float, int], default=None)
fair_value_change_income = ValidateAttr(field="fair_value_change_income", type=[float, int], default=None)
investment_income = ValidateAttr(field="investment_income", type=[float, int], default=None)
investment_income_in_associate_joint_ventures = ValidateAttr(
field="investment_income_in_associate_joint_ventures", type=[float, int], default=None)
other_income = ValidateAttr(field="other_income", type=[float, int], default=None)
operating_profit = ValidateAttr(field="operating_profit", type=[float, int], default=None)
add_non_operating_income = ValidateAttr(field="add_non_operating_income", type=[float, int], default=None)
gain_on_disposal_of_non_current_assets = ValidateAttr(field="gain_on_disposal_of_non_current_assets",
type=[float, int], default=None)
non_monetary_asset_exchange_gains = ValidateAttr(field="non_monetary_asset_exchange_gains", type=[float, int],
default=None)
debt_restructuring_gains = ValidateAttr(field="debt_restructuring_gains", type=[float, int], default=None)
government_grant = ValidateAttr(field="government_grant", type=[float, int], default=None)
non_operating_expenses = ValidateAttr(field="non_operating_expenses", type=[float, int], default=None)
loss_on_disposal_of_non_current_assets = ValidateAttr(field="loss_on_disposal_of_non_current_assets",
type=[float, int], default=None)
non_monetary_asset_exchange_loss = ValidateAttr(field="non_monetary_asset_exchange_loss", type=[float, int],
default=None)
debt_restructuring_loss = ValidateAttr(field="debt_restructuring_loss", type=[float, int], default=None)
net_profit = ValidateAttr(field="net_profit", type=[float, int], default=None)
profit_attributable = ValidateAttr(field="profit_attributable", type=[float, int], default=None)
minority_shareholders = ValidateAttr(field="minority_shareholders", type=[float, int], default=None)
total_operating_income = ValidateAttr(field="total_operating_income", type=[float, int], default=None)
main_business_income = ValidateAttr(field="main_business_income", type=[float, int], default=None)
guarantee_fee_income = ValidateAttr(field="guarantee_fee_income", type=[float, int], default=None)
entrusted_loan_interest_income = ValidateAttr(field="entrusted_loan_interest_income", type=[float, int],
default=None)
loan_interest_income = ValidateAttr(field="loan_interest_income", type=[float, int], default=None)
withdraw_unexpired_liability_reserve = ValidateAttr(field="withdraw_unexpired_liability_reserve",
type=[float, int], default=None)
other_business_income = ValidateAttr(field="other_business_income", type=[float, int], default=None)
fields_map = {
"total_profit": "利润总额",
"income_tax_expense": "所得税费用",
"total_operating_cost": "营业总成本",
"main_business_cost": "主营业务成本",
"guarantee_compensation_reserve": "提取担保赔偿准备金",
"guarantee_compensation_expenses": "担保赔偿支出",
"category_guarantee": "分出担保费",
"entrusted_loan": "委托贷款手续费",
"other_business_expenses": "其他业务支出",
"taxes_and_surcharges": "税金及附加",
"sales_expense": "销售费用",
"business_administrative_expenses": "业务及管理费用",
"finance_charge": "财务费用",
"interest_expense": "利息支出",
"interest_income": "利息收入",
"asset_impairment_loss": "资产减值损失",
"fair_value_change_income": "公允价值变动收益",
"investment_income": "投资收益",
"investment_income_in_associate_joint_ventures": "对联营企业和合营企业的投资收益",
"other_income": "其他收益",
"operating_profit": "营业利润",
"add_non_operating_income": "营业外收入",
"gain_on_disposal_of_non_current_assets": "非流动资产处置利得",
"non_monetary_asset_exchange_gains": "非货币性资产交换利得",
"debt_restructuring_gains": "债务重组利得",
"government_grant": "政府补助",
"non_operating_expenses": "营业外支出",
"loss_on_disposal_of_non_current_assets": "非流动资产处置损失",
"non_monetary_asset_exchange_loss": "非货币性资产交换损失",
"debt_restructuring_loss": "债务重组损失",
"net_profit": "净利润",
"profit_attributable": "归属于母公司所有者的利润",
"minority_shareholders": "少数股东损益",
"total_operating_income": "营业总收入",
"main_business_income": "主营业务收入",
"guarantee_fee_income": "担保费收入",
"entrusted_loan_interest_income": "委贷利息收入",
"loan_interest_income": "贷款利息收入",
"withdraw_unexpired_liability_reserve": "提取未到期责任准备金",
"other_business_income": "其他业务收入"
}
class AppendixSheet(SpecObject):
"""补充数据表"""
current_compensation_amount = ValidateAttr(field="current_compensation_amount", type=[float, int], default=None)
current_compensation_recycle_amount = ValidateAttr(field="current_compensation_recycle_amount",
type=[float, int], default=None)
guarantee_liability = ValidateAttr(field="guarantee_liability", type=[float, int], default=None)
accumulated_compensation_amount = ValidateAttr(field="accumulated_compensation_amount", type=[float, int],
default=None)
cumulative_compensation_recovery_amount = ValidateAttr(field="cumulative_compensation_recovery_amount",
type=[float, int], default=None)
cumulative_amount = ValidateAttr(field="cumulative_amount", type=[float, int], default=None)
largest_financing = ValidateAttr(field="largest_financing", type=[float, int], default=None)
financing_guarantee_liabilities = ValidateAttr(field="financing_guarantee_liabilities", type=[float, int],
default=None)
financial_guarantee_responsibility_balance = ValidateAttr(field="financial_guarantee_responsibility_balance",
type=[float, int], default=None)
risk_weighted_assets = ValidateAttr(field="risk_weighted_assets", type=[float, int], default=None)
guaranteed_risk_reserve_balance = ValidateAttr(field="guaranteed_risk_reserve_balance", type=[float, int],
default=None)
top_five_financing_guarantee_liabilities = ValidateAttr(field="top_five_financing_guarantee_liabilities",
type=[float, int], default=None)
maximum_enterprise_financing_guarantee = ValidateAttr(field="maximum_enterprise_financing_guarantee",
type=[float, int], default=None)
guarantee_compensation_reserve = ValidateAttr(field="guarantee_compensation_reserve", type=[float, int],
default=None)
unexpired_liability_reserve = ValidateAttr(field="unexpired_liability_reserve", type=[float, int], default=None)
counter_guarantee_amount = ValidateAttr(field="counter_guarantee_amount", type=[float, int], default=None)
deposit_margin = ValidateAttr(field="deposit_margin", type=[float, int], default=None)
save_margin = ValidateAttr(field="save_margin", type=[float, int], default=None)
guarantee_business_income = ValidateAttr(field="guarantee_business_income", type=[float, int], default=None)
guaranteed_balance = ValidateAttr(field="guaranteed_balance", type=[float, int], default=None)
one_assets = ValidateAttr(field="one_assets", type=[float, int], default=None)
two_assets = ValidateAttr(field="two_assets", type=[float, int], default=None)
three_assets = ValidateAttr(field="three_assets", type=[float, int], default=None)
fields_map = {
"current_compensation_amount": "当期代偿金额",
"current_compensation_recycle_amount": "当期代偿回收金额",
"guarantee_liability": "当期解除担保责任余额",
"accumulated_compensation_amount": "近三年累计代偿金额",
"cumulative_compensation_recovery_amount": "近三年累计代偿回收金额",
"cumulative_amount": "近三年累计解除担保责任金额",
"largest_financing": "最大单一行业融资担保责任余额",
"financing_guarantee_liabilities": "当期新增融资担保责任余额",
"financial_guarantee_responsibility_balance": "融资担保责任余额",
"risk_weighted_assets": "风险加权资产",
"guaranteed_risk_reserve_balance": "担保风险准备金余额",
"top_five_financing_guarantee_liabilities": "前五大被担保企业融资担保责任余额",
"maximum_enterprise_financing_guarantee": "最大被担保企业融资担保责任余额",
"guarantee_compensation_reserve": "担保赔偿准备金",
"unexpired_liability_reserve": "未到期责任准备金",
"counter_guarantee_amount": "反担保金额",
"deposit_margin": "存入保证金",
"save_margin": "存出保证金",
"guaranteed_balance": "担保在保余额",
"guarantee_business_income": "担保业务收入",
"one_assets": "I类资产",
"two_assets": "II类资产",
"three_assets": "III类资产"
}
class FinancialIndicator(SpecObject):
"""财务指标"""
guaranteed_insured_balance_growth_rate = ValidateAttr(field="guaranteed_insured_balance_growth_rate",
type=[float, int], default=None)
guaranteed_revenue_growth_rate = ValidateAttr(field="guaranteed_revenue_growth_rate", type=[float, int],
default=None)
growth_rate_of_total_assets = ValidateAttr(field="growth_rate_of_total_assets", type=[float, int], default=None)
cash_assets_ratio = ValidateAttr(field="cash_assets_ratio", type=[float, int], default=None)
current_ratio = ValidateAttr(field="current_ratio", type=[float, int], default=None)
compensation_reserve_ratio = ValidateAttr(field="compensation_reserve_ratio", type=[float, int], default=None)
compensation_rate = ValidateAttr(field="compensation_rate", type=[float, int], default=None)
risk_reserve_adequacy_ratio = ValidateAttr(field="risk_reserve_adequacy_ratio", type=[float, int], default=None)
single_customer_concentration = ValidateAttr(field="single_customer_concentration", type=[float, int],
default=None)
current_guarantee_compensation_rate = ValidateAttr(field="current_guarantee_compensation_rate",
type=[float, int], default=None)
current_compensation_recovery_rate = ValidateAttr(field="current_compensation_recovery_rate", type=[float, int],
default=None)
financing_guarantee_magnification = ValidateAttr(field="financing_guarantee_magnification", type=[float, int],
default=None)
industry_concentration = ValidateAttr(field="industry_concentration", type=[float, int], default=None)
return_total_assets = ValidateAttr(field="return_total_assets", type=[float, int], default=None)
operating_margin = ValidateAttr(field="operating_margin", type=[float, int], default=None)
roe = ValidateAttr(field="roe", type=[float, int], default=None)
actual_asset_liability_ratio = ValidateAttr(field="actual_asset_liability_ratio", type=[float, int],
default=None)
capital_adequacy_ratio = ValidateAttr(field="capital_adequacy_ratio", type=[float, int], default=None)
paid_capital = ValidateAttr(field="paid_capital", type=[float, int], default=None)
guarantee_business_income = ValidateAttr(field="guarantee_business_income", type=[float, int], default=None)
cumulative_guarantee_compensation_rate = ValidateAttr(field="cumulative_guarantee_compensation_rate",
type=[float, int], default=None)
cumulative_compensation_recovery_rate = ValidateAttr(field="cumulative_compensation_recovery_rate",
type=[float, int], default=None)
risk_coverage_ratio = ValidateAttr(field="risk_coverage_ratio", type=[float, int], default=None)
cash_asset_compensation_rate = ValidateAttr(field="cash_asset_compensation_rate", type=[float, int],
default=None)
margin_ratio = ValidateAttr(field="margin_ratio", type=[float, int], default=None)
proportion_investment_business_income = ValidateAttr(field="proportion_investment_business_income",
type=[float, int], default=None)
investment_income_growth_rate = ValidateAttr(field="investment_income_growth_rate", type=[float, int],
default=None)
one_proportion_class_assets = ValidateAttr(field="one_proportion_class_assets", type=[float, int], default=None)
customer_concentration = ValidateAttr(field="customer_concentration", type=[float, int], default=None)
proportion_income_guarantee_business = ValidateAttr(field="proportion_income_guarantee_business",
type=[float, int], default=None)
two_proportion_class_assets = ValidateAttr(field="two_proportion_class_assets", type=[float, int], default=None)
three_proportion_class_assets = ValidateAttr(field="three_proportion_class_assets", type=[float, int],
default=None)
fields_map = {
"guaranteed_insured_balance_growth_rate": "担保在保余额增长率(%)",
"guaranteed_revenue_growth_rate": "担保收入增长率(%)",
"growth_rate_of_total_assets": "资产总额增长率(%)",
"cash_assets_ratio": "现金类资产比率(%)",
"current_ratio": "流动比率(%)",
"compensation_reserve_ratio": "代偿准备金比率(%)",
"compensation_rate": "代偿保障率(%)",
"risk_reserve_adequacy_ratio": "风险准备金充足率(%)",
"single_customer_concentration": "单一客户集中度(%)",
"current_guarantee_compensation_rate": "当期担保代偿率(%)",
"current_compensation_recovery_rate": "当期代偿回收率(%)",
"financing_guarantee_magnification": "融资担保放大倍数(倍)",
"industry_concentration": "行业集中度(%)",
"return_total_assets": "总资产收益率(%)",
"operating_margin": "营业利润率(%)",
"roe": "净资产收益率(%)",
"actual_asset_liability_ratio": "实际资产负债率(%)",
"capital_adequacy_ratio": "资本充足率(%)",
"paid_capital": "实收资本(亿元)",
"guarantee_business_income": "担保业务收入(万元)",
"cumulative_guarantee_compensation_rate": "近三年累计担保代偿率(%)",
"cumulative_compensation_recovery_rate": "近三年累计代偿回收率(%)",
"risk_coverage_ratio": "风险覆盖率(%)",
"cash_asset_compensation_rate": "现金类资产代偿保障率(%)",
"margin_ratio": "保证金比率(%)",
"proportion_investment_business_income": "投资业务收入占比(%)",
"investment_income_growth_rate": "投资收益增长率(%)",
"one_proportion_class_assets": "I类资产占比(%)",
"customer_concentration": "客户集中度(%)",
"proportion_income_guarantee_business": "担保业务收入占比(%)",
"two_proportion_class_assets": "II类资产占比(%)",
"three_proportion_class_assets": "III类资产占比(%)"
}
cid = ValidateAttr(field="cid", type=str)
company_name = ValidateAttr(field="company_name", type=str, default=None)
report_period = ValidateAttr(field="report_period", type=str, default=None)
balance_sheet = ValidateAttr(field="balance_sheet", type=BalanceSheet, default=None)
income_sheet = ValidateAttr(field="income_sheet", type=IncomeSheet, default=None)
appendix_sheet = ValidateAttr(field="appendix_sheet", type=AppendixSheet, default=None)
financial_indicator = ValidateAttr(field="financial_indicator", type=FinancialIndicator, default=None)
fields_map = {
"cid": "企业ID",
"company_name": "企业名称",
"report_period": "报告期",
"balance_sheet": "资产负债表",
"income_sheet": "利润表",
"appendix_sheet": "补充数据表",
"financial_indicator": "财务指标"
}
class BusinessInfo(SpecObject):
"""经营数据"""
class CustomerInfo(SpecObject):
"""客户信息"""
cid = ValidateAttr(field='cid', type=str)
report_period = ValidateAttr(field="report_period", type=str)
client_name = ValidateAttr(field="client_name", type=str)
guarantee_type = ValidateAttr(field="guarantee_type", type=str, default=None)
balance_under_insurance = ValidateAttr(field="balance_under_insurance", type=[float, int], default=None)
financing_guarantee_balance = ValidateAttr(field="financing_guarantee_balance", type=[float, int], default=None)
guarantee_start_date = ValidateAttr(field="guarantee_start_date", func=Validate.date_format, default=None)
guarantee_end_date = ValidateAttr(field="guarantee_end_date", func=Validate.date_format, default=None)
fields_map = {
"cid": "企业ID",
"report_period": "报告期",
"client_name": "客户名称",
"guarantee_type": "担保类型",
"balance_under_insurance": "在保余额",
"financing_guarantee_balance": "融资担保责任余额",
"guarantee_start_date": "担保起始日",
"guarantee_end_date": "担保截止日"
}
class RegionalDistribution(SpecObject):
"""区域分布"""
cid = ValidateAttr(field='cid', type=str)
report_period = ValidateAttr(field="report_period", type=str)
region = ValidateAttr(field="region", type=str)
year_end_insured_balance = ValidateAttr(field="year_end_insured_balance", type=[float, int], default=None)
year_end_insured_liability_balance = ValidateAttr(field="year_end_insured_liability_balance", type=[float, int],
default=None)
insured_balance_newly_added = ValidateAttr(field="insured_balance_newly_added", type=[float, int], default=None)
insured_liability_newly_added = ValidateAttr(field="insured_liability_newly_added", type=[float, int],
default=None)
fields_map = {
"cid": "企业ID",
"report_period": "报告期",
"region": "地区",
"year_end_insured_balance": "年末在保余额",
"year_end_insured_liability_balance": "年末在保责任余额",
"insured_balance_newly_added": "当年新增在保余额",
"insured_liability_newly_added": "当年新增在保责任余额"
}
class IndustryDistribution(SpecObject):
"""行业分布"""
cid = ValidateAttr(field='cid', type=str)
report_period = ValidateAttr(field="report_period", type=str)
industry = ValidateAttr(field="industry", type=str)
year_end_insured_balance = ValidateAttr(field="year_end_insured_balance", type=[float, int], default=None)
year_end_insured_liability_balance = ValidateAttr(field="year_end_insured_liability_balance", type=[float, int], default=None)
insured_balance_newly_added = ValidateAttr(field="insured_balance_newly_added", type=[float, int], default=None)
insured_liability_newly_added = ValidateAttr(field="insured_liability_newly_added", type=[float, int], default=None)
fields_map = {
"cid": "企业ID",
"report_period": "报告期",
"industry": "所属行业",
"year_end_insured_balance": "年末在保余额",
"year_end_insured_liability_balance": "年末在保责任余额",
"insured_balance_newly_added": "当年新增在保余额",
"insured_liability_newly_added": "当年新增在保责任余额"
}
class GuaranteedBalanceDistribution(SpecObject):
"""担保余额分布"""
class GuaranteeDetail(SpecObject):
"""担保金额详细"""
guarantee_account = ValidateAttr(field='guarantee_account', type=int)
guarantee_number = ValidateAttr(field='guarantee_number', type=int)
liability_balance = ValidateAttr(field='liability_balance', type=[int, float])
fields_map = {
"guarantee_account": "担保户数",
"guarantee_number": "担保笔数",
"liability_balance": "担保责任余额"
}
"""担保金额相关"""
cid = ValidateAttr(field='cid', type=str)
report_period = ValidateAttr(field="report_period", type=str)
one_million = ValidateAttr(field="one_million", type=GuaranteeDetail, default=None)
five_million = ValidateAttr(field="five_million", type=GuaranteeDetail, default=None)
ten_million = ValidateAttr(field="ten_million", type=GuaranteeDetail, default=None)
thirty_million = ValidateAttr(field="thirty_million", type=GuaranteeDetail, default=None)
fifty_million = ValidateAttr(field="fifty_million", type=GuaranteeDetail, default=None)
eighty_million = ValidateAttr(field="eighty_million", type=GuaranteeDetail, default=None)
one_hundred_million = ValidateAttr(field="one_hundred_million", type=GuaranteeDetail, default=None)
more_than_one_hundred_million = ValidateAttr(field="more_than_one_hundred_million", type=GuaranteeDetail, default=None)
total = ValidateAttr(field="total", type=[int, float], default=None)
fields_map = {
"cid": "企业ID",
"report_period": "报告期",
"one_million": "100万以下含100万",
"five_million": "500万以下含500万",
"ten_million": "500-1000万含1000万",
"thirty_million": "1000-3000万含3000万",
"fifty_million": "3000-5000万含5000万",
"eighty_million": "5000-8000万含8000万",
"one_hundred_million": "8000-10000万含10000万",
"more_than_one_hundred_million": "10000万以上",
"total": "合计"
}
company_name = ValidateAttr(field='company_name', type=str, default=None)
cid = ValidateAttr(field='cid', type=str)
customerinfo = ValidateAttr(field='customerinfo', instance_list=CustomerInfo)
regional_distribution = ValidateAttr(field='regional_distribution', instance_list=RegionalDistribution)
industry_distribution = ValidateAttr(field='industry_distribution', instance_list=IndustryDistribution)
balance_distribution = ValidateAttr(field='balance_distribution', instance_list=GuaranteedBalanceDistribution)
fields_map = {
"company_name": "企业名称",
"cid": "企业ID",
"customerinfo": "客户信息",
"regional_distribution": "区域分布",
"industry_distribution": "行业分布",
"balance_distribution": "担保金额分布"
}
class GuaranteeInfo(SpecObject):
"""担保信息"""
class CompensationInfo(SpecObject):
"""代偿信息"""
compensation_id = ValidateAttr(field="compensation_id", type=str)
project_name = ValidateAttr(field="project_name", type=str)
compensation_amount = ValidateAttr(field="compensation_amount", type=[int, float])
compensation_recovery_amount = ValidateAttr(field="compensation_recovery_amount", type=[int, float])
compensation_date = ValidateAttr(field="compensation_date", func=Validate.date_format)
fields_map = {
"compensation_id": "担保ID",
"project_name": "项目名称",
"compensation_amount": "代偿金额(万元)",
"compensation_recovery_amount": "代偿回收金额(万元)",
"compensation_date": "代偿日期"
}
cid = ValidateAttr(field="cid", type=str)
guarantee_id = ValidateAttr(field="guarantee_id", type=str)
project_name = ValidateAttr(field="project_name", type=str)
warrantee = ValidateAttr(field="warrantee", type=str)
guarantee_type = ValidateAttr(field="guarantee_type", type=str)
guarantee_method = ValidateAttr(field="guarantee_method", type=str)
guarantee_balance = ValidateAttr(field="guarantee_balance", type=[float, int], default=None)
release_amount = ValidateAttr(field="release_amount", type=[float, int], default=None)
liability_guarantee_balance = ValidateAttr(field="liability_guarantee_balance", type=[float, int], default=None)
guarantee_start_date = ValidateAttr(field="guarantee_start_date", func=Validate.date_format)
guarantee_end_date = ValidateAttr(field="guarantee_end_date", func=Validate.date_format)
province = ValidateAttr(field="province", type=str, default=None)
city = ValidateAttr(field="city", type=str, default=None)
industry = ValidateAttr(field="industry", type=str, default=None)
compensation_info = ValidateAttr(field="compensation_info", instance_list=CompensationInfo)
remark = ValidateAttr(field="remark", type=str, default=None)
fields_map = {
"cid": "企业ID",
"guarantee_id": "担保ID",
"project_name": "项目名称",
"warrantee": "被担保人",
"guarantee_type": "担保类型",
"guarantee_method": "担保方式",
"guarantee_balance": "担保余额(万元)",
"release_amount": "解除金额(万元)",
"liability_guarantee_balance": "责任担保余额(万元)",
"guarantee_start_date": "担保开始日期",
"guarantee_end_date": "担保结束日期",
"province": "省份",
"city": "地级市",
"industry": "行业",
"compensation_info": "代偿信息",
"remark": "备注"
}
class BankCredit(SpecObject):
"""银行授信"""
cid = ValidateAttr(field="cid", type=str)
company_name = ValidateAttr(field="company_name", type=str)
bank_name = ValidateAttr(field="bank_name", type=str)
report_period = ValidateAttr(field="report_period", type=str)
credit_line = ValidateAttr(field="credit_line", type=[float, int])
usage_quota = ValidateAttr(field="usage_quota", type=[float, int])
fields_map = {
"cid": "企业ID",
"company_name": "企业名称",
"bank_name": "银行名称",
"report_period": "报告期",
"credit_line": "授信额度",
"usage_quota": "使用额度"
}
class RiskInfo(SpecObject):
"""风险信息"""
def __init__(self):
self.token = TOKEN
cid = ValidateAttr(field="cid", type=str)
company_name = ValidateAttr(field="company_name", type=str)
report_date = ValidateAttr(field="report_date", func=Validate.date_format)
dishonest_executor = ValidateAttr(field="dishonest_executor", type=int)
person_to_be_executed = ValidateAttr(field="person_to_be_executed", type=int)
final_case = ValidateAttr(field="final_case", type=int)
consumption_restriction_order = ValidateAttr(field="consumption_restriction_order", type=int)
administrative_penalties = ValidateAttr(field="administrative_penalties", type=int)
legal_action = ValidateAttr(field="legal_action", type=int)
fields_map = {
"cid": "企业ID",
"company_name": "企业名称",
"report_date": "报告期",
"dishonest_executor": "失信被执行人",
"person_to_be_executed": "被执行人",
"final_case": "终本案件",
"consumption_restriction_order": "限制消费令",
"administrative_penalties": "行政处罚",
"legal_action": "法律诉讼(被告)"
}