Commit d752e083 authored by 赵杰's avatar 赵杰

添加字段

parent 28edb4b4
...@@ -20,8 +20,15 @@ def recalculation_fund_comment(args): ...@@ -20,8 +20,15 @@ def recalculation_fund_comment(args):
suggest_fund_list = [] suggest_fund_list = []
suggest_amount_list = [] suggest_amount_list = []
all_sug_amount_dict = {} all_sug_amount_dict = {}
newprcode_dict = {}
for key, value_list in suggest_result.items(): for key, value_list in suggest_result.items():
if len(value_list) <= 0:
continue
for value in value_list: for value in value_list:
if len(value) == 0:
continue
if value.get("newprcode"):
newprcode_dict[value["fund_id"]] = value["newprcode"]
all_sug_amount_dict[value["fund_id"]] = value["after_optimization"] all_sug_amount_dict[value["fund_id"]] = value["after_optimization"]
value["after_optimization"] = round(float(value["after_optimization"]), 2) value["after_optimization"] = round(float(value["after_optimization"]), 2)
if value["after_optimization"] <= 0: if value["after_optimization"] <= 0:
...@@ -52,6 +59,8 @@ def recalculation_fund_comment(args): ...@@ -52,6 +59,8 @@ def recalculation_fund_comment(args):
for key_, value_ in new_suggestions_result.items(): for key_, value_ in new_suggestions_result.items():
for new_sug in value_: for new_sug in value_:
new_sug["after_optimization"] = all_sug_amount_dict.get(new_sug["fund_id"], 0) new_sug["after_optimization"] = all_sug_amount_dict.get(new_sug["fund_id"], 0)
if newprcode_dict.get(new_sug["fund_id"]):
new_sug["newprcode"] = newprcode_dict.get(new_sug["fund_id"])
new_suggestions_result_asset["after"] = sum_amount new_suggestions_result_asset["after"] = sum_amount
dict_result["suggestions_result"] = new_suggestions_result dict_result["suggestions_result"] = new_suggestions_result
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment