Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tour_business
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
0
Merge Requests
0
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
魏强
tour_business
Commits
fd2e218f
Commit
fd2e218f
authored
Jul 08, 2021
by
Aeolus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解锁仓功能
parent
284c35e0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
Controller/ToolController.py
+23
-0
No files found.
Controller/ToolController.py
View file @
fd2e218f
...
@@ -208,3 +208,26 @@ def tool_hatch_no_lock():
...
@@ -208,3 +208,26 @@ def tool_hatch_no_lock():
db
.
session
.
commit
()
db
.
session
.
commit
()
return
jsonify
(
BASE_RESPONSE
()
.
to_dict
())
return
jsonify
(
BASE_RESPONSE
()
.
to_dict
())
@route_tool.route
(
'/hatch_no_unlock'
,
methods
=
[
"POST"
])
def
tool_hatch_no_unlock
():
json_data
=
request
.
get_json
()
mac_no
=
json_data
.
get
(
'mac_no'
,
None
)
hatch_no
=
json_data
.
get
(
'hatch_no'
,
None
)
if
not
mac_no
or
not
hatch_no
:
return
jsonify
({
'code'
:
-
1
,
'msg'
:
'params error'
})
machine_info
=
Machine
.
query
.
filter_by
(
mac_no
=
mac_no
)
.
first
()
if
not
machine_info
:
return
jsonify
(
MACHINE_NOT_EXIST_ERROR
)
power_info
=
Power
.
query
.
filter_by
(
machine_id
=
machine_info
.
id
,
hatch_no
=
hatch_no
)
.
first
()
if
power_info
:
power_info
.
status
=
2
db
.
session
.
add
(
power_info
)
db
.
session
.
commit
()
return
jsonify
(
BASE_RESPONSE
()
.
to_dict
())
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