hongjli
2023-10-11 77b8d972800221d19bd0ea7f2a14b720920b16bb
产能分配优化
已修改4个文件
已添加2个文件
135 ■■■■ 文件已修改
_Main/BL/Type_CapacityAllocationResultsRuleConfiguration/StaticMethod_AutomaticallyGenerateCapacityRules.qbl 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CapacityAllocationResultsRuleConfiguration/StaticMethod_RecursiveGeneration.qbl 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CapacityAllocationResultsRuleConfiguration/StaticMethod_Test.qbl 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlanner/Component_FormTestButtonCollection/Response_Button884_OnClick.def 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlanner/Component_FormTestButtonCollection/_ROOT_Component_FormTestButtonCollection.def 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Response_OnCreated.def 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CapacityAllocationResultsRuleConfiguration/StaticMethod_AutomaticallyGenerateCapacityRules.qbl
@@ -7,7 +7,7 @@
{
  TextBody:
  [*
    targetProduct_MP := select( macroPlan, Product_MP, tempPMP, tempPMP.ID() = "Chassis - SUV 1" );
    targetProduct_MP := select( macroPlan, Product_MP, tempPMP, tempPMP.ID() = "ProSports Spider D2.6 M" );
    
    period_MPS := null( Period_MPs );
    traverse ( macroPlan, PeriodSpecification_MP, psmp, psmp.ID() = "Planning periods" ) {
@@ -15,8 +15,10 @@
    }
    
    traverse ( targetProduct_MP, ProductInStockingPoint_MP, pisp ) {
      traverse ( period_MPS, Elements, pmp ) {
      traverse ( period_MPS, Elements, pmp, pmp.StartDate() = Date::Construct( 2020, 4, 1 ) ) {
        info( pmp.StartDate().Format( "Y-M2-D2" ), "    outputPISP:", pisp.Name() );
        CapacityAllocationResultsRuleConfiguration::RecursiveGeneration( macroPlan, pisp, pisp, pmp.StartDate() );
        info( "-------------------------------------------------------------------------------------------------------" );
      }
    }
  *]
_Main/BL/Type_CapacityAllocationResultsRuleConfiguration/StaticMethod_RecursiveGeneration.qbl
@@ -9,15 +9,28 @@
{
  TextBody:
  [*
    operations := selectset( macroPlan, Routing.RoutingStep.Operation, tempO,
                             exists( tempO, OperationOutput, tempOO, tempOO.ProductInStockingPoint_MP() = outputPISP ) );
    traverse ( operations, Elements, o ) {
      traverse ( o, OperationInput, tempOI ) {
        inputPISP := tempOI.ProductInStockingPoint_MP();
        CapacityAllocationResultsRuleConfiguration::RecursiveGeneration( macroPlan, tempOI.ProductInStockingPoint_MP(), firstPISP, startDate );
        info( "输入PISP:", inputPISP.Name(), "    è¾“出PISP:", outputPISP.Name(), "    ç¬¬ä¸€æ¬¡PISP:", firstPISP.Name() );
    traverse ( outputPISP, ProcessOutput.AsProcessOutput, pmp ) {
      ontype( pmp ) {
        Operation as o : {
          traverse ( o, OperationInput, oi ) {
            oiPISP := oi.ProductInStockingPoint_MP();
            CapacityAllocationResultsRuleConfiguration::RecursiveGeneration( macroPlan, oiPISP, firstPISP, startDate );
            info( "输入PISP:", oiPISP.Name(), "    è¾“出PISP:", outputPISP.Name(), "    ç¬¬ä¸€æ¬¡PISP:", firstPISP.Name() );
          }
        }
        LaneLeg as ll : {
          traverse ( ll, LaneLegInput, lli ) {
            lliPISP := lli.ProductInStockingPoint_MP();
            if ( lliPISP.ProductID() = outputPISP.ProductID() ) {
              CapacityAllocationResultsRuleConfiguration::RecursiveGeneration( macroPlan, lliPISP, firstPISP, startDate );
              info( "输入PISP:", lliPISP.Name(), "    è¾“出PISP:", outputPISP.Name(), "    ç¬¬ä¸€æ¬¡PISP:", firstPISP.Name() );
            }
          }
        }
      }
    }
  *]
}
_Main/BL/Type_CapacityAllocationResultsRuleConfiguration/StaticMethod_Test.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,61 @@
Quintiq file version 2.0
#parent: #root
StaticMethod Test (
  MacroPlan this
)
{
  TextBody:
  [*
    pispnames := construct( Strings );
    traverse( this, SalesDemand.ProductInStockingPoint_MP, pisp )
    {
      if( not exists( pisp, ProcessOutput.AsProcessOutput.ProcessInput, processinput, true ) )
      {
        pispnames.Add( pisp.Name() );
      }
      else
      {
        dummyprocesses := selectset( pisp, ProcessOutput.AsProcessOutput, process, true );
        index := 0;
        limit := 10000;
        while( index < dummyprocesses.Size()
               and index < limit )
        {
          dummyprocess := dummyprocesses.Element( index );
          index++;
          pisps := construct( ProductInStockingPoint_MPs );
          if( dummyprocess.istype( Operation ) )
          {
            pisps := selectset( dummyprocess, astype( Operation ).RoutingStep.Routing.InputPISPNodeInRouting.ProductInStockingPoint_MP, pisp2,
                                not pisp2.IsSystem() );
          }
          else if( dummyprocess.istype( LaneLeg ) )
          {
            pisps := selectset( dummyprocess, astype( LaneLeg ).LaneLegInput.ProductInStockingPoint_MP, pisp2,
                                pisp2.Product_MP() = pisp.Product_MP() );
          }
          traverse( pisps, Elements, pisp2 )
          {
            if( not exists( pisp2, ProcessOutput.AsProcessOutput.ProcessInput, processinput, true ) )
            {
              pispnames.Add( pisp2.Name() );
            }
            else
            {
              dummyprocesses2 := selectset( pisp2, ProcessOutput.AsProcessOutput, process, true );
              dummyprocesses.AddInPlace( dummyprocesses2 );
            }
          }
        }
      }
    }
    pispnames := pispnames.Unique().Sort();
    info( pispnames.ToString( String::NewLine() ) );
  *]
}
_Main/UI/MacroPlanner/Component_FormTestButtonCollection/Response_Button884_OnClick.def
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,12 @@
Quintiq file version 2.0
#parent: Button884
Response OnClick () id:Response_FormTestButtonCollection_Button884_OnClick
{
  #keys: '[414702.1.33954101]'
  Body:
  [*
    CapacityAllocationResultsRuleConfiguration::Test( MacroPlan );
  *]
  CanBindMultiple: false
  DefinitionID: 'Responsedef_GUIButtonBase_OnClick'
}
_Main/UI/MacroPlanner/Component_FormTestButtonCollection/_ROOT_Component_FormTestButtonCollection.def
@@ -11,6 +11,7 @@
    Columns:
    [
      GBFlow.Column { grow: 0 id: 454 parent: 0 }
      GBFlow.Column { grow: 0 id: 968 parent: 0 }
    ]
    Elements:
    [
@@ -18,6 +19,11 @@
      {
        Component => Button398
        Position { startcolumn: 454 startrow: 649 endcolumn: 454 endrow: 649 }
      }
      GBElement
      {
        Component => Button884
        Position { startcolumn: 968 startrow: 649 endcolumn: 968 endrow: 649 }
      }
    ]
    Gaps: [ left: 5 right: 5 top: 5 bottom: 5 inner: 5 ]
@@ -35,7 +41,19 @@
      Properties:
      [
        Image: 'HARDHAT'
        LayoutGroup: 'Button'
        Text: '生成产能分配结果数据'
      ]
    }
    Component Button884
    {
      #keys: '[414702.1.33954049]'
      BaseType: 'Button'
      Properties:
      [
        Image: 'CAKE_SLICE'
        LayoutGroup: 'Button'
        Text: '根据成品生成物料'
      ]
    }
  ]
@@ -46,5 +64,10 @@
    IncludeInView: true
    Title: '功能测试按钮'
    Width: 535
    ModeledStringList ChildOrdering
    {
      c: Button398
      c: Button884
    }
  ]
}
_Main/UI/MacroPlannerWebApp/Component_FrmOrderForecast/Response_OnCreated.def
@@ -5,10 +5,6 @@
  #keys: '[414724.0.91471552]'
  CanBindMultiple: false
  DefinitionID: 'Responsedef_WebComponent_OnCreated'
  Precondition:
  [*
  *]
  QuillAction
  {
    Body: