Class BTTransferRequestSave
java.lang.Object
overit.geocall.bl.BusinessTask<TransferRequestSaveEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<TransferRequestSaveEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<TransferRequestSaveEvent>
overit.geocallapp.wfm.inventory.bl.task.BTInventoryManagement<TransferRequestSaveEvent>
overit.geocallapp.wfm.inventory.bl.warehouse.transfer.request.task.BTTransferRequestSave
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(TransferRequestSaveEvent.class)
public class BTTransferRequestSave
extends BTInventoryManagement<TransferRequestSaveEvent>
Business task in order to update a
When the
TransferRequest. When the
TransferRequestSaveEvent is launched the BT notices the call and updates the TransferRequest basing on the event's input. Required fields:
- Header
- List of items
Permission:
Error Code:
Codes.PROPERTY_REQUIRED: Mandatory field not found.
- Since:
- 13.0
- See Also:
- GCApi:
- task
-
Field Summary
Fields inherited from class overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask
LOG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckCentralMobileAssociation(TransferRequest transferRequest, PoolKit poolKit) Checks if the association between the central and mobile warehouses is valid.protected voidexecute(TransferRequestSaveEvent event, PoolKit poolKit) Updates the givenTransferRequestby updating the givenBOTransferRequestHeaderand all the givenBOTransferRequestItems.protected LonginsertItem(BOTransferRequestItem item, Long headerId, PoolKit poolKit) Inserts the newly addedBOTransferRequestItemby calling theTransferRequestItemInsertEvent.booleanChecks if the execution is valid.protected List<BOCentralMobileWarehouse> loadCentralMobileRelation(Long centralWarehouse, Long mobileWarehouse, PoolKit poolKit) Loads the central and mobile warehouses association.protected voidsaveHeader(BOTransferRequestHeader header, PoolKit poolKit) Saves theBOTransferRequestHeader.protected voidsaveSerializedMaterialRelations(Long itemId, List<BOTransferRequestItemSerializedMaterial> relations, PoolKit poolKit) Saves the serialized material relations.protected voidupdateItem(BOTransferRequestItem item, PoolKit poolKit) Updates theBOTransferRequestItemby calling theTransferRequestItemUpdateEvent.protected voidvalidateData(TransferRequest transferRequest, PoolKit poolKit) Validates the data before the update.Methods inherited from class overit.geocallapp.wfm.inventory.bl.task.BTInventoryManagement
checkValidExecutionMethods inherited from class overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask
getException, throwExceptionIfInvalidMethods inherited from class overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask
body, getEventMethods inherited from class overit.geocall.bl.BusinessTask
start, start, startAlone, startInBackground
-
Constructor Details
-
BTTransferRequestSave
public BTTransferRequestSave()
-
-
Method Details
-
execute
protected void execute(TransferRequestSaveEvent event, PoolKit poolKit) throws DAException, DAValidateException Updates the givenTransferRequestby updating the givenBOTransferRequestHeaderand all the givenBOTransferRequestItems.- Specified by:
executein classValidExecutionBusinessTask<TransferRequestSaveEvent>- Parameters:
event- theTransferRequestSaveEventpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
validateData
protected void validateData(TransferRequest transferRequest, PoolKit poolKit) throws DAValidateException, DAException Validates the data before the update.- Parameters:
transferRequest- the currentTransferRequestpoolKit- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
checkCentralMobileAssociation
protected void checkCentralMobileAssociation(TransferRequest transferRequest, PoolKit poolKit) throws DAValidateException, DAException Checks if the association between the central and mobile warehouses is valid.- Parameters:
transferRequest- the currentTransferRequestpoolKit- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
loadCentralMobileRelation
protected List<BOCentralMobileWarehouse> loadCentralMobileRelation(Long centralWarehouse, Long mobileWarehouse, PoolKit poolKit) throws DAValidateException, DAException Loads the central and mobile warehouses association.- Parameters:
centralWarehouse- the central warehousemobileWarehouse- the mobile warehousepoolKit- thePoolKit- Returns:
- a list of loaded
BOCentralMobileWarehouse - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
saveHeader
protected void saveHeader(BOTransferRequestHeader header, PoolKit poolKit) throws DAValidateException, DAException Saves theBOTransferRequestHeader.- Parameters:
header- theBOTransferRequestHeaderto updatepoolKit- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
insertItem
protected Long insertItem(BOTransferRequestItem item, Long headerId, PoolKit poolKit) throws DAValidateException, DAException Inserts the newly addedBOTransferRequestItemby calling theTransferRequestItemInsertEvent.- Parameters:
item- theBOTransferRequestItemto insertheaderId- theBOTransferRequestHeaderidpoolKit- thePoolKit- Returns:
- the inserted
BOTransferRequestItemid - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
updateItem
protected void updateItem(BOTransferRequestItem item, PoolKit poolKit) throws DAValidateException, DAException Updates theBOTransferRequestItemby calling theTransferRequestItemUpdateEvent.- Parameters:
item- theBOTransferRequestItemto updatepoolKit- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
saveSerializedMaterialRelations
protected void saveSerializedMaterialRelations(Long itemId, List<BOTransferRequestItemSerializedMaterial> relations, PoolKit poolKit) throws DAValidateException, DAException Saves the serialized material relations.- Parameters:
itemId- the item idrelations- list ofBOTransferRequestItemSerializedMaterialpoolKit- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
isValidExecution
public boolean isValidExecution()Checks if the execution is valid.- Returns:
- true, if successful
-