modif sur les rdz
This commit is contained in:
parent
a151a0b655
commit
bd7b24fed7
@ -17,11 +17,11 @@
|
|||||||
"ActorID": "${carrier_apt.physical_depot}",
|
"ActorID": "${carrier_apt.physical_depot}",
|
||||||
<#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "false">
|
<#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "false">
|
||||||
<#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_RECEPTION>
|
<#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_RECEPTION>
|
||||||
<#assign duration = RfxDurationBetweenTwoDateTimetoInSeconds(carrier_apt.planned_unloading_start_datetime,carrier_apt.planned_unloading_end_datetime,time_zone_rfx) />
|
<#assign duration = (carrier_apt.planned_unloading_start_datetime,carrier_apt.planned_unloading_end_datetime,time_zone_rfx) />
|
||||||
<#else>
|
<#else>
|
||||||
<#if carrier_apt.unloading_appointment == "false" && carrier_apt.load_appointment == "true" >
|
<#if carrier_apt.unloading_appointment == "false" && carrier_apt.load_appointment == "true" >
|
||||||
<#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_EXPEDITION>
|
<#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_EXPEDITION>
|
||||||
<#assign duration = RfxDurationBetweenTwoDateTimetoInSeconds(carrier_apt.planned_load_start_datetime,carrier_apt.planned_load_end_datetime,time_zone_rfx) />
|
<#assign duration = DurationBetweenTwoDatetimeInSeconds(carrier_apt.planned_load_start_datetime?datetime.iso,carrier_apt.planned_load_end_datetime?datetime.iso,time_zone_rfx) />
|
||||||
<#else>
|
<#else>
|
||||||
<#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "true">
|
<#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "true">
|
||||||
<#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_BOTH>
|
<#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_BOTH>
|
||||||
@ -62,7 +62,7 @@
|
|||||||
<#if carrier_apt.unloading_appointment == "false" && carrier_apt.load_appointment == "true">
|
<#if carrier_apt.unloading_appointment == "false" && carrier_apt.load_appointment == "true">
|
||||||
"StartDateTime": "${carrier_apt.planned_load_start_datetime}"
|
"StartDateTime": "${carrier_apt.planned_load_start_datetime}"
|
||||||
<#else>
|
<#else>
|
||||||
<#assign duration = RfxDurationBetweenTwoDateTimetoInSeconds(carrier_apt.planned_unloading_start_datetime,carrier_apt.planned_load_start_datetime,time_zone_rfx) />
|
<#assign duration = DurationBetweenTwoDatetimeInSeconds(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 carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "true">
|
||||||
<#if duration >= 0>
|
<#if duration >= 0>
|
||||||
"StartDateTime": "${carrier_apt.planned_unloading_start_datetime}"
|
"StartDateTime": "${carrier_apt.planned_unloading_start_datetime}"
|
||||||
|
|||||||
@ -17,11 +17,11 @@
|
|||||||
"ActorID": "${carrier_apt.physical_depot}",
|
"ActorID": "${carrier_apt.physical_depot}",
|
||||||
<#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "false">
|
<#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "false">
|
||||||
<#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_RECEPTION>
|
<#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_RECEPTION>
|
||||||
<#assign duration = RfxDurationBetweenTwoDateTimetoInSeconds(carrier_apt.planned_unloading_start_datetime,carrier_apt.planned_unloading_end_datetime,time_zone_rfx) />
|
<#assign duration = DurationBetweenTwoDatetimeInSeconds(carrier_apt.planned_unloading_start_datetime?datetime.iso,carrier_apt.planned_unloading_end_datetime?datetime.iso,time_zone_rfx) />
|
||||||
<#else>
|
<#else>
|
||||||
<#if carrier_apt.unloading_appointment == "false" && carrier_apt.load_appointment == "true" >
|
<#if carrier_apt.unloading_appointment == "false" && carrier_apt.load_appointment == "true" >
|
||||||
<#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_EXPEDITION>
|
<#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_EXPEDITION>
|
||||||
<#assign duration = RfxDurationBetweenTwoDateTimetoInSeconds(carrier_apt.planned_load_start_datetime,carrier_apt.planned_load_end_datetime,time_zone_rfx) />
|
<#assign duration = DurationBetweenTwoDatetimeInSeconds(carrier_apt.planned_load_start_datetime?datetime.iso,carrier_apt.planned_load_end_datetime?datetime.iso,time_zone_rfx) />
|
||||||
<#else>
|
<#else>
|
||||||
<#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "true">
|
<#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "true">
|
||||||
<#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_BOTH>
|
<#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_BOTH>
|
||||||
@ -47,7 +47,7 @@
|
|||||||
<#if carrier_apt.unloading_appointment == "false" && carrier_apt.load_appointment == "true">
|
<#if carrier_apt.unloading_appointment == "false" && carrier_apt.load_appointment == "true">
|
||||||
"StartDateTime": "${carrier_apt.planned_load_start_datetime}"
|
"StartDateTime": "${carrier_apt.planned_load_start_datetime}"
|
||||||
<#else>
|
<#else>
|
||||||
<#assign duration = RfxDurationBetweenTwoDateTimetoInSeconds(carrier_apt.planned_unloading_start_datetime,carrier_apt.planned_load_start_datetime,time_zone_rfx) />
|
<#assign duration = DurationBetweenTwoDatetimeInSeconds(carrier_apt.planned_unloading_start_datetime?datetime.iso,carrier_apt.planned_load_start_datetime?datetime.iso,time_zone_rfx) />
|
||||||
<#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "true">
|
<#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "true">
|
||||||
<#if duration >= 0>
|
<#if duration >= 0>
|
||||||
"StartDateTime": "${carrier_apt.planned_unloading_start_datetime}"
|
"StartDateTime": "${carrier_apt.planned_unloading_start_datetime}"
|
||||||
|
|||||||
@ -15,11 +15,11 @@
|
|||||||
"ActorID": "${carrier_apt.physical_depot}",
|
"ActorID": "${carrier_apt.physical_depot}",
|
||||||
<#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "false">
|
<#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "false">
|
||||||
<#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_RECEPTION>
|
<#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_RECEPTION>
|
||||||
<#assign duration = RfxDurationBetweenTwoDateTimetoInSeconds(carrier_apt.planned_unloading_start_datetime,carrier_apt.planned_unloading_end_datetime,time_zone_rfx) />
|
<#assign duration = DurationBetweenTwoDatetimeInSeconds(carrier_apt.planned_unloading_start_datetime?datetime.iso,carrier_apt.planned_unloading_end_datetime?datetime.iso,time_zone_rfx) />
|
||||||
<#else>
|
<#else>
|
||||||
<#if carrier_apt.unloading_appointment == "false" && carrier_apt.load_appointment == "true" >
|
<#if carrier_apt.unloading_appointment == "false" && carrier_apt.load_appointment == "true" >
|
||||||
<#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_EXPEDITION>
|
<#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_EXPEDITION>
|
||||||
<#assign duration = RfxDurationBetweenTwoDateTimetoInSeconds(carrier_apt.planned_load_start_datetime,carrier_apt.planned_load_end_datetime,time_zone_rfx) />
|
<#assign duration = DurationBetweenTwoDatetimeInSeconds(carrier_apt.planned_load_start_datetime?datetime.iso,carrier_apt.planned_load_end_datetime?datetime.iso,time_zone_rfx) />
|
||||||
<#else>
|
<#else>
|
||||||
<#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "true">
|
<#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "true">
|
||||||
<#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_BOTH>
|
<#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_BOTH>
|
||||||
@ -60,7 +60,7 @@
|
|||||||
<#if carrier_apt.unloading_appointment == "false" && carrier_apt.load_appointment == "true">
|
<#if carrier_apt.unloading_appointment == "false" && carrier_apt.load_appointment == "true">
|
||||||
"StartDateTime": "${carrier_apt.planned_load_start_datetime}"
|
"StartDateTime": "${carrier_apt.planned_load_start_datetime}"
|
||||||
<#else>
|
<#else>
|
||||||
<#assign duration = RfxDurationBetweenTwoDateTimetoInSeconds(carrier_apt.planned_unloading_start_datetime,carrier_apt.planned_load_start_datetime,time_zone_rfx) />
|
<#assign duration = DurationBetweenTwoDatetimeInSeconds(carrier_apt.planned_unloading_start_datetime?datetime.iso,carrier_apt.planned_load_start_datetime?datetime.iso,time_zone_rfx) />
|
||||||
<#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "true">
|
<#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "true">
|
||||||
<#if duration >= 0>
|
<#if duration >= 0>
|
||||||
"StartDateTime": "${carrier_apt.planned_unloading_start_datetime}"
|
"StartDateTime": "${carrier_apt.planned_unloading_start_datetime}"
|
||||||
|
|||||||
@ -9,12 +9,23 @@
|
|||||||
<#assign projectRP = project>
|
<#assign projectRP = project>
|
||||||
<#assign organisationRP = organisation>
|
<#assign organisationRP = organisation>
|
||||||
|
|
||||||
<#-- initialisation map for SegmentationKey and MetaData -->
|
<#switch eventRP.event>
|
||||||
<#assign Header_MetaData_Map = {} />
|
<#case "Created">
|
||||||
<#assign SegmentationKeys_Map = {} />
|
<#-- *********************************************** Action = CREATE or UPDATE ******************** -->
|
||||||
<#assign Line_MetaData_Map = {} />
|
<#assign appointment = eventRP.data />
|
||||||
|
[
|
||||||
|
{
|
||||||
|
|
||||||
|
<#assign apiRestReflexID = ApiRestReflexID.appointment_post>
|
||||||
|
"apiRestReflexID" : "${apiRestReflexID}",
|
||||||
|
"datas" :
|
||||||
|
<#include "RPtoRFX_CarrierAppointment.ftl">
|
||||||
|
}
|
||||||
|
]
|
||||||
|
<#break>
|
||||||
|
<#default>
|
||||||
|
<#stop >
|
||||||
|
</#switch>
|
||||||
<#switch eventRP.event>
|
<#switch eventRP.event>
|
||||||
<#case "Created">
|
<#case "Created">
|
||||||
<#assign appointment = eventRP.data />
|
<#assign appointment = eventRP.data />
|
||||||
|
|||||||
76
RPtoRFX_CarrierAppointment.ftl
Normal file
76
RPtoRFX_CarrierAppointment.ftl
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
<#include "ActorPrefix.ftl">
|
||||||
|
<#include "HfRpConfig.ftl">
|
||||||
|
|
||||||
|
{
|
||||||
|
"id" : {"refid" : "${eventRP.refid?json_string}"},
|
||||||
|
"route" : "rest/public/v1/physical_depots/{physical_depot_code}/carrier_appointments",
|
||||||
|
"method" : "POST",
|
||||||
|
"uri_substitutions": {
|
||||||
|
"physical_depot_code": "DPF" <#-- "${RPtoRFXprefixDepot(appointment.ActorID)}" -->
|
||||||
|
},
|
||||||
|
"payload" :
|
||||||
|
{
|
||||||
|
"appointment_reference": "${appointment.a_defnir?json_string}",
|
||||||
|
|
||||||
|
<#switch appointment.AppointmentType>
|
||||||
|
<#case "APPOINTMENT_TYPE_EXPEDITION">
|
||||||
|
|
||||||
|
"unloading_appointment" : "false",
|
||||||
|
"load_appointment" : "true",
|
||||||
|
"planned_load_start_datetime : "${appointment.Slot.StartDateTime?iso_nz(time_zone_rfx)}",
|
||||||
|
"planned_load_end_datetime": "${AddSecondsToDatetime(appointment.Slot.StartDateTime,appointment.Slot.DurationInSeconds)?iso_nz(time_zone_rfx)}"
|
||||||
|
|
||||||
|
<#break>
|
||||||
|
|
||||||
|
<#case "APPOINTMENT_TYPE_RECEPTION">
|
||||||
|
"unloading_appointment" : "true",
|
||||||
|
"load_appointment" : "false",
|
||||||
|
"planned_unloading_start_datetime : "${appointment.Slot.StartDateTime?iso_nz(time_zone_rfx))}",
|
||||||
|
"planned_unloading_end_datetime": "${AddSecondsToDatetime(appointment.Slot.StartDateTime,appointment.Slot.DurationInSeconds)?iso_nz(time_zone_rfx)}"
|
||||||
|
<#break>
|
||||||
|
<#default>
|
||||||
|
<#stop "appointment.AppointmentType not implemented>
|
||||||
|
</#switch>
|
||||||
|
|
||||||
|
"planned_carrier" : "${appointment.CarrierName?json_string}",
|
||||||
|
|
||||||
|
<#if appointment.Commissions??>
|
||||||
|
"physical_receipt_list": [
|
||||||
|
<#list appointment.Commissions as commission>
|
||||||
|
{
|
||||||
|
"receipt_activity": "str",
|
||||||
|
"originator_code": "string",
|
||||||
|
"physical_receipt_reference": "string",
|
||||||
|
"receipt_year": 0,
|
||||||
|
"receipt_number": 0,
|
||||||
|
"comment_list": [
|
||||||
|
{
|
||||||
|
"line_number": 999,
|
||||||
|
"group_code": "str",
|
||||||
|
"text": "string"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
{
|
||||||
|
"ProjectID": "recette-rfxdev",
|
||||||
|
"OrderID": "SPA-121125-02",
|
||||||
|
"Quantities": [
|
||||||
|
{
|
||||||
|
"UnitID": "PAL",
|
||||||
|
"Value": 1.0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"OrganisationID": "recette",
|
||||||
|
"PartnerAppID": "recette-rfxdev-rfxdev",
|
||||||
|
"ExecutionflowID": "DPFALIDEPT ALIMSPA-121125-02"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
<#sep>,</#sep>
|
||||||
|
</#list>
|
||||||
|
],
|
||||||
|
</#if>
|
||||||
|
"constant_appointment": "false"
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,6 +1,6 @@
|
|||||||
<#-- --------------------------------------------------------------------------------------- -->
|
<#-- -------------------------------------------------------------------------------------------- -->
|
||||||
<#-- Concat HARDIS WMS timestamp with HARDIS WMS time zone and format this date in ISO UTC format -->
|
<#-- Concat HARDIS WMS timestamp with HARDIS WMS time zone and format this date in ISO UTC format -->
|
||||||
<#-- --------------------------------------------------------------------------------------- -->
|
<#-- -------------------------------------------------------------------------------------------- -->
|
||||||
<#function RfxDateTimetoUTC rfxdatetime offset >
|
<#function RfxDateTimetoUTC rfxdatetime offset >
|
||||||
<#return ((rfxdatetime + offset)?datetime.iso?iso_utc)>
|
<#return ((rfxdatetime + offset)?datetime.iso?iso_utc)>
|
||||||
</#function>
|
</#function>
|
||||||
@ -9,6 +9,22 @@
|
|||||||
<#return dateutc?datetime.iso?iso_nz(locale)>
|
<#return dateutc?datetime.iso?iso_nz(locale)>
|
||||||
</#function>
|
</#function>
|
||||||
|
|
||||||
|
<#-- -------------------------------------------------------------------------------------------- -->
|
||||||
|
<#-- Add second to dateTime ex: AddSecondsToDatetime("2025-11-17T09:15:00Z"?datetime.iso, 61) -->
|
||||||
|
<#-- -------------------------------------------------------------------------------------------- -->
|
||||||
|
<#function AddSecondsToDatetime date seconds>
|
||||||
|
<#assign timeInMilliseconds = (1000 * seconds) >
|
||||||
|
<#assign aDate = date?long + timeInMilliseconds?long>
|
||||||
|
<#return aDate?number_to_datetime>
|
||||||
|
</#function>
|
||||||
|
|
||||||
|
<#-- -------------------------------------------------------------------------------------------- -->
|
||||||
|
<#-- duration between two datetime in second -->
|
||||||
|
<#-- -------------------------------------------------------------------------------------------- -->
|
||||||
|
<#function DurationBetweenTwoDatetimeInsecond startDate endDate>
|
||||||
|
<#return (endDate?long - startDate?long) / 1000 >
|
||||||
|
</#function>
|
||||||
|
|
||||||
<#-- --------------------------------------------------------------------------------------- -->
|
<#-- --------------------------------------------------------------------------------------- -->
|
||||||
<#-- Split email HARDIS WMS into json array string -->
|
<#-- Split email HARDIS WMS into json array string -->
|
||||||
<#-- Example : splitemail "john.doe@hardis-group.com,; name@hardis-group.com" -->
|
<#-- Example : splitemail "john.doe@hardis-group.com,; name@hardis-group.com" -->
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user