use of de.metas.ui.web.handlingunits.HUEditorView in project metasfresh-webui-api by metasfresh.
the class WEBUI_PP_Order_HUEditor_ProcessBase method retrieveSelectedAndEligibleHUEditorRows.
protected final Stream<HUEditorRow> retrieveSelectedAndEligibleHUEditorRows() {
final HUEditorView huEditorView = HUEditorView.cast(super.getView());
final Stream<HUEditorRow> huEditorRows = huEditorView.streamByIds(getSelectedRowIds());
return retrieveEligibleHUEditorRows(huEditorRows);
}
use of de.metas.ui.web.handlingunits.HUEditorView in project metasfresh-webui-api by metasfresh.
the class WEBUI_Add_Batch_SerialNo_To_CUs method removeHUsIfDestroyed.
/**
* @return true if at least one HU was removed
*/
private boolean removeHUsIfDestroyed(final Collection<Integer> huIds) {
final ImmutableSet<Integer> destroyedHUIds = huIds.stream().distinct().map(huId -> load(huId, I_M_HU.class)).filter(Services.get(IHandlingUnitsBL.class)::isDestroyed).map(I_M_HU::getM_HU_ID).collect(ImmutableSet.toImmutableSet());
if (destroyedHUIds.isEmpty()) {
return false;
}
final HUEditorView view = getView();
final boolean changes = view.removeHUIds(destroyedHUIds);
return changes;
}
use of de.metas.ui.web.handlingunits.HUEditorView in project metasfresh-webui-api by metasfresh.
the class WEBUI_M_HU_Transform method removeHUsIfDestroyed.
/**
* @return true if at least one HU was removed
*/
private boolean removeHUsIfDestroyed(final Collection<Integer> huIds) {
final ImmutableSet<Integer> destroyedHUIds = huIds.stream().distinct().map(huId -> load(huId, I_M_HU.class)).filter(Services.get(IHandlingUnitsBL.class)::isDestroyed).map(I_M_HU::getM_HU_ID).collect(ImmutableSet.toImmutableSet());
if (destroyedHUIds.isEmpty()) {
return false;
}
final HUEditorView view = getView();
final boolean changes = view.removeHUIds(destroyedHUIds);
return changes;
}
use of de.metas.ui.web.handlingunits.HUEditorView in project metasfresh-webui-api by metasfresh.
the class WEBUI_Add_Batch_SerialNo_To_CUs method removeSelectedRowsIfHUDestoyed.
/**
* @return true if view was changed and needs invalidation
*/
private final boolean removeSelectedRowsIfHUDestoyed() {
final DocumentIdsSelection selectedRowIds = getSelectedRowIds();
if (selectedRowIds.isEmpty()) {
return false;
} else if (selectedRowIds.isAll()) {
return false;
}
final HUEditorView view = getView();
final ImmutableSet<HuId> selectedHUIds = view.streamByIds(selectedRowIds).map(HUEditorRow::getHuId).filter(Objects::nonNull).collect(ImmutableSet.toImmutableSet());
return removeHUsIfDestroyed(selectedHUIds);
}
use of de.metas.ui.web.handlingunits.HUEditorView in project metasfresh-webui-api by metasfresh.
the class WEBUI_Add_Batch_SerialNo_To_CUs method updateViewFromResult.
private final void updateViewFromResult(final WebuiHUTransformCommandResult result) {
final HUEditorView view = getView();
view.addHUIds(result.getHuIdsToAddToView());
view.removeHUIds(result.getHuIdsToRemoveFromView());
if (!result.getHuIdsChanged().isEmpty()) {
removeHUsIfDestroyed(result.getHuIdsChanged());
}
}
Aggregations