use of de.metas.picking.api.IPickingSlotDAO.PickingSlotQuery in project metasfresh-webui-api by metasfresh.
the class WEBUI_M_HU_Pick_ParametersFiller method getPickingSlotValues.
public LookupValuesList getPickingSlotValues(@NonNull final LookupDataSourceContext context) {
if (shipmentScheduleId <= 0) {
return LookupValuesList.EMPTY;
}
final IShipmentScheduleEffectiveBL shipmentScheduleEffectiveBL = Services.get(IShipmentScheduleEffectiveBL.class);
final I_M_ShipmentSchedule shipmentSchedule = load(shipmentScheduleId, I_M_ShipmentSchedule.class);
final PickingSlotQuery pickingSlotQuery = PickingSlotQuery.builder().availableForBPartnerId(shipmentScheduleEffectiveBL.getC_BP_Location_ID(shipmentSchedule)).availableForBPartnerLocationId(shipmentScheduleEffectiveBL.getC_BP_Location_ID(shipmentSchedule)).build();
final List<I_M_PickingSlot> availablePickingSlots = Services.get(IPickingSlotDAO.class).retrievePickingSlots(pickingSlotQuery);
return availablePickingSlots.stream().map(pickingSlot -> IntegerLookupValue.of(pickingSlot.getM_PickingSlot_ID(), createPickingSlotLabel(pickingSlot))).collect(LookupValuesList.collect());
}
use of de.metas.picking.api.IPickingSlotDAO.PickingSlotQuery in project metasfresh-webui-api by metasfresh.
the class PickingSlotsClearingViewFactory method createView.
@Override
public PickingSlotsClearingView createView(final CreateViewRequest request) {
request.assertNoParentViewOrRow();
final DocumentFilterDescriptorsProvider filterDescriptors = getFilterDescriptorsProvider();
final CreateViewRequest requestEffective = request.unwrapFiltersAndCopy(filterDescriptors);
final ViewId viewId = ViewId.random(PickingSlotsClearingViewFactory.WINDOW_ID);
final PickingSlotQuery query = createPickingSlotQuery(requestEffective);
return PickingSlotsClearingView.builder().viewId(viewId).rows(() -> pickingSlotRepo.retrievePickingSlotsRows(query)).additionalRelatedProcessDescriptors(createAdditionalRelatedProcessDescriptors()).filterDescriptors(filterDescriptors).filters(requestEffective.getFilters().getFilters()).build();
}
use of de.metas.picking.api.IPickingSlotDAO.PickingSlotQuery in project metasfresh-webui-api by metasfresh.
the class PickingSlotViewRepository method retrievePickingSlotsForShipmentSchedule.
/**
* Retrieves the M_PickingSlots that are available for the given shipmentSchedules' partner and location.
* Assumes that all shipment schedules have the same partner and location (needs to be made sure) before starting all this stuff
*
* @param shipmentSchedule
* @return
*/
private static List<I_M_PickingSlot> retrievePickingSlotsForShipmentSchedule(@NonNull final PickingSlotRepoQuery repoQuery) {
final I_M_ShipmentSchedule shipmentSchedule = loadOutOfTrx(repoQuery.getCurrentShipmentScheduleId(), I_M_ShipmentSchedule.class);
final IShipmentScheduleEffectiveBL shipmentScheduleEffectiveBL = Services.get(IShipmentScheduleEffectiveBL.class);
final PickingSlotQuery pickingSlotQuery = PickingSlotQuery.builder().availableForBPartnerId(shipmentScheduleEffectiveBL.getC_BPartner_ID(shipmentSchedule)).availableForBPartnerLocationId(shipmentScheduleEffectiveBL.getC_BP_Location_ID(shipmentSchedule)).warehouseId(shipmentScheduleEffectiveBL.getWarehouseId(shipmentSchedule)).barcode(repoQuery.getPickingSlotBarcode()).build();
final IPickingSlotDAO pickingSlotDAO = Services.get(IPickingSlotDAO.class);
final List<I_M_PickingSlot> pickingSlots = pickingSlotDAO.retrievePickingSlots(pickingSlotQuery);
return pickingSlots;
}
Aggregations