Commit 07ab8d24 authored by Jérome Perrin's avatar Jérome Perrin

PostProcessOrderLateness: read due date from the BOM

parent 3227ccaa
......@@ -11,22 +11,24 @@ class PostProcessOrderLateness(plugin.OutputPreparationPlugin, TimeSupportMixin)
order_lateness_dict = result[self.configuration_dict["output_id"]] = {}
for obj in result['elementList']:
if obj.get('_class') == "Dream.OrderDesign": # XXX How to find orders ?
dueDate, = [order['dueDate'] for order in data['input']['BOM']['productionOrders'] if order['id'] == obj['id']]
order_lateness_dict[obj["id"]] = {
"dueDate": self.convertToFormattedRealWorldTime(obj["results"]["completionTime"] - obj["results"].get("delay", 0)),
"dueDate": self.convertToFormattedRealWorldTime(dueDate),
"delay": obj["results"].get("delay", 0),
"completionDate": self.convertToFormattedRealWorldTime(obj["results"]["completionTime"])
}
if obj.get('_class') == "Dream.CapacityProject": # XXX How to find orders ?
dueDate, = [order['dueDate'] for order in data['input']['BOM']['productionOrders'] if order['id'] == obj['id']]
if obj["results"]["schedule"]:
completionTime = obj["results"]["schedule"][-1]["exitTime"]
order_lateness_dict[obj["id"]] = {
"dueDate": self.convertToFormattedRealWorldTime(obj["dueDate"]),
"delay": completionTime - obj["dueDate"],
"dueDate": self.convertToFormattedRealWorldTime(dueDate),
"delay": completionTime - dueDate,
"completionDate": self.convertToFormattedRealWorldTime(completionTime)
}
else:
order_lateness_dict[obj["id"]] = {
"dueDate": self.convertToFormattedRealWorldTime(obj["dueDate"]),
"dueDate": self.convertToFormattedRealWorldTime(dueDate),
"delay": 1000,
"completionDate": "Unfinished"
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment