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
ba55c42b
Commit
ba55c42b
authored
Nov 26, 2021
by
Aeolus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
补货逻辑修改
parent
1b09c945
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
myapps/sukang24h/api/hatch_portal.py
+1
-1
myapps/sukang24h/api/tallyman_portal.py
+7
-6
No files found.
myapps/sukang24h/api/hatch_portal.py
View file @
ba55c42b
...
...
@@ -114,7 +114,7 @@ def run_hatch_open():
rent_detail
.
is_take
=
1
db
.
session
.
add
(
rent_detail
)
# 查询到柜子中的物品 数量减一
sql
=
"update
earphone_
hatch set left_count = left_count - 1 where machine_no = '{}' and hatch_no='{}'"
.
format
(
sql
=
"update hatch set left_count = left_count - 1 where machine_no = '{}' and hatch_no='{}'"
.
format
(
machine_no
,
hatch_no
)
db
.
session
.
execute
(
sql
)
db
.
session
.
commit
()
...
...
myapps/sukang24h/api/tallyman_portal.py
View file @
ba55c42b
...
...
@@ -263,8 +263,8 @@ def run_tally_start():
elif
tally_type
==
2
:
hatch_nos
=
json_data
[
'hatch_nos'
]
hatch_list
=
Hatch
.
query
.
filter
(
Hatch
.
machine_no
==
machine_no
,
Hatch
.
status
==
2
,
Hatch
.
hatch_no
.
in_
(
hatch_nos
))
.
order_by
(
Hatch
.
hatch_no
.
asc
())
.
all
()
hatch_list
=
Hatch
.
query
.
filter
(
Hatch
.
machine_no
==
machine_no
,
Hatch
.
hatch_no
.
in_
(
hatch_nos
))
.
order_by
(
Hatch
.
hatch_no
.
asc
())
.
all
()
if
not
hatch_list
:
return
jsonify
(
HATCH_NOT_EXIST_ERROR
)
else
:
...
...
@@ -306,9 +306,9 @@ def run_tally_over():
if
tally_record
:
tally_record
.
status
=
2
db
.
session
.
add
(
tally_record
)
db
.
session
.
commit
()
hatch
=
Hatch
.
query
.
filter
(
Hatch
.
machine_no
==
machine_no
,
Hatch
.
hatch_no
.
in_
(
hatch_no
),
Hatch
.
status
==
2
)
.
update
({
"status"
:
1
}
)
sql
=
"update hatch set left_count = total_count , status=1 where machine_no = '{}' and hatch_no='{}'"
.
format
(
machine_no
,
i
)
db
.
session
.
execute
(
sql
)
db
.
session
.
commit
()
elif
tally_type
==
2
:
...
...
@@ -319,9 +319,10 @@ def run_tally_over():
if
tally_record
:
tally_record
.
status
=
2
db
.
session
.
add
(
tally_record
)
hatch
=
Hatch
.
query
.
filter_by
(
machine_no
=
machine_no
,
hatch_no
=
hatch_no
,
status
=
2
)
.
first
()
hatch
=
Hatch
.
query
.
filter_by
(
machine_no
=
machine_no
,
hatch_no
=
hatch_no
)
.
first
()
if
hatch
:
hatch
.
status
=
1
hatch
.
left_count
=
hatch
.
total_count
db
.
session
.
add
(
hatch
)
db
.
session
.
commit
()
else
:
...
...
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