修改财务得分结构

This commit is contained in:
王思川 2021-12-17 14:36:38 +08:00
parent fcfc937e3b
commit a75db83138
2 changed files with 25 additions and 4 deletions

View File

@ -1,3 +1,5 @@
import pandas as pd
from Rating.db import find_threshold
from common.scripts import file_path, read_json_file
@ -43,9 +45,28 @@ def financial_score(level_1_industry, param2):
else:
score = 0
scores[key] = round(score, 2)
scores['合计'] = round(sum(scores.values()), 2)
return scores
result = dict()
fin1 = ['净资产收益率', '总资产报酬率']
fin2 = ['总资产周转率', '应收账款周转率', '存货周转率']
fin3 = ['资产负债率', '已获利息倍数', '速动比率']
fin4 = ['营业增长率', '总资产增长率', '技术投入比率']
result['盈利能力'] = dict((key, value) for key, value in scores.items() if key in fin1)
result['资产质量'] = dict((key, value) for key, value in scores.items() if key in fin1)
result['债务风险'] = dict((key, value) for key, value in scores.items() if key in fin1)
result['经营增长'] = dict((key, value) for key, value in scores.items() if key in fin1)
df_scores = pd.DataFrame([scores])
result['盈利能力']['合计'] = float(df_scores[fin1].sum(axis=1).values[0])
result['资产质量']['合计'] = float(df_scores[fin2].sum(axis=1).values[0])
result['债务风险']['合计'] = float(df_scores[fin3].sum(axis=1).values[0])
result['经营增长']['合计'] = float(df_scores[fin4].sum(axis=1).values[0])
result['合计'] = round(sum(scores.values()), 2)
return result
def linear_correlation_type(value, standard_score, refer1, refer2):

View File

@ -1,6 +1,6 @@
{
"评价ID": "kSVoCeJ1",
"企业ID": "mKJreZRw",
"评价ID": "bR2n0mV0",
"企业ID": "cqqHE80f",
"企业名称": "远东资信评估有限公司",
"行业选择": ["制造业", "电子工业"],
"评价年度": "2021年",