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
b1ce71cd
Commit
b1ce71cd
authored
Aug 17, 2023
by
xianyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
账户增加受益人,第四层查询增加字段
parent
1e14b02f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
3 deletions
+8
-3
crud.py
app/api/account/crud.py
+5
-3
schemas.py
app/api/account/schemas.py
+2
-0
views.py
app/api/export/views.py
+1
-0
No files found.
app/api/account/crud.py
View file @
b1ce71cd
...
...
@@ -169,8 +169,8 @@ def create_account(param):
# account_uuid = result['data']['result']['data']['uuid']
if
result
[
'status'
]:
account_uuid
=
result
[
'data'
][
'uuid'
]
sql
=
f
"insert into fi_account(name, unique_tag, config_key, description, uuid, income, output, create_time) "
\
f
"values('{param.name}', '{param.unique_tag}', '{param.config_key}', '{param.remark}', '{account_uuid}', '{income}', '{output}', {get_now_timestamp()});"
sql
=
f
"insert into fi_account(name, unique_tag,
beneficiary,
config_key, description, uuid, income, output, create_time) "
\
f
"values('{param.name}', '{param.unique_tag}', '{param.
beneficiary}','{param.
config_key}', '{param.remark}', '{account_uuid}', '{income}', '{output}', {get_now_timestamp()});"
LinkMysql
(
env
.
DB_3YV2
)
.
perform_mysql
(
sql
)
except
Exception
as
e
:
Logger
(
40
)
.
logger
.
error
(
f
"创建新账户失败,原因:{str(e)}"
)
...
...
@@ -186,7 +186,7 @@ def update_account_info(old_data):
output
=
','
.
join
(
map
(
str
,
old_data
.
output
))
try
:
sql
=
f
"update fi_account set name='{old_data.name}',income='{income}', output='{output}', "
\
f
"description='{old_data.remark}' where id = {old_data.id}"
f
"description='{old_data.remark}'
,beneficiary='{old_data.beneficiary}'
where id = {old_data.id}"
LinkMysql
(
env
.
DB_3YV2
)
.
perform_mysql
(
sql
)
except
Exception
as
e
:
Logger
(
40
)
.
logger
.
error
(
f
"修改账户sql:{sql},原因:{str(e)}"
)
...
...
@@ -709,6 +709,8 @@ class SpecificAccountQuery(object):
for
i
in
res
:
i
[
'reference_name'
]
=
TYPE_NAME
[
i
[
'reference_type'
]]
if
TYPE_NAME
.
get
(
i
[
'reference_type'
])
else
i
[
'reference_type'
]
if
self
.
unique_tag
==
'guild_account'
:
i
[
'amount_type'
]
=
'可消费'
if
i
[
'amount_type'
]
==
'consumable'
else
'可提现'
data_pd
=
pd
.
DataFrame
(
self
.
total_list
)
amount_total
=
data_pd
[
'amount'
]
.
sum
()
return
res
,
total
,
float
(
amount_total
)
...
...
app/api/account/schemas.py
View file @
b1ce71cd
...
...
@@ -16,6 +16,7 @@ class AccountCreate(BaseModel):
remark
:
Optional
[
str
]
=
''
unique_tag
:
Optional
[
str
]
=
''
config_key
:
Optional
[
str
]
=
''
beneficiary
:
Optional
[
str
]
=
''
income
:
Optional
[
list
]
=
[]
output
:
Optional
[
list
]
=
[]
...
...
@@ -32,6 +33,7 @@ class AccountUpdate(BaseModel):
remark
:
str
income
:
list
output
:
list
beneficiary
:
Optional
[
str
]
=
''
class
FinanceInfo
(
PublicModel
):
...
...
app/api/export/views.py
View file @
b1ce71cd
...
...
@@ -112,6 +112,7 @@ def reference_type_total(date: str, type: str):
def
abnormal_total
(
date
:
str
,
type
:
str
,
page
:
Optional
[
int
]
=
None
,
size
:
Optional
[
int
]
=
None
,
token
=
Depends
(
login_required
)):
"""异常数据详情"""
# 我们的第二个情人节,也陪你走过了春夏秋冬,从陌生的彼此走到了一起,完成了爱你所爱,喜你所喜,弃你所恶这样的转变
if
not
all
([
date
,
type
]):
return
HttpResultResponse
(
code
=
500
,
msg
=
'缺少必传参数'
)
result
,
tota
=
crud
.
AbnormalDataDetails
(
date
,
type
,
page
,
size
)
.
abnormal_task
()
...
...
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