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
5898954b
Commit
5898954b
authored
Apr 14, 2023
by
xianyang
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/development' into development
parents
1e239aff
2c77d17e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
33 additions
and
24 deletions
+33
-24
financial-system.iml
.idea/financial-system.iml
+1
-1
misc.xml
.idea/misc.xml
+1
-1
crud.py
app/api/statement/crud.py
+2
-1
guild.py
app/api/statement/guild.py
+25
-17
schemas.py
app/api/statement/schemas.py
+1
-1
views.py
app/api/statement/views.py
+2
-2
guild.py
models/guild.py
+1
-1
No files found.
.idea/financial-system.iml
View file @
5898954b
...
...
@@ -6,7 +6,7 @@
<excludeFolder
url=
"file://$MODULE_DIR$/fs-env"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/venv"
/>
</content>
<orderEntry
type=
"
jdk"
jdkName=
"Python 3.8 (financial-system)"
jdkType=
"Python SDK
"
/>
<orderEntry
type=
"
inheritedJdk
"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
</component>
<component
name=
"PyDocumentationSettings"
>
...
...
.idea/misc.xml
View file @
5898954b
...
...
@@ -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/statement/crud.py
View file @
5898954b
...
...
@@ -93,7 +93,7 @@ class RechargeStatement(object):
if
end_time
:
query
.
append
(
f
" create_time < {time_str_to_timestamp(end_time + ' 23:59:59')} "
)
query
=
' and '
.
join
(
query
)
now_month
=
get_
date_list
(
start_time
,
end_tim
e
)
now_month
=
get_
month_last_month
(
month_typ
e
)
count
,
once_res
,
moeny_data
=
self
.
statistics_data
(
month_type
,
query
,
page
,
size
,
now_month
[
0
])
else
:
query_data
=
self
.
query_add_time
(
start_time
,
end_time
,
query
)
...
...
@@ -251,6 +251,7 @@ class WithdrawStatement(object):
def
dispose_user
(
self
,
month_type
,
query
,
page
,
size
,
now_month
):
if
month_type
==
1
:
count_sql
=
f
"SELECT count(*) FROM assets_log_{now_month} where {query}"
print
(
count_sql
)
count
=
self
.
linkmysql
.
query_mysql
(
count_sql
)[
0
]
.
get
(
"count(*)"
)
sql
=
f
'SELECT uuid,a.reference_type,a.reference_number,FROM_UNIXTIME(a.create_time,"
%
Y-
%
c-
%
d
%
h:
%
i:
%
s") as payment_time,a.amount_type FROM assets_log_{now_month} as a where {query} ORDER BY id desc limit {(int(page) - 1) * size},{size}'
once_res
=
self
.
linkmysql
.
query_mysql
(
sql
)
...
...
app/api/statement/guild.py
View file @
5898954b
...
...
@@ -2,6 +2,7 @@ import json
import
math
import
socket
import
threading
import
time
from
concurrent.futures.thread
import
ThreadPoolExecutor
import
requests
...
...
@@ -93,8 +94,13 @@ class GuildSet(object):
querydata
=
db
.
query
(
GuildSettlementLog
)
.
filter
()
.
order_by
(
GuildSettlementLog
.
id
.
desc
())
.
offset
((
int
(
page
)
-
1
)
*
size
)
.
limit
(
size
)
data
=
[
QueryAllData
.
serialization
(
item
,
remove
=
{
'create_time'
,
'remark'
})
for
item
in
querydata
]
list
=
[]
for
item
in
data
:
item
[
'accounts'
]
=
item
.
get
(
"pearl"
)
+
item
.
get
(
"balance"
)
item
[
'update_time'
]
=
time
.
strftime
(
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
,
time
.
localtime
(
item
.
get
(
"update_time"
)))
list
.
append
(
item
)
count
=
db
.
query
(
func
.
count
(
GuildSettlementLog
.
id
))
.
filter
()
.
scalar
()
return
data
,
count
return
list
,
count
def
update_guild_info
(
self
,
data
):
"""公会结算修改"""
...
...
@@ -524,41 +530,43 @@ def transfer_query(data):
def
GuildSettlementAdd
(
db
,
data
):
guild_data
=
db
.
query
(
GuildSettlementLog
)
.
filter
(
GuildSettlementLog
.
work_
id
==
data
.
id
)
.
first
()
guild_data
=
db
.
query
(
GuildSettlementLog
)
.
filter
(
GuildSettlementLog
.
id
==
data
.
id
)
.
first
()
if
guild_data
:
# 修改状态
db
.
query
(
GuildSettlementLog
)
.
filter
(
GuildSettlementLog
.
work_id
==
data
.
id
)
.
update
(
{
GuildSettlementLog
.
status
:
data
.
status
,
GuildSettlementLog
.
update_time
:
get_now_timestamp
()})
db
.
commit
()
guild_sql
=
f
"select * from guild where id={guild_data.get('guild_id')} limit 0,1"
guild_sql
=
f
"select * from guild where id={guild_data.guild_id} limit 0,1"
guild_info
=
LinkMysql
(
env
.
DB_3YV2
)
.
query_mysql
(
guild_sql
)
if
not
guild_info
:
return
'公会数据错误'
return
400
,{
"name"
:
"公会数据错误"
}
acc_sql
=
f
"select * from fi_account where config_key='guildSettlement' limit 0,1"
acc_info
=
LinkMysql
(
env
.
DB_3YV2
)
.
query_mysql
(
acc_sql
)
if
not
acc_info
:
return
'财务平台账户数据错误'
if
guild_data
[
'status'
]
==
0
:
return
400
,
{
"name"
:
"财务平台账户数据错误"
}
if
guild_data
.
status
==
0
:
first_sta
=
00
# 钻石处理
if
guild_data
[
'balance'
]
and
guild_data
[
'balance'
]
>
0
:
if
guild_data
.
balance
and
guild_data
.
balance
>
0
:
balance_refer_num
=
f
'guild_settlement_{data.id}_balance'
is_failure
=
transfer_trigger_task
(
guild_info
[
'uuid'
],
0
,
data
.
balance
,
'guild_clear'
,
'consumable'
,
balance_refer_num
,
[],
1
,
acc_info
[
'uuid'
])
is_failure
=
transfer_trigger_task
(
guild_info
[
0
]
.
get
(
"uuid"
),
0
,
data
.
balance
,
'guild_clear'
,
'consumable'
,
balance_refer_num
,
[],
1
,
acc_info
[
0
]
[
'uuid'
])
if
is_failure
:
return
is_failure
return
400
,
{
"name"
:
"结算错误"
}
first_sta
=
1
# 珍珠处理
if
guild_data
[
'pearl'
]
and
guild_data
[
'pearl'
]
>
0
:
if
guild_data
.
pearl
and
guild_data
.
pearl
>
0
:
pearl_refer_num
=
f
'guild_settlement_{data.id}_pearl'
is_lose
=
transfer_trigger_task
(
guild_info
[
'uuid'
],
0
,
data
.
balance
,
'guild_clear'
,
'withdrawable'
,
pearl_refer_num
,
[],
1
,
acc_info
[
'uuid'
])
is_lose
=
transfer_trigger_task
(
guild_info
[
0
]
.
get
(
"uuid"
),
0
,
data
.
pearl
,
'guild_clear'
,
'withdrawable'
,
pearl_refer_num
,
[],
1
,
acc_info
[
0
]
[
'uuid'
])
if
is_lose
:
return
is_lose
return
400
,
{
"name"
:
"结算错误"
}
first_sta
=
1
if
first_sta
:
url
=
"http://106.55.103.148:8787/api/guild/editSettlementLog"
res
=
requests
.
post
(
url
=
url
,
json
=
json
.
dumps
({
'id'
:
guild_data
[
'id'
],
'status'
:
2
}))
json
=
{
'id'
:
guild_data
.
work_id
,
'status'
:
2
}
res
=
requests
.
post
(
url
=
url
,
json
=
json
)
if
res
.
status_code
!=
200
:
return
'财务回调失败'
return
400
,
{
"name"
:
"财务请求失败"
}
guild_data
=
db
.
query
(
GuildSettlementLog
)
.
filter
(
GuildSettlementLog
.
id
==
data
.
id
)
.
first
()
db
.
query
(
GuildSettlementLog
)
.
filter
(
GuildSettlementLog
.
work_id
==
guild_data
.
work_id
)
.
update
(
{
GuildSettlementLog
.
status
:
data
.
status
,
GuildSettlementLog
.
update_time
:
get_now_timestamp
()})
db
.
commit
()
return
''
else
:
db_export
=
GuildSettlementLog
(
work_id
=
data
.
id
,
guild_id
=
data
.
guild_id
,
balance
=
data
.
balance
,
...
...
app/api/statement/schemas.py
View file @
5898954b
...
...
@@ -159,7 +159,7 @@ class GuildAddLog(BaseModel):
status
:
int
create_time
:
Optional
[
int
]
=
None
update_time
:
Optional
[
str
]
=
None
guild_name
:
Optional
[
int
]
=
None
guild_name
:
Optional
[
str
]
=
None
guild_per
:
Optional
[
str
]
=
None
actual_money
:
Optional
[
str
]
=
None
pledge_deposit_money
:
Optional
[
str
]
=
None
app/api/statement/views.py
View file @
5898954b
...
...
@@ -259,5 +259,5 @@ def menu_list(db: Session = Depends(get_db),menu_type: Optional[int] = ""):
@
router
.
post
(
"/guild/accounts"
)
def
guild_add
(
data
:
schemas
.
GuildAddLog
,
db
:
Session
=
Depends
(
get_db
)):
"""公会结算"""
GuildSettlementAdd
(
db
,
data
)
return
HttpResultResponse
(
code
=
200
,
msg
=
HttpMessage
.
SUCCESS
)
code
,
data
=
GuildSettlementAdd
(
db
,
data
)
return
HttpResultResponse
(
code
=
code
,
data
=
data
)
models/guild.py
View file @
5898954b
...
...
@@ -143,7 +143,7 @@ class GuildSettlementLog(Base, SerializerMixin):
pearl
=
Column
(
DECIMAL
(
15
,
3
),
default
=
'0.000'
,
comment
=
"结算时候的珍珠,RMB单位"
)
status
=
Column
(
Integer
,
comment
=
"0待结算,1待结款,2已完成"
)
create_time
=
Column
(
Integer
,
default
=
'0'
,
comment
=
"创建时间"
)
update_time
=
Column
(
DateTime
,
default
=
'0'
,
comment
=
"修改时间"
)
update_time
=
Column
(
Integer
,
default
=
'0'
,
comment
=
"修改时间"
)
guild_name
=
Column
(
Integer
,
comment
=
"公会名字"
)
guild_per
=
Column
(
String
(
122
),
comment
=
"公会比例"
)
actual_money
=
Column
(
DECIMAL
(
15
,
3
),
default
=
'0.000'
,
comment
=
"实际结款"
)
...
...
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