xiaoding721
2024-11-22 d47b2a6610c16b6db7fa991f6064d990085b65f3
_Main/BL/Type_CustomerDemandIDS/StaticMethod_GenerateData.qbl
@@ -14,17 +14,17 @@
    //interface.CustomerDemandIDS( relflush );
    //interface.CustomerDemandIDSSearch( relflush );
    info( '-------------------------Start---------------------');
    allunit               := CustomerDemandIDS::GetDefaultAllUnit();
    search                := interface.CustomerDemandIDSSearch( relnew, Product := allunit, StartDate := Date::MinDate(), EndDate := Date::MaxDate(), Unit := allunit );
    allunit               := CustomerDemandIDS::GetDefaultAllUnit();//search                :=
    interface.CustomerDemandIDSSearch( relnew, Product := allunit, StartDate := Date::MinDate(), EndDate := Date::MaxDate(), Unit := allunit );
    name                  := '客户需求';
    idstable              := selectobject( interface, CustomerDemandIDS, idstable, idstable.ID() = name );
    if( isnull( idstable ) ){
      idstable            := interface.CustomerDemandIDS( relnew, ID := name, Name := name );
    }
    showtable             := selectobject( interface, CustomerDemandIDS, version, version.IsShow() );
    if( isnull( showtable ) ){
      showtable           := interface.CustomerDemandIDS( relnew, ID := name + 'Show', Name := name, IsShow := true );
    }
    //showtable             := selectobject( interface, CustomerDemandIDS, version, version.IsShow() );
    //if( isnull( showtable ) ){
    //  showtable           := interface.CustomerDemandIDS( relnew, ID := name + 'Show', Name := name, IsShow := true );
    //}
    binaryValue           := TemplateManager::GetIDSFullTable( archive, Date::ActualDate().Year() );
    source                := GeneralExcelImportAndExportDataSource::Upload( recycle, binaryValue, OS::TempPath() + "template.xlsx" );
    source.ReadStructure();
@@ -48,12 +48,12 @@
        traverse( row, GeneralExcelImportAndExportDataCell, cell, cell.GeneralExcelImportAndExportDataColumn().ColumnIndex() > 2 ){
          period          := cnv2.Convert( cell.GeneralExcelImportAndExportDataColumn().Name() );
          daycolumn       := idstable.GetColumnByTimeUnit( Translations::MP_GlobalParameters_Day(), period );
          weekcolumn      := idstable.GetColumnByTimeUnit( Translations::MP_GlobalParameters_Week(), period );
          monthcolumn     := idstable.GetColumnByTimeUnit( Translations::MP_GlobalParameters_Month(), period );
    //      weekcolumn      := idstable.GetColumnByTimeUnit( Translations::MP_GlobalParameters_Week(), period );
    //      monthcolumn     := idstable.GetColumnByTimeUnit( Translations::MP_GlobalParameters_Month(), period );
          
          idsrow.SetCellValue( daycolumn, [Number]cell.Value() );
          idsrow.SetCellValue( weekcolumn, [Number]cell.Value() );
          idsrow.SetCellValue( monthcolumn, [Number]cell.Value() );
    //      idsrow.SetCellValue( weekcolumn, [Number]cell.Value() );
    //      idsrow.SetCellValue( monthcolumn, [Number]cell.Value() );
        }
      }
    }
@@ -66,18 +66,18 @@
      traverse( forecast, PlanningSalesDemandInPeriod, sdip ){
        idsrow              := idstable.GetRowByUnit( forecast.ProductID(), unitname );
        daycolumn           := idstable.GetColumnByTimeUnit( Translations::MP_GlobalParameters_Day(), sdip.StartDate() );
        weekcolumn          := idstable.GetColumnByTimeUnit( Translations::MP_GlobalParameters_Week(), sdip.StartDate() );
        monthcolumn         := idstable.GetColumnByTimeUnit( Translations::MP_GlobalParameters_Month(), sdip.StartDate() );
        info( '-----------------', isnull( idsrow ), isnull( daycolumn ), isnull( weekcolumn ), isnull( monthcolumn ), sdip.StartDate() );
    //    weekcolumn          := idstable.GetColumnByTimeUnit( Translations::MP_GlobalParameters_Week(), sdip.StartDate() );
    //    monthcolumn         := idstable.GetColumnByTimeUnit( Translations::MP_GlobalParameters_Month(), sdip.StartDate() );
    //    info( '-----------------', isnull( idsrow ), isnull( daycolumn ), isnull( weekcolumn ), isnull( monthcolumn ), sdip.StartDate() );
        idsrow.SetCellValue( daycolumn, [Number]sdip.Quantity() );
        idsrow.SetCellValue( weekcolumn, [Number]sdip.Quantity() );
        idsrow.SetCellValue( monthcolumn, [Number]sdip.Quantity() );
    //    idsrow.SetCellValue( weekcolumn, [Number]sdip.Quantity() );
    //    idsrow.SetCellValue( monthcolumn, [Number]sdip.Quantity() );
      }
    }
    
    source.Delete();
    info( '-------------------------End---------------------');
    productids             := selectuniquevalues( idstable, Row, row, row.Name() );
    showtable.Generate( search, productids );
    //productids             := selectuniquevalues( idstable, Row, row, row.Name() );
    //showtable.Generate( search, productids );
  *]
}