Merge branch 'release/1.2' into 'main'

Release/1.2

See merge request r-d-technique/tiers/reflex-wms-connector!22
This commit is contained in:
Cedric RODIER 2024-04-06 07:27:04 +00:00
commit 0b36faa2ae
51 changed files with 941 additions and 681 deletions

View File

@ -26,7 +26,7 @@
<#list reflexStockPicturesInterface.detailled_stock_list as stock> <#list reflexStockPicturesInterface.detailled_stock_list as stock>
<#if stock.stock_type_code != "200"> <#if stock.stock_type_code != "200">
<#stop "stock type different from 200"> <#stop>
<#break> <#break>
</#if> </#if>
</#list> </#list>

View File

@ -27,6 +27,8 @@
<#assign priority_date = stock.priority_date?datetime(rfx_date_format_default)?iso_utc /> <#assign priority_date = stock.priority_date?datetime(rfx_date_format_default)?iso_utc />
<#if (stock.priority_date!="") && (stock.priority_date?starts_with("00")== false) > <#if (stock.priority_date!="") && (stock.priority_date?starts_with("00")== false) >
"PriorityDate" : "${priority_date}", "PriorityDate" : "${priority_date}",
<#else>
"PriorityDate": "1970-01-01T00:00:00Z",
</#if> </#if>
<#-- Segmentation keys inclusion --> <#-- Segmentation keys inclusion -->

View File

@ -12,6 +12,7 @@
<#assign reflexMvtStockInterface = JsonUtil.jsonToMap(dataRfx)> <#assign reflexMvtStockInterface = JsonUtil.jsonToMap(dataRfx)>
<#-- exclusion of the cases of an IPG move with quantity = 0 (weight modification) --> <#-- exclusion of the cases of an IPG move with quantity = 0 (weight modification) -->
<#if reflexMvtStockInterface.ipg_move_quantity_in_base_lvs != 0> <#if reflexMvtStockInterface.ipg_move_quantity_in_base_lvs != 0>
<#-- IPG moves translated into Stock moves --> <#-- IPG moves translated into Stock moves -->
@ -34,15 +35,13 @@
"apiReflexPlatformID" : "${apiReflexPlatformID}", "apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" : "datas" :
<#include "RFXtoRP_HsaIpgMove_StockMoved.ftl"> <#include "RFXtoRP_HsaIpgMove_StockMoved.ftl">
} }
] ]
<#else> <#else>
<#-- IPG moves translated into goods received (all type of receipt) --> <#-- IPG moves translated into goods received (all type of receipt) -->
<#if reflexMvtStockInterface.ipg_move_type == "100" || <#if (reflexMvtStockInterface.ipg_move_type == "100" ||
reflexMvtStockInterface.ipg_move_type == "110" || reflexMvtStockInterface.ipg_move_type == "110" ||
reflexMvtStockInterface.ipg_move_type == "120" reflexMvtStockInterface.ipg_move_type == "120") && reflexMvtStockInterface.receipt_reference?? && reflexMvtStockInterface.receipt_reference!="">
>
[ [
{ {
<#assign apiReflexPlatformID = ApiReflexPlatformID.HandlingunitGoodsReceived> <#assign apiReflexPlatformID = ApiReflexPlatformID.HandlingunitGoodsReceived>
@ -52,10 +51,14 @@
} }
] ]
<#else> <#else>
<#if reflexMvtStockInterface.receipt_reference?? && reflexMvtStockInterface.receipt_reference!="">
<#-- Case of IPG move type volontarilly ignored--> <#-- Case of IPG move type volontarilly ignored-->
<#stop " Reference receipt is empty">
<#else>
<#stop> <#stop>
</#if> </#if>
</#if> </#if>
</#if>
<#else> <#else>
<#-- cases of an IPG move with quantity = 0 (weight modification)--> <#-- cases of an IPG move with quantity = 0 (weight modification)-->
<#stop> <#stop>

View File

@ -24,7 +24,11 @@
"Payload": { "Payload": {
"Goods": { "Goods": {
"ItemID": "${reflexMvtStockInterface.item_code?trim?json_string}", "ItemID": "${reflexMvtStockInterface.item_code?trim?json_string}",
<#if (reflexMvtStockInterface.ipg_priority_date!="") && (reflexMvtStockInterface.ipg_priority_date?starts_with("00")== false) >
"PriorityDate": "${ipg_priority_datetime}", "PriorityDate": "${ipg_priority_datetime}",
<#else>
"PriorityDate": "1970-01-01T00:00:00Z",
</#if>
<#-- Segmentation keys inclusions --> <#-- Segmentation keys inclusions -->
<#include "RFXtoRP_HsaIpgMove_StockMoved_SegmentationKeys.ftl">, <#include "RFXtoRP_HsaIpgMove_StockMoved_SegmentationKeys.ftl">,

View File

@ -49,7 +49,9 @@
<#-- LV Metadata inclusion --> <#-- LV Metadata inclusion -->
<#include "RFXtoRP_HsaItm_ItemCreated_LogisticVariantMetadata.ftl">, <#include "RFXtoRP_HsaItm_ItemCreated_LogisticVariantMetadata.ftl">,
<#if logistical_variant.base_lv?? && logistical_variant.base_lv!="">
"IsBaseLogisticVariant": ${logistical_variant.base_lv}, "IsBaseLogisticVariant": ${logistical_variant.base_lv},
</#if>
<#if logistical_variant.base_lv != "true"> <#if logistical_variant.base_lv != "true">
"RefLV": "${logistical_variant.subpackaging_lv_code?json_string}", "RefLV": "${logistical_variant.subpackaging_lv_code?json_string}",

View File

@ -17,6 +17,7 @@
<#assign preparationStatusInterface = JsonUtil.jsonToMap(dataRfx) /> <#assign preparationStatusInterface = JsonUtil.jsonToMap(dataRfx) />
[ [
<#--**Pick batch runned (200) **--> <#--**Pick batch runned (200) **-->
<#if preparationStatusInterface.preparation_order_originator_reference?? && preparationStatusInterface.preparation_order_originator_reference!="">
<#if preparationStatusInterface.preparation_status_type == "100" && preparationStatusInterface.preparation_status_code == "200" > <#if preparationStatusInterface.preparation_status_type == "100" && preparationStatusInterface.preparation_status_code == "200" >
{ {
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowPreparationExpected> <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowPreparationExpected>
@ -34,17 +35,14 @@
<#include "RFXtoRP_HsaProStatus_PreparationStarted.ftl"> <#include "RFXtoRP_HsaProStatus_PreparationStarted.ftl">
} }
<#else> <#else>
<#-- **Preparation to package (500) and preparation completed (550)** --> <#-- ****Preparation dispatched (600)** -->
<#if preparationStatusInterface.preparation_status_type == "100" && (preparationStatusInterface.preparation_status_code == "500" || preparationStatusInterface.preparation_status_code == "550")> <#if preparationStatusInterface.preparation_status_type == "100" && preparationStatusInterface.preparation_status_code == "600" >
{ {
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowPreparationCompleted> <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowPreparationCompleted>
"apiReflexPlatformID" : "${apiReflexPlatformID}", "apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" : "datas" :
<#include "RFXtoRP_HsaProStatus_PreparationCompleted.ftl"> <#include "RFXtoRP_HsaProStatus_PreparationCompleted.ftl">
} },
<#else>
<#-- ****Preparation dispatched (600)** -->
<#if preparationStatusInterface.preparation_status_type == "100" && preparationStatusInterface.preparation_status_code == "600" >
{ {
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowTransportStarted> <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowTransportStarted>
"apiReflexPlatformID" : "${apiReflexPlatformID}", "apiReflexPlatformID" : "${apiReflexPlatformID}",
@ -66,6 +64,8 @@
</#if> </#if>
</#if> </#if>
</#if> </#if>
<#else>
<#stop "PRO reference is empty">
</#if> </#if>
] ]
<#break> <#break>

View File

@ -2,7 +2,7 @@
<#-- input : message RFX --> <#-- input : message RFX -->
<#-- project : projectId in ReflexPlatform --> <#-- project : projectId in ReflexPlatform -->
<#-- organisation : organisationtId in ReflexPlatform --> <#-- organisation : organisationtId in ReflexPlatform -->
<#include "ReflexUtils.ftl">
<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> <#assign cloudEventMsg = JsonUtil.jsonToMap(input)>
<#assign projectRP = project> <#assign projectRP = project>
<#assign organisationRP = organisation> <#assign organisationRP = organisation>
@ -16,13 +16,13 @@
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign preparationOrder = JsonUtil.jsonToMap(dataRfx)> <#assign preparationOrder = JsonUtil.jsonToMap(dataRfx)>
<#if preparationOrder.total_lv_validated !=0> <#if preparationOrder.total_lv_validated !=0>
[ [
{ {
<#assign apiReflexPlatformID = ApiReflexPlatformID.HandlingunitGoodsPrepared> <#assign apiReflexPlatformID = ApiReflexPlatformID.HandlingunitGoodsPrepared>
"apiReflexPlatformID" : "${apiReflexPlatformID}", "apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" : "datas" :
<#include "RFXtoRP_HsrPrepa_GoodsPrepared.ftl"> <#include "RFXtoRP_HsrPrepa_HandlingunitGoodsPrepared.ftl">
}, },
{ {
<#assign apiReflexPlatformID = ApiReflexPlatformID.HandlingunitDispatched> <#assign apiReflexPlatformID = ApiReflexPlatformID.HandlingunitDispatched>
@ -30,9 +30,27 @@
"datas" : "datas" :
<#include "RFXtoRP_HsrPrepa_HandlingUnitDispatched.ftl"> <#include "RFXtoRP_HsrPrepa_HandlingUnitDispatched.ftl">
} }
<#list preparationOrder.preparation_line_lst?filter(l ->l.despatched_ipg_list??) as preparation_line>
<#if preparationOrder.load_data?? && preparationOrder.load_data.carrier_code?? && preparationOrder.load_data.carrier_code!="">
,
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCarrierUpdated>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrPrepa_CarrierUpdated.ftl">
},
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.OrderCarrierUpdated>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrPrepa_OrderCarrierUpdated.ftl">
}
</#if>
<#list preparationOrder.preparation_line_lst?filter(l ->l.despatched_ipg_list?? && l.preparation_order_originator_reference!="") as preparation_line>
<#list preparation_line.despatched_ipg_list as despatched_ipg> <#list preparation_line.despatched_ipg_list as despatched_ipg>
<#if despatched_ipg.consignment_unit_id != ""> <#assign HUadded_packing_datetime = RfxDateTimetoUTC(preparation_line.confirmation_datetime,time_zone_offset_rfx) />
<#if despatched_ipg.consignment_unit_id!="">
, ,
{ {
<#assign apiReflexPlatformID = ApiReflexPlatformID.TrackingHULabeled> <#assign apiReflexPlatformID = ApiReflexPlatformID.TrackingHULabeled>
@ -41,13 +59,28 @@
<#include "RFXtoRP_HsrPrepa_TrackingHuLabelled.ftl"> <#include "RFXtoRP_HsrPrepa_TrackingHuLabelled.ftl">
} }
</#if> </#if>
<#if despatched_ipg.carton_number != "000000000000000000" && despatched_ipg.carton_number!=despatched_ipg.hd_number >
,
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.HandlingunitHUsAdded>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrPrepa_HandlingunitHUsAdded.ftl">
},
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.HandlingunitDispatched>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrPrepa_HUsAdded_HandlingUnitDispatched.ftl">
}
</#if>
</#list> </#list>
</#list> </#list>
] ]
<#else> <#else>
<#stop "no confirmed quantity for the preparation - preparation closed"> <#stop "no confirmed quantity for the preparation - preparation closed">
</#if> </#if>
<#break> <#break>
<#case "D"> <#case "D">

View File

@ -0,0 +1,26 @@
<#include "HfRpConfig.ftl">
<#include "ReflexUtils.ftl">
[
<#list preparationOrder.preparation_line_lst?filter(l ->l.preparation_order_originator_reference!="") as preparation_line>
<#assign OrderOriginReference = preparation_line.preparation_order_originator_reference?trim?json_string>
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID":{
"RefID": "${OrderOriginReference}"
},
"Payload":{
"Carrier": {
"ActorID":"${preparationOrder.load_data.carrier_code?trim?json_string}"
}
<#-- Add transport grade code
<#if preparationOrder.transport_grade_code!="">
,
"CarrierService":"${preparationOrder.transport_grade_code?trim?json_string}"
</#if> -->
}
}
<#sep>,</#sep>
</#list>
]

View File

@ -1,89 +0,0 @@
<#include "HfRpConfig.ftl">
[
<#list preparationOrder.preparation_line_lst?filter(l ->l.despatched_ipg_list??) as preparation_line>
<#list preparation_line.despatched_ipg_list as despatched_ipg>
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
<#if despatched_ipg.carton_number != "000000000000000000">
"RefID": "${despatched_ipg.carton_number}"
<#else>
"RefID": "${despatched_ipg.hd_number}"
</#if>
},
"Payload": {
"Information" :{
<#if despatched_ipg.carton_number != "000000000000000000">
"ContainerType": "${despatched_ipg.carton_type_code}"
<#else>
"ContainerType": "${despatched_ipg.hd_type_code}"
</#if>
},
<#-- HU Metadata inclusin inclusion -->
<#include "RFXtoRP_HsrPrepa_GoodsPrepared_HandlingUnitMetadata.ftl">
,
"PreparedContents" :[
{
"Goods": {
"ItemID": "${preparation_line.item_code?trim?json_string}",
"LVBranchID": "${preparation_line.item_lv_code?json_string}",
<#if (despatched_ipg.ipg_manufacture_date?length != 0) && (despatched_ipg.ipg_manufacture_date?starts_with("00") == false)>
<#assign priority_date = despatched_ipg.ipg_manufacture_date?datetime(rfx_date_format_default)?iso_utc />
"PriorityDate": "${priority_date}",
<#else>
<#if (despatched_ipg.ipg_receipt_date?length != 0) && (despatched_ipg.ipg_receipt_date?starts_with("00")== false)>
<#assign priority_date = despatched_ipg.ipg_receipt_date?datetime(rfx_date_format_default)?iso_utc />
"PriorityDate": "${priority_date}",
<#else>
<#if (despatched_ipg.ipg_best_before_date?length != 0) && (despatched_ipg.ipg_best_before_date?starts_with("00")== false)>
<#assign priority_date = despatched_ipg.ipg_best_before_date?datetime(rfx_date_format_default)?iso_utc />
"PriorityDate": "${priority_date}",
<#else>
<#if (despatched_ipg.ipg_sell_by_date?length != 0) && (despatched_ipg.ipg_sell_by_date?starts_with("00")== false)>
<#assign priority_date = despatched_ipg.ipg_sell_by_date?datetime(rfx_date_format_default)?iso_utc />
"PriorityDate": "${priority_date}",
<#else>
<#if (despatched_ipg.ipg_use_by_date?length != 0) && (despatched_ipg.ipg_use_by_date?starts_with("00")== false)>
<#assign priority_date = despatched_ipg.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_line.preparation_order_originator_reference?trim?json_string}",
<#if (preparation_line.pro_originator_reference_line_number!0) != 0>
"LineID": "${preparation_line.pro_originator_reference_line_number}",
<#else>
"LineID": "${preparation_line.pro_line_number!0}",
</#if>
"ActorID": "${preparationOrder.physical_depot_code?trim?json_string}",
"Quantity": {
"LVID": "${quantity_in_base_lv_RP_Cst}",
"Value": ${despatched_ipg.quantity_lvs}
}
}
]
}
}<#sep>,</#sep>
</#list>
<#sep>,</#sep>
</#list>
]

View File

@ -0,0 +1,25 @@
<#include "HfRpConfig.ftl">
<#include "ReflexUtils.ftl">
[
<#assign dispatched3_datetime = RfxDateTimetoUTC(preparationOrder.stock_despatch_at_preparation_datetime,time_zone_offset_rfx) />
<#list preparationOrder.preparation_line_lst?filter(l ->l.despatched_ipg_list??) as preparation_line3>
<#list preparation_line3.despatched_ipg_list?filter(j ->j.carton_number!="000000000000000000") as despatched_ipg3>
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
"RefID": "${despatched_ipg3.carton_number}",
"RefDate": {
"DateTime": "${dispatched3_datetime}",
"AuthorTimeZone": "${time_zone_rfx}"
}
},
"Payload": { }
}<#sep>,</#sep>
</#list>
<#if preparation_line3.despatched_ipg_list?filter(j ->j.carton_number!="000000000000000000")?size!=0 >
<#sep>,</#sep>
</#if>
</#list>
]

View File

@ -2,18 +2,14 @@
<#include "ReflexUtils.ftl"> <#include "ReflexUtils.ftl">
[ [
<#assign dispatched_datetime = RfxDateTimetoUTC(preparationOrder.stock_despatch_at_preparation_datetime,time_zone_offset_rfx) /> <#assign dispatched_datetime = RfxDateTimetoUTC(preparationOrder.stock_despatch_at_preparation_datetime,time_zone_offset_rfx) />
<#list preparationOrder.preparation_line_lst?filter(l ->l.despatched_ipg_list??) as preparation_line> <#list preparationOrder.preparation_line_lst?filter(l ->l.despatched_ipg_list?? && l.preparation_order_originator_reference!="") as preparation_line>
<#list preparation_line.despatched_ipg_list as despatched_ipg> <#list preparation_line.despatched_ipg_list as despatched_ipg>
{ {
"Header": { "Header": {
"ProjectID": "${projectRP}" "ProjectID": "${projectRP}"
}, },
"ID": { "ID": {
<#if despatched_ipg.carton_number != "000000000000000000">
"RefID": "${despatched_ipg.carton_number}",
<#else>
"RefID": "${despatched_ipg.hd_number}", "RefID": "${despatched_ipg.hd_number}",
</#if>
"RefDate": { "RefDate": {
"DateTime": "${dispatched_datetime}", "DateTime": "${dispatched_datetime}",
"AuthorTimeZone": "${time_zone_rfx}" "AuthorTimeZone": "${time_zone_rfx}"

View File

@ -0,0 +1,132 @@
<#include "HfRpConfig.ftl">
[
<#list preparationOrder.preparation_line_lst?filter(l ->l.despatched_ipg_list?? && l.preparation_order_originator_reference!="") as preparation_line2>
<#list preparation_line2.despatched_ipg_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}"
<#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>
]

View File

@ -0,0 +1,40 @@
<#include "HfRpConfig.ftl">
<#include "ReflexUtils.ftl">
[
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
"RefDate": {
"AuthorTimeZone": "${time_zone_rfx}",
"DateTime": "${HUadded_packing_datetime}"
},
"RefID": "${despatched_ipg.hd_number}"
},
"Payload": {
"IncludedHandlingunitIDs": [ "${despatched_ipg.carton_number}" ]
<#if preparation_line.despatched_hds_list?? >
,
"Information": {
"ContainerType": "${preparation_line.despatched_hds_list[0].hd_type_code}",
"Length": {
"Unit": "${length_unit_rfx}",
"Value": ${preparation_line.despatched_hds_list[0].hd_type_depth}
},
"Weight": {
"Unit": "${weight_unit_rfx}",
"Value": ${preparation_line.despatched_hds_list[0].hd_gross_weight}
},
"Width": {
"Unit": "${length_unit_rfx}",
"Value": ${preparation_line.despatched_hds_list[0].hd_type_width}
}
}
</#if>
}
}
]

View File

@ -0,0 +1,21 @@
<#include "HfRpConfig.ftl">
<#include "ReflexUtils.ftl">
[
<#list preparationOrder.preparation_line_lst?filter(l ->l.preparation_order_originator_reference!="") as preparation_line>
<#assign OrderOriginReference = preparation_line.preparation_order_originator_reference?trim?json_string>
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID":{
"RefID": "${OrderOriginReference}"
},
"Payload":{
"Carrier": {
"ActorID":"${preparationOrder.load_data.carrier_code?trim?json_string}"
}
}
}
<#sep>,</#sep>
</#list>
]

View File

@ -15,6 +15,13 @@
<#else> <#else>
"HandlingunitID": "${despatched_ipg.hd_number}" "HandlingunitID": "${despatched_ipg.hd_number}"
</#if> </#if>
<#if preparationOrder.load_data?? && preparationOrder.load_data.carrier_code?? && preparationOrder.load_data.carrier_code!="" >
,
"HUCarrier":{
"ActorID": "${preparationOrder.load_data.carrier_code?json_string}"
}
</#if>
} }
} }
] ]

View File

@ -46,12 +46,18 @@
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign preparation_order = JsonUtil.jsonToMap(dataRfx)> <#assign preparation_order = JsonUtil.jsonToMap(dataRfx)>
[ [
{
<#if preparation_order.originator_reference?? && preparation_order.originator_reference!="">
{ {
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCancelled> <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCancelled>
"apiReflexPlatformID" : "${apiReflexPlatformID}", "apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" : "datas" :
<#include "RFXtoRP_HsrPro_ExecutionflowCancelled.ftl"> <#include "RFXtoRP_HsrPro_ExecutionflowCancelled.ftl">
} }
<#else>
<#stop "PRO reference is empty">
</#if>
}
] ]
<#break> <#break>

View File

@ -45,12 +45,13 @@
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign receipt = JsonUtil.jsonToMap(dataRfx)> <#assign receipt = JsonUtil.jsonToMap(dataRfx)>
[ [
<#if receipt.receipt_reference?? && receipt.receipt_reference!="">
<#if receipt.receipt_confirmed == "true" > <#if receipt.receipt_confirmed == "true" >
{ {
<#assign apiReflexPlatformID = ApiReflexPlatformID.ReceiptCompleted> <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowReceiptCompleted>
"apiReflexPlatformID" : "${apiReflexPlatformID}", "apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" : "datas" :
<#include "RFXtoRP_HsrReceiptList_ReceiptCompleted.ftl"> <#include "RFXtoRP_HsrReceiptList_ExecutionflowReceiptCompleted.ftl">
} }
<#else> <#else>
<#if receipt.receipt_type = "030"> <#if receipt.receipt_type = "030">
@ -67,10 +68,12 @@
"apiReflexPlatformID" : "${apiReflexPlatformID}", "apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" : "datas" :
<#include "RFXtoRP_HsrReceiptList_ReceiptExpected.ftl"> <#include "RFXtoRP_HsrReceiptList_ReceiptExpected.ftl">
} }
</#if> </#if>
</#if> </#if>
<#else>
<#stop "Receipt reference is empty">
</#if>
] ]
<#break> <#break>
@ -79,14 +82,17 @@
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign receipt = JsonUtil.jsonToMap(dataRfx)> <#assign receipt = JsonUtil.jsonToMap(dataRfx)>
[ [
<#if receipt.receipt_reference?? && receipt.receipt_reference!="">
{ {
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCancelled> <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCancelled>
"apiReflexPlatformID" : "${apiReflexPlatformID}", "apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" : "datas" :
<#include "RFXtoRP_HsrReceiptList_ExecutionflowCancelled.ftl"> <#include "RFXtoRP_HsrReceiptList_ExecutionflowCancelled.ftl">
} }
<#else>
<#stop "Receipt reference is empty">
</#if>
] ]
<#break> <#break>

View File

@ -35,7 +35,7 @@
"ContextPayload": "rfxresponse", "ContextPayload": "rfxresponse",
"Type": "RP_EXECUTIONFLOW_EVENT", "Type": "RP_EXECUTIONFLOW_EVENT",
"Task": "${id.apiRestReflexID}", "Task": "${id.apiRestReflexID}",
"OriginalID": "${id.refid}", "OriginalID": "${id.refid?trim?json_string}",
"StackTrace": "" "StackTrace": ""
} }
} }

View File

@ -36,6 +36,12 @@
"apiReflexPlatformID" : "${apiReflexPlatformID}", "apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" : "datas" :
<#include "RFXtoRP_PlatformLogCreate.ftl"> <#include "RFXtoRP_PlatformLogCreate.ftl">
},
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowAllocationError>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_RestResponseAllocationError.ftl">
} }
] ]
</#if> </#if>
@ -52,6 +58,12 @@
"apiReflexPlatformID" : "${apiReflexPlatformID}", "apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" : "datas" :
<#include "RFXtoRP_PlatformLogCreate.ftl"> <#include "RFXtoRP_PlatformLogCreate.ftl">
},
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowAllocationError>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_RestResponseAllocationError.ftl">
} }
] ]
</#switch> </#switch>
@ -81,6 +93,12 @@
"apiReflexPlatformID" : "${apiReflexPlatformID}", "apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" : "datas" :
<#include "RFXtoRP_PlatformLogCreate.ftl"> <#include "RFXtoRP_PlatformLogCreate.ftl">
},
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowAllocationError>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_RestResponseAllocationError.ftl">
} }
] ]
@ -98,6 +116,12 @@
"apiReflexPlatformID" : "${apiReflexPlatformID}", "apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" : "datas" :
<#include "RFXtoRP_PlatformLogCreate.ftl"> <#include "RFXtoRP_PlatformLogCreate.ftl">
},
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowAllocationError>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_RestResponseAllocationError.ftl">
} }
] ]
</#switch> </#switch>

View File

@ -0,0 +1,20 @@
<#include "HfRpConfig.ftl">
<#include "ReflexUtils.ftl">
[
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
"RefID": "${id.refid?trim?json_string}",
"RefDate": {
"DateTime": "${aDateTime?iso_utc}",
"AuthorTimeZone": "${time_zone_rfx}"
}
},
"Payload": {}
}
]

View File

@ -2,6 +2,8 @@
<#-- input : message RFX --> <#-- input : message RFX -->
<#-- project : projectId in ReflexPlatform --> <#-- project : projectId in ReflexPlatform -->
<#-- organisation : organisationtId in ReflexPlatform --> <#-- organisation : organisationtId in ReflexPlatform -->
<#include "HfRpConfig.ftl">
<#include "ReflexUtils.ftl">
<#assign eventRP = JsonUtil.jsonToMap(input)> <#assign eventRP = JsonUtil.jsonToMap(input)>
<#assign projectRP = project> <#assign projectRP = project>

View File

@ -1,8 +1,5 @@
<#include "RPtoRFX_PrepOrder_DefaultHeaderData.ftl"> <#include "RPtoRFX_PrepOrder_DefaultHeaderData.ftl">
<#assign aDateTime = .now>
{ {
"id" : {"refid" : "${executionflow.OrderID}"}, "id" : {"refid" : "${executionflow.OrderID}"},
"route" : "rest/public/v1/activities/{activity_code}/physical_depots/{physical_depot_code}/originators/{originator_code}/preparation_orders", "route" : "rest/public/v1/activities/{activity_code}/physical_depots/{physical_depot_code}/originators/{originator_code}/preparation_orders",
@ -18,9 +15,9 @@
"preparation_type_code": "${preparation_type_code}", "preparation_type_code": "${preparation_type_code}",
"end_consignee_code": "${executionflow.ShipTo.ActorID!""}", "end_consignee_code": "${executionflow.ShipTo.ActorID!""}",
<#if executionflow.RequestedMilestones?? && executionflow.RequestedMilestones.RequestedDeliveryDateTime??> <#if executionflow.RequestedMilestones?? && executionflow.RequestedMilestones.RequestedDeliveryDateTime??>
"requested_delivery_start_datetime": "${executionflow.RequestedMilestones.RequestedDeliveryDateTime.DateTime}", "requested_delivery_start_datetime": "${DateTimeUTCtoRfxLocale(executionflow.RequestedMilestones.RequestedDeliveryDateTime.DateTime,time_zone_rfx)}",
<#else> <#else>
"requested_delivery_start_datetime": "${aDateTime?iso_utc}", "requested_delivery_start_datetime": "${DateTimeUTCtoRfxLocale(.now?iso_utc?string,time_zone_rfx)}",
</#if> </#if>
"requested_delivery_date_type": "${requested_delivery_date_type}", "requested_delivery_date_type": "${requested_delivery_date_type}",
"consolidated_delivery": "${consolidated_delivery_flag}", "consolidated_delivery": "${consolidated_delivery_flag}",

View File

@ -1,5 +1,5 @@
<#include "RPtoRFX_Receipt_DefaultHeaderData.ftl"> <#include "RPtoRFX_Receipt_DefaultHeaderData.ftl">
<#assign aDateTime = .now>
{ {
"id" : {"refid" : "${executionflow.OrderID}"}, "id" : {"refid" : "${executionflow.OrderID}"},
"route" : "rest/public/v1/activities/{activity_code}/physical_depots/{physical_depot_code}/originators/{originator_code}/receipts", "route" : "rest/public/v1/activities/{activity_code}/physical_depots/{physical_depot_code}/originators/{originator_code}/receipts",
@ -19,9 +19,9 @@
"carrier_code" : "${executionflow.Carrier.ActorID!""}", "carrier_code" : "${executionflow.Carrier.ActorID!""}",
<#if executionflow.RequestedMilestones?? && executionflow.RequestedMilestones.RequestedDeliveryDateTime??> <#if executionflow.RequestedMilestones?? && executionflow.RequestedMilestones.RequestedDeliveryDateTime??>
"receipt_datetime": "${executionflow.RequestedMilestones.RequestedDeliveryDateTime.DateTime}", "receipt_datetime": "${DateTimeUTCtoRfxLocale(executionflow.RequestedMilestones.RequestedDeliveryDateTime.DateTime,time_zone_rfx)}",
<#else> <#else>
"receipt_datetime": "${aDateTime?iso_utc}", "receipt_datetime": "${DateTimeUTCtoRfxLocale(.now?iso_utc?string,time_zone_rfx)}",
</#if> </#if>
"carrier_appointment_made": "false", "carrier_appointment_made": "false",
"receipt_in_cross_docking": "false", "receipt_in_cross_docking": "false",

View File

@ -2,8 +2,11 @@
<#-- Concat reflex timestamp with reflex time zone and format this date in ISO UTC format --> <#-- Concat reflex timestamp with reflex time zone and format this date in ISO UTC format -->
<#-- --------------------------------------------------------------------------------------- --> <#-- --------------------------------------------------------------------------------------- -->
<#function RfxDateTimetoUTC rfxdatetime offset > <#function RfxDateTimetoUTC rfxdatetime offset >
<#assign datetimeUTC = JsonUtil.createUTCDateTime(rfxdatetime,time_zone_rfx , "yyyy-MM-dd'T'HH:mm:ss") /> <#return ((rfxdatetime + offset)?datetime.iso?iso_utc)>
<#return (datetimeUTC)> </#function>
<#function DateTimeUTCtoRfxLocale dateutc locale >
<#return dateutc?datetime.iso?iso_nz(locale)>
</#function> </#function>
<#-- --------------------------------------------------------------------------------------- --> <#-- --------------------------------------------------------------------------------------- -->
@ -13,7 +16,7 @@
<#-- --------------------------------------------------------------------------------------- --> <#-- --------------------------------------------------------------------------------------- -->
<#function splitEmailsIntoArray emails > <#function splitEmailsIntoArray emails >
<#local str = "["> <#local str = "[">
<#list emails?split(";|,| |à|/","r")?filter(l -> l != "") as email> <#list emails?split(";|,| |à|/","r")?filter(l -> l != "") as email>
<#if email?matches("^[\\w-\\.]+@([\\w-]+\\.)+[\\w-]{2,4}$")> <#if email?matches("^[\\w-\\.]+@([\\w-]+\\.)+[\\w-]{2,4}$")>
<#if str != "["> <#if str != "[">
<#local str += ","> <#local str += ",">

View File

@ -1 +1 @@
1.2.12+3 1.2.15+4