Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
Automat
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
冯佳佳
Automat
Commits
75818ace
Commit
75818ace
authored
Jan 19, 2022
by
Aeolus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
6256c4df
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
364 additions
and
156 deletions
+364
-156
models/models.py
+29
-6
models_tmp.py
+234
-144
myapps/automat/api/rent_portal.py
+6
-3
myapps/pc_management/api/rent_portal.py
+93
-1
utils/error_code.py
+2
-2
No files found.
models/models.py
View file @
75818ace
...
...
@@ -349,27 +349,50 @@ class RentDetail(Base):
id
=
Column
(
INTEGER
(
10
),
primary_key
=
True
,
unique
=
True
)
rent_no
=
Column
(
String
(
40
,
'utf8mb4_unicode_ci'
),
nullable
=
False
,
comment
=
'订单编号'
)
user_id
=
Column
(
INTEGER
(
10
),
nullable
=
False
,
index
=
True
,
comment
=
'用户id'
)
user_id
=
Column
(
INTEGER
(
10
),
nullable
=
False
,
comment
=
'用户id'
)
machine_no
=
Column
(
String
(
20
,
'utf8mb4_unicode_ci'
),
nullable
=
False
,
comment
=
'机柜id'
)
hatch_no
=
Column
(
TINYINT
(
3
),
nullable
=
False
,
comment
=
'机柜仓口号'
)
production_id
=
Column
(
INTEGER
(
10
),
nullable
=
False
,
comment
=
'商品id'
)
total
=
Column
(
INTEGER
(
10
),
server_default
=
text
(
"'0'"
),
comment
=
'实收金额'
)
rent_count
=
Column
(
TINYINT
(
3
),
nullable
=
False
,
server_default
=
text
(
"'0'"
))
refund_total
=
Column
(
INTEGER
(
10
),
server_default
=
text
(
"'0'"
))
refund_count
=
Column
(
INTEGER
(
10
),
server_default
=
text
(
"'0'"
))
is_take
=
Column
(
TINYINT
(
3
),
nullable
=
False
,
server_default
=
text
(
"'0'"
),
comment
=
'是否取货'
)
name
=
Column
(
String
(
100
,
'utf8mb4_unicode_ci'
),
nullable
=
False
,
comment
=
'商品名称'
)
business_id
=
Column
(
INTEGER
(
11
),
nullable
=
False
,
server_default
=
text
(
"'0'"
))
status
=
Column
(
TINYINT
(
3
),
nullable
=
False
,
server_default
=
text
(
"'1'"
),
comment
=
'1正常 2删除'
)
production_id
=
Column
(
INTEGER
(
10
),
nullable
=
False
,
comment
=
'商品id'
)
production_name
=
Column
(
String
(
100
,
'utf8mb4_unicode_ci'
),
nullable
=
False
,
comment
=
'商品名称'
)
title
=
Column
(
String
(
200
,
'utf8mb4_unicode_ci'
),
nullable
=
False
,
comment
=
'商品标题'
)
brand_id
=
Column
(
INTEGER
(
10
),
nullable
=
False
,
comment
=
'品牌ID'
)
brand_name
=
Column
(
String
(
100
,
'utf8mb4_unicode_ci'
),
nullable
=
False
,
comment
=
'商品名称'
)
production_type_id
=
Column
(
INTEGER
(
10
),
nullable
=
False
,
comment
=
'分类ID'
)
production_type_name
=
Column
(
String
(
200
,
'utf8mb4_unicode_ci'
),
nullable
=
False
,
comment
=
'商品标题'
)
price
=
Column
(
INTEGER
(
10
),
nullable
=
False
,
comment
=
'价格'
)
rent_count
=
Column
(
INTEGER
(
10
),
nullable
=
False
,
comment
=
'数量
'
)
original_price
=
Column
(
INTEGER
(
10
),
nullable
=
False
,
comment
=
'商品原价
'
)
img
=
Column
(
String
(
200
,
'utf8mb4_unicode_ci'
))
tags
=
Column
(
String
(
255
,
'utf8mb4_unicode_ci'
),
comment
=
'商品标签'
)
content
=
Column
(
Text
(
collation
=
'utf8mb4_unicode_ci'
),
comment
=
'商品内容'
)
summary
=
Column
(
Text
(
collation
=
'utf8mb4_unicode_ci'
),
comment
=
'商品描述'
)
status
=
Column
(
TINYINT
(
3
),
nullable
=
False
,
server_default
=
text
(
"'1'"
),
comment
=
'1正常 -1删除'
)
business_id
=
Column
(
INTEGER
(
11
),
nullable
=
False
,
server_default
=
text
(
"'0'"
),
comment
=
"商户号"
)
created_at
=
Column
(
TIMESTAMP
,
server_default
=
text
(
"CURRENT_TIMESTAMP"
))
updated_at
=
Column
(
TIMESTAMP
,
server_default
=
text
(
"CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
))
weight
=
Column
(
INTEGER
(
10
),
server_default
=
text
(
"'0'"
),
comment
=
'重量'
)
weight_unit
=
Column
(
String
(
10
,
'utf8mb4_unicode_ci'
),
server_default
=
text
(
"'g'"
),
comment
=
'重量单位'
)
expiration_date
=
Column
(
INTEGER
(
10
),
server_default
=
text
(
"'0'"
),
comment
=
'保质期'
)
expiration_date_unit
=
Column
(
String
(
10
,
'utf8mb4_unicode_ci'
),
server_default
=
text
(
"'月'"
),
comment
=
'保质期单位'
)
is_expiration_date
=
Column
(
TINYINT
(
1
),
server_default
=
text
(
"'0'"
),
comment
=
'是否有保质期'
)
weight_error
=
Column
(
INTEGER
(
10
),
server_default
=
text
(
"'0'"
),
comment
=
'重量误差'
)
class
RentRefund
(
Base
):
__tablename__
=
'rent_refund'
id
=
Column
(
INTEGER
(
10
),
primary_key
=
True
)
user_id
=
Column
(
INTEGER
(
10
),
nullable
=
False
,
index
=
True
,
comment
=
'用户id'
)
refund_no
=
Column
(
String
(
191
,
'utf8mb4_unicode_ci'
),
nullable
=
False
)
rent_no
=
Column
(
String
(
191
,
'utf8mb4_unicode_ci'
),
nullable
=
False
)
rent_detail_id
=
Column
(
INTEGER
(
10
),
nullable
=
False
)
total
=
Column
(
INTEGER
(
10
),
nullable
=
False
)
comment
=
Column
(
Text
(
collation
=
'utf8mb4_unicode_ci'
))
cause
=
Column
(
String
(
191
,
'utf8mb4_unicode_ci'
))
class
SalePlan
(
Base
):
...
...
models_tmp.py
View file @
75818ace
...
...
@@ -14,38 +14,68 @@ class AdminAccount(Base):
user_no
=
Column
(
String
(
25
,
'utf8mb4_unicode_ci'
),
nullable
=
False
,
unique
=
True
)
user_name
=
Column
(
String
(
255
,
'utf8mb4_unicode_ci'
),
nullable
=
False
)
phone
=
Column
(
String
(
191
,
'utf8mb4_unicode_ci'
),
nullable
=
False
,
unique
=
True
)
level
=
Column
(
TINYINT
(
2
),
nullable
=
False
)
parent_id
=
Column
(
INTEGER
(
10
),
nullable
=
False
)
draw
=
Column
(
TINYINT
(
1
),
nullable
=
False
,
server_default
=
text
(
"'0'"
))
rate
=
Column
(
INTEGER
(
10
),
nullable
=
False
)
status
=
Column
(
INTEGER
(
1
),
nullable
=
False
)
level
=
Column
(
TINYINT
(
2
),
nullable
=
False
,
comment
=
'1:超级管理员,2:代理商,3:业务员,4:财务,5:运维管理员,6:补货员,7:客服 '
)
parent_id
=
Column
(
INTEGER
(
10
),
nullable
=
False
,
comment
=
'上级ID'
)
draw
=
Column
(
TINYINT
(
1
),
nullable
=
False
,
server_default
=
text
(
"'0'"
)
,
comment
=
'提现权限0不可以1可以'
)
rate
=
Column
(
INTEGER
(
10
),
nullable
=
False
,
comment
=
'分成比例'
)
status
=
Column
(
INTEGER
(
1
),
nullable
=
False
,
comment
=
'1:正常 2:删除'
)
_password_hash_
=
Column
(
String
(
255
,
'utf8mb4_unicode_ci'
))
comment
=
Column
(
String
(
255
,
'utf8mb4_unicode_ci'
))
created_at
=
Column
(
DateTime
,
nullable
=
False
,
server_default
=
text
(
"CURRENT_TIMESTAMP"
))
updated_at
=
Column
(
DateTime
,
nullable
=
False
,
server_default
=
text
(
"CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
))
class
AdminBrand
(
Base
):
__tablename__
=
'admin_brand'
id
=
Column
(
INTEGER
(
11
),
primary_key
=
True
)
user_id
=
Column
(
INTEGER
(
11
),
nullable
=
False
)
user_no
=
Column
(
String
(
25
,
'utf8mb4_unicode_ci'
),
nullable
=
False
)
brand_id
=
Column
(
INTEGER
(
11
),
nullable
=
False
)
status
=
Column
(
INTEGER
(
1
),
nullable
=
False
,
server_default
=
text
(
"'1'"
),
comment
=
'1:正常 2:删除'
)
created_at
=
Column
(
DateTime
,
nullable
=
False
,
server_default
=
text
(
"CURRENT_TIMESTAMP"
))
updated_at
=
Column
(
DateTime
,
nullable
=
False
,
server_default
=
text
(
"CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
))
class
AdminBusines
(
Base
):
__tablename__
=
'admin_business'
__table_args__
=
(
Index
(
'unique4admin_business_user_business'
,
'user_id'
,
'business_id'
,
unique
=
True
),
)
id
=
Column
(
INTEGER
(
11
),
primary_key
=
True
)
user_id
=
Column
(
INTEGER
(
11
),
nullable
=
False
)
user_no
=
Column
(
String
(
25
,
'utf8mb4_unicode_ci'
),
nullable
=
False
)
business_id
=
Column
(
INTEGER
(
11
),
nullable
=
False
)
status
=
Column
(
INTEGER
(
1
),
nullable
=
False
,
server_default
=
text
(
"'1'"
),
comment
=
'1:正常 -1:删除'
)
created_at
=
Column
(
DateTime
,
nullable
=
False
,
server_default
=
text
(
"CURRENT_TIMESTAMP"
))
updated_at
=
Column
(
DateTime
,
nullable
=
False
,
server_default
=
text
(
"CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
))
class
AdminLoginRecord
(
Base
):
__tablename__
=
'admin_login_record'
id
=
Column
(
INTEGER
(
10
),
primary_key
=
True
)
phone
=
Column
(
VARCHAR
(
40
),
nullable
=
False
)
platform
=
Column
(
TINYINT
(
4
),
nullable
=
False
,
server_default
=
text
(
"'1'"
))
platform
=
Column
(
TINYINT
(
4
),
nullable
=
False
,
server_default
=
text
(
"'1'"
)
,
comment
=
'平台 1PC平台'
)
ip
=
Column
(
VARCHAR
(
40
),
nullable
=
False
)
last_login
=
Column
(
DateTime
,
nullable
=
False
)
login_type
=
Column
(
INTEGER
(
1
),
nullable
=
False
)
login_type
=
Column
(
INTEGER
(
1
),
nullable
=
False
,
comment
=
'1:验证码登录 2:token 3:发送验证码 4:密码'
)
created_at
=
Column
(
DateTime
,
nullable
=
False
)
updated_at
=
Column
(
DateTime
,
nullable
=
False
)
class
AdminMachine
(
Base
):
__tablename__
=
'admin_machine'
__table_args__
=
(
Index
(
'unique4admin_machine_user_id_machine_no'
,
'user_id'
,
'machine_no'
,
unique
=
True
),
)
id
=
Column
(
INTEGER
(
11
),
primary_key
=
True
)
user_id
=
Column
(
INTEGER
(
11
),
nullable
=
False
)
user_no
=
Column
(
String
(
25
,
'utf8mb4_unicode_ci'
),
nullable
=
False
)
machine_no
=
Column
(
INTEGER
(
11
),
nullable
=
False
)
status
=
Column
(
INTEGER
(
1
),
nullable
=
False
,
server_default
=
text
(
"'1'"
))
machine_no
=
Column
(
String
(
40
,
'utf8mb4_unicode_ci'
),
nullable
=
False
)
status
=
Column
(
INTEGER
(
1
),
nullable
=
False
,
server_default
=
text
(
"'1'"
)
,
comment
=
'1:正常 -1:删除'
)
created_at
=
Column
(
DateTime
,
nullable
=
False
,
server_default
=
text
(
"CURRENT_TIMESTAMP"
))
updated_at
=
Column
(
DateTime
,
nullable
=
False
,
server_default
=
text
(
"CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
))
...
...
@@ -57,7 +87,7 @@ class AdminPlace(Base):
user_id
=
Column
(
INTEGER
(
11
),
nullable
=
False
)
user_no
=
Column
(
String
(
25
,
'utf8mb4_unicode_ci'
),
nullable
=
False
)
place_id
=
Column
(
INTEGER
(
11
),
nullable
=
False
)
status
=
Column
(
INTEGER
(
1
),
nullable
=
False
,
server_default
=
text
(
"'1'"
))
status
=
Column
(
INTEGER
(
1
),
nullable
=
False
,
server_default
=
text
(
"'1'"
)
,
comment
=
'1:正常 2:删除'
)
created_at
=
Column
(
DateTime
,
nullable
=
False
,
server_default
=
text
(
"CURRENT_TIMESTAMP"
))
updated_at
=
Column
(
DateTime
,
nullable
=
False
,
server_default
=
text
(
"CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
))
...
...
@@ -69,7 +99,19 @@ class AdminProduction(Base):
user_id
=
Column
(
INTEGER
(
11
),
nullable
=
False
)
user_no
=
Column
(
String
(
25
,
'utf8mb4_unicode_ci'
),
nullable
=
False
)
production_id
=
Column
(
INTEGER
(
11
),
nullable
=
False
)
status
=
Column
(
INTEGER
(
1
),
nullable
=
False
,
server_default
=
text
(
"'1'"
))
status
=
Column
(
INTEGER
(
1
),
nullable
=
False
,
server_default
=
text
(
"'1'"
),
comment
=
'1:正常 2:删除'
)
created_at
=
Column
(
DateTime
,
nullable
=
False
,
server_default
=
text
(
"CURRENT_TIMESTAMP"
))
updated_at
=
Column
(
DateTime
,
nullable
=
False
,
server_default
=
text
(
"CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
))
class
AdminProductionType
(
Base
):
__tablename__
=
'admin_production_type'
id
=
Column
(
INTEGER
(
11
),
primary_key
=
True
)
user_id
=
Column
(
INTEGER
(
11
),
nullable
=
False
)
user_no
=
Column
(
String
(
25
,
'utf8mb4_unicode_ci'
),
nullable
=
False
)
production_type_id
=
Column
(
INTEGER
(
11
),
nullable
=
False
)
status
=
Column
(
INTEGER
(
1
),
nullable
=
False
,
server_default
=
text
(
"'1'"
),
comment
=
'1:正常 2:删除'
)
created_at
=
Column
(
DateTime
,
nullable
=
False
,
server_default
=
text
(
"CURRENT_TIMESTAMP"
))
updated_at
=
Column
(
DateTime
,
nullable
=
False
,
server_default
=
text
(
"CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
))
...
...
@@ -78,8 +120,19 @@ class Brand(Base):
__tablename__
=
'brand'
id
=
Column
(
INTEGER
(
10
),
primary_key
=
True
)
name
=
Column
(
VARCHAR
(
191
),
nullable
=
False
,
index
=
True
)
img
=
Column
(
VARCHAR
(
191
),
nullable
=
False
)
brand_name
=
Column
(
VARCHAR
(
191
),
nullable
=
False
,
index
=
True
,
comment
=
'品牌名'
)
img
=
Column
(
VARCHAR
(
191
),
nullable
=
False
,
comment
=
'logo'
)
created_at
=
Column
(
TIMESTAMP
,
server_default
=
text
(
"CURRENT_TIMESTAMP"
))
updated_at
=
Column
(
TIMESTAMP
,
server_default
=
text
(
"CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
))
status
=
Column
(
TINYINT
(
1
),
nullable
=
False
,
server_default
=
text
(
"'1'"
),
comment
=
'状态: 1正常-1删除'
)
class
Busines
(
Base
):
__tablename__
=
'business'
id
=
Column
(
INTEGER
(
10
),
primary_key
=
True
)
business_name
=
Column
(
VARCHAR
(
191
),
nullable
=
False
,
comment
=
'品牌名'
)
status
=
Column
(
TINYINT
(
1
),
nullable
=
False
,
server_default
=
text
(
"'1'"
),
comment
=
'状态: 1正常-1删除'
)
created_at
=
Column
(
TIMESTAMP
,
server_default
=
text
(
"CURRENT_TIMESTAMP"
))
updated_at
=
Column
(
TIMESTAMP
,
server_default
=
text
(
"CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
))
...
...
@@ -91,24 +144,30 @@ class Hatch(Base):
)
id
=
Column
(
INTEGER
(
10
),
primary_key
=
True
,
unique
=
True
)
machine_no
=
Column
(
String
(
20
,
'utf8mb4_unicode_ci'
),
nullable
=
False
)
hatch_no
=
Column
(
TINYINT
(
3
),
nullable
=
False
)
production_id
=
Column
(
INTEGER
(
10
),
nullable
=
False
)
name
=
Column
(
String
(
100
,
'utf8mb4_unicode_ci'
),
nullable
=
False
)
title
=
Column
(
String
(
200
,
'utf8mb4_unicode_ci'
),
nullable
=
False
)
left_count
=
Column
(
TINYINT
(
3
),
nullable
=
False
,
server_default
=
text
(
"'1'"
))
total_count
=
Column
(
TINYINT
(
3
),
nullable
=
False
,
server_default
=
text
(
"'1'"
))
brand_id
=
Column
(
INTEGER
(
10
),
nullable
=
False
)
brand_name
=
Column
(
String
(
100
,
'utf8mb4_unicode_ci'
),
nullable
=
False
)
cate_id
=
Column
(
INTEGER
(
10
),
nullable
=
False
)
cate_name
=
Column
(
String
(
200
,
'utf8mb4_unicode_ci'
),
nullable
=
False
)
price
=
Column
(
INTEGER
(
10
),
nullable
=
False
)
original_price
=
Column
(
INTEGER
(
10
),
nullable
=
False
)
machine_no
=
Column
(
String
(
20
,
'utf8mb4_unicode_ci'
),
nullable
=
False
,
comment
=
'机柜id'
)
hatch_no
=
Column
(
TINYINT
(
3
),
nullable
=
False
,
comment
=
'机柜仓口号'
)
production_id
=
Column
(
INTEGER
(
10
),
nullable
=
False
,
comment
=
'商品id'
)
production_name
=
Column
(
String
(
100
,
'utf8mb4_unicode_ci'
),
nullable
=
False
,
comment
=
'商品名称'
)
title
=
Column
(
String
(
200
,
'utf8mb4_unicode_ci'
),
nullable
=
False
,
comment
=
'商品标题'
)
left_count
=
Column
(
TINYINT
(
3
),
nullable
=
False
,
server_default
=
text
(
"'1'"
),
comment
=
'剩余数量'
)
total_count
=
Column
(
TINYINT
(
3
),
nullable
=
False
,
server_default
=
text
(
"'1'"
),
comment
=
'总数量'
)
brand_id
=
Column
(
INTEGER
(
10
),
nullable
=
False
,
comment
=
'品牌ID'
)
brand_name
=
Column
(
String
(
100
,
'utf8mb4_unicode_ci'
),
nullable
=
False
,
comment
=
'商品名称'
)
production_type_id
=
Column
(
INTEGER
(
10
),
nullable
=
False
,
comment
=
'分类ID'
)
production_type_name
=
Column
(
String
(
200
,
'utf8mb4_unicode_ci'
),
nullable
=
False
,
comment
=
'商品标题'
)
price
=
Column
(
INTEGER
(
10
),
nullable
=
False
,
comment
=
'价格'
)
original_price
=
Column
(
INTEGER
(
10
),
nullable
=
False
,
comment
=
'商品原价'
)
weight
=
Column
(
INTEGER
(
10
),
server_default
=
text
(
"'0'"
),
comment
=
'重量'
)
weight_unit
=
Column
(
String
(
10
,
'utf8mb4_unicode_ci'
),
server_default
=
text
(
"'g'"
),
comment
=
'重量单位'
)
weight_error
=
Column
(
INTEGER
(
10
),
server_default
=
text
(
"'0'"
),
comment
=
'重量误差'
)
expiration_date
=
Column
(
INTEGER
(
10
),
server_default
=
text
(
"'0'"
),
comment
=
'保质期'
)
expiration_date_unit
=
Column
(
String
(
10
,
'utf8mb4_unicode_ci'
),
server_default
=
text
(
"'月'"
),
comment
=
'保质期单位'
)
is_expiration_date
=
Column
(
TINYINT
(
1
),
server_default
=
text
(
"'0'"
),
comment
=
'是否有保质期'
)
img
=
Column
(
String
(
200
,
'utf8mb4_unicode_ci'
))
tags
=
Column
(
String
(
255
,
'utf8mb4_unicode_ci'
))
content
=
Column
(
Text
(
collation
=
'utf8mb4_unicode_ci'
))
summary
=
Column
(
Text
(
collation
=
'utf8mb4_unicode_ci'
))
status
=
Column
(
TINYINT
(
3
),
nullable
=
False
,
server_default
=
text
(
"'1'"
))
tags
=
Column
(
String
(
255
,
'utf8mb4_unicode_ci'
)
,
comment
=
'商品标签'
)
content
=
Column
(
Text
(
collation
=
'utf8mb4_unicode_ci'
)
,
comment
=
'商品内容'
)
summary
=
Column
(
Text
(
collation
=
'utf8mb4_unicode_ci'
)
,
comment
=
'商品描述'
)
status
=
Column
(
TINYINT
(
3
),
nullable
=
False
,
server_default
=
text
(
"'1'"
)
,
comment
=
'1可售2售空'
)
created_at
=
Column
(
TIMESTAMP
,
server_default
=
text
(
"CURRENT_TIMESTAMP"
))
updated_at
=
Column
(
TIMESTAMP
,
server_default
=
text
(
"CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
))
...
...
@@ -117,23 +176,24 @@ class Machine(Base):
__tablename__
=
'machine'
id
=
Column
(
INTEGER
(
10
),
primary_key
=
True
)
machine_no
=
Column
(
String
(
20
,
'utf8mb4_unicode_ci'
),
nullable
=
False
,
unique
=
True
)
device_id
=
Column
(
String
(
45
,
'utf8mb4_unicode_ci'
),
unique
=
True
)
qrcode_no
=
Column
(
String
(
20
,
'utf8mb4_unicode_ci'
),
unique
=
True
)
machine_no
=
Column
(
String
(
20
,
'utf8mb4_unicode_ci'
),
nullable
=
False
,
unique
=
True
,
comment
=
'机柜编号'
)
device_id
=
Column
(
String
(
45
,
'utf8mb4_unicode_ci'
),
unique
=
True
,
comment
=
'蓝牙设备号'
)
qrcode_no
=
Column
(
String
(
20
,
'utf8mb4_unicode_ci'
),
unique
=
True
,
comment
=
'机柜编号'
)
mac
=
Column
(
String
(
30
,
'utf8mb4_unicode_ci'
),
unique
=
True
)
power
=
Column
(
TINYINT
(
3
),
nullable
=
False
,
server_default
=
text
(
"'0'"
))
power
=
Column
(
TINYINT
(
3
),
nullable
=
False
,
server_default
=
text
(
"'0'"
)
,
comment
=
'电量'
)
short_address
=
Column
(
VARCHAR
(
45
))
address
=
Column
(
String
(
191
,
'utf8mb4_unicode_ci'
))
address
=
Column
(
String
(
191
,
'utf8mb4_unicode_ci'
)
,
comment
=
'机柜位置'
)
place_id
=
Column
(
INTEGER
(
10
))
mch_platform
=
Column
(
INTEGER
(
11
),
nullable
=
False
,
server_default
=
text
(
"'1'"
))
position
=
Column
(
String
(
20
,
'utf8mb4_unicode_ci'
))
hatch_number
=
Column
(
TINYINT
(
3
),
nullable
=
False
,
server_default
=
text
(
"'0'"
))
type
=
Column
(
TINYINT
(
3
),
nullable
=
False
,
server_default
=
text
(
"'1'"
))
status
=
Column
(
TINYINT
(
1
),
server_default
=
text
(
"'0'"
))
mch_platform
=
Column
(
INTEGER
(
11
),
nullable
=
False
,
server_default
=
text
(
"'1'"
)
,
comment
=
'1随身玩 2晓见文旅'
)
position
=
Column
(
String
(
20
,
'utf8mb4_unicode_ci'
)
,
comment
=
'机柜位置坐标'
)
hatch_number
=
Column
(
TINYINT
(
3
),
nullable
=
False
,
server_default
=
text
(
"'0'"
)
,
comment
=
'机柜的仓口数量'
)
type
=
Column
(
TINYINT
(
3
),
nullable
=
False
,
server_default
=
text
(
"'1'"
)
,
comment
=
'机柜类型1 单库存 2多库存'
)
status
=
Column
(
TINYINT
(
1
),
server_default
=
text
(
"'0'"
)
,
comment
=
'状态: 0未激活 1正常-1删除'
)
created_at
=
Column
(
TIMESTAMP
,
nullable
=
False
,
server_default
=
text
(
"CURRENT_TIMESTAMP"
))
updated_at
=
Column
(
TIMESTAMP
,
nullable
=
False
,
server_default
=
text
(
"CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
))
command_time
=
Column
(
INTEGER
(
4
),
nullable
=
False
,
server_default
=
text
(
"'1'"
))
discounts_id
=
Column
(
INTEGER
(
10
),
server_default
=
text
(
"'0'"
))
discounts_id
=
Column
(
INTEGER
(
10
),
server_default
=
text
(
"'0'"
),
comment
=
'折扣活动'
)
business_id
=
Column
(
INTEGER
(
10
),
nullable
=
False
,
server_default
=
text
(
"'0'"
))
class
MachineProduction
(
Base
):
...
...
@@ -143,7 +203,7 @@ class MachineProduction(Base):
machine_id
=
Column
(
INTEGER
(
10
),
nullable
=
False
)
production_id
=
Column
(
INTEGER
(
10
),
nullable
=
False
)
hatch_no
=
Column
(
INTEGER
(
10
),
nullable
=
False
)
status
=
Column
(
TINYINT
(
1
),
nullable
=
False
)
status
=
Column
(
TINYINT
(
1
),
nullable
=
False
,
comment
=
'状态: 1整除-1删除'
)
created_at
=
Column
(
TIMESTAMP
,
server_default
=
text
(
"CURRENT_TIMESTAMP"
))
updated_at
=
Column
(
TIMESTAMP
,
server_default
=
text
(
"CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
))
...
...
@@ -189,33 +249,35 @@ class ManagementTallyman(Base):
class
NfcCard
(
Base
):
__tablename__
=
'nfc_card'
__table_args__
=
{
'comment'
:
'nfc卡片表'
}
id
=
Column
(
INTEGER
(
10
),
primary_key
=
True
)
card_no
=
Column
(
String
(
40
,
'utf8mb4_unicode_ci'
))
card_no
=
Column
(
String
(
40
,
'utf8mb4_unicode_ci'
)
,
comment
=
'卡片编号'
)
user_id
=
Column
(
INTEGER
(
10
))
nick_name
=
Column
(
String
(
40
,
'utf8mb4_unicode_ci'
))
phone
=
Column
(
String
(
40
,
'utf8mb4_unicode_ci'
),
index
=
True
)
nick_name
=
Column
(
String
(
40
,
'utf8mb4_unicode_ci'
)
,
comment
=
'学生名称'
)
phone
=
Column
(
String
(
40
,
'utf8mb4_unicode_ci'
),
index
=
True
,
comment
=
'手机号'
)
money
=
Column
(
INTEGER
(
10
),
nullable
=
False
)
mch_platform
=
Column
(
INTEGER
(
11
),
nullable
=
False
,
server_default
=
text
(
"'1'"
))
mch_platform
=
Column
(
INTEGER
(
11
),
nullable
=
False
,
server_default
=
text
(
"'1'"
)
,
comment
=
'1咻咻'
)
limit_count
=
Column
(
TINYINT
(
1
),
nullable
=
False
,
server_default
=
text
(
"'-1'"
))
status
=
Column
(
TINYINT
(
4
),
nullable
=
False
)
status
=
Column
(
TINYINT
(
4
),
nullable
=
False
,
comment
=
'状态0停用1正常'
)
created_at
=
Column
(
TIMESTAMP
,
server_default
=
text
(
"CURRENT_TIMESTAMP"
))
updated_at
=
Column
(
TIMESTAMP
,
server_default
=
text
(
"CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
))
class
NfcCardPayRecord
(
Base
):
__tablename__
=
'nfc_card_pay_record'
__table_args__
=
{
'comment'
:
'nfc卡片充值表'
}
id
=
Column
(
INTEGER
(
10
),
primary_key
=
True
)
card_no
=
Column
(
String
(
40
,
'utf8mb4_unicode_ci'
),
index
=
True
)
rent_no
=
Column
(
VARCHAR
(
40
),
nullable
=
False
)
user_id
=
Column
(
INTEGER
(
10
),
nullable
=
False
)
is_pay
=
Column
(
TINYINT
(
3
),
nullable
=
False
,
server_default
=
text
(
"'0'"
))
pay_money
=
Column
(
INTEGER
(
10
),
nullable
=
False
)
mch_platform
=
Column
(
INTEGER
(
11
),
nullable
=
False
,
server_default
=
text
(
"'1'"
))
prepay_id
=
Column
(
VARCHAR
(
191
))
refund_no
=
Column
(
VARCHAR
(
191
))
status
=
Column
(
TINYINT
(
4
),
nullable
=
False
)
card_no
=
Column
(
String
(
40
,
'utf8mb4_unicode_ci'
),
index
=
True
,
comment
=
'卡片编号'
)
rent_no
=
Column
(
VARCHAR
(
40
),
nullable
=
False
,
comment
=
'租借单号'
)
user_id
=
Column
(
INTEGER
(
10
),
nullable
=
False
,
comment
=
'用户id'
)
is_pay
=
Column
(
TINYINT
(
3
),
nullable
=
False
,
server_default
=
text
(
"'0'"
)
,
comment
=
'是否支付'
)
pay_money
=
Column
(
INTEGER
(
10
),
nullable
=
False
,
comment
=
'充值金额'
)
mch_platform
=
Column
(
INTEGER
(
11
),
nullable
=
False
,
server_default
=
text
(
"'1'"
)
,
comment
=
'1随身玩 2晓见文旅'
)
prepay_id
=
Column
(
VARCHAR
(
191
)
,
comment
=
'微信支付prepay_id'
)
refund_no
=
Column
(
VARCHAR
(
191
)
,
comment
=
'退款单号'
)
status
=
Column
(
TINYINT
(
4
),
nullable
=
False
,
comment
=
'1已充值 2已圈存到账 3已退款 -1已删除'
)
created_at
=
Column
(
TIMESTAMP
,
server_default
=
text
(
"CURRENT_TIMESTAMP"
))
updated_at
=
Column
(
TIMESTAMP
,
server_default
=
text
(
"CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
))
...
...
@@ -237,16 +299,16 @@ class Place(Base):
__tablename__
=
'place'
id
=
Column
(
INTEGER
(
10
),
primary_key
=
True
)
parent_id
=
Column
(
INTEGER
(
10
))
place_name
=
Column
(
VARCHAR
(
191
),
nullable
=
False
,
index
=
True
)
img
=
Column
(
VARCHAR
(
191
))
logo
=
Column
(
VARCHAR
(
191
))
parent_id
=
Column
(
INTEGER
(
10
)
,
comment
=
'上级ID'
)
place_name
=
Column
(
VARCHAR
(
191
),
nullable
=
False
,
index
=
True
,
comment
=
'场所名'
)
img
=
Column
(
VARCHAR
(
191
)
,
comment
=
'展示界面的图片'
)
logo
=
Column
(
VARCHAR
(
191
)
,
comment
=
'微型头像'
)
address
=
Column
(
VARCHAR
(
255
),
server_default
=
text
(
"''"
))
position
=
Column
(
String
(
20
,
'utf8mb4_unicode_ci'
))
open_time
=
Column
(
VARCHAR
(
191
))
close_time
=
Column
(
VARCHAR
(
191
))
open_time
=
Column
(
VARCHAR
(
191
)
,
comment
=
'开始时间'
)
close_time
=
Column
(
VARCHAR
(
191
)
,
comment
=
'结束时间'
)
open_week
=
Column
(
VARCHAR
(
255
),
server_default
=
text
(
"''"
))
status
=
Column
(
INTEGER
(
1
),
nullable
=
False
,
server_default
=
text
(
"'1'"
))
status
=
Column
(
INTEGER
(
1
),
nullable
=
False
,
server_default
=
text
(
"'1'"
)
,
comment
=
'1:正常 2:删除'
)
created_at
=
Column
(
TIMESTAMP
,
server_default
=
text
(
"CURRENT_TIMESTAMP"
))
updated_at
=
Column
(
TIMESTAMP
,
server_default
=
text
(
"CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
))
...
...
@@ -267,23 +329,23 @@ class Production(Base):
id
=
Column
(
INTEGER
(
10
),
primary_key
=
True
)
production_no
=
Column
(
String
(
45
,
'utf8mb4_unicode_ci'
),
nullable
=
False
)
production_name
=
Column
(
String
(
100
,
'utf8mb4_unicode_ci'
),
nullable
=
False
,
index
=
True
)
title
=
Column
(
String
(
200
,
'utf8mb4_unicode_ci'
),
nullable
=
False
)
brand_id
=
Column
(
INTEGER
(
10
),
nullable
=
False
)
production_type_id
=
Column
(
INTEGER
(
10
),
nullable
=
False
)
price
=
Column
(
INTEGER
(
10
),
nullable
=
False
)
original_price
=
Column
(
INTEGER
(
10
),
nullable
=
False
)
weight
=
Column
(
INTEGER
(
10
),
server_default
=
text
(
"'0'"
))
weight_unit
=
Column
(
String
(
10
,
'utf8mb4_unicode_ci'
),
server_default
=
text
(
"'g'"
))
expiration_date
=
Column
(
INTEGER
(
10
),
server_default
=
text
(
"'0'"
))
expiration_date_unit
=
Column
(
String
(
10
,
'utf8mb4_unicode_ci'
),
server_default
=
text
(
"'
'"
)
)
is_expiration_date
=
Column
(
TINYINT
(
1
),
server_default
=
text
(
"'0'"
))
weight_error
=
Column
(
INTEGER
(
10
),
server_default
=
text
(
"'0'"
))
production_name
=
Column
(
String
(
100
,
'utf8mb4_unicode_ci'
),
nullable
=
False
,
index
=
True
,
comment
=
'商品名称'
)
title
=
Column
(
String
(
200
,
'utf8mb4_unicode_ci'
),
nullable
=
False
,
comment
=
'商品标题'
)
brand_id
=
Column
(
INTEGER
(
10
),
nullable
=
False
,
comment
=
'品牌ID'
)
production_type_id
=
Column
(
INTEGER
(
10
),
nullable
=
False
,
comment
=
'分类ID'
)
price
=
Column
(
INTEGER
(
10
),
nullable
=
False
,
comment
=
'价格'
)
original_price
=
Column
(
INTEGER
(
10
),
nullable
=
False
,
comment
=
'商品原价'
)
weight
=
Column
(
INTEGER
(
10
),
server_default
=
text
(
"'0'"
)
,
comment
=
'重量'
)
weight_unit
=
Column
(
String
(
10
,
'utf8mb4_unicode_ci'
),
server_default
=
text
(
"'g'"
)
,
comment
=
'重量单位'
)
expiration_date
=
Column
(
INTEGER
(
10
),
server_default
=
text
(
"'0'"
)
,
comment
=
'保质期'
)
expiration_date_unit
=
Column
(
String
(
10
,
'utf8mb4_unicode_ci'
),
server_default
=
text
(
"'
月'"
),
comment
=
'保质期单位'
)
is_expiration_date
=
Column
(
TINYINT
(
1
),
server_default
=
text
(
"'0'"
)
,
comment
=
'是否有保质期'
)
weight_error
=
Column
(
INTEGER
(
10
),
server_default
=
text
(
"'0'"
)
,
comment
=
'重量误差'
)
img
=
Column
(
String
(
200
,
'utf8mb4_unicode_ci'
))
tags
=
Column
(
String
(
255
,
'utf8mb4_unicode_ci'
))
content
=
Column
(
Text
(
collation
=
'utf8mb4_unicode_ci'
))
summary
=
Column
(
Text
(
collation
=
'utf8mb4_unicode_ci'
))
status
=
Column
(
TINYINT
(
1
))
tags
=
Column
(
String
(
255
,
'utf8mb4_unicode_ci'
)
,
comment
=
'商品标签'
)
content
=
Column
(
Text
(
collation
=
'utf8mb4_unicode_ci'
)
,
comment
=
'商品内容'
)
summary
=
Column
(
Text
(
collation
=
'utf8mb4_unicode_ci'
)
,
comment
=
'商品描述'
)
status
=
Column
(
TINYINT
(
1
)
,
nullable
=
False
,
server_default
=
text
(
"'1'"
),
comment
=
'状态: 1正常-1删除'
)
created_at
=
Column
(
TIMESTAMP
,
server_default
=
text
(
"CURRENT_TIMESTAMP"
))
updated_at
=
Column
(
TIMESTAMP
,
server_default
=
text
(
"CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
))
...
...
@@ -292,63 +354,90 @@ class ProductionType(Base):
__tablename__
=
'production_type'
id
=
Column
(
INTEGER
(
10
),
primary_key
=
True
)
name
=
Column
(
VARCHAR
(
191
),
nullable
=
False
,
index
=
True
)
production_type_name
=
Column
(
VARCHAR
(
191
),
nullable
=
False
,
index
=
True
,
comment
=
'分类名'
)
created_at
=
Column
(
TIMESTAMP
,
server_default
=
text
(
"CURRENT_TIMESTAMP"
))
updated_at
=
Column
(
TIMESTAMP
,
server_default
=
text
(
"CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
))
catecol
=
Column
(
String
(
45
,
'utf8mb4_unicode_ci'
)
)
status
=
Column
(
TINYINT
(
1
),
nullable
=
False
,
server_default
=
text
(
"'1'"
),
comment
=
'状态: 1正常-1删除'
)
class
Rent
(
Base
):
__tablename__
=
'rent'
id
=
Column
(
INTEGER
(
10
),
primary_key
=
True
)
rent_no
=
Column
(
VARCHAR
(
40
),
nullable
=
False
,
index
=
True
)
machine_no
=
Column
(
String
(
40
,
'utf8mb4_unicode_ci'
),
nullable
=
False
,
index
=
True
)
user_id
=
Column
(
INTEGER
(
10
),
nullable
=
False
,
index
=
True
)
rent_no
=
Column
(
VARCHAR
(
40
),
nullable
=
False
,
index
=
True
,
comment
=
'租借单号'
)
machine_no
=
Column
(
String
(
40
,
'utf8mb4_unicode_ci'
),
nullable
=
False
,
index
=
True
,
comment
=
'机柜id'
)
user_id
=
Column
(
INTEGER
(
10
),
nullable
=
False
,
index
=
True
,
comment
=
'用户id'
)
card_no
=
Column
(
String
(
40
,
'utf8mb4_unicode_ci'
),
index
=
True
)
place_id
=
Column
(
INTEGER
(
10
),
nullable
=
False
,
index
=
True
)
total
=
Column
(
INTEGER
(
10
),
server_default
=
text
(
"'0'"
))
real_total
=
Column
(
INTEGER
(
10
),
server_default
=
text
(
"'0'"
))
agent_total
=
Column
(
INTEGER
(
10
),
server_default
=
text
(
"'0'"
))
back_money
=
Column
(
INTEGER
(
10
),
nullable
=
False
,
server_default
=
text
(
"'0'"
))
is_pay
=
Column
(
TINYINT
(
3
),
nullable
=
False
,
server_default
=
text
(
"'0'"
))
rent_type
=
Column
(
TINYINT
(
3
),
nullable
=
False
,
server_default
=
text
(
"'1'"
))
mch_platform
=
Column
(
INTEGER
(
1
),
nullable
=
False
,
server_default
=
text
(
"'1'"
))
add_time
=
Column
(
TIMESTAMP
,
nullable
=
False
,
server_default
=
text
(
"CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
))
pay_time
=
Column
(
TIMESTAMP
)
is_over
=
Column
(
TINYINT
(
3
),
nullable
=
False
,
server_default
=
text
(
"'0'"
))
is_cancel
=
Column
(
TINYINT
(
3
),
nullable
=
False
,
server_default
=
text
(
"'0'"
))
refund_no
=
Column
(
VARCHAR
(
191
))
expire_handle
=
Column
(
TINYINT
(
3
),
nullable
=
False
,
server_default
=
text
(
"'0'"
))
prepay_id
=
Column
(
VARCHAR
(
191
))
over_time
=
Column
(
TIMESTAMP
)
place_id
=
Column
(
INTEGER
(
10
),
nullable
=
False
,
index
=
True
,
comment
=
'场所id'
)
total
=
Column
(
INTEGER
(
10
),
server_default
=
text
(
"'0'"
)
,
comment
=
'应收金额'
)
real_total
=
Column
(
INTEGER
(
10
),
server_default
=
text
(
"'0'"
)
,
comment
=
'实收金额'
)
agent_total
=
Column
(
INTEGER
(
10
),
server_default
=
text
(
"'0'"
)
,
comment
=
'给代理商看的收入'
)
back_money
=
Column
(
INTEGER
(
10
),
nullable
=
False
,
server_default
=
text
(
"'0'"
)
,
comment
=
'退款金额'
)
is_pay
=
Column
(
TINYINT
(
3
),
nullable
=
False
,
server_default
=
text
(
"'0'"
)
,
comment
=
'是否支付'
)
rent_type
=
Column
(
TINYINT
(
3
),
nullable
=
False
,
server_default
=
text
(
"'1'"
)
,
comment
=
'租借类型1现场租借2预约3nfc租借'
)
mch_platform
=
Column
(
INTEGER
(
1
),
nullable
=
False
,
server_default
=
text
(
"'1'"
)
,
comment
=
'1待定'
)
add_time
=
Column
(
TIMESTAMP
,
nullable
=
False
,
server_default
=
text
(
"CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
)
,
comment
=
'下单时间'
)
pay_time
=
Column
(
TIMESTAMP
,
comment
=
'支付时间'
)
is_over
=
Column
(
TINYINT
(
3
),
nullable
=
False
,
server_default
=
text
(
"'0'"
)
,
comment
=
'是否完结'
)
is_cancel
=
Column
(
TINYINT
(
3
),
nullable
=
False
,
server_default
=
text
(
"'0'"
)
,
comment
=
'是否取消交易'
)
refund_no
=
Column
(
VARCHAR
(
191
)
,
comment
=
'退款单号'
)
expire_handle
=
Column
(
TINYINT
(
3
),
nullable
=
False
,
server_default
=
text
(
"'0'"
)
,
comment
=
'是否做过期处理'
)
prepay_id
=
Column
(
VARCHAR
(
191
)
,
comment
=
'微信支付prepay_id'
)
over_time
=
Column
(
TIMESTAMP
,
comment
=
'订单完结时间'
)
created_at
=
Column
(
TIMESTAMP
,
server_default
=
text
(
"CURRENT_TIMESTAMP"
))
updated_at
=
Column
(
TIMESTAMP
,
server_default
=
text
(
"CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
))
business_id
=
Column
(
INTEGER
(
11
),
nullable
=
False
,
server_default
=
text
(
"'0'"
))
class
RentDetail
(
Base
):
__tablename__
=
'rent_detail'
id
=
Column
(
INTEGER
(
10
),
primary_key
=
True
,
unique
=
True
)
rent_no
=
Column
(
String
(
40
,
'utf8mb4_unicode_ci'
),
nullable
=
False
)
user_id
=
Column
(
INTEGER
(
10
),
nullable
=
False
)
machine_no
=
Column
(
String
(
20
,
'utf8mb4_unicode_ci'
),
nullable
=
False
)
hatch_no
=
Column
(
TINYINT
(
3
),
nullable
=
False
)
production_id
=
Column
(
INTEGER
(
10
),
nullable
=
False
)
is_take
=
Column
(
TINYINT
(
3
),
nullable
=
False
,
server_default
=
text
(
"'0'"
))
name
=
Column
(
String
(
100
,
'utf8mb4_unicode_ci'
),
nullable
=
False
)
title
=
Column
(
String
(
200
,
'utf8mb4_unicode_ci'
),
nullable
=
False
)
brand_id
=
Column
(
INTEGER
(
10
),
nullable
=
False
)
brand_name
=
Column
(
String
(
100
,
'utf8mb4_unicode_ci'
),
nullable
=
False
)
cate_id
=
Column
(
INTEGER
(
10
),
nullable
=
False
)
cate_name
=
Column
(
String
(
200
,
'utf8mb4_unicode_ci'
),
nullable
=
False
)
price
=
Column
(
INTEGER
(
10
),
nullable
=
False
)
rent_count
=
Column
(
TINYINT
(
3
),
nullable
=
False
)
rent_no
=
Column
(
String
(
40
,
'utf8mb4_unicode_ci'
),
nullable
=
False
,
comment
=
'订单编号'
)
user_id
=
Column
(
INTEGER
(
10
),
nullable
=
False
,
comment
=
'用户id'
)
machine_no
=
Column
(
String
(
20
,
'utf8mb4_unicode_ci'
),
nullable
=
False
,
comment
=
'机柜id'
)
hatch_no
=
Column
(
TINYINT
(
3
),
nullable
=
False
,
comment
=
'机柜仓口号'
)
total
=
Column
(
INTEGER
(
10
),
server_default
=
text
(
"'0'"
),
comment
=
'实收金额'
)
rent_count
=
Column
(
TINYINT
(
3
),
nullable
=
False
,
server_default
=
text
(
"'0'"
))
refund_total
=
Column
(
INTEGER
(
10
),
server_default
=
text
(
"'0'"
))
refund_count
=
Column
(
INTEGER
(
10
),
server_default
=
text
(
"'0'"
))
is_take
=
Column
(
TINYINT
(
3
),
nullable
=
False
,
server_default
=
text
(
"'0'"
),
comment
=
'是否取货'
)
business_id
=
Column
(
INTEGER
(
11
),
nullable
=
False
,
server_default
=
text
(
"'0'"
))
status
=
Column
(
TINYINT
(
3
),
nullable
=
False
,
server_default
=
text
(
"'1'"
),
comment
=
'1正常 2删除'
)
production_id
=
Column
(
INTEGER
(
10
),
nullable
=
False
,
comment
=
'商品id'
)
production_name
=
Column
(
String
(
100
,
'utf8mb4_unicode_ci'
),
nullable
=
False
,
comment
=
'商品名称'
)
title
=
Column
(
String
(
200
,
'utf8mb4_unicode_ci'
),
nullable
=
False
,
comment
=
'商品标题'
)
brand_id
=
Column
(
INTEGER
(
10
),
nullable
=
False
,
comment
=
'品牌ID'
)
brand_name
=
Column
(
String
(
100
,
'utf8mb4_unicode_ci'
),
nullable
=
False
,
comment
=
'商品名称'
)
production_type_id
=
Column
(
INTEGER
(
10
),
nullable
=
False
,
comment
=
'分类ID'
)
production_type_name
=
Column
(
String
(
200
,
'utf8mb4_unicode_ci'
),
nullable
=
False
,
comment
=
'商品标题'
)
price
=
Column
(
INTEGER
(
10
),
nullable
=
False
,
comment
=
'价格'
)
original_price
=
Column
(
INTEGER
(
10
),
nullable
=
False
,
comment
=
'商品原价'
)
img
=
Column
(
String
(
200
,
'utf8mb4_unicode_ci'
))
tags
=
Column
(
String
(
255
,
'utf8mb4_unicode_ci'
))
content
=
Column
(
Text
(
collation
=
'utf8mb4_unicode_ci'
))
summary
=
Column
(
Text
(
collation
=
'utf8mb4_unicode_ci'
))
status
=
Column
(
TINYINT
(
3
),
nullable
=
False
,
server_default
=
text
(
"'1'"
))
tags
=
Column
(
String
(
255
,
'utf8mb4_unicode_ci'
),
comment
=
'商品标签'
)
content
=
Column
(
Text
(
collation
=
'utf8mb4_unicode_ci'
),
comment
=
'商品内容'
)
summary
=
Column
(
Text
(
collation
=
'utf8mb4_unicode_ci'
),
comment
=
'商品描述'
)
created_at
=
Column
(
TIMESTAMP
,
server_default
=
text
(
"CURRENT_TIMESTAMP"
))
updated_at
=
Column
(
TIMESTAMP
,
server_default
=
text
(
"CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
))
weight
=
Column
(
INTEGER
(
10
),
server_default
=
text
(
"'0'"
),
comment
=
'重量'
)
weight_unit
=
Column
(
String
(
10
,
'utf8mb4_unicode_ci'
),
server_default
=
text
(
"'g'"
),
comment
=
'重量单位'
)
expiration_date
=
Column
(
INTEGER
(
10
),
server_default
=
text
(
"'0'"
),
comment
=
'保质期'
)
expiration_date_unit
=
Column
(
String
(
10
,
'utf8mb4_unicode_ci'
),
server_default
=
text
(
"'月'"
),
comment
=
'保质期单位'
)
is_expiration_date
=
Column
(
TINYINT
(
1
),
server_default
=
text
(
"'0'"
),
comment
=
'是否有保质期'
)
weight_error
=
Column
(
INTEGER
(
10
),
server_default
=
text
(
"'0'"
),
comment
=
'重量误差'
)
class
RentRefund
(
Base
):
__tablename__
=
'rent_refund'
id
=
Column
(
INTEGER
(
11
),
primary_key
=
True
)
user_id
=
Column
(
INTEGER
(
10
),
nullable
=
False
)
refund_no
=
Column
(
VARCHAR
(
20
),
nullable
=
False
)
rent_no
=
Column
(
String
(
20
,
'utf8mb4_unicode_ci'
),
nullable
=
False
)
rent_detail_id
=
Column
(
INTEGER
(
11
),
nullable
=
False
)
total
=
Column
(
INTEGER
(
11
),
nullable
=
False
)
cause
=
Column
(
VARCHAR
(
191
))
comment
=
Column
(
TEXT
)
created_at
=
Column
(
TIMESTAMP
,
server_default
=
text
(
"CURRENT_TIMESTAMP"
))
updated_at
=
Column
(
TIMESTAMP
,
server_default
=
text
(
"CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
))
...
...
@@ -357,9 +446,9 @@ class SalePlan(Base):
__tablename__
=
'sale_plan'
id
=
Column
(
INTEGER
(
10
),
primary_key
=
True
)
name
=
Column
(
String
(
100
,
'utf8mb4_unicode_ci'
),
nullable
=
False
)
title
=
Column
(
String
(
200
,
'utf8mb4_unicode_ci'
),
nullable
=
False
)
status
=
Column
(
TINYINT
(
1
),
nullable
=
False
)
name
=
Column
(
String
(
100
,
'utf8mb4_unicode_ci'
),
nullable
=
False
,
comment
=
'方案名称'
)
title
=
Column
(
String
(
200
,
'utf8mb4_unicode_ci'
),
nullable
=
False
,
comment
=
'方案标题'
)
status
=
Column
(
TINYINT
(
1
),
nullable
=
False
,
comment
=
'状态: 1整除-1删除'
)
created_at
=
Column
(
TIMESTAMP
,
server_default
=
text
(
"CURRENT_TIMESTAMP"
))
updated_at
=
Column
(
TIMESTAMP
,
server_default
=
text
(
"CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
))
...
...
@@ -370,7 +459,7 @@ class SalePlanMachine(Base):
id
=
Column
(
INTEGER
(
10
),
primary_key
=
True
)
plan_id
=
Column
(
INTEGER
(
10
),
nullable
=
False
)
machine_id
=
Column
(
INTEGER
(
10
),
nullable
=
False
)
status
=
Column
(
TINYINT
(
1
),
nullable
=
False
)
status
=
Column
(
TINYINT
(
1
),
nullable
=
False
,
comment
=
'状态: 1正常 -1删除'
)
created_at
=
Column
(
TIMESTAMP
,
server_default
=
text
(
"CURRENT_TIMESTAMP"
))
updated_at
=
Column
(
TIMESTAMP
,
server_default
=
text
(
"CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
))
...
...
@@ -382,7 +471,7 @@ class SalePlanProduction(Base):
plan_id
=
Column
(
INTEGER
(
10
),
nullable
=
False
)
production_id
=
Column
(
INTEGER
(
10
),
nullable
=
False
)
index
=
Column
(
INTEGER
(
10
),
nullable
=
False
)
status
=
Column
(
TINYINT
(
1
),
nullable
=
False
)
status
=
Column
(
TINYINT
(
1
),
nullable
=
False
,
comment
=
'状态: 1整除-1删除'
)
created_at
=
Column
(
TIMESTAMP
,
server_default
=
text
(
"CURRENT_TIMESTAMP"
))
updated_at
=
Column
(
TIMESTAMP
,
server_default
=
text
(
"CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
))
...
...
@@ -391,14 +480,14 @@ class TallyRecord(Base):
__tablename__
=
'tally_record'
id
=
Column
(
INTEGER
(
10
),
primary_key
=
True
)
user_no
=
Column
(
String
(
25
,
'utf8mb4_unicode_ci'
),
nullable
=
False
)
user_name
=
Column
(
String
(
255
,
'utf8mb4_unicode_ci'
),
nullable
=
False
)
machine_no
=
Column
(
String
(
20
,
'utf8mb4_unicode_ci'
),
nullable
=
False
)
hatch_no
=
Column
(
TINYINT
(
3
),
nullable
=
False
)
production_id
=
Column
(
INTEGER
(
10
),
nullable
=
False
)
production_name
=
Column
(
String
(
100
,
'utf8mb4_unicode_ci'
),
nullable
=
False
)
user_no
=
Column
(
String
(
25
,
'utf8mb4_unicode_ci'
),
nullable
=
False
,
comment
=
'补货员'
)
user_name
=
Column
(
String
(
255
,
'utf8mb4_unicode_ci'
),
nullable
=
False
,
comment
=
'补货员'
)
machine_no
=
Column
(
String
(
20
,
'utf8mb4_unicode_ci'
),
nullable
=
False
,
comment
=
'机柜id'
)
hatch_no
=
Column
(
TINYINT
(
3
),
nullable
=
False
,
comment
=
'机柜仓口号'
)
production_id
=
Column
(
INTEGER
(
10
),
nullable
=
False
,
comment
=
'商品id'
)
production_name
=
Column
(
String
(
100
,
'utf8mb4_unicode_ci'
),
nullable
=
False
,
comment
=
'商品名称'
)
tally_count
=
Column
(
TINYINT
(
3
),
nullable
=
False
,
server_default
=
text
(
"'1'"
))
status
=
Column
(
TINYINT
(
3
),
nullable
=
False
,
server_default
=
text
(
"'1'"
))
status
=
Column
(
TINYINT
(
3
),
nullable
=
False
,
server_default
=
text
(
"'1'"
)
,
comment
=
'1指令已下发(等待开仓) 2指令上报(补货完成)'
)
created_at
=
Column
(
TIMESTAMP
,
server_default
=
text
(
"CURRENT_TIMESTAMP"
))
updated_at
=
Column
(
TIMESTAMP
,
server_default
=
text
(
"CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
))
...
...
@@ -410,8 +499,8 @@ class TallymanAccount(Base):
user_no
=
Column
(
String
(
25
,
'utf8mb4_unicode_ci'
),
nullable
=
False
,
unique
=
True
)
user_name
=
Column
(
String
(
255
,
'utf8mb4_unicode_ci'
),
nullable
=
False
)
phone
=
Column
(
String
(
191
,
'utf8mb4_unicode_ci'
),
nullable
=
False
,
unique
=
True
)
level
=
Column
(
INTEGER
(
1
),
nullable
=
False
)
status
=
Column
(
INTEGER
(
1
),
nullable
=
False
)
level
=
Column
(
INTEGER
(
1
),
nullable
=
False
,
comment
=
'1:补货员'
)
status
=
Column
(
INTEGER
(
1
),
nullable
=
False
,
comment
=
'1:正常 2:删除'
)
_password_hash_
=
Column
(
String
(
255
,
'utf8mb4_unicode_ci'
))
comment
=
Column
(
String
(
255
,
'utf8mb4_unicode_ci'
))
last_login
=
Column
(
DateTime
)
...
...
@@ -425,10 +514,10 @@ class TallymanLoginRecord(Base):
id
=
Column
(
INTEGER
(
10
),
primary_key
=
True
)
phone
=
Column
(
VARCHAR
(
255
),
nullable
=
False
)
platform
=
Column
(
TINYINT
(
4
),
nullable
=
False
,
server_default
=
text
(
"'2'"
))
platform
=
Column
(
TINYINT
(
4
),
nullable
=
False
,
server_default
=
text
(
"'2'"
)
,
comment
=
'平台 2小导游 8商户PC'
)
ip
=
Column
(
VARCHAR
(
255
),
nullable
=
False
)
last_login
=
Column
(
DateTime
,
nullable
=
False
)
login_type
=
Column
(
INTEGER
(
1
),
nullable
=
False
)
login_type
=
Column
(
INTEGER
(
1
),
nullable
=
False
,
comment
=
'1:验证码登录 2:token 3:发送验证码 4:密码'
)
created_at
=
Column
(
DateTime
,
nullable
=
False
)
updated_at
=
Column
(
DateTime
,
nullable
=
False
)
...
...
@@ -457,20 +546,21 @@ class TallymanPlace(Base):
class
WxUser
(
Base
):
__tablename__
=
'wx_user'
__table_args__
=
{
'comment'
:
'微信用户表'
}
id
=
Column
(
INTEGER
(
10
),
primary_key
=
True
)
openid
=
Column
(
String
(
40
,
'utf8mb4_unicode_ci'
),
index
=
True
)
unionid
=
Column
(
String
(
40
,
'utf8mb4_unicode_ci'
))
platform
=
Column
(
TINYINT
(
4
),
nullable
=
False
,
server_default
=
text
(
"'0'"
))
phone
=
Column
(
String
(
40
,
'utf8mb4_unicode_ci'
),
index
=
True
)
language
=
Column
(
String
(
40
,
'utf8mb4_unicode_ci'
))
nick_name
=
Column
(
String
(
40
,
'utf8mb4_unicode_ci'
))
gender
=
Column
(
TINYINT
(
4
),
nullable
=
False
,
server_default
=
text
(
"'0'"
))
avatar_url
=
Column
(
String
(
191
,
'utf8mb4_unicode_ci'
))
openid
=
Column
(
String
(
40
,
'utf8mb4_unicode_ci'
),
index
=
True
,
comment
=
'微信支付宝公众平台openID'
)
unionid
=
Column
(
String
(
40
,
'utf8mb4_unicode_ci'
)
,
comment
=
'微信支付宝unionid'
)
platform
=
Column
(
TINYINT
(
4
),
nullable
=
False
,
server_default
=
text
(
"'0'"
)
,
comment
=
'平台'
)
phone
=
Column
(
String
(
40
,
'utf8mb4_unicode_ci'
),
index
=
True
,
comment
=
'手机号'
)
language
=
Column
(
String
(
40
,
'utf8mb4_unicode_ci'
)
,
comment
=
'语种'
)
nick_name
=
Column
(
String
(
40
,
'utf8mb4_unicode_ci'
)
,
comment
=
'昵称'
)
gender
=
Column
(
TINYINT
(
4
),
nullable
=
False
,
server_default
=
text
(
"'0'"
)
,
comment
=
'性别 0:未知、1:男、2:女'
)
avatar_url
=
Column
(
String
(
191
,
'utf8mb4_unicode_ci'
)
,
comment
=
'头像'
)
city
=
Column
(
String
(
45
,
'utf8mb4_unicode_ci'
))
province
=
Column
(
String
(
45
,
'utf8mb4_unicode_ci'
))
country
=
Column
(
String
(
45
,
'utf8mb4_unicode_ci'
))
status
=
Column
(
TINYINT
(
4
),
nullable
=
False
)
last_login_at
=
Column
(
TIMESTAMP
,
server_default
=
text
(
"CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
))
status
=
Column
(
TINYINT
(
4
),
nullable
=
False
,
comment
=
'状态0停用1正常'
)
last_login_at
=
Column
(
TIMESTAMP
,
server_default
=
text
(
"CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
)
,
comment
=
'上次登录时间'
)
created_at
=
Column
(
TIMESTAMP
,
server_default
=
text
(
"CURRENT_TIMESTAMP"
))
updated_at
=
Column
(
TIMESTAMP
,
server_default
=
text
(
"CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
))
myapps/automat/api/rent_portal.py
View file @
75818ace
...
...
@@ -93,6 +93,7 @@ def create_rent():
rent
.
user_id
=
g
.
user
.
id
rent
.
place_id
=
machine
.
place_id
rent
.
total
=
total_fee
rent
.
real_total
=
total_fee
rent
.
add_time
=
datetime
.
datetime
.
now
()
rent
.
is_pay
=
1
rent
.
pay_time
=
datetime
.
datetime
.
now
()
...
...
@@ -105,13 +106,14 @@ def create_rent():
rent_detail
.
machine_no
=
rent
.
machine_no
rent_detail
.
hatch_no
=
open_hatch
.
hatch_no
rent_detail
.
production_id
=
open_hatch
.
production_id
rent_detail
.
name
=
open_hatch
.
production_name
rent_detail
.
production_
name
=
open_hatch
.
production_name
rent_detail
.
title
=
open_hatch
.
title
rent_detail
.
brand_id
=
open_hatch
.
brand_id
rent_detail
.
brand_name
=
open_hatch
.
brand_name
rent_detail
.
production_type_id
=
open_hatch
.
production_type_id
rent_detail
.
production_type_name
=
open_hatch
.
production_type_name
rent_detail
.
price
=
0
rent_detail
.
total
=
0
rent_detail
.
rent_count
=
1
rent_detail
.
img
=
open_hatch
.
img
rent_detail
.
tags
=
open_hatch
.
tags
...
...
@@ -260,13 +262,14 @@ def wx_pay_callback():
rent_detail
.
machine_no
=
rent
.
machine_no
rent_detail
.
hatch_no
=
i
.
hatch_no
rent_detail
.
production_id
=
i
.
production_id
rent_detail
.
name
=
i
.
production_name
rent_detail
.
production_
name
=
i
.
production_name
rent_detail
.
title
=
i
.
title
rent_detail
.
brand_id
=
i
.
brand_id
rent_detail
.
brand_name
=
i
.
brand_name
rent_detail
.
production_type_id
=
i
.
production_type_id
rent_detail
.
production_type_name
=
i
.
production_type_name
rent_detail
.
price
=
i
.
price
*
open_hatchs
[
str
(
i
.
hatch_no
)]
rent_detail
.
price
=
i
.
price
rent_detail
.
total
=
i
.
price
*
open_hatchs
[
str
(
i
.
hatch_no
)]
rent_detail
.
rent_count
=
open_hatchs
[
str
(
i
.
hatch_no
)]
rent_detail
.
img
=
i
.
img
rent_detail
.
tags
=
i
.
tags
...
...
myapps/pc_management/api/rent_portal.py
View file @
75818ace
...
...
@@ -11,8 +11,15 @@ author:Aeolus
import
logging
from
flask
import
Blueprint
,
g
,
request
,
jsonify
from
sqlalchemy.exc
import
SQLAlchemyError
from
config.wechat_config
import
platform_appid_config_list
,
pay_config_list
from
models.base_model
import
db
from
utils.error_code
import
OPERATE_LEVEL_ERROR
from
models.models
import
Rent
,
RentDetail
,
WxUser
,
Machine
,
RentRefund
from
service.rent_service
import
RentService
from
service.wechat_service
import
WeChatPayService
from
utils.error_code
import
OPERATE_LEVEL_ERROR
,
ACTION_CODE_ERROR
,
REFUND_NOT_PRODUCTION_INFO
,
Param_Invalid_Error
,
\
REFUND_MONEY_IS_ZERO
,
REFUND_MONEY_ERROR
from
utils.my_response
import
BaseResponse
logger
=
logging
.
getLogger
(
__name__
)
...
...
@@ -181,3 +188,88 @@ def get_rent_detail():
else
:
return
BaseResponse
()
@rent_route.route
(
'/rent_money_refund'
,
methods
=
[
'GET'
,
'POST'
])
def
rent_money_refund_new
():
if
g
.
user
.
level
not
in
(
1
,
2
,
4
):
return
jsonify
(
OPERATE_LEVEL_ERROR
)
json_data
=
request
.
get_json
()
action_pwd
=
json_data
[
'action_pwd'
]
if
'action_pwd'
in
json_data
else
''
rent_no
=
json_data
[
'rent_no'
]
rent_detail_id
=
json_data
[
'rent_detail_id'
]
if
action_pwd
!=
"xxzn666"
:
return
BaseResponse
(
**
ACTION_CODE_ERROR
)
cause
=
json_data
[
'cause'
]
comment
=
json_data
[
'comment'
]
if
'comment'
in
json_data
else
''
rent_info
=
db
.
session
.
query
(
RentDetail
,
Rent
,
WxUser
,
Machine
)
.
join
(
Rent
,
Rent
.
rent_no
==
RentDetail
.
rent_no
)
.
join
(
WxUser
,
WxUser
.
id
==
Rent
.
user_id
)
.
filter
(
RentDetail
.
id
==
rent_detail_id
,
Rent
.
rent_no
==
rent_no
)
.
first
()
if
not
rent_info
:
return
jsonify
(
REFUND_NOT_PRODUCTION_INFO
)
rent
=
rent_info
.
Rent
rent_detail
=
rent_info
.
RentDetail
wx_user
=
rent_info
.
WxUser
refund_count
=
int
(
json_data
[
"refund_count"
])
refund_money
=
refund_count
*
rent_detail
.
price
if
refund_money
<=
0
:
return
jsonify
(
REFUND_MONEY_IS_ZERO
)
if
refund_money
>
rent_detail
.
total
:
# 不能超出金额退款
return
jsonify
(
REFUND_MONEY_ERROR
)
new_total
=
rent_detail
.
total
-
refund_money
# 重新计算订单对应所有讲解器总收入,退款金额
rent_total
=
0
rent_details
=
RentDetail
.
query
.
filter_by
(
rent_no
=
rent
.
rent_no
)
.
all
()
for
tmp
in
rent_details
:
if
tmp
.
id
==
rent_detail
.
id
:
rent_total
+=
new_total
else
:
rent_total
+=
tmp
.
total
# 退款操作
data
=
{
"out_refund_no"
:
RentService
.
create_refund_no
(),
"out_trade_no"
:
rent_info
.
Rent
.
rent_no
,
"total_fee"
:
rent
.
total
,
"refund_fee"
:
refund_money
}
result
=
WeChatPayService
(
app_id
=
platform_appid_config_list
[
wx_user
.
platform
],
config_name
=
pay_config_list
[
rent
.
mch_platform
])
.
do_refund
(
data
)
if
result
:
try
:
rent_refund
=
RentRefund
()
rent_refund
.
user_id
=
g
.
user
.
id
rent_refund
.
refund_no
=
data
[
"out_refund_no"
]
rent_refund
.
rent_no
=
rent
.
rent_no
rent_refund
.
rent_detail_id
=
rent_detail
.
id
rent_refund
.
total
=
refund_money
rent_refund
.
comment
=
comment
rent_refund
.
cause
=
cause
rent
.
real_total
=
rent_total
rent
.
back_money
+=
refund_money
rent_detail
.
total
=
new_total
rent_detail
.
refund_count
+=
refund_count
rent_detail
.
refund_total
+=
refund_money
db
.
session
.
add
(
rent_refund
)
db
.
session
.
add
(
rent
)
db
.
session
.
add
(
rent_detail
)
db
.
session
.
commit
()
except
SQLAlchemyError
as
e
:
db
.
session
.
rollback
()
raise
e
return
BaseResponse
()
else
:
return
BaseResponse
(
error_code
=-
1
,
error_message
=
'refund failed'
)
utils/error_code.py
View file @
75818ace
#!usr/bin/env python # -*- coding:utf-8 _*- """ @version: author:Aeolus @file: error_code.py """ ### 通用错误相关 Param_Invalid_Error = { "error_code": "500", "error_message": "params is invalid, 参数无效" } TOKEN_NOT_VALID_ERROR = { "error_code": "1001", "error_message": "无效的token" } TOKEN_NOT_PROVIDED_ERROR = { "error_code": "1002", "error_message": "token未提供" } TOKEN_EXPIRE_ERROR = { "error_code": "1003", "error_message": "token超时" } PHONE_NOT_BINDING_ERROR = { "error_code": "1004", "error_message": "未绑定手机号" } PHONE_NOT_NULL_ERROR = { "error_code": "1005", "error_message": "手机号为空" } PHONE_NOT_VALID_ERROR = { "error_code": "1006", "error_message": "无效的手机号" } USER_ALREADY_REGISTER_ERROR = { "error_code": "1007", "error_message": "用户已注册" } VERIFICATION_CODE_NULL_ERROR = { "error_code": "1008", "error_message": "验证码为空" } VERIFICATION_CODE_INVALID_ERROR = { "error_code": "1009", "error_message": "验证码已失效" } VERIFICATION_CODE_ERROR = { "error_code": "1010", "error_message": "验证码错误" } PASSWORD_ERROR = { "error_code": "1011", "error_message": "账号或密码错误" } # 账号相关 12开头 ACCOUNT_ALREADY_EXISTS_ERROR = { "error_code": '1012', "error_message": "该账号已存在" } ACCOUNT_NOT_EXISTS_ERROR = { "error_code": '1013', "error_message": "账号不存在" } ACCOUNT_ALREADY_DELETE_ERROR = { "error_code": '1014', "error_message": "账号已被删除" } ACCOUNT_AGENT_SPOT_NULL_ERROR = { "error_code": '1015', "error_message": "代理商景点列表为空" } AGNET_MODULES_ERROR = { "error_code": '1016', "error_message": "用户未绑定模块" } OPERATE_TYPE_ERROR = { "error_code": '1017', "error_message": "type错误" } OPERATE_LEVEL_ERROR = { "error_code": '1018', "error_message": "权限错误" } OPERATE_ERROR = { "error_code": '1019', "error_message": "操作有误" } MODULES_NOT_EXISTS_ERROR = { "error_code": '1020', "error_message": "modules not exists,模块不存在" } ACCOUNT_AGENT_SPOT_NOT_EXIST = { "error_code": '1021', "error_message": "agent spot not exists,代理景区不存在" } AGENT_MACHINE_NOT_EXIST = { "error_code": '1022', "error_message": "agent machine not exists,代理机柜不存在" } NO_BUSINESS_ERROR = { "error_code": '1023', "error_message": "no business error,商户不存在" } ADMIN_BUSINESS_NOT_EXIST = { "error_code": '1024', "error_message": "admin business not exist,用户商户不存在" } ## 微信登陆相关 WX_LOGIN_DATA_ERROR = { "error_code": "3001", "error_message": "微信登录数据错误" } WX_LOGIN_CODE_ERROR = { "error_code": "3002", "error_message": "微信登录code值错误" } WX_OPENID_NOT_GET_ERROR = { "error_code": "3003", "error_message": "微信OpenId获取失败,请刷新重试" } WX_SESSION_KEY_ERROR = { "error_code": "3004", "error_message": "session key error" } ### 微信支付相关 WE_MINIAPP_PAY_FAIL = { "error_code": "3101", "error_message": "小程序下单失败" } ### 消息推送相关 WXBizMsgCrypt_OK = { "error_code": "0", "error_message": "WXBizMsgCrypt_OK" } WXBizMsgCrypt_ValidateSignature_Error = { "error_code": "4001", "error_message": "验证签名错误" } WXBizMsgCrypt_ParseXml_Error = { "error_code": "4002", "error_message": "解析xml错误" } WXBizMsgCrypt_ComputeSignature_Error = { "error_code": "4003", "error_message": "计算签名错误" } WXBizMsgCrypt_IllegalAesKey = { "error_code": "4004", "error_message": "Aes key非法错误" } WXBizMsgCrypt_ValidateAppid_Error = { "error_code": "4005", "error_message": "appid错误" } WXBizMsgCrypt_EncryptAES_Error = { "error_code": "4006", "error_message": "aes加密错误" } WXBizMsgCrypt_DecryptAES_Error = { "error_code": "4007", "error_message": "aes解密错误" } WXBizMsgCrypt_IllegalBuffer = { "error_code": "4008", "error_message": "illegal buffer" } WXBizMsgCrypt_EncodeBase64_Error = { "error_code": "4009", "error_message": "base64加密错误" } WXBizMsgCrypt_DecodeBase64_Error = { "error_code": "4010", "error_message": "base64解密错误" } WXBizMsgCrypt_GenReturnXml_Error = { "error_code": "4011", "error_message": "gen return xml error" } MACHINE_NOT_EXIST_ERROR = { "error_code": '5001', "error_message": "机柜不存在" } MACHINE_IS_USE_ERROR = { "error_code": '5002', "error_message": "已有他人正在租借中,请稍后" } MACHINE_IS_NOT_ONLINE_ERROR = { "error_code": '5003', "error_message": "机柜不在线" } MACHINE_ADD_ERROR = { "error_code": '5004', "error_message": "机柜添加失败" } MACHINE_NO_DUPLICATE_ERROR = { "error_code": '5005', "error_message": "machine_no duplicate,机柜编号重复" } MACHINE_EDIT_ERROR = { "error_code": '5006', "error_message": "machine edit error, 机柜修改错误" } HATCH_NOT_EXIST_ERROR = { "error_code": "5007", "error_message": "no hatch, 没有仓道商品信息" } HATCH_NOT_ALL_EXIST_ERROR = { "error_code": "5008", "error_message": "no all hatch, 存在已售出商品" } HATCH_COUNT_ERROR = { "error_code": "5009", "error_message": "hatch count error, 商品数量错误,检查数量" } MACHINE_ACTIVATED_ERROR = { "error_code": '5010', "error_message": "machine activated, 机柜已激活" } MACHINE_NO_CREATE_ERROR = { "error_code": '5011', "error_message": "machine_no create error , 机柜编号生成错误" } MACHINE_MAC_DUPLICATE_ERROR = { "error_code": '5012', "error_message": "machine_mac duplicate,机柜mac重复" } HATCH_COUNT_MAX_ERROR = { "error_code": '5013', "error_message": "hatch count max,仓道数量达到上限" } HATCH_NO_DUPLICATE_ERROR = { "error_code": '5014', "error_message": "hatch_no duplicate,仓道序号重复" } HATCH_NO_DUPLICATE_ERROR = { "error_code": '5014', "error_message": "hatch_no duplicate,仓道序号重复" } ### 订单相关 RENT_ORDER_NOT_BACK_ERROR = { "error_code": '6101', "error_message": "有未归还的订单" } RENT_ORDER_NOT_TAKE_ERROR = { "error_code": '6102', "error_message": "有未取货的订单" } RENT_ORDER_NUMBER_MAX = { "error_code": '6103', "error_message": "订单数量达到上限" } TAKE_CODE_NOT_VALID = { "error_code": '6104', "error_message": "取货码错误请确认手机号及取货码是否匹配" } CODE_CANCEL_ERROR = { "error_code": '6105', "error_message": "取货码已取消" } CODE_USED_ERROR = { "error_code": '6108', "error_message": "取货码已使用" } NO_POWER_ERROR = { "error_code": '6106', "error_message": "没有可租借设备" } NO_RENT_RECORD = { "error_code": '6107', "error_message": "订单不存在" } CODE_USED_ERROR = { "error_code": '6108', "error_message": "取货码已使用" } RENT_ORDER_NUMBER_LIMIT = { "error_code": '6109', "error_message": "机柜只允许租借一台" } REFUND_NOT_RENT_INFO = { "error_code": "6301", "error_message": "没有该订单信息" } REFUND_BACK_TIME_ERROR = { "error_code": "6302", "error_message": "归还时间异常" } REFUND_NOT_PRODUCTION_INFO = { "error_code": "6303", "error_message": "没有该讲解器信息" } REFUND_MONEY_IS_ZERO = { "error_code": "6304", "error_message": "退款金额为零" } REFUND_NO_DUPLICATE = { "error_code": "6305", "error_message": "退款单号重复" } TALLYMAN_ACCOUNT_EXIST = { "error_code": "7001", "error_message": "tallyman account exist, 补货员账号已存在" } TALLYMAN_ACCOUNT_NOT_EXIST = { "error_code": "7002", "error_message": "tallyman account not exist, 补货员账号不存在" } NFC_CARD_NOT_EXIST = { "error_code": "8001", "error_message": "nfc card not exist, 卡号错误" } NFC_CARD_ACTIVATED_ERROR = { "error_code": "8002", "error_message": "nfc card activated, 卡片已激活" } NO_NFC_CARD_ERROR = { "error_code": "8003", "error_message": "no nfc card , 不存在卡片" } RE_NFC_CARD_ERROR = { "error_code": "8004", "error_message": "re nfc card , 卡片已存在" } NFC_PAY_LOAD_SECRET_ERROR = { "error_code": "8005", "error_message": "secret error , 身份验证失败" } # 9 场所相关 NO_PLACE_ERROR = { "error_code": "9001", "error_message": "no place error,不存在场景" } # 10 商品相关 NO_PRODUCTION_ERROR = { "error_code": "10001", "error_message": "no production error,商品不存在" } NO_BRAND_ERROR = { "error_code": "10002", "error_message": "no production error,品牌不存在" } # COMMON_MONGO_ERROR = { "error_code": 5001, "error_message": "mongodb operation error, mongodb操作错误" }
\ No newline at end of file
#!usr/bin/env python # -*- coding:utf-8 _*- """ @version: author:Aeolus @file: error_code.py """ ### 通用错误相关 Param_Invalid_Error = { "error_code": "500", "error_message": "params is invalid, 参数无效" } TOKEN_NOT_VALID_ERROR = { "error_code": "1001", "error_message": "无效的token" } TOKEN_NOT_PROVIDED_ERROR = { "error_code": "1002", "error_message": "token未提供" } TOKEN_EXPIRE_ERROR = { "error_code": "1003", "error_message": "token超时" } PHONE_NOT_BINDING_ERROR = { "error_code": "1004", "error_message": "未绑定手机号" } PHONE_NOT_NULL_ERROR = { "error_code": "1005", "error_message": "手机号为空" } PHONE_NOT_VALID_ERROR = { "error_code": "1006", "error_message": "无效的手机号" } USER_ALREADY_REGISTER_ERROR = { "error_code": "1007", "error_message": "用户已注册" } VERIFICATION_CODE_NULL_ERROR = { "error_code": "1008", "error_message": "验证码为空" } VERIFICATION_CODE_INVALID_ERROR = { "error_code": "1009", "error_message": "验证码已失效" } VERIFICATION_CODE_ERROR = { "error_code": "1010", "error_message": "验证码错误" } PASSWORD_ERROR = { "error_code": "1011", "error_message": "账号或密码错误" } # 账号相关 12开头 ACCOUNT_ALREADY_EXISTS_ERROR = { "error_code": '1012', "error_message": "该账号已存在" } ACCOUNT_NOT_EXISTS_ERROR = { "error_code": '1013', "error_message": "账号不存在" } ACCOUNT_ALREADY_DELETE_ERROR = { "error_code": '1014', "error_message": "账号已被删除" } ACCOUNT_AGENT_SPOT_NULL_ERROR = { "error_code": '1015', "error_message": "代理商景点列表为空" } AGNET_MODULES_ERROR = { "error_code": '1016', "error_message": "用户未绑定模块" } OPERATE_TYPE_ERROR = { "error_code": '1017', "error_message": "type错误" } OPERATE_LEVEL_ERROR = { "error_code": '1018', "error_message": "权限错误" } OPERATE_ERROR = { "error_code": '1019', "error_message": "操作有误" } MODULES_NOT_EXISTS_ERROR = { "error_code": '1020', "error_message": "modules not exists,模块不存在" } ACCOUNT_AGENT_SPOT_NOT_EXIST = { "error_code": '1021', "error_message": "agent spot not exists,代理景区不存在" } AGENT_MACHINE_NOT_EXIST = { "error_code": '1022', "error_message": "agent machine not exists,代理机柜不存在" } NO_BUSINESS_ERROR = { "error_code": '1023', "error_message": "no business error,商户不存在" } ADMIN_BUSINESS_NOT_EXIST = { "error_code": '1024', "error_message": "admin business not exist,用户商户不存在" } ACTION_CODE_ERROR = { "error_code": '1025', "error_message": "退款操作码错误" } ## 微信登陆相关 WX_LOGIN_DATA_ERROR = { "error_code": "3001", "error_message": "微信登录数据错误" } WX_LOGIN_CODE_ERROR = { "error_code": "3002", "error_message": "微信登录code值错误" } WX_OPENID_NOT_GET_ERROR = { "error_code": "3003", "error_message": "微信OpenId获取失败,请刷新重试" } WX_SESSION_KEY_ERROR = { "error_code": "3004", "error_message": "session key error" } ### 微信支付相关 WE_MINIAPP_PAY_FAIL = { "error_code": "3101", "error_message": "小程序下单失败" } ### 消息推送相关 WXBizMsgCrypt_OK = { "error_code": "0", "error_message": "WXBizMsgCrypt_OK" } WXBizMsgCrypt_ValidateSignature_Error = { "error_code": "4001", "error_message": "验证签名错误" } WXBizMsgCrypt_ParseXml_Error = { "error_code": "4002", "error_message": "解析xml错误" } WXBizMsgCrypt_ComputeSignature_Error = { "error_code": "4003", "error_message": "计算签名错误" } WXBizMsgCrypt_IllegalAesKey = { "error_code": "4004", "error_message": "Aes key非法错误" } WXBizMsgCrypt_ValidateAppid_Error = { "error_code": "4005", "error_message": "appid错误" } WXBizMsgCrypt_EncryptAES_Error = { "error_code": "4006", "error_message": "aes加密错误" } WXBizMsgCrypt_DecryptAES_Error = { "error_code": "4007", "error_message": "aes解密错误" } WXBizMsgCrypt_IllegalBuffer = { "error_code": "4008", "error_message": "illegal buffer" } WXBizMsgCrypt_EncodeBase64_Error = { "error_code": "4009", "error_message": "base64加密错误" } WXBizMsgCrypt_DecodeBase64_Error = { "error_code": "4010", "error_message": "base64解密错误" } WXBizMsgCrypt_GenReturnXml_Error = { "error_code": "4011", "error_message": "gen return xml error" } MACHINE_NOT_EXIST_ERROR = { "error_code": '5001', "error_message": "机柜不存在" } MACHINE_IS_USE_ERROR = { "error_code": '5002', "error_message": "已有他人正在租借中,请稍后" } MACHINE_IS_NOT_ONLINE_ERROR = { "error_code": '5003', "error_message": "机柜不在线" } MACHINE_ADD_ERROR = { "error_code": '5004', "error_message": "机柜添加失败" } MACHINE_NO_DUPLICATE_ERROR = { "error_code": '5005', "error_message": "machine_no duplicate,机柜编号重复" } MACHINE_EDIT_ERROR = { "error_code": '5006', "error_message": "machine edit error, 机柜修改错误" } HATCH_NOT_EXIST_ERROR = { "error_code": "5007", "error_message": "no hatch, 没有仓道商品信息" } HATCH_NOT_ALL_EXIST_ERROR = { "error_code": "5008", "error_message": "no all hatch, 存在已售出商品" } HATCH_COUNT_ERROR = { "error_code": "5009", "error_message": "hatch count error, 商品数量错误,检查数量" } MACHINE_ACTIVATED_ERROR = { "error_code": '5010', "error_message": "machine activated, 机柜已激活" } MACHINE_NO_CREATE_ERROR = { "error_code": '5011', "error_message": "machine_no create error , 机柜编号生成错误" } MACHINE_MAC_DUPLICATE_ERROR = { "error_code": '5012', "error_message": "machine_mac duplicate,机柜mac重复" } HATCH_COUNT_MAX_ERROR = { "error_code": '5013', "error_message": "hatch count max,仓道数量达到上限" } HATCH_NO_DUPLICATE_ERROR = { "error_code": '5014', "error_message": "hatch_no duplicate,仓道序号重复" } HATCH_NO_DUPLICATE_ERROR = { "error_code": '5014', "error_message": "hatch_no duplicate,仓道序号重复" } ### 订单相关 RENT_ORDER_NOT_BACK_ERROR = { "error_code": '6101', "error_message": "有未归还的订单" } RENT_ORDER_NOT_TAKE_ERROR = { "error_code": '6102', "error_message": "有未取货的订单" } RENT_ORDER_NUMBER_MAX = { "error_code": '6103', "error_message": "订单数量达到上限" } TAKE_CODE_NOT_VALID = { "error_code": '6104', "error_message": "取货码错误请确认手机号及取货码是否匹配" } CODE_CANCEL_ERROR = { "error_code": '6105', "error_message": "取货码已取消" } CODE_USED_ERROR = { "error_code": '6108', "error_message": "取货码已使用" } NO_POWER_ERROR = { "error_code": '6106', "error_message": "没有可租借设备" } NO_RENT_RECORD = { "error_code": '6107', "error_message": "订单不存在" } CODE_USED_ERROR = { "error_code": '6108', "error_message": "取货码已使用" } RENT_ORDER_NUMBER_LIMIT = { "error_code": '6109', "error_message": "机柜只允许租借一台" } REFUND_NOT_RENT_INFO = { "error_code": "6301", "error_message": "没有该订单信息" } REFUND_BACK_TIME_ERROR = { "error_code": "6302", "error_message": "归还时间异常" } REFUND_NOT_PRODUCTION_INFO = { "error_code": "6303", "error_message": "没有该讲解器信息" } REFUND_MONEY_IS_ZERO = { "error_code": "6304", "error_message": "退款金额为零" } REFUND_NO_DUPLICATE = { "error_code": "6305", "error_message": "退款单号重复" } REFUND_MONEY_ERROR = { "error_code": "6306", "error_message": "refund money退款金额错误" } TALLYMAN_ACCOUNT_EXIST = { "error_code": "7001", "error_message": "tallyman account exist, 补货员账号已存在" } TALLYMAN_ACCOUNT_NOT_EXIST = { "error_code": "7002", "error_message": "tallyman account not exist, 补货员账号不存在" } NFC_CARD_NOT_EXIST = { "error_code": "8001", "error_message": "nfc card not exist, 卡号错误" } NFC_CARD_ACTIVATED_ERROR = { "error_code": "8002", "error_message": "nfc card activated, 卡片已激活" } NO_NFC_CARD_ERROR = { "error_code": "8003", "error_message": "no nfc card , 不存在卡片" } RE_NFC_CARD_ERROR = { "error_code": "8004", "error_message": "re nfc card , 卡片已存在" } NFC_PAY_LOAD_SECRET_ERROR = { "error_code": "8005", "error_message": "secret error , 身份验证失败" } # 9 场所相关 NO_PLACE_ERROR = { "error_code": "9001", "error_message": "no place error,不存在场景" } # 10 商品相关 NO_PRODUCTION_ERROR = { "error_code": "10001", "error_message": "no production error,商品不存在" } NO_BRAND_ERROR = { "error_code": "10002", "error_message": "no production error,品牌不存在" } # COMMON_MONGO_ERROR = { "error_code": 5001, "error_message": "mongodb operation error, mongodb操作错误" }
\ No newline at end of file
...
...
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