71 lines
2.5 KiB
Java
71 lines
2.5 KiB
Java
<#-- **** input parameters ***** -->
|
|
<#-- input : message RFX -->
|
|
<#-- project : projectId in ReflexPlatform -->
|
|
<#-- organisation : organisationtId in ReflexPlatform -->
|
|
<#include "ActorPrefix.ftl">
|
|
<#include "HfRpConfig.ftl">
|
|
<#include "ReflexUtils.ftl">
|
|
|
|
<#assign cloudEventMsg = JsonUtil.jsonToMap(input)>
|
|
<#assign projectRP = project>
|
|
|
|
<#assign organisationRP = organisation>
|
|
|
|
<#assign aDateTime = .now>
|
|
|
|
<#switch cloudEventMsg.action>
|
|
<#case "C">
|
|
<#case "U">
|
|
<#-- *********************************************** Action = Update ******************** -->
|
|
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
|
|
<#assign carrier_apt_status = JsonUtil.jsonToMap(dataRfx)>
|
|
[
|
|
{
|
|
|
|
|
|
<#switch carrier_apt_status.status.carrier_status_code>
|
|
<#case "010"> <#-- Transporteur attendu -->
|
|
<#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentCarrierExpected> <#-- à revoir -->
|
|
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
|
"datas" :
|
|
<#include "RFXtoRP_HsaLstCarSta_CarrierExpected.ftl">
|
|
<#break>
|
|
<#case "020"> <#-- Transporteur arrivé sur site-->
|
|
<#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentCarrierArrived> <#-- à revoir -->
|
|
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
|
"datas" :
|
|
<#include "RFXtoRP_HsaLstCarSta_CarrierArrived.ftl">
|
|
<#break>
|
|
<#case "040"> <#-- Déchargement commencé -->
|
|
<#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentReceptionStarted> <#-- à revoir -->
|
|
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
|
"datas" :
|
|
<#include "RFXtoRP_HsaLstCarSta_ReceptionStarted.ftl">
|
|
<#break>
|
|
<#case "050"> <#-- Déchargement terminé-->
|
|
<#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentReceptionStarted> <#-- à revoir -->
|
|
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
|
"datas" :
|
|
<#include "RFXtoRP_HsaLstCarSta_ReceptionStarted.ftl">
|
|
<#break>
|
|
|
|
<#default>
|
|
<#stop 'this updated appointment Status not implemented'>
|
|
</#switch>
|
|
|
|
|
|
}
|
|
]
|
|
<#break>
|
|
|
|
<#case "D">
|
|
<#-- *********************************************** Action = Delete ******************** -->
|
|
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
|
|
<#assign carrier_apt_status = JsonUtil.jsonToMap(dataRfx)>
|
|
<#stop 'Delete Appointment Status not implemented' >
|
|
<#break>
|
|
<#default>
|
|
<#stop >
|
|
</#switch>
|
|
|