Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
dream
Commits
50cd3378
Commit
50cd3378
authored
Feb 19, 2015
by
Ioannis Papagiannopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ReadJSWorkPlan plugin corrected
parent
87375166
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
14 deletions
+21
-14
dream/plugins/ReadJSWorkPlan.py
dream/plugins/ReadJSWorkPlan.py
+21
-14
No files found.
dream/plugins/ReadJSWorkPlan.py
View file @
50cd3378
...
@@ -5,7 +5,6 @@ import random
...
@@ -5,7 +5,6 @@ import random
import
operator
import
operator
from
datetime
import
datetime
from
datetime
import
datetime
import
copy
import
copy
import
routeQuery
from
dream.plugins
import
plugin
from
dream.plugins
import
plugin
...
@@ -31,36 +30,44 @@ class ReadJSWorkPlan(plugin.InputPreparationPlugin):
...
@@ -31,36 +30,44 @@ class ReadJSWorkPlan(plugin.InputPreparationPlugin):
""" inserts the retrieved order components and the related information (routing) to the BOM echelon
""" inserts the retrieved order components and the related information (routing) to the BOM echelon
"""
"""
self
.
data
=
data
self
.
data
=
data
WPdata
=
data
[
"input"
][
"workplan_spreadsheet"
]
WPdata
=
data
[
"input"
].
get
(
"workplan_spreadsheet"
,[])
orders
=
data
[
"input"
][
"BOM"
].
get
(
"orders"
,{})
orders
=
data
[
"input"
][
"BOM"
].
get
(
"orders"
,{})
if
WPdata
:
if
WPdata
:
WPdata
.
pop
(
0
)
# pop the column names
WPdata
.
pop
(
0
)
# pop the column names
for
line
in
WPdata
:
for
line
in
WPdata
:
orderID
=
WPdata
[
1
]
orderID
=
line
[
1
]
order
=
self
.
findEntityByID
(
orderID
)
order
=
self
.
findEntityByID
(
orderID
)
# if the order is not defined then skip this part
# if the order is not defined then skip this part
if
not
order
:
if
not
order
:
continue
continue
partID
=
WPdata
[
0
]
partID
=
line
[
0
]
part
=
self
.
findEntityByID
(
partID
)
part
=
self
.
findEntityByID
(
partID
)
# if there is no such part in the BOM then create it
# if there is no such part in the BOM then create it
if
not
part
:
if
not
part
:
partName
=
WPdata
[
2
]
partName
=
line
[
2
]
components
=
order
.
get
(
"componentsList"
,[])
components
=
order
.
get
(
"componentsList"
,[])
components
.
append
({
# the part is brand new
part
=
{
"componentID"
:
partID
,
"componentID"
:
partID
,
"componentName"
:
partName
"componentName"
:
partName
})
}
components
.
append
(
part
)
order
[
"componentsList"
]
=
components
order
[
"componentsList"
]
=
components
# update the route of the component
# update the route of the component
route
=
part
.
get
(
"route"
,
[])
route
=
part
.
get
(
"route"
,
[])
task_id
=
WPdata
[
-
1
]
task_id
=
line
[
-
1
]
sequence
=
WPdata
[
4
]
sequence
=
line
[
4
]
processingTime
=
WPdata
[
-
4
]
processingTime
=
line
[
-
4
]
operator
=
WPdata
[
5
]
operator
=
line
[
5
]
partsneeded
=
WPdata
[
-
2
].
replace
(
" "
,
""
).
split
(
','
)
partsneeded
=
line
[
-
3
]
technology
=
WPdata
[
3
]
# if there are requested parts then split them
quantity
=
WPdata
[
6
]
if
partsneeded
:
partsneeded
=
partsneeded
.
replace
(
" "
,
""
).
split
(
','
)
else
:
partsneeded
=
[
""
]
technology
=
line
[
3
]
quantity
=
line
[
6
]
# append the current step to the route of the part
route
.
append
({
route
.
append
({
"task_id"
:
task_id
,
"task_id"
:
task_id
,
"sequence"
:
sequence
,
"sequence"
:
sequence
,
...
...
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