123 lines
4.2 KiB
Java
123 lines
4.2 KiB
Java
<#-- **** input parameters ***** -->
|
|
<#-- input : message HARDIS WMS -->
|
|
<#-- project : projectId in HARDIS SC NETWORK -->
|
|
<#-- organisation : organisationtId in HARDIS SC NETWORK -->
|
|
<#include "HfRpConfig.ftl">
|
|
<#include "ReflexUtils.ftl">
|
|
<#include "ActorPrefix.ftl">
|
|
|
|
<#assign eventRP = JsonUtil.jsonToMap(input)>
|
|
<#assign projectRP = project>
|
|
<#assign organisationRP = organisation>
|
|
|
|
<#switch eventRP.event>
|
|
<#-- *********************************************** Action = CREATE ******************** -->
|
|
<#case "Created">
|
|
<#assign appointment = eventRP.data />
|
|
[
|
|
{
|
|
<#assign apiRestReflexID = ApiRestReflexID.appointment_post_create>
|
|
"apiRestReflexID" : "${apiRestReflexID}",
|
|
"datas" :
|
|
<#include "RPtoRFX_CarrierAppointmentCreated.ftl">
|
|
}
|
|
]
|
|
<#break>
|
|
<#-- *********************************************** Action = CommissionsUpdated ******************** -->
|
|
<#case "Updated">
|
|
<#assign AddComma = false />
|
|
<#assign appointment = eventRP.data />
|
|
[
|
|
<#if eventRP.commissionsUpdated>
|
|
<#if appointment.AppointmentType == "APPOINTMENT_TYPE_UNLOADING" && eventRP.addedCommissions?? && eventRP.addedCommissions != "">
|
|
<#if eventRP.appointmentCustomFields?has_content>
|
|
{
|
|
<#assign apiRestReflexID = ApiRestReflexID.appointment_post_physical_receipt_associations_by_number>
|
|
"apiRestReflexID" : "${apiRestReflexID}",
|
|
"datas" :
|
|
<#include "RPtoRFX_CarrierAppointmentPhysicalReceiptAssociationByNumber.ftl">
|
|
}
|
|
<#else>
|
|
{
|
|
<#assign apiRestReflexID = ApiRestReflexID.appointment_post_physical_receipt_associations_by_ref>
|
|
"apiRestReflexID" : "${apiRestReflexID}",
|
|
"datas" :
|
|
<#include "RPtoRFX_CarrierAppointmentPhysicalReceiptAssociationByRef.ftl">
|
|
}
|
|
</#if>
|
|
<#assign AddComma = true />
|
|
</#if>
|
|
<#if appointment.AppointmentType == "APPOINTMENT_TYPE_UNLOADING" && eventRP.removedCommissions?? && eventRP.removedCommissions!="">
|
|
<#if AddComma == true>
|
|
,
|
|
</#if>
|
|
|
|
<#if eventRP.appointmentCustomFields?has_content>
|
|
{
|
|
<#assign apiRestReflexID = ApiRestReflexID.appointment_post_physical_receipt_dissociations_by_number>
|
|
"apiRestReflexID" : "${apiRestReflexID}",
|
|
"datas" :
|
|
<#include "RPtoRFX_CarrierAppointmentPhysicalReceiptDissociationByNumber.ftl">
|
|
}
|
|
<#else>
|
|
{
|
|
<#assign apiRestReflexID = ApiRestReflexID.appointment_post_physical_receipt_dissociations_by_ref>
|
|
"apiRestReflexID" : "${apiRestReflexID}",
|
|
"datas" :
|
|
<#include "RPtoRFX_CarrierAppointmentPhysicalReceiptDissociationByRef.ftl">
|
|
}
|
|
</#if>
|
|
<#assign AddComma = true />
|
|
</#if>
|
|
</#if>
|
|
<#-- *********************************************** Action = reasonUpdated or slotUpdated ******************** -->
|
|
<#if eventRP.reasonUpdated || eventRP.slotUpdated || eventRP.carrierInformationUpdated>
|
|
<#if AddComma == true>
|
|
,
|
|
</#if>
|
|
<#if eventRP.appointmentCustomFields?has_content>
|
|
{
|
|
<#assign apiRestReflexID = ApiRestReflexID.appointment_put_update_by_number>
|
|
"apiRestReflexID" : "${apiRestReflexID}",
|
|
"datas" :
|
|
<#include "RPtoRFX_CarrierAppointmentSlotOrCarrierInformationUpdatedByNumber.ftl">
|
|
}
|
|
<#else>
|
|
{
|
|
<#assign apiRestReflexID = ApiRestReflexID.appointment_put_update_by_ref>
|
|
"apiRestReflexID" : "${apiRestReflexID}",
|
|
"datas" :
|
|
<#include "RPtoRFX_CarrierAppointmentSlotOrCarrierInformationUpdatedByRef.ftl">
|
|
}
|
|
</#if>
|
|
<#assign AddComma = true />
|
|
</#if>
|
|
]
|
|
<#break>
|
|
<#-- *********************************************** Action = Canceled ******************** -->
|
|
<#case "Canceled">
|
|
<#assign appointment = eventRP.data />
|
|
[
|
|
<#if eventRP.appointmentCustomFields?has_content>
|
|
{
|
|
<#assign apiRestReflexID = ApiRestReflexID.status_appointment_put_update_by_number>
|
|
"apiRestReflexID" : "${apiRestReflexID}",
|
|
"datas" :
|
|
<#include "RPtoRFX_CarrierAppointmentCanceledByNumber.ftl">
|
|
}
|
|
<#else>
|
|
{
|
|
<#assign apiRestReflexID = ApiRestReflexID.status_appointment_put_update_by_ref>
|
|
"apiRestReflexID" : "${apiRestReflexID}",
|
|
"datas" :
|
|
<#include "RPtoRFX_CarrierAppointmentCanceledByRef.ftl">
|
|
}
|
|
</#if>
|
|
]
|
|
<#break>
|
|
<#default>
|
|
<#stop >
|
|
</#switch>
|
|
|
|
|