Class ProductionRunServices


  • public class ProductionRunServices
    extends java.lang.Object
    Services for Production Run maintenance
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Map<java.lang.String,​java.lang.Object> addProductionRunComponent​(DispatchContext ctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> addProductionRunRoutingTask​(DispatchContext ctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> approveRequirement​(DispatchContext ctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> cancelProductionRun​(DispatchContext ctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      Cancels a ProductionRun.
      static java.util.Map<java.lang.String,​java.lang.Object> changeProductionRunStatus​(DispatchContext ctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> changeProductionRunTaskStatus​(DispatchContext ctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> checkDecomposeInventoryItem​(DispatchContext ctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> checkUpdatePrunRoutingTask​(DispatchContext ctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      Check if field for routingTask update are correct and if need recalculated data in Production Run.
      static java.util.Map<java.lang.String,​java.lang.Object> createProductionRun​(DispatchContext ctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      Creates a Production Run.
      static java.util.Map<java.lang.String,​java.lang.Object> createProductionRunForMktgPkg​(DispatchContext ctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> createProductionRunFromConfiguration​(DispatchContext ctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> createProductionRunFromRequirement​(DispatchContext ctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> createProductionRunsForOrder​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> createProductionRunsForProductBom​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> createProductionRunTaskCosts​(DispatchContext ctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> decomposeInventoryItem​(DispatchContext ctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> getProductionRunCost​(DispatchContext ctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> getProductionRunTotResQty​(DispatchContext ctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      Given a productId and an optional date, returns the total qty of productId reserved by production runs.
      static java.util.Map<java.lang.String,​java.lang.Object> getWorkEffortCosts​(DispatchContext ctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> productionRunDeclareAndProduce​(DispatchContext ctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> productionRunProduce​(DispatchContext ctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> productionRunTaskProduce​(DispatchContext ctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> productionRunTaskReturnMaterial​(DispatchContext ctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> quickChangeProductionRunStatus​(DispatchContext ctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      Quick moves a ProductionRun to the passed in status, performing all the needed tasks in the way.
      static java.util.Map<java.lang.String,​java.lang.Object> quickRunAllProductionRunTasks​(DispatchContext ctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      Quick runs all the tasks of a ProductionRun to the completed status, also issuing components if necessary.
      static java.util.Map<java.lang.String,​java.lang.Object> quickRunProductionRunTask​(DispatchContext ctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      Quick runs a ProductionRun task to the completed status, also issuing components if necessary.
      static java.util.Map<java.lang.String,​java.lang.Object> quickStartAllProductionRunTasks​(DispatchContext ctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> setEstimatedDeliveryDates​(DispatchContext ctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> updateProductionRun​(DispatchContext ctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      Update a Production Run.
      static java.util.Map<java.lang.String,​java.lang.Object> updateProductionRunComponent​(DispatchContext ctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> updateProductionRunTask​(DispatchContext ctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ProductionRunServices

        public ProductionRunServices()
    • Method Detail

      • cancelProductionRun

        public static java.util.Map<java.lang.String,​java.lang.Object> cancelProductionRun​(DispatchContext ctx,
                                                                                                 java.util.Map<java.lang.String,​? extends java.lang.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 java.util.Map<java.lang.String,​java.lang.Object> createProductionRun​(DispatchContext ctx,
                                                                                                 java.util.Map<java.lang.String,​? extends java.lang.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 java.util.Map<java.lang.String,​java.lang.Object> updateProductionRun​(DispatchContext ctx,
                                                                                                 java.util.Map<java.lang.String,​? extends java.lang.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 java.util.Map<java.lang.String,​java.lang.Object> changeProductionRunStatus​(DispatchContext ctx,
                                                                                                       java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • changeProductionRunTaskStatus

        public static java.util.Map<java.lang.String,​java.lang.Object> changeProductionRunTaskStatus​(DispatchContext ctx,
                                                                                                           java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • getWorkEffortCosts

        public static java.util.Map<java.lang.String,​java.lang.Object> getWorkEffortCosts​(DispatchContext ctx,
                                                                                                java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • getProductionRunCost

        public static java.util.Map<java.lang.String,​java.lang.Object> getProductionRunCost​(DispatchContext ctx,
                                                                                                  java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • createProductionRunTaskCosts

        public static java.util.Map<java.lang.String,​java.lang.Object> createProductionRunTaskCosts​(DispatchContext ctx,
                                                                                                          java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • checkUpdatePrunRoutingTask

        public static java.util.Map<java.lang.String,​java.lang.Object> checkUpdatePrunRoutingTask​(DispatchContext ctx,
                                                                                                        java.util.Map<java.lang.String,​? extends java.lang.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 java.util.Map<java.lang.String,​java.lang.Object> addProductionRunComponent​(DispatchContext ctx,
                                                                                                       java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • updateProductionRunComponent

        public static java.util.Map<java.lang.String,​java.lang.Object> updateProductionRunComponent​(DispatchContext ctx,
                                                                                                          java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • addProductionRunRoutingTask

        public static java.util.Map<java.lang.String,​java.lang.Object> addProductionRunRoutingTask​(DispatchContext ctx,
                                                                                                         java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • productionRunProduce

        public static java.util.Map<java.lang.String,​java.lang.Object> productionRunProduce​(DispatchContext ctx,
                                                                                                  java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • productionRunDeclareAndProduce

        public static java.util.Map<java.lang.String,​java.lang.Object> productionRunDeclareAndProduce​(DispatchContext ctx,
                                                                                                            java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • productionRunTaskProduce

        public static java.util.Map<java.lang.String,​java.lang.Object> productionRunTaskProduce​(DispatchContext ctx,
                                                                                                      java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • productionRunTaskReturnMaterial

        public static java.util.Map<java.lang.String,​java.lang.Object> productionRunTaskReturnMaterial​(DispatchContext ctx,
                                                                                                             java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • updateProductionRunTask

        public static java.util.Map<java.lang.String,​java.lang.Object> updateProductionRunTask​(DispatchContext ctx,
                                                                                                     java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • approveRequirement

        public static java.util.Map<java.lang.String,​java.lang.Object> approveRequirement​(DispatchContext ctx,
                                                                                                java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • createProductionRunFromRequirement

        public static java.util.Map<java.lang.String,​java.lang.Object> createProductionRunFromRequirement​(DispatchContext ctx,
                                                                                                                java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • createProductionRunFromConfiguration

        public static java.util.Map<java.lang.String,​java.lang.Object> createProductionRunFromConfiguration​(DispatchContext ctx,
                                                                                                                  java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • createProductionRunForMktgPkg

        public static java.util.Map<java.lang.String,​java.lang.Object> createProductionRunForMktgPkg​(DispatchContext ctx,
                                                                                                           java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • createProductionRunsForOrder

        public static java.util.Map<java.lang.String,​java.lang.Object> createProductionRunsForOrder​(DispatchContext dctx,
                                                                                                          java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • createProductionRunsForProductBom

        public static java.util.Map<java.lang.String,​java.lang.Object> createProductionRunsForProductBom​(DispatchContext dctx,
                                                                                                               java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • quickRunProductionRunTask

        public static java.util.Map<java.lang.String,​java.lang.Object> quickRunProductionRunTask​(DispatchContext ctx,
                                                                                                       java.util.Map<java.lang.String,​? extends java.lang.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 java.util.Map<java.lang.String,​java.lang.Object> quickRunAllProductionRunTasks​(DispatchContext ctx,
                                                                                                           java.util.Map<java.lang.String,​? extends java.lang.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 java.util.Map<java.lang.String,​java.lang.Object> quickStartAllProductionRunTasks​(DispatchContext ctx,
                                                                                                             java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • quickChangeProductionRunStatus

        public static java.util.Map<java.lang.String,​java.lang.Object> quickChangeProductionRunStatus​(DispatchContext ctx,
                                                                                                            java.util.Map<java.lang.String,​? extends java.lang.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 java.util.Map<java.lang.String,​java.lang.Object> getProductionRunTotResQty​(DispatchContext ctx,
                                                                                                       java.util.Map<java.lang.String,​? extends java.lang.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 java.util.Map<java.lang.String,​java.lang.Object> checkDecomposeInventoryItem​(DispatchContext ctx,
                                                                                                         java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • decomposeInventoryItem

        public static java.util.Map<java.lang.String,​java.lang.Object> decomposeInventoryItem​(DispatchContext ctx,
                                                                                                    java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • setEstimatedDeliveryDates

        public static java.util.Map<java.lang.String,​java.lang.Object> setEstimatedDeliveryDates​(DispatchContext ctx,
                                                                                                       java.util.Map<java.lang.String,​? extends java.lang.Object> context)