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
43d88d7c
Commit
43d88d7c
authored
Oct 19, 2021
by
冯佳佳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
5a9dc40c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
8 deletions
+17
-8
myapps/sukang24h/api/machine_portal.py
+17
-8
utils/middlewares.py
+0
-0
No files found.
myapps/sukang24h/api/machine_portal.py
View file @
43d88d7c
...
...
@@ -19,15 +19,12 @@ logger = logging.getLogger(__name__)
machine_route
=
Blueprint
(
'machine'
,
__name__
)
@machine_route.route
(
'mac_upload'
,
methods
=
[
"post"
])
def
run_machine_mac_upload
():
json_data
=
request
.
get_json
()
machine_no
=
json_data
[
"machine_no"
]
mac
=
json_data
[
"mac"
]
machine
=
Machine
.
query
.
filter_by
(
machine_no
=
machine_no
,
status
=
1
)
.
first
()
if
not
machine
:
return
jsonify
(
MACHINE_NOT_EXIST_ERROR
)
...
...
@@ -42,7 +39,7 @@ def run_machine_power_upload():
json_data
=
request
.
get_json
()
machine_no
=
json_data
[
"machine_no"
]
power
=
json_data
[
"power"
]
machine
=
Machine
.
query
.
filter_by
(
machine_no
=
machine_no
,
status
=
1
)
.
first
()
if
not
machine
:
return
jsonify
(
MACHINE_NOT_EXIST_ERROR
)
...
...
@@ -57,7 +54,7 @@ def run_machine_hatch_number_upload():
json_data
=
request
.
get_json
()
machine_no
=
json_data
[
"machine_no"
]
hatch_number
=
json_data
[
"hatch_number"
]
machine
=
Machine
.
query
.
filter_by
(
machine_no
=
machine_no
,
status
=
1
)
.
first
()
if
not
machine
:
return
jsonify
(
MACHINE_NOT_EXIST_ERROR
)
...
...
@@ -72,13 +69,25 @@ def run_machine_hatch_data_upload():
json_data
=
request
.
get_json
()
machine_no
=
json_data
[
"machine_no"
]
hatch_data
=
json_data
[
"in_stock"
]
machine
=
Machine
.
query
.
filter_by
(
machine_no
=
machine_no
,
status
=
1
)
.
first
()
if
not
machine
:
return
jsonify
(
MACHINE_NOT_EXIST_ERROR
)
Hatch
.
query
.
filter
(
Hatch
.
hatch_no
.
in_
(
hatch_data
))
.
update
({
"status"
:
1
})
db
.
session
.
commit
()
Hatch
.
query
.
filter
(
Hatch
.
hatch_no
.
notin_
(
hatch_data
))
.
update
({
"status"
:
2
})
db
.
session
.
commit
()
return
BaseResponse
()
@machine_route.route
(
'get_machine_no'
,
methods
=
[
"post"
])
def
run_get_machine_no
():
json_data
=
request
.
get_json
()
qrcode_no
=
json_data
[
"qrcode_no"
]
machine
=
Machine
.
query
.
filter_by
(
qrcode_no
=
qrcode_no
,
status
=
1
)
.
first
()
if
machine
:
return
BaseResponse
(
data
=
{
"machine_no"
:
machine
.
machine_no
})
else
:
return
jsonify
(
MACHINE_NOT_EXIST_ERROR
)
utils/middlewares.py
View file @
43d88d7c
This diff is collapsed.
Click to expand it.
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