Class CrewShellUtils
java.lang.Object
overit.geocallapp.wfm.crewshell.bl.CrewShellUtils
overit.geocallapp.wfm.core.bl.crewshell.CrewShellUtils
Utility class for the crew shells.
- Since:
- 16.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static BOCrewShellgetCrewShell(Long crewShellId, PoolKit pk) getCrewShellBySchedulings(Set<Long> schedulingIDs, PoolKit pk) Retrieves the set of the IDs of theBOCrewShellobjects by taking into account their work-shifts.static DBViewgetCrewShellBySchedulingsDbv(Set<Long> schedulingIDs, PoolKit pk) Retrieves theDBViewobject containing the scheduling's data for eachBOCrewShellobject.getCrewShellBySchedulingsGroupedByDay(Set<Long> schedulingIDs, PoolKit pk) Retrieves the map of the IDs of theBOCrewShellobjects for eachDatecomposition day, by taking into account theBOCrewShellobjects' schedulings.static StringgetCrewShellName(Long crewShellID, PoolKit pk) Retrieves theBOCrewShellobject's name (i.e., the crew shell's description).static BOWorkShiftgetCrewShellWorkShift(Long crewShellId, Date day, PoolKit poolKit) protected static BOOperationCentergetOperationCenter(Long operationCenterId, PoolKit pk) protected static BOSchedulingUsergetSchedulingUser(Long schedulingUserId, PoolKit pk) static StringgetTechnicianName(BOCrewShellDraftComposition technician, PoolKit pk) Retrieves theBOCrewShellDraftCompositionobject's concatenation of surname-space-name (i.e., the technician's full name).static StringgetUserName(Long userID, PoolKit pk) Retrieves theBOSchedulingUserobject's concatenation of surname-space-name (i.e., the user's full name) by its userID.protected static BOWorkShiftgetWorkshift(Long workshiftId, PoolKit pk) static booleanisDummyUser(BOSchedulingUser user) Checks if theBOSchedulingUserobject is aBOCrewShellobject (i.e., a dummy user).static List<BOCrewShellOperationCenter> retrieveActivatedOCsForCrewShells(PoolKit poolKit) Retrieves the list of all theBOCrewShellOperationCenterobjects (i.e., the list of the activated crew shells' operation centers).Retrieves the list of all the operation centers' IDs associated to theBOCrewShellOperationCenterobjects (i.e., the list of the IDs of the activated operation centers for crew shells).static voidvalidateDeactivatedCrewShellsOC(DynO dynO, PoolKit pk) Validates whether the associatedBOOperationCenterobject (i.e., operation center) has been deactivated for crew shells.static voidMethods inherited from class overit.geocallapp.wfm.crewshell.bl.CrewShellUtils
findCrewShellByDummyUser, getCrewShellByDummyUser, getCrewShellDummyUsers, getCrewShellTechnicians, getCrewShellTechnicians, getCrewShellTechniciansByDummyUser, getCrewShellTechniciansByDummyUser, getResourceOfACrewShell, getResourceOfACrewShell, isAnyForemanPresent, isResourceInACrewShell
-
Constructor Details
-
CrewShellUtils
protected CrewShellUtils()
-
-
Method Details
-
getCrewShellBySchedulings
public static Set<Long> getCrewShellBySchedulings(Set<Long> schedulingIDs, PoolKit pk) throws DAValidateException, DAException Retrieves the set of the IDs of theBOCrewShellobjects by taking into account their work-shifts.- Parameters:
schedulingIDs- the set of work-shifts' IDspk- thePoolKitpoolKit- Returns:
- the set of the IDs of the
BOCrewShellobjects - Throws:
DAValidateException- if there is a data validation exceptionDAException- if a genericExceptionobject is thrown- See Also:
-
getCrewShellBySchedulingsGroupedByDay
public static Map<Date,Set<Long>> getCrewShellBySchedulingsGroupedByDay(Set<Long> schedulingIDs, PoolKit pk) throws DAValidateException, DAException Retrieves the map of the IDs of theBOCrewShellobjects for eachDatecomposition day, by taking into account theBOCrewShellobjects' schedulings.- Parameters:
schedulingIDs- the set of work-shifts' IDspk- thePoolKitpoolKit- Returns:
- the map of the IDs of the
BOCrewShellobjects for eachDatecomposition day - Throws:
DAValidateException- if there is a data validation exceptionDAException- if a genericExceptionobject is thrown- See Also:
-
getCrewShellBySchedulingsDbv
public static DBView getCrewShellBySchedulingsDbv(Set<Long> schedulingIDs, PoolKit pk) throws DAValidateException, DAException Retrieves theDBViewobject containing the scheduling's data for eachBOCrewShellobject.- Parameters:
schedulingIDs- the set of work-shifts' IDspk- thePoolKitpoolKit- Returns:
- the
DBViewobject containing the scheduling's data for eachBOCrewShellobject - Throws:
DAValidateException- if there is a data validation exceptionDAException- if a genericExceptionobject is thrown- See Also:
-
getTechnicianName
public static String getTechnicianName(BOCrewShellDraftComposition technician, PoolKit pk) throws DAValidateException, DAException Retrieves theBOCrewShellDraftCompositionobject's concatenation of surname-space-name (i.e., the technician's full name). This method concerns aBOCrewShellobject's draft composition.- Parameters:
technician- theBOCrewShellDraftCompositiontechnician- Returns:
- the technician's full name
- Throws:
DAValidateException- if there is a data validation exceptionDAException- if a genericExceptionobject is thrown
-
getUserName
Retrieves theBOSchedulingUserobject's concatenation of surname-space-name (i.e., the user's full name) by its userID.- Parameters:
userID- theBOSchedulingUseruser's ID.- Returns:
- the user's full name
- Throws:
DAExceptionDAValidateException- See Also:
-
getCrewShellName
public static String getCrewShellName(Long crewShellID, PoolKit pk) throws DAException, DAValidateException Retrieves theBOCrewShellobject's name (i.e., the crew shell's description).- Parameters:
crewShellID- theBOCrewShellobject's ID.- Returns:
- the crew shell's description
- Throws:
DAExceptionDAValidateException
-
isDummyUser
Checks if theBOSchedulingUserobject is aBOCrewShellobject (i.e., a dummy user).- Parameters:
user- theBOSchedulingUserobject to be checked- Returns:
- true if the user is a dummy user, false otherwise
-
retrieveActivatedOCsForCrewShells
public static List<BOCrewShellOperationCenter> retrieveActivatedOCsForCrewShells(PoolKit poolKit) throws DAValidateException, DAException Retrieves the list of all theBOCrewShellOperationCenterobjects (i.e., the list of the activated crew shells' operation centers).- Parameters:
poolKit- thePoolKitpoolKit- Returns:
- the list of the activated crew shells' operation centers
- Throws:
DAValidateException- if there is a data validation exceptionDAException- if a genericExceptionobject is thrown
-
retrieveActivatedOCsIDsForCrewShells
public static List<Long> retrieveActivatedOCsIDsForCrewShells(PoolKit poolKit) throws DAValidateException, DAException Retrieves the list of all the operation centers' IDs associated to theBOCrewShellOperationCenterobjects (i.e., the list of the IDs of the activated operation centers for crew shells).- Parameters:
poolKit- thePoolKitpoolKit- Returns:
- the list of the IDs of the activated operation centers for crew shells
- Throws:
DAValidateException- if there is a data validation exceptionDAException- if a genericExceptionobject is thrown
-
validateDeactivatedCrewShellsOC
public static void validateDeactivatedCrewShellsOC(DynO dynO, PoolKit pk) throws DAValidateException, DAException Validates whether the associatedBOOperationCenterobject (i.e., operation center) has been deactivated for crew shells. The existence of aBOCrewShellOperationCenterobject (i.e., crew shell's activated operation center) implies that the associated operation center has been activated for crew shells. The validation is performed based on the providedDynOobject, and aDAValidateExceptionis thrown with different error codes for each extension of theDynOobject.- Parameters:
dynO- theDynOobject to be validatedpk- thePoolKitpoolKit- Throws:
DAValidateException- if there is a data validation exceptionDAException- if a genericExceptionobject is thrown
-
validateDeactivatedCrewShellsOC
public static void validateDeactivatedCrewShellsOC(NotificationInput<BOWorkShift> input, PoolKit pk) throws DAValidateException, DAException - Throws:
DAValidateExceptionDAException
-
getCrewShell
protected static BOCrewShell getCrewShell(Long crewShellId, PoolKit pk) throws DAException, DAValidateException - Throws:
DAExceptionDAValidateException
-
getWorkshift
protected static BOWorkShift getWorkshift(Long workshiftId, PoolKit pk) throws DAException, DAValidateException - Throws:
DAExceptionDAValidateException
-
getOperationCenter
protected static BOOperationCenter getOperationCenter(Long operationCenterId, PoolKit pk) throws DAException, DAValidateException - Throws:
DAExceptionDAValidateException
-
getSchedulingUser
protected static BOSchedulingUser getSchedulingUser(Long schedulingUserId, PoolKit pk) throws DAException, DAValidateException - Throws:
DAExceptionDAValidateException
-
getCrewShellWorkShift
public static BOWorkShift getCrewShellWorkShift(Long crewShellId, Date day, PoolKit poolKit) throws DAException, DAValidateException - Throws:
DAExceptionDAValidateException
-