Quintiq file version 2.0 
 | 
#parent: #root 
 | 
StaticMethod Upload ( 
 | 
  MacroPlan macroPlan, 
 | 
  GeneralExcelImportAndExportDataTable table 
 | 
) 
 | 
{ 
 | 
  TextBody: 
 | 
  [* 
 | 
    // 清空原始数据 
 | 
    macroPlan.ThreeDigitCode( relflush ); 
 | 
     
 | 
    // 校验文件名 
 | 
    if ( table.GeneralExcelImportAndExportDataSource().Name() <> "发动机匹配-三位码.xlsx" ) { 
 | 
      error( Translations::A_VWED_GeneralExcelImportAndExportDataSource_UploadError2() ); 
 | 
    } 
 | 
     
 | 
    // 生成数据 
 | 
    rowSize := table.GeneralExcelImportAndExportDataRow( relsize ); 
 | 
     
 | 
    for ( rowIndex := 0; rowIndex < rowSize; rowIndex++ ) { 
 | 
      row := select( table, GeneralExcelImportAndExportDataRow, tempGEIAEDR, tempGEIAEDR.RowNr() = rowIndex ); 
 | 
       
 | 
      codeCell             := select( row, GeneralExcelImportAndExportDataCell, tempGEIAEDC, tempGEIAEDC.GeneralExcelImportAndExportDataColumn().ColumnIndex() = 0 ); 
 | 
      vehicleModelCell     := select( row, GeneralExcelImportAndExportDataCell, tempGEIAEDC, tempGEIAEDC.GeneralExcelImportAndExportDataColumn().ColumnIndex() = 1 ); 
 | 
       
 | 
      macroPlan.ThreeDigitCode( relnew,  
 | 
                                Code                := guard( codeCell.Value(), "" ), 
 | 
                                VehicleModel        := guard( vehicleModelCell.Value(), "" ) );  
 | 
    } 
 | 
     
 | 
    // 校验数据 
 | 
    feedback            := ""; 
 | 
    sanitycheckfeedback := ""; 
 | 
    flag                := true; 
 | 
     
 | 
    traverse ( macroPlan, ThreeDigitCode, tdc, flag ) { 
 | 
      ThreeDigitCode::ValidateInput( feedback, sanitycheckfeedback, macroPlan, tdc.Code(), tdc.VehicleModel(), tdc ); 
 | 
      flag := feedback = ""; 
 | 
    } 
 | 
     
 | 
    if ( not flag ) { 
 | 
      error( feedback ); 
 | 
    } 
 | 
  *] 
 | 
} 
 |