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
b0310bf0
Commit
b0310bf0
authored
Feb 17, 2023
by
xianyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户提现,公会提现接口
parent
32ab311b
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
259 additions
and
121 deletions
+259
-121
views.py
app/api/role/views.py
+1
-1
crud.py
app/api/statement/crud.py
+165
-103
schemas.py
app/api/statement/schemas.py
+9
-0
views.py
app/api/statement/views.py
+17
-15
views.py
app/api/users/views.py
+1
-1
__init__.py
models/__init__.py
+2
-1
recharge.py
models/recharge.py
+64
-0
No files found.
app/api/role/views.py
View file @
b0310bf0
...
...
@@ -39,4 +39,4 @@ def delete_user(role_id: int, db: Session = Depends(get_db)):
def
role_list
(
data
:
schemas
.
RoleList
,
db
:
Session
=
Depends
(
get_db
)):
"""用户列表"""
result
=
crud
.
get_roles
(
db
,
data
)
return
HttpResultResponse
(
count
=
len
(
result
),
data
=
result
)
return
HttpResultResponse
(
total
=
len
(
result
),
data
=
result
)
app/api/statement/crud.py
View file @
b0310bf0
This diff is collapsed.
Click to expand it.
app/api/statement/schemas.py
View file @
b0310bf0
...
...
@@ -41,3 +41,12 @@ class UserWithdrawalList(BaseModel):
end_time
:
Optional
[
str
]
=
""
status
:
Optional
[
int
]
=
None
user_id
:
Optional
[
int
]
=
None
class
GuildWithdrawalList
(
BaseModel
):
page
:
Optional
[
int
]
=
None
size
:
Optional
[
int
]
=
None
start_time
:
Optional
[
str
]
=
""
end_time
:
Optional
[
str
]
=
""
status
:
Optional
[
int
]
=
None
guild_id
:
Optional
[
int
]
=
None
app/api/statement/views.py
View file @
b0310bf0
from
app.api.statement
import
crud
,
schemas
from
fastapi
import
APIRouter
from
app
import
get_db
from
fastapi
import
Depends
,
APIRouter
from
sqlalchemy.orm
import
Session
from
app.api.statement.crud
import
RechargeStatement
,
WithdrawStatement
from
libs.result_format
import
HttpResultResponse
...
...
@@ -8,28 +9,29 @@ router = APIRouter()
@
router
.
post
(
"/recharge/list"
)
def
statement_recharge_list
(
data
:
schemas
.
StatementList
):
def
statement_recharge_list
(
data
:
schemas
.
StatementList
,
db
:
Session
=
Depends
(
get_db
)
):
"""充值报表列表"""
statement_list
,
money
=
RechargeStatement
()
.
get_statements
(
data
,
1
)
return
HttpResultResponse
(
count
=
len
(
statement_list
),
total
=
money
,
data
=
statement_list
)
statement_list
,
total
,
money
=
RechargeStatement
()
.
get_statements
(
db
,
data
,
1
)
return
HttpResultResponse
(
total
=
total
,
count
=
float
(
money
)
,
data
=
statement_list
)
@
router
.
post
(
"/derive/excel"
)
def
statement_derive_excel
(
data
:
schemas
.
StatementList
):
def
statement_derive_excel
(
data
:
schemas
.
StatementList
,
db
:
Session
=
Depends
(
get_db
)
):
"""充值报表导出"""
statement_list
=
RechargeStatement
()
.
get_statements
(
data
)
statement_list
=
RechargeStatement
()
.
get_statements
(
d
b
,
d
ata
)
return
crud
.
data_to_file
(
statement_list
,
"充值报表"
)
@
router
.
post
(
"/userWithdrawal/list"
)
def
user_withdrawal_list
(
data
:
schemas
.
UserWithdrawalList
):
def
user_withdrawal_list
(
data
:
schemas
.
UserWithdrawalList
,
db
:
Session
=
Depends
(
get_db
)
):
"""用户提现列表"""
statement_list
=
WithdrawStatement
()
.
get_user_withdraw_cash
(
data
,
1
)
return
HttpResultResponse
(
data
=
statement_list
)
statement_list
,
total
,
money
,
final_money
=
WithdrawStatement
()
.
get_user_withdraw_cash
(
db
,
data
)
return
HttpResultResponse
(
total
=
total
,
count
=
float
(
money
),
actual_count
=
final_money
,
data
=
statement_list
)
@
router
.
post
(
"/guildWithdrawal/list"
)
def
guild_withdrawal_list
(
data
:
schemas
.
GuildWithdrawalList
,
db
:
Session
=
Depends
(
get_db
)):
"""公会提现列表"""
guild_list
,
total
,
money
,
final_money
=
WithdrawStatement
()
.
get_guild_withdraw_cash
(
db
,
data
)
return
HttpResultResponse
(
total
=
total
,
count
=
float
(
money
),
actual_count
=
final_money
,
data
=
guild_list
)
@
router
.
post
(
"/userWithdrawal/excel"
)
def
user_withdrawal_excel
(
data
:
schemas
.
UserWithdrawalList
):
"""用户提现导出"""
user_list
=
WithdrawStatement
()
.
get_user_withdraw_cash
(
data
)
return
crud
.
data_to_file
(
user_list
,
"用户提现"
)
app/api/users/views.py
View file @
b0310bf0
...
...
@@ -82,7 +82,7 @@ def read_user(data: schemas.PermissionCreate, db: Session = Depends(get_db)):
def
user_list
(
data
:
schemas
.
UserList
,
db
:
Session
=
Depends
(
get_db
)):
"""用户列表"""
result
=
crud
.
get_users
(
db
,
data
)
return
HttpResultResponse
(
count
=
len
(
result
),
data
=
result
)
return
HttpResultResponse
(
total
=
len
(
result
),
data
=
result
)
@
router
.
delete
(
"/delete/{user_id}"
)
...
...
models/__init__.py
View file @
b0310bf0
from
core.storage.db
import
engine
from
models
import
users
,
roles
from
models
import
users
,
roles
,
recharge
# 映射模型表
users
.
Base
.
metadata
.
create_all
(
bind
=
engine
)
roles
.
Base
.
metadata
.
create_all
(
bind
=
engine
)
recharge
.
Base
.
metadata
.
create_all
(
bind
=
engine
)
models/recharge.py
0 → 100644
View file @
b0310bf0
from
sqlalchemy
import
Column
,
Integer
,
String
,
Float
,
DateTime
from
core.storage.db
import
Base
from
sqlalchemy_serializer
import
SerializerMixin
class
Recharge
(
Base
,
SerializerMixin
):
"""充值表"""
__tablename__
=
"recharge"
id
=
Column
(
Integer
,
primary_key
=
True
,
index
=
True
)
order_number
=
Column
(
String
(
255
),
comment
=
"订单编号"
)
user_id
=
Column
(
Integer
,
comment
=
"用户ID"
)
user_number
=
Column
(
Integer
,
comment
=
"朱贝号"
)
nick_name
=
Column
(
String
(
255
),
comment
=
"昵称"
)
money
=
Column
(
Float
,
comment
=
"金额"
)
pay_channel
=
Column
(
Integer
,
comment
=
"充值渠道(-1:公会后台 0:后台添加,1:支付宝,2:网银,4:神州行充值卡,5:联通充值,3:骏网充值,"
"6第三方充值,7利用公会充值账号充值)"
)
sid
=
Column
(
String
(
255
),
comment
=
"订单序列号(在后台充值记录的是添加的备注,通过网银等充值记录的是充值成功第三方返回的订单id)"
)
last_update
=
Column
(
Integer
,
comment
=
"最后更新时间"
)
current
=
Column
(
DateTime
,
comment
=
"回调成功时间"
)
payment_time
=
Column
(
Integer
,
comment
=
"实际第三方订单支付时间"
)
class
UserWC
(
Base
,
SerializerMixin
):
"""用户提现"""
__tablename__
=
"user_withdraw_cash"
id
=
Column
(
Integer
,
primary_key
=
True
,
index
=
True
)
user_id
=
Column
(
Integer
,
comment
=
"用户ID"
)
bank_code
=
Column
(
String
(
255
),
comment
=
"银行编号"
)
user_number
=
Column
(
Integer
,
comment
=
"用户的视频号(朱贝号)"
)
nick_name
=
Column
(
String
(
255
),
comment
=
"昵称"
)
true_name
=
Column
(
String
(
255
),
comment
=
"用户真实姓名"
)
id_card
=
Column
(
String
(
255
),
comment
=
"用户的身份证号码"
)
account
=
Column
(
String
(
255
),
comment
=
"提现账号"
)
status
=
Column
(
Integer
,
comment
=
"申请的进度,0发起申请,1处理中,3成功,4失败,5已到账,6未到账"
)
money
=
Column
(
Float
,
comment
=
"金额"
)
platform_service_fee
=
Column
(
String
(
50
),
comment
=
"平台服务费"
)
third_service_fee
=
Column
(
String
(
50
),
comment
=
"第三方费用"
)
final_money
=
Column
(
String
(
50
),
comment
=
"实得收益"
)
current
=
Column
(
DateTime
,
comment
=
"回调成功时间"
)
class
GuildWC
(
Base
,
SerializerMixin
):
"""公会提现"""
__tablename__
=
"guild_withdraw_cash"
id
=
Column
(
Integer
,
primary_key
=
True
,
index
=
True
)
guild_id
=
Column
(
Integer
,
comment
=
"公会ID"
)
merchants_id
=
Column
(
Integer
,
comment
=
"招商ID"
)
account
=
Column
(
String
(
255
),
comment
=
"账号"
)
guild_name
=
Column
(
String
(
255
),
comment
=
"公会名称"
)
money
=
Column
(
Float
,
comment
=
"提现金额"
)
status
=
Column
(
Integer
,
comment
=
"提现状态,1为处理中,2为成功,3为拒绝"
)
platform_service_fee
=
Column
(
String
(
50
),
comment
=
"平台服务费"
)
third_service_fee
=
Column
(
String
(
50
),
comment
=
"第三方费用"
)
final_money
=
Column
(
String
(
50
),
comment
=
"实得收益"
)
create_time
=
Column
(
DateTime
,
comment
=
"创建时间"
)
update_time
=
Column
(
DateTime
,
comment
=
"修改时间"
)
class
Settlement
(
Base
,
SerializerMixin
):
"""公会结算"""
pass
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