From 4802c74fb81e99df0b9a77529b346e831274b3ac Mon Sep 17 00:00:00 2001 From: Laurie Montant Date: Thu, 14 Mar 2024 11:51:49 +0100 Subject: [PATCH] modifs ref vide --- RFXtoRP_HsaProStatus.ftl | 68 ++++++++++----------- RFXtoRP_HsrPrepa.ftl | 127 +++++++++++++++++++-------------------- 2 files changed, 97 insertions(+), 98 deletions(-) diff --git a/RFXtoRP_HsaProStatus.ftl b/RFXtoRP_HsaProStatus.ftl index 044f6db..99a4993 100644 --- a/RFXtoRP_HsaProStatus.ftl +++ b/RFXtoRP_HsaProStatus.ftl @@ -18,55 +18,55 @@ [ <#--**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" > - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowPreparationExpected> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsaProStatus_PreparationExpected.ftl"> - } - <#else> - <#-- ** Collection started (300) and Preparation in progress (400)** --> - <#if preparationStatusInterface.preparation_status_type == "100" && (preparationStatusInterface.preparation_status_code == "300" || preparationStatusInterface.preparation_status_code == "400") > + <#if preparationStatusInterface.preparation_status_type == "100" && preparationStatusInterface.preparation_status_code == "200" > { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowPreparationStarted> + <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowPreparationExpected> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : - <#include "RFXtoRP_HsaProStatus_PreparationStarted.ftl"> + <#include "RFXtoRP_HsaProStatus_PreparationExpected.ftl"> } <#else> - <#-- ****Preparation dispatched (600)** --> - <#if preparationStatusInterface.preparation_status_type == "100" && preparationStatusInterface.preparation_status_code == "600" > - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowPreparationCompleted> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsaProStatus_PreparationCompleted.ftl"> - }, - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowTransportStarted> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsaProStatus_TransportStarted.ftl"> - } + <#-- ** Collection started (300) and Preparation in progress (400)** --> + <#if preparationStatusInterface.preparation_status_type == "100" && (preparationStatusInterface.preparation_status_code == "300" || preparationStatusInterface.preparation_status_code == "400") > + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowPreparationStarted> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaProStatus_PreparationStarted.ftl"> + } <#else> - <#-- ****Preparation cancelled (650)**** --> - <#if preparationStatusInterface.preparation_status_type == "100" && preparationStatusInterface.preparation_status_code == "650" > + <#-- ****Preparation dispatched (600)** --> + <#if preparationStatusInterface.preparation_status_type == "100" && preparationStatusInterface.preparation_status_code == "600" > { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCancelled> + <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowPreparationCompleted> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : - <#include "RFXtoRP_HsaProStatus_ExecutionflowCancelled.ftl"> + <#include "RFXtoRP_HsaProStatus_PreparationCompleted.ftl"> + }, + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowTransportStarted> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaProStatus_TransportStarted.ftl"> } <#else> - <#stop> + <#-- ****Preparation cancelled (650)**** --> + <#if preparationStatusInterface.preparation_status_type == "100" && preparationStatusInterface.preparation_status_code == "650" > + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCancelled> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaProStatus_ExecutionflowCancelled.ftl"> + } + <#else> + <#stop> + + <#else> + <#stop "PRO reference is empty"> - <#else> - <#stop "PRO reference is empty"> - ] <#break> diff --git a/RFXtoRP_HsrPrepa.ftl b/RFXtoRP_HsrPrepa.ftl index 712cfec..bcd6a62 100644 --- a/RFXtoRP_HsrPrepa.ftl +++ b/RFXtoRP_HsrPrepa.ftl @@ -15,74 +15,73 @@ <#-- *********************************************** Action = CREATE or UPDATE ******************** --> <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> <#assign preparationOrder = JsonUtil.jsonToMap(dataRfx)> +<#if preparation_line.preparation_order_originator_reference?? && preparation_line.preparation_order_originator_reference??!=""> + <#if preparationOrder.total_lv_validated !=0> + [ + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.HandlingunitGoodsPrepared> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrPrepa_HandlingunitGoodsPrepared.ftl"> + }, + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.HandlingunitDispatched> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrPrepa_HandlingUnitDispatched.ftl"> + } -<#if preparationOrder.total_lv_validated !=0> - [ - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.HandlingunitGoodsPrepared> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsrPrepa_HandlingunitGoodsPrepared.ftl"> - }, - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.HandlingunitDispatched> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsrPrepa_HandlingUnitDispatched.ftl"> - } - - <#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"> - } - - - <#list preparationOrder.preparation_line_lst?filter(l ->l.despatched_ipg_list??) as preparation_line> - <#list preparation_line.despatched_ipg_list as despatched_ipg> - <#if despatched_ipg.consignment_unit_id!=""> - , - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.TrackingHULabeled> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsrPrepa_TrackingHuLabelled.ftl"> - } - - <#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 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"> + } + + <#list preparationOrder.preparation_line_lst?filter(l ->l.despatched_ipg_list??) as preparation_line> + <#list preparation_line.despatched_ipg_list as despatched_ipg> + <#if despatched_ipg.consignment_unit_id!=""> + , + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.TrackingHULabeled> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrPrepa_TrackingHuLabelled.ftl"> + } + + <#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"> + } + + + <#-- <#sep>, --> - <#-- <#sep>, --> - - - - ] - + ] + <#else> + <#stop "no confirmed quantity for the preparation - preparation closed"> + <#else> - <#stop "no confirmed quantity for the preparation - preparation closed"> + <#stop "PRO reference is empty"> <#break>