Merge branch 'release/1.2' into 'main-1.2'
Release/1.2 -> Main-1.2 See merge request r-d-technique/tiers/reflex-wms-connector!126
This commit is contained in:
commit
a939e6067e
14
README.md
14
README.md
@ -1,10 +1,20 @@
|
||||
# Reflex Platform Core FTLs
|
||||
|
||||
## Overview
|
||||
|
||||
The **Reflex WMS Connector** is a set of **FreeMarker templates (FTL)** designed to transform **outgoing JSON flows from Reflex WMS** into **flows compatible with Reflex Platform**.
|
||||
|
||||
These FTL core files aim to translate data flow from Reflex WMS into Reflex platform API.
|
||||
This connector does not contain any standalone executable code: it is intended to be used by **Reflex integration engines** or **data exchange pipelines**, where it applies the mapping rules defined in the `.ftl` files.
|
||||
|
||||
## Role of the FTL Files
|
||||
|
||||
- Each `.ftl` file corresponds to a **flow type** (order, stock, receipt, shipment, etc.).
|
||||
- These templates use the **FreeMarker** syntax to:
|
||||
- Extract the required fields from the WMS source flow.
|
||||
- Apply transformation rules (mapping, conversions, enrichments).
|
||||
- Generate a **final structured JSON** for Reflex Platform.
|
||||
|
||||
You can find more info about those files in the Reflex platform documentation center : https://docs.viz.reflex-platform.com/connectivity/partnerapp/reflex-wms-connector/
|
||||
## Useful Resources
|
||||
|
||||
- [FreeMarker Documentation](https://freemarker.apache.org/docs/index.html)
|
||||
- [Reflex Platform](https://auth.reflex-platform.com/)
|
||||
|
||||
31
RFXtoRP_HliPrepaL.ftl
Normal file
31
RFXtoRP_HliPrepaL.ftl
Normal file
@ -0,0 +1,31 @@
|
||||
<#-- **** input parameters ***** -->
|
||||
<#-- input : message RFX -->
|
||||
<#-- project : projectId in ReflexPlatform -->
|
||||
<#-- organisation : organisationtId in ReflexPlatform -->
|
||||
<#include "ReflexUtils.ftl">
|
||||
<#assign cloudEventMsg = JsonUtil.jsonToMap(input)>
|
||||
<#assign projectRP = project>
|
||||
<#assign organisationRP = organisation>
|
||||
<#include "RFX_PartnerAPP_Settings.ftl">
|
||||
|
||||
<#assign aDateTime = .now>
|
||||
|
||||
<#switch cloudEventMsg.action>
|
||||
<#case "C">
|
||||
<#--<#case "U">
|
||||
<#-- *********************************************** Action = CREATE or UPDATE ******************** -->
|
||||
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
|
||||
<#assign preparationOrderLines = JsonUtil.jsonToMap(dataRfx)>
|
||||
<#stop "no generic FTL file available yet for preparationOrderLines">
|
||||
<#break>
|
||||
<#case "D">
|
||||
<#-- *********************************************** Action = DELETE ******************** -->
|
||||
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
|
||||
<#assign preparationOrderLines = JsonUtil.jsonToMap(dataRfx)>
|
||||
<#stop "no generic FTL file available yet for preparationOrderLines">
|
||||
<#break>
|
||||
<#break>
|
||||
|
||||
<#default>
|
||||
<#stop>
|
||||
</#switch>
|
||||
34
RFXtoRP_HliReceiptLr.ftl
Normal file
34
RFXtoRP_HliReceiptLr.ftl
Normal file
@ -0,0 +1,34 @@
|
||||
<#-- **** input parameters ***** -->
|
||||
<#-- input : message RFX -->
|
||||
<#-- project : projectId in ReflexPlatform -->
|
||||
<#-- organisation : organisationtId in ReflexPlatform -->
|
||||
|
||||
<#assign cloudEventMsg = JsonUtil.jsonToMap(input)>
|
||||
<#assign projectRP = project>
|
||||
<#assign organisationRP = organisation>
|
||||
|
||||
<#assign aDateTime = .now>
|
||||
|
||||
<#switch cloudEventMsg.action>
|
||||
<#case "C">
|
||||
<#case "U">
|
||||
<#-- *********************************************** Action = CREATE ******************** -->
|
||||
|
||||
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
|
||||
<#assign receiptLines = JsonUtil.jsonToMap(dataRfx)>
|
||||
|
||||
<#stop "no generic FTL file available yet for receiptLines">
|
||||
<#break>
|
||||
|
||||
<#case "D">
|
||||
<#-- *********************************************** Action = DELETE ******************** -->
|
||||
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
|
||||
<#assign receiptLines = JsonUtil.jsonToMap(dataRfx)>
|
||||
|
||||
<#stop "no generic FTL file available yet for receiptLines">
|
||||
<#break>
|
||||
|
||||
<#default>
|
||||
<#stop >
|
||||
</#switch>
|
||||
|
||||
32
RFXtoRP_HlrProL.ftl
Normal file
32
RFXtoRP_HlrProL.ftl
Normal file
@ -0,0 +1,32 @@
|
||||
<#-- **** input parameters ***** -->
|
||||
<#-- input : message RFX -->
|
||||
<#-- project : projectId in ReflexPlatform -->
|
||||
<#-- organisation : organisationtId in ReflexPlatform -->
|
||||
|
||||
<#assign cloudEventMsg = JsonUtil.jsonToMap(input)>
|
||||
<#assign projectRP = project>
|
||||
<#assign organisationRP = organisation>
|
||||
|
||||
<#assign aDateTime = .now>
|
||||
|
||||
<#switch cloudEventMsg.action>
|
||||
<#case "C">
|
||||
<#case "U">
|
||||
<#-- *********************************************** Action = CREATE or UPDATE ******************** -->
|
||||
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
|
||||
<#assign preparationOrderLines = JsonUtil.jsonToMap(dataRfx)>
|
||||
|
||||
<#stop "no generic FTL file available yet for preparationOrderLines">
|
||||
<#break>
|
||||
|
||||
<#case "D">
|
||||
<#-- *********************************************** Action = DELETE ******************** -->
|
||||
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
|
||||
<#assign preparationOrderLines = JsonUtil.jsonToMap(dataRfx)>
|
||||
|
||||
<#stop "no generic FTL file available yet for preparationOrderLines">
|
||||
<#break>
|
||||
<#default>
|
||||
<#stop >
|
||||
</#switch>
|
||||
|
||||
@ -36,7 +36,8 @@
|
||||
<#stop>
|
||||
</#if>
|
||||
<#else>
|
||||
<#stop "Reference is empty">
|
||||
<#-- "Reference is empty"-->
|
||||
<#stop>
|
||||
</#if>
|
||||
</#if>
|
||||
]
|
||||
|
||||
@ -57,8 +57,8 @@
|
||||
}
|
||||
]
|
||||
<#else>
|
||||
<#-- Case of IPG move type volontarilly ignored-->
|
||||
<#stop " Reference receipt is empty">
|
||||
<#-- Case of IPG move type volontarilly ignored, Reference receipt is empty-->
|
||||
<#stop >
|
||||
</#if>
|
||||
<#else>
|
||||
<#stop>
|
||||
|
||||
@ -29,14 +29,30 @@
|
||||
<#-- Goods received Segmentation Keys inclusion -->
|
||||
<#include "RFXtoRP_HsaIpgMove_GoodsReceived_SegmentationKeys.ftl">
|
||||
},
|
||||
<#if reflexMvtStockInterface.receipt_reference!="">
|
||||
"ExecutionflowID": "${reflexMvtStockInterface.receipt_reference?trim?json_string}",
|
||||
"OrderID": "${reflexMvtStockInterface.receipt_reference?trim?json_string}",
|
||||
<#if reflexMvtStockInterface.ipg_move_type?? & reflexMvtStockInterface.ipg_move_type=="120"> <#-- if it is a transfer-type movement -->
|
||||
<#if reflexMvtStockInterface.origin_order_line_reference?? && reflexMvtStockInterface.origin_order_line_reference!="">
|
||||
"ExecutionflowID": "${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!="">
|
||||
"ExecutionflowID": "${reflexMvtStockInterface.receipt_reference?trim?json_string}",
|
||||
"OrderID": "${reflexMvtStockInterface.receipt_reference?trim?json_string}",
|
||||
</#if>
|
||||
</#if>
|
||||
<#else>
|
||||
"ExecutionflowID": "${reflexMvtStockInterface.physical_depot_code}${reflexMvtStockInterface.activity_code}${reflexMvtStockInterface.ipg_move_year_number}${reflexMvtStockInterface.extended_ipg_move_number}",
|
||||
"OrderID": "${reflexMvtStockInterface.physical_depot_code}${reflexMvtStockInterface.activity_code}${reflexMvtStockInterface.ipg_move_year_number}${reflexMvtStockInterface.extended_ipg_move_number}",
|
||||
<#if reflexMvtStockInterface.receipt_reference?? && reflexMvtStockInterface.receipt_reference!="">
|
||||
"ExecutionflowID": "${reflexMvtStockInterface.receipt_reference?trim?json_string}",
|
||||
"OrderID": "${reflexMvtStockInterface.receipt_reference?trim?json_string}",
|
||||
<#else>
|
||||
"ExecutionflowID": "${reflexMvtStockInterface.physical_depot_code}${reflexMvtStockInterface.activity_code}${reflexMvtStockInterface.ipg_move_year_number}${reflexMvtStockInterface.extended_ipg_move_number}",
|
||||
"OrderID": "${reflexMvtStockInterface.physical_depot_code}${reflexMvtStockInterface.activity_code}${reflexMvtStockInterface.ipg_move_year_number}${reflexMvtStockInterface.extended_ipg_move_number}",
|
||||
</#if>
|
||||
</#if>
|
||||
<#if reflexMvtStockInterface.origin_order_line_number_reference?? && reflexMvtStockInterface.origin_order_line_number_reference!=0>
|
||||
"LineID": "${reflexMvtStockInterface.origin_order_line_number_reference}",
|
||||
<#else>
|
||||
"LineID": "${reflexMvtStockInterface.receipt_line_number}",
|
||||
</#if>
|
||||
"LineID": "${reflexMvtStockInterface.receipt_line_number}",
|
||||
"ActorID": "${RFXtoRPprefixDepot(reflexMvtStockInterface.physical_depot_code?trim?json_string)}",
|
||||
"Quantity": {
|
||||
"LVID": "${quantity_in_base_lv_RP_Cst}",
|
||||
|
||||
@ -17,56 +17,57 @@
|
||||
<#assign preparationStatusInterface = JsonUtil.jsonToMap(dataRfx) />
|
||||
[
|
||||
<#--**Pick batch runned (200) **-->
|
||||
<#if preparationStatusInterface.preparation_order_originator_reference?? && preparationStatusInterface.preparation_order_originator_reference!="">
|
||||
<#if preparationStatusInterface.preparation_status_type == "100" && preparationStatusInterface.preparation_status_code == "200" >
|
||||
<#if preparationStatusInterface.preparation_order_originator_reference?? && preparationStatusInterface.preparation_order_originator_reference!="">
|
||||
<#if preparationStatusInterface.preparation_status_type == "100" && preparationStatusInterface.preparation_status_code == "200" >
|
||||
{
|
||||
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowPreparationExpected>
|
||||
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
||||
"datas" :
|
||||
<#include "RFXtoRP_HsaProStatus_PreparationExpected.ftl">
|
||||
}
|
||||
<#else>
|
||||
<#-- ** Collection started (300) and Preparation in progress (400)** -->
|
||||
<#if preparationStatusInterface.preparation_status_type == "100" && (preparationStatusInterface.preparation_status_code == "300" || preparationStatusInterface.preparation_status_code == "400") >
|
||||
{
|
||||
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowPreparationExpected>
|
||||
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowPreparationStarted>
|
||||
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
||||
"datas" :
|
||||
<#include "RFXtoRP_HsaProStatus_PreparationExpected.ftl">
|
||||
<#include "RFXtoRP_HsaProStatus_PreparationStarted.ftl">
|
||||
}
|
||||
<#else>
|
||||
<#-- ** Collection started (300) and Preparation in progress (400)** -->
|
||||
<#if preparationStatusInterface.preparation_status_type == "100" && (preparationStatusInterface.preparation_status_code == "300" || preparationStatusInterface.preparation_status_code == "400") >
|
||||
{
|
||||
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowPreparationStarted>
|
||||
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
||||
"datas" :
|
||||
<#include "RFXtoRP_HsaProStatus_PreparationStarted.ftl">
|
||||
}
|
||||
<#else>
|
||||
<#-- ****Preparation dispatched (600)** -->
|
||||
<#if preparationStatusInterface.preparation_status_type == "100" && preparationStatusInterface.preparation_status_code == "600" >
|
||||
{
|
||||
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowPreparationCompleted>
|
||||
<#-- ****Preparation dispatched (600)** -->
|
||||
<#if preparationStatusInterface.preparation_status_type == "100" && preparationStatusInterface.preparation_status_code == "600" >
|
||||
{
|
||||
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowPreparationCompleted>
|
||||
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
||||
"datas" :
|
||||
<#include "RFXtoRP_HsaProStatus_PreparationCompleted.ftl">
|
||||
},
|
||||
{
|
||||
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowTransportStarted>
|
||||
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
||||
"datas" :
|
||||
<#include "RFXtoRP_HsaProStatus_PreparationCompleted.ftl">
|
||||
},
|
||||
<#include "RFXtoRP_HsaProStatus_TransportStarted.ftl">
|
||||
}
|
||||
<#else>
|
||||
<#-- ****Preparation cancelled (650)**** -->
|
||||
<#if preparationStatusInterface.preparation_status_type == "100" && preparationStatusInterface.preparation_status_code == "650" >
|
||||
{
|
||||
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowTransportStarted>
|
||||
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
||||
"datas" :
|
||||
<#include "RFXtoRP_HsaProStatus_TransportStarted.ftl">
|
||||
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCancelled>
|
||||
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
||||
"datas" :
|
||||
<#include "RFXtoRP_HsaProStatus_ExecutionflowCancelled.ftl">
|
||||
}
|
||||
<#else>
|
||||
<#-- ****Preparation cancelled (650)**** -->
|
||||
<#if preparationStatusInterface.preparation_status_type == "100" && preparationStatusInterface.preparation_status_code == "650" >
|
||||
{
|
||||
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCancelled>
|
||||
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
||||
"datas" :
|
||||
<#include "RFXtoRP_HsaProStatus_ExecutionflowCancelled.ftl">
|
||||
}
|
||||
<#else>
|
||||
<#stop>
|
||||
</#if>
|
||||
<#stop>
|
||||
</#if>
|
||||
</#if>
|
||||
</#if>
|
||||
<#else>
|
||||
<#stop "PRO reference is empty">
|
||||
</#if>
|
||||
<#else>
|
||||
<#--PRO reference is empty-->
|
||||
<#stop >
|
||||
</#if>
|
||||
]
|
||||
<#break>
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
"ProjectID": "${projectRP}"
|
||||
},
|
||||
"ID": {
|
||||
"RefID": "${preparationStatusInterface.preparation_order_originator_reference?trim?json_string}",
|
||||
"RefID": "${preparationStatusInterface.preparation_order_originator_reference?trim?json_string}",
|
||||
"RefDate": {
|
||||
"DateTime": "${preparation_status_datetime}",
|
||||
"AuthorTimeZone": "${time_zone_rfx}"
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
"ProjectID": "${projectRP}"
|
||||
},
|
||||
"ID": {
|
||||
"RefID": "${preparationStatusInterface.preparation_order_originator_reference?trim?json_string}",
|
||||
"RefID": "${preparationStatusInterface.preparation_order_originator_reference?trim?json_string}",
|
||||
"RefDate": {
|
||||
"DateTime": "${preparation_status_datetime}",
|
||||
"AuthorTimeZone": "${time_zone_rfx}"
|
||||
|
||||
@ -7,10 +7,10 @@
|
||||
"ProjectID": "${projectRP}"
|
||||
},
|
||||
"ID": {
|
||||
"RefID": "${preparationStatusInterface.preparation_order_originator_reference?trim?json_string}",
|
||||
"RefDate": {
|
||||
"DateTime": "${preparation_status_datetime}",
|
||||
"AuthorTimeZone": "${time_zone_rfx}"
|
||||
"RefID": "${preparationStatusInterface.preparation_order_originator_reference?trim?json_string}",
|
||||
"RefDate": {
|
||||
"DateTime": "${preparation_status_datetime}",
|
||||
"AuthorTimeZone": "${time_zone_rfx}"
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@ -7,10 +7,10 @@
|
||||
"ProjectID": "${projectRP}"
|
||||
},
|
||||
"ID": {
|
||||
"RefID": "${preparationStatusInterface.preparation_order_originator_reference?trim?json_string}",
|
||||
"RefDate": {
|
||||
"DateTime": "${preparation_status_datetime}",
|
||||
"AuthorTimeZone": "${time_zone_rfx}"
|
||||
"RefID": "${preparationStatusInterface.preparation_order_originator_reference?trim?json_string}",
|
||||
"RefDate": {
|
||||
"DateTime": "${preparation_status_datetime}",
|
||||
"AuthorTimeZone": "${time_zone_rfx}"
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@ -7,10 +7,10 @@
|
||||
"ProjectID": "${projectRP}"
|
||||
},
|
||||
"ID": {
|
||||
"RefID": "${preparationStatusInterface.preparation_order_originator_reference?trim?json_string}",
|
||||
"RefID": "${preparationStatusInterface.preparation_order_originator_reference?trim?json_string}",
|
||||
"RefDate": {
|
||||
"DateTime": "${preparation_status_datetime}",
|
||||
"AuthorTimeZone": "${time_zone_rfx}"
|
||||
"DateTime": "${preparation_status_datetime}",
|
||||
"AuthorTimeZone": "${time_zone_rfx}"
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
32
RFXtoRP_HsrPackBranch.ftl
Normal file
32
RFXtoRP_HsrPackBranch.ftl
Normal file
@ -0,0 +1,32 @@
|
||||
<#-- **** input parameters ***** -->
|
||||
<#-- input : message RFX -->
|
||||
<#-- project : projectId in ReflexPlatform -->
|
||||
<#-- organisation : organisationtId in ReflexPlatform -->
|
||||
|
||||
<#assign cloudEventMsg = JsonUtil.jsonToMap(input)>
|
||||
<#assign projectRP = project>
|
||||
<#assign organisationRP = organisation>
|
||||
|
||||
<#assign aDateTime = .now>
|
||||
|
||||
<#switch cloudEventMsg.action>
|
||||
<#case "C">
|
||||
<#case "U">
|
||||
<#-- *********************************************** Action = CREATE or UPDATE ******************** -->
|
||||
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
|
||||
<#assign packBranch = JsonUtil.jsonToMap(dataRfx)>
|
||||
|
||||
<#stop "no generic FTL file available yet for Pack Branch">
|
||||
<#break>
|
||||
|
||||
<#case "D">
|
||||
<#-- *********************************************** Action = DELETE ******************** -->
|
||||
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
|
||||
<#assign packBranch = JsonUtil.jsonToMap(dataRfx)>
|
||||
|
||||
<#stop "no generic FTL file available yet for Pack Branch">
|
||||
<#break>
|
||||
<#default>
|
||||
<#stop >
|
||||
</#switch>
|
||||
|
||||
32
RFXtoRP_HsrPackOrder.ftl
Normal file
32
RFXtoRP_HsrPackOrder.ftl
Normal file
@ -0,0 +1,32 @@
|
||||
<#-- **** input parameters ***** -->
|
||||
<#-- input : message RFX -->
|
||||
<#-- project : projectId in ReflexPlatform -->
|
||||
<#-- organisation : organisationtId in ReflexPlatform -->
|
||||
|
||||
<#assign cloudEventMsg = JsonUtil.jsonToMap(input)>
|
||||
<#assign projectRP = project>
|
||||
<#assign organisationRP = organisation>
|
||||
|
||||
<#assign aDateTime = .now>
|
||||
|
||||
<#switch cloudEventMsg.action>
|
||||
<#case "C">
|
||||
<#case "U">
|
||||
<#-- *********************************************** Action = CREATE or UPDATE ******************** -->
|
||||
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
|
||||
<#assign packOrder = JsonUtil.jsonToMap(dataRfx)>
|
||||
|
||||
<#stop "no generic FTL file available yet for Pack Order">
|
||||
<#break>
|
||||
|
||||
<#case "D">
|
||||
<#-- *********************************************** Action = DELETE ******************** -->
|
||||
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
|
||||
<#assign packOrder = JsonUtil.jsonToMap(dataRfx)>
|
||||
|
||||
<#stop "no generic FTL file available yet for Pack Order">
|
||||
<#break>
|
||||
<#default>
|
||||
<#stop >
|
||||
</#switch>
|
||||
|
||||
@ -18,6 +18,7 @@
|
||||
<#assign preparationOrder = JsonUtil.jsonToMap(dataRfx)>
|
||||
|
||||
<#if preparationOrder.total_lv_validated !=0>
|
||||
<#if preparationOrder.preparation_line_lst??>
|
||||
[
|
||||
{
|
||||
<#assign apiReflexPlatformID = ApiReflexPlatformID.HandlingunitGoodsPrepared>
|
||||
@ -95,8 +96,13 @@
|
||||
</#list>
|
||||
<#assign refIDHmap ={}>
|
||||
]
|
||||
<#else>
|
||||
<#-- No line-->
|
||||
<#stop >
|
||||
</#if>
|
||||
<#else>
|
||||
<#stop "no confirmed quantity for the preparation - preparation closed">
|
||||
<#-- no confirmed quantity for the preparation - preparation closed-->
|
||||
<#stop >
|
||||
</#if>
|
||||
|
||||
|
||||
|
||||
@ -4,30 +4,30 @@
|
||||
[
|
||||
<#assign refIDHmap_local ={}>
|
||||
<#list preparationOrder.preparation_line_lst?filter(l ->l.preparation_order_originator_reference!="") as preparation_line>
|
||||
<#assign OrderOriginReference = preparation_line.preparation_order_originator_reference?trim?json_string>
|
||||
<#if !refIDHmap_local[OrderOriginReference]?? >
|
||||
<#if refIDHmap_local?size != 0 >
|
||||
,
|
||||
</#if>
|
||||
<#assign OrderOriginReference = preparation_line.preparation_order_originator_reference?trim?json_string>
|
||||
<#if !refIDHmap_local[OrderOriginReference]?? >
|
||||
<#if refIDHmap_local?size != 0 >
|
||||
,
|
||||
</#if>
|
||||
<#assign refIDHmap_local +={OrderOriginReference,OrderOriginReference}>
|
||||
{
|
||||
{
|
||||
"Header": {
|
||||
"ProjectID": "${projectRP}"
|
||||
},
|
||||
"ID":{
|
||||
"RefID": "${OrderOriginReference}"
|
||||
},
|
||||
"Payload":{
|
||||
"Carrier": {
|
||||
"ActorID": "${RFXtoRPprefixCarrier(preparationOrder.load_data.carrier_code?trim?json_string)}"
|
||||
"Payload":{
|
||||
"Carrier": {
|
||||
"ActorID": "${RFXtoRPprefixCarrier(preparationOrder.load_data.carrier_code?trim?json_string)}"
|
||||
}
|
||||
<#-- Add transport grade code
|
||||
<#if preparationOrder.transport_grade_code!="">
|
||||
,
|
||||
"CarrierService":"${preparationOrder.transport_grade_code?trim?json_string}"
|
||||
</#if> -->
|
||||
}
|
||||
<#-- Add transport grade code
|
||||
<#if preparationOrder.transport_grade_code!="">
|
||||
,
|
||||
"CarrierService":"${preparationOrder.transport_grade_code?trim?json_string}"
|
||||
</#if> -->
|
||||
}
|
||||
}
|
||||
}
|
||||
</#if>
|
||||
</#list>
|
||||
<#assign refIDHmap_local ={}>
|
||||
|
||||
@ -111,9 +111,9 @@
|
||||
|
||||
<#-- Segmentation Keys inclusion -->
|
||||
<#include "RFXtoRP_HsrPrepa_GoodsPrepared_SegmentationKeys.ftl">
|
||||
},
|
||||
"OrderID": "${preparation_line.preparation_order_originator_reference?trim?json_string}",
|
||||
"ExecutionflowID": "${preparation_line.preparation_order_originator_reference?trim?json_string}",
|
||||
},
|
||||
"OrderID": "${preparation_line.preparation_order_originator_reference?trim?json_string}",
|
||||
"ExecutionflowID": "${preparation_line.preparation_order_originator_reference?trim?json_string}",
|
||||
<#if (preparation_line.pro_originator_reference_line_number!0) != 0>
|
||||
"LineID": "${preparation_line.pro_originator_reference_line_number}",
|
||||
<#else>
|
||||
|
||||
@ -5,25 +5,25 @@
|
||||
<#assign refIDHmap_local ={}>
|
||||
<#list preparationOrder.preparation_line_lst?filter(l ->l.preparation_order_originator_reference!="") as preparation_line>
|
||||
<#assign OrderOriginReference = preparation_line.preparation_order_originator_reference?trim?json_string>
|
||||
<#if !refIDHmap_local[OrderOriginReference]?? >
|
||||
<#if !refIDHmap_local[OrderOriginReference]?? >
|
||||
<#if refIDHmap_local?size != 0 >
|
||||
,
|
||||
</#if>
|
||||
<#assign refIDHmap_local +={OrderOriginReference,OrderOriginReference}>
|
||||
{
|
||||
"Header": {
|
||||
"ProjectID": "${projectRP}"
|
||||
},
|
||||
"ID":{
|
||||
"RefID": "${OrderOriginReference}"
|
||||
},
|
||||
"Payload":{
|
||||
"Carrier": {
|
||||
"ActorID": "${RFXtoRPprefixCarrier(preparationOrder.load_data.carrier_code?trim?json_string)}"
|
||||
,
|
||||
</#if>
|
||||
<#assign refIDHmap_local +={OrderOriginReference,OrderOriginReference}>
|
||||
{
|
||||
"Header": {
|
||||
"ProjectID": "${projectRP}"
|
||||
},
|
||||
"ID":{
|
||||
"RefID": "${OrderOriginReference}"
|
||||
},
|
||||
"Payload":{
|
||||
"Carrier": {
|
||||
"ActorID": "${RFXtoRPprefixCarrier(preparationOrder.load_data.carrier_code?trim?json_string)}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</#if>
|
||||
}
|
||||
</#if>
|
||||
</#list>
|
||||
<#assign refIDHmap_local ={}>
|
||||
]
|
||||
@ -16,29 +16,27 @@
|
||||
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
|
||||
<#assign preparation_order = JsonUtil.jsonToMap(dataRfx)>
|
||||
[
|
||||
|
||||
<#if preparation_order.originator_reference?? && preparation_order.originator_reference!="">
|
||||
<#-- check preparation type code (internal order and reservation are ignored) -->
|
||||
<#if preparation_order.preparation_type_code == "010" || preparation_order.preparation_type_code == "030">
|
||||
<#-- Only if preparation order not confirmed -->
|
||||
<#if preparation_order.preparation_order_confirmed == "false" >
|
||||
{
|
||||
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected>
|
||||
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
||||
"datas" :
|
||||
<#include "RFXtoRP_HsrPro_ExecutionflowDetected.ftl">
|
||||
}
|
||||
<#else>
|
||||
<#-- preparation order already confirmed -->
|
||||
<#stop>
|
||||
</#if>
|
||||
|
||||
<#if preparation_order.preparation_type_code?? && (preparation_order.preparation_type_code == "010" || preparation_order.preparation_type_code == "030")>
|
||||
<#if preparation_order.line_list??>
|
||||
{
|
||||
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected>
|
||||
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
||||
"datas" :
|
||||
<#include "RFXtoRP_HsrPro_ExecutionflowDetected.ftl">
|
||||
}
|
||||
<#else>
|
||||
<#-- No line -->
|
||||
<#stop>
|
||||
</#if>
|
||||
<#else>
|
||||
<#-- preparation order type not supported -->
|
||||
<#stop>
|
||||
<#stop>
|
||||
</#if>
|
||||
<#else>
|
||||
<#stop "PRO reference is empty">
|
||||
<#-- PRO reference is empty -->
|
||||
<#stop>
|
||||
</#if>
|
||||
]
|
||||
<#break>
|
||||
@ -49,14 +47,20 @@
|
||||
<#assign preparation_order = JsonUtil.jsonToMap(dataRfx)>
|
||||
[
|
||||
<#if preparation_order.originator_reference?? && preparation_order.originator_reference!="">
|
||||
{
|
||||
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCancelled>
|
||||
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
||||
"datas" :
|
||||
<#include "RFXtoRP_HsrPro_ExecutionflowCancelled.ftl">
|
||||
}
|
||||
<#if preparation_order.line_list??>
|
||||
{
|
||||
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCancelled>
|
||||
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
||||
"datas" :
|
||||
<#include "RFXtoRP_HsrPro_ExecutionflowCancelled.ftl">
|
||||
}
|
||||
<#else>
|
||||
<#-- No line -->
|
||||
<#stop>
|
||||
</#if>
|
||||
<#else>
|
||||
<#stop "PRO reference is empty">
|
||||
<#-- PRO reference is empty -->
|
||||
<#stop>
|
||||
</#if>
|
||||
]
|
||||
<#break>
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
"ProjectID": "${projectRP}"
|
||||
},
|
||||
"ID": {
|
||||
"RefID": "${preparation_order.originator_reference?trim?json_string}",
|
||||
"RefID": "${preparation_order.originator_reference?trim?json_string}",
|
||||
"RefDate": {
|
||||
"DateTime": "${pro_creation_datetime}",
|
||||
"AuthorTimeZone": "${time_zone_rfx}"
|
||||
@ -78,7 +78,7 @@
|
||||
}
|
||||
</#if>
|
||||
},
|
||||
|
||||
"OrderID": "${preparation_order.originator_reference?trim?json_string}",
|
||||
<#if preparation_order.line_list??>
|
||||
"Lines" : [
|
||||
<#list preparation_order.line_list as preparation_order_line >
|
||||
|
||||
@ -17,8 +17,9 @@
|
||||
<#assign receipt = JsonUtil.jsonToMap(dataRfx)>
|
||||
<#if receipt.receipt_reference ?? && receipt.receipt_reference!="">
|
||||
<#if receipt.receipt_type == "030">
|
||||
<#stop "ignored message because receipt type = transfert">
|
||||
<#stop "ignored message because receipt type = transfert">
|
||||
<#else>
|
||||
<#if receipt.line_list ??>
|
||||
[
|
||||
{
|
||||
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected>
|
||||
@ -35,10 +36,15 @@
|
||||
|
||||
}
|
||||
]
|
||||
</#if>
|
||||
<#else>
|
||||
<#stop "Receipt reference is empty">
|
||||
<#else>
|
||||
<#-- No line-->
|
||||
<#stop>
|
||||
</#if>
|
||||
</#if>
|
||||
<#else>
|
||||
<#-- "Receipt reference is empty"-->
|
||||
<#stop>
|
||||
</#if>
|
||||
<#break>
|
||||
<#case "U">
|
||||
<#-- *********************************************** Action = UPDATE ******************** -->
|
||||
@ -65,23 +71,29 @@
|
||||
<#if receipt.receipt_type == "030">
|
||||
<#stop "ignored message because receipt type = transfert">
|
||||
<#else>
|
||||
{
|
||||
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected>
|
||||
<#if receipt.line_list ??>
|
||||
{
|
||||
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected>
|
||||
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
||||
"datas" :
|
||||
<#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl">
|
||||
},
|
||||
{
|
||||
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowReceiptExpected>
|
||||
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
||||
"datas" :
|
||||
<#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl">
|
||||
},
|
||||
{
|
||||
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowReceiptExpected>
|
||||
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
||||
"datas" :
|
||||
<#include "RFXtoRP_HsrReceiptList_ReceiptExpected.ftl">
|
||||
}
|
||||
<#include "RFXtoRP_HsrReceiptList_ReceiptExpected.ftl">
|
||||
}
|
||||
<#else>
|
||||
<#-- No line-->
|
||||
<#stop>
|
||||
</#if>
|
||||
</#if>
|
||||
</#if>
|
||||
</#if>
|
||||
<#else>
|
||||
<#stop "Receipt reference is empty">
|
||||
<#-- Receipt reference is empty-->
|
||||
<#stop >
|
||||
</#if>
|
||||
]
|
||||
<#break>
|
||||
@ -92,15 +104,21 @@
|
||||
<#assign receipt = JsonUtil.jsonToMap(dataRfx)>
|
||||
[
|
||||
<#if receipt.receipt_reference?? && receipt.receipt_reference!="">
|
||||
{
|
||||
<#if receipt.line_list ??>
|
||||
{
|
||||
|
||||
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCancelled>
|
||||
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
||||
"datas" :
|
||||
<#include "RFXtoRP_HsrReceiptList_ExecutionflowCancelled.ftl">
|
||||
}
|
||||
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCancelled>
|
||||
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
||||
"datas" :
|
||||
<#include "RFXtoRP_HsrReceiptList_ExecutionflowCancelled.ftl">
|
||||
}
|
||||
<#else>
|
||||
<#-- No line-->
|
||||
<#stop>
|
||||
</#if>
|
||||
<#else>
|
||||
<#stop "Receipt reference is empty">
|
||||
<#-- Receipt reference is empty-->
|
||||
<#stop >
|
||||
</#if>
|
||||
]
|
||||
<#break>
|
||||
|
||||
@ -1,20 +1,46 @@
|
||||
<#include "HfRpConfig.ftl">
|
||||
<#include "ReflexUtils.ftl">
|
||||
<#assign receipt_status_datetime = RfxDateTimetoUTCWithTimezone(receipt.modification_datetime,time_zone_rfx) />
|
||||
|
||||
<#assign refIDHmap_local ={}>
|
||||
[
|
||||
{
|
||||
"Header": {
|
||||
"ProjectID": "${projectRP}"
|
||||
},
|
||||
"ID": {
|
||||
"RefID": "${receipt.receipt_reference?trim?json_string}",
|
||||
"RefDate": {
|
||||
"DateTime": "${receipt_status_datetime}",
|
||||
"AuthorTimeZone": "${time_zone_rfx}"
|
||||
}
|
||||
},
|
||||
"Payload": {
|
||||
}
|
||||
}
|
||||
<#if receipt.line_list??>
|
||||
<#list receipt.line_list as receipt_line >
|
||||
<#if receipt_line.origin_order_line_reference!="">
|
||||
<#if !refIDHmap_local[receipt_line.origin_order_line_reference]?? >
|
||||
<#if refIDHmap_local?size != 0 >
|
||||
,
|
||||
</#if>
|
||||
<#assign refIDHmap_local +={receipt_line.origin_order_line_reference,receipt_line.origin_order_line_reference}>
|
||||
{
|
||||
"Header": {"ProjectID": "${projectRP}"},
|
||||
"ID": {
|
||||
"RefID": "${receipt_line.origin_order_line_reference?trim?json_string}",
|
||||
"RefDate": {
|
||||
"DateTime": "${receipt_status_datetime}",
|
||||
"AuthorTimeZone": "${time_zone_rfx}"
|
||||
}
|
||||
},
|
||||
"Payload": {
|
||||
}
|
||||
}
|
||||
</#if>
|
||||
<#else>
|
||||
<#if receipt.receipt_reference?? && receipt.receipt_reference!="">
|
||||
{
|
||||
"Header": {"ProjectID": "${projectRP}"},
|
||||
"ID": {
|
||||
"RefID": "${receipt.receipt_reference?trim?json_string}",
|
||||
"RefDate": {
|
||||
"DateTime": "${receipt_status_datetime}",
|
||||
"AuthorTimeZone": "${time_zone_rfx}"
|
||||
}
|
||||
},
|
||||
"Payload": {
|
||||
}
|
||||
}
|
||||
<#break>
|
||||
</#if>
|
||||
</#if>
|
||||
</#list>
|
||||
</#if>
|
||||
]
|
||||
|
||||
@ -44,7 +44,7 @@
|
||||
"ActorID":"${RFXtoRPprefixCarrier(receipt.carrier_informations.carrier_code?trim?json_string)}"
|
||||
},
|
||||
</#if>
|
||||
|
||||
"OrderID": "${receipt.receipt_reference?trim?json_string}",
|
||||
<#if receipt.line_list??>
|
||||
"Lines" : [
|
||||
<#list receipt.line_list as line>
|
||||
|
||||
@ -1,19 +1,46 @@
|
||||
<#include "HfRpConfig.ftl">
|
||||
<#include "ReflexUtils.ftl">
|
||||
<#assign receipt_status_datetime = RfxDateTimetoUTCWithTimezone(receipt.confirmation_datetime,time_zone_rfx) />
|
||||
<#assign receipt_status_datetime = RfxDateTimetoUTCWithTimezone(receipt.modification_datetime,time_zone_rfx) />
|
||||
<#assign refIDHmap_local ={}>
|
||||
[
|
||||
{
|
||||
"Header": {
|
||||
"ProjectID": "${projectRP}"
|
||||
},
|
||||
"ID": {
|
||||
"RefID": "${receipt.receipt_reference?trim?json_string}",
|
||||
"RefDate": {
|
||||
"DateTime": "${receipt_status_datetime}",
|
||||
"AuthorTimeZone": "${time_zone_rfx}"
|
||||
}
|
||||
},
|
||||
"Payload": {
|
||||
}
|
||||
}
|
||||
<#if receipt.line_list??>
|
||||
<#list receipt.line_list as receipt_line >
|
||||
<#if receipt_line.origin_order_line_reference!="">
|
||||
<#if !refIDHmap_local[receipt_line.origin_order_line_reference]?? >
|
||||
<#if refIDHmap_local?size != 0 >
|
||||
,
|
||||
</#if>
|
||||
<#assign refIDHmap_local +={receipt_line.origin_order_line_reference,receipt_line.origin_order_line_reference}>
|
||||
{
|
||||
"Header": {"ProjectID": "${projectRP}"},
|
||||
"ID": {
|
||||
"RefID": "${receipt_line.origin_order_line_reference?trim?json_string}",
|
||||
"RefDate": {
|
||||
"DateTime": "${receipt_status_datetime}",
|
||||
"AuthorTimeZone": "${time_zone_rfx}"
|
||||
}
|
||||
},
|
||||
"Payload": {
|
||||
}
|
||||
}
|
||||
</#if>
|
||||
<#else>
|
||||
<#if receipt.receipt_reference?? && receipt.receipt_reference!="">
|
||||
{
|
||||
"Header": {"ProjectID": "${projectRP}"},
|
||||
"ID": {
|
||||
"RefID": "${receipt.receipt_reference?trim?json_string}",
|
||||
"RefDate": {
|
||||
"DateTime": "${receipt_status_datetime}",
|
||||
"AuthorTimeZone": "${time_zone_rfx}"
|
||||
}
|
||||
},
|
||||
"Payload": {
|
||||
}
|
||||
}
|
||||
<#break>
|
||||
</#if>
|
||||
</#if>
|
||||
</#list>
|
||||
</#if>
|
||||
]
|
||||
|
||||
@ -1,21 +1,46 @@
|
||||
<#include "HfRpConfig.ftl">
|
||||
<#include "ReflexUtils.ftl">
|
||||
<#assign receipt_status_datetime = RfxDateTimetoUTCWithTimezone(receipt.creation_datetime,time_zone_rfx) />
|
||||
|
||||
<#assign receipt_status_datetime = RfxDateTimetoUTCWithTimezone(receipt.modification_datetime,time_zone_rfx) />
|
||||
<#assign refIDHmap_local ={}>
|
||||
[
|
||||
{
|
||||
"Header": {
|
||||
"ProjectID": "${projectRP}"
|
||||
},
|
||||
"ID": {
|
||||
"RefID": "${receipt.receipt_reference?trim?json_string}",
|
||||
"RefDate": {
|
||||
"DateTime": "${receipt_status_datetime}",
|
||||
"AuthorTimeZone": "${time_zone_rfx}"
|
||||
}
|
||||
},
|
||||
|
||||
"Payload": {}
|
||||
|
||||
}
|
||||
<#if receipt.line_list??>
|
||||
<#list receipt.line_list as receipt_line >
|
||||
<#if receipt_line.origin_order_line_reference!="">
|
||||
<#if !refIDHmap_local[receipt_line.origin_order_line_reference]?? >
|
||||
<#if refIDHmap_local?size != 0 >
|
||||
,
|
||||
</#if>
|
||||
<#assign refIDHmap_local +={receipt_line.origin_order_line_reference,receipt_line.origin_order_line_reference}>
|
||||
{
|
||||
"Header": {"ProjectID": "${projectRP}"},
|
||||
"ID": {
|
||||
"RefID": "${receipt_line.origin_order_line_reference?trim?json_string}",
|
||||
"RefDate": {
|
||||
"DateTime": "${receipt_status_datetime}",
|
||||
"AuthorTimeZone": "${time_zone_rfx}"
|
||||
}
|
||||
},
|
||||
"Payload": {
|
||||
}
|
||||
}
|
||||
</#if>
|
||||
<#else>
|
||||
<#if receipt.receipt_reference?? && receipt.receipt_reference!="">
|
||||
{
|
||||
"Header": {"ProjectID": "${projectRP}"},
|
||||
"ID": {
|
||||
"RefID": "${receipt.receipt_reference?trim?json_string}",
|
||||
"RefDate": {
|
||||
"DateTime": "${receipt_status_datetime}",
|
||||
"AuthorTimeZone": "${time_zone_rfx}"
|
||||
}
|
||||
},
|
||||
"Payload": {
|
||||
}
|
||||
}
|
||||
<#break>
|
||||
</#if>
|
||||
</#if>
|
||||
</#list>
|
||||
</#if>
|
||||
]
|
||||
|
||||
@ -105,13 +105,6 @@
|
||||
"batch_1": "${batch_1?json_string}",
|
||||
"base_lv_quantity": "true",
|
||||
"any_lv": "false"
|
||||
<#--
|
||||
"stock_reservation": "false",
|
||||
"forced_priority_date_min_lead_time": "false",
|
||||
"temp_substitution_possible": "false",
|
||||
"substitution_possible": "false"
|
||||
-->
|
||||
|
||||
}
|
||||
<#sep>,</#sep>
|
||||
</#list>
|
||||
|
||||
@ -57,15 +57,9 @@
|
||||
"grade_code": "${grade_code}",
|
||||
"batch_1": "${batch_1?json_string!""}",
|
||||
"optional_attributes": {
|
||||
<#--"held_for_check": "false",
|
||||
"hold_code": "false", -->
|
||||
"hold_for_specific_code": "false"
|
||||
<#include "RPtoRFX_Receipt_OptionalAttributes.ftl">
|
||||
"hold_for_specific_code": "false"
|
||||
}
|
||||
<#--"quality_control_attributes": {
|
||||
"qcf_to_create_for_receipt_line": "false",
|
||||
"exclude_item_from_inspection": "false"
|
||||
} -->
|
||||
|
||||
}<#sep>,</#sep>
|
||||
</#list>
|
||||
]
|
||||
|
||||
16
RPtoRFX_Receipt_OptionalAttributes.ftl
Normal file
16
RPtoRFX_Receipt_OptionalAttributes.ftl
Normal file
@ -0,0 +1,16 @@
|
||||
<#-- Here are the fields that can be added
|
||||
"batch_2": "string",
|
||||
"batch_3": "string",
|
||||
"anticipated_receipt_line_activity_code": "str",
|
||||
"anticipated_receipt_line_physical_depot_code": "str",
|
||||
"anticipated_receipt_line_originator_code": "string",
|
||||
"anticipated_receipt_reference": "string",
|
||||
"anticipated_receipt_planned_date": "0000-00-00",
|
||||
"anticipated_receipt_reference_line_no": 999999,
|
||||
"reservation_consignee_code": "string",
|
||||
"reservation_consignee_group_code": "string",
|
||||
"pro_reservation_reference": "string",
|
||||
"held_for_check": "false",
|
||||
"held_for_repacking": "false",
|
||||
"hold_code": "str"
|
||||
-->
|
||||
Loading…
x
Reference in New Issue
Block a user