Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
financial-system
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xianyang
financial-system
Commits
a05e25b9
Commit
a05e25b9
authored
Apr 21, 2023
by
xianyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
c2d6a36b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
crud.py
app/api/statement/crud.py
+2
-2
requirements.txt
requirements.txt
+2
-0
No files found.
app/api/statement/crud.py
View file @
a05e25b9
...
@@ -63,7 +63,7 @@ def account_data_to_file(db, data, outcome, income, header):
...
@@ -63,7 +63,7 @@ def account_data_to_file(db, data, outcome, income, header):
try
:
try
:
income_list
=
[
i
for
i
in
data
if
i
[
'type'
]
==
'入账'
]
income_list
=
[
i
for
i
in
data
if
i
[
'type'
]
==
'入账'
]
outcome_list
=
[
i
for
i
in
data
if
i
[
'type'
]
==
'出账'
]
outcome_list
=
[
i
for
i
in
data
if
i
[
'type'
]
==
'出账'
]
workbook
=
xlsxwriter
.
Workbook
(
"账户类型汇总.xlsx"
)
workbook
=
xlsxwriter
.
Workbook
(
"
static/
账户类型汇总.xlsx"
)
worksheet
=
workbook
.
add_worksheet
()
worksheet
=
workbook
.
add_worksheet
()
worksheet
.
merge_range
(
"A1:B1"
,
"出账"
)
worksheet
.
merge_range
(
"A1:B1"
,
"出账"
)
worksheet
.
write
(
1
,
0
,
'类型'
)
worksheet
.
write
(
1
,
0
,
'类型'
)
...
@@ -87,7 +87,7 @@ def account_data_to_file(db, data, outcome, income, header):
...
@@ -87,7 +87,7 @@ def account_data_to_file(db, data, outcome, income, header):
worksheet
.
write
(
row
,
0
,
'合计'
)
worksheet
.
write
(
row
,
0
,
'合计'
)
worksheet
.
write
(
row
,
1
,
outcome
)
worksheet
.
write
(
row
,
1
,
outcome
)
workbook
.
close
()
workbook
.
close
()
file
=
open
(
"账户类型汇总.xlsx"
,
'rb'
)
file
=
open
(
"
static/
账户类型汇总.xlsx"
,
'rb'
)
# 记录导出
# 记录导出
crud
.
create_export_data
(
db
,
params
,
user
)
crud
.
create_export_data
(
db
,
params
,
user
)
return
StreamingResponse
(
file
,
media_type
=
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
)
return
StreamingResponse
(
file
,
media_type
=
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
)
...
...
requirements.txt
View file @
a05e25b9
...
@@ -45,3 +45,5 @@ xmltodict==0.13.0
...
@@ -45,3 +45,5 @@ xmltodict==0.13.0
openpyxl
==3.1.2
openpyxl
==3.1.2
redis
==4.3.4
redis
==4.3.4
xpinyin
==0.7.6
xpinyin
==0.7.6
xlsxwriter-3.1.0
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