Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
oee-services
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
harshavardhan.c
oee-services
Commits
ec053b0d
Commit
ec053b0d
authored
Jun 06, 2022
by
harshavardhan.c
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sending the start_time range for calculating the downtime while calculating batch oee.
parent
21d7bc6c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
scripts/core/handlers/batch_oee_calc_handler.py
scripts/core/handlers/batch_oee_calc_handler.py
+13
-2
No files found.
scripts/core/handlers/batch_oee_calc_handler.py
View file @
ec053b0d
...
...
@@ -66,8 +66,19 @@ class CalculateBatchOEEHandler:
CommonConstants
.
USER_META_TIME_FORMAT
)
.
astimezone
(
tz
=
pytz
.
timezone
(
request_data
.
tz
))
.
isoformat
()
request_data
=
OEEDataSaveRequest
(
**
request_data
.
dict
(
exclude_none
=
True
))
request_data
.
downtime
=
self
.
common_util
.
get_downtime_details_by_hierarchy
(
hierarchy
=
request_data
.
hierarchy
,
project_id
=
request_data
.
project_id
)
start_timestamp
=
int
(
self
.
common_util
.
pendulum_conversion
(
request_data
.
prod_start_time
,
timestamp
=
True
,
tz
=
request_data
.
tz
))
*
1000
curr_timestamp
=
int
(
self
.
common_util
.
pendulum_conversion
(
request_data
.
prod_end_time
,
timestamp
=
True
,
tz
=
request_data
.
tz
))
*
1000
downtime
=
self
.
common_util
.
get_downtime_details_by_hierarchy
(
hierarchy
=
request_data
.
hierarchy
,
project_id
=
request_data
.
project_id
,
filters
=
{
"start_time"
:
[
start_timestamp
,
curr_timestamp
]})
if
downtime
is
None
:
logger
.
debug
(
"Downtime for selected hierarchy got None, Updating to zero"
)
downtime
=
0
request_data
.
downtime
=
downtime
oee_calculation
=
oee_engine
.
start_batch_oee_calc
(
request_data
=
request_data
)
self
.
save_oee_data
(
oee_calculation
,
db
)
if
not
request_data
.
prod_end_time
:
...
...
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