lazhen
2024-11-05 aa42b48fd2d23e75b64a0aec05d5be4b9ebf0465
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
Quintiq file version 2.0
#parent: #root
StaticMethod RefreshData (
  InterfaceDataset interface,
  const MacroPlan macroPlan
)
{
  TextBody:
  [*
    //根据当前版本的装配上线计划
    interface.AssemblyOnlinePlanVersion( relflush );
    allunit                := AssemblyOnlinePlanVersion::GetDefaultAllUnit();
    name                   := AssemblyOnlinePlanVersion::GetDefaultName();//search                 := 
    interface.AssemblyOnlinePlanVersionSearch( relnew, Product := allunit, ProductionLine := allunit, TimeUnit := Translations::MP_GlobalParameters_Day(), Unit := allunit, StartDate := Date::MinDate(), EndDate := Date::MaxDate() );
    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( table ) ){
    //  showtable               := interface.AssemblyOnlinePlanVersion( relnew, ID := name, Name := name, IsShow := true );
    //}
    aopcolumns             := selectuniquevalues(  macroPlan, NewAssemblyOnlinePlanColumn, aopcolumn, not exists( table, Column, column, column.TimeUnit() = Translations::MP_GlobalParameters_Day() and column.StartDate() = aopcolumn.StartDate() ), aopcolumn.StartDate() );
    table.GenerateColumn( aopcolumns );
    traverse( macroPlan, NewAssemblyOnlinePlanRow, aoprow, aoprow.Type() = '1' ){
      row                  := table.GetRow( aoprow );
      info( '------------------------', row.Type() );
      traverse( aoprow, NewAssemblyOnlinePlanCell, aopcell ){
        column             := selectobject( table, Column, column, column.TimeUnit() = Translations::MP_GlobalParameters_Day() and column.StartDate() = aopcell.NewAssemblyOnlinePlanColumn().StartDate() );
        cell               := selectobject( row, Cell, cell, cell.Column() = column );
        cell.InventoryWeight( aopcell.InventoryWeight() );
    //    cell.ProductionSerialNumber( aopcell.ProductionSerialNumber() );  
        cell.Quantity( aopcell.Quantity() );
    //    cell.Shift( aopcell.Shift() );
    //    cell.Value( aopcell.Value() );
      }
    }
    //showtable.Generate( search, products );
  *]
}