Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
F
fund_report
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
彭熊
fund_report
Commits
3de4dd83
Commit
3de4dd83
authored
Dec 07, 2020
by
pengxiong@wealthgrow.cn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
生成pdf
parent
3bf46d55
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
73 additions
and
134 deletions
+73
-134
monthReportV2.html
app/templates/v2/monthReportV2.html
+11
-19
fund_rank.py
app/utils/fund_rank.py
+47
-106
html_to_pdf.py
app/utils/html_to_pdf.py
+1
-1
jinjia2html.py
app/utils/jinjia2html.py
+14
-8
No files found.
app/templates/v2/monthReportV2.html
View file @
3de4dd83
...
...
@@ -903,7 +903,7 @@
<div
class=
"box0"
>
<div
class=
"cover_head dtable"
>
<div
class=
"dcell"
>
<img
src=
"./img/logo.png"
alt=
""
class=
"cover_logo"
>
<img
src=
{{logo}}
alt=
""
class=
"cover_logo"
>
</div>
<div
class=
"dcell"
>
<div
class=
"cover_line"
></div>
...
...
@@ -920,13 +920,13 @@
敬呈
</span>
<span
class=
"cover_name"
>
王晶
{{customer_name}}
</span>
<span
class=
"cover_sir"
>
先生
</span>
</div>
<img
src=
"./img/cover-back.png"
alt=
""
class=
"cover_back"
>
<img
src=
{{cover_back}}
alt=
""
class=
"cover_back"
>
<div
class=
"cover_date"
>
<div
class=
"cover_time"
>
2020.10
...
...
@@ -985,7 +985,7 @@
</div>
<div
class=
"page_head dcell"
>
<div
class=
"dcell"
>
<img
src=
"./img/logo.png"
alt=
""
class=
"page_logo"
>
<img
src=
{{logo}}
alt=
""
class=
"page_logo"
>
</div>
<div
class=
"dcell"
>
<div
class=
"page_line"
></div>
...
...
@@ -1167,9 +1167,6 @@
<td>
{{value[12]["profit"]}}
</td>
<!-- <td>-->
<!-- {{value[13]["profit"]}}-->
<!-- </td>-->
</tr>
<tr>
<td>
...
...
@@ -1211,11 +1208,6 @@
<td>
{{value[12]["net_amount"]}}
</td>
<!-- <td>-->
<!-- {{value[13]["net_amount"]}}-->
<!-- </td> <td>-->
<!-- {{value[13]["net_amount"]}}-->
<!-- </td>-->
</tr>
{%endfor%}
</table>
...
...
@@ -1234,7 +1226,7 @@
</div>
<div
class=
"page_head dcell"
>
<div
class=
"dcell"
>
<img
src=
"./img/logo.png"
alt=
""
class=
"page_logo"
>
<img
src=
{{logo}}
alt=
""
class=
"page_logo"
>
</div>
<div
class=
"dcell"
>
<div
class=
"page_line"
></div>
...
...
@@ -1460,7 +1452,7 @@
</div>
<div
class=
"page_head dcell"
>
<div
class=
"dcell"
>
<img
src=
"./img/logo.png"
alt=
""
class=
"page_logo"
>
<img
src=
{{logo}}
alt=
""
class=
"page_logo"
>
</div>
<div
class=
"dcell"
>
<div
class=
"page_line"
></div>
...
...
@@ -1612,7 +1604,7 @@
</div>
<div
class=
"page_head dcell"
>
<div
class=
"dcell"
>
<img
src=
"./img/logo.png"
alt=
""
class=
"page_logo"
>
<img
src=
{{logo}}
alt=
""
class=
"page_logo"
>
</div>
<div
class=
"dcell"
>
<div
class=
"page_line"
></div>
...
...
@@ -1697,7 +1689,7 @@
</div>
<div
class=
"page_head dcell"
>
<div
class=
"dcell"
>
<img
src=
"./img/logo.png"
alt=
""
class=
"page_logo"
>
<img
src=
{{logo}}
alt=
""
class=
"page_logo"
>
</div>
<div
class=
"dcell"
>
<div
class=
"page_line"
></div>
...
...
@@ -1921,7 +1913,7 @@
</div>
<div
class=
"page_head dcell"
>
<div
class=
"dcell"
>
<img
src=
"./img/logo.png"
alt=
""
class=
"page_logo"
>
<img
src=
{{logo}}
alt=
""
class=
"page_logo"
>
</div>
<div
class=
"dcell"
>
<div
class=
"page_line"
></div>
...
...
@@ -2004,7 +1996,7 @@
<div
class=
"financial_show dtable"
>
<div
class=
"financial_left dcell"
>
<div
class=
"financial_scene"
>
<img
src=
"./img/scene.png
"
alt=
""
class=
"financial_scene_img"
>
<img
src=
{{scene}}
"
alt=
""
class=
"financial_scene_img"
>
<div
class=
"financial_scene_text"
>
我们挣的是⻆度和变化的钱⽽不是纠正市场错 误的钱,市场永远是正确的,关键是在其正确 被反复证明后的逆向⽽⾏,⼀定是避开它的正 确被展开的过程 。
</div>
...
...
@@ -2015,7 +2007,7 @@
</div>
<div
class=
"financial_show_right dcell"
>
<div
class=
"financial_team"
>
<img
src=
"./img/team.png"
alt=
""
class=
"financial_team_img"
>
<img
src=
{{team}}
alt=
""
class=
"financial_team_img"
>
</div>
</div>
</div>
...
...
app/utils/fund_rank.py
View file @
3de4dd83
This diff is collapsed.
Click to expand it.
app/utils/html_to_pdf.py
View file @
3de4dd83
...
...
@@ -17,7 +17,7 @@ def html_to_pdf(source_path, target_path):
'encoding'
:
"utf-8"
,
# 'page-size': 'A5',
# 'page-width': '300mm',
# 'page-height': 'auto
',
'page-height'
:
'2.3mm
'
,
'margin-top'
:
'0mm'
,
'margin-right'
:
'0mm'
,
'margin-bottom'
:
'0mm'
,
...
...
app/utils/jinjia2html.py
View file @
3de4dd83
...
...
@@ -3,6 +3,7 @@ import uuid
from
jinja2
import
PackageLoader
,
Environment
from
app.api.engine
import
work_dir
,
pdf_folder
,
template_folder
from
app.service.portfolio_diagnose
import
portfolio_diagnose
from
app.service.result_service_v2
import
UserCustomerResultAdaptor
import
numpy
as
np
...
...
@@ -80,8 +81,6 @@ class DataIntegrate:
self
.
single_fund_data_list
=
[]
portfolio_evaluation
=
portfolio_diagnose
.
old_portfolio_evaluation
()
radar_chart_data
=
portfolio_diagnose
.
single_fund_radar
()
print
(
'***************************'
)
print
(
portfolio_evaluation
)
for
i
in
range
(
len
(
portfolio_evaluation
)):
if
portfolio_evaluation
[
i
][
'status'
]
==
'保留'
:
portfolio_evaluation
[
i
][
'status'
]
=
'<div class="self_type fl">保留</div>'
...
...
@@ -167,8 +166,15 @@ class DataIntegrate:
def
render_data
(
self
):
# 全部数据
data
=
{
'customer_name'
:
self
.
customer_name
,
'customer_gender'
:
'女'
,
'year_month'
:
'2020年10月'
,
'ifa_company'
:
'飞度工作室'
,
data
=
{
'cover_back'
:
template_folder
+
'/v2/img/cover-back.png'
,
'logo'
:
template_folder
+
'/v2/img/logo.png'
,
'scene'
:
template_folder
+
'/v2/img/scene/png'
,
'team'
:
template_folder
+
'/v2/img/team.png'
,
'customer_name'
:
self
.
customer_name
,
'customer_gender'
:
'女'
,
'year_month'
:
'2020年10月'
,
'ifa_company'
:
'飞度工作室'
,
'title'
:
'10月综述'
,
'brand_name'
:
'飞度工作室'
,
'customer_old'
:
42
,
'customer_level'
:
'平衡型'
,
# 'new_evaluation': self.new_evaluation,
...
...
@@ -219,10 +225,10 @@ class DataIntegrate:
# with open(save_file, 'w', encoding="utf-8") as f:
# f.write(monthReport_html)
save_file
=
"app/html/v2/monthReportV2.html"
with
open
(
save_file
,
'w'
,
encoding
=
"utf-8"
)
as
f
:
f
.
write
(
monthReport_html
)
# html_to_pdf(monthReport_html, '/Users/pengxiong/Desktop/fund_report/app/pdf/%s.pdf' %
str(uuid.uuid4()))
#
save_file = "app/html/v2/monthReportV2.html"
#
with open(save_file, 'w', encoding="utf-8") as f:
#
f.write(monthReport_html)
html_to_pdf
(
monthReport_html
,
pdf_folder
+
str
(
uuid
.
uuid4
()))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment