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
7c15d350
Commit
7c15d350
authored
Jun 05, 2023
by
xianyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化tcp 获取字节数
parent
d5978514
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
guild.py
app/api/statement/guild.py
+8
-2
functions.py
libs/functions.py
+1
-2
No files found.
app/api/statement/guild.py
View file @
7c15d350
...
...
@@ -12,6 +12,7 @@ from core.config.env import env, COS_PATH, COS_RERURN_PATH
from
libs.db_link
import
LinkMysql
from
libs.functions
import
get_now_timestamp
,
get_now_datetime
,
get_order
,
get_ip
,
time_str_to_timestamp
,
\
time_int_timestamp
,
send_json_rpc_request
,
AES_Decrypt
,
AES_Encrypt
from
libs.log_utils
import
Logger
from
libs.orm
import
QueryAllData
from
libs.token_verify
import
get_current_user
from
models.recharge
import
Settlement
,
Fitransferlog
,
FinanceFixLog
,
Account_log
,
Paymentlog
...
...
@@ -270,6 +271,7 @@ def query_token(db, h_list):
def
transfer_trigger_task
(
uuid
,
user_id
,
balance
,
type
,
amount_type
,
remark
=
'用户转账'
,
money_data
=
[],
isUser
=
1
,
dst_uuid
=
""
,
reference_number
=
''
):
"""转账验证"""
Logger
(
20
)
.
logger
.
info
(
"转账验证"
)
request_data
=
{
"ip"
:
get_ip
(),
"uuid"
:
uuid
,
...
...
@@ -281,13 +283,17 @@ def transfer_trigger_task(uuid, user_id, balance, type, amount_type, remark='用
"amount_type"
:
amount_type
if
amount_type
else
'consumable'
,
"notify_url"
:
""
}
res
=
send_json_rpc_request
(
request_data
,
'Server.UserExecute.Transfer'
)
try
:
if
not
res
[
'data'
][
'result'
][
'status'
]:
res
=
send_json_rpc_request
(
request_data
,
'Server.UserExecute.Transfer'
)
if
not
res
:
return
'清算系统调用失败'
Logger
(
20
)
.
logger
.
info
(
"数据验证,是否成功"
)
if
not
res
[
'status'
]:
if
'Insufficient assets'
in
res
[
'data'
][
'result'
][
'msg'
]:
return
200
,
"资产不足,无法转账"
return
res
[
'data'
][
'result'
][
'msg'
]
except
Exception
as
e
:
Logger
(
40
)
.
logger
.
error
(
f
"错误数据格式:{res}"
)
return
f
"清算系统异常:{str(e)}"
status
=
2
if
res
[
'status'
]
==
0
:
...
...
libs/functions.py
View file @
7c15d350
...
...
@@ -153,11 +153,10 @@ def send_json_rpc_request(params, method):
s
.
sendall
(
request_str
.
encode
())
# 接收服务器响应
response_str
=
s
.
recv
(
1024
)
.
decode
()
response_str
=
s
.
recv
(
1024
0
)
.
decode
()
# 将响应字符串解码为 JSON 对象
response
=
json
.
loads
(
response_str
)
if
"error"
in
response
:
return
{}
return
response
[
"result"
]
...
...
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