hongji.li
2023-09-18 a88fe6630f15c12d5c35d6b8a6dd4c8c4635d202
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
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" );
    
    rootNamedValue := replynvt.Root();
    bodyHandle := replynvt.GetHandle( "Body" );
    petHandle := replynvt.GetHandle( "Pet" );
    bodyNamedValue := rootNamedValue.Child( bodyHandle );
    petNamedValue := bodyNamedValue.AddChild( petHandle );
    categoryHandle := replynvt.GetHandle( "Category" );
    categoryNamedValue := petNamedValue.AddChild( categoryHandle );
    categoryIDHandle := replynvt.GetHandle( "Id" );
    categoryIDNamedValue := categoryNamedValue.AddChild( categoryIDHandle );
    categoryIDNamedValue.SetValue( 3 );
    categoryNameHandle := replynvt.GetHandle( "Name" );
    categoryNameNamedValue := categoryNamedValue.AddChild( categoryNameHandle );
    categoryNameNamedValue.SetValue( "Cat" );
    petNameHandle := replynvt.GetHandle( "Name" );
    petNameValue := petNamedValue.AddChild( petNameHandle );
    petNameValue.SetValue( "Pet1" );
    petIdHandle := replynvt.GetHandle( "PetId" );
    petIdNameValue := petNamedValue.AddChild( petIdHandle );
    petIdNameValue.SetValue( 1 );
    
    photoUrlHandle := replynvt.GetHandle( "PhotoUrl" );
    photoUrlNameValue := petNamedValue.AddChild( photoUrlHandle );
    urlHandle := replynvt.GetHandle( "Url" );
    photoUrlNameValue.AddChild( urlHandle, "url1" );
    
    statusHandle := replynvt.GetHandle( "Status" );
    statusNameValue := petNamedValue.AddChild( statusHandle );
    statusNameValue.SetValue( "available" );
    
    tagHandle := replynvt.GetHandle( "Tag" );
    tagNameValue := petNamedValue.AddChild( tagHandle );
    tagIdHandle := replynvt.GetHandle( "Id" );
    tagNameValue.AddChild( tagIdHandle, 123 );
    tagNameHandle := replynvt.GetHandle( "Name" );
    tagNameValue.AddChild( tagNameHandle, "tag1" );
    
    
    info( replynvt.ToString() );
    
    
    return emit( replynvt );
  *]
}