use of de.metas.ui.web.picking.packageable.PackageableView in project metasfresh-webui-api by metasfresh.
the class PickingSlotViewsIndexStorage method removeById.
@Override
public void removeById(@NonNull final ViewId pickingSlotViewId) {
final DocumentId rowId = extractRowId(pickingSlotViewId);
final PackageableView packageableView = getPackageableViewByPickingSlotViewId(pickingSlotViewId);
packageableView.removePickingSlotView(rowId, ViewCloseReason.USER_REQUEST);
}
use of de.metas.ui.web.picking.packageable.PackageableView in project metasfresh-webui-api by metasfresh.
the class PickingSlotViewsIndexStorage method put.
@Override
public void put(final IView pickingSlotView) {
final ViewId pickingSlotViewId = pickingSlotView.getViewId();
final PackageableView packageableView = getPackageableViewByPickingSlotViewId(pickingSlotViewId);
final DocumentId rowId = extractRowId(pickingSlotViewId);
packageableView.setPickingSlotView(rowId, PickingSlotView.cast(pickingSlotView));
}
use of de.metas.ui.web.picking.packageable.PackageableView in project metasfresh-webui-api by metasfresh.
the class PickingSlotViewsIndexStorage method getPackageableViewByPickingSlotViewId.
private PackageableView getPackageableViewByPickingSlotViewId(final ViewId pickingSlotViewId) {
final ViewId pickingViewId = extractPickingViewId(pickingSlotViewId);
final PackageableView view = PackageableView.cast(getViewsRepository().getView(pickingViewId));
return view;
}
use of de.metas.ui.web.picking.packageable.PackageableView in project metasfresh-webui-api by metasfresh.
the class HUsToPickViewBasedProcess method getSingleSelectedPackageableRow.
protected final PackageableRow getSingleSelectedPackageableRow() {
final PickingSlotView pickingSlotView = getPickingSlotView();
final ViewId packageablesViewId = pickingSlotView.getParentViewId();
if (packageablesViewId == null) {
throw new AdempiereException("Packageables view is not available");
}
final DocumentId packageableRowId = pickingSlotView.getParentRowId();
if (packageableRowId == null) {
throw new AdempiereException("There is no single packageable row selected");
}
final PackageableView packageableView = PackageableView.cast(viewsRepo.getView(packageablesViewId));
return packageableView.getById(packageableRowId);
}
use of de.metas.ui.web.picking.packageable.PackageableView in project metasfresh-webui-api by metasfresh.
the class PickingSlotViewsIndexStorage method getOrCreatePickingSlotView.
private PickingSlotView getOrCreatePickingSlotView(@NonNull final ViewId pickingSlotViewId, final boolean create) {
final PackageableView packageableView = getPackageableViewByPickingSlotViewId(pickingSlotViewId);
final DocumentId packageableRowId = extractRowId(pickingSlotViewId);
if (create) {
return packageableView.computePickingSlotViewIfAbsent(packageableRowId, () -> {
final PackageableRow packageableRow = packageableView.getById(packageableRowId);
final CreateViewRequest createViewRequest = CreateViewRequest.builder(PickingConstants.WINDOWID_PickingSlotView, JSONViewDataType.includedView).setParentViewId(packageableView.getViewId()).setParentRowId(packageableRow.getId()).build();
// provide all pickingView's M_ShipmentSchedule_IDs to the factory, because we want to show the same picking slots and picked HU-rows for all of them.
final List<Integer> allShipmentScheduleIds = packageableView.streamByIds(DocumentIdsSelection.ALL).map(PackageableRow::cast).map(PackageableRow::getShipmentScheduleId).collect(Collectors.toList());
return pickingSlotViewFactory.createView(createViewRequest, allShipmentScheduleIds);
});
} else {
return packageableView.getPickingSlotViewOrNull(packageableRowId);
}
}
Aggregations