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
b3084f1a
Commit
b3084f1a
authored
May 30, 2023
by
xianyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化公会导出
parent
11237c65
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
1 deletion
+38
-1
crud.py
app/api/account/crud.py
+24
-1
views.py
app/api/account/views.py
+5
-0
business.py
libs/business.py
+9
-0
No files found.
app/api/account/crud.py
View file @
b3084f1a
...
@@ -4,7 +4,7 @@ from concurrent.futures.thread import ThreadPoolExecutor
...
@@ -4,7 +4,7 @@ from concurrent.futures.thread import ThreadPoolExecutor
import
pandas
as
pd
import
pandas
as
pd
from
sqlalchemy.orm
import
Session
from
sqlalchemy.orm
import
Session
from
core.config.env
import
env
from
core.config.env
import
env
from
libs.business
import
TYPE_NAME
,
query_fi_account_type
from
libs.business
import
TYPE_NAME
,
query_fi_account_type
,
GUILD_NAME
from
libs.db_link
import
LinkMysql
from
libs.db_link
import
LinkMysql
from
libs.functions
import
wrapper_out
,
get_now_timestamp
,
uuid
,
get_before_timestamp
,
time_str_to_timestamp
,
\
from
libs.functions
import
wrapper_out
,
get_now_timestamp
,
uuid
,
get_before_timestamp
,
time_str_to_timestamp
,
\
get_yesterday_timestamp
,
get_last_month
,
get_date_list
,
send_json_rpc_request
,
ymd_str_to_timestamp
get_yesterday_timestamp
,
get_last_month
,
get_date_list
,
send_json_rpc_request
,
ymd_str_to_timestamp
...
@@ -536,6 +536,14 @@ def delete_specify_field(data, unique_tag):
...
@@ -536,6 +536,14 @@ def delete_specify_field(data, unique_tag):
"outcome"
:
i
.
get
(
'outcome'
,
''
),
"outcome"
:
i
.
get
(
'outcome'
,
''
),
"create_time"
:
i
.
get
(
'create_time'
,
''
)
"create_time"
:
i
.
get
(
'create_time'
,
''
)
}
}
if
unique_tag
==
'guild_account'
:
structure
=
{
"uuid"
:
i
.
get
(
'guild_id'
,
''
),
"income"
:
i
.
get
(
'income'
,
''
),
"outcome"
:
i
.
get
(
'outcome'
,
''
),
"initial_money"
:
i
.
get
(
'initial_money'
,
''
),
"create_time"
:
i
.
get
(
'create_time'
,
''
)
}
else
:
else
:
structure
=
{
structure
=
{
"reference_number"
:
i
.
get
(
'reference_number'
,
''
),
"reference_number"
:
i
.
get
(
'reference_number'
,
''
),
...
@@ -548,6 +556,21 @@ def delete_specify_field(data, unique_tag):
...
@@ -548,6 +556,21 @@ def delete_specify_field(data, unique_tag):
return
res_list
return
res_list
def
delete_guild_specify_field
(
data
):
res_list
=
[]
for
i
in
data
:
structure
=
{
"name"
:
GUILD_NAME
[
i
.
get
(
'guild_id'
)],
"guild_id"
:
i
.
get
(
'guild_id'
,
''
),
"income"
:
i
.
get
(
'income'
,
''
),
"outcome"
:
i
.
get
(
'outcome'
,
''
),
"initial_money"
:
i
.
get
(
'initial_money'
,
''
),
"create_time"
:
i
.
get
(
'create_time'
,
''
)
}
res_list
.
append
(
structure
)
return
res_list
class
SpecificAccountQuery
(
object
):
class
SpecificAccountQuery
(
object
):
"""账户用户,背包,公会第四层查询"""
"""账户用户,背包,公会第四层查询"""
...
...
app/api/account/views.py
View file @
b3084f1a
...
@@ -7,6 +7,7 @@ from app.api.account import schemas, crud
...
@@ -7,6 +7,7 @@ from app.api.account import schemas, crud
from
app.api.account.crud
import
AccountStatistics
,
SpecificAccountQuery
,
HomePageDisplay
from
app.api.account.crud
import
AccountStatistics
,
SpecificAccountQuery
,
HomePageDisplay
from
app.api.statement
import
crud
as
statement_crud
from
app.api.statement
import
crud
as
statement_crud
from
libs
import
functions
from
libs
import
functions
from
libs.business
import
GUILD_NAME
from
libs.export
import
Export
,
TableToFile
from
libs.export
import
Export
,
TableToFile
from
libs.functions
import
get_date_list
from
libs.functions
import
get_date_list
from
libs.log_utils
import
Logger
from
libs.log_utils
import
Logger
...
@@ -106,6 +107,10 @@ def finance_info_excel(data: schemas.FinanceDetails, request: Request,
...
@@ -106,6 +107,10 @@ def finance_info_excel(data: schemas.FinanceDetails, request: Request,
if
data
.
unique_tag
in
[
"knapsack_account"
,
"user_account"
,
"guild_account"
,
"pledgeDeduction"
]:
if
data
.
unique_tag
in
[
"knapsack_account"
,
"user_account"
,
"guild_account"
,
"pledgeDeduction"
]:
field_head
=
[
'uuid'
,
'入账'
,
'出账'
,
'时间'
]
field_head
=
[
'uuid'
,
'入账'
,
'出账'
,
'时间'
]
statement_list
=
statement_list
[
0
]
statement_list
=
statement_list
[
0
]
if
data
.
unique_tag
==
'guild_account'
:
field_head
=
[
'公会名'
,
'公会id'
,
'入账'
,
'出账'
,
'余额'
,
'时间'
]
data
=
crud
.
delete_guild_specify_field
(
statement_list
)
return
TableToFile
(
db
,
data
,
"财务明细"
,
headers
,
field_head
)
.
main_method
()
else
:
else
:
field_head
=
[
'订单号'
,
'出入账方式'
,
'礼物类型'
,
'金额'
,
'时间'
]
field_head
=
[
'订单号'
,
'出入账方式'
,
'礼物类型'
,
'金额'
,
'时间'
]
data
=
crud
.
delete_specify_field
(
statement_list
,
data
.
unique_tag
)
data
=
crud
.
delete_specify_field
(
statement_list
,
data
.
unique_tag
)
...
...
libs/business.py
View file @
b3084f1a
...
@@ -17,7 +17,16 @@ def query_fi_account_type():
...
@@ -17,7 +17,16 @@ def query_fi_account_type():
return
fi_type
return
fi_type
def
query_fi_guild_name
():
guild_name
=
{}
sql
=
f
"SELECT id,guild_name,uuid FROM guild"
res_data
=
LinkMysql
(
env
.
DB_3YV2
)
.
query_mysql
(
sql
)
for
i
in
res_data
:
guild_name
[
i
[
'id'
]]
=
i
[
'guild_name'
]
return
guild_name
TYPE_NAME
=
query_fi_account_type
()
TYPE_NAME
=
query_fi_account_type
()
GUILD_NAME
=
query_fi_guild_name
()
# TYPE_NAME_T = {
# TYPE_NAME_T = {
...
...
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