Quintiq file version 2.0 
 | 
#parent: #root 
 | 
StaticMethod GenerateData ( 
 | 
  const MacroPlan macroplan, 
 | 
  InterfaceDataset interfaceDataset, 
 | 
  String executor, 
 | 
  Boolean versionflag 
 | 
) 
 | 
{ 
 | 
  Description: '生成可以下发的客户需求(PPA+IDS)数据' 
 | 
  TextBody: 
 | 
  [* 
 | 
    // 甄兰鸽 Aug-20-2024 (created) 
 | 
    loginfo                := maxobject(  interfaceDataset, InterfaceLoginfo, loginfo, loginfo.Name() = Translations::InterfaceDataset_AssemblyOnlinePlanPPPSPush_Name(), loginfo.InterfaceDateTime() ); 
 | 
    if( not isnull( loginfo ) ){ 
 | 
      if( not loginfo.IsShow() ){ 
 | 
        loginfo.Delete(); 
 | 
      }else{ 
 | 
        loginfo.Last( false ); 
 | 
      } 
 | 
      interfaceDataset.AssemblyOnlinePlanPPPSPush( relflush ); 
 | 
    } 
 | 
    nowdate                := DateTime::ActualTime(); 
 | 
    loginfo                := interfaceDataset.InterfaceLoginfo( relnew, ExecuteUser := executor 
 | 
                                                                 , Name := Translations::InterfaceDataset_AssemblyOnlinePlanPPPSPush_Name() 
 | 
                                                                 , InterfaceDateTime := nowdate 
 | 
                                                                 , Message := '装配上线计划-PPPS传输至数据中台(包含排序)/SAP(不包含排序)' 
 | 
                                                                 , IsShow := false 
 | 
                                                                 , Last := true 
 | 
                                                                 , ReturnSuccess := true 
 | 
                                                                 , ReturnMsg := 'Success' 
 | 
                                                                 , Success := 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() 
 | 
                                                                           , VersionName             := macroplan.ScenarioName() 
 | 
                                                                           , InterfaceTime           := nowdate 
 | 
                                                                           , VersionFlag             := versionflag 
 | 
                                                                           , ProductFourCode         := product.Notes() 
 | 
                                                                           ); 
 | 
        loginfo.AssemblyOnlinePlanPPPSPush( relinsert, cd ); 
 | 
      } 
 | 
    } 
 | 
    loginfo.TotalRow( loginfo.AssemblyOnlinePlanPPPSPush( relsize ) ); 
 | 
  *] 
 | 
} 
 |