hongjli
2023-09-13 afcb84a794314268332e62c0b26c01a7b38c8115
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
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 );
    
    releaseDateHandle := requestnvt.GetHandle( "releaseDate" );
    businessTypeHandle := requestnvt.GetHandle( "businessType" );
    scenarioNameHandle := requestnvt.GetHandle( "scenarioName" );
    
    releaseDateNameValue := restPayloadNameValue.Child( releaseDateHandle );
    businessTypeNameValue := restPayloadNameValue.Child( businessTypeHandle );
    scenarioNameNameValue := restPayloadNameValue.Child( scenarioNameHandle );
    
    info( "发布时间:", releaseDateNameValue.GetValueAsString(), "    事业部:", businessTypeNameValue.GetValueAsString(), "    版本号:", scenarioNameNameValue.GetValueAsString() );
    
    panelMaterialsHandle := requestnvt.GetHandle( "panelMaterials" );
    panelMaterialsNameValue := restPayloadNameValue.Child( panelMaterialsHandle );
    childPanelMaterialsNameValue := panelMaterialsNameValue.Children();
    productIDHandle := requestnvt.GetHandle( "productID" );
    productDescriptionHandle := requestnvt.GetHandle( "productDescription" );
    startDateHandle := requestnvt.GetHandle( "startDate" );
    quantityHandle := requestnvt.GetHandle( "quantity" );
    traverse ( childPanelMaterialsNameValue, Elements, cpmnv ) {
      info( "产品:", cpmnv.Child( productIDHandle ).GetValueAsString() );
      info( "产品描述:", cpmnv.Child( productDescriptionHandle ).GetValueAsString() );
      info( "开始时间:", cpmnv.Child( startDateHandle ).GetValueAsString() );
      info( "数量:", cpmnv.Child( quantityHandle ).GetValueAsString() );
    }
    
    // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    replynvt := LibInt_MessageAccessor::CreateEmptyMessage();
    LibInt_MessageAccessor::SetHeaderProperty( replynvt, "Content-Type", "application/json" );
    
    
    
    return emit( replynvt );
  *]
}