Class ProductionRunServices

java.lang.Object
org.apache.ofbiz.manufacturing.jobshopmgt.ProductionRunServices

public class ProductionRunServices extends Object
Services for Production Run maintenance
  • Constructor Details

    • ProductionRunServices

      public ProductionRunServices()
  • Method Details

    • cancelProductionRun

      public static Map<String,Object> cancelProductionRun(DispatchContext ctx, Map<String,? extends Object> context)
      Cancels a ProductionRun.
      Parameters:
      ctx - The DispatchContext that this service is operating in.
      context - Map containing the input parameters.
      Returns:
      Map with the result of the service, the output parameters.
    • createProductionRun

      public static Map<String,Object> createProductionRun(DispatchContext ctx, Map<String,? extends Object> context)
      Creates a Production Run.
      • check if routing - product link exist
      • check if product have a Bill Of Material
      • check if routing have routingTask
      • create the workEffort for ProductionRun
      • create the WorkEffortGoodStandard for link between ProductionRun and the product it will produce
      • for each valid routingTask of the routing create a workeffort-task
      • for the first routingTask, create for all the valid productIdTo with no associateRoutingTask a WorkEffortGoodStandard
      • for each valid routingTask of the routing and valid productIdTo associate with this RoutingTask create a WorkEffortGoodStandard
      Parameters:
      ctx - The DispatchContext that this service is operating in.
      context - Map containing the input parameters, productId, routingId, pRQuantity, startDate, workEffortName, description
      Returns:
      Map with the result of the service, the output parameters.
    • updateProductionRun

      public static Map<String,Object> updateProductionRun(DispatchContext ctx, Map<String,? extends Object> context)
      Update a Production Run.
      • update field and after recalculate the entire ProductionRun data (routingTask and productComponent)
      • create the WorkEffortGoodStandard for link between ProductionRun and the product it will produce
      • for each valid routingTask of the routing create a workeffort-task
      • for the first routingTask, create for all the valid productIdTo with no associateRoutingTask a WorkEffortGoodStandard
      • for each valid routingTask of the routing and valid productIdTo associate with this RoutingTask create a WorkEffortGoodStandard
      Parameters:
      ctx - The DispatchContext that this service is operating in.
      context - Map containing the input parameters, productId, routingId, quantity, estimatedStartDate, workEffortName, description
      Returns:
      Map with the result of the service, the output parameters.
    • changeProductionRunStatus

      public static Map<String,Object> changeProductionRunStatus(DispatchContext ctx, Map<String,? extends Object> context)
    • changeProductionRunTaskStatus

      public static Map<String,Object> changeProductionRunTaskStatus(DispatchContext ctx, Map<String,? extends Object> context)
    • getWorkEffortCosts

      public static Map<String,Object> getWorkEffortCosts(DispatchContext ctx, Map<String,? extends Object> context)
    • getProductionRunCost

      public static Map<String,Object> getProductionRunCost(DispatchContext ctx, Map<String,? extends Object> context)
    • createProductionRunTaskCosts

      public static Map<String,Object> createProductionRunTaskCosts(DispatchContext ctx, Map<String,? extends Object> context)
    • checkUpdatePrunRoutingTask

      public static Map<String,Object> checkUpdatePrunRoutingTask(DispatchContext ctx, Map<String,? extends Object> context)
      Check if field for routingTask update are correct and if need recalculated data in Production Run. Check
      • if estimatedStartDate is not before Production Run estimatedStartDate.
      • if there is not a another routingTask with the same priority
      • If priority or estimatedStartDate has changed recalculated data for routingTask after that one.
      Update the productionRun
      Parameters:
      ctx - The DispatchContext that this service is operating in.
      context - Map containing the input parameters, productId, routingId, priority, estimatedStartDate, estimatedSetupMillis, estimatedMilliSeconds
      Returns:
      Map with the result of the service, the output parameters, estimatedCompletionDate.
    • addProductionRunComponent

      public static Map<String,Object> addProductionRunComponent(DispatchContext ctx, Map<String,? extends Object> context)
    • updateProductionRunComponent

      public static Map<String,Object> updateProductionRunComponent(DispatchContext ctx, Map<String,? extends Object> context)
    • addProductionRunRoutingTask

      public static Map<String,Object> addProductionRunRoutingTask(DispatchContext ctx, Map<String,? extends Object> context)
    • productionRunProduce

      public static Map<String,Object> productionRunProduce(DispatchContext ctx, Map<String,? extends Object> context)
    • productionRunDeclareAndProduce

      public static Map<String,Object> productionRunDeclareAndProduce(DispatchContext ctx, Map<String,? extends Object> context)
    • productionRunTaskProduce

      public static Map<String,Object> productionRunTaskProduce(DispatchContext ctx, Map<String,? extends Object> context)
    • productionRunTaskReturnMaterial

      public static Map<String,Object> productionRunTaskReturnMaterial(DispatchContext ctx, Map<String,? extends Object> context)
    • updateProductionRunTask

      public static Map<String,Object> updateProductionRunTask(DispatchContext ctx, Map<String,? extends Object> context)
    • approveRequirement

      public static Map<String,Object> approveRequirement(DispatchContext ctx, Map<String,? extends Object> context)
    • createProductionRunFromRequirement

      public static Map<String,Object> createProductionRunFromRequirement(DispatchContext ctx, Map<String,? extends Object> context)
    • createProductionRunFromConfiguration

      public static Map<String,Object> createProductionRunFromConfiguration(DispatchContext ctx, Map<String,? extends Object> context)
    • createProductionRunForMktgPkg

      public static Map<String,Object> createProductionRunForMktgPkg(DispatchContext ctx, Map<String,? extends Object> context)
    • createProductionRunsForOrder

      public static Map<String,Object> createProductionRunsForOrder(DispatchContext dctx, Map<String,? extends Object> context)
    • createProductionRunsForProductBom

      public static Map<String,Object> createProductionRunsForProductBom(DispatchContext dctx, Map<String,? extends Object> context)
    • quickRunProductionRunTask

      public static Map<String,Object> quickRunProductionRunTask(DispatchContext ctx, Map<String,? extends Object> context)
      Quick runs a ProductionRun task to the completed status, also issuing components if necessary.
      Parameters:
      ctx - The DispatchContext that this service is operating in.
      context - Map containing the input parameters.
      Returns:
      Map with the result of the service, the output parameters.
    • quickRunAllProductionRunTasks

      public static Map<String,Object> quickRunAllProductionRunTasks(DispatchContext ctx, Map<String,? extends Object> context)
      Quick runs all the tasks of a ProductionRun to the completed status, also issuing components if necessary.
      Parameters:
      ctx - The DispatchContext that this service is operating in.
      context - Map containing the input parameters.
      Returns:
      Map with the result of the service, the output parameters.
    • quickStartAllProductionRunTasks

      public static Map<String,Object> quickStartAllProductionRunTasks(DispatchContext ctx, Map<String,? extends Object> context)
    • quickChangeProductionRunStatus

      public static Map<String,Object> quickChangeProductionRunStatus(DispatchContext ctx, Map<String,? extends Object> context)
      Quick moves a ProductionRun to the passed in status, performing all the needed tasks in the way.
      Parameters:
      ctx - The DispatchContext that this service is operating in.
      context - Map containing the input parameters.
      Returns:
      Map with the result of the service, the output parameters.
    • getProductionRunTotResQty

      public static Map<String,Object> getProductionRunTotResQty(DispatchContext ctx, Map<String,? extends Object> context)
      Given a productId and an optional date, returns the total qty of productId reserved by production runs.
      Parameters:
      ctx - The DispatchContext that this service is operating in.
      context - Map containing the input parameters.
      Returns:
      Map with the result of the service, the output parameters.
    • checkDecomposeInventoryItem

      public static Map<String,Object> checkDecomposeInventoryItem(DispatchContext ctx, Map<String,? extends Object> context)
    • decomposeInventoryItem

      public static Map<String,Object> decomposeInventoryItem(DispatchContext ctx, Map<String,? extends Object> context)
    • setEstimatedDeliveryDates

      public static Map<String,Object> setEstimatedDeliveryDates(DispatchContext ctx, Map<String,? extends Object> context)