陈清红
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
45
46
47
48
49
50
51
52
Quintiq file version 2.0
#parent: #root
Method GetImage (
  LibSOPImpExp_DataSource datasource_i
) declarative as String
{
  TextBody:
  [*
    // Display associated image based on whether the files uploaded is matching with files required
    value := "";
    
    // Find import object group in user import profile that is matched with datasource
    matched_iog := this.GetMatchingImportObjectGroup( datasource_i, false );
    isGroup := isnull( datasource_i.LibSOPImpExp_DataSourceParent() );
    isSource := datasource_i.LibSOPImpExp_DataSourceChild( relsize ) = 0;
    selectedFiles := selectvalues( this, LibSOPImpExp_ImportUploadedFile, file, true, file.FileName() );
    filesRequired := null( Strings );
    
    if( isSource )
    {
      filesRequired := selectvalues( datasource_i, LibSOPImpExp_DataSourceFile, file, true, file.FileName() );
      value := this.GetImage( matched_iog, false );
    }
    else if ( isGroup )
    {
      filesRequired := selectvalues( datasource_i, LibSOPImpExp_DataSourceChild.LibSOPImpExp_DataSourceChild.LibSOPImpExp_DataSourceFile,
                                     file, file.LibSOPImpExp_DataSource().DisplayFileNames().Length() > 0, file.FileName() );
    }
    else
    {
      filesRequired := selectvalues( datasource_i, LibSOPImpExp_DataSourceChild.LibSOPImpExp_DataSourceFile, file,
                                      file.LibSOPImpExp_DataSource().DisplayFileNames().Length() > 0, file.FileName() );
    }
    
    if( selectedFiles.ContainsAll( filesRequired ) )
    {
      value := this.GetImage( matched_iog, true );
    }
    else if( selectedFiles.Intersect( filesRequired ).Size() > 0 )
    {
      if( isSource )
      {
        value := this.GetImage( matched_iog, false );
      }
      else
      {
        value := "ARROW_MIX";
      }
    }
    return value;
  *]
}