From d895bac1372655aa83bfa32cc08642f9ff60f60d Mon Sep 17 00:00:00 2001 From: Francis Reat Date: Fri, 7 Nov 2025 10:07:21 +0100 Subject: [PATCH] version 1 des FTL des RDZ --- ...oRP_HsaCarrierAptStatus_CarrierArrived.ftl | 18 +++ ...RP_HsaCarrierAptStatus_CarrierDeparted.ftl | 18 +++ ...RP_HsaCarrierAptStatus_CarrierExpected.ftl | 18 +++ ...P_HsaCarrierAptStatus_ReceptionStarted.ftl | 18 +++ ..._HsaCarrierAptStatus_ReceptionUnloaded.ftl | 18 +++ ...saDispute_TableReasonCodeToClaimTypeID.ftl | 12 +- RFXtoRP_HsaLstCarSta.ftl | 108 +++++++++++------- RFXtoRP_HsrCarrierApt.ftl | 106 ++++++++++------- ...rCarrierApt_AppointmentCarrierExpected.ftl | 18 +++ ...P_HsrCarrierApt_ForceUpdateAppointment.ftl | 77 +++++++++++++ ...RP_HsrCarrierApt_SiteCancelAppointment.ftl | 13 +++ ...HsrCarrierApt_SiteForceBookAppointment.ftl | 62 ++++++++++ ...rCarrierApt_SiteForceUpdateAppointment.ftl | 75 ++++++++++++ RPtoRFX_PrepOrder_DefaultHeaderData.ftl | 23 +++- 14 files changed, 497 insertions(+), 87 deletions(-) create mode 100644 RFXtoRP_HsaCarrierAptStatus_CarrierArrived.ftl create mode 100644 RFXtoRP_HsaCarrierAptStatus_CarrierDeparted.ftl create mode 100644 RFXtoRP_HsaCarrierAptStatus_CarrierExpected.ftl create mode 100644 RFXtoRP_HsaCarrierAptStatus_ReceptionStarted.ftl create mode 100644 RFXtoRP_HsaCarrierAptStatus_ReceptionUnloaded.ftl create mode 100644 RFXtoRP_HsrCarrierApt_AppointmentCarrierExpected.ftl create mode 100644 RFXtoRP_HsrCarrierApt_ForceUpdateAppointment.ftl create mode 100644 RFXtoRP_HsrCarrierApt_SiteCancelAppointment.ftl create mode 100644 RFXtoRP_HsrCarrierApt_SiteForceBookAppointment.ftl create mode 100644 RFXtoRP_HsrCarrierApt_SiteForceUpdateAppointment.ftl diff --git a/RFXtoRP_HsaCarrierAptStatus_CarrierArrived.ftl b/RFXtoRP_HsaCarrierAptStatus_CarrierArrived.ftl new file mode 100644 index 0000000..60ed608 --- /dev/null +++ b/RFXtoRP_HsaCarrierAptStatus_CarrierArrived.ftl @@ -0,0 +1,18 @@ +<#include "HfRpConfig.ftl"> +<#include "ReflexUtils.ftl"> +[ + <#assign ref_datetime = RfxDateTimetoUTCWithTimezone(carrier_apt_status.status.creation_datetime,time_zone_rfx) /> + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${carrier_apt_status.appointment_reference?trim?json_string}", + "RefDate": { + "DateTime": "${ref_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + } + }, + "Payload":{} + } +] \ No newline at end of file diff --git a/RFXtoRP_HsaCarrierAptStatus_CarrierDeparted.ftl b/RFXtoRP_HsaCarrierAptStatus_CarrierDeparted.ftl new file mode 100644 index 0000000..60ed608 --- /dev/null +++ b/RFXtoRP_HsaCarrierAptStatus_CarrierDeparted.ftl @@ -0,0 +1,18 @@ +<#include "HfRpConfig.ftl"> +<#include "ReflexUtils.ftl"> +[ + <#assign ref_datetime = RfxDateTimetoUTCWithTimezone(carrier_apt_status.status.creation_datetime,time_zone_rfx) /> + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${carrier_apt_status.appointment_reference?trim?json_string}", + "RefDate": { + "DateTime": "${ref_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + } + }, + "Payload":{} + } +] \ No newline at end of file diff --git a/RFXtoRP_HsaCarrierAptStatus_CarrierExpected.ftl b/RFXtoRP_HsaCarrierAptStatus_CarrierExpected.ftl new file mode 100644 index 0000000..60ed608 --- /dev/null +++ b/RFXtoRP_HsaCarrierAptStatus_CarrierExpected.ftl @@ -0,0 +1,18 @@ +<#include "HfRpConfig.ftl"> +<#include "ReflexUtils.ftl"> +[ + <#assign ref_datetime = RfxDateTimetoUTCWithTimezone(carrier_apt_status.status.creation_datetime,time_zone_rfx) /> + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${carrier_apt_status.appointment_reference?trim?json_string}", + "RefDate": { + "DateTime": "${ref_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + } + }, + "Payload":{} + } +] \ No newline at end of file diff --git a/RFXtoRP_HsaCarrierAptStatus_ReceptionStarted.ftl b/RFXtoRP_HsaCarrierAptStatus_ReceptionStarted.ftl new file mode 100644 index 0000000..60ed608 --- /dev/null +++ b/RFXtoRP_HsaCarrierAptStatus_ReceptionStarted.ftl @@ -0,0 +1,18 @@ +<#include "HfRpConfig.ftl"> +<#include "ReflexUtils.ftl"> +[ + <#assign ref_datetime = RfxDateTimetoUTCWithTimezone(carrier_apt_status.status.creation_datetime,time_zone_rfx) /> + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${carrier_apt_status.appointment_reference?trim?json_string}", + "RefDate": { + "DateTime": "${ref_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + } + }, + "Payload":{} + } +] \ No newline at end of file diff --git a/RFXtoRP_HsaCarrierAptStatus_ReceptionUnloaded.ftl b/RFXtoRP_HsaCarrierAptStatus_ReceptionUnloaded.ftl new file mode 100644 index 0000000..60ed608 --- /dev/null +++ b/RFXtoRP_HsaCarrierAptStatus_ReceptionUnloaded.ftl @@ -0,0 +1,18 @@ +<#include "HfRpConfig.ftl"> +<#include "ReflexUtils.ftl"> +[ + <#assign ref_datetime = RfxDateTimetoUTCWithTimezone(carrier_apt_status.status.creation_datetime,time_zone_rfx) /> + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${carrier_apt_status.appointment_reference?trim?json_string}", + "RefDate": { + "DateTime": "${ref_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + } + }, + "Payload":{} + } +] \ No newline at end of file diff --git a/RFXtoRP_HsaDispute_TableReasonCodeToClaimTypeID.ftl b/RFXtoRP_HsaDispute_TableReasonCodeToClaimTypeID.ftl index 9b2f13a..e2f37da 100644 --- a/RFXtoRP_HsaDispute_TableReasonCodeToClaimTypeID.ftl +++ b/RFXtoRP_HsaDispute_TableReasonCodeToClaimTypeID.ftl @@ -1,7 +1,15 @@ + <#-- Specify table for reason code --> -<#assign TableReasonCode = {}/> - +<#-- Table example for reason code to claim type ID --> +<#-- <#assign TableReasonCode = { --> +<#-- "001":"ID_CLAIMTYPE_1",--> +<#-- "M1":"ID_CLAIMTYPE_2",--> +<#-- }/>--> + <#assign TableReasonCode = { +"M1" :"CAS" +} +/> \ No newline at end of file diff --git a/RFXtoRP_HsaLstCarSta.ftl b/RFXtoRP_HsaLstCarSta.ftl index a74a148..e561d3d 100644 --- a/RFXtoRP_HsaLstCarSta.ftl +++ b/RFXtoRP_HsaLstCarSta.ftl @@ -1,40 +1,68 @@ -<#-- **** input parameters ***** --> -<#-- input : message HARDIS WMS --> -<#-- project : projectId in HARDIS SC NETWORK --> -<#-- organisation : organisationtId in HARDIS SC NETWORK --> - -<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> -<#assign projectRP = project> -<#assign organisationRP = organisation> - -<#assign aDateTime = .now> - -<#stop> - -<#switch cloudEventMsg.action> - <#case "C"> - <#case "U"> - <#-- *********************************************** Action = CREATE or UPDATE ******************** --> - <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> - <#assign depot = JsonUtil.jsonToMap(dataRfx)> - [ - { - - } - ] - <#break> - - <#case "D"> - <#-- *********************************************** Action = DELETE *************************** --> - <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> - <#assign depot = JsonUtil.jsonToMap(dataRfx)> - [ - { - - } - ] - <#break> - - <#default> - <#stop > - \ No newline at end of file +<#-- **** input parameters ***** --> +<#-- input : message RFX --> +<#-- project : projectId in ReflexPlatform --> +<#-- organisation : organisationtId in ReflexPlatform --> +<#-- site : siteID in ReflexPlatform --> + +<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> +<#assign projectRP = project> + +<#assign organisationRP = organisation> + +<#assign aDateTime = .now> + +<#switch cloudEventMsg.action> + <#case "C"> + <#case "U"> + <#-- *********************************************** Action = Update ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign carrier_apt_status = JsonUtil.jsonToMap(dataRfx)> + [ + { + + + <#switch carrier_apt_status.status.carrier_status_code> + <#case "010"> <#-- Transporteur attendu --> + <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentCarrierExpected> <#-- à revoir --> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaCarrierAptStatus_CarrierExpected.ftl"> + <#break> + <#case "020"> <#-- Transporteur arrivé sur site--> + <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentCarrierArrived> <#-- à revoir --> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaCarrierAptStatus_CarrierArrived.ftl"> + <#break> + <#case "040"> <#-- Déchargement commencé --> + <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentReceptionStarted> <#-- à revoir --> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaCarrierAptStatus_ReceptionStarted.ftl"> + <#break> + <#case "050"> <#-- Déchargement terminé--> + <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentReceptionStarted> <#-- à revoir --> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaCarrierAptStatus_ReceptionStarted.ftl"> + <#break> + + <#default> + <#stop 'this updated appointment Status not implemented'> + + + + } + ] + <#break> + +<#case "D"> + <#-- *********************************************** Action = Delete ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign carrier_apt_status = JsonUtil.jsonToMap(dataRfx)> + <#stop 'Delete Appointment Status not implemented' > + <#break> + <#default> + <#stop > + + diff --git a/RFXtoRP_HsrCarrierApt.ftl b/RFXtoRP_HsrCarrierApt.ftl index a74a148..b8a39b8 100644 --- a/RFXtoRP_HsrCarrierApt.ftl +++ b/RFXtoRP_HsrCarrierApt.ftl @@ -1,40 +1,66 @@ -<#-- **** input parameters ***** --> -<#-- input : message HARDIS WMS --> -<#-- project : projectId in HARDIS SC NETWORK --> -<#-- organisation : organisationtId in HARDIS SC NETWORK --> - -<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> -<#assign projectRP = project> -<#assign organisationRP = organisation> - -<#assign aDateTime = .now> - -<#stop> - -<#switch cloudEventMsg.action> - <#case "C"> - <#case "U"> - <#-- *********************************************** Action = CREATE or UPDATE ******************** --> - <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> - <#assign depot = JsonUtil.jsonToMap(dataRfx)> - [ - { - - } - ] - <#break> - - <#case "D"> - <#-- *********************************************** Action = DELETE *************************** --> - <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> - <#assign depot = JsonUtil.jsonToMap(dataRfx)> - [ - { - - } - ] - <#break> - - <#default> - <#stop > - \ No newline at end of file +<#-- **** input parameters ***** --> +<#-- input : message RFX --> +<#-- project : projectId in ReflexPlatform --> +<#-- organisation : organisationtId in ReflexPlatform --> +<#-- site : siteID in ReflexPlatform --> + +<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> +<#assign projectRP = project> +<#assign organisationRP = organisation> + +<#assign aDateTime = .now> + +<#switch cloudEventMsg.action> + <#case "C"> + <#-- *********************************************** Action = CREATE or UPDATE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign carrier_apt = JsonUtil.jsonToMap(dataRfx)> + [ + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.SiteForceBookAppointment> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrCarrierApt_SiteForceBookAppointment.ftl"> + }, + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentCarrierExpected> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrCarrierApt_AppointmentCarrierExpected.ftl"> + } + ] + <#break> + + <#case "U"> + <#-- *********************************************** Action = Update ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign carrier_apt = JsonUtil.jsonToMap(dataRfx)> + [ + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.SiteForceUpdateAppointment> <#-- à revoir --> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrCarrierApt_SiteForceUpdateAppointment.ftl"> + } + ] + <#break> + +<#case "D"> + <#-- *********************************************** Action = Delete ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign carrier_apt = JsonUtil.jsonToMap(dataRfx)> + [ + <#-- Ajout des lignes--> + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.SiteCancelAppointment> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrCarrierApt_SiteCancelAppointment.ftl"> + } + + ] + <#break> + <#default> + <#stop > + + diff --git a/RFXtoRP_HsrCarrierApt_AppointmentCarrierExpected.ftl b/RFXtoRP_HsrCarrierApt_AppointmentCarrierExpected.ftl new file mode 100644 index 0000000..a3c6dae --- /dev/null +++ b/RFXtoRP_HsrCarrierApt_AppointmentCarrierExpected.ftl @@ -0,0 +1,18 @@ +<#include "HfRpConfig.ftl"> +<#include "ReflexUtils.ftl"> +[ + <#assign ref_datetime = RfxDateTimetoUTCWithTimezone(carrier_apt.metadata.creation_datetime,time_zone_rfx) /> + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID": "${carrier_apt.appointment_reference?trim?json_string}", + "RefDate": { + "DateTime": "${ref_datetime}", + "AuthorTimeZone": "${time_zone_rfx}" + } + }, + "Payload":{} + } +] \ No newline at end of file diff --git a/RFXtoRP_HsrCarrierApt_ForceUpdateAppointment.ftl b/RFXtoRP_HsrCarrierApt_ForceUpdateAppointment.ftl new file mode 100644 index 0000000..d951834 --- /dev/null +++ b/RFXtoRP_HsrCarrierApt_ForceUpdateAppointment.ftl @@ -0,0 +1,77 @@ +<#include "HfRpConfig.ftl"> +<#include "ReflexUtils.ftl"> + + +<#-- à quoi correspond ID du transporteur dans l'API a voir avec Vincent--> + + +[ + { + <#assign appointment_reception_start_datetime = RfxDateTimetoUTCWithTimezone(carrier_apt.planned_unloading_start_datetime,time_zone_rfx) /> + <#assign appointment_expedition_start_datetime = RfxDateTimetoUTCWithTimezone(carrier_apt.planned_load_start_datetime,time_zone_rfx) /> + <#assign creation_datetime = RfxDateTimetoUTCWithTimezone(carrier_apt.metadata.creation_datetime,time_zone_rfx) /> + + "Header":{ + "ProjectID": "${projectRP}" + }, + "ActorID": "${carrier_apt.physical_depot}", + <#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "false"> + <#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_RECEPTION> + <#assign duration = RfxDurationBetweenTwoDateTimetoInSeconds(carrier_apt.planned_unloading_start_datetime,carrier_apt.planned_unloading_end_datetime,time_zone_rfx) /> + <#else> + <#if carrier_apt.unloading_appointment == "false" && carrier_apt.load_appointment == "true" > + <#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_EXPEDITION> + <#assign duration = RfxDurationBetweenTwoDateTimetoInSeconds(carrier_apt.planned_load_start_datetime,carrier_apt.planned_load_end_datetime,time_zone_rfx) /> + <#else> + <#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "true"> + <#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_BOTH> + <#assign duration = 0 /> <#-- à confirmer --> + <#else> + <#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_UNKNOWN> + <#assign duration = 0 /> <#-- à confirmer --> + + + + "ProjectID": "${projectRP}", + "TimeZone": "${time_zone_rfx}", + "AppointmentID": "${carrier_apt.appointment_reference}", + <#if carrier_apt.physical_receipt_list?? && (carrier_apt.physical_receipt_list?size == lv.physical_receipt_list?filter(l ->l??)?size)> + "Commissions": [ + <#list carrier_apt.physical_receipt_list as physical_receipt> + { + "ActorID": "${carrier_apt.physical_depot}", + "OrderID": "${physical_receipt.physical_receipt_reference?json_string}", + "ProjectID": "${projectRP}", + "Quantities": [ + { + "UnitID": "PAL", <#-- à changer --> + "Value": 1 <#-- à changer --> + } + ] + }<#sep>, + + ], + + + "Slots": [{ + <#-- calcul de de la durée en fonction des start et end time--> + "DurationInSeconds": "${duration}", + <#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "false"> + "StartDateTime": "${carrier_apt.planned_unloading_start_datetime}" + <#else> + <#if carrier_apt.unloading_appointment == "false" && carrier_apt.load_appointment == "true"> + "StartDateTime": "${carrier_apt.planned_load_start_datetime}" + <#else> + <#assign duration = RfxDurationBetweenTwoDateTimetoInSeconds(carrier_apt.planned_unloading_start_datetime,carrier_apt.planned_load_start_datetime,time_zone_rfx) /> + <#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "true"> + <#if duration >= 0> + "StartDateTime": "${carrier_apt.planned_unloading_start_datetime}" + <#else> + "StartDateTime": "${carrier_apt.planned_load_start_datetime}" + + + + + }] + } +] \ No newline at end of file diff --git a/RFXtoRP_HsrCarrierApt_SiteCancelAppointment.ftl b/RFXtoRP_HsrCarrierApt_SiteCancelAppointment.ftl new file mode 100644 index 0000000..cb8256b --- /dev/null +++ b/RFXtoRP_HsrCarrierApt_SiteCancelAppointment.ftl @@ -0,0 +1,13 @@ +<#include "HfRpConfig.ftl"> +<#include "ReflexUtils.ftl"> + +<#assign ref_datetime = RfxDateTimetoUTCWithTimezone(carrier_apt.metadata.last_update_datetime,time_zone_rfx) /> + +[ + { + "AppointmentID": "${carrier_apt.appointment_reference?trim?json_string}", + "Header": { + "ProjectID": "${projectRP}" + } + } +] \ No newline at end of file diff --git a/RFXtoRP_HsrCarrierApt_SiteForceBookAppointment.ftl b/RFXtoRP_HsrCarrierApt_SiteForceBookAppointment.ftl new file mode 100644 index 0000000..1a08474 --- /dev/null +++ b/RFXtoRP_HsrCarrierApt_SiteForceBookAppointment.ftl @@ -0,0 +1,62 @@ +<#include "HfRpConfig.ftl"> +<#include "ReflexUtils.ftl"> + + +<#-- à quoi correspond ID du transporteur dans l'API a voir avec Vincent--> + + +[ + { + <#assign appointment_reception_start_datetime = RfxDateTimetoUTCWithTimezone(carrier_apt.planned_unloading_start_datetime,time_zone_rfx) /> + <#assign appointment_expedition_start_datetime = RfxDateTimetoUTCWithTimezone(carrier_apt.planned_load_start_datetime,time_zone_rfx) /> + <#assign creation_datetime = RfxDateTimetoUTCWithTimezone(carrier_apt.metadata.creation_datetime,time_zone_rfx) /> + + "Header":{ + "ProjectID": "${projectRP}" + }, + "ActorID": "${carrier_apt.physical_depot}", + <#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "false"> + <#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_RECEPTION> + <#assign duration = RfxDurationBetweenTwoDateTimetoInSeconds(carrier_apt.planned_unloading_start_datetime,carrier_apt.planned_unloading_end_datetime,time_zone_rfx) /> + <#else> + <#if carrier_apt.unloading_appointment == "false" && carrier_apt.load_appointment == "true" > + <#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_EXPEDITION> + <#assign duration = RfxDurationBetweenTwoDateTimetoInSeconds(carrier_apt.planned_load_start_datetime,carrier_apt.planned_load_end_datetime,time_zone_rfx) /> + <#else> + <#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "true"> + <#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_BOTH> + <#assign duration = 0 /> <#-- à confirmer --> + <#else> + <#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_UNKNOWN> + <#assign duration = 0 /> <#-- à confirmer --> + + + + "ProjectID": "${projectRP}", + "Emails": ["francis.reat@hardis-group.com"], <#-- à confirmer --> + "Reason": "no commission", <#-- à confirmer --> + "CarrierName": "${carrier_apt.planned_carrier}", + "AppointmentType": "${appointmentType}", + "AppointmentID": "${carrier_apt.appointment_reference}", + "Slots": [{ + <#-- calcul de de la durée en fonction des start et end time--> + "DurationInSeconds": "${duration}", + <#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "false"> + "StartDateTime": "${carrier_apt.planned_unloading_start_datetime}" + <#else> + <#if carrier_apt.unloading_appointment == "false" && carrier_apt.load_appointment == "true"> + "StartDateTime": "${carrier_apt.planned_load_start_datetime}" + <#else> + <#assign duration = RfxDurationBetweenTwoDateTimetoInSeconds(carrier_apt.planned_unloading_start_datetime,carrier_apt.planned_load_start_datetime,time_zone_rfx) /> + <#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "true"> + <#if duration >= 0> + "StartDateTime": "${carrier_apt.planned_unloading_start_datetime}" + <#else> + "StartDateTime": "${carrier_apt.planned_load_start_datetime}" + + + + + }] + } +] \ No newline at end of file diff --git a/RFXtoRP_HsrCarrierApt_SiteForceUpdateAppointment.ftl b/RFXtoRP_HsrCarrierApt_SiteForceUpdateAppointment.ftl new file mode 100644 index 0000000..571bfc4 --- /dev/null +++ b/RFXtoRP_HsrCarrierApt_SiteForceUpdateAppointment.ftl @@ -0,0 +1,75 @@ +<#include "HfRpConfig.ftl"> +<#include "ReflexUtils.ftl"> + + + +[ + { + <#assign appointment_reception_start_datetime = RfxDateTimetoUTCWithTimezone(carrier_apt.planned_unloading_start_datetime,time_zone_rfx) /> + <#assign appointment_expedition_start_datetime = RfxDateTimetoUTCWithTimezone(carrier_apt.planned_load_start_datetime,time_zone_rfx) /> + <#assign creation_datetime = RfxDateTimetoUTCWithTimezone(carrier_apt.metadata.creation_datetime,time_zone_rfx) /> + + "Header":{ + "ProjectID": "${projectRP}" + }, + "ActorID": "${carrier_apt.physical_depot}", + <#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "false"> + <#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_RECEPTION> + <#assign duration = RfxDurationBetweenTwoDateTimetoInSeconds(carrier_apt.planned_unloading_start_datetime,carrier_apt.planned_unloading_end_datetime,time_zone_rfx) /> + <#else> + <#if carrier_apt.unloading_appointment == "false" && carrier_apt.load_appointment == "true" > + <#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_EXPEDITION> + <#assign duration = RfxDurationBetweenTwoDateTimetoInSeconds(carrier_apt.planned_load_start_datetime,carrier_apt.planned_load_end_datetime,time_zone_rfx) /> + <#else> + <#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "true"> + <#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_BOTH> + <#assign duration = 0 /> <#-- à confirmer --> + <#else> + <#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_UNKNOWN> + <#assign duration = 0 /> <#-- à confirmer --> + + + + "ProjectID": "${projectRP}", + "TimeZone": "${time_zone_rfx}", + "AppointmentID": "${carrier_apt.appointment_reference}", + <#if carrier_apt.physical_receipt_list?? && (carrier_apt.physical_receipt_list?size == carrier_apt.physical_receipt_list?filter(l ->l??)?size)> + "Commissions": [ + <#list carrier_apt.physical_receipt_list as physical_receipt> + { + "ActorID": "${carrier_apt.physical_depot}", + "OrderID": "${physical_receipt.physical_receipt_reference?json_string}", + "ProjectID": "${projectRP}", + "Quantities": [ + { + "UnitID": "PAL", <#-- à changer --> + "Value": 1 <#-- à changer --> + } + ] + }<#sep>, + + ], + + + "Slots": [{ + <#-- calcul de de la durée en fonction des start et end time--> + "DurationInSeconds": "${duration}", + <#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "false"> + "StartDateTime": "${carrier_apt.planned_unloading_start_datetime}" + <#else> + <#if carrier_apt.unloading_appointment == "false" && carrier_apt.load_appointment == "true"> + "StartDateTime": "${carrier_apt.planned_load_start_datetime}" + <#else> + <#assign duration = RfxDurationBetweenTwoDateTimetoInSeconds(carrier_apt.planned_unloading_start_datetime,carrier_apt.planned_load_start_datetime,time_zone_rfx) /> + <#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "true"> + <#if duration >= 0> + "StartDateTime": "${carrier_apt.planned_unloading_start_datetime}" + <#else> + "StartDateTime": "${carrier_apt.planned_load_start_datetime}" + + + + + }] + } +] \ No newline at end of file diff --git a/RPtoRFX_PrepOrder_DefaultHeaderData.ftl b/RPtoRFX_PrepOrder_DefaultHeaderData.ftl index 6d51468..c196fce 100644 --- a/RPtoRFX_PrepOrder_DefaultHeaderData.ftl +++ b/RPtoRFX_PrepOrder_DefaultHeaderData.ftl @@ -2,6 +2,7 @@ <#-- How to use MD Header map Example : +<<<<<<< HEAD <#assign pick_sequence_code = Header_MetaData_Map["OrderType"].String!""/> If your MD is : @@ -14,19 +15,28 @@ -<#assign activity_code = ""/> -<#assign originator_code = ""/> -<#assign preparation_type_code = ""/> -<#assign requested_delivery_date_type = ""/> +<#assign activity_code = "ALI"/> +<#assign originator_code = "001"/> +======= + <#assign pick_sequence_code = Header_MetaData_Map["OrderType"]!""/> +--> + + +<#assign activity_code = "ALI"/> +<#assign originator_code = "DEPT ALIM"/> +>>>>>>> main +<#assign preparation_type_code = "010"/> +<#assign requested_delivery_date_type = "010"/> <#assign consolidated_delivery_flag ="false"/> <#assign pick_sequence_code = ""/> <#assign protected_flag ="false"/> <#assign automatic_generation_flag ="false"/> <#assign apt_with_end_consignee_flag="false"/> +<<<<<<< HEAD <#-- A supprimer si utilisation de la table de correspondance--> <#--To be deleted if using the correspondence table--> -<#assign load_grouping = "default"> +<#assign load_grouping = "TEST"> <#-- Table de correspondance Transporteur/Code regroupement chargement, @@ -45,3 +55,6 @@ Assigning to a load if you set up Load Grouping+Distribution Master Plan--> +======= +<#assign load_grouping = "STD"/> +>>>>>>> main