update 处理已获利息倍数为None的情况

This commit is contained in:
彭森 2022-01-25 14:22:05 +08:00
parent 1ca8a849a5
commit 24b253bd01
1 changed files with 23 additions and 20 deletions

View File

@ -25,27 +25,30 @@ def financial_score(param1, param2):
# main
for key, value in param2.items():
refer = list(map(float, refers[key]))
weight = weights[key]
if value is None:
score = 0
elif value > refer[0]:
score = weight
elif value > refer[1]:
standard_score = round(weight * 1, 2)
score = linear_correlation_type(value, standard_score, refer[0], refer[1])
elif value > refer[2]:
standard_score = round(weight * 0.8, 2)
score = linear_correlation_type(value, standard_score, refer[1], refer[2])
elif value > refer[3]:
standard_score = round(weight * 0.5, 2)
score = linear_correlation_type(value, standard_score, refer[2], refer[3])
elif value > refer[4]:
standard_score = round(weight * 0.25, 2)
score = linear_correlation_type(value, standard_score, refer[3], refer[4])
if key == '已获利息倍数' and value is None:
scores[key] = 5
else:
score = 0
scores[key] = round(score, 2)
refer = list(map(float, refers[key]))
weight = weights[key]
if value is None:
score = 0
elif value > refer[0]:
score = weight
elif value > refer[1]:
standard_score = round(weight * 1, 2)
score = linear_correlation_type(value, standard_score, refer[0], refer[1])
elif value > refer[2]:
standard_score = round(weight * 0.8, 2)
score = linear_correlation_type(value, standard_score, refer[1], refer[2])
elif value > refer[3]:
standard_score = round(weight * 0.5, 2)
score = linear_correlation_type(value, standard_score, refer[2], refer[3])
elif value > refer[4]:
standard_score = round(weight * 0.25, 2)
score = linear_correlation_type(value, standard_score, refer[3], refer[4])
else:
score = 0
scores[key] = round(score, 2)
result = dict()