Quintiq file version 2.0 
 | 
#parent: #root 
 | 
StaticMethod CreateOldAssemblyOnlinePlanData ( 
 | 
  MacroPlan macroPlan 
 | 
) 
 | 
{ 
 | 
  TextBody: 
 | 
  [* 
 | 
    macroPlan.AssemblyOnlinePlanRow( relflush ); 
 | 
    macroPlan.AssemblyOnlinePlanColumn( relflush ); 
 | 
     
 | 
    // 创建列 
 | 
    firstColumn  := macroPlan.AssemblyOnlinePlanColumn( relnew, ColumnDate := macroPlan.StartOfPlanning().Date() - 2 ); 
 | 
    secondColumn := macroPlan.AssemblyOnlinePlanColumn( relnew, ColumnDate := macroPlan.StartOfPlanning().Date() - 1 ); 
 | 
    traverse ( macroPlan, NewAssemblyOnlinePlanColumn, naopc ) { 
 | 
      macroPlan.AssemblyOnlinePlanColumn( relnew, ColumnDate := naopc.StartDate() ); 
 | 
    } 
 | 
     
 | 
    pls := selectuniquevalues( macroPlan, NewAssemblyOnlinePlanRow, tempNAOPR, true, tempNAOPR.ProductionLine() ); 
 | 
     
 | 
    traverse ( pls, Elements, pl ) { 
 | 
      // 创建明细行 
 | 
      detailNAOPRs := selectsortedset( macroPlan, NewAssemblyOnlinePlanRow, tempNAOOPR, tempNAOOPR.ProductionLine() = pl and tempNAOOPR.Type() = "1", tempNAOOPR.ProductionLine(), tempNAOOPR.ProductID() ); 
 | 
      traverse ( detailNAOPRs, Elements, naopr ) { 
 | 
        quantityOPR := macroPlan.AssemblyOnlinePlanRow( relnew, ProductionLine := naopr.ProductionLine(), ProductID := naopr.ProductID(), Type := "1" ); 
 | 
        orderOPR    := macroPlan.AssemblyOnlinePlanRow( relnew, ProductionLine := naopr.ProductionLine(), ProductID := naopr.ProductID(), Type := "2" ); 
 | 
         
 | 
        // 第一列 
 | 
        quantityOPR.AssemblyOnlinePlanCell( relnew, AssemblyOnlinePlanColumn := firstColumn,  Value := naopr.Name() ); 
 | 
        orderOPR.AssemblyOnlinePlanCell(    relnew, AssemblyOnlinePlanColumn := firstColumn,  Value := "" ); 
 | 
         
 | 
        // 第二列 
 | 
        quantityOPR.AssemblyOnlinePlanCell( relnew, AssemblyOnlinePlanColumn := secondColumn, Value := "Quantity" ); 
 | 
        orderOPR.AssemblyOnlinePlanCell(    relnew, AssemblyOnlinePlanColumn := secondColumn, Value := "Order" ); 
 | 
         
 | 
        // 时间列 
 | 
        traverse ( naopr, NewAssemblyOnlinePlanCell, naopcell ) { 
 | 
          aopc := select( macroPlan, AssemblyOnlinePlanColumn, tempAOPC, tempAOPC.ColumnDate() = naopcell.StartDate() ); 
 | 
          quantityOPR.AssemblyOnlinePlanCell( relnew, AssemblyOnlinePlanColumn := aopc, Value := [String]naopcell.Quantity() ); 
 | 
          orderOPR.AssemblyOnlinePlanCell(    relnew, AssemblyOnlinePlanColumn := aopc, Value := naopcell.Order() ); 
 | 
        } 
 | 
      } 
 | 
       
 | 
      // 创建合计行 
 | 
      totalNAOPR           := select( macroPlan, NewAssemblyOnlinePlanRow, tempNAOPR, tempNAOPR.ProductionLine() = pl and tempNAOPR.Type() = "2" ); 
 | 
       
 | 
      totalAOPR             := macroPlan.AssemblyOnlinePlanRow( relnew, ProductionLine := totalNAOPR.ProductionLine(), ProductID := "Z", Type := "3" ); 
 | 
      shiftPatternNameAOPR  := macroPlan.AssemblyOnlinePlanRow( relnew, ProductionLine := totalNAOPR.ProductionLine(), ProductID := "Z", Type := "4" ); 
 | 
      shiftPatternStartAOPR := macroPlan.AssemblyOnlinePlanRow( relnew, ProductionLine := totalNAOPR.ProductionLine(), ProductID := "Z", Type := "5" ); 
 | 
      shiftPatternEndOAPR   := macroPlan.AssemblyOnlinePlanRow( relnew, ProductionLine := totalNAOPR.ProductionLine(), ProductID := "Z", Type := "6" ); 
 | 
       
 | 
      // 第一列 
 | 
      totalAOPR.AssemblyOnlinePlanCell(             relnew, AssemblyOnlinePlanColumn := firstColumn, Value := "合计" ); 
 | 
      shiftPatternNameAOPR.AssemblyOnlinePlanCell(  relnew, AssemblyOnlinePlanColumn := firstColumn, Value := "" ); 
 | 
      shiftPatternStartAOPR.AssemblyOnlinePlanCell( relnew, AssemblyOnlinePlanColumn := firstColumn, Value := "" ); 
 | 
      shiftPatternEndOAPR.AssemblyOnlinePlanCell(   relnew, AssemblyOnlinePlanColumn := firstColumn, Value := "" ); 
 | 
       
 | 
       // 第二列 
 | 
      totalAOPR.AssemblyOnlinePlanCell(             relnew, AssemblyOnlinePlanColumn := secondColumn, Value := "总量" ); 
 | 
      shiftPatternNameAOPR.AssemblyOnlinePlanCell(  relnew, AssemblyOnlinePlanColumn := secondColumn, Value := "班次" ); 
 | 
      shiftPatternStartAOPR.AssemblyOnlinePlanCell( relnew, AssemblyOnlinePlanColumn := secondColumn, Value := "班次开始时间" ); 
 | 
      shiftPatternEndOAPR.AssemblyOnlinePlanCell(   relnew, AssemblyOnlinePlanColumn := secondColumn, Value := "班次结束时间" ); 
 | 
       
 | 
      // 时间列 
 | 
      traverse ( totalNAOPR, NewAssemblyOnlinePlanCell, naopcell ) { 
 | 
        opc := select( macroPlan, AssemblyOnlinePlanColumn, tempAOPC, tempAOPC.ColumnDate() = naopcell.StartDate() ); 
 | 
        totalAOPR.AssemblyOnlinePlanCell(             relnew, AssemblyOnlinePlanColumn := opc, Value := [String]naopcell.TotalQuantity() ); 
 | 
        shiftPatternNameAOPR.AssemblyOnlinePlanCell(  relnew, AssemblyOnlinePlanColumn := opc, Value := naopcell.ShiftPatternName() ); 
 | 
        shiftPatternStartAOPR.AssemblyOnlinePlanCell( relnew, AssemblyOnlinePlanColumn := opc, Value := naopcell.ShiftPatternStart() ); 
 | 
        shiftPatternEndOAPR.AssemblyOnlinePlanCell(   relnew, AssemblyOnlinePlanColumn := opc, Value := naopcell.ShiftPatternEnd() ); 
 | 
      } 
 | 
    } 
 | 
  *] 
 | 
} 
 |