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
e4fdc820
Commit
e4fdc820
authored
Oct 15, 2021
by
Aeolus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
e48d50f4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
2 deletions
+22
-2
myapps/sukang24h/api/hatch_portal.py
+21
-2
myapps/sukang24h/api/rent_portal.py
+1
-0
No files found.
myapps/sukang24h/api/hatch_portal.py
View file @
e4fdc820
...
@@ -7,9 +7,10 @@ author:Aeolus
...
@@ -7,9 +7,10 @@ author:Aeolus
"""
"""
import
logging
import
logging
from
flask
import
Blueprint
,
request
,
jsonify
from
flask
import
Blueprint
,
request
,
jsonify
,
g
from
models.models
import
Machine
,
Production
,
Hatch
from
models.base_model
import
db
from
models.models
import
Machine
,
Production
,
Hatch
,
RentDetail
from
utils.error_code
import
MACHINE_NOT_EXIST_ERROR
,
HATCH_NOT_EXIST_ERROR
from
utils.error_code
import
MACHINE_NOT_EXIST_ERROR
,
HATCH_NOT_EXIST_ERROR
from
utils.my_response
import
BaseResponse
from
utils.my_response
import
BaseResponse
...
@@ -93,3 +94,21 @@ def get_production_info():
...
@@ -93,3 +94,21 @@ def get_production_info():
}
}
return
BaseResponse
(
data
=
hatch_data
)
return
BaseResponse
(
data
=
hatch_data
)
@hatch_route.route
(
"/hatch_open"
,
methods
=
[
"POST"
])
def
run_hatch_open
():
json_data
=
request
.
get_json
()
machine_no
=
json_data
[
'machine_no'
]
hatch_no
=
json_data
[
'hatch_no'
]
user_id
=
g
.
user
.
id
rent_detail
=
RentDetail
.
query
.
filter
(
RentDetail
.
user_id
==
user_id
,
RentDetail
.
machine_no
==
machine_no
,
RentDetail
.
hatch_no
==
hatch_no
,
RentDetail
.
status
!=
-
1
,
RentDetail
.
is_take
==
0
)
.
order_by
(
RentDetail
.
id
.
desc
())
.
first
()
if
rent_detail
:
rent_detail
.
is_take
=
1
db
.
session
.
add
(
rent_detail
)
db
.
session
.
commit
()
return
BaseResponse
()
myapps/sukang24h/api/rent_portal.py
View file @
e4fdc820
...
@@ -281,6 +281,7 @@ def get_user_detail_record():
...
@@ -281,6 +281,7 @@ def get_user_detail_record():
detail_data
=
[]
detail_data
=
[]
for
i
in
rent_detail
:
for
i
in
rent_detail
:
tmp_data
=
{}
tmp_data
=
{}
tmp_data
[
"machine_no"
]
=
i
.
machine_no
tmp_data
[
"hatch_no"
]
=
i
.
hatch_no
tmp_data
[
"hatch_no"
]
=
i
.
hatch_no
tmp_data
[
"production_id"
]
=
i
.
production_id
tmp_data
[
"production_id"
]
=
i
.
production_id
tmp_data
[
"is_take"
]
=
i
.
is_take
tmp_data
[
"is_take"
]
=
i
.
is_take
...
...
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