renhao
2023-10-18 ff1d40a1a235da7c3bdfa26070af267f19c7a3d3
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
53
54
55
56
57
58
59
60
61
62
63
64
Quintiq file version 2.0
#parent: #root
Method ReceivingPanelMaterials (
  NamedValueTree requestnvt
) as stream[NamedValueTree]
{
  TextBody:
  [*
    logfile( "--------------------------------------1,进来了------------------------------------------------" );
    nameValue := requestnvt.Root();
    
    bodyHandle := requestnvt.GetHandle( "Body" );
    restHandle := requestnvt.GetHandle( "Rest" );
    restPayloadHandle := requestnvt.GetHandle( "RestPayload" );
    
    bodyNameValue := nameValue.Child( bodyHandle );
    restNameValue := bodyNameValue.Child( restHandle );
    restPayloadNameValue := restNameValue.Child( restPayloadHandle );
    
    businessTypeHandle := requestnvt.GetHandle( "businessType" );
    businessTypeNameValue := restPayloadNameValue.Child( businessTypeHandle );
    
    businessType := businessTypeNameValue.GetValueAsString();
    
    if ( businessType = "车载" ) {
      PanelMaterialVehicle::ReceiveDataGeneration( this, requestnvt );
    } else if ( businessType = "汽车电子" ) {
      PanelMaterialAutomotiveElectronics::ReceiveDataGeneration( this, requestnvt );
    } else if ( businessType = "天华" ) {
      PanelMaterialTianHua::ReceiveDataGeneration( this, requestnvt );
    } else if ( businessType = "运动健康" ) {
      PanelMaterialSportsHealth::ReceiveDataGeneration( this, requestnvt );
    } else if ( businessType = "专显" ) {
      PanelMaterialSpecializedDisplay::ReceiveDataGeneration( this, requestnvt );
    } else if ( businessType = "IT" ) {
      PanelMaterialIT::ReceiveDataGeneration( this, requestnvt );
    } else if ( businessType = "TM17" ) {
      PanelMaterialTM17::ReceiveDataGeneration( this, requestnvt );
    } else if ( businessType = "TM18" ) {
      PanelMaterialTM18::ReceiveDataGeneration( this, requestnvt );
    }
    
    info( "---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------" );
    
    replynvt := LibInt_MessageAccessor::CreateEmptyMessage();
    LibInt_MessageAccessor::SetHeaderProperty( replynvt, "Content-Type", "application/json" );
    LibInt_MessageAccessor::SetHeaderProperty( replynvt, "path", "/panelMaterial/send" );
    
    rootNamedValue := replynvt.Root();
    bodyHandle := replynvt.GetHandle( "Body" );
    
    //petHandle := replynvt.GetHandle( "Pet" );
    bodyNamedValue := rootNamedValue.Child( bodyHandle );
    codeHandler := replynvt.GetHandle( "code" );
    codeNamedValue := bodyNamedValue.AddChild( codeHandler );
    codeNamedValue.SetValue( 200 );
    
    info( "响应------------------------------------------------------------" );
    info( replynvt.ToString() );
    
    
    return emit( replynvt );
  *]
}