Commit 7f437900 authored by 赵杰's avatar 赵杰

汇总数据

parent 97dc8fb0
...@@ -154,14 +154,14 @@ class UserCustomerResultAdaptor(UserCustomerDataAdaptor): ...@@ -154,14 +154,14 @@ class UserCustomerResultAdaptor(UserCustomerDataAdaptor):
folio_report_data["group_nav_info"] = result_fund_nav_info folio_report_data["group_nav_info"] = result_fund_nav_info
folio_report_data["group_hoding_info"] = result_fund_hoding_info folio_report_data["group_hoding_info"] = result_fund_hoding_info
folio_report_data["group_hoding_info_total"] = \ folio_report_data["group_hoding_info_total"] = \
{"total_cost": total_cost, {"total_cost": round(total_cost/10000.0, 2),
"cur_month_profit": cur_month_profit, "cur_month_profit": round(cur_month_profit/10000.0, 2),
"cur_month_profit_ratio": cur_month_profit_ratio, "cur_month_profit_ratio": round(cur_month_profit_ratio*100, 2),
"ending_assets": ending_assets, "ending_assets": round(ending_assets/10000.0, 2),
"weight": 100, "weight": 100,
"cumulative_profit": cumulative_profit, "cumulative_profit": round(cumulative_profit/10000.0, 2),
"cumulative_return": cumulative_return, "cumulative_return": round((cumulative_return-1)*100, 2),
"return_ratio_year": return_ratio_year} "return_ratio_year": round(return_ratio_year*100, 2)}
# 对应指数数据 # 对应指数数据
index_df = self.get_customer_index_nav_data() index_df = self.get_customer_index_nav_data()
...@@ -385,7 +385,7 @@ class UserCustomerResultAdaptor(UserCustomerDataAdaptor): ...@@ -385,7 +385,7 @@ class UserCustomerResultAdaptor(UserCustomerDataAdaptor):
# 累积年化收益率 # 累积年化收益率
cur_resample_df = resample_df[[row["fund_id"]]].dropna() cur_resample_df = resample_df[[row["fund_id"]]].dropna()
return_ratio_year = annual_return(fund_hoding_info["cum_profit_ratio"]/100.0, cur_resample_df, n_freq) return_ratio_year = annual_return(fund_hoding_info["cum_profit_ratio"]/100.0, cur_resample_df, n_freq)
fund_hoding_info["return_ratio_year"] = float(return_ratio_year) fund_hoding_info["return_ratio_year"] = round(float(return_ratio_year)*100, 2)
group_fund_hoding_info.append(fund_hoding_info) group_fund_hoding_info.append(fund_hoding_info)
return group_fund_basic_info, group_fund_hoding_info return group_fund_basic_info, group_fund_hoding_info
......
...@@ -1521,14 +1521,14 @@ ...@@ -1521,14 +1521,14 @@
{% endfor %} {% endfor %}
<tr class="gray"> <tr class="gray">
<td colspan="4">总计</td> <td colspan="4">总计</td>
<td class="text_red">0.40</td> <td>{{group_hoding_info_total["total_cost"]}}</td>
<td class="text_green">0.40</td> <td>{{group_hoding_info_total["cur_month_profit"]}}</td>
<td>0.40</td> <td>{{group_hoding_info_total["cur_month_profit_ratio"]}}</td>
<td>0.40</td> <td>{{group_hoding_info_total["ending_assets"]}}</td>
<td>0.40</td> <td>100</td>
<td>0.40</td> <td>{{group_hoding_info_total["cumulative_profit"]}}</td>
<td>0.40</td> <td>{{group_hoding_info_total["cumulative_return"]}}</td>
<td>0.40</td> <td>{{group_hoding_info_total["return_ratio_year"]}}</td>
</tr> </tr>
</table> </table>
</div> </div>
......
...@@ -162,6 +162,7 @@ class DataIntegrate: ...@@ -162,6 +162,7 @@ class DataIntegrate:
self.group_nav_info = group_result["group_nav_info"] self.group_nav_info = group_result["group_nav_info"]
self.group_hoding_info = group_result["group_hoding_info"] self.group_hoding_info = group_result["group_hoding_info"]
self.group_hoding_info_total = group_result["group_hoding_info_total"]
def render_data(self): def render_data(self):
...@@ -201,6 +202,7 @@ class DataIntegrate: ...@@ -201,6 +202,7 @@ class DataIntegrate:
'monthly_table_return': self.monthly_table_return, 'monthly_table_return': self.monthly_table_return,
'group_nav_info': self.group_nav_info, 'group_nav_info': self.group_nav_info,
'group_hoding_info': self.group_hoding_info, 'group_hoding_info': self.group_hoding_info,
'group_hoding_info_total': self.group_hoding_info_total,
'old_evaluation': self.old_evaluation, 'old_evaluation': self.old_evaluation,
'contribution_decomposition': self.contribution_decomposition, 'contribution_decomposition': self.contribution_decomposition,
'single_fund_data_list': self.single_fund_data_list, 'single_fund_data_list': self.single_fund_data_list,
......
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