hongjli
2023-10-17 609d17f466b80466d7069871e54ec78542bcd991
_Main/BL/Type_CapacityAllocationResults/StaticMethod_CreateDate.qbl
@@ -1,16 +1,16 @@
Quintiq file version 2.0
#parent: #root
StaticMethod CreateDate (
  GlobalOTDTable globalOTDTable,
  GlobalOTDSOP globalOTDSOP,
  MacroPlan macroPlan,
  Scenario scenario
)
{
  TextBody:
  [*
    globalOTDTable.CapacityAllocationResults( relflush );
    globalOTDSOP.CapacityAllocationResults( relflush );
    
    finaleProductInStockingPoint_MPs := CapacityAllocationResults::ObtainTheFinalOutputProduct( macroPlan, globalOTDTable );
    finaleProductInStockingPoint_MPs := CapacityAllocationResults::ObtainTheFinalOutputProduct( macroPlan, globalOTDSOP );
    
    period_MPS := null( Period_MPs );
    traverse ( macroPlan, PeriodSpecification_MP, psmp, psmp.ID() = "Planning periods" ) {
@@ -18,15 +18,15 @@
    }
    
    traverse ( finaleProductInStockingPoint_MPs, Elements, fpispmp ) {
      capacityAllocationResultsRuleConfigurations := selectset( globalOTDTable, CapacityAllocationResultsRuleConfiguration, tempCARRC, tempCARRC.ModuleMaterialCode() = fpispmp.ProductID() and tempCARRC.StockingPointID() = fpispmp.StockingPointID() );
      capacityAllocationResultsRuleConfigurations := selectset( globalOTDSOP, CapacityAllocationResultsRuleConfiguration, tempCARRC, tempCARRC.ModuleMaterialCode() = fpispmp.ProductID() and tempCARRC.StockingPointID() = fpispmp.StockingPointID() );
    //  info( "生产的产品:", fpispmp.ProductID(), "------产品在库存点-------:", fpispmp.StockingPointID() );
      traverse ( period_MPS, Elements, pmp ) {     
        // CapacityAllocationResults::IterativeGeneration( globalOTDTable, pisp, 1, null( NewSupply ), -1.0, pmp.StartDate() ); 老版
        CapacityAllocationResults::IterativeGeneration2( globalOTDTable, fpispmp, pmp.StartDate(), capacityAllocationResultsRuleConfigurations, 0, null( NewSupply ), 0.0 );
        CapacityAllocationResults::IterativeGeneration2( globalOTDSOP, fpispmp, pmp.StartDate(), capacityAllocationResultsRuleConfigurations, 0, null( NewSupply ), 0.0 );
      }
    }
    
    traverse ( globalOTDTable, CapacityAllocationResults, car ) {
    traverse ( globalOTDSOP, CapacityAllocationResults, car ) {
      car.VersionNumber( scenario.Name() );
    }
  *]