lazhen
2024-11-07 7a55464720fcef69fc4362dcb570dff763ff026b
_Main/BL/Type_OfflinePlanArchiveVersion/StaticMethod_RefreshData.qbl
@@ -11,17 +11,19 @@
    //根据当前版本的下线计划
    allunit                := OfflinePlanArchiveVersion::GetDefaultAllUnit();
    name                   := OfflinePlanArchiveVersion::GetDefaultName();
    interface.OfflinePlanArchiveSearch( relnew, Product := allunit, ProductionLine := allunit, TimeUnit := Translations::MP_GlobalParameters_Day(), Unit := allunit, StartDate := Date::MinDate(), EndDate := Date::MaxDate() );
    search                 := interface.OfflinePlanArchiveSearch( relnew, Product := allunit, ProductionLine := allunit, TimeUnit := Translations::MP_GlobalParameters_Day(), Unit := allunit, StartDate := Date::MinDate(), EndDate := Date::MaxDate() );
    table                  := selectobject( interface, OfflinePlanArchiveVersion, version, not version.IsShow() );
    if( isnull( table ) ){
      table                := interface.OfflinePlanArchiveVersion( relnew, ID := name, Name := name );
    }
    //showtable              := selectobject( interface, OfflinePlanArchiveVersion, version, version.IsShow() );
    //if( isnull( table ) ){
    //  showtable               := interface.OfflinePlanArchiveVersion( relnew, ID := name, Name := name, IsShow := true );
    //}
    showtable              := selectobject( interface, OfflinePlanArchiveVersion, version, version.IsShow() );
    if( isnull( showtable ) ){
      showtable               := interface.OfflinePlanArchiveVersion( relnew, ID := name, Name := name, IsShow := true );
    }
    nopcolumns             := selectuniquevalues(  macroPlan, NewOfflinePlanTable.NewOfflinePlanColumn, nopcolumn, not exists( table, Column, column, column.TimeUnit() = Translations::MP_GlobalParameters_Day() and column.StartDate() = nopcolumn.StartDate() ), nopcolumn.StartDate() );
    table.GenerateColumn( nopcolumns );
    if( nopcolumns.Size() > 0 ){
      table.GenerateColumn( nopcolumns, false );
    }
    noptable               := maxobject( macroPlan, NewOfflinePlanTable, noptable, noptable.SaveDateTime() );
    actproductiondatas     := selectset( archive,ActualDailyProductionData,data,true );
    actproductiontree      := NamedValueTree::Create();
@@ -53,6 +55,6 @@
    //      cell.Value( nopcell.Value() );
      }
    }
    //showtable.Generate( search, products );
    showtable.Generate( search );
  *]
}