diff --git a/RFXtoRP_HsrPrepa.ftl b/RFXtoRP_HsrPrepa.ftl index ea7f9cf..cba206c 100644 --- a/RFXtoRP_HsrPrepa.ftl +++ b/RFXtoRP_HsrPrepa.ftl @@ -47,6 +47,7 @@ + <#list preparationOrder.preparation_line_lst?filter(l ->l.despatched_ipg_list??) as preparation_line> <#list preparation_line.despatched_ipg_list as despatched_ipg> { @@ -54,8 +55,23 @@ "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : <#include "RFXtoRP_HsrPrepa_TrackingHuLabelled.ftl"> - } - + }, + <#if despatched_ipg.carton_number != "000000000000000000" && despatched_ipg.carton_number!=despatched_ipg.hd_number > + { + <#assign includeHU = []> + <#list preparation_line.despatched_ipg_list as despatched_ipg2> + <#if despatched_ipg.hd_number == despatched_ipg2.hd_number > + <#assign includeHU += ["despatched_ipg2.carton_number"] + + + + <#assign apiReflexPlatformID = ApiReflexPlatformID.HandlingunitHUsAdded> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrPrepa_HandlingunitHUsAdded.ftl"> + } + + diff --git a/RFXtoRP_HsrPrepa_HandlingunitHUsAdded.ftl b/RFXtoRP_HsrPrepa_HandlingunitHUsAdded.ftl index e69de29..b953a5b 100644 --- a/RFXtoRP_HsrPrepa_HandlingunitHUsAdded.ftl +++ b/RFXtoRP_HsrPrepa_HandlingunitHUsAdded.ftl @@ -0,0 +1,34 @@ +<#include "HfRpConfig.ftl"> +<#include "ReflexUtils.ftl"> +[ + + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${despatched_ipg.hd_number}" + }, + + "Payload": { + + "IncludedHandlingunitIDs": ${includeHU}, + "Information": { + "ContainerType": "${preparation_line.despached_hds-list[0].hd_type_code}", + "Length": { + "Unit": "${length_unit_rfx}", + "Value": ${preparation_line.despached_hds-list[0].hd_type_depth} + }, + "Weight": { + "Unit": "${weight_unit_rfx}", + "Value": ${preparation_line.despached_hds-list[0].hd_type_weight} + }, + "Width": { + "Unit": "${length_unit_rfx}", + "Value": ${preparation_line.despached_hds-list[0].hd_type_width} + } + } + + } + } +] \ No newline at end of file