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
16e35a54
Commit
16e35a54
authored
Apr 18, 2023
by
xianyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化导出
parent
c21d8011
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
5 deletions
+21
-5
financial-system.iml
.idea/financial-system.iml
+1
-1
misc.xml
.idea/misc.xml
+1
-1
crud.py
app/api/account/crud.py
+14
-0
schemas.py
app/api/account/schemas.py
+1
-0
views.py
app/api/account/views.py
+4
-3
No files found.
.idea/financial-system.iml
View file @
16e35a54
...
...
@@ -6,7 +6,7 @@
<excludeFolder
url=
"file://$MODULE_DIR$/fs-env"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/venv"
/>
</content>
<orderEntry
type=
"
inheritedJdk
"
/>
<orderEntry
type=
"
jdk"
jdkName=
"Python 3.8 (financial-system)"
jdkType=
"Python SDK
"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
</component>
<component
name=
"PyDocumentationSettings"
>
...
...
.idea/misc.xml
View file @
16e35a54
...
...
@@ -3,5 +3,5 @@
<component
name=
"JavaScriptSettings"
>
<option
name=
"languageLevel"
value=
"ES6"
/>
</component>
<component
name=
"ProjectRootManager"
version=
"2"
project-jdk-name=
"Python 3.8 (financial
_
system)"
project-jdk-type=
"Python SDK"
/>
<component
name=
"ProjectRootManager"
version=
"2"
project-jdk-name=
"Python 3.8 (financial
-
system)"
project-jdk-type=
"Python SDK"
/>
</project>
\ No newline at end of file
app/api/account/crud.py
View file @
16e35a54
...
...
@@ -453,6 +453,20 @@ class AccountStatistics(object):
return
res
def
delete_specify_field
(
data
):
res_list
=
[]
for
i
in
data
:
structure
=
{
"order_number"
:
i
[
"order_number"
],
"type"
:
'出账'
if
i
[
"type"
]
==
0
else
'入账'
,
"reference_type"
:
i
[
"reference_type"
],
"amount"
:
round
(
float
(
i
[
"amount"
]),
3
),
"create_time"
:
i
[
"create_time"
]
}
res_list
.
append
(
structure
)
return
res_list
class
SpecificAccountQuery
(
object
):
"""账户用户,背包,公会第四层查询"""
...
...
app/api/account/schemas.py
View file @
16e35a54
...
...
@@ -36,6 +36,7 @@ class AccountUpdate(BaseModel):
class
FinanceInfo
(
PublicModel
):
unique_tag
:
str
id
:
Optional
[
int
]
=
None
class
FinanceDetails
(
PublicModel
):
...
...
app/api/account/views.py
View file @
16e35a54
...
...
@@ -68,8 +68,8 @@ def finance_info_excel(data: schemas.FinanceInfo, request: Request,
token
=
Depends
(
login_required
),
db
:
Session
=
Depends
(
get_db
)):
"""账户财务详情导出"""
headers
=
request
.
get
(
"headers"
)
statement_list
=
crud
.
get_finance_info
(
data
.
unique_tag
,
data
.
page
,
99999
,
data
.
start_time
,
data
.
end_time
)
df
=
[
'
表id'
,
'金
额'
,
'入账'
,
'出账'
,
'时间'
]
statement_list
=
crud
.
get_finance_info
(
data
.
unique_tag
,
data
.
id
,
data
.
page
,
99999
,
data
.
start_time
,
data
.
end_time
)
df
=
[
'
账户余
额'
,
'入账'
,
'出账'
,
'时间'
]
return
statement_crud
.
data_to_file
(
db
,
statement_list
,
"财务信息"
,
headers
,
df
)
...
...
@@ -99,8 +99,9 @@ def finance_info_excel(data: schemas.FinanceDetails, request: Request,
headers
=
request
.
get
(
"headers"
)
statement_list
=
AccountStatistics
(
data
.
page
,
99999
,
data
.
uuid
,
data
.
user_id
,
data
.
start_time
,
data
.
end_time
,
data
.
type
,
data
.
gift_type
,
data
.
unique_tag
)
.
get_finance_details
()
data
=
crud
.
delete_specify_field
(
statement_list
)
field_head
=
[
'订单号'
,
'出入账方式'
,
'礼物类型'
,
'金额'
,
'时间'
]
return
statement_crud
.
data_to_file
(
db
,
statement_list
,
"财务明细"
,
headers
,
field_head
)
return
statement_crud
.
data_to_file
(
db
,
data
,
"财务明细"
,
headers
,
field_head
)
@
router
.
get
(
"/finance/fourth/details"
)
...
...
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