Skip to content

Commit

Permalink
Add javadocs; un-deprecate WEBUI_Picking_AddHUToPickingSlot
Browse files Browse the repository at this point in the history
* WEBUI_Picking_AddHUToPickingSlot might be useful
* also improve
WEBUI_Picking_RemoveHUFromPickingSlot.checkPreconditionsApplicable()

518: Picking prototype (v6) 

Task-Url: #518
  • Loading branch information
metas-ts committed Jul 27, 2017
1 parent d379789 commit 2941737
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ private List<RelatedProcessDescriptor> createAdditionalRelatedProcessDescriptors
.webuiQuickAction(true)
.build(),

// TODO: remove WEBUI_Picking_AddHUToPickingSlot when opening included view is fixed in frontend
RelatedProcessDescriptor.builder()
.processId(adProcessDAO.retriveProcessIdByClass(ctx, WEBUI_Picking_AddHUToPickingSlot.class))
.anyTable().anyWindow()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package de.metas.ui.web.picking.process;

import static de.metas.ui.web.picking.process.AD_Message_Values.MSG_WEBUI_PICKING_SELECT_PICKING_SLOT;

import org.springframework.beans.factory.annotation.Autowired;

import de.metas.process.IProcessPrecondition;
Expand Down Expand Up @@ -41,13 +43,11 @@
* @author metas-dev <dev@metasfresh.com>
*
*/
// TODO: remove WEBUI_Picking_AddHUToPickingSlot when opening included view is fixed in frontend
@Deprecated
public class WEBUI_Picking_AddHUToPickingSlot extends ViewBasedProcessTemplate implements IProcessPrecondition
{
@Autowired
private PickingCandidateCommand pickingCandidateCommand;

@Param(parameterName = "M_HU_ID", mandatory = true)
private int p_M_HU_ID;

Expand All @@ -59,6 +59,12 @@ protected ProcessPreconditionsResolution checkPreconditionsApplicable()
return ProcessPreconditionsResolution.rejectBecauseNotSingleSelection();
}

final PickingSlotRow pickingSlotRow = getSingleSelectedRow();
if (!pickingSlotRow.isPickingSlotRow())
{
return ProcessPreconditionsResolution.reject(msgBL.getTranslatableMsgText(MSG_WEBUI_PICKING_SELECT_PICKING_SLOT));
}

return ProcessPreconditionsResolution.accept();
}

Expand All @@ -68,7 +74,7 @@ protected String doIt()
final PickingSlotRow pickingSlotRow = getSingleSelectedRow();
final int pickingSlotId = pickingSlotRow.getPickingSlotId();
final int shipmentScheduleId = getView().getShipmentScheduleId();

pickingCandidateCommand.addHUToPickingSlot(p_M_HU_ID, pickingSlotId, shipmentScheduleId);

invalidateView();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@
* #L%
*/

/**
* This process opens a HU editor window within the picking window
*
* @author metas-dev <dev@metasfresh.com>
*
*/
public class WEBUI_Picking_OpenHUsToPick extends ViewBasedProcessTemplate
{
@Autowired
Expand Down Expand Up @@ -80,6 +86,7 @@ protected String doIt()
.setParentViewId(pickingSlotViewId)
.setParentRowId(pickingSlotRow.getId())
.addStickyFilters(HUIdsFilterHelper.createFilter(huIdsToAvailableToPickQuery))

.addAdditionalRelatedProcessDescriptor(RelatedProcessDescriptor.builder()
.processId(adProcessDAO.retriveProcessIdByClassIfUnique(Env.getCtx(), WEBUI_Picking_PickSelectedHU.class))
.webuiQuickAction(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@
* #L%
*/

/**
* This process is called from the HU selection dialog that is opened by {@link WEBUI_Picking_OpenHUsToPick}.
*
* @author metas-dev <dev@metasfresh.com>
*
*/
public class WEBUI_Picking_PickSelectedHU extends ViewBasedProcessTemplate implements IProcessPrecondition
{
@Autowired
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package de.metas.ui.web.picking.process;

import static de.metas.ui.web.picking.process.AD_Message_Values.MSG_WEBUI_PICKING_SELECT_HU;
import static de.metas.ui.web.picking.process.AD_Message_Values.*;

import org.springframework.beans.factory.annotation.Autowired;

Expand Down Expand Up @@ -61,6 +61,11 @@ protected ProcessPreconditionsResolution checkPreconditionsApplicable()
return ProcessPreconditionsResolution.reject(msgBL.getTranslatableMsgText(MSG_WEBUI_PICKING_SELECT_HU));
}

if(pickingSlotRow.isProcessed())
{
return ProcessPreconditionsResolution.reject(msgBL.getTranslatableMsgText(MSG_WEBUI_PICKING_NO_UNPROCESSED_RECORDS));
}

return ProcessPreconditionsResolution.accept();
}

Expand Down

0 comments on commit 2941737

Please sign in to comment.