Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
800b0fcd
Commit
800b0fcd
authored
Feb 21, 2020
by
蒋勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
557cd4e8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
rpt_result/main.py
+13
-5
No files found.
rpt_result/main.py
View file @
800b0fcd
...
...
@@ -36,18 +36,21 @@ def charts(datalist, charttype, pngpath):
axisline_opts
=
opts
.
AxisLineOpts
(
linestyle_opts
=
opts
.
LineStyleOpts
(
color
=
[(
0.3
,
"#67e0e3"
),
(
0.7
,
"#37a2da"
),
(
1
,
"#fd666d"
)],
width
=
35
)),
label_opts
=
opts
.
LabelOpts
(
font_size
=
55
,
formatter
=
"{value}
%
"
))
if
img
:
print
(
">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
)
make_snapshot
(
snapshot
,
img
.
render
(),
pngpath
)
return
True
else
:
return
False
except
Exception
as
e
:
print
(
"ExceptionExceptionExceptionExceptionExceptionException>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>ExceptionExceptionExceptionException"
)
print
(
e
)
print
(
"ExceptionExceptionExceptionExceptionExceptionException>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>ExceptionExceptionExceptionException"
)
return
False
#生成报告(es工商、财务信息、风险监测(仪表盘图))
def
WriteReport
(
Else_info
,
Companyinfo
,
Fi_dict
,
Risk_info
):
tpl
=
DocxTemplate
(
'tax_word_model.docx'
)
tpl
=
DocxTemplate
(
'
./
tax_word_model.docx'
)
context
=
{}
#其他传入参数
context
[
'CreatTime'
]
=
Else_info
[
'CreatTime'
]
...
...
@@ -144,10 +147,11 @@ def WriteReport(Else_info,Companyinfo,Fi_dict,Risk_info):
context
[
"VAT_XZJX_Risk_desc"
]
=
str
(
Risk_info
[
"Risk_VAT_XZJX"
][
"describe"
])
.
replace
(
"['"
,
""
)
.
replace
(
"']"
,
""
)
.
replace
(
"'"
,
""
)
context
[
"CT_FX_Risk_desc"
]
=
str
(
Risk_info
[
"Risk_CT_FX"
][
"describe"
])
.
replace
(
"['"
,
""
)
.
replace
(
"']"
,
""
)
.
replace
(
"'"
,
""
)
context
[
"ALLT_FX_Risk_desc"
]
=
str
(
Risk_info
[
"Risk_ALLT_FX"
][
"describe"
])
.
replace
(
"['"
,
""
)
.
replace
(
"']"
,
""
)
.
replace
(
"'"
,
""
)
print
(
"ddddddddddddddddddddddddddddddddddd"
);
tpl
.
render
(
context
)
addr
=
"/tmp/TaxRiskReport.docx"
# addr = "G://TaxRiskReport26.docx"
print
(
"ddddddddddddddddddddddddddddddddddd"
);
tpl
.
save
(
addr
)
print
(
addr
,
"+++++++++"
)
return
addr
...
...
@@ -194,13 +198,17 @@ def UpdateTaskRptUrl(batchid, rptUrl):
# 风险监测自动报告接口
@server.route
(
'/gsb/api/
report
2'
,
methods
=
[
'POST'
])
@server.route
(
'/gsb/api/
git
2'
,
methods
=
[
'POST'
])
def
report
():
if
request
.
method
==
'POST'
:
print
(
"=======调用风险检测自动报告接口"
)
data
=
request
.
json
json_str
=
json
.
dumps
(
data
)
GetAllinfo
=
json
.
loads
(
json_str
)
# print(data)
# print("ccccccccccccccccccccccccccccc")
# json_str = json.dumps(data)
# print(json_str);
GetAllinfo
=
json
.
loads
(
data
)
print
(
GetAllinfo
)
companyname
=
GetAllinfo
[
"company_name"
]
#获取监测企业名称
batchid
=
GetAllinfo
[
"Task_Num"
]
#获取任务号
companyname
=
strQ2B
(
companyname
)
...
...
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