Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dwsproject
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
dws
dwsproject
Commits
bbf327f5
Commit
bbf327f5
authored
Jun 10, 2025
by
guibin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
将/roke/workstation/plant/tree接口设置成无需登录
parent
d9373859
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
76 additions
and
2 deletions
+76
-2
qdry_project/controllers/controllers.py
+76
-2
No files found.
qdry_project/controllers/controllers.py
View file @
bbf327f5
...
...
@@ -21,4 +21,78 @@ class RokeMesThreeColourLight(http.Controller):
factory_code
=
http
.
request
.
env
(
user
=
SUPERUSER_ID
)[
'ir.config_parameter'
]
.
get_param
(
'database.uuid'
,
default
=
""
)
data
=
{
"code"
:
1
,
"message"
:
"请求通过"
,
"data"
:
{
"factory_code"
:
factory_code
}}
template
=
env
.
get_template
(
'equipment_status_qdry.html'
)
return
template
.
render
(
data
)
\ No newline at end of file
return
template
.
render
(
data
)
@http.route
(
'/roke/workstation/plant/tree'
,
type
=
'json'
,
auth
=
'none'
,
csrf
=
False
,
cors
=
"*"
)
def
get_roke_workstation_plant
(
self
):
_self
=
http
.
request
no_icon
=
_self
.
jsonrequest
.
get
(
"no_icon"
,
False
)
data
=
[]
workshop_ids
=
http
.
request
.
env
(
user
=
SUPERUSER_ID
)[
'roke.workshop'
]
.
search
([
(
"plant_id"
,
"="
,
False
)
],
order
=
"name asc"
)
if
len
(
workshop_ids
)
>
0
:
data
.
append
({
"id"
:
0
,
"name"
:
"未分配至车间"
,
"type"
:
"plant"
,
"file_list"
:
[],
"workshops"
:
[
{
"id"
:
workshop_id
.
id
,
"name"
:
workshop_id
.
name
or
""
,
"type"
:
"workshop"
,
"workshop_icon"
:
workshop_id
.
workshop_icon
or
""
,
"classes_id"
:
workshop_id
.
classes_id
.
id
,
"classes_name"
:
workshop_id
.
classes_id
.
name
or
""
,
"center_count"
:
len
(
workshop_id
.
center_ids
),
"file_list"
:
[{
"name"
:
attachment
.
name
,
"file_type"
:
attachment
.
mimetype
,
"data"
:
f
"data:{attachment.mimetype};base64,{attachment.datas.decode('utf-8')}"
if
not
no_icon
else
""
,
"url"
:
self
.
_get_attachment_file_url
(
attachment
)
}
for
attachment
in
workshop_id
.
attachment_ids
]
}
for
workshop_id
in
workshop_ids
]
})
plant_ids
=
http
.
request
.
env
(
user
=
SUPERUSER_ID
)[
'roke.plant'
]
.
search
([
],
order
=
"name asc"
)
for
plant_id
in
plant_ids
:
# print("plant_id", plant_id.company_ids)
data
.
append
({
"id"
:
plant_id
.
id
,
"name"
:
plant_id
.
name
or
"未分配至车间"
,
"type"
:
"plant"
,
"file_list"
:
[{
"name"
:
attachment
.
name
,
"file_type"
:
attachment
.
mimetype
,
"data"
:
f
"data:{attachment.mimetype};base64,{attachment.datas.decode('utf-8')}"
if
not
no_icon
else
""
,
"url"
:
self
.
_get_attachment_file_url
(
attachment
)
}
for
attachment
in
plant_id
.
attachment_ids
],
"workshops"
:
[
{
"id"
:
workshop_id
.
id
,
"name"
:
workshop_id
.
name
or
""
,
"type"
:
"workshop"
,
"workshop_icon"
:
workshop_id
.
workshop_icon
or
""
,
"classes_id"
:
workshop_id
.
classes_id
.
id
,
"classes_name"
:
workshop_id
.
classes_id
.
name
or
""
,
"center_count"
:
len
(
workshop_id
.
center_ids
),
"file_list"
:
[{
"name"
:
attachment
.
name
,
"file_type"
:
attachment
.
mimetype
,
"data"
:
f
"data:{attachment.mimetype};base64,{attachment.datas.decode('utf-8')}"
if
not
no_icon
else
""
,
"url"
:
self
.
_get_attachment_file_url
(
attachment
)
}
for
attachment
in
workshop_id
.
attachment_ids
]
}
for
workshop_id
in
plant_id
.
workshop_ids
]
})
return
{
"code"
:
0
,
"message"
:
"获取车间列表成功"
,
"data"
:
data
}
\ No newline at end of file
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