Class MrpServices

  • public class MrpServices
    extends Object
    Services for running MRP
    • Constructor Detail

      • MrpServices

        public MrpServices()
    • Method Detail

      • findProductMrpQoh

        public static BigDecimal findProductMrpQoh​(String mrpId,
                                                   GenericValue product,
                                                   String facilityId,
                                                   LocalDispatcher dispatcher,
                                                   Delegator delegator)
        Find the quantity on hand of products for MRP.
        • PreConditions : none
        • Result : We get the quantity of product available in the stocks.
        product - the product for which the Quantity Available is required
        the sum of all the totalAvailableToPromise of the inventoryItem related to the product, if the related facility is Mrp available (not yet implemented!!)
      • processBomComponent

        public static void processBomComponent​(String mrpId,
                                               GenericValue product,
                                               BigDecimal eventQuantity,
                                               Timestamp startDate,
                                               Map<String,​Object> routingTaskStartDate,
                                               List<BOMNode> listComponent)
        Process the bill of material (bom) of the product to insert components in the MrpEvent table. Before inserting in the entity, test if there is the record already existing to add quantity rather to create a new one.
        mrpId - the mrp id
        product - GenericValue oject of the product
        eventQuantity - the product quantity needed
        startDate - the startDate of the productionRun which will used to produce the product
        routingTaskStartDate - Map with all the routingTask as keys and startDate of each of them
        listComponent - a List with all the components
      • executeMrp

        public static Map<String,​Object> executeMrp​(DispatchContext ctx,
                                                          Map<String,​? extends Object> context)
        Launch the MRP.
        • PreConditions : none
        • Result : The date when we must order or begin to build the products and subproducts we need are calculated
        • INPUT : parameters to get from the context:
          • String mrpName
        • OUTPUT : Result to put in the map :
          • none
        ctx - The DispatchContext that this service is operating in.
        context - Map containing the input parameters, productId routingId, quantity, startDate.
        Map with the result of the service, the output parameters.