lazhen
2024-09-06 db7a0a9394d11c51b478579d6aa24790b7deaa4c
_Main/BL/Type_CustomerDemandPPAIDS/StaticMethod_GenerateData.qbl
@@ -2,7 +2,6 @@
#parent: #root
StaticMethod GenerateData (
  const MacroPlan macroplan,
  RecycleBin recycle,
  const Archive archive,
  InterfaceDataset interfaceDataset,
  String executor,
@@ -44,16 +43,15 @@
      loginfo.CustomerDemandPPAIDS( relinsert, cd );
    }
    binaryValue           := TemplateManager::GetIDSFullTable( archive, Date::ActualDate().Year() );
    source                := GeneralExcelImportAndExportDataSource::Upload( recycle, binaryValue, OS::TempPath() + "template.xlsx" );
    source.ReadStructure();
    //productcolumn         := select( recycle, ge.Column, column, column.Index() = 1 );
    CustomerDemandIDS::ReadStructure( binaryValue, interfaceDataset );
    productcolumn         := select( interfaceDataset, CustomerDemandIDS.Column, column, column.Index() = 1 );
    cnv2 := StringToDate::StandardConverter();
    cnv2.SetCustomConversion();
    cnv2.CustomFormatString( "dd/MM/yyyy" );
    traverse( recycle, GeneralExcelImportAndExportDataSource.GeneralExcelImportAndExportDataTable.GeneralExcelImportAndExportDataRow, row ){
      product             := selectobject( row, GeneralExcelImportAndExportDataCell, cell, cell.GeneralExcelImportAndExportDataColumn().ColumnIndex() = 1 );
      traverse( row, GeneralExcelImportAndExportDataCell, cell, cell.GeneralExcelImportAndExportDataColumn().ColumnIndex() > 3 ){
        period := cnv2.Convert( cell.GeneralExcelImportAndExportDataColumn().Name() );
    traverse( interfaceDataset, CustomerDemandIDS.Row, row ){
      product             := selectobject( row, Cell, cell, cell.Column() = productcolumn );
      traverse( row, Cell, cell, cell.Column().Index() > 3 ){
        period := cnv2.Convert( cell.Column().Name() );
        cd                  :=interfaceDataset.CustomerDemandPPAIDS( relnew, Product           := product.Value()
                                                                     , DemandDate              := period
                                                                     , DemandQty               := [Number]cell.Value()
@@ -64,7 +62,6 @@
        loginfo.CustomerDemandPPAIDS( relinsert, cd );
      }
    }
    source.Delete();
    loginfo.TotalRow( loginfo.CustomerDemandPPAIDS( relsize ) );
  *]
}