陈清红
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
Quintiq file version 2.0
#parent: #root
StaticMethod Import (
  MacroPlan macroPlan,
  GeneralExcelImportAndExportDataTable table
)
{
  TextBody:
  [*
    generation := "";
    mqb_mlb    := "";
    
    traverse ( table, GeneralExcelImportAndExportDataRow, row ) {
      traverse ( table, GeneralExcelImportAndExportDataColumn, column ) {
        // 单元格值
        cellValue := select( row, GeneralExcelImportAndExportDataCell, tempGEIAEDCell, tempGEIAEDCell.GeneralExcelImportAndExportDataColumn() = column ).Value();
        
        if ( column.ColumnIndex() = 0 and cellValue <> "" ) {
          generation := guard( cellValue.Tokenize( " " ).Element( 0 ), "" );
          mqb_mlb    := guard( cellValue.Tokenize( " " ).Element( 1 ), "" );
        }
        
        
        // 料架总数设置列
        mrc  := select( macroPlan, MaterialRackColumn, tempMRC, tempMRC.Month() = guard( [Number]column.Name(), 0 ) );
        // 料架总数设置行
        mrcr := select( macroPlan, MaterialRackCustomRow, tempMRCR, tempMRCR.Generation() = generation and tempMRCR.MLB_MQB() = mqb_mlb );
        
        if ( column.ColumnIndex() > 0 and not isnull( mrc ) and not isnull( mrcr ) ) {
          cell := select( mrcr, MaterialRackCustomCell, tempMRCCell, tempMRCCell.MaterialRackColumn() = mrc );
          
          cell.Quantity( [Real]cellValue );
        }
      }
    }
  *]
}