70 lines
3.4 KiB
Java
70 lines
3.4 KiB
Java
{
|
|
"id" : {"refid" : "${eventRP.refid?json_string}"},
|
|
"route" : "rest/public/v1/physical_depots/{physical_depot_code}/carrier_appointments",
|
|
"method" : "POST",
|
|
"uri_substitutions": {
|
|
"physical_depot_code": "${RPtoRFXprefixDepot(eventRP.actor)}"
|
|
},
|
|
"payload" :
|
|
{
|
|
"appointment_reference": "${eventRP.refid?json_string}",
|
|
<#switch appointment.AppointmentType>
|
|
<#case "APPOINTMENT_TYPE_LOADING">
|
|
"unloading_appointment" : "false",
|
|
"load_appointment" : "true",
|
|
<#if appointment.TimeZone?? && appointment.TimeZone!="">
|
|
"planned_load_start_datetime" : "${DateTimeUTCtoRfxLocale(RfxDateTimetoUTCWithTimezone(appointment.Slot.StartDateTime,appointment.TimeZone),time_zone_rfx)}",
|
|
"planned_load_end_datetime": "${DateTimeUTCtoRfxLocale(RfxDateTimetoUTCWithTimezone(appointment.Slot.EndDateTime,appointment.TimeZone),time_zone_rfx)}",
|
|
<#else>
|
|
"planned_load_start_datetime" : "${DateTimeUTCtoRfxLocale(RfxDateTimetoUTCWithTimezone(appointment.Slot.StartDateTime,time_zone_rfx),time_zone_rfx)}",
|
|
"planned_load_end_datetime": "${DateTimeUTCtoRfxLocale(RfxDateTimetoUTCWithTimezone(appointment.Slot.EndDateTime,time_zone_rfx),time_zone_rfx)}",
|
|
</#if>
|
|
<#break>
|
|
<#case "APPOINTMENT_TYPE_UNLOADING">
|
|
"unloading_appointment" : "true",
|
|
"load_appointment" : "false",
|
|
<#if appointment.TimeZone?? && appointment.TimeZone!="">
|
|
"planned_unloading_start_datetime":"${DateTimeUTCtoRfxLocale(RfxDateTimetoUTCWithTimezone(appointment.Slot.StartDateTime,appointment.TimeZone),time_zone_rfx)}",
|
|
"planned_unloading_end_datetime" : "${DateTimeUTCtoRfxLocale(RfxDateTimetoUTCWithTimezone(appointment.Slot.EndDateTime,appointment.TimeZone),time_zone_rfx)}",
|
|
<#else>
|
|
"planned_unloading_start_datetime":"${DateTimeUTCtoRfxLocale(RfxDateTimetoUTCWithTimezone(appointment.Slot.StartDateTime,time_zone_rfx),time_zone_rfx)}",
|
|
"planned_unloading_end_datetime" : "${DateTimeUTCtoRfxLocale(RfxDateTimetoUTCWithTimezone(appointment.Slot.EndDateTime,time_zone_rfx),time_zone_rfx)}",
|
|
</#if>
|
|
<#break>
|
|
<#default>
|
|
<#stop "appointment.AppointmentType not implemented" >
|
|
</#switch>
|
|
<#include "RPtoRFX_CarrierAppointmentDefaultData.ftl">
|
|
<#if appointment.Commissions??>
|
|
<#if appointment.AppointmentType == "APPOINTMENT_TYPE_UNLOADING">
|
|
<#if appointment.Commissions[0].OrderID?? && appointment.Commissions[0].OrderID!="">
|
|
"physical_receipt_list": [
|
|
<#list eventRP.executionflowCustomFields.entrySet()?filter(l ->l.value?? && l.value?has_content) as custom>
|
|
{
|
|
"receipt_activity": "${custom.value.activity_code?json_string}",
|
|
"originator_code": "${custom.value.originator_code?json_string}",
|
|
"physical_receipt_reference": "${custom.value.reference?json_string}",
|
|
"receipt_year": "${custom.value.order_year?json_string}",
|
|
"receipt_number": "${custom.value.order_number?json_string}"
|
|
|
|
}
|
|
<#sep>,</#sep>
|
|
</#list>
|
|
],
|
|
<#else>
|
|
"appointment_designation":"${(appointment.Reason!"")!?json_string}",
|
|
</#if>
|
|
<#else>
|
|
<#if appointment.AppointmentType == "APPOINTMENT_TYPE_LOADING">
|
|
<#if appointment.Commissions[0].OrderID ?? && appointment.Commissions[0].OrderID!="">
|
|
"appointment_designation":"LOADING",
|
|
<#else>
|
|
"appointment_designation":"${(appointment.Reason!"")?json_string}",
|
|
</#if>
|
|
</#if>
|
|
</#if>
|
|
</#if>
|
|
"constant_appointment": "false"
|
|
}
|
|
}
|