Search in sources :

Example 1 with I_M_ShipmentSchedule

use of de.metas.inoutcandidate.model.I_M_ShipmentSchedule 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());
}
Also used : IShipmentSchedulePA(de.metas.inoutcandidate.api.IShipmentSchedulePA) LookupDataSourceFactory(de.metas.ui.web.window.model.lookup.LookupDataSourceFactory) IntegerLookupValue(de.metas.ui.web.window.datatypes.LookupValue.IntegerLookupValue) I_M_ShipmentSchedule(de.metas.inoutcandidate.model.I_M_ShipmentSchedule) SqlLookupDescriptor(de.metas.ui.web.window.descriptor.sql.SqlLookupDescriptor) DB(org.compiere.util.DB) LookupDescriptor(de.metas.ui.web.window.descriptor.LookupDescriptor) InterfaceWrapperHelper(org.adempiere.model.InterfaceWrapperHelper) ImmutableList(com.google.common.collect.ImmutableList) DisplayType(org.compiere.util.DisplayType) I_M_PickingSlot(de.metas.picking.model.I_M_PickingSlot) IPickingSlotDAO(de.metas.picking.api.IPickingSlotDAO) LookupValuesList(de.metas.ui.web.window.datatypes.LookupValuesList) I_M_HU(de.metas.handlingunits.model.I_M_HU) IProcessDefaultParameter(de.metas.process.IProcessDefaultParameter) I_C_BPartner(org.compiere.model.I_C_BPartner) IShipmentScheduleEffectiveBL(de.metas.inoutcandidate.api.IShipmentScheduleEffectiveBL) LookupDataSource(de.metas.ui.web.window.model.lookup.LookupDataSource) LookupDataSourceContext(de.metas.ui.web.window.model.lookup.LookupDataSourceContext) NonNull(lombok.NonNull) IHUContextFactory(de.metas.handlingunits.IHUContextFactory) Services(org.adempiere.util.Services) List(java.util.List) Builder(lombok.Builder) AdempiereException(org.adempiere.exceptions.AdempiereException) IValidationRuleFactory(org.adempiere.ad.validationRule.IValidationRuleFactory) IProcessDefaultParametersProvider(de.metas.process.IProcessDefaultParametersProvider) InterfaceWrapperHelper.load(org.adempiere.model.InterfaceWrapperHelper.load) PickingSlotQuery(de.metas.picking.api.IPickingSlotDAO.PickingSlotQuery) IValidationRule(org.adempiere.ad.validationRule.IValidationRule) IHUProductStorage(de.metas.handlingunits.storage.IHUProductStorage) I_M_PickingSlot(de.metas.picking.model.I_M_PickingSlot) PickingSlotQuery(de.metas.picking.api.IPickingSlotDAO.PickingSlotQuery) IPickingSlotDAO(de.metas.picking.api.IPickingSlotDAO) IShipmentScheduleEffectiveBL(de.metas.inoutcandidate.api.IShipmentScheduleEffectiveBL) I_M_ShipmentSchedule(de.metas.inoutcandidate.model.I_M_ShipmentSchedule)

Example 2 with I_M_ShipmentSchedule

use of de.metas.inoutcandidate.model.I_M_ShipmentSchedule in project metasfresh-webui-api by metasfresh.

the class WEBUI_Picking_With_M_Source_HU_Base method checkSourceHuPrecondition.

protected final boolean checkSourceHuPrecondition() {
    final I_M_ShipmentSchedule shipmentSchedule = getView().getCurrentShipmentSchedule();
    final PickingHUsQuery query = PickingHUsQuery.builder().onlyIfAttributesMatchWithShipmentSchedules(true).shipmentSchedules(ImmutableList.of(shipmentSchedule)).onlyTopLevelHUs(true).build();
    final IHUPickingSlotBL huPickingSlotBL = Services.get(IHUPickingSlotBL.class);
    final List<I_M_HU> sourceHUs = huPickingSlotBL.retrieveAvailableSourceHUs(query);
    return !sourceHUs.isEmpty();
}
Also used : IHUPickingSlotBL(de.metas.handlingunits.picking.IHUPickingSlotBL) I_M_HU(de.metas.handlingunits.model.I_M_HU) I_M_ShipmentSchedule(de.metas.inoutcandidate.model.I_M_ShipmentSchedule) PickingHUsQuery(de.metas.handlingunits.picking.IHUPickingSlotBL.PickingHUsQuery)

Example 3 with I_M_ShipmentSchedule

use of de.metas.inoutcandidate.model.I_M_ShipmentSchedule 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;
}
Also used : I_M_PickingSlot(de.metas.picking.model.I_M_PickingSlot) PickingSlotQuery(de.metas.picking.api.IPickingSlotDAO.PickingSlotQuery) IPickingSlotDAO(de.metas.picking.api.IPickingSlotDAO) I_M_ShipmentSchedule(de.metas.inoutcandidate.model.I_M_ShipmentSchedule) IShipmentScheduleEffectiveBL(de.metas.inoutcandidate.api.IShipmentScheduleEffectiveBL)

Aggregations

I_M_ShipmentSchedule (de.metas.inoutcandidate.model.I_M_ShipmentSchedule)3 I_M_HU (de.metas.handlingunits.model.I_M_HU)2 IShipmentScheduleEffectiveBL (de.metas.inoutcandidate.api.IShipmentScheduleEffectiveBL)2 IPickingSlotDAO (de.metas.picking.api.IPickingSlotDAO)2 PickingSlotQuery (de.metas.picking.api.IPickingSlotDAO.PickingSlotQuery)2 I_M_PickingSlot (de.metas.picking.model.I_M_PickingSlot)2 ImmutableList (com.google.common.collect.ImmutableList)1 IHUContextFactory (de.metas.handlingunits.IHUContextFactory)1 IHUPickingSlotBL (de.metas.handlingunits.picking.IHUPickingSlotBL)1 PickingHUsQuery (de.metas.handlingunits.picking.IHUPickingSlotBL.PickingHUsQuery)1 IHUProductStorage (de.metas.handlingunits.storage.IHUProductStorage)1 IShipmentSchedulePA (de.metas.inoutcandidate.api.IShipmentSchedulePA)1 IProcessDefaultParameter (de.metas.process.IProcessDefaultParameter)1 IProcessDefaultParametersProvider (de.metas.process.IProcessDefaultParametersProvider)1 IntegerLookupValue (de.metas.ui.web.window.datatypes.LookupValue.IntegerLookupValue)1 LookupValuesList (de.metas.ui.web.window.datatypes.LookupValuesList)1 LookupDescriptor (de.metas.ui.web.window.descriptor.LookupDescriptor)1 SqlLookupDescriptor (de.metas.ui.web.window.descriptor.sql.SqlLookupDescriptor)1 LookupDataSource (de.metas.ui.web.window.model.lookup.LookupDataSource)1 LookupDataSourceContext (de.metas.ui.web.window.model.lookup.LookupDataSourceContext)1