Class TechDataServices
java.lang.Object
org.apache.ofbiz.manufacturing.techdata.TechDataServices
TechDataServices - TechData related Services
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Timestamp
addBackward
(GenericValue techDataCalendar, Timestamp dateFrom, long amount) Used to move backward in a TechDataCalendar, start from the dateFrom and move backward only on available period.static Timestamp
addForward
(GenericValue techDataCalendar, Timestamp dateFrom, long amount) Used to move forward in a TechDataCalenda, start from the dateFrom and move forward only on available period.static long
capacityRemaining
(GenericValue techDataCalendar, Timestamp dateFrom) Used to to request the remain capacity available for dateFrom in a TechDataCalenda, If the dateFrom (param in) is not in an available TechDataCalendar period, the return value is zero.static long
capacityRemainingBackward
(GenericValue techDataCalendar, Timestamp dateFrom) Used to request the remaining capacity available for dateFrom in a TechDataCalenda, If the dateFrom (param in) is not in an available TechDataCalendar period, the return value is zero.checkRoutingTaskAssoc
(DispatchContext ctx, Map<String, ? extends Object> context) Used to check if there is not two routing task with the same SeqId valid at the same perioddayEndCapacityAvailable
(GenericValue techDataCalendarWeek, int dayEnd) Used to find the last day in the TechDataCalendarWeek where capacity != 0, ending at dayEnd, dayEnd included.dayStartCapacityAvailable
(GenericValue techDataCalendarWeek, int dayStart) Used to find the fisrt day in the TechDataCalendarWeek where capacity != 0, beginning at dayStart, dayStart included.endPreviousDay
(GenericValue techDataCalendar, Timestamp dateFrom) Used to move in a TechDataCalenda, produce the Timestamp for the end of the previous day available and its associated capacity.static GenericValue
getTechDataCalendar
(GenericValue routingTask) Used to get the techDataCalendar for a routingTask, if there is a entity exception or routingTask associated with no MachineGroup the DEFAULT TechDataCalendar is return.lookupRoutingTask
(DispatchContext ctx, Map<String, ? extends Object> context) Used to retrieve some RoutingTasks (WorkEffort) selected by Name or MachineGroup ordered by NamestartNextDay
(GenericValue techDataCalendar, Timestamp dateFrom) Used to move in a TechDataCalenda, produce the Timestamp for the begining of the next day available and its associated capacity.
-
Constructor Details
-
TechDataServices
public TechDataServices()
-
-
Method Details
-
lookupRoutingTask
public static Map<String,Object> lookupRoutingTask(DispatchContext ctx, Map<String, ? extends Object> context) Used to retrieve some RoutingTasks (WorkEffort) selected by Name or MachineGroup ordered by Name- Parameters:
ctx
- the dispatch contextcontext
- a map containing workEffortName (routingTaskName) and fixedAssetId (MachineGroup or ANY)- Returns:
- result a map containing lookupResult (list of RoutingTask <=> workEffortId with currentStatusId = "ROU_ACTIVE" and workEffortTypeId = "ROU_TASK"
-
checkRoutingTaskAssoc
public static Map<String,Object> checkRoutingTaskAssoc(DispatchContext ctx, Map<String, ? extends Object> context) Used to check if there is not two routing task with the same SeqId valid at the same period- Parameters:
ctx
- The DispatchContext that this service is operating in.context
- a map containing workEffortIdFrom (routing) and SeqId, fromDate thruDate- Returns:
- result a map containing sequenceNumNotOk which is equal to "Y" if it's not Ok
-
getTechDataCalendar
Used to get the techDataCalendar for a routingTask, if there is a entity exception or routingTask associated with no MachineGroup the DEFAULT TechDataCalendar is return.- Parameters:
routingTask
- the routingTask for which we are looking for- Returns:
- the techDataCalendar associated
-
dayStartCapacityAvailable
public static Map<String,Object> dayStartCapacityAvailable(GenericValue techDataCalendarWeek, int dayStart) Used to find the fisrt day in the TechDataCalendarWeek where capacity != 0, beginning at dayStart, dayStart included.- Parameters:
techDataCalendarWeek
- The TechDataCalendarWeek coverdayStart
-- Returns:
- a map with the capacity (Double) available and moveDay (int): the number of day it's necessary to move to have capacity available
-
capacityRemaining
Used to to request the remain capacity available for dateFrom in a TechDataCalenda, If the dateFrom (param in) is not in an available TechDataCalendar period, the return value is zero.- Parameters:
techDataCalendar
- The TechDataCalendar coverdateFrom
- the date- Returns:
- long capacityRemaining
-
startNextDay
Used to move in a TechDataCalenda, produce the Timestamp for the begining of the next day available and its associated capacity. If the dateFrom (param in) is not in an available TechDataCalendar period, the return value is the next day available- Parameters:
techDataCalendar
- The TechDataCalendar coverdateFrom
- the date- Returns:
- a map with Timestamp dateTo, Double nextCapacity
-
addForward
Used to move forward in a TechDataCalenda, start from the dateFrom and move forward only on available period. If the dateFrom (param in) is not a available TechDataCalendar period, the startDate is the begining of the next day available- Parameters:
techDataCalendar
- The TechDataCalendar coverdateFrom
- the start dateamount
- the amount of millisecond to move forward- Returns:
- the dateTo
-
dayEndCapacityAvailable
public static Map<String,Object> dayEndCapacityAvailable(GenericValue techDataCalendarWeek, int dayEnd) Used to find the last day in the TechDataCalendarWeek where capacity != 0, ending at dayEnd, dayEnd included.- Parameters:
techDataCalendarWeek
- The TechDataCalendarWeek coverdayEnd
-- Returns:
- a map with the capacity (Double) available, the startTime and moveDay (int): the number of day it's necessary to move to have capacity available
-
capacityRemainingBackward
Used to request the remaining capacity available for dateFrom in a TechDataCalenda, If the dateFrom (param in) is not in an available TechDataCalendar period, the return value is zero.- Parameters:
techDataCalendar
- The TechDataCalendar coverdateFrom
- the date- Returns:
- long capacityRemaining
-
endPreviousDay
Used to move in a TechDataCalenda, produce the Timestamp for the end of the previous day available and its associated capacity. If the dateFrom (param in) is not in an available TechDataCalendar period, the return value is the previous day available- Parameters:
techDataCalendar
- The TechDataCalendar coverdateFrom
- the date- Returns:
- a map with Timestamp dateTo, Double previousCapacity
-
addBackward
Used to move backward in a TechDataCalendar, start from the dateFrom and move backward only on available period. If the dateFrom (param in) is not a available TechDataCalendar period, the startDate is the end of the previous day available- Parameters:
techDataCalendar
- The TechDataCalendar coverdateFrom
- the start dateamount
- the amount of millisecond to move backward- Returns:
- the dateTo
-