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
9d0fe1d7
Commit
9d0fe1d7
authored
Jun 26, 2025
by
nningxx
Browse files
Options
Browse Files
Download
Plain Diff
tht合并到master
parents
a7dce4c0
3d3bbfe2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
3 deletions
+46
-3
tht_project/controllers/big_screen.py
+45
-2
tht_project/static/html/big_screen/view/cook_process.html
+1
-1
tht_project/static/html/big_screen/view/expected_process.html
+0
-0
tht_project/static/src/view/equipment_status.html
+0
-0
No files found.
tht_project/controllers/big_screen.py
View file @
9d0fe1d7
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
from
odoo
import
http
,
fields
from
odoo
import
http
,
fields
,
SUPERUSER_ID
from
odoo.http
import
request
from
odoo.http
import
request
from
odoo.addons.roke_mes_three_colour_light.controller.main
import
RokeMesThreeColourLight
from
odoo.addons.roke_mes_three_colour_light.controller.main
import
RokeMesThreeColourLight
import
os
import
os
import
math
import
math
from
datetime
import
datetime
,
time
from
datetime
import
datetime
,
time
,
timedelta
from
jinja2
import
Environment
,
FileSystemLoader
from
jinja2
import
Environment
,
FileSystemLoader
import
logging
import
logging
import
requests
import
requests
...
@@ -164,3 +164,46 @@ class ResMesBigScreen(http.Controller):
...
@@ -164,3 +164,46 @@ class ResMesBigScreen(http.Controller):
def
get_lishibaozhuang_data
(
self
):
def
get_lishibaozhuang_data
(
self
):
body
=
http
.
request
.
jsonrequest
body
=
http
.
request
.
jsonrequest
return
self
.
common_dws_interface
(
body
,
'/get_real_time_device_data'
,
cate
=
"制袋包装机"
)
return
self
.
common_dws_interface
(
body
,
'/get_real_time_device_data'
,
cate
=
"制袋包装机"
)
@http.route
(
'/roke/tht/get_abnormal_alarm_list'
,
type
=
'json'
,
auth
=
"none"
,
methods
=
[
'POST'
,
'OPTIONS'
],
csrf
=
False
,
cors
=
'*'
)
def
get_abnormal_alarm_list
(
self
):
"""
获取异常表单列表
:return:
"""
jsonrequest
=
http
.
request
.
jsonrequest
domain
=
[]
abnormal_alarm_id
=
jsonrequest
.
get
(
'abnormal_alarm_id'
,
False
)
#表单id
if
abnormal_alarm_id
:
domain
.
append
((
'id'
,
'='
,
abnormal_alarm_id
))
abnormal_id
=
jsonrequest
.
get
(
'abnormal_id'
,
False
)
#异常类型id
if
abnormal_id
:
domain
.
append
((
'abnormal_id'
,
'='
,
abnormal_id
))
page_size
=
int
(
http
.
request
.
jsonrequest
.
get
(
'page_size'
,
20
))
page_no
=
int
(
http
.
request
.
jsonrequest
.
get
(
'page_no'
,
1
))
abnormal_alarm_ids
=
http
.
request
.
env
(
user
=
SUPERUSER_ID
)[
'roke.abnormal.alarm'
]
.
search
(
domain
,
limit
=
page_size
,
offset
=
(
page_no
-
1
)
*
page_size
,
order
=
"originating_time desc"
)
abnormal_alarm_list
=
[]
for
item
in
abnormal_alarm_ids
:
note
=
''
if
item
.
abnormal_id
.
name
==
'设备异常'
:
note
=
f
"{item.equipment_id.name or ''}发生了故障"
elif
item
.
abnormal_id
.
name
==
'缺料断料'
:
note
=
f
"{item.sponsor.name or item.create_uid.name or ''} 发起了缺料申请"
abnormal_alarm_list
.
append
({
"id"
:
item
.
id
,
# 异常表单id
"abnormal_name"
:
item
.
abnormal_id
.
name
,
# 异常类型
"originating_time"
:
(
item
.
originating_time
+
timedelta
(
hours
=
8
))
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
if
item
.
originating_time
else
''
,
#发起时间
"note"
:
note
,
#报警表述
})
total
=
http
.
request
.
env
(
user
=
SUPERUSER_ID
)[
'roke.abnormal.alarm'
]
.
search_count
(
domain
)
return
{
"state"
:
"success"
,
"msgs"
:
"获取成功"
,
"total"
:
total
,
"abnormal_alarm_list"
:
abnormal_alarm_list
}
tht_project/static/html/big_screen/view/cook_process.html
View file @
9d0fe1d7
...
@@ -369,7 +369,7 @@
...
@@ -369,7 +369,7 @@
config
=
{},
config
=
{},
errorMessage
=
"操作失败,请稍后重试"
,
errorMessage
=
"操作失败,请稍后重试"
,
contentType
=
"application/json"
,
contentType
=
"application/json"
,
baseurl
=
"
https://tht.dws.rokecloud.com
"
baseurl
=
""
)
{
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
!
url
)
reject
(
null
)
if
(
!
url
)
reject
(
null
)
...
...
tht_project/static/html/big_screen/view/expected_process.html
View file @
9d0fe1d7
This diff is collapsed.
Click to expand it.
tht_project/static/src/view/equipment_status.html
View file @
9d0fe1d7
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