62 lines
3.0 KiB
Java
62 lines
3.0 KiB
Java
<#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 -->
|
|
</#if>
|
|
</#if>
|
|
</#if>
|
|
"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}"
|
|
</#if>
|
|
</#if>
|
|
</#if>
|
|
</#if>
|
|
}]
|
|
}
|
|
] |