lihongji
2024-11-07 7da84821eb07cfa1370adfe4144e41416cf1cefa
_Main/BL/Type_AssemblyOnlinePlanPush/StaticMethod_GenerateData.qbl
@@ -1,10 +1,9 @@
Quintiq file version 2.0
#parent: #root
StaticMethod GenerateData (
  const MacroPlan macroplan,
  InterfaceDataset interfaceDataset,
  String executor,
  Boolean versionflag
  const MacroPlan macroplan,
  String executor
)
{
  Description: '生成可以下发的客户需求(PPA+IDS)数据'
@@ -25,32 +24,28 @@
                                                                 , Name := Translations::InterfaceDataset_AssemblyOnlinePlanPPPSPush_Name()
                                                                 , InterfaceDateTime := nowdate
                                                                 , Message := '装配上线计划-PPPS传输至数据中台(包含排序)/SAP(不包含排序)'
                                                                 , IsShow := false
                                                                 , Last := true
                                                                 , ReturnSuccess := true
                                                                 , ReturnMsg := 'Success'
                                                                 , Success := true
                                                                 , Last                      := true
                                                                  );
    traverse( macroplan, AssemblyOnlinePlanColumn, column ){
      traverse( column, AssemblyOnlinePlanCell, cell, cell.Value() <> '' and cell.AssemblyOnlinePlanRow().Type() = '1' ){
        quantityrow        := cell.AssemblyOnlinePlanRow();
        ordercell          := selectobject( column, AssemblyOnlinePlanCell, ocell, ocell.AssemblyOnlinePlanRow().ProductID() = quantityrow.ProductID()
                                            and ocell.AssemblyOnlinePlanRow().ProductionLine() = quantityrow.ProductionLine()
                                            and ocell.AssemblyOnlinePlanRow().Type() = '2' );
        product            := selectobject( macroplan, Product_MP, product, product.ID() = quantityrow.ProductID() );
        cd                  :=interfaceDataset.AssemblyOnlinePlanPPPSPush( relnew, Product           := product.ID()
                                                                           , PlanningDate            := column.ColumnDate()
                                                                           , PlanningQty             := [Number]cell.Value()
                                                                           , Sequence                := ordercell.Value()
    traverse( interfaceDataset, AssemblyOnlinePlanVersion, verison, not verison.IsShow() ){
      traverse( verison, Column, column, column.TimeUnit() = Translations::MP_GlobalParameters_Day() ){
        traverse( column, Cell, cell ){
          row              := cell.Row();
          cd               :=interfaceDataset.AssemblyOnlinePlanPPPSPush( relnew, Product            := row.ProductID()
                                                                           , PlanningDate            := column.StartDate()
                                                                           , PlanningQty             := [Number]cell.Quantity()
                                                                           , Sequence                := cell.Order()
                                                                           , VersionName             := macroplan.ScenarioName()
                                                                           , InterfaceTime           := nowdate
                                                                           , VersionFlag             := versionflag
                                                                           , ProductFourCode         := product.Notes()
                                                                           , FactoryName             := row.Unit()
                                                                          , Fac                     := ifexpr( row.Unit() = FinancialProductionReport::GetDefaultCCUnit(), 'CC', 'DL' )
    //                                                                       , VersionFlag             := versionflag
                                                                           , ProductFourCode         := ifexpr( row.ProductID() = row.Name(), '', row.Name() )
                                                                           );
        loginfo.AssemblyOnlinePlanPPPSPush( relinsert, cd );
        }
      }
    }
    loginfo.TotalRow( loginfo.AssemblyOnlinePlanPPPSPush( relsize ) );
    AssemblyOnlinePlanPPPSPush::Publish( interfaceDataset, loginfo );
  *]
}