RDV
This commit is contained in:
parent
dbb4a21e66
commit
29e35d8ed1
@ -42,23 +42,40 @@
|
|||||||
<#-- *********************************************** Action = Update ********************-->
|
<#-- *********************************************** Action = Update ********************-->
|
||||||
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
|
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
|
||||||
<#assign carrier_apt = JsonUtil.jsonToMap(dataRfx)>
|
<#assign carrier_apt = JsonUtil.jsonToMap(dataRfx)>
|
||||||
<#if carrier_apt.physical_receipt_list?? && (carrier_apt.physical_receipt_list?filter(l ->l??)?size != 0)>
|
<#if carrier_apt.status ?? carrier_apt.status.status_code=="999">
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
<#assign apiReflexPlatformID = ApiReflexPlatformID.SiteForceUpdateAppointment> <#-- à revoir-->
|
<#assign apiReflexPlatformID = ApiReflexPlatformID.SiteCancelAppointment>
|
||||||
|
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
||||||
|
"datas" :
|
||||||
|
<#include "RFXtoRP_HsrCarrierApt_SiteCancelAppointment.ftl">
|
||||||
|
}
|
||||||
|
]
|
||||||
|
<#else>
|
||||||
|
<#if carrier_apt.physical_receipt_list?? && (carrier_apt.physical_receipt_list?filter(l ->l??)?size != 0)>
|
||||||
|
[
|
||||||
|
{
|
||||||
|
<#assign apiReflexPlatformID = ApiReflexPlatformID.SiteWMSUpdateAppointment>
|
||||||
|
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
||||||
|
"datas" :
|
||||||
|
<#include "RFXtoRP_HsrCarrierApt_UpdateAppointment.ftl">
|
||||||
|
}
|
||||||
|
]
|
||||||
|
<#else>
|
||||||
|
[
|
||||||
|
{
|
||||||
|
<#assign apiReflexPlatformID = ApiReflexPlatformID.SiteWMSUpdateAppointment> <#-- à revoir-->
|
||||||
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
||||||
"datas" :
|
"datas" :
|
||||||
<#include "RFXtoRP_HsrCarrierApt_SiteForceUpdateAppointment.ftl">
|
<#include "RFXtoRP_HsrCarrierApt_UpdateSlotAppointment.ftl">
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
<#else>
|
|
||||||
<#stop> <#--no comission-->
|
|
||||||
</#if>
|
</#if>
|
||||||
<#break>
|
<#break>
|
||||||
|
|
||||||
<#case "D">
|
<#case "D">
|
||||||
<#-- *********************************************** Action = Delete ******************** -->
|
<#-- *********************************************** Action = Delete ******************** -->
|
||||||
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
|
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
|
||||||
<#assign carrier_apt = JsonUtil.jsonToMap(dataRfx)>
|
<#assign carrier_apt = JsonUtil.jsonToMap(dataRfx)>
|
||||||
[
|
[
|
||||||
<#-- Ajout des lignes-->
|
<#-- Ajout des lignes-->
|
||||||
@ -68,7 +85,6 @@
|
|||||||
"datas" :
|
"datas" :
|
||||||
<#include "RFXtoRP_HsrCarrierApt_SiteCancelAppointment.ftl">
|
<#include "RFXtoRP_HsrCarrierApt_SiteCancelAppointment.ftl">
|
||||||
}
|
}
|
||||||
|
|
||||||
]
|
]
|
||||||
<#break>
|
<#break>
|
||||||
<#default>
|
<#default>
|
||||||
|
|||||||
@ -43,7 +43,6 @@
|
|||||||
</#if>
|
</#if>
|
||||||
</#if>
|
</#if>
|
||||||
"ActorID": "${RFXtoRPprefixDepot(carrier_apt.physical_depot?json_string)}",
|
"ActorID": "${RFXtoRPprefixDepot(carrier_apt.physical_depot?json_string)}",
|
||||||
"Emails": ["${carrier_apt.creation_user_email?json_string}"],
|
|
||||||
"CustomFields": [
|
"CustomFields": [
|
||||||
{
|
{
|
||||||
"Key": "depot",
|
"Key": "depot",
|
||||||
@ -66,21 +65,6 @@
|
|||||||
"Value": "${carrier_apt.planned_carrier?json_string}"
|
"Value": "${carrier_apt.planned_carrier?json_string}"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"Reason":"",
|
|
||||||
<#if carrier_apt.physical_receipt_list?? && (carrier_apt.physical_receipt_list?filter(l ->l??)?size != 0)>
|
|
||||||
"Commissions": [
|
|
||||||
<#list carrier_apt.physical_receipt_list?filter(l ->l??) as physical_receipt>
|
|
||||||
{
|
|
||||||
"ActorID": "${RFXtoRPprefixDepot(carrier_apt.physical_depot?json_string)}",
|
|
||||||
"OrderID": "${physical_receipt.physical_receipt_reference?json_string}",
|
|
||||||
"ProjectID": "${projectRP}",
|
|
||||||
<#include "RFXtoRP_HsrCarrierApt_Quantities.ftl">
|
|
||||||
}<#sep>,</#sep>
|
|
||||||
</#list>
|
|
||||||
],
|
|
||||||
<#else>
|
|
||||||
"Reason": "no commission", <#-- à changer -->
|
|
||||||
</#if>
|
|
||||||
"Slots": [{
|
"Slots": [{
|
||||||
<#-- calcul de de la durée en fonction des start et end time-->
|
<#-- calcul de de la durée en fonction des start et end time-->
|
||||||
"DurationInSeconds": "${duration}",
|
"DurationInSeconds": "${duration}",
|
||||||
92
RFXtoRP_HsrCarrierApt_UpdateSlotAppointment.ftl
Normal file
92
RFXtoRP_HsrCarrierApt_UpdateSlotAppointment.ftl
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
<#assign creation_datetime = RfxDateTimetoUTCWithTimezone(carrier_apt.metadata.creation_datetime,time_zone_rfx) />
|
||||||
|
|
||||||
|
"Header":{
|
||||||
|
"ProjectID": "${projectRP}"
|
||||||
|
},
|
||||||
|
<#if carrier_apt.appointment_reference?? && carrier_apt.appointment_reference!="">
|
||||||
|
"AppointmentID": "${carrier_apt.appointment_reference?json_string}",
|
||||||
|
<#else>
|
||||||
|
<#if carrier_apt.constant_appointment?? && carrier_apt.constant_appointment== "true">
|
||||||
|
"AppointmentID": "${carrier_apt.appointment_reference?json_string}${carrier_apt.physical_depot?json_string}${carrier_apt.year_number}${carrier_apt.appointment_number}",
|
||||||
|
<#else>
|
||||||
|
"AppointmentID": "${carrier_apt.physical_depot?json_string}${carrier_apt.year_number}${carrier_apt.appointment_number}",
|
||||||
|
</#if>
|
||||||
|
</#if>
|
||||||
|
<#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "false">
|
||||||
|
<#if carrier_apt.planned_unloading_start_datetime?starts_with("00") || carrier_apt.planned_unloading_start_datetime?contains("-00-") || carrier_apt.planned_unloading_end_datetime?starts_with("00") || carrier_apt.planned_unloading_end_datetime?contains("-00-")>
|
||||||
|
<#stop "planned_unloading_start_datetime or planned_unloading_end_datetime field of appointmend is not initialized" >
|
||||||
|
</#if>
|
||||||
|
<#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_UNLOADING>
|
||||||
|
<#assign duration = DurationBetweenTwoDatetimeInSeconds(carrier_apt.planned_unloading_start_datetime?datetime.iso,carrier_apt.planned_unloading_end_datetime?datetime.iso) />
|
||||||
|
<#if (duration <= 0)>
|
||||||
|
<#stop "planned_unloading_start_datetime or planned_unloading_end_datetime field of appointmend are not valid" >
|
||||||
|
</#if>
|
||||||
|
<#else>
|
||||||
|
<#if carrier_apt.unloading_appointment == "false" && carrier_apt.load_appointment == "true" >
|
||||||
|
<#if carrier_apt.planned_load_start_datetime?starts_with("00") || carrier_apt.planned_load_start_datetime?contains("-00-") || carrier_apt.planned_load_end_datetime?starts_with("00") || carrier_apt.planned_load_end_datetime?contains("-00-")>
|
||||||
|
<#stop "planned_load_start_datetime or planned_load_end_datetime field of appointmend is not initialized" >
|
||||||
|
</#if>
|
||||||
|
<#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_LOADING>
|
||||||
|
<#assign duration = DurationBetweenTwoDatetimeInSeconds(carrier_apt.planned_load_start_datetime?datetime.iso,carrier_apt.planned_load_end_datetime?datetime.iso) />
|
||||||
|
<#if (duration <= 0)>
|
||||||
|
<#stop "planned_unloading_start_datetime or planned_unloading_end_datetime field of appointmend are not valid" >
|
||||||
|
</#if>
|
||||||
|
<#else>
|
||||||
|
<#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "true">
|
||||||
|
<#stop "Not managed">
|
||||||
|
<#else>
|
||||||
|
<#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_UNKNOWN>
|
||||||
|
<#assign duration = 0 /> <#-- à confirmer -->
|
||||||
|
</#if>
|
||||||
|
</#if>
|
||||||
|
</#if>
|
||||||
|
"ActorID": "${RFXtoRPprefixDepot(carrier_apt.physical_depot?json_string)}",
|
||||||
|
"CustomFields": [
|
||||||
|
{
|
||||||
|
"Key": "depot",
|
||||||
|
"Value": "${carrier_apt.physical_depot?json_string}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Key": "year",
|
||||||
|
"Value": "${carrier_apt.year_number?json_string}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Key": "number",
|
||||||
|
"Value": "${carrier_apt.appointment_number?json_string}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Key": "reference",
|
||||||
|
"Value": "${carrier_apt.appointment_reference?json_string}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Key": "carrier",
|
||||||
|
"Value": "${carrier_apt.planned_carrier?json_string}"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"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" >
|
||||||
|
<#if carrier_apt.planned_unloading_start_datetime?starts_with("00") || carrier_apt.planned_unloading_start_datetime?contains("-00-")>
|
||||||
|
<#stop "planned_unloading_start_datetime field of appointmend is not initialized" >
|
||||||
|
</#if>
|
||||||
|
|
||||||
|
"StartDateTime": "${carrier_apt.planned_unloading_start_datetime}"
|
||||||
|
<#else>
|
||||||
|
<#if carrier_apt.unloading_appointment == "false" && carrier_apt.load_appointment == "true">
|
||||||
|
<#if carrier_apt.planned_load_start_datetime?starts_with("00") || carrier_apt.planned_load_start_datetime?contains("-00-")>
|
||||||
|
<#stop "planned_load_start_datetime field of appointmend is not initialized" >
|
||||||
|
</#if>
|
||||||
|
"StartDateTime": "${carrier_apt.planned_load_start_datetime}"
|
||||||
|
<#else>
|
||||||
|
<#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "true">
|
||||||
|
<#stop "Not managed">
|
||||||
|
</#if>
|
||||||
|
</#if>
|
||||||
|
</#if>
|
||||||
|
}]
|
||||||
|
|
||||||
|
}
|
||||||
|
]
|
||||||
Loading…
x
Reference in New Issue
Block a user