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
d5feaadc
Commit
d5feaadc
authored
Mar 31, 2023
by
xianyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化业务类型汇总导出,余额查询
parent
5b54b719
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
15 deletions
+11
-15
schemas.py
app/api/account/schemas.py
+1
-2
views.py
app/api/export/views.py
+1
-2
guild.py
app/api/statement/guild.py
+9
-11
No files found.
app/api/account/schemas.py
View file @
d5feaadc
...
...
@@ -48,11 +48,10 @@ class FinanceDetails(PublicModel):
class
FixTable
(
BaseModel
):
type
:
int
uuid
:
str
=
''
uuid
:
str
money
:
float
amount_type
:
Optional
[
str
]
=
"consumable"
remark
:
str
unique_tag
:
Optional
[
str
]
=
""
class
AccountTypeUpdate
(
BaseModel
):
...
...
app/api/export/views.py
View file @
d5feaadc
...
...
@@ -96,7 +96,6 @@ def month_to_export(param: schemas.MonthStatistics, request: Request, token=Depe
headers
=
request
.
get
(
"headers"
)
if
not
param
.
date
:
return
HttpResultResponse
(
code
=
500
,
msg
=
'查询月份不能为空'
)
result
,
num
=
crud
.
CalculationMonthlyBill
()
.
month_statistics_task
(
'assets_log_'
+
param
.
date
,
param
.
type
,
param
.
name
,
param
.
page
,
999999
)
result
=
crud
.
MonthDataDerive
()
.
derive_data
(
'assets_log_'
+
param
.
date
,
param
.
type
,
param
.
name
)
field_head
=
[
'业务名称'
,
'财务编码类型'
,
'出账金额'
,
'入账金额'
,
'是否异常'
,
'异常金额'
]
return
statement_crud
.
data_to_file
(
db
,
result
,
"业务类型汇总"
,
headers
,
field_head
)
app/api/statement/guild.py
View file @
d5feaadc
...
...
@@ -338,15 +338,9 @@ def transfer_money(db: Session, param, h_list):
def
create_fix_table
(
db
:
Session
,
param
,
h_list
):
"""增加修复报表"""
uuid
=
param
.
uuid
unique_res
=
[]
if
param
.
type
==
0
:
acc_sql
=
f
"select unique_tag,uuid from fi_account where unique_tag='{param.unique_tag}'"
unique_res
=
LinkMysql
(
env
.
DB_3YV2
)
.
query_mysql
(
acc_sql
)
uuid
=
unique_res
[
0
][
'uuid'
]
if
param
.
amount_type
==
'backpack'
:
guild_sql
=
f
"select count(id) as num from guild where uuid='{uuid}'"
user_sql
=
f
"select user_id,nick_name,user_number from v2_user where uuid='{uuid}'"
guild_sql
=
f
"select count(id) as num from guild where uuid='{
param.
uuid}'"
user_sql
=
f
"select user_id,nick_name,user_number from v2_user where uuid='{
param.
uuid}'"
with
ThreadPoolExecutor
(
max_workers
=
2
)
as
pool
:
future1
=
pool
.
submit
(
LinkMysql
(
env
.
DB_3YV2
)
.
query_mysql
,
guild_sql
)
future2
=
pool
.
submit
(
LinkMysql
(
env
.
DB_3YV2
)
.
query_mysql
,
user_sql
)
...
...
@@ -369,7 +363,7 @@ def create_fix_table(db: Session, param, h_list):
method
=
'Server.BaseExecute.Increase'
data
=
{
"ip"
:
ip
,
"dst_uuid"
:
uuid
,
"dst_uuid"
:
param
.
uuid
,
"dst_amount_type"
:
param
.
amount_type
,
"amount"
:
param
.
money
,
"fee"
:
0
,
...
...
@@ -382,7 +376,7 @@ def create_fix_table(db: Session, param, h_list):
method
=
'Server.BaseExecute.Reduce'
data
=
{
"ip"
:
ip
,
"src_uuid"
:
uuid
,
"src_uuid"
:
param
.
uuid
,
"src_amount_type"
:
param
.
amount_type
,
"amount"
:
param
.
money
,
"fee"
:
0
,
...
...
@@ -394,7 +388,11 @@ def create_fix_table(db: Session, param, h_list):
clearing_res
=
search
(
data
,
method
)
print
(
clearing_res
)
if
clearing_res
[
'status'
]:
unique_tag
=
unique_res
[
0
][
'unique_tag'
]
if
unique_res
else
uuid
unique_res
=
[]
if
param
.
type
==
0
:
acc_sql
=
f
"select unique_tag from fi_account where uuid='{param.uuid}'"
unique_res
=
LinkMysql
(
env
.
DB_3YV2
)
.
query_mysql
(
acc_sql
)
unique_tag
=
unique_res
[
0
][
'unique_tag'
]
if
unique_res
else
param
.
uuid
user
=
query_token
(
db
,
h_list
)
try
:
insert_fix_sql
=
f
"insert into finance_fix_log(type, money, create_time, unique_tag, amount_type, remark, operator,operator_id) "
\
...
...
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