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
b01f5bd1
Commit
b01f5bd1
authored
Jan 20, 2022
by
Aeolus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
1cdf4683
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
14 deletions
+14
-14
myapps/pc_management/api/hatch_portal.py
+1
-1
myapps/pc_management/api/machine_portal.py
+3
-3
myapps/pc_management/api/place_portal.py
+1
-1
myapps/pc_management/api/production_portal.py
+9
-9
No files found.
myapps/pc_management/api/hatch_portal.py
View file @
b01f5bd1
...
...
@@ -51,7 +51,7 @@ def run_hatch_list():
where_sql
=
" where 0=0"
else
:
where_sql
=
""" where hatch.machine_no in ( select machine_no from admin_machine where
admin_machine.user_id =
{user_id}
and admin_machine.status = 1)
admin_machine.user_id =
'{user_id}'
and admin_machine.status = 1)
"""
.
format
(
user_id
=
admin
.
id
)
if
keyword
:
where_sql
+=
"""
...
...
myapps/pc_management/api/machine_portal.py
View file @
b01f5bd1
...
...
@@ -51,7 +51,7 @@ def run_machine_list():
where_sql
=
" where 0=0 "
else
:
where_sql
=
""" where machine.machine_no in ( select machine_no from admin_machine where
admin_machine.user_id =
{user_id}
and admin_machine.status = 1)"""
.
format
(
user_id
=
admin
.
id
)
admin_machine.user_id =
'{user_id}'
and admin_machine.status = 1)"""
.
format
(
user_id
=
admin
.
id
)
if
keyword
:
where_sql
+=
"""
and CONCAT(machine.machine_no,ifnull(machine.qrcode_no,'')) LIKE '
%
{keyword}
%
'
...
...
@@ -198,9 +198,9 @@ def get_machine_detail():
where_sql
=
" where 0=0 "
else
:
where_sql
=
""" where machine.machine_no in ( select machine_no from admin_machine where
admin_machine.user_id =
{user_id}
and admin_machine.status = 1) """
.
format
(
user_id
=
admin
.
id
)
admin_machine.user_id =
'{user_id}'
and admin_machine.status = 1) """
.
format
(
user_id
=
admin
.
id
)
where_sql
+=
" and machine.machine_no =
{}
"
.
format
(
machine_no
)
where_sql
+=
" and machine.machine_no =
'{}'
"
.
format
(
machine_no
)
result
=
db
.
session
.
execute
(
select_sql
+
from_sql
+
where_sql
)
.
fetchall
()
if
not
result
or
len
(
result
)
!=
1
:
...
...
myapps/pc_management/api/place_portal.py
View file @
b01f5bd1
...
...
@@ -42,7 +42,7 @@ def run_place_list():
where_sql
=
" where 0=0 "
else
:
where_sql
=
""" where place.id in ( select place_id from admin_place where
admin_place.user_id =
{}
and admin_place.status = 1) """
.
format
(
admin
.
id
)
admin_place.user_id =
'{}'
and admin_place.status = 1) """
.
format
(
admin
.
id
)
if
keyword
:
where_sql
+=
"""
...
...
myapps/pc_management/api/production_portal.py
View file @
b01f5bd1
...
...
@@ -50,7 +50,7 @@ def run_production_list():
where_sql
=
" where 0=0"
else
:
where_sql
=
""" where p.id in ( select production_id from admin_production where
admin_production.user_id =
{}
and admin_production.status = 1
admin_production.user_id =
'{}'
and admin_production.status = 1
)"""
.
format
(
admin
.
id
)
if
keyword
:
where_sql
+=
"""
...
...
@@ -234,9 +234,9 @@ def get_production_detail():
else
:
where_sql
=
""" where p.id in (
select production_id from admin_production where
admin_production.user_id =
{}
and admin_production.status = 1
admin_production.user_id =
'{}'
and admin_production.status = 1
)"""
.
format
(
admin
.
id
)
where_sql
+=
" and p.id=
{}
"
.
format
(
production_id
)
where_sql
+=
" and p.id=
'{}'
"
.
format
(
production_id
)
result
=
db
.
session
.
execute
(
select_sql
+
from_sql
+
where_sql
)
.
fetchall
()
if
not
result
or
len
(
result
)
!=
1
:
...
...
@@ -280,7 +280,7 @@ def run_brand_list():
else
:
where_sql
=
""" where b.id in (
select brand_id from admin_brand where
admin_brand.user_id =
{}
and admin_brand.status = 1
admin_brand.user_id =
'{}'
and admin_brand.status = 1
)"""
.
format
(
admin
.
id
)
if
keyword
:
where_sql
+=
"""
...
...
@@ -377,9 +377,9 @@ def get_brand_detail():
else
:
where_sql
=
""" where b.id in (
select brand_id from admin_brand where
admin_brand.user_id =
{}
and admin_brand.status = 1
admin_brand.user_id =
'{}'
and admin_brand.status = 1
)"""
.
format
(
admin
.
id
)
where_sql
+=
" and b.id =
{}
"
.
format
(
brand_id
)
where_sql
+=
" and b.id =
'{}'
"
.
format
(
brand_id
)
result
=
db
.
session
.
execute
(
select_sql
+
from_sql
+
where_sql
)
.
fetchall
()
if
not
result
or
len
(
result
)
!=
1
:
...
...
@@ -414,7 +414,7 @@ def run_production_type_list():
where_sql
=
" where 0=0"
else
:
where_sql
=
""" where p.id in ( select production_type_id from admin_production_type where
admin_production_type.user_id =
{}
and admin_production_type.status = 1
admin_production_type.user_id =
'{}'
and admin_production_type.status = 1
)
"""
.
format
(
admin
.
id
)
if
keyword
:
...
...
@@ -508,10 +508,10 @@ def get_production_type_detail():
where_sql
=
" where 0=0"
else
:
where_sql
=
""" where p.id in ( select production_type_id from admin_production_type where
admin_production_type.user_id =
{}
and admin_production_type.status = 1
admin_production_type.user_id =
'{}'
and admin_production_type.status = 1
)
"""
.
format
(
admin
.
id
)
where_sql
+=
" and b.id =
{}
"
.
format
(
production_type_id
)
where_sql
+=
" and b.id =
'{}'
"
.
format
(
production_type_id
)
result
=
db
.
session
.
execute
(
select_sql
+
from_sql
+
where_sql
)
.
fetchall
()
if
not
result
or
len
(
result
)
!=
1
:
...
...
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