reflex-wms-connector/RFXtoRP_HlrProL.ftl
2025-10-21 16:19:01 +02:00

66 lines
2.3 KiB
Java

<#-- **** 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">
<#case "U">
<#-- *********************************************** Action = CREATE or UPDATE ******************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign preparation_order = JsonUtil.jsonToMap(dataRfx)>
[
<#-- check preparation type code (internal order and reservation are ignored) -->
<#if preparation_order.preparation_type_code == "010" || preparation_order.preparation_type_code == "030">
<#if preparation_order.line_list??>
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowLinesAdded>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HlrProL_ExecutionflowLinesAdded.ftl">
}
<#else>
<#-- No line -->
<#stop>
</#if>
<#else>
<#-- Preparation order type not supported -->
<#stop>
</#if>
]
<#break>
<#case "D">
<#-- *********************************************** Action = DELETE ******************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign preparation_order = JsonUtil.jsonToMap(dataRfx)>
[
<#if preparation_order.preparation_type_code == "010" || preparation_order.preparation_type_code == "030" >
<#if preparation_order.line_list??>
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCancelled>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrPro_ExecutionflowCancelled.ftl">
}
<#else>
<#-- No line -->
<#stop>
</#if>
<#else>
<#-- Preparation order type not supported -->
<#stop>
</#if>
]
<#break>
<#default>
<#stop >
</#switch>