Merge branch 'release/2.0' into 'main-2.0'

release/2.0 into main-2.0

See merge request r-d-technique/tiers/reflex-wms-connector!263
This commit is contained in:
2026-04-20 12:24:15 +00:00
39 changed files with 809 additions and 383 deletions

11
InternalSettings.ftl Normal file
View File

@@ -0,0 +1,11 @@
<#-- --------------------------------------------------------------------------------------- -->
<#-- DeleteEF est un paramètre qui permet de déterminer si lexécution logistique doit être supprimée lors de la création dune commande.-->
<#-- Attention : si vous choisissez de la supprimer, toutes les métadonnées associées à cette exécution logistique seront également supprimées. -->
<#-- Si DeleteEF_False = true, nous ne supprimons pas l'exécution logistique, Si DeleteEF_False = false, nous supprimons l'exécution logistique.-->
<#-- --------------------------------------------------------------------------------------- -->
<#-- DeleteEF is a parameter used to determine whether the logistics execution should be deleted when creating an order.-->
<#-- Warning: if deletion is selected, all metadata related to the logistics execution will also be removed. -->
<#-- If DeleteEF_False = true, we do not delete the logistics execution. If DeleteEF_False = false, we delete the logistics execution. -->
<#-- --------------------------------------------------------------------------------------- -->
<#assign DeleteEF_False = true>

View File

@@ -34,7 +34,7 @@
"ExecutionflowID": "${reflexMvtStockInterface.original_receipt_physical_depot_code}${reflexMvtStockInterface.activity_code}${reflexMvtStockInterface.originator_code}${reflexMvtStockInterface.origin_order_line_reference?trim?json_string}",
"OrderID": "${reflexMvtStockInterface.origin_order_line_reference?trim?json_string}",
<#else>
<#if reflexMvtStockInterface.receipt_reference?? && reflexMvtStockInterface.receipt_reference!="">
<#if reflexMvtStockInterface.receipt_reference?? && reflexMvtStockInterface.receipt_reference!="" && !reflexMvtStockInterface.receipt_reference?starts_with(reflexMvtStockInterface.original_receipt_physical_depot_code + reflexMvtStockInterface.activity_code + reflexMvtStockInterface.receipt_year_number)>
"ExecutionflowID": "${reflexMvtStockInterface.original_receipt_physical_depot_code}${reflexMvtStockInterface.activity_code}${reflexMvtStockInterface.originator_code}${reflexMvtStockInterface.receipt_reference?trim?json_string}",
"OrderID": "${reflexMvtStockInterface.receipt_reference?trim?json_string}",
<#else>

50
RFXtoRP_HsrAntRec.ftl Normal file
View File

@@ -0,0 +1,50 @@
<#-- **** input parameters ***** -->
<#-- input : message HARDIS WMS -->
<#-- project : projectId in HARDIS SC NETWORK -->
<#-- organisation : organisationtId in HARDIS SC NETWORK -->
<#assign cloudEventMsg = JsonUtil.jsonToMap(input)>
<#assign projectRP = project>
<#assign organisationRP = organisation>
<#assign aDateTime = .now>
<#switch cloudEventMsg.action>
<#case "C">
<#-- *********************************************** Action = CREATE ******************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign ancReceipt = JsonUtil.jsonToMap(dataRfx)>
[
{
<#stop >
}
]
<#break>
<#case "U">
<#-- *********************************************** Action = UPDATE ******************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign ancReceipt = JsonUtil.jsonToMap(dataRfx)>
[
{
<#stop >
}
]
<#break>
<#case "D">
<#-- *********************************************** Action = DELETE ******************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign ancReceipt = JsonUtil.jsonToMap(dataRfx)>
[
{
<#stop >
}
]
<#break>
<#default>
<#stop >
</#switch>

View File

@@ -9,6 +9,7 @@
<#assign cloudEventMsg = JsonUtil.jsonToMap(input)>
<#assign projectRP = project>
<#assign organisationRP = organisation>
<#assign partnerApplicationRP = partnerApplication>
<#assign aDateTime = .now>
@@ -20,15 +21,49 @@
<#-- *********************************************** Action = CREATE or UPDATE ******************** -->
[
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.SiteForceBookAppointment>
<#assign apiReflexPlatformID = ApiReflexPlatformID.BookingForceBookAppointment>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrCarrierApt_SiteForceBookAppointment.ftl">
<#include "RFXtoRP_HsrCarrierApt_BookingForceBookAppointment.ftl">
},
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentCarrierExpected>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrCarrierApt_CarrierExpected.ftl">
}
]
<#break>
<#case "U">
<#-- *********************************************** Action = Update ********************-->
<#if carrier_apt.constant_appointment?? && carrier_apt.constant_appointment== "true">
<#if carrier_apt.appointment_reference?? && carrier_apt.appointment_reference!="">
<#assign ID = "${carrier_apt.appointment_reference?json_string}-${carrier_apt.year_number}-${carrier_apt.appointment_number}" />
<#else>
<#assign ID = "${carrier_apt.year_number}-${carrier_apt.appointment_number}" />
</#if>
<#else>
<#if carrier_apt.appointment_reference?? && carrier_apt.appointment_reference!="">
<#assign ID = "${carrier_apt.appointment_reference?json_string}" />
<#else>
<#assign ID = "${carrier_apt.year_number}-${carrier_apt.appointment_number}" />
</#if>
</#if>
<#assign payload = '{"Header": {"ProjectID": "${projectRP}:${RFXtoRPprefixDepot(carrier_apt.physical_depot?json_string)}"},"IDs": [{"RefID": "${ID}"}],"Options": {"Only": ["ID.RefID","Payload.WMSCreated"]}}'/>
<#assign queryApiReflexPlatformID = QueryApiReflexPlatformID.AppointmentGetByIds>
<#assign response = QueryApiReflexPlatformCall.call(queryApiReflexPlatformID,payload) />
<#assign appointmentRP = JsonUtil.jsonToMap(response)>
<#if !appointmentRP?? || !appointmentRP.Objects?? || !appointmentRP.Objects[0]?? || !appointmentRP.Objects[0].ID.RefID?? || !appointmentRP.Objects[0].Payload?? || !appointmentRP.Objects[0].Payload.WMSCreated?? || !appointmentRP.Objects[0].Payload.WMSCreated>
[
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.BookingForceBookAppointment>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrCarrierApt_BookingForceBookAppointment.ftl">
}
]
<#else>
[
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentCustomFieldsUpdated>
@@ -41,10 +76,10 @@
<#if carrier_apt.status?? && (carrier_apt.status.status_code=="999" || carrier_apt.status.status_code=="040" || carrier_apt.status.status_code=="030")>
[
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.SiteCancelAppointment>
<#assign apiReflexPlatformID = ApiReflexPlatformID.BookingCancelAppointment>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrCarrierApt_SiteCancelAppointment.ftl">
<#include "RFXtoRP_HsrCarrierApt_BookingCancelAppointment.ftl">
}
]
<#else>
@@ -85,6 +120,12 @@
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrCarrierApt_LoadingStarted.ftl">
},
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.AppointmentCarrierExpected>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrCarrierApt_CarrierExpected.ftl">
}
]
<#else>
@@ -110,10 +151,10 @@
<#else>
[
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.SiteWMSUpdateAppointment>
<#assign apiReflexPlatformID = ApiReflexPlatformID.BookingWMSUpdateAppointment>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrCarrierApt_UpdateAppointment.ftl">
<#include "RFXtoRP_HsrCarrierApt_BookingWMSUpdateAppointment.ftl">
}
]
</#if>
@@ -124,16 +165,17 @@
</#if>
</#if>
]
</#if>
<#break>
<#case "D">
<#-- *********************************************** Action = Delete ******************** -->
[
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.SiteCancelAppointment>
<#assign apiReflexPlatformID = ApiReflexPlatformID.BookingCancelAppointment>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrCarrierApt_SiteCancelAppointment.ftl">
<#include "RFXtoRP_HsrCarrierApt_BookingCancelAppointment.ftl">
}
]
<#break>

View File

@@ -7,20 +7,20 @@
"ID": {
<#if carrier_apt.constant_appointment?? && carrier_apt.constant_appointment== "true">
<#if carrier_apt.appointment_reference?? && carrier_apt.appointment_reference!="">
"RefID": "${carrier_apt.appointment_reference?json_string}-${carrier_apt.year_number}-${carrier_apt.appointment_number}",
"RefID": "${carrier_apt.appointment_reference?json_string}-${carrier_apt.year_number}-${carrier_apt.appointment_number}"
<#else>
"RefID": "${carrier_apt.year_number}-${carrier_apt.appointment_number}",
"RefID": "${carrier_apt.year_number}-${carrier_apt.appointment_number}"
</#if>
<#else>
<#if carrier_apt.appointment_reference?? && carrier_apt.appointment_reference!="">
"RefID": "${carrier_apt.appointment_reference?json_string}",
"RefID": "${carrier_apt.appointment_reference?json_string}"
<#else>
"RefID": "${carrier_apt.year_number}-${carrier_apt.appointment_number}",
"RefID": "${carrier_apt.year_number}-${carrier_apt.appointment_number}"
</#if>
</#if>
}
},
"Payload": {
"ActorID": "ActorID": "${RFXtoRPprefixDepot(carrier_apt.physical_depot?json_string)}",
"ActorID": "${RFXtoRPprefixDepot(carrier_apt.physical_depot?json_string)}",
<#--To configure-->
<#-- "CarrierInformation": [
{

View File

@@ -7,20 +7,20 @@
"ID": {
<#if carrier_apt.constant_appointment?? && carrier_apt.constant_appointment== "true">
<#if carrier_apt.appointment_reference?? && carrier_apt.appointment_reference!="">
"RefID": "${carrier_apt.appointment_reference?json_string}-${carrier_apt.year_number}-${carrier_apt.appointment_number}",
"RefID": "${carrier_apt.appointment_reference?json_string}-${carrier_apt.year_number}-${carrier_apt.appointment_number}"
<#else>
"RefID": "${carrier_apt.year_number}-${carrier_apt.appointment_number}",
"RefID": "${carrier_apt.year_number}-${carrier_apt.appointment_number}"
</#if>
<#else>
<#if carrier_apt.appointment_reference?? && carrier_apt.appointment_reference!="">
"RefID": "${carrier_apt.appointment_reference?json_string}",
"RefID": "${carrier_apt.appointment_reference?json_string}"
<#else>
"RefID": "${carrier_apt.year_number}-${carrier_apt.appointment_number}",
"RefID": "${carrier_apt.year_number}-${carrier_apt.appointment_number}"
</#if>
</#if>
}
},
"Payload": {
"ActorID": "ActorID": "${RFXtoRPprefixDepot(carrier_apt.physical_depot?json_string)}",
"ActorID": "${RFXtoRPprefixDepot(carrier_apt.physical_depot?json_string)}",
<#--To configure-->
<#-- "MetaData": [
{

View File

@@ -0,0 +1,58 @@
<#assign update_datetime = RfxDateTimetoUTCWithTimezone(carrier_apt.metadata.last_update_datetime,time_zone_rfx) />
[
{
"ID":{
<#if carrier_apt.constant_appointment?? && carrier_apt.constant_appointment== "true">
<#if carrier_apt.appointment_reference?? && carrier_apt.appointment_reference!="">
"RefID": "${carrier_apt.appointment_reference?json_string}-${carrier_apt.year_number}-${carrier_apt.appointment_number}",
<#else>
"RefID": "${carrier_apt.year_number}-${carrier_apt.appointment_number}",
</#if>
<#else>
<#if carrier_apt.appointment_reference?? && carrier_apt.appointment_reference!="">
"RefID": "${carrier_apt.appointment_reference?json_string}",
<#else>
"RefID": "${carrier_apt.year_number}-${carrier_apt.appointment_number}",
</#if>
</#if>
"RefDate": {
"DateTime": "${update_datetime}",
"AuthorTimeZone": "${time_zone_rfx}"
},
"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}"
},
{
"Key": "loading",
"Value": "${carrier_apt.load_appointment?json_string}"
},
{
"Key": "unloading",
"Value": "${carrier_apt.unloading_appointment?json_string}"
}
]
},
"Header": {
"ProjectID": "${projectRP}:${RFXtoRPprefixDepot(carrier_apt.physical_depot?json_string)}"
}
}
]

View File

@@ -0,0 +1,180 @@
[
<#assign creation_datetime = RfxDateTimetoUTCWithTimezone(carrier_apt.metadata.creation_datetime,time_zone_rfx) />
{
"Header":{
"ProjectID": "${projectRP}:${RFXtoRPprefixDepot(carrier_apt.physical_depot?json_string)}"
},
"ID":{
"RefDate": {
"DateTime": "${creation_datetime}",
"AuthorTimeZone": "${time_zone_rfx}"
},
<#if carrier_apt.constant_appointment?? && carrier_apt.constant_appointment== "true">
<#if carrier_apt.appointment_reference?? && carrier_apt.appointment_reference!="">
"RefID": "${carrier_apt.appointment_reference?json_string}-${carrier_apt.year_number}-${carrier_apt.appointment_number}",
<#else>
"RefID": "${carrier_apt.year_number}-${carrier_apt.appointment_number}",
</#if>
<#else>
<#if carrier_apt.appointment_reference?? && carrier_apt.appointment_reference!="">
"RefID": "${carrier_apt.appointment_reference?json_string}",
<#else>
"RefID": "${carrier_apt.year_number}-${carrier_apt.appointment_number}",
</#if>
</#if>
"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}"
},
{
"Key": "loading",
"Value": "${carrier_apt.load_appointment?json_string}"
},
{
"Key": "unloading",
"Value": "${carrier_apt.unloading_appointment?json_string}"
}
]
},
"Payload": {
"TimeZone":"${time_zone_rfx}",
<#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">
<#if carrier_apt.planned_load_end_datetime?starts_with("00") || carrier_apt.planned_load_end_datetime?contains("-00-") || carrier_apt.planned_unloading_start_datetime?starts_with("00") || carrier_apt.planned_unloading_start_datetime?contains("-00-") >
<#stop "planned_unloading_start_datetime or planned_load_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_load_end_datetime?datetime.iso) />
<#if (duration <= 0)>
<#stop "planned_unloading_start_datetime or planned_load_end_datetime field of appointmend are not valid" >
</#if>
<#else>
<#stop "Appointment type not supported" >
</#if>
</#if>
</#if>
"AppointmentType": "${appointmentType}",
"Emails": ["${carrier_apt.creation_user_email?json_string}"],
<#include "RFXtoRP_HsrCarrierApt_SegmentationSelections.ftl">,
<#include "RFXtoRP_HsrCarrierApt_CarrierInformation.ftl">,
<#include "RFXtoRP_HsrCarrierApt_MetadataAppointment.ftl">,
<#if carrier_apt.physical_receipt_list?? && (carrier_apt.physical_receipt_list?filter(l ->l??)?size != 0)>
"Unloading" :
{
"Projects" : [{
"Commissions": [
<#list carrier_apt.physical_receipt_list?filter(l ->l??) as physical_receipt>
{
"ActorID": "${RFXtoRPprefixDepot(carrier_apt.physical_depot?json_string)}",
<#if physical_receipt.physical_receipt_reference?? && physical_receipt.physical_receipt_reference!="">
"OrderID": "${physical_receipt.physical_receipt_reference?json_string}",
<#else>
"OrderID": "R${carrier_apt.physical_depot?json_string}${physical_receipt.receipt_activity?json_string}${physical_receipt.originator_code?json_string}${physical_receipt.receipt_year}${physical_receipt.receipt_number}",
</#if>
"ExecutionflowID": "R${carrier_apt.physical_depot?json_string}${physical_receipt.receipt_activity?json_string}${physical_receipt.originator_code?json_string}${physical_receipt.receipt_year?json_string}${physical_receipt.receipt_number?json_string}",
"ProjectID": "${projectRP}",
"PartnerAppID": "${partnerApplicationRP}",
"OrganisationID": "${organisationRP}"
}<#sep>,</#sep>
</#list>
],
"ProjectID" : "${projectRP}"
}]
},
<#else>
<#if appointmentType == AppointmentType.APPOINTMENT_TYPE_UNLOADING>
"Unloading" :
<#else>
"Loading" :
</#if>
{
"Projects" : [{
"Commissions": [{
"ActorID": "${RFXtoRPprefixDepot(carrier_apt.physical_depot?json_string)}",
"ProjectID": "${projectRP}",
"PartnerAppID": "${partnerApplicationRP}",
"OrganisationID": "${organisationRP}"
}],
"ProjectID" : "${projectRP}"
}]
},
<#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "true">
"Reason": "UNLOADING AND LOADING / ${carrier_apt.appointment_designation?json_string}",
<#else>
<#if carrier_apt.appointment_designation?? && carrier_apt.appointment_designation!="">
"Reason": "${carrier_apt.appointment_designation?json_string}",
<#else>
<#if carrier_apt.appointment_reference?? && carrier_apt.appointment_reference!="">
"Reason": "${carrier_apt.appointment_reference?json_string}",
<#else>
"Reason": "${carrier_apt.year_number}-${carrier_apt.appointment_number}",
</#if>
</#if>
</#if>
</#if>
"Slot": {
<#-- 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">
<#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>
<#stop "Appointment type not supported" >
</#if>
</#if>
</#if>
}
}
}
]

View File

@@ -1,23 +1,60 @@
[
{
<#assign update_datetime = RfxDateTimetoUTCWithTimezone(carrier_apt.metadata.last_update_datetime,time_zone_rfx) />
"Header":{
"ProjectID": "${projectRP}"
"ProjectID": "${projectRP}:${RFXtoRPprefixDepot(carrier_apt.physical_depot?json_string)}"
},
"ID":{
"RefDate": {
"DateTime": "${update_datetime}",
"AuthorTimeZone": "${time_zone_rfx}"
},
"ActorID": "${RFXtoRPprefixDepot(carrier_apt.physical_depot?json_string)}",
<#if carrier_apt.constant_appointment?? && carrier_apt.constant_appointment== "true">
<#if carrier_apt.appointment_reference?? && carrier_apt.appointment_reference!="">
"AppointmentID": "${carrier_apt.appointment_reference?json_string}-${carrier_apt.year_number}-${carrier_apt.appointment_number}",
"RefID": "${carrier_apt.appointment_reference?json_string}-${carrier_apt.year_number}-${carrier_apt.appointment_number}",
<#else>
"AppointmentID": "${carrier_apt.year_number}-${carrier_apt.appointment_number}",
"RefID": "${carrier_apt.year_number}-${carrier_apt.appointment_number}",
</#if>
<#else>
<#if carrier_apt.appointment_reference?? && carrier_apt.appointment_reference!="">
"AppointmentID": "${carrier_apt.appointment_reference?json_string}",
"RefID": "${carrier_apt.appointment_reference?json_string}",
<#else>
"AppointmentID": "${carrier_apt.year_number}-${carrier_apt.appointment_number}",
"RefID": "${carrier_apt.year_number}-${carrier_apt.appointment_number}",
</#if>
</#if>
"TimeZone":"${time_zone_rfx}",
"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}"
},
{
"Key": "loading",
"Value": "${carrier_apt.load_appointment?json_string}"
},
{
"Key": "unloading",
"Value": "${carrier_apt.unloading_appointment?json_string}"
}
]
},
"Payload": {
<#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" >
@@ -48,47 +85,16 @@
<#stop "planned_unloading_start_datetime or planned_load_end_datetime field of appointmend are not valid" >
</#if>
<#else>
<#assign appointmentType = AppointmentType.APPOINTMENT_TYPE_UNKNOWN>
<#assign duration = 0 />
<#stop "Appointment type not supported" >
</#if>
</#if>
</#if>
"AppointmentType": "${appointmentType}",
"Emails": ["${carrier_apt.creation_user_email?json_string}"],
"CustomFields": [
"TimeZone":"${time_zone_rfx}",
<#if carrier_apt.physical_receipt_list?? && (carrier_apt.physical_receipt_list?filter(l ->l??)?size != 0) && ((carrier_apt.unloading_appointment =="true" && carrier_apt.load_appointment =="false") || (carrier_apt.unloading_appointment =="false" && carrier_apt.load_appointment =="true"))>
"Unloading" :
{
"Key": "depot",
"Value": "${carrier_apt.physical_depot?json_string}"
},
"Projects" : [
{
"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}"
},
{
"Key": "loading",
"Value": "${carrier_apt.load_appointment?json_string}"
},
{
"Key": "unloading",
"Value": "${carrier_apt.unloading_appointment?json_string}"
}
],
<#include "RFXtoRP_HsrCarrierApt_SegmentationSelections.ftl">,
<#include "RFXtoRP_HsrCarrierApt_CarrierInformation.ftl">,
<#include "RFXtoRP_HsrCarrierApt_MetadataAppointment.ftl">,
<#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>
{
@@ -100,18 +106,51 @@
</#if>
"ExecutionflowID": "R${carrier_apt.physical_depot?json_string}${physical_receipt.receipt_activity?json_string}${physical_receipt.originator_code?json_string}${physical_receipt.receipt_year?json_string}${physical_receipt.receipt_number?json_string}",
"ProjectID": "${projectRP}",
<#include "RFXtoRP_HsrCarrierApt_Quantities.ftl">
"PartnerAppID": "${partnerApplicationRP}",
"OrganisationID": "${organisationRP}"
}<#sep>,</#sep>
</#list>
],
"ProjectID" : "${projectRP}"
}]
},
"Reason": "",
<#else>
<#if appointmentType == AppointmentType.APPOINTMENT_TYPE_LOADING>
"Loading" :
{
"Projects" : [
{
"Commissions": [
{
"ActorID": "${RFXtoRPprefixDepot(carrier_apt.physical_depot?json_string)}",
"ProjectID": "${projectRP}",
<#include "RFXtoRP_HsrCarrierApt_Quantities.ftl">
"PartnerAppID": "${partnerApplicationRP}",
"OrganisationID": "${organisationRP}"
}
],
"ProjectID" : "${projectRP}"
}]
},
<#else>
<#if appointmentType == AppointmentType.APPOINTMENT_TYPE_UNLOADING>
"Unloading" :
{
"Projects" : [
{
"Commissions": [
{
"ActorID": "${RFXtoRPprefixDepot(carrier_apt.physical_depot?json_string)}",
"ProjectID": "${projectRP}",
"PartnerAppID": "${partnerApplicationRP}",
"OrganisationID": "${organisationRP}"
}
],
"ProjectID" : "${projectRP}"
}]
},
</#if>
</#if>
<#if carrier_apt.unloading_appointment == "true" && carrier_apt.load_appointment == "true">
"Reason": "UNLOADING AND LOADING / ${carrier_apt.appointment_designation?json_string}",
<#else>
@@ -126,7 +165,7 @@
</#if>
</#if>
</#if>
"Slots": [{
"Slot": {
<#-- 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" >
@@ -151,6 +190,7 @@
</#if>
</#if>
</#if>
}]
}
}
}
]

View File

@@ -0,0 +1,31 @@
[
<#assign ref_datetime = RfxDateTimetoUTCWithTimezone(carrier_apt.metadata.creation_datetime,time_zone_rfx) />
<#assign ref_datetime2 = AddSecondsToDatetime(ref_datetime?datetime.iso, 60)?iso_utc />
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
<#if carrier_apt.constant_appointment?? && carrier_apt.constant_appointment== "true">
<#if carrier_apt.appointment_reference?? && carrier_apt.appointment_reference!="">
"RefID": "${carrier_apt.appointment_reference?json_string}-${carrier_apt.year_number}-${carrier_apt.appointment_number}",
<#else>
"RefID": "${carrier_apt.year_number}-${carrier_apt.appointment_number}",
</#if>
<#else>
<#if carrier_apt.appointment_reference?? && carrier_apt.appointment_reference!="">
"RefID": "${carrier_apt.appointment_reference?json_string}",
<#else>
"RefID": "${carrier_apt.year_number}-${carrier_apt.appointment_number}",
</#if>
</#if>
"RefDate": {
"DateTime": "${ref_datetime2}",
"AuthorTimeZone": "${time_zone_rfx}"
}
},
"Payload":{
"ActorID": "${RFXtoRPprefixDepot(carrier_apt.physical_depot?json_string)}"
}
}
]

View File

@@ -1,5 +0,0 @@
"Quantities": [
]

View File

@@ -24,12 +24,6 @@
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrPro_ExecutionflowDetected.ftl">
},
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCustomFieldsUpdated>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrPro_ExecutionflowCustomFieldsUpdated.ftl">
}
<#else>
<#-- No line -->

View File

@@ -1,44 +0,0 @@
<#include "HfRpConfig.ftl">
<#include "ReflexUtils.ftl">
<#include "ActorPrefix.ftl">
[
{
"Header": {
"ProjectID": "${projectRP}"
},
"Payload" :{},
"ID":{
"CustomFields": [
{
"Key": "depot_code",
"Value": "${preparation_order.physical_depot_code?trim?json_string}"
},
{
"Key": "activity_code",
"Value": "${preparation_order.activity_code?trim?json_string}"
},
{
"Key": "originator_code",
"Value": "${preparation_order.originator_code?trim?json_string}"
},
{
"Key": "reference",
"Value": "${preparation_order.originator_reference?trim?json_string}"
},
{
"Key": "order_year",
"Value": "${preparation_order.preparation_order_year}"
},
{
"Key": "order_number",
"Value": "${preparation_order.preparation_order_number}"
}
],
<#if preparation_order.originator_reference?? && preparation_order.originator_reference!="">
"RefID": "${preparation_order.physical_depot_code?trim?json_string}${preparation_order.activity_code?trim?json_string}${preparation_order.originator_code?trim?json_string}${preparation_order.originator_reference?trim?json_string}"
<#else>
"RefID": "O${preparation_order.physical_depot_code?trim?json_string}${preparation_order.activity_code?trim?json_string}${preparation_order.originator_code?trim?json_string}${preparation_order.preparation_order_year}${preparation_order.preparation_order_number}"
</#if>
}
}
]

View File

@@ -79,6 +79,7 @@
<#else>
"Actor":
{
<#include "RFXtoRP_HsrPro_ExecutionflowDetected_ShipToMetadata.ftl">,
"Name" : "${(preparation_order.address.name_or_company_name!"")?json_string}",
"Address" :
{

View File

@@ -0,0 +1,10 @@
<#-- use protobuf of class HsrPro to find HARDIS WMS fields names -->
<#-- Best practices:
If the SK is of type:
- string: add ?json_string (e.g. "${stock.batch_1?json_string}")
- boolean: possible values: true and false
- datetime: expected format: 2025-10-30T10:12:10.000Z
- decimal number: the separator is a point (e.g. 10.5)-->
"MetaData": [ ]

View File

@@ -15,7 +15,7 @@
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign receipt = JsonUtil.jsonToMap(dataRfx)>
<#if receipt.receipt_type?? && receipt.receipt_type = "030" && receipt.line_list??> <#-- if reception is a transfer type -->
<#if receipt.receipt_type?? && receipt.receipt_type = "030" && receipt.line_list?? && receipt.line_list[0]?? > <#-- if reception is a transfer type -->
[
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected>
@@ -29,16 +29,10 @@
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrReceiptList_TransfertReceiptExpected.ftl">
},
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCustomFieldsUpdated>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrReceiptList_TransfertCustomFieldsUpdated.ftl">
}
]
<#else>
<#if receipt.line_list ??>
<#if receipt.line_list ?? && receipt.line_list[0]??>
[
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected>
@@ -52,12 +46,6 @@
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrReceiptList_ReceiptExpected.ftl">
},
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCustomFieldsUpdated>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrReceiptList_CustomFieldsUpdated.ftl">
}
]
<#else>
@@ -79,12 +67,40 @@
}
<#else>
<#if receipt.receipt_type?? && receipt.receipt_type == "030" && receipt.receipt_confirmed == "true">
<#if receipt.origin_order_line_depot?? && receipt.origin_order_line_depot!="" && receipt.receipt_reference?? && receipt.receipt_reference!="">
<#assign ID = "${receipt.origin_order_line_depot?trim?json_string}${receipt.activity_code?trim?json_string}${receipt.originator_code?trim?json_string}${receipt.receipt_reference?trim?json_string}"/>
<#else>
<#if receipt.receipt_reference?? && receipt.receipt_reference!="">
<#assign ID = "${receipt.physical_depot_code?trim?json_string}${receipt.activity_code?trim?json_string}${receipt.originator_code?trim?json_string}${receipt.receipt_reference?trim?json_string}"/>
<#else>
<#assign ID = "R${receipt.physical_depot_code?trim?json_string}${receipt.activity_code?trim?json_string}${receipt.originator_code?trim?json_string}${receipt.receipt_year}${receipt.receipt_number}"/>
</#if>
</#if>
<#assign payload = '{"Header": {"ProjectID": "${projectRP!""}"},"IDs": [{"RefID": "${ID}"}]}' />
<#assign queryApiReflexPlatformID = QueryApiReflexPlatformID.OrderGetByIds>
<#assign response = QueryApiReflexPlatformCall.call(queryApiReflexPlatformID,payload) />
<#assign orderRP = JsonUtil.jsonToMap(response)>
<#if orderRP?? && orderRP.Objects?? && orderRP.Objects[0]?? && orderRP.Objects[0].ID.RefID?? >
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowReceiptCompleted>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrReceiptList_TransfertExecutionflowReceiptCompleted.ftl">
}
<#else>
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrReceiptList_TransfertExecutionflowDetected.ftl">
},
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowReceiptCompleted>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrReceiptList_TransfertExecutionflowReceiptCompleted.ftl">
}
</#if>
<#else>
<#if receipt.receipt_confirmed?? && receipt.receipt_confirmed == "true" && receipt.confirmation_total_level_1==0 && receipt.confirmation_total_level_2==0 && receipt.confirmation_total_level_3==0>
{
@@ -95,6 +111,12 @@
}
<#else>
<#if receipt.receipt_confirmed ?? && receipt.receipt_confirmed == "true" >
<#assign ID = "R${receipt.physical_depot_code?trim?json_string}${receipt.activity_code?trim?json_string}${receipt.originator_code?trim?json_string}${receipt.receipt_year}${receipt.receipt_number}"/>
<#assign payload = '{"Header": {"ProjectID": "${projectRP!""}"},"IDs": [{"RefID": "${ID}"}]}'/>
<#assign queryApiReflexPlatformID = QueryApiReflexPlatformID.OrderGetByIds>
<#assign response = QueryApiReflexPlatformCall.call(queryApiReflexPlatformID,payload) />
<#assign orderRP = JsonUtil.jsonToMap(response)>
<#if orderRP?? && orderRP.Objects?? && orderRP.Objects[0]?? && orderRP.Objects[0].ID.RefID?? >
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowReceiptCompleted>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
@@ -102,7 +124,21 @@
<#include "RFXtoRP_HsrReceiptList_ExecutionflowReceiptCompleted.ftl">
}
<#else>
<#if receipt.receipt_type?? && receipt.receipt_type == "030" && receipt.receipt_confirmed == "false" && receipt.line_list??>
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl">
},
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowReceiptCompleted>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrReceiptList_ExecutionflowReceiptCompleted.ftl">
}
</#if>
<#else>
<#if receipt.receipt_type?? && receipt.receipt_type == "030" && receipt.receipt_confirmed == "false" && receipt.line_list?? && receipt.line_list[0]??>
<#if receipt.receipt_reference?? && receipt.receipt_reference!="">
[
{
@@ -110,21 +146,19 @@
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrReceiptList_TransfertExecutionflowDetected.ftl">
},
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowReceiptExpected>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrReceiptList_TransfertReceiptExpected.ftl">
}
]
<#else>
<#stop> <#-- Receipt reference for transfer is empty-->
</#if>
<#else>
<#if receipt.line_list ??>
<#if receipt.line_list ?? && receipt.line_list[0]??>
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected>
"apiReflexPlatformID" : "${apiReflexPlatformID}",

View File

@@ -1,40 +0,0 @@
<#include "HfRpConfig.ftl">
<#include "ReflexUtils.ftl">
<#include "ActorPrefix.ftl">
[
{
"Header": {
"ProjectID": "${projectRP}"
},
"Payload" :{},
"ID":{
"CustomFields": [
{
"Key": "depot_code",
"Value": "${receipt.physical_depot_code?trim?json_string}"
},
{
"Key": "activity_code",
"Value": "${receipt.activity_code?trim?json_string}"
},
{
"Key": "originator_code",
"Value": "${receipt.originator_code?trim?json_string}"
},
{
"Key": "reference",
"Value": "${receipt.receipt_reference?trim?json_string}"
},
{
"Key": "order_year",
"Value": "${receipt.receipt_year}"
},
{
"Key": "order_number",
"Value": "${receipt.receipt_number}"
}
],
"RefID": "R${receipt.physical_depot_code?trim?json_string}${receipt.activity_code?trim?json_string}${receipt.originator_code?trim?json_string}${receipt.receipt_year}${receipt.receipt_number}"
}
}
]

View File

@@ -1,48 +0,0 @@
<#include "HfRpConfig.ftl">
<#include "ReflexUtils.ftl">
<#include "ActorPrefix.ftl">
[
{
"Header": {
"ProjectID": "${projectRP}"
},
"Payload" :{},
"ID":{
"CustomFields": [
{
"Key": "depot_code",
<#if receipt.origin_order_line_depot?? && receipt.origin_order_line_depot!="">
"Value": "${receipt.origin_order_line_depot?trim?json_string}"
<#else>
"Value": "${receipt.physical_depot_code?trim?json_string}"
</#if>
},
{
"Key": "activity_code",
"Value": "${receipt.activity_code?trim?json_string}"
},
{
"Key": "originator_code",
"Value": "${receipt.originator_code?trim?json_string}"
},
{
"Key": "reference",
"Value": "${receipt.receipt_reference?trim?json_string}"
},
{
"Key": "order_year",
"Value": "${receipt.receipt_year}"
},
{
"Key": "order_number",
"Value": "${receipt.receipt_number}"
}
],
<#if receipt.origin_order_line_depot?? && receipt.origin_order_line_depot!="">
"RefID": "${receipt.origin_order_line_depot?trim?json_string}${receipt.activity_code?trim?json_string}${receipt.originator_code?trim?json_string}${receipt.receipt_reference?trim?json_string}"
<#else>
"RefID": "R${receipt.physical_depot_code?trim?json_string}${receipt.activity_code?trim?json_string}${receipt.originator_code?trim?json_string}${receipt.receipt_year}${receipt.receipt_number}"
</#if>
}
}
]

View File

@@ -7,10 +7,14 @@
{
"Header": {"ProjectID": "${projectRP}"},
"ID": {
<#if receipt.origin_order_line_depot?? && receipt.origin_order_line_depot!="">
<#if receipt.origin_order_line_depot?? && receipt.origin_order_line_depot!="" && receipt.receipt_reference?? && receipt.receipt_reference!="">
"RefID": "${receipt.origin_order_line_depot?trim?json_string}${receipt.activity_code?trim?json_string}${receipt.originator_code?trim?json_string}${receipt.receipt_reference?trim?json_string}",
<#else>
<#if receipt.receipt_reference?? && receipt.receipt_reference!="">
"RefID": "${receipt.physical_depot_code?trim?json_string}${receipt.activity_code?trim?json_string}${receipt.originator_code?trim?json_string}${receipt.receipt_reference?trim?json_string}",
<#else>
"RefID": "R${receipt.physical_depot_code?trim?json_string}${receipt.activity_code?trim?json_string}${receipt.originator_code?trim?json_string}${receipt.receipt_year}${receipt.receipt_number}",
</#if>
</#if>
"RefDate": {
"DateTime": "${receipt_status_datetime}",

View File

@@ -39,11 +39,15 @@
"Value": "${receipt.receipt_number}"
}
],
<#if receipt.origin_order_line_depot?? && receipt.origin_order_line_depot!="">
<#if receipt.origin_order_line_depot?? && receipt.origin_order_line_depot!="" && receipt.receipt_reference?? && receipt.receipt_reference!="">
"RefID": "${receipt.origin_order_line_depot?trim?json_string}${receipt.activity_code?trim?json_string}${receipt.originator_code?trim?json_string}${receipt.receipt_reference?trim?json_string}",
<#else>
<#if receipt.receipt_reference?? && receipt.receipt_reference!="">
"RefID": "${receipt.physical_depot_code?trim?json_string}${receipt.activity_code?trim?json_string}${receipt.originator_code?trim?json_string}${receipt.receipt_reference?trim?json_string}",
<#else>
"RefID": "R${receipt.physical_depot_code?trim?json_string}${receipt.activity_code?trim?json_string}${receipt.originator_code?trim?json_string}${receipt.receipt_year}${receipt.receipt_number}",
</#if>
</#if>
"RefDate": {
"DateTime": "${receipt_creation_datetime}",
"AuthorTimeZone": "${time_zone_rfx}"
@@ -54,7 +58,7 @@
"DateTime": "${receipt_creation_datetime}",
"AuthorTimeZone": "${time_zone_rfx}"
},
<#if receipt.origin_order_line_depot?? && receipt.origin_order_line_depot!="">
<#if receipt.receipt_reference?? && receipt.receipt_reference!="">
"OrderID": "${receipt.receipt_reference?trim?json_string}",
<#else>
"OrderID": "R${receipt.physical_depot_code?trim?json_string}${receipt.activity_code?trim?json_string}${receipt.originator_code?trim?json_string}${receipt.receipt_year}${receipt.receipt_number}",
@@ -233,7 +237,7 @@
"DateTime": "${receipt_creation_datetime}",
"AuthorTimeZone": "${time_zone_rfx}"
},
"OrderID":"${receipt.physical_depot_code?trim?json_string}${receipt.activity_code?trim?json_string}${receipt.originator_code?trim?json_string}${receipt.receipt_year?trim?json_string}${receipt.receipt_number?trim?json_string}",
"OrderID":"R${receipt.physical_depot_code?trim?json_string}${receipt.activity_code?trim?json_string}${receipt.originator_code?trim?json_string}${receipt.receipt_year?trim?json_string}${receipt.receipt_number?trim?json_string}",
<#-- Header Metadata inclusion -->
<#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_HeaderMetadata.ftl">,
"ShipFrom":

View File

@@ -7,10 +7,14 @@
{
"Header": {"ProjectID": "${projectRP}"},
"ID": {
<#if receipt.origin_order_line_depot?? && receipt.origin_order_line_depot!="">
<#if receipt.origin_order_line_depot?? && receipt.origin_order_line_depot!="" && receipt.receipt_reference?? && receipt.receipt_reference!="">
"RefID": "${receipt.origin_order_line_depot?trim?json_string}${receipt.activity_code?trim?json_string}${receipt.originator_code?trim?json_string}${receipt.receipt_reference?trim?json_string}",
<#else>
<#if receipt.receipt_reference?? && receipt.receipt_reference!="">
"RefID": "${receipt.physical_depot_code?trim?json_string}${receipt.activity_code?trim?json_string}${receipt.originator_code?trim?json_string}${receipt.receipt_reference?trim?json_string}",
<#else>
"RefID": "R${receipt.physical_depot_code?trim?json_string}${receipt.activity_code?trim?json_string}${receipt.originator_code?trim?json_string}${receipt.receipt_year}${receipt.receipt_number}",
</#if>
</#if>
"RefDate": {
"DateTime": "${receipt_status_datetime}",

View File

@@ -7,10 +7,14 @@
{
"Header": {"ProjectID": "${projectRP}"},
"ID": {
<#if receipt.origin_order_line_depot?? && receipt.origin_order_line_depot!="">
<#if receipt.origin_order_line_depot?? && receipt.origin_order_line_depot!="" && receipt.receipt_reference?? && receipt.receipt_reference!="">
"RefID": "${receipt.origin_order_line_depot?trim?json_string}${receipt.activity_code?trim?json_string}${receipt.originator_code?trim?json_string}${receipt.receipt_reference?trim?json_string}",
<#else>
<#if receipt.receipt_reference?? && receipt.receipt_reference!="">
"RefID": "${receipt.physical_depot_code?trim?json_string}${receipt.activity_code?trim?json_string}${receipt.originator_code?trim?json_string}${receipt.receipt_reference?trim?json_string}",
<#else>
"RefID": "R${receipt.physical_depot_code?trim?json_string}${receipt.activity_code?trim?json_string}${receipt.originator_code?trim?json_string}${receipt.receipt_year}${receipt.receipt_number}",
</#if>
</#if>
"RefDate": {
"DateTime": "${receipt_status_datetime}",

View File

@@ -8,11 +8,20 @@
<#assign projectRP = project>
<#assign organisationRP = organisation>
<<<<<<< HEAD
=======
>>>>>>> develop
<#assign aDateTime = .now>
<#assign no_apiRestReflexID = "no apiRestReflexID">
<#assign no_status = -99999>
<#assign event = "UNKNOW_EVENT" >
<<<<<<< HEAD
=======
<#-- DeleteEF_False a définir dans ce fichier -->
<#-- DeleteEF_False to be defined in this file.-->
<#include "InternalSettings.ftl">
>>>>>>> develop
<#switch id.apiRestReflexID!no_apiRestReflexID>
<#case no_apiRestReflexID>
@@ -59,6 +68,7 @@
<#case 201>
<#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) />
<#assign preparationOrderPostResponse = JsonUtil.jsonToMap(restResponseBody)>
<<<<<<< HEAD
<#if preparationOrderPostResponse.status?? && preparationOrderPostResponse.status == "SUCCESS" >
[
{
@@ -70,6 +80,10 @@
]
<#else>
<#if preparationOrderPostResponse.status?? && preparationOrderPostResponse.status == "WARN">
=======
<#if preparationOrderPostResponse.status?? && (preparationOrderPostResponse.status == "SUCCESS" || preparationOrderPostResponse.status == "WARN") >
<#if DeleteEF_False>
>>>>>>> develop
[
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowShipFromAcked>
@@ -81,6 +95,33 @@
<#else>
[
{
<<<<<<< HEAD
<#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) />
<#assign apiReflexPlatformID = ApiReflexPlatformID.PlatformLogCreate>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#assign event = "RP_EXECUTIONFLOW_EVENT">
<#include "RFXtoRP_PlatformLogCreate.ftl">
},
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowAllocationError>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_RestResponseAllocationError.ftl">
}
]
</#if>
=======
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDeleted>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_ExecutionflowDeleted.ftl">
}
]
</#if>
<#else>
[
{
<#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) />
<#assign apiReflexPlatformID = ApiReflexPlatformID.PlatformLogCreate>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
@@ -95,7 +136,7 @@
<#include "RFXtoRP_RestResponseAllocationError.ftl">
}
]
</#if>
>>>>>>> develop
</#if>
<#break>
<#default>
@@ -156,7 +197,7 @@
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDeleted>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_Receipt_ExecutionflowDeleted.ftl">
<#include "RFXtoRP_ExecutionflowDeleted.ftl">
}
]
<#else>

View File

@@ -28,8 +28,16 @@
<#assign AddComma = false />
<#assign appointment = eventRP.data />
[
<#if appointment?? && (!(appointment.WMSCreated??) || !appointment.WMSCreated) && appointment.Status?? && appointment.Status.Current?? && appointment.Status.Current.StatusCode?? && appointment.Status.Current.StatusCode == AppointmentStatusCode.APPOINTMENT_0150_ALLOCATION_ERROR>
{
<#assign apiRestReflexID = ApiRestReflexID.appointment_post_create>
"apiRestReflexID" : "${apiRestReflexID}",
"datas" :
<#include "RPtoRFX_CarrierAppointmentCreated.ftl">
}
<#else>
<#if eventRP.commissionsUpdated>
<#if appointment.AppointmentType == "APPOINTMENT_TYPE_UNLOADING" && eventRP.addedCommissions?? && eventRP.addedCommissions != "">
<#if appointment.AppointmentType == AppointmentType.APPOINTMENT_TYPE_UNLOADING && eventRP.addedUnloadCommissions?? && eventRP.addedUnloadCommissions != "">
<#if eventRP.appointmentCustomFields?has_content>
{
<#assign apiRestReflexID = ApiRestReflexID.appointment_post_physical_receipt_associations_by_number>
@@ -47,7 +55,7 @@
</#if>
<#assign AddComma = true />
</#if>
<#if appointment.AppointmentType == "APPOINTMENT_TYPE_UNLOADING" && eventRP.removedCommissions?? && eventRP.removedCommissions!="">
<#if appointment.AppointmentType == AppointmentType.APPOINTMENT_TYPE_UNLOADING && eventRP.removedUnloadCommissions?? && eventRP.removedUnloadCommissions!="">
<#if AddComma == true>
,
</#if>
@@ -70,7 +78,7 @@
<#assign AddComma = true />
</#if>
</#if>
<#-- *********************************************** Action = reasonUpdated or slotUpdated ******************** -->
<#-- *********************************************** Action = reasonUpdated or slotUpdated ******************** -->
<#if eventRP.reasonUpdated || eventRP.slotUpdated || eventRP.carrierInformationUpdated>
<#if AddComma == true>
,
@@ -92,6 +100,7 @@
</#if>
<#assign AddComma = true />
</#if>
</#if>
]
<#break>
<#-- *********************************************** Action = Canceled ******************** -->

View File

@@ -9,7 +9,7 @@
{
"appointment_reference": "${eventRP.refid?json_string}",
<#switch appointment.AppointmentType>
<#case "APPOINTMENT_TYPE_LOADING">
<#case AppointmentType.APPOINTMENT_TYPE_LOADING>
"unloading_appointment" : "false",
"load_appointment" : "true",
<#if appointment.TimeZone?? && appointment.TimeZone!="">
@@ -20,7 +20,7 @@
"planned_load_end_datetime": "${DateTimeUTCtoRfxLocale(RfxDateTimetoUTCWithTimezone(appointment.Slot.EndDateTime,time_zone_rfx),time_zone_rfx)}",
</#if>
<#break>
<#case "APPOINTMENT_TYPE_UNLOADING">
<#case AppointmentType.APPOINTMENT_TYPE_UNLOADING>
"unloading_appointment" : "true",
"load_appointment" : "false",
<#if appointment.TimeZone?? && appointment.TimeZone!="">
@@ -35,31 +35,33 @@
<#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!="">
<#if appointment.AppointmentType == AppointmentType.APPOINTMENT_TYPE_UNLOADING >
<#if appointment.Unloading?? && appointment.Unloading.Projects?? && appointment.Unloading.Projects[0]?? &&
appointment.Unloading.Projects[0].Commissions?? &&
appointment.Unloading.Projects[0].Commissions[0]?? && appointment.Unloading.Projects[0].Commissions[0].ExecutionflowID?? && appointment.Unloading.Projects[0].Commissions[0].ExecutionflowID!="" >
"physical_receipt_list": [
<#list eventRP.executionflowCustomFields.entrySet()?filter(l ->l.value?? && l.value?has_content) as custom>
<#list appointment.Unloading.Projects[0].Commissions?filter(l ->l.ExecutionflowID?? && l.ExecutionflowID !="") as commission>
<#list eventRP.executionflowCustomFields.entrySet()?filter(l ->l.key == commission.ExecutionflowID && 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>
<#sep>,</#sep>
</#list>
],
<#else>
"appointment_designation":"${(appointment.Reason!"")!?json_string}",
</#if>
<#else>
<#if appointment.AppointmentType == "APPOINTMENT_TYPE_LOADING">
<#if appointment.AppointmentType == AppointmentType.APPOINTMENT_TYPE_LOADING>
"appointment_designation":"${(appointment.Reason!"")?json_string}",
</#if>
</#if>
</#if>
"constant_appointment": "false"
}
}

View File

@@ -19,3 +19,23 @@
Int : .Int
String : .String
-->
<#-- Note : you can send url path of appointment to WMS, using this below code -->
<#--
<#assign appointmentPathURL = JsonUtil.getAppointmentPathURL(eventRP.site,eventRP.refid)>
<#assign payLoad = '{ "Header": {"ProjectID": "${projectRP!""}"},"IsOnce": false,"IsPublic": true,"TimeToLive": "0","URL": "${appointmentPathURL}"}' />
<#assign projectGetTinyURL = QueryApiReflexPlatformID.ProjectGetTinyURL>
<#assign response = QueryApiReflexPlatformCall.call(projectGetTinyURL,payLoad) />
<#assign tinyURL = JsonUtil.jsonToMap(response)>
<#if tinyURL?? && tinyURL.TinyURL?? >
"comment_list": [
{
"line_number": 1,
"group_code": "SCN",
"text": "${tinyURL.TinyURL.URL?json_string}"
}
],
</#if>
-->

View File

@@ -10,8 +10,14 @@
"payload" :
{
<#assign executionflowCustomFields = eventRP.executionflowCustomFields >
<#if appointment.AppointmentType == AppointmentType.APPOINTMENT_TYPE_UNLOADING>
<#assign addedCommissions = eventRP.addedUnloadCommissions />
<#else>
<#assign addedCommissions = eventRP.addedLoadCommissions />
</#if>
"physical_receipt_list": [
<#list eventRP.addedCommissions as addedCommission>
<#list addedCommissions?filter(l -> l.ExecutionflowID??) as addedCommission>
{
"receipt_activity": "${executionflowCustomFields[addedCommission.ExecutionflowID].activity_code?json_string}",
"originator_code": "${executionflowCustomFields[addedCommission.ExecutionflowID].originator_code?json_string}",

View File

@@ -9,8 +9,14 @@
"payload" :
{
<#assign executionflowCustomFields = eventRP.executionflowCustomFields >
<#if appointment.AppointmentType == AppointmentType.APPOINTMENT_TYPE_UNLOADING>
<#assign addedCommissions = eventRP.addedUnloadCommissions />
<#else>
<#assign addedCommissions = eventRP.addedLoadCommissions />
</#if>
"physical_receipt_list": [
<#list eventRP.addedCommissions as addedCommission>
<#list addedCommissions?filter(l -> l.ExecutionflowID??) as addedCommission>
{
"receipt_activity": "${executionflowCustomFields[addedCommission.ExecutionflowID].activity_code?json_string}",
"originator_code": "${executionflowCustomFields[addedCommission.ExecutionflowID].originator_code?json_string}",

View File

@@ -10,8 +10,14 @@
"payload" :
{
<#assign executionflowCustomFields = eventRP.executionflowCustomFields >
<#if appointment.AppointmentType == AppointmentType.APPOINTMENT_TYPE_UNLOADING>
<#assign removedCommissions = eventRP.removedUnloadCommissions />
<#else>
<#assign removedCommissions = eventRP.removedLoadCommissions />
</#if>
"physical_receipt_list": [
<#list eventRP.removedCommissions as removedCommission>
<#list removedCommissions?filter(l -> l.ExecutionflowID??) as removedCommission>
{
"receipt_activity": "${executionflowCustomFields[removedCommission.ExecutionflowID].activity_code?json_string}",
"originator_code": "${executionflowCustomFields[removedCommission.ExecutionflowID].originator_code?json_string}",

View File

@@ -9,8 +9,14 @@
"payload" :
{
<#assign executionflowCustomFields = eventRP.executionflowCustomFields >
<#if appointment.AppointmentType == AppointmentType.APPOINTMENT_TYPE_UNLOADING>
<#assign removedCommissions = eventRP.removedUnloadCommissions />
<#else>
<#assign removedCommissions = eventRP.removedLoadCommissions />
</#if>
"physical_receipt_list": [
<#list eventRP.removedCommissions as removedCommission>
<#list removedCommissions?filter(l -> l.ExecutionflowID??) as removedCommission>
{
"receipt_activity": "${executionflowCustomFields[removedCommission.ExecutionflowID].activity_code?json_string}",
"originator_code": "${executionflowCustomFields[removedCommission.ExecutionflowID].originator_code?json_string}",

View File

@@ -9,10 +9,10 @@
},
"payload" :
{
"unloading_appointment" : "${eventRP.appointmentCustomFields.unloading?json_string}",
"load_appointment" : "${eventRP.appointmentCustomFields.loading?json_string}",
"unloading_appointment" : "${eventRP.appointmentCustomFields.unloading!"false"?json_string}",
"load_appointment" : "${eventRP.appointmentCustomFields.loading!"false"?json_string}",
<#switch appointment.AppointmentType>
<#case "APPOINTMENT_TYPE_LOADING">
<#case AppointmentType.APPOINTMENT_TYPE_LOADING>
<#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)}",
@@ -21,7 +21,7 @@
"planned_load_end_datetime": "${DateTimeUTCtoRfxLocale(RfxDateTimetoUTCWithTimezone(appointment.Slot.EndDateTime,time_zone_rfx),time_zone_rfx)}",
</#if>
<#break>
<#case "APPOINTMENT_TYPE_UNLOADING">
<#case AppointmentType.APPOINTMENT_TYPE_UNLOADING>
<#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)}",

View File

@@ -9,7 +9,7 @@
"payload" :
{
<#switch appointment.AppointmentType>
<#case "APPOINTMENT_TYPE_LOADING">
<#case AppointmentType.APPOINTMENT_TYPE_LOADING>
"unloading_appointment" : "false",
"load_appointment" : "true",
<#if appointment.TimeZone?? && appointment.TimeZone!="">
@@ -20,7 +20,7 @@
"planned_load_end_datetime": "${DateTimeUTCtoRfxLocale(RfxDateTimetoUTCWithTimezone(appointment.Slot.EndDateTime,time_zone_rfx),time_zone_rfx)}",
</#if>
<#break>
<#case "APPOINTMENT_TYPE_UNLOADING">
<#case AppointmentType.APPOINTMENT_TYPE_UNLOADING>
"unloading_appointment" : "true",
"load_appointment" : "false",
<#if appointment.TimeZone?? && appointment.TimeZone!="">

View File

@@ -10,10 +10,10 @@
"payload" :
{
<#include "RPtoRFX_CarrierAppointmentDataUpdated.ftl">
"unloading_appointment" : "${eventRP.appointmentCustomFields.unloading?json_string}",
"load_appointment" : "${eventRP.appointmentCustomFields.loading?json_string}",
"unloading_appointment" : "${eventRP.appointmentCustomFields.unloading!"false"?json_string}",
"load_appointment" : "${eventRP.appointmentCustomFields.loading!"false"?json_string}",
<#switch appointment.AppointmentType>
<#case "APPOINTMENT_TYPE_LOADING">
<#case AppointmentType.APPOINTMENT_TYPE_LOADING>
<#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)}",
@@ -22,7 +22,7 @@
"planned_load_end_datetime": "${DateTimeUTCtoRfxLocale(RfxDateTimetoUTCWithTimezone(appointment.Slot.EndDateTime,time_zone_rfx),time_zone_rfx)}",
</#if>
<#break>
<#case "APPOINTMENT_TYPE_UNLOADING">
<#case AppointmentType.APPOINTMENT_TYPE_UNLOADING>
<#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)}",

View File

@@ -10,7 +10,7 @@
{
<#include "RPtoRFX_CarrierAppointmentDataUpdated.ftl">
<#switch appointment.AppointmentType>
<#case "APPOINTMENT_TYPE_LOADING">
<#case AppointmentType.APPOINTMENT_TYPE_LOADING>
"unloading_appointment" : "false",
"load_appointment" : "true",
<#if appointment.TimeZone?? && appointment.TimeZone!="">
@@ -21,7 +21,7 @@
"planned_load_end_datetime": "${DateTimeUTCtoRfxLocale(RfxDateTimetoUTCWithTimezone(appointment.Slot.EndDateTime,time_zone_rfx),time_zone_rfx)}",
</#if>
<#break>
<#case "APPOINTMENT_TYPE_UNLOADING">
<#case AppointmentType.APPOINTMENT_TYPE_UNLOADING>
"unloading_appointment" : "true",
"load_appointment" : "false",
<#if appointment.TimeZone?? && appointment.TimeZone!="">

View File

@@ -1 +1 @@
2.0.20+4
2.0.21+1