renhao
2023-10-18 ff1d40a1a235da7c3bdfa26070af267f19c7a3d3
_Main/BL/Type_CapacityAllocationResults/StaticMethod_IterativeGeneration2.qbl
@@ -1,7 +1,7 @@
Quintiq file version 2.0
#parent: #root
StaticMethod IterativeGeneration2 (
  GlobalOTDTable globalOTDTable,
  GlobalOTDSOP globalOTDSOP,
  ProductInStockingPoint_MP pisp,
  Date targetDate,
  CapacityAllocationResultsRuleConfigurations carrcs,
@@ -21,7 +21,7 @@
        previous := pispippl.PreviousPlanningPISPIP().astype( ProductInStockingPointInPeriodPlanningLeaf );
        if ( not previous.Period_MP().IsHistorical() ) {
          previousDate := previous.Start().Date();
          CapacityAllocationResults::IterativeGeneration2( globalOTDTable,
          CapacityAllocationResults::IterativeGeneration2( globalOTDSOP,
                                                           pisp,
                                                           previousDate,
                                                           carrcs,
@@ -50,7 +50,7 @@
    //          info( "层数:", numberOfLayers, "    当前供应的pisp:", ns.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().Name(), "    总供应值:", ns.Quantity(), "    需要供应值:", currentLayerDependentDemandQuantity,
    //                "    当前需求pisp:", dd.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().Name(), "    需求值:", currentLayerDependentDemandQuantity );
    //          info( "-----------------------------------------------------------------------------------------------------------------" );
              CapacityAllocationResults::IterativeGeneration2( globalOTDTable,
              CapacityAllocationResults::IterativeGeneration2( globalOTDSOP,
                                                               dd.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP(),
                                                               targetDate,
                                                               carrcs,
@@ -62,25 +62,25 @@
            carrc := select( carrcs, Elements, carrc, carrc.PanelMaterialCode() = ns.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().ProductID() );
            if ( not isnull( carrc ) ) {
    //          info( "找到面板物料..." );
              globalOTDTable.CapacityAllocationResults( relnew,
                                                        PanelBase             := pto.Operation().UnitID(),
                                                        PanelMaterialCode     := ns.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().ProductID(),
                                                        NumberOfPanels        := currentLayerDependentDemandQuantity,
                                                        PanelMeasurementUnit  := ns.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().UnitOfMeasureName(),
                                                        ModuleMaterialCode    := firstLevelSupply.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().ProductID(),
                                                        NumberOfModules       := firstLevelSupply.Quantity(),
                                                        ModuleMeasurementUnit := firstLevelSupply.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().UnitOfMeasureName(),
                                                        ModuleBase            := guard( firstLevelSupply.PeriodTask_MP().astype( PeriodTaskOperation ).Operation().UnitID(), "车道运输" ),
                                                        Division              := carrc.Division(),
                                                        RequirementDate       := firstLevelSupply.Start().Date(),
                                                        Date                  := firstLevelSupply.Start().Date(),
                                                        Description           := "",
                                                        ID                    := OS::GenerateGUIDAsString(),
                                                        ProductID             := ns.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().ProductID(),
                                                        StockingPointID       := ns.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().StockingPointID(),
                                                        UserQuantity          := currentLayerDependentDemandQuantity,
                                                        ManufacturedDate      := Date::MinDate()
                                                       );
              globalOTDSOP.CapacityAllocationResults( relnew,
                                                      PanelBase             := pto.Operation().UnitID(),
                                                      PanelMaterialCode     := ns.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().ProductID(),
                                                      NumberOfPanels        := currentLayerDependentDemandQuantity,
                                                      PanelMeasurementUnit  := ns.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().UnitOfMeasureName(),
                                                      ModuleMaterialCode    := firstLevelSupply.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().ProductID(),
                                                      NumberOfModules       := firstLevelSupply.Quantity(),
                                                      ModuleMeasurementUnit := firstLevelSupply.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().UnitOfMeasureName(),
                                                      ModuleBase            := guard( firstLevelSupply.PeriodTask_MP().astype( PeriodTaskOperation ).Operation().UnitID(), "车道运输" ),
                                                      Division              := carrc.Division(),
                                                      RequirementDate       := firstLevelSupply.Start().Date(),
                                                      Date                  := firstLevelSupply.Start().Date(),
                                                      Description           := "",
                                                      ID                    := OS::GenerateGUIDAsString(),
                                                      ProductID             := ns.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().ProductID(),
                                                      StockingPointID       := ns.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().StockingPointID(),
                                                      UserQuantity          := currentLayerDependentDemandQuantity,
                                                      ManufacturedDate      := Date::MinDate()
                                                     );
                                                        
            }
            //info( "-----------------------------------------------------------------------------------------------------------------" );
@@ -93,7 +93,7 @@
    //              "    当前需求pisp:", targetDependentDemand.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP().Name(), "    需求值:", currentLayerDependentDemandQuantity );
    //        info( "LaneLeg周期任务..." );
            //info( "-----------------------------------------------------------------------------------------------------------------" );
            CapacityAllocationResults::IterativeGeneration2( globalOTDTable,
            CapacityAllocationResults::IterativeGeneration2( globalOTDSOP,
                                                             targetDependentDemand.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP(),
                                                             targetDate,
                                                             carrcs,