From cd858cab4fde50efb1f69a627cafbb3a3a2dacd4 Mon Sep 17 00:00:00 2001 From: Laure Pascal Date: Thu, 7 Sep 2023 16:23:29 +0200 Subject: [PATCH] changement de statut uniquement sur HsrProStatus --- RFXtoRP_HsaProStatus.ftl | 2 +- RFXtoRP_HsrPrepa.ftl | 8 +------- RFXtoRP_HsrPrepa_TransportStarted.ftl | 24 ------------------------ RFXtoRP_HsrPro.ftl | 17 +++++------------ RFXtoRP_HsrPro_PreparationCompleted.ftl | 20 -------------------- RFXtoRP_HsrReceiptList.ftl | 6 +++++- 6 files changed, 12 insertions(+), 65 deletions(-) delete mode 100644 RFXtoRP_HsrPrepa_TransportStarted.ftl delete mode 100644 RFXtoRP_HsrPro_PreparationCompleted.ftl diff --git a/RFXtoRP_HsaProStatus.ftl b/RFXtoRP_HsaProStatus.ftl index 4d85b39..974cfe3 100644 --- a/RFXtoRP_HsaProStatus.ftl +++ b/RFXtoRP_HsaProStatus.ftl @@ -39,7 +39,7 @@ <#include "RFXtoRP_HsaProStatus_PreparationStarted.ftl"> } <#else> - <#-- **Preparation to package (500) and preparationcompleted (550)** --> + <#-- **Preparation to package (500) and preparation completed (550)** --> <#if preparationStatusInterface.preparation_status_type == "100" && (preparationStatusInterface.preparation_status_code == "500" || preparationStatusInterface.preparation_status_code == "550")> diff --git a/RFXtoRP_HsrPrepa.ftl b/RFXtoRP_HsrPrepa.ftl index cb84d59..9ed9935 100644 --- a/RFXtoRP_HsrPrepa.ftl +++ b/RFXtoRP_HsrPrepa.ftl @@ -27,13 +27,7 @@ "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : <#include "RFXtoRP_HsrPrepa_HandlingUnitDispatched.ftl"> - }, - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowTransportStarted> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsrPrepa_TransportStarted.ftl"> - } + } ] <#break> diff --git a/RFXtoRP_HsrPrepa_TransportStarted.ftl b/RFXtoRP_HsrPrepa_TransportStarted.ftl deleted file mode 100644 index 6075737..0000000 --- a/RFXtoRP_HsrPrepa_TransportStarted.ftl +++ /dev/null @@ -1,24 +0,0 @@ -<#include "HfRpConfig.ftl"> -<#include "ReflexUtils.ftl"> -<#assign preparation_status_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> - { - "Header": { - "ProjectID": "${projectRP}" - }, - "ID": { - "RefID": "${preparation_line.preparation_order_originator_reference}", - "RefDate": { - "DateTime": "${preparation_status_datetime}", - "AuthorTimeZone": "${time_zone_rfx}" - } - }, - - "Payload": {} - - } - <#sep>, - -] - diff --git a/RFXtoRP_HsrPro.ftl b/RFXtoRP_HsrPro.ftl index b8b998a..b073207 100644 --- a/RFXtoRP_HsrPro.ftl +++ b/RFXtoRP_HsrPro.ftl @@ -19,26 +19,19 @@ { <#-- check preparation type code (internal order and reservation are ignored) --> <#if order.preparation_type_code == "010" || - order.preparation_type_code == "030"> + order.preparation_type_code == "030"> - <#-- Preparation order not confirmed --> + <#-- Only if preparation order not confirmed --> <#if order.preparation_order_confirmed == "false" > <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : - <#include "RFXtoRP_HsrPro_ExecutionflowDetected.ftl"> - - <#-- Preparation order confirmed --> - <#else> - <#assign apiReflexPlatformID = ApiReflexPlatformID.PreparationCompleted> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsrPro_PreparationCompleted.ftl"> + <#include "RFXtoRP_HsrPro_ExecutionflowDetected.ftl"> + <#else> <#stop "preparation type not supported"> - - + } ] diff --git a/RFXtoRP_HsrPro_PreparationCompleted.ftl b/RFXtoRP_HsrPro_PreparationCompleted.ftl deleted file mode 100644 index 4cfb270..0000000 --- a/RFXtoRP_HsrPro_PreparationCompleted.ftl +++ /dev/null @@ -1,20 +0,0 @@ -<#include "HfRpConfig.ftl"> -<#include "ReflexUtils.ftl"> -<#assign preparation_status_datetime = RfxDateTimetoUTC(order.confirmation_datetime,time_zone_offset_rfx) /> -[ - { - "Header": { - "ProjectID": "${projectRP}" - }, - "ID": { - "RefID": "${order.originator_reference}", - "RefDate": { - "DateTime": "${preparation_status_datetime}", - "AuthorTimeZone": "${time_zone_rfx}" - } - }, - - "Payload": {} - - } -] diff --git a/RFXtoRP_HsrReceiptList.ftl b/RFXtoRP_HsrReceiptList.ftl index 4ff1cb1..4932a33 100644 --- a/RFXtoRP_HsrReceiptList.ftl +++ b/RFXtoRP_HsrReceiptList.ftl @@ -49,7 +49,10 @@ "datas" : <#include "RFXtoRP_HsrReceiptList_ReceiptCompleted.ftl"> } - <#else> + <#else> + <#if receipt.receipt_type = "030"> + <#stop "ignored message because receipt type = transfert"> + <#else> { <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected> "apiReflexPlatformID" : "${apiReflexPlatformID}", @@ -64,6 +67,7 @@ } + ] <#break>