133 lines
6.2 KiB
Java
133 lines
6.2 KiB
Java
<#include "HfRpConfig.ftl">
|
|
[
|
|
<#list preparationOrder.preparation_line2_lst?filter(l ->l.despatched_ipg2_list?? && l.preparation_order_originator_reference!="") as preparation_line2>
|
|
<#list preparation_line2.despatched_ipg2_list as despatched_ipg2>
|
|
<#assign packing_datetime = RfxDateTimetoUTC(preparation_line2.confirmation_datetime,time_zone_offset_rfx) />
|
|
{
|
|
"Header": {
|
|
"ProjectID": "${projectRP}"
|
|
},
|
|
"ID": {
|
|
"RefDate": {
|
|
"AuthorTimeZone": "${time_zone_rfx}",
|
|
"DateTime": "${packing_datetime}"
|
|
},
|
|
<#if despatched_ipg2.carton_number != "000000000000000000">
|
|
"RefID": "${despatched_ipg2.carton_number}"
|
|
<#else>
|
|
"RefID": "${despatched_ipg2.hd_number}"
|
|
</#if>
|
|
},
|
|
|
|
"Payload": {
|
|
"Information" :{
|
|
<#if despatched_ipg2.carton_number != "000000000000000000">
|
|
"ContainerType": "${despatched_ipg2.carton_type_code?json_string}"
|
|
<#if preparation_line2.despatched_cartons_list?? >
|
|
<#list preparation_line2.despatched_cartons_list?filter(l ->l.carton_number==despatched_ipg2.carton_number) as dimensionCarton>
|
|
,
|
|
"Length": {
|
|
"Unit": "${length_unit_rfx}",
|
|
"Value": "${dimensionCarton.overall_depth}"
|
|
},
|
|
"Weight": {
|
|
"Unit": "${weight_unit_rfx}",
|
|
"Value": "${dimensionCarton.carton_gross_weight}"
|
|
},
|
|
"Height": {
|
|
"Unit": "${length_unit_rfx}",
|
|
"Value": "${dimensionCarton.overall_height}"
|
|
},
|
|
"Width": {
|
|
"Unit": "${length_unit_rfx}",
|
|
"Value": "${dimensionCarton.overall_width}"
|
|
}
|
|
</#list>
|
|
</#if>
|
|
<#else>
|
|
"ContainerType": "${despatched_ipg2.hd_type_code?json_string}"
|
|
<#if preparation_line2.despatched_hds_list??>
|
|
<#list preparation_line2.despatched_hds_list?filter(j ->j.handling_device_number==despatched_ipg2.hd_number) as dimensionHU>
|
|
,
|
|
"Length": {
|
|
"Unit": "${length_unit_rfx}",
|
|
"Value": "${dimensionHU.hd_type_depth}"
|
|
},
|
|
"Weight": {
|
|
"Unit": "${weight_unit_rfx}",
|
|
"Value": "${dimensionHU.hd_gross_weight}"
|
|
},
|
|
"Width": {
|
|
"Unit": "${length_unit_rfx}",
|
|
"Value": "${dimensionHU.hd_type_width}"
|
|
}
|
|
</#list>
|
|
</#if>
|
|
</#if>
|
|
},
|
|
|
|
<#-- HU Metadata inclusin inclusion -->
|
|
<#include "RFXtoRP_HsrPrepa_GoodsPrepared_HandlingUnitMetadata.ftl">
|
|
,
|
|
"PreparedContents" :[
|
|
{
|
|
"Goods": {
|
|
"ItemID": "${preparation_line2.item_code?trim?json_string}",
|
|
"LVBranchID": "${preparation_line2.item_lv_code?json_string}",
|
|
<#if (despatched_ipg2.ipg_manufacture_date?length != 0) && (despatched_ipg2.ipg_manufacture_date?starts_with("00") == false)>
|
|
<#assign priority_date = despatched_ipg2.ipg_manufacture_date?datetime(rfx_date_format_default)?iso_utc />
|
|
"PriorityDate": "${priority_date}",
|
|
<#else>
|
|
<#if (despatched_ipg2.ipg_receipt_date?length != 0) && (despatched_ipg2.ipg_receipt_date?starts_with("00")== false)>
|
|
<#assign priority_date = despatched_ipg2.ipg_receipt_date?datetime(rfx_date_format_default)?iso_utc />
|
|
"PriorityDate": "${priority_date}",
|
|
<#else>
|
|
<#if (despatched_ipg2.ipg_best_before_date?length != 0) && (despatched_ipg2.ipg_best_before_date?starts_with("00")== false)>
|
|
<#assign priority_date = despatched_ipg2.ipg_best_before_date?datetime(rfx_date_format_default)?iso_utc />
|
|
"PriorityDate": "${priority_date}",
|
|
<#else>
|
|
<#if (despatched_ipg2.ipg_sell_by_date?length != 0) && (despatched_ipg2.ipg_sell_by_date?starts_with("00")== false)>
|
|
<#assign priority_date = despatched_ipg2.ipg_sell_by_date?datetime(rfx_date_format_default)?iso_utc />
|
|
"PriorityDate": "${priority_date}",
|
|
<#else>
|
|
<#if (despatched_ipg2.ipg_use_by_date?length != 0) && (despatched_ipg2.ipg_use_by_date?starts_with("00")== false)>
|
|
<#assign priority_date = despatched_ipg2.ipg_use_by_date?datetime(rfx_date_format_default)?iso_utc />
|
|
"PriorityDate": "${priority_date}",
|
|
<#else>
|
|
<#if (preparationOrder.stock_despatch_at_preparation_datetime?length != 0) && (preparationOrder.stock_despatch_at_preparation_datetime?starts_with("00")== false)>
|
|
<#assign priority_date = preparationOrder.stock_despatch_at_preparation_datetime?datetime(rfx_date_format_default)?iso_utc />
|
|
"PriorityDate": "${priority_date}",
|
|
<#else>
|
|
"PriorityDate": "1970-01-01T00:00:00Z",
|
|
</#if>
|
|
</#if>
|
|
</#if>
|
|
</#if>
|
|
</#if>
|
|
</#if>
|
|
|
|
<#-- Segmentation Keys inclusion -->
|
|
<#include "RFXtoRP_HsrPrepa_GoodsPrepared_SegmentationKeys.ftl">
|
|
},
|
|
"ExecutionflowID": "${preparation_line2.preparation_order_originator_reference?trim?json_string}",
|
|
<#if (preparation_line2.pro_originator_reference_line_number!0) != 0>
|
|
"LineID": "${preparation_line2.pro_originator_reference_line_number}",
|
|
<#else>
|
|
"LineID": "${preparation_line2.pro_line_number!0}",
|
|
</#if>
|
|
"ActorID": "${preparationOrder.physical_depot_code?trim?json_string}",
|
|
"Quantity": {
|
|
"LVID": "${quantity_in_base_lv_RP_Cst}",
|
|
"Value": ${despatched_ipg2.quantity_lvs}
|
|
}
|
|
|
|
}
|
|
]
|
|
}
|
|
|
|
}<#sep>,</#sep>
|
|
</#list>
|
|
<#sep>,</#sep>
|
|
</#list>
|
|
]
|