陈清红
2025-04-14 880f3c0257eeb8c37761d484258fdd102a369a19
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
Quintiq file version 2.0
#parent: #root
StaticMethod RefreshData (
  InterfaceDataset interface,
  MacroPlan macroPlan
)
{
  TextBody:
  [*
    //根据当前版本的装配上线计划
    //interface.AssemblyOnlinePlanVersion( relflush );
    allunit                := AssemblyOnlinePlanVersion::GetDefaultAllUnit();
    name                   := AssemblyOnlinePlanVersion::GetDefaultName();//search                 :=
    interface.AssemblyOnlinePlanVersionSearch( relnew, Product := allunit, ProductionLine := allunit, Unit := allunit, StartDate := Date::MinDate(), EndDate := Date::MaxDate() );//, TimeUnit := Translations::MP_GlobalParameters_Day()
    table                  := selectobject( interface, AssemblyOnlinePlanVersion, version, not version.IsShow() );
    if( isnull( table ) ){
      table                := interface.AssemblyOnlinePlanVersion( relnew, ID := name, Name := name );
    }
    //showtable              := selectobject( interface, AssemblyOnlinePlanVersion, version, version.IsShow() );
    //if( isnull( showtable ) ){
    //  showtable               := interface.AssemblyOnlinePlanVersion( relnew, ID := name, Name := name, IsShow := true );
    //}
    aopcolumns             := selectuniquevalues(  macroPlan, NewAssemblyOnlinePlanColumn, aopcolumn, not exists( table, Column, column, column.StartDate() = aopcolumn.StartDate() ), aopcolumn.StartDate() );//, column.TimeUnit() = Translations::MP_GlobalParameters_Day()
    if( aopcolumns.Size() > 0 ){
      table.GenerateColumn( aopcolumns, false );
    }
    traverse( macroPlan, NewAssemblyOnlinePlanRow, aoprow, aoprow.Type() = '1' ){
      row                  := table.GetRow( aoprow );
      traverse( aoprow, NewAssemblyOnlinePlanCell, aopcell ){
        column             := selectobject( table, Column, column, column.StartDate() = aopcell.NewAssemblyOnlinePlanColumn().StartDate() );
        
    //  traverse( table, Column, column, exists( aopcolumns, Elements, e, e = column.StartDate() ) ){//, aopcolumns.Find( column.StartDate() ) > -1
    //    qty                := se( aoprow, NewAssemblyOnlinePlanCell, aopcell, column.StartDate() <= aopcell.NewAssemblyOnlinePlanColumn().StartDate()
    //                                     and column.EndDate() >= aopcell.NewAssemblyOnlinePlanColumn().StartDate(), aopcell.Quantity() );
        
        cell               := selectobject( row, Cell, cell, cell.Column() = column );
        if( isnull( cell ) ){
          cell             := column.Cell( relnew, InventoryWeight := 0, ProductionSerialNumber := 0, Quantity := 0, Shift := '', Value := '' );
          row.Cell( relinsert, cell );
        }
        cell.Note( aopcell.Note() );
        cell.Order( aopcell.Order() );
        cell.OrderNr( aopcell.OrderNr() );
        cell.Quantity( aopcell.Quantity() );
      }
    }
    //productids             := selectuniquevalues( table, Row, row, row.Name() );
    //productlines           := selectuniquevalues( table, Row, row, row.ProductionLine() );
    //showtable.Generate( search, productids, productlines );
  *]
}