陈清红
2025-04-14 880f3c0257eeb8c37761d484258fdd102a369a19
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
41
42
43
44
Quintiq file version 2.0
#parent: #root
StaticMethod FillRows (
  const GeneralExcelImportAndExportDataTable general,
  Strings rowKeys,
  NamedValueTree rowKeyIndexTree,
  NamedValueTree rowTree,
  constcontent GeneralExcelImportAndExportDataRows rows
)
{
  TextBody:
  [*
    // rislai Jun-22-2024 (created)
    rowKeyColumn1 := select( general, GeneralExcelImportAndExportDataColumn, column, column.Name() = "产地" );
    rowKeyColumn2 := select( general, GeneralExcelImportAndExportDataColumn, column, column.Name() = "车型" );
    rowKeyColumn3 := select( general, GeneralExcelImportAndExportDataColumn, column, column.Name() = "发动机零件号" );
    rowKeyColumn4 := select( general, GeneralExcelImportAndExportDataColumn, column, column.Name() = "发动机四位码" );
    tempRowKeyCells1 := selectset( rowKeyColumn1,GeneralExcelImportAndExportDataCell,cell,true );
    tempRowKeyCells2 := selectset( rowKeyColumn2,GeneralExcelImportAndExportDataCell,cell,true );
    tempRowKeyCells3 := selectset( rowKeyColumn3,GeneralExcelImportAndExportDataCell,cell,true );
    tempRowKeyCells4 := selectset( rowKeyColumn4,GeneralExcelImportAndExportDataCell,cell,true );
    
    for( i := 0; i< tempRowKeyCells1.Size(); i++ ){
      tempRowKeyCell1 := tempRowKeyCells1.Element( i );
      tempRowKeyCell2 := tempRowKeyCells2.Element( i );
      tempRowKeyCell3 := tempRowKeyCells3.Element( i );
      tempRowKeyCell4 := tempRowKeyCells4.Element( i );
      
      rowKey := tempRowKeyCell1.Value() + tempRowKeyCell2.Value() + tempRowKeyCell3.Value() + tempRowKeyCell4.Value();
      
      tempHandle := rowTree.GetHandle( rowKey );
      rowTree.Root().AddChild( tempHandle ,i);
      rows.Add( tempRowKeyCell1.GeneralExcelImportAndExportDataRow());
      
      rowKeyHanlde := rowKeyIndexTree.GetHandle( rowKey );
      rowKeyIndex := guard( rowKeyIndexTree.Root().Child( rowKeyHanlde ),null( NamedValue ));
      if( isnull( rowKeyIndex )){
        rowKeys.Add( rowKey );
        rowKeyIndexTree.Root().AddChild( rowKeyHanlde,rowKeys.Size() - 1 );
      }
      
    }
  *]
}